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;n0&&t[0].al()>0?t[0].bt():e?e.max.x:void 0}getXMin(t=[],e){return void 0!==e?e?e.min.x:void 0:t.length>0?t[t.length-1].xt():void 0}setPrecision(t){return this.set("_columnPackaging",Cr(rc(t)))}},verticalProgressive:new class extends dc{constructor(){super({wl:Rr()}),this.Wi="VerticalProgressivePattern"}nw(t,e){const i=t.length,s=Math.min(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1]._t():void 0}getYMin(t=[],e){return t.length>0&&t[0].al()>0?t[0].Mt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",Rr(rc(t)))}},verticalRegressive:new class extends dc{constructor(){super({wl:Ir()}),this.Wi="VerticalRegressivePattern"}nw(t,e){const i=t.length,s=Math.max(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0&&t[0].al()>0?t[0]._t():e?e.max.y:void 0}getYMin(t=[],e){return void 0!==e?e?e.min.y:void 0:t.length>0?t[t.length-1].Mt():void 0}setPrecision(t){return this.set("_columnPackaging",Ir(rc(t)))}},freeform:new sc};class gc extends Qu{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g,y){super(t,e,i,s,r,n,o,h,fc.horizontalProgressive,a,c,d,f,g,y),this.Ms="Step Series",this.Ew=t=>{const e=this.JM.length>0?this.JM[this.JM.length-1].il().length+this.JM[this.JM.length-1].tl().length:void 0;pu(t,e,this.h_,this.$w)},this.$w=t=>{const e=t.length;if(this.JM.length>0){const i=this.JM[this.JM.length-1];if(e>0){const e=i.il(),s=i.tl(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Ku([r].concat(t),this.Xw);n.shift();const o=u((r.x+n[0].x)/2,(r.y+n[0].y)/2),h=Array.prototype.concat(o,n);(s.length>0?e.length+s.length:e.length)>=this.h_?(i.ol(o,m(u(o.x,o.y),u(o.x,o.y))).Vl(!0),this.zw(h).El(!0),this.Ow(t)):i.ol(h)}}else e>0&&this.zw(Ku(t,this.Xw));this.Vw(t)},this.Xw=l,void 0===this.Ww.find((t=>"DataPattern"===t.type))&&this.Ww.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class mc extends yu{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Ms="OHLC Series",this.jw=t=>t[4]>=t[1],this.d_=m(c(Le,Le),c(Ve,Ve)),this.Zw=[],this.Qw=!1,this.Jw=-1,this.Kw=[],this.qw=!0,this.tC=!1,this.iC=4,this.Om=(t,e,i)=>(t.addRow(e.getName()).addRow("Time","",e.axisX.formatValue(i.position)).addRow("Open","",i.open.toFixed(3)).addRow("High","",i.high.toFixed(3)).addRow("Low","",i.low.toFixed(3)).addRow("Close","",i.close.toFixed(3)),t),this.sC=[1e-7,1e-6,1e-5,1e-4,.001,.01,.1,1,5,10,30,60,300,600,1800,3600,7200,14400,28800,36e3,43200,50400,57600,64800,72e3,86400,172800,259200,345600,432e3,604800,1209600,2592e3,7776e3,10368e3,15552e3,31536e3,15768e4,31536e4,63072e4,7884e5,15768e5,31536e5,3942e6,47304e5,63072e5,7884e6,15768e6,31536e6,3942e7,47304e6,63072e6,7884e7,15768e7,31536e7,63072e7,7884e8,15768e8,31536e8,47304e8,63072e8],this.Ki.cs.Gn(ah.nf)}n_(){return this.Kw}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)}qy(){return this.iS&&this.Kw.length>0&&this.getVisible()}eC(t){if(!(this.Kw.length<1))return[this.Kw[t][0],this.Kw[t][1],this.Kw[t][2],this.Kw[t][3],this.Kw[t][4]]}$c(t){if(0===this.Kw.length)return;const e=dt(t,this.Ts.cs.ft,this.scale).x,i=void 0!==this.getPackDataState();let s,r,n,o,h;if(i){const t=this.hC;if(!t)return;const i=ke(e,t.length-1,(e=>t[e][0])),a=void 0!==i&&t[i];if(!a)return;o=a[3],n=a[2],r=a[1],h=a[4],s=a[0]}else{const t=ke(e,this.Kw.length-1,(t=>this.Kw[t][0])),i=void 0!==t&&this.Kw[t];if(!i)return;s=i[0],r=i[1],n=i[2],o=i[3],h=i[4]}const a={position:s,open:r,high:n,low:o,close:h,isPacked:i};return{location:u(a.position,a.close),scale:this.scale,resultTableContent:this.Om(new la,this,a).Qu(),owner:this,isPacked:i,position:s,open:r,high:n,low:o,close:h}}UM(t){if(!(t.x instanceof Di))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.rC=t.x}Mr(){return u(5,5)}H_(t){const e=t.length-1;if(e<0)return this;for(let i=0;i<=e;i+=1)t[i][3]0&&this.Ki.cs.Gn(ah.xf);const e=Array.isArray(t[0])?t:[t[0]];if(e.length>0){this.Qw=!0;const t=this.Kw.length,i=this.Zw.length,s=e.length;this.Kw.length=t+s,this.Zw.length=i+s;for(let r=0;rthis.sC[t]));return void 0===i?i=e=1){for(let e=0;e=1&&(t!==this.Jw||this.Qw||this.tC)){this.tC=!1,this.Jw=t,this.Qw=!1,this.oC(),this.hC=[];const e=this.Kw.length;let i=this.Kw[0][0]-this.Kw[0][0]%(t/2)+t,s=0;for(;s({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...Ka(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Mr().x))}),Ac=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...Ka(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Mr().y))});class vc extends vu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f){super(t,e,i,s,r,n,o,h,a,l,u),this.JM=[],this.Ms="Line Series",this.Rb=!0,this.h_=void 0,this.Bw="nearest-x",this.Su=void 0,this.Wd=()=>ue(this.uu.getFillStyle()),this.FC=(t,e)=>{const i=t.Yb(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.Ww=c,this.Yn=f,this.uu=fe(this.ts.lineSeriesStrokeStyle,d),this.IC={individualLookupValuesEnabled:void 0!==(null==f?void 0:f.individualLookupValuesEnabled)&&f.individualLookupValuesEnabled}}add(t){return super.add(t),this}setMouseInteractions(t){return super.setMouseInteractions(t)}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;for(let t=0;tt.vu(this.Su))),this.Ts.vs(),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.Ts.vs(),this}getCursorSolveBasis(){return this.Bw}UM(t){}r_(t){let e=this.JM[0];e||(e=this.zw(),this.JM.push(e),this.fs(e)),e.ol(t,this.s_)}zw(){return this.Ts.sy(this.scale,this.IC,[za.UserSeries,...this.Ww]).Ee(this.uu).vu(this.Su).qa(Vr(this.Bw)).ds(this.getHighlight())}attach(t,e=!0,i=!1){return le(t,this.ts,i,{stroke:this.uu}),super.attach(t,e,i)}Pe(t,e){t.ds(e),this.Ts.vs()}e_(t,e,i,s){}$c(t,e,i=this.Rb){const s=bu(t,e?this.JM.filter((t=>t.getIsUnderMouse())):this.JM,i?this.Gw:this.FC,"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].cu();return Ta(t,this.scale,this.Om(new la,this,t.x,t.y,t).Qu(),this,e.getFillStyle())}}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}}class bc extends vu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,new sc,l,u),this.JM=[],this.Ms="Point series",this.$b=5,this.ga=0,this.Wa=!1,this.Ua=!1,this.Ya=!1,this.h_=void 0,this.Nw=(t,e)=>{const i=t.$c(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Yn=d,this.Xb=a,this.be=fe(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}Wd(){return ue(this.be)}ks(){return this.bs||this.Xb}UM(t){}attach(t,e=!0,i=!1){return le(t,this.ts,i,{fill:this.be}),super.attach(t,e)}Pe(t,e){t.ds(e),this.Ts.vs()}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(let t=0;tt.getIsUnderMouse())):this.JM,this.Nw,Xe);if(void 0!==i){const t=dt(i[0],this.Ts.cs.ft,this.scale),e=i[1].zh(),s=X(e)?i[0].color?new G({color:i[0].color}):new G({color:e.getFallbackColor()}):e;return Ta(t,this.scale,this.Om(new la,this,t.x,t.y,t).Qu(),this,s)}}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}setCursorResultTableFormatter(t){return super.setCursorResultTableFormatter(t)}}class Mc{constructor(t,e,i,s){this.PC=!1,this.L=new r.Eventer,this.chart=i,this.DC=s,this.Xs=t.Xs,this.te=s||Ls,this.BC=bt.document.createElement("div"),this.BC.style.position="absolute",this.BC.style.pointerEvents="none",bt.document.body.append(this.BC);const n=()=>{const t=i.engine.container.getBoundingClientRect();this.BC.style.left=`${t.left}px`,this.BC.style.top=`${t.top}px`,this.BC.style.width=`${t.width}px`,this.BC.style.height=`${t.height}px`};n(),i.onResize(n),this.LC(this.BC),this.RC(),this.EC(),this.zC(),this.VC(e),this.chart.OC().push(this)}LC(t){this.NC=bt.document.createElement("div"),this.NC.style.pointerEvents="all",t.append(this.NC),this.GC=bt.document.createElement("div"),this.WC=new Es(this.Xs,this.te,this.chart,this.GC),this.UC=bt.document.createElement("table"),this.UC.style.borderSpacing="0",this.NC.appendChild(this.WC.ae()),this.NC.appendChild(this.GC),this.GC.appendChild(this.UC)}EC(){let t=0,e=0,i=0,s=0,r=!1;this.PC=!1,this.NC.onmousedown=n=>{n=n||bt.event,i=n.clientX,s=n.clientY,r=!0,bt.document.onmouseup=t=>{this.PC?this.NC.addEventListener("click",Zt,!0):this.NC.removeEventListener("click",Zt,!0),r=!1,this.PC=!1,bt.document.onmouseup=null,bt.document.onmousemove=null},bt.document.onmousemove=n=>{n=n||bt.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.PC=!0,this.NC.style.top=this.NC.offsetTop-e+"px",this.NC.style.left=this.NC.offsetLeft-t+"px",this.NC.style.removeProperty("right"),this.NC.style.removeProperty("bottom"))}}}zC(){let t=0,e=0,i=0,s=0,r=!1;this.NC.ontouchstart=n=>{n=n||bt.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.NC.ontouchend=()=>{r=!1,bt.document.ontouchend=null,bt.document.ontouchmove=null},this.NC.ontouchmove=n=>{r&&(Zt(n),n=n||bt.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.NC.style.top=this.NC.offsetTop-e+"px",this.NC.style.left=this.NC.offsetLeft-t+"px",this.NC.style.removeProperty("right"),this.NC.style.removeProperty("bottom"))}}}RC(){this.NC.style.setProperty("top","10px"),this.NC.style.setProperty("left","10px"),this.NC.style.position="absolute",this.NC.style.display="flex",this.NC.style.alignItems="flex-start",this.GC.style.setProperty("display","none")}removePositionProperty(){this.NC.style.removeProperty("top"),this.NC.style.removeProperty("left"),this.NC.style.removeProperty("bottom"),this.NC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.NC.style.setProperty("bottom","10px"),this.NC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.NC.style.setProperty("top","10px"),this.NC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.NC.style.setProperty("bottom","10px"),this.NC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.NC.style.setProperty("top","10px"),this.NC.style.setProperty("right","10px")}}VC(t){for(let e=0;e[t.Xc((()=>{this.$C+=1,this.$C>1&&this.Ki.cs.Gn(ah.xf),this.Ki.cs.vs()})),t.jc((()=>this.Ki.cs.vs()))])),this.Ga.ld(t),this.chart.cs.vs()),this}getDataSet(){return this.ZC()}setStrokeStyle(t){return this.Ga.Ee(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.cu()}setAreaFillStyle(t){return this.Ga.dd(t),this.Ts.vs(),this}getAreaFillStyle(){return this.Ga.QC()}setPointFillStyle(t){return this.Ga.ud(t),this.Ts.vs(),this}getPointFillStyle(){return this.Ga.yd()}setPointSize(t){return this.Ga.Sd(t),this.Ts.vs(),this}getPointSize(){return this.Ga.JC()}setPointShape(t){return this.Ga.Ad(t),this.Ts.vs(),this}getPointShape(){return this.Ga.gd()}setPointRotation(t){return this.Ga.pd(t),this.Ts.vs(),this}getPointRotation(){return this.Ga.md()}setPointAlignment(t){return this.Ga.KC(t),this.Ki.cs.vs(),this}getPointAlignment(){return this.Ga.qC()}setCurvePreprocessing(t){return this.Ga.XC(t),this.Ts.vs(),this}getCurvePreprocessing(){return this.Ga.tk()}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}add(t){return this.ZC().add(t),this.Ts.vs(),this}addArraysXY(t,e){return this.ZC().addArraysXY(t,e),this.Ts.vs(),this}appendJSON(t,e){return this.ZC().appendJSON(t,e),this.Ts.vs(),this}appendSample(t){return this.ZC().appendSample(t),this.Ts.vs(),this}appendSamples(t){return this.ZC().appendSamples(t),this.Ts.vs(),this}fill(t){return this.ZC().fill(t),this.Ts.vs(),this}setSamples(t){return this.ZC().setSamples(t),this.Ts.vs(),this}alterSamples(t,e){return this.ZC().alterSamples(t,e),this.Ts.vs(),this}alterSamplesByID(t,e){return this.ZC().alterSamplesByID(t,e),this.Ts.vs(),this}getSampleCount(){return this.ZC().getSampleCount()}getNextSampleIndex(){return this.ZC().getNextSampleIndex()}clear(){return this.ZC().clear(),this.Ts.vs(),this}setMaxSampleCount(t){return this.ZC().setMaxSampleCount(t),this.Ts.vs(),this}getMaxSampleCount(){return this.ZC().getMaxSampleCount()}readBack(t){return this.ZC().readBack(t)}onMaxSampleCountExceeded(t){return this.ZC().onMaxSampleCountExceeded(t)}offMaxSampleCountExceeded(t){return this.ZC().offMaxSampleCountExceeded(t)}ik(){return this.ZC()}Wd(){return ue(this.getPointFillStyle())||ue(this.getStrokeStyle().getFillStyle())||ue(this.getAreaFillStyle())}qy(){var t;const e=null===(t=this.ad)||void 0===t?void 0:t.Ut;return this.getAutoScrollingEnabled()&&void 0!==e&&e.cc>0}UM(t){}getXMax(){return this.Ga.bt()}getXMin(){return this.Ga.xt()}getYMax(){return this.Ga._t()}getYMin(){return this.Ga.Mt()}Mr(){return{x:this.Ga.xl(),y:this.Ga.bl()}}ZC(){if(!this.ad){const t=new no(this.Yn);t.Sc&&this.Ki.cs.Gn(ah.Mf),t.xc&&this.Ki.cs.Gn(ah.bf),this.ad=Fe(t,this.ad,(()=>[t.Xc((()=>{this.$C+=1,this.$C>1&&this.Ki.cs.Gn(ah.xf),this.Ki.cs.vs()})),t.jc((()=>{this.Ki.cs.vs()}))])),this.Ga.ld(t)}return this.ad.Ut}attach(t,e=!0,i=!1){super.attach(t,e,i);const s=this.getPointFillStyle(),r=this.getAreaFillStyle();return le(t,this.ts,i,{stroke:this.getStrokeStyle(),fill:s!==z?s:r}),super.attach(t,e)}ks(){return this.bs||this.getPointShape()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e,i=this.Rb){void 0!==this.getCurvePreprocessing()&&(i=!1);const s=this.ik(),r=dt(t,this.Ki.cs.ft,this.scale),n=!e||this.Ga.getIsUnderMouse()?s.$c(r,i,this.scale,this.Ki.pixelScale):void 0;if(void 0!==n){const t=[this.getStrokeStyle().getFillStyle(),this.getPointFillStyle(),this.getAreaFillStyle()];return Ta(n,this.scale,this.Om(new la,this,n).Qu(),this,t.filter((t=>!N(t)))[0])}}solveNearestFromScreen(t,e=!1){return this.$c(rh(t,this.Ki.cs),!1,e)}}const Tc=(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)),void 0!==i.lookupValue&&t.addRow("Value","",i.lookupValue.toFixed(1)),t},wc=(...t)=>(e,i)=>t.forEach((t=>t.forEach((t=>{t.axis.ft.tt(e),t.axis.ng.tt(i)})))),kc=u(10,10);var Cc;e.AxisPosition=void 0,(Cc=e.AxisPosition||(e.AxisPosition={}))[Cc.Top=0]="Top",Cc[Cc.Bottom=1]="Bottom",Cc[Cc.Left=2]="Left",Cc[Cc.Right=3]="Right";const Rc=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),Ic=t=>t.setStopped(!0),Fc=t=>t.getChartInteractionFitByDrag()?t.fit(!0):void 0,Dc=(t,e)=>{const i="linear-highPrecision"===t.Th.type||"linear-highPrecision"===e.Th.type,s="logarithmic"===t.Th.type||"logarithmic"===e.Th.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.Th.type}, y: ${e.Th.type})`;throw new Error(i)}};var Lc,Vc,_c;!function(t){t[t.seriesBackground=0]="seriesBackground",t[t.gridLine0=1]="gridLine0",t[t.gridLine1=2]="gridLine1",t[t.gridLine2=3]="gridLine2",t[t.highlightersBelow=4]="highlightersBelow"}(Lc||(Lc={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(Vc||(Vc={}));class Pc extends al{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("chartXY bg",0),r,i.cs.ts.chartXYBackgroundFillStyle,i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.chartXYTitleFont,i.cs.ts.chartXYTitleFillStyle,h),this.sk=this.ep.d2({scaleXYConstructor:_i}),this.Og=[],this.Ng=[],this.Wg=[],this.Gg=[],this.ek=new Map,this.hk=!0,this.rk=!0,this.nk=!0,this.Ef=2,this.ak=!0,this.lk=!0,this.uk=[],this.ck=this.vp.Te(this.sk).ke(z).Ce(ot).setMouseInteractions(!1),this.dk=this.vp.ze(this.sk).Ee(ot).setMouseInteractions(!1),this.fk=this.vp.ze(this.sk).Ee(ot).setMouseInteractions(!1),this.Ak=this.ts.chartXYZoomingRectangleFillStyle,this.gk=this.ts.chartXYZoomingRectangleStrokeStyle,this.pk=this.ts.chartXYFittingRectangleFillStyle,this.mk=this.ts.chartXYFittingRectangleStrokeStyle,this.yk=e.MouseStyles.Default,this.Sk=e.MouseStyles.Move,this.vk=e.MouseStyles.ZoomIn,this.xk=e.MouseStyles.Default,this.bk=void 0,this.Mk=Bc,this.WM=0,this.Vm=e.AutoCursorModes.snapToClosest,this._k=wc(this.Ng,this.Og),this.wk=wc(this.Wg,this.Gg),this.Ck=(t,e,i,s,r)=>{this._k(s,r),this.wk(r,s),this.sk.tt(s,r),this.cs.vs()},this.kk=(t,e)=>{this.ek.set(t,e)},this.tg=t=>{const e=this.Ng.findIndex((e=>e.axis===t)),i=this.Og.findIndex((e=>e.axis===t)),s=this.Wg.findIndex((e=>e.axis===t)),r=this.Gg.findIndex((e=>e.axis===t));e>=0&&this.Ng.splice(e,1),i>=0&&this.Og.splice(i,1),s>=0&&this.Wg.splice(s,1),r>=0&&this.Gg.splice(r,1),this.ek.delete(t),this.cs.vs()},this.addAreaSeries=t=>{const e=(null==t?void 0:t.axisX)||(null==t?void 0:t.xAxis)||this.getDefaultAxisX(),i=(null==t?void 0:t.axisY)||(null==t?void 0:t.yAxis)||this.getDefaultAxisY();Dc(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Wu.Positive)(this,this.wS,this.Wx,e,i,this.Tk(e),this.Tk(i),this.np,s,this.ts,this.cs.hs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length);return this.DS(r),r},this.addAreaRangeSeries=t=>{const e=(null==t?void 0:t.axisX)||(null==t?void 0:t.xAxis)||this.getDefaultAxisX(),i=(null==t?void 0:t.axisY)||(null==t?void 0:t.yAxis)||this.getDefaultAxisY();Dc(e,i);const s=new $u(this,this.wS,this.Wx,e,i,this.Tk(e),this.Tk(i),this.np,this.ts,this.cs.hs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length);return this.DS(s),s},this.Fk=!1,this.Ik=!1,this.YM=()=>{(this.hk||this.rk)&&(this.bk=this.engine.setMouseStyle(this.yk))},this.HM=()=>{this.Fk=!1,this.engine.restoreMouseStyle(this.bk)},this.$M=(t,e,i)=>{var s,r;const n=Ft(null===(s=this.dA.Hn)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Ft(null===(r=this.dA.Hn)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.bk);const h=this.vp.cs.De(e.clientX,e.clientY);i===n&&(this.hk||this.rk)?(this.Pk(t,h),Zt(e)):i===o&&this.ak&&(this.bk=this.engine.setMouseStyle(this.Sk),this.Ik=!0,Zt(e))},this.hS=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=Ft(null===(n=this.dA.Hn)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=Ft(null===(o=this.dA.Hn)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.hk||this.rk)?(this.Dk(t,s,h),Zt(e)):i===l&&this.ak&&(this.Bk(ni(r,-1)),Zt(e)),this.cs.vs()},this.XM=(t,e,i,s)=>{var r,n;const o=Ft(null===(r=this.dA.Hn)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=Ft(null===(n=this.dA.Hn)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.hk||this.rk)){const i=u(e.clientX,e.clientY);this.Lk(t,s,i),Zt(e)}else i===h&&this.ak&&Zt(e);this.engine.restoreMouseStyle(this.bk),this.IS.getIsUnderMouse()&&(this.bk=this.engine.setMouseStyle(this.yk)),this.Fk=!1,this.Ik=!1},this.eS=(t,e)=>{if(this.nk){const t=this.vp.cs.De(e.clientX,e.clientY);this.Rk(t,u(ge(e),ge(e))),Zt(e)}},this.Ek=(t,e,i,s)=>{},this.zk=(t,e,i,s,r,n)=>{if(this.ak){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.Bk(t),Zt(n),this.Ik=!0}if(this.nk){const t=this.engine.clientLocation2Engine(e.x,e.y),o=this.engine.clientLocation2Engine(i.x,i.y),h=hi(u(Math.abs(t.x-s.x-(o.x-r.x)),Math.abs(t.y-s.y-(o.y-r.y))),u(Math.abs(t.x-o.x),Math.abs(t.y-o.y)));this.forEachAxisX((t=>{t.getChartInteractionZoomByWheel()&&t.vt(t.ft.mi(t.getInterval().start,-h.x),t.ft.mi(t.getInterval().end,h.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.vt(t.ft.mi(t.getInterval().start,-h.y),t.ft.mi(t.getInterval().end,h.y),!1,!0,"interactionZoom")})),Zt(n),this.Fk=!0}},this.Vk=(t,e,i,s)=>{this.Ik=!1,this.Fk=!1},this.Ok=(t,e,i)=>{(this.rk||this.hk)&&(this.Pk(t,e),Zt(i))},this.Nk=(t,e,i,s,r)=>{(this.rk||this.hk)&&(this.Dk(t,e,i),Zt(r))},this.Gk=(t,e,i,s)=>{(this.rk||this.hk)&&(this.Lk(t,e,i),Zt(s))},this.cs.Gn(ah.pf),this.setPadding({right:24}),this.Wk=i.Ax("chartXY series bg",Lc.seriesBackground),this.Uk=[Lc.gridLine0,Lc.gridLine1,Lc.gridLine2].map((t=>i.Yk(`chartXY gridline #${t}`,t))),this.KA=i.Yk("chartXY highlighters below",Lc.highlightersBelow),this.Wx=i.Um("chartXY plotting",Vc.plotting),this.qA=i.Um("chartXY highlighters above",Vc.highlightersAbove),this.bA=i.Um("chartXY fg",Vc.fg),this.sk.x.K(0,this.uiScale.x.getCellSize()-(this.jt.left+this.jt.right+this.ya.left+this.ya.right)),this.sk.y.K(0,this.uiScale.y.getCellSize()-(this.jt.bottom+this.jt.top+this.ya.bottom+this.ya.top)),this.sk.tt(this.uiScale.ai().x,this.uiScale.ai().y),this.IS=this.Wk.Te(this.sk).ke(this.ts.chartXYSeriesBackgroundFillStyle).Ce(ot),this.PS=this.bA.Te(this.sk).ke(z).Ce(this.ts.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.FS(this.IS,this.PS),this.setSeriesBackgroundEffect(!1),this.Hm=i.$m();const a=Ft(o?o.autoCursorBuilder:void 0,hu);this.Fp=a.am(this.Hm,this.sk,this.sk,this.ts),ia.Ip(this),this.RS(((t,e)=>{ia.Pp(this,e)})),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.Ck),this.bp.Eh("ChartXY"),this.rS=Wi(new $i(this.Ok,this.Nk,this.Gk,1),new Zi(this.Ek,this.zk,this.Vk)),this.onSeriesBackgroundMouseEnter(this.YM),this.onSeriesBackgroundMouseLeave(this.HM),this.onSeriesBackgroundMouseWheel(this.eS),this.onSeriesBackgroundMouseDragStart(this.$M),this.onSeriesBackgroundMouseDrag(this.hS),this.onSeriesBackgroundMouseDragStop(this.XM),this.onSeriesBackgroundTouchStart(this.rS.onTouchStart),this.onSeriesBackgroundTouchMove(this.rS.onTouchMove),this.onSeriesBackgroundTouchEnd(this.rS.onTouchEnd),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.mp(n,this.sk)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.MS}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}solveNearest(t){const e=t||this.cs.Nn();if(e)return ia.$c(this,rh(e,this.cs),this.MS)}getMinimumSize(){const t={x:0,y:0};t.x+=this.jt.left+this.jt.right+this.ya.left+this.ya.right,t.y+=this.jt.top+this.jt.bottom+this.ya.top+this.ya.bottom;const e=this.bp.Ds().Zc(),i=A(zc(this.Mk||Bc),this.Sp);return t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom,this.Hk&&(t.x+=this.Hk.left,t.x+=this.Hk.right,t.y+=this.Hk.top,t.y+=this.Hk.bottom),t.x+=kc.x,t.y+=kc.y,t}addChartMarkerXY(t=au,e,i){const s=this.np(),r=new gu(s,this.uiScale,e||this.getDefaultAxisX(),i||this.getDefaultAxisY(),t,this.ip(s),this.ts);return this.Ap(r),r}addAxisX(t){var e,i;const{opposite:s,type:r}=nh(t);let n;n="linear"===r.type?this.ep.d1({dimension:"x",scale1DConstructor:Di}):"linear-highPrecision"===r.type?this.ep.d1({dimension:"x",scale1DConstructor:Di})._i():this.ep.d1({dimension:"x",scale1DConstructor:Mi}).gi(r.base),n.tt(this.sk.x.ai());const o=s?this.Og:this.Ng,h=new uh(this.Uk,this.bA,this.vp,this.KA,this.qA,this.cs.hs,n,this.sk.y,(a=()=>h.wg(),{...ch,...Sc(a)}),this,s?100:0,this.tg,this.kk,this.ts,this.ih,r);var a;let l,u;return void 0===(null==t?void 0:t.iParallel)&&void 0===(null==t?void 0:t.iStack)?(l=o.reduce(((t,e)=>Math.max(t,e.iParallel+1)),0),u=0):(l=null!==(e=t.iParallel)&&void 0!==e?e:0,u=null!==(i=t.iStack)&&void 0!==i?i:0),o.push({axis:h,iStack:u,iParallel:l}),this.cs.vs(),h}addAxisY(t){var e,i;const{opposite:s,type:r}=nh(t);let n;n="linear"===r.type?this.ep.d1({dimension:"y",scale1DConstructor:Di}):"linear-highPrecision"===r.type?this.ep.d1({dimension:"y",scale1DConstructor:Di})._i():this.ep.d1({dimension:"y",scale1DConstructor:Mi}).gi(r.base),n.tt(this.sk.y.ai());const o=s?this.Gg:this.Wg,h=new uh(this.Uk,this.bA,this.vp,this.KA,this.qA,this.cs.hs,n,this.sk.x,(a=()=>h.wg(),{...dh,...Ac(a)}),this,s?100:0,this.tg,this.kk,this.ts,this.ih,r);var a;let l,u;return void 0===(null==t?void 0:t.iParallel)&&void 0===(null==t?void 0:t.iStack)?(l=o.reduce(((t,e)=>Math.max(t,e.iParallel+1)),0),u=0):(l=null!==(e=t.iParallel)&&void 0!==e?e:0,u=null!==(i=t.iStack)&&void 0!==i?i:0),o.push({axis:h,iParallel:l,iStack:u}),this.cs.vs(),h}swapAxes(t,e){const i=[this.Ng,this.Wg,this.Gg,this.Og],s=i.find((e=>void 0!==e.find((e=>e.axis===t)))),r=i.find((t=>void 0!==t.find((t=>t.axis===e))));if(!s||!r)return this;if(s!==r)throw new Error("LightningChart JS ChartXY.swapAxes does not support swapping Axes that are on different sides.");const n=s.find((e=>e.axis===t)),o=s.find((t=>t.axis===e));if(!n||!o)return this;const h=n.iParallel,a=n.iStack;return n.iParallel=o.iParallel,n.iStack=o.iStack,o.iParallel=h,o.iStack=a,this.cs.vs(),this}dispose(){return this.Fp.dispose(),this.Wk.U(),this.Wx.U(),this.bA.U(),this.Uk.forEach((t=>t.U())),this.qA.U(),this.KA.U(),this.Hm.U(),this.OC().forEach((t=>t.dispose())),Kh(this.sk),this.Ng.slice().forEach((t=>t.axis.dispose())),this.Wg.slice().forEach((t=>t.axis.dispose())),this.Gg.slice().forEach((t=>t.axis.dispose())),this.Og.slice().forEach((t=>t.axis.dispose())),this.MS.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){var t;return null===(t=[...this.Ng,...this.Og].find((t=>t.axis.getVisible())))||void 0===t?void 0:t.axis}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}getDefaultAxisY(){var t;return null===(t=[...this.Wg,...this.Gg].find((t=>t.axis.getVisible())))||void 0===t?void 0:t.axis}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):Rc;return It(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.Og.map((t=>t.axis));case e.AxisPosition.Bottom:return this.Ng.map((t=>t.axis));case e.AxisPosition.Left:return this.Wg.map((t=>t.axis));case e.AxisPosition.Right:return this.Gg.map((t=>t.axis))}})))}$k(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.Ng.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.Og.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}forEachAxisY(t){this.Wg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.Gg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}setTitlePosition(t){return this.Mk=t,this.cs.vs(),this}getTitlePosition(){return this.Mk}Xk(t,e,i,s){const r=this.Mk||Bc;let n,o=A(zc(r),this.Sp);this.getTitleFillStyle()===z||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.bp.Ds().Zc();const h=Math.abs(s)+this.ya.bottom+this.jt.bottom,a=Math.abs(i)+this.ya.top+this.jt.top,l={left:Math.abs(t)+this.ya.left+this.jt.left,right:Math.abs(e)+this.ya.right+this.jt.right,top:a,bottom:h},u=this.uiScale.Ui(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=Nc(r,u,l,n,o,this.ya);return this.bp.Ie(f).Ba(c).Ra(d),g}Fe(t){super.Fe(t);for(const t of this.MS)t.aS();for(const t of this.MS)t.Fe();const e=this.Wg.map((t=>t.axis._r().Ds())),i=this.Ng.map((t=>t.axis._r().Ds())),s=this.Og.map((t=>t.axis._r().Ds())),r=this.Gg.map((t=>t.axis._r().Ds()));let n=!1;this.forEachAxis((t=>{(t.Tr()||t.Fr())&&(n=!0)}));const o=this.Fk||this.Ik||!this.lk&&n;ia.Tp(this,this.IS.getIsUnderMouse(),o,this.MS,(t=>ia.$c(this,t,this.MS)),((t,e)=>t.$c(e,!0)));const h=Uc(this.Wg,e),a=Uc(this.Ng,i),l=Uc(this.Og,s),c=Uc(this.Gg,r),d=this.Xk(h.thicknessTotal,c.thicknessTotal,l.thicknessTotal,a.thicknessTotal),f=this.sk.x.getCellSize()-(d.left+d.right),g=this.sk.y.getCellSize()-(d.bottom+d.top),m=[d.left,d.right],p=[d.bottom,d.top];this.sk.x.K(0,f),this.sk.y.K(0,g),this.sk.x.ei(m),this.sk.y.ei(p);const x=(t,e,i,s)=>{let r=0;t.groups.forEach((t=>{let n=0;const o=t.stacks.reduce(((t,e)=>Math.max(t,e.Tg)),0),h=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()?e.axis.sA+e.axis.eA:0)),0),a=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"pixels"in e.axis.Vd?e.axis.Vd.pixels:0)),0),l=e-h-a;t.stacks.forEach((s=>{const h=s.axis,a=h.getVisible(),u=Math.max(e-n,0),c=Math.min(a?"pixels"in h.Vd?h.Vd.pixels:h.Vd.relative/t.sumRelativeSize*l:0,u),d=a?i[0]+n+h.sA:0,f=a?i[1]+(e-n)-c-h.sA:0;h.ft.ei([d,f]),h.Fe({Tg:o,Fg:s.Fg,Dg:c,jk:n,Vg:o+s.Fg,Lg:r}),a&&(n+=c+h.sA+h.eA)})),r+=s*t.thicknessMax}))};x(h,g,p,-1),x(c,g,p,1),x(a,f,m,-1),x(l,f,m,1),this.Hk={left:h.thicknessTotal,top:l.thicknessTotal,right:c.thicknessTotal,bottom:a.thicknessTotal},this.IS.Ie(u(0,0)).tt(u(f,g)),this.PS.Ie(u(0,0)).tt(u(f,g));const S=y(this.sk.x.hi(),this.sk.y.hi(),this.sk.x.ni(),this.sk.y.ni());this.Wx.tx(S),this.KA.tx(S),this.qA.tx(S),this.Qg&&this.Qg(),this.Ng.forEach((t=>t.axis.Ug())),this.Og.forEach((t=>t.axis.Ug())),this.Wg.forEach((t=>t.axis.Ug())),this.Gg.forEach((t=>t.axis.Ug())),super.pp();for(const t of this.MS)t.Ay()}Z(){for(let t=0;t=10;n&&a&&h.x===s.x&&this.rk?(this.Fk=!0,this.ck.ke(this.pk).Ce(this.mk),this.dk.Ee(this.mk).Oe(s).Ve(r),this.fk.Ee(this.mk).Oe(u(s.x,r.y)).Ve(u(r.x,s.y)),this.bk=this.engine.setMouseStyle(this.xk,this.bk)):n&&a&&(this.hk||this.rk)?(this.Fk=!0,this.ck.ke(this.Ak).Ce(this.gk),this.dk.Ee(ot),this.fk.Ee(ot),this.bk=this.engine.setMouseStyle(this.vk,this.bk)):(this.Fk=!1,this.ck.Ce(ot).ke(z),this.dk.Ee(ot),this.fk.Ee(ot),this.engine.restoreMouseStyle(this.bk)),this.cs.vs()}Lk(t,e,i){if(this.Fk){const t=dt(this.engine.clientLocation2Engine(i.x,i.y),this.vp.cs.ft,this.sk),s=He(t.x,this.sk.x.getInnerStart(),this.sk.x.getInnerEnd())&&He(t.y,this.sk.y.getInnerStart(),this.sk.y.getInnerEnd()),r=i.x>=e.x||!this.rk?"zoom":"fit",n=this.ck.Ia(),o=oi(n,this.ck.ai()),h=Math.min(this.ck.ai().x,this.ck.ai().y)>=10;s&&h&&"zoom"===r&&this.hk?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=dt(n,this.sk,t.og).x,i=dt(o,this.sk,t.og).x;t.vt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=dt(n,this.sk,t.og).y,i=dt(o,this.sk,t.og).y;t.vt(e,i,!0,!0,"interactionSetInterval")}}))):s&&h&&"fit"===r&&this.rk&&this.forEachAxis(Fc)}this.ck.Ce(ot).ke(z),this.dk.Ee(ot),this.fk.Ee(ot),this.cs.vs()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}Bk(t){this.forEachAxisX((e=>{e.getChartInteractionPanByDrag()&&e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.getChartInteractionPanByDrag()&&e.setStopped(!0).pan(t.y)}))}zoom(t,e){this.forEachAxis(Ic),this.forEachAxisX((i=>{i.zoom(i.ft.ct(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.ft.ct(t.y),e.y)}))}Rk(t,e){this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&(Ic(i),i.zoom(i.ft.ct(t.x),e.x))})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&(Ic(i),i.zoom(i.ft.ct(t.y),e.y))}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}Qd(){const t=[];return this.forEachAxis((e=>e.xg((e=>t.push(e))))),super.Qd().concat(t)}OC(){return this.uk}me(){return this._p(this.Wx)}setAutoCursorEnabledDuringAxisAnimation(t){return this.lk=t,this}getAutoCursorEnabledDuringAxisAnimation(){return this.lk}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,r=e,n=fh(r)?r:Ui(r)?this.pixelScale:void 0;if(n&&zi(i)){const t=dt(s,n,this.engine.scale);return this.cs.Bo({engineX:t.x,engineY:t.y})}if(n&&Ui(i))return dt(s,n,this.pixelScale);if(n&&fh(i))return dt(s,n,i)}else{const i=t;if(Ui(e)){const t=this.cs.Do(i);return dt({x:t.engineX,y:t.engineY},this.engine.scale,this.pixelScale)}if(fh(e)){const t=e,s=this.cs.Do(i);return dt({x:s.engineX,y:s.engineY},this.engine.scale,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}}e.ChartXYTitlePositionOptions=void 0,(_c=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",_c.RightTop="right-top",_c.LeftTop="left-top",_c.CenterBottom="center-bottom",_c.RightBottom="right-bottom",_c.LeftBottom="left-bottom",_c.SeriesCenterTop="series-center-top",_c.SeriesRightTop="series-right-top",_c.SeriesLeftTop="series-left-top",_c.SeriesCenterBottom="series-center-bottom",_c.SeriesRightBottom="series-right-bottom",_c.SeriesLeftBottom="series-left-bottom";const Bc=e.ChartXYTitlePositionOptions.CenterTop,zc=t=>{switch(t){case"center-top":case"series-center-bottom":return{left:0,right:0,top:0,bottom:5};case"left-top":return{left:20,right:0,top:0,bottom:5};case"right-top":return{left:0,right:20,top:0,bottom:5};case"center-bottom":return{left:0,right:0,top:0,bottom:0};case"left-bottom":return{left:20,right:0,top:0,bottom:0};case"right-bottom":return{left:0,right:20,top:0,bottom:0};case"series-center-top":return{left:0,right:0,top:5,bottom:0};case"series-left-top":return{left:5,right:0,top:5,bottom:0};case"series-right-top":return{left:0,right:5,top:5,bottom:0};case"series-left-bottom":return{left:5,right:0,top:0,bottom:5};case"series-right-bottom":return{left:0,right:5,top:0,bottom:5}}return be(0,`Unexpected ChartXY title position selection ${t}`)},Nc=(t,e,i,s,r,n)=>{s.x,r.left,r.right;const o=s.y+r.bottom+r.top,h=(r.left-r.right)*e.x,a=(r.bottom-r.top)*e.y;switch(t){case"center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+h,y:100-(n.top+r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:h,y:100-(n.top-r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100+h,y:100-(n.top-r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50+h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100+h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"series-center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:i.left*e.x+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100-i.right*e.x+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50,y:i.bottom*e.y+a},marginsWithTitle:i};case"series-left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:i.left*e.x+h,y:i.bottom*e.y+a},marginsWithTitle:i};case"series-right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100-i.right*e.x+h,y:i.bottom*e.y+a},marginsWithTitle:i}}return be(0,`Unexpected ChartXY title position selection ${t}`)},Uc=(t,e)=>{const i=[];t.forEach(((t,s)=>{const r=e[s],n=i.find((e=>e.iParallel===t.iParallel));n?(n.stacks.push({...t,...r}),n.stacks.sort(((t,e)=>t.iStack-e.iStack))):i.push({iParallel:t.iParallel,stacks:[{...t,...r}]})}));const s=i.map((t=>{const e=t.stacks.reduce(((t,e)=>Math.max(t,e.Tg)),0),i=t.stacks.reduce(((t,e)=>Math.max(t,e.Fg)),0),s=t.stacks.reduce(((t,e)=>Math.max(t,e.Od)),0),r=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"relative"in e.axis.Vd?e.axis.Vd.relative:0)),0);return{...t,ticksSizeMax:e,titleSizeMax:i,sumRelativeSize:r,thicknessMax:s}}));return s.sort(((t,e)=>t.iParallel-e.iParallel)),{groups:s,thicknessTotal:s.reduce(((t,e)=>t+e.thicknessMax),0)}};class Oc{constructor(t,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.L=new r.Eventer,this.Zk=[],this.Qk=new Map,this.MS=new Map,this.Jk=(t,e,i)=>{0!==this.MS.size&&void 0!==[...this.MS.values()].find((({series:t})=>!0===t.getVisible()))||this.Kk.vt(e,i,!1,!1,"zoomBandChart"),this.qk.cs.vs()},i.cs.Gn(ah.Af),this.dA=t,this.tT=(null==h?void 0:h.orientation)||"x",this.iT=void 0!==(null==h?void 0:h.useSharedValueAxis)&&h.useSharedValueAxis,this.sT=n,this.Uu="x"===this.tT?ch:dh;const l={...h,defaultAxisX:this.Uu.getWidth({x:null==h?void 0:h.defaultAxis,y:void 0}),defaultAxisY:this.Uu.getHeight({x:null==h?void 0:h.defaultAxis,y:void 0})};this.qk=new Pc(t,i,s,kt,o,l,a).setTitle("Zoom Band Chart").setMouseInteractions(!1).setAutoCursorMode(e.AutoCursorModes.disabled),this.engine=this.qk.engine;const u=this.qk.getDefaultAxisX().setMouseInteractions(!1),c=this.qk.getDefaultAxisY().setMouseInteractions(!1);this.Kk=this.Uu.getWidth({x:u,y:c}).setScrollStrategy(zs.fitting).setAnimationScroll(!1).setStrokeStyle(ot).setTickStrategy(Ns.Empty),(null==h?void 0:h.useSharedValueAxis)?this.eT=this.Uu.getHeight({x:u,y:c}):this.Uu.getHeight({x:u,y:c}).dispose();const d=this.getTheme().zoomBandChartDefocusOverlayFillStyle||new G({color:this.getTheme().isDark?E(0,0,0,180):E(255,255,255,180)});this.hT=[this.qk.bA.Te(this.Kk.og).ke(d).Ce(ot),this.qk.bA.Te(this.Kk.og).ke(d).Ce(ot)];const f=this.qk.bA.Rg(this.Kk.og).Ee(this.getTheme().zoomBandChartSplitterStrokeStyle||this.getTheme().chartXYSeriesBackgroundStrokeStyle);this.rT={collection:f,members:new Array(5).fill(0).map((t=>f.Vr()))};const g=this.getTheme(),m="function"==typeof g.zoomBandChartKnobFillStyle?g.zoomBandChartKnobFillStyle(this.dA.Xs):g.zoomBandChartKnobFillStyle||z;this.nT=[this.qk.bA.Te(this.qk.pixelScale).ke(m).Ce(ot),this.qk.bA.Te(this.qk.pixelScale).ke(m).Ce(ot)],this.oT=this.getTheme().zoomBandChartKnobSize||{x:0,y:0},this.aT()}add(t){var e,i,s,r,n;const o=this.Zk.map((t=>t.axis)),h="x"===this.tT?t.axisX:t.axisY;if(!o.includes(h)){const t=h.onIntervalChange(this.Jk);this.Zk.push({axis:h,deattach:()=>{h.offIntervalChange(t)}}),this.Kk.Xh(h.$h()),this.lT&&this.lT.remove(),this.lT=gt(...this.Zk.map((t=>t.axis)))}const a=this.Uu.getHeight({x:t.axisX,y:t.axisY});let l;if(this.iT)l=this.eT;else{const t=this.Qk.get(a);t?l=t:(l=this.Uu.getHeight({x:this.qk.addAxisX.bind(this.qk),y:this.qk.addAxisY.bind(this.qk)})(),this.uT(l)),this.Qk.set(a,l)}const u=this.Uu.getWidth({x:this.Kk,y:l}),c=this.Uu.getHeight({x:this.Kk,y:l});let d;const f=[],g=(t,e)=>{const i=t=>{if(0!==t.length)if("x"in t[0]){const i=t;e.add(i)}else{const i=t,s=[];for(let t=0;ti(e)));f.push((()=>t.a_(r)));const n=t.l_((()=>e.clear()));f.push((()=>{t.u_(n)}))};if(t instanceof Ec)d=this.qk.addPointLineAreaSeries({...t.Yn,xAxis:u,yAxis:c}).setStrokeStyle(t.getStrokeStyle()).setAreaFillStyle(t.getAreaFillStyle()).setPointFillStyle(t.getPointFillStyle()).setCurvePreprocessing(t.getCurvePreprocessing()),d.setDataSet(t.ik());else if(t instanceof vc||t instanceof mc){const i=this.qk.addLineSeries({xAxis:u,yAxis:c,dataPattern:t instanceof vc?null===(e=t.Yn)||void 0===e?void 0:e.dataPattern:void 0});if(t instanceof vc)i.setStrokeStyle(t.getStrokeStyle());else{const e=Gc(t);e&&i.setStrokeStyle(e)}g(t,i),d=i}else if(t instanceof Yu){const e=this.qk.addAreaSeries({xAxis:u,yAxis:c,baseline:t._w}).setFillStyle(t.getFillStyle()).setStrokeStyle(t.getStrokeStyle());g(t,e),d=e}else if(t instanceof bc){const e=this.qk.addPointSeries({xAxis:u,yAxis:c,pointShape:null===(i=t.Yn)||void 0===i?void 0:i.pointShape}).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof gc){const e=this.qk.addStepSeries({xAxis:u,yAxis:c,pointShape:null===(s=t.Yn)||void 0===s?void 0:s.pointShape,mode:t.Xw}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof ic){const e=this.qk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(r=t.Yn)||void 0===r?void 0:r.pointShape}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof Qu){const e=this.qk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(n=t.Yn)||void 0===n?void 0:n.pointShape}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof $u){const e=this.qk.addAreaRangeSeries({xAxis:u,yAxis:c}).setLowFillStyle(t.getLowFillStyle()).setHighFillStyle(t.getHighFillStyle()).setLowStrokeStyle(t.getLowStrokeStyle()).setHighStrokeStyle(t.getHighStrokeStyle()).add(t.n_()),i=t.o_(((t,i)=>e.add(i)));f.push((()=>t.a_(i))),d=e;const s=t.l_((()=>e.clear()));f.push((()=>{t.u_(s)}))}else{if(!(t instanceof _u))throw new Error("LightningChart JS Zoom Band Chart unsupported series type");{const e=this.qk.addHeatmapGridSeries({xAxis:u,yAxis:c,...t.I_}),i=()=>{e.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};i(),d=e,t.B_(d);const s=t.E_(((t,i)=>e.invalidateIntensityValues(i))),r=t.L_(i);f.push((()=>{t.z_(s),t.R_(r)}));const n=t.l_((()=>e.clear()));f.push((()=>{t.u_(n)}))}}d.setMouseInteractions(!1);const m=t.onVisibleStateChanged(((t,e)=>{d.setVisible(e)}));f.push((()=>{t.offVisibleStateChanged(m)}));const y=t.onHighlight(((t,e)=>d.setHighlight(e)));f.push((()=>{t.offHighlight(y)}));const p=t.onDispose((()=>{this.disposeSeries(t)}));return f.push((()=>{t.offDispose(p)})),this.MS.set(t,{series:d,clearReferences:()=>f.forEach((t=>t()))}),d}disposeSeries(t){const e=this.MS.get(t);if(e){const{clearReferences:i}=e;i(),this.MS.delete(t),e.series.dispose();const s=this.Uu.getHeight({x:t.axisX,y:t.axisY}),r=this.Qk.get(s);r&&0===r.wg().length&&(this.Qk.delete(s),r.dispose())}const i="x"===this.tT?t.axisX:t.axisY;if(!Array.from(this.MS.keys()).find((t=>i===("x"===this.tT?t.axisX:t.axisY)))){const t=this.Zk.findIndex((t=>t.axis===i));this.Zk[t].deattach(),this.Zk.splice(t,1)}return this}setDefocusOverlayFillStyle(t){return this.hT.forEach((e=>e.ke(t))),this.qk.cs.vs(),this}getDefocusOverlayFillStyle(){return this.hT[0].zh()}setSplitterStrokeStyle(t){return this.rT.collection.Ee(t),this.qk.cs.vs(),this}getSplitterStrokeStyle(){return this.rT.collection.cu()}setKnobFillStyle(t){return this.nT.forEach((e=>e.ke(t))),this.qk.cs.vs(),this}getKnobFillStyle(){return this.nT[0].zh()}setKnobStrokeStyle(t){return this.nT.forEach((e=>e.Ce(t))),this.qk.cs.vs(),this}getKnobStrokeStyle(){return this.nT[0].lo()}setKnobSize(t){return this.oT=t,this.qk.cs.vs(),this}getKnobSize(){return this.oT}getDefaultAxisX(){return this.qk.getDefaultAxisX()}getDefaultAxisY(){return this.qk.getDefaultAxisY()}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}uT(t){t.setTickStrategy(Ns.Empty).setMouseInteractions(!1).setNibStyle(ot).setStrokeStyle(ot)}aT(){let t;const i=(t,e,i)=>{var s,r;const n="x"===this.tT?null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.MS.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Kk.getInterval();Math.abs(this.Kk.ft.dt(t)-this.Kk.ft.dt(e))<10||Math.sign(e-t)!==Math.sign(o.end-o.start)||Math.min(t,e)Math.max(h.start,h.end)&&Math.max(o.start,o.end){s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(this.Uu.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical}),t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const n=t=>{var e,s;const n="x"===this.tT?null===(e=Array.from(this.MS.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisY;if(!n)return;const o=this.Uu.getWidth(this.qk.translateCoordinate(t,this.qk.coordsAxis)),h=n.getInterval(),a=0===r?o:h.start,l=1===r?o:h.end;i(a,l,!1),Zt(t)};s.setMouseDragEventHandler(((t,e,i,s,r)=>n(e)));const o=Wi(new $i(void 0,((t,e,i,s,r)=>n(r))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)})),this.qk.onSeriesBackgroundMouseEnter((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Move,t)})),this.qk.onSeriesBackgroundMouseLeave((()=>{this.engine.restoreMouseStyle(t)}));const s=(t,e)=>{var s,r;const n="x"===this.tT?null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.MS.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Kk.ft.mi(o.start,this.Uu.getWidth(t)),a=this.Kk.ft.mi(o.end,this.Uu.getWidth(t));i(h,a,!1),Zt(e)};this.qk.onSeriesBackgroundMouseDrag(((t,e,i,r,n)=>s(n,e)));const r=Wi(new $i(void 0,((t,e,i,r,n)=>s(r,n))));this.qk.onSeriesBackgroundMouseWheel(((t,e)=>{var s,r;const n="x"===this.tT?null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.MS.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Kk.getInterval(),a=this.Uu.getWidth(this.qk.translateCoordinate(e,this.qk.coordsAxis)),l=this.Kk.ft.dt(o.start),u=this.Kk.ft.dt(o.end),c=this.Kk.ft.dt(a),d=Rt((c-l)/(u-l),0,1),f=.2*Math.abs(u-l)*n.Ef,g=d*f*-Math.sign(e.deltaY),m=(1-d)*f*Math.sign(e.deltaY),y=Rt(this.Kk.ft.mi(o.start,g),h.start,h.end),p=Rt(this.Kk.ft.mi(o.end,m),h.start,h.end);i(y,p,!1),Zt(e)})),this.qk.onSeriesBackgroundTouchStart(r.onTouchStart),this.qk.onSeriesBackgroundTouchMove(r.onTouchMove),this.qk.onSeriesBackgroundTouchEnd(r.onTouchEnd),this.hT.forEach(((s,r)=>{s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Point,t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const n=t=>{var e,s;const r="x"===this.tT?null===(e=Array.from(this.MS.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisY;if(!r)return;const n=this.Uu.getWidth(this.qk.translateCoordinate(t,this.qk.coordsAxis)),o=r.getInterval(),h=this.Kk.getInterval(),a=Rt(n-(o.end-o.start)/2,Math.min(h.start,h.end),Math.max(h.start,h.end)-Math.abs(o.end-o.start)),l=a+(o.end-o.start);i(a,l,!0),Zt(t)};s.setMouseClickEventHandler(((t,e)=>n(e)));const o=Wi(new class{constructor(t,e=300){this.Bs=!1,this.Ls=[],this.Rs=300,this.Es=t,this.Rs=e}Ps(t,e){const i=bt.performance.now();let s=!1;for(let t=0;t=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&&!this.Bs){const i=this.Ls.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=1&&i.off>=1&&(this.Es(t,e),this.Ls.length=0)}}}(((t,e)=>n(e))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)}))}getSizePixels(){return this.qk.getSizePixels()}onResize(t){return this.qk.onResize(((e,i,s,r,n)=>t(this,i,s,r,n)))}offResize(t){return this.qk.offResize(t)}Ir(t){this.qk.Ir(t)}getMinimumSize(){return this.qk.getMinimumSize()}Z(){return this.qk.Z()}J(){return this.qk.J()}Fe(t){var e,i,s,r;const n=xe(Array.from(this.MS.keys()).map((t=>t.chart))),o="x"===this.tT?null===(e=Array.from(this.MS.keys())[0])||void 0===e?void 0:e.axisX:null===(i=Array.from(this.MS.keys())[0])||void 0===i?void 0:i.axisY;if("x"===this.tT){const t=n.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=0===t.eg?t.Yg():0})),Math.max(t,i)}),0),e=n.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=100===t.eg?t.Yg():0})),Math.max(t,i)}),0),i=n.reduce(((t,e)=>Math.max(t,e.getPadding().left)),0),r=n.reduce(((t,e)=>Math.max(t,e.getPadding().right)),0);null===(s=this.getDefaultAxisY())||void 0===s||s.setThickness(t),this.qk.setPadding({left:i+(0===n.length?10:0),right:r+e+(0===n.length?10:0)})}else{const t=n.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=0===t.eg?t.Yg():0})),Math.max(t,i)}),0),e=n.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=100===t.eg?t.Yg():0})),Math.max(t,i)}),0),i=n.reduce(((t,e)=>Math.max(t,e.getPadding().bottom)),0),s=n.reduce(((t,e)=>Math.max(t,e.getPadding().top)),0);null===(r=this.getDefaultAxisX())||void 0===r||r.setThickness(t),this.qk.setPadding({bottom:i+(0===n.length?10:0),top:s+e+(0===n.length?10:0)})}this.qk.Fe(t);const h=this.Kk.getInterval().start,a=this.Kk.getInterval().end,l=Rt(o?o.getInterval().start:h,h,a),u=Rt(o?o.getInterval().end:a,h,a),c=this.Uu.getHeight(this.qk.sk.getInnerIntervalPixels());this.hT[0].Ie(this.Uu.toPoint(h,0)).tt(this.Uu.toPoint(l-h,c)),this.hT[1].Ie(this.Uu.toPoint(u,0)).tt(this.Uu.toPoint(a-u,c)),this.rT.members[0].zg(this.Uu.toPoint(h,c),this.Uu.toPoint(l,c)),this.rT.members[1].zg(this.Uu.toPoint(l,c),this.Uu.toPoint(l,0)),this.rT.members[2].zg(this.Uu.toPoint(l,0),this.Uu.toPoint(u,0)),this.rT.members[3].zg(this.Uu.toPoint(u,0),this.Uu.toPoint(u,c)),this.rT.members[4].zg(this.Uu.toPoint(u,c),this.Uu.toPoint(a,c));const d=dt(this.Uu.toPoint(l,c/2),this.Kk.og,this.qk.pixelScale),f=dt(this.Uu.toPoint(u,c/2),this.Kk.og,this.qk.pixelScale),g=this.oT;this.nT[0].Ie({x:d.x-g.x/2,y:d.y-g.y/2}).tt({x:g.x,y:g.y}).Gh(this.Uu.getWidth({x:0,y:90})),this.nT[1].Ie({x:f.x-g.x/2,y:f.y-g.y/2}).tt({x:g.x,y:g.y}).Gh(this.Uu.getWidth({x:0,y:90}))}setSeriesBackgroundFillStyle(t){return this.qk.setSeriesBackgroundFillStyle(t),this.qk.cs.vs(),this}getSeriesBackgroundFillStyle(){return this.qk.getSeriesBackgroundFillStyle()}setSeriesBackgroundStrokeStyle(t){return this.qk.setSeriesBackgroundStrokeStyle(t),this.qk.cs.vs(),this}getSeriesBackgroundStrokeStyle(){return this.qk.getSeriesBackgroundStrokeStyle()}setSeriesBackgroundEffect(t){return this.qk.setSeriesBackgroundEffect(t),this.qk.cs.vs(),this}getSeriesBackgroundEffect(){return this.qk.getSeriesBackgroundEffect()}getTheme(){return this.qk.getTheme()}setTitle(t){return this.qk.setTitle(t),this}getTitle(){return this.qk.getTitle()}setTitleFillStyle(t){return this.qk.setTitleFillStyle(t),this}getTitleFillStyle(){return this.qk.getTitleFillStyle()}setTitleFont(t){return this.qk.setTitleFont(t),this}getTitleFont(){return this.qk.getTitleFont()}setTitleMargin(t){return this.qk.setTitleMargin(t),this}getTitleMargin(){return this.qk.getTitleMargin()}setPadding(t){return this.qk.setPadding(t),this}getPadding(){return this.qk.getPadding()}setBackgroundFillStyle(t){return this.qk.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.qk.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.qk.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.qk.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return $h(t,e,i,this.qk.pixelScale,this.qk.cs)}addUIElement(t,e){return this.qk.addUIElement(t,e)}addLegendBox(t,e){return this.qk.addLegendBox(t,e)}getLegendBoxes(){return this.qk.getLegendBoxes()}saveToFile(t,e,i){return this.qk.saveToFile(t,e,i),this}dispose(){return this.qk.dispose(),this.Qk.clear(),this.MS.clear(),this.sT(this),this}isDisposed(){return this.qk.isDisposed()}onDispose(t){return this.qk.onDispose((()=>t(this)))}offDispose(t){return this.qk.offDispose(t)}}const Gc=t=>{if("getStrokeStyle"in t)return t.getStrokeStyle();const e=(t=>t instanceof vc||t instanceof Yu?t.getStrokeStyle().getFillStyle():t instanceof bc||t instanceof Qu?t.getPointFillStyle():void 0)(t);return e?new Ji({thickness:2,fillStyle:e}):void 0};class Yc extends Yl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Ms="Point Series",this.Ob=[],this.Nb=!1,this.$b=3,this.ga=0,this.Om=Hl,this.be=fe(this.ts.polarPointSeriesFillStyle,o),this.ad=new no({dataPattern:null}),this.Ga=t.fd(r).Ee(ot).dd(z).ud(this.be).Ad(e.PointShape.Circle).Sd(this.$b).ds(this.getHighlight()).ld(this.ad),this.fs(this.Ga)}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}setPointAlignment(t){return this.Ga.KC(t),this.Ki.cs.vs(),this}getPointAlignment(){return this.Ga.qC()}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.Ga.ud(e),this.Ts.vs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.$b=t,this.Ga.Sd(t),this.Ts.vs(),this}getPointSize(){return this.$b}setPointShape(t){return this.Ga.Ad(t),this.Ki.cs.vs(),this}getPointShape(){return this.Ga.gd()}setPointRotation(t){return this.ga=t,this.Ga.pd(t),this.Ts.vs(),this}getPointRotation(){return this.ga}qy(){return this.iS&&this.Ob.length>0&&this.getVisible()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){const i=dt(t,this.Ki.cs.ft,this.scale),s=this.ad.$c(i,!1,this.scale,this.Ki.pixelScale);if(!s)return;const{angle:r,amplitude:n}=$l(s,this.scale);return Ta(s,this.scale,this.Om(new la,this,r,n,this.Ki.getAmplitudeAxis().formatValue).Qu(),this,"color"in s&&void 0!==s.color&&X(this.be)?new G({color:k(s.color)}):this.be)}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}Fe(){if(this.Nb||this.scale.Hb()){const t=Xl(this.Ob,this.scale),e=Ze(t);this.ad.clear().add(t),this.Ga.Ho(e),this.Nb=!1,this.Ga.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be}),this}ks(){return this.bs||this.getPointShape()}}class Hc{constructor(t,e,i,s){this.L=new r.Eventer,this.cT=!1,this.Ki=t,this.dT=e,this.MS=i,this.Ga=s}setGeometry(t){return this.fT=t,this.cT=!0,this.Ki.cs.vs(),this}getGeometry(){return this.fT}setMouseInteractions(t){return this.Ga.setMouseInteractions(t),this}dispose(){return this.Ga.dispose(),this.dT(this),this.L.emit("dispose",this),this}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setVisible(t){const e=this.Ga.getVisible()!==t;return this.Ga.setVisible(t),e&&this.L.emit("visibleStateChanged",this,t),this.Ki.cs.vs(),this}getVisible(){return this.Ga.getVisible()}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}}class Xc extends Yl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Ms="Polygon Series",this.AT=[],this.gT=[],this.Om=Hl,this.pT=t=>{const e=this.gT.indexOf(t);e>=0&&this.gT.splice(e,1);const i=this.AT.findIndex((e=>e===t.Ga));i>=0&&this.AT.splice(i,1),this.Ts.vs()},this.be=fe(this.ts.polarPolygonSeriesFillStyle,n),this.Me=fe(this.ts.polarPolygonSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}addPolygon(){const t=new Hc(this.Ki,this.pT,this,this.mT());return this.gT.push(t),t}setFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(const t of this.AT)t.ke(e);return this.Ts.vs(),this}getFillStyle(){return this.be}setStrokeStyle(t){this.Me="function"==typeof t?t(this.Me):t;const e=this.Me;for(const t of this.AT)t.Ce(e);return this.Ts.vs(),this}getStrokeStyle(){return this.Me}qy(){return this.iS&&void 0!==this.gT.find((t=>void 0!==t.yT))&&this.getVisible()}Fe(){this.gT.forEach((t=>{(t.cT||this.scale.Hb())&&t.ST&&(t.Ga.Sl(Xl(t.ST,this.scale)),t.cT=!1,t.Ga.Ds())}))}aS(){super.aS();const t=m(Le,Ve);this.gT.forEach((e=>{if(!e.fT)return;const i=!e.cT&&e.ST?e.ST:jl(e.fT);e.ST=i;const s=!e.cT&&e.yT?e.yT:Wl(i);e.yT=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.Lb=t}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){const i=bu(t,this.AT,((t,e)=>{const i=t.$c(e);if(i)return dt(i,this.scale,t.cs.ft)}),Xe);if(!i)return;const s=dt(i[0],i[1].cs.ft,this.scale),r=this.vT(i[1]);if(!r)return;const{angle:n,amplitude:o}=$l(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.Om(new la,this,n,o,this.Ki.getAmplitudeAxis().formatValue).Qu(),owner:this,fillStyle:this.be,polarPolygon:r}}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be,stroke:this.Me}),this}mT(){const t=this.Ts.sc(this.scale,hn.Simple).ke(this.be).Ce(this.Me).ds(this.getHighlight());return this.AT.push(t),this.fs(t),t}vT(t){return this.gT.find((e=>e.Ga===t))}}class Wc extends Yl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Ms="Area Series",this.Ob=[],this.Nb=!1,this.Gb=!1,this.xT=!1,this.Om=Hl,this.be=fe(this.ts.polarAreaSeriesFillStyle,n),this.Me=fe(this.ts.polarAreaSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setData(t){0!==this.Ob.length&&this.Ki.cs.Gn(ah.xf);const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}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 jc extends Wc{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.bT=this.Ts.sc(this.scale,hn.Simple).ds(this.getHighlight()),this.fs(this.bT)}Fe(){if(this.Nb||this.scale.Hb()){const t=this.Ob,e=!0===this.Gb?Xl(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(Ct(e.angle,i.angle))return t;const s=1*Math.sign(i.angle-e.angle);let r=0;const n=[];for(let t=i.angle+s;!Ct(t%360,e.angle%360);t+=s)if(n.push({angle:t,amplitude:0}),r+=1,r>360)return[];for(let t=0;t=this.MT.start}Cb(t){this._T=t,this.FT=!0}Tb(){return!1===this._T}kb(t){this.wT=t,this.FT=!0}Mb(){return this.wT}yi(){return this.xi}wi(){return!1}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}Si(){return this.fi}Hb(){return this.TT}DT(){return this.FT}Ui(){return this.IT}Z(){return this.o=!1,this.xi=!1,this.TT=!1,this.FT=!1,this}J(){return this.o=!0,this.xi=!0,this.TT=!0,this.FT=!0,this}tt(t,e){return"object"==typeof t?(this.j.x=t.x,this.j.y=t.y):(this.j.x=t,this.j.y=e),this.PT(),this}zi(t){return this.CT=t,this.PT(),this}Vi(t){return this.kT=t,this.PT(),this}oi(){return u(this.CT[0]+this.CT[1],this.kT[0]+this.kT[1])}ai(){return this.j}PT(){const t=this.MT,e=u(this.x.li(this.j.x),this.y.li(this.j.y)),i=this.CT[0]+this.CT[1],s=this.kT[0]+this.kT[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.CT[0]+Math.max((r-2*o)/2,0),this.CT[1]+Math.max((r-2*o)/2,0)],a=[this.kT[0]+Math.max((n-2*o)/2,0),this.kT[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.tt(this.j.x).ei(h).K(-l,l),this.y.tt(this.j.y).ei(a).K(-l,l),this.IT={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.fi={x:this.x.Si(),y:this.y.Si()},this.J()}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 Zc extends al{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("polarChart bg",0),r,i.cs.ts.polarChartBackgroundFillStyle,i.cs.ts.polarChartBackgroundStrokeStyle,i.cs.ts.polarChartTitleFont,i.cs.ts.polarChartTitleFillStyle,h),this.coordsClient="client",this.Kf=[],this.Lo=!0,this.Vm=e.AutoCursorModes.onHover,this.BT=(t,e,i,s,r)=>{this.hb.tt(s,r)},this.iA=Qt(this.Kf),this.LT=t=>{this.Kf.push(t)},this.RT=()=>this.MS,this.cs.Gn(ah.df),this.Wk=i.Ax("polarChart series bg",0),this.ET=i.Um("polarChart axis gridlines",0),this.zT=i.Um("polarChart series",1),this.VT=i.Um("polarChart axis lines",2),this.OT=i.Um("polarChart axis ticks",3),this.hb=s.d2({scaleXYConstructor:$c}),this.onResize(this.BT),this.bp.Eh("Polar Chart"),this.IS=this.Wk.Kc(this.hb).ke(this.ts.polarChartSeriesBackgroundFillStyle).Ce(ot).hu(0).Ve(360).au(0),this.PS=this.Wk.Kc(this.hb).ke(z).Ce(this.ts.polarChartSeriesBackgroundStrokeStyle).hu(0).Ve(360).au(0),super.FS(this.IS,this.PS),this.mp(n,this.pixelScale),this.NT=new Vl(this,this.hb,this.ts,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.ET,this.VT,this.OT,this.hs,this.RT),this.GT=new Pl(this,this.hb,this.ts,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.ET,this.VT,this.OT,this.hs),this.coordsAxis={axisAmplitude:this.NT,axisRadial:this.GT},this.Hm=i.$m();const a=Ft(o?o.autoCursorBuilder:void 0,Ma);this.Fp=a.am(this.Hm,this.uiScale,this.uiScale,this.ts),ia.Ip(this),this.RS(((t,e)=>{ia.Pp(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled))}getSeries(){return this.MS}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}solveNearest(t){const e=t||this.cs.Nn();if(e)return ia.$c(this,rh(e,this.cs),this.MS)}translateCoordinate(t,e,i){if(i){const e=t,s=this.pixelScale,r=i;if(zi(r)){const t=dt(e,s,this.engine.scale);return this.cs.Bo({engineX:t.x,engineY:t.y})}if(Ui(r))return e;if(Nl(r)){const t=dt(e,s,this.hb);return $l(t,this.hb)}}else{const i=t,s=e;if(Ni(i)){if(Nl(s)){const t=this.cs.Do(i),e=dt({x:t.engineX,y:t.engineY},this.engine.scale,this.hb);return $l(e,this.hb)}if(zi(s))return i;if(Ui(s)){const t=this.cs.Do(i);return dt({x:t.engineX,y:t.engineY},this.cs.ft,this.pixelScale)}}else if(Ul(i)){if(Nl(s))return i;const t=Xl([i],this.hb)[0];if(zi(s)){const e=dt(t,this.hb,this.engine.scale),i={engineX:e.x,engineY:e.y};return this.cs.Bo(i)}if(Ui(s))return dt(t,this.hb,this.pixelScale)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new Jl(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addPointSeries(t){const e=new Yc(this.zT,this,this.wS,this.hb,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 ql(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addAreaSeries(t){const e=new jc(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addPolygonSeries(t){const e=new Xc(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addHeatmapSeries(t){const e=new Zl(this.zT,this,this.wS,this.hb,this.ts,this.cs.hs,t);return this.DS(e),e}addSector(){const t=new Ol(this.zT,this,this.iA,this.hb,this.ts,this.cs.hs);return this.LT(t),t}getAmplitudeAxis(){return this.NT}get amplitudeAxis(){return this.NT}get axisAmplitude(){return this.NT}getRadialAxis(){return this.GT}get radialAxis(){return this.radialAxis}get axisRadial(){return this.radialAxis}Fe(t){var e,i;super.Fe(t),ta.kp(this.bp,this.Sp);for(const t of this.MS)t.aS();this.NT._r(),this.GT._r();for(const t of this.MS)t.Fe();for(let t=1;t<=2;t+=1){const e=this.NT.Fe(),i=this.GT.Fe(),s=ta.Cp(this.bp,this.Sp),r=[this.ya.left+i,this.ya.right+i],n=[this.ya.bottom+i,this.ya.top+i+s];this.hb.zi(r).Vi(n);const o=4;if(!(!this.WT||Math.abs(this.WT.amplitude-e)>=o||Math.abs(this.WT.radial-i)>=o)||1!==t){this.WT={amplitude:e,radial:i};break}}const s=this.hb.yb().start,r=this.hb.yb().end,n=this.hb.mb()?((null===(e=this.WT)||void 0===e?void 0:e.radial)||0)*this.hb.x.getPixelSize()+r-s:((null===(i=this.WT)||void 0===i?void 0:i.radial)||0)*this.hb.x.getPixelSize()+s-r;this.IS.ru(n).lu(360),this.PS.ru(n).lu(360);for(const t of this.Kf)t.Fe();ia.Tp(this,this.IS.getIsUnderMouse(),!1,this.MS,(t=>ia.$c(this,t,this.MS)),((t,e)=>t.$c(e,!0)));for(const t of this.MS)t.Ay();return super.pp(),this.UT(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.NT.setAnimationsEnabled(t),this.GT.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.Lo=t,this}getMouseInteractions(){return this.Lo}getMinimumSize(){return u(Kc,Kc)}UT(){}forEachAxis(t){return t(this.NT),t(this.GT),this}dispose(){return this.Kf.slice().forEach((t=>t.dispose())),this.Fp.dispose(),this.Wk.U(),this.ET.U(),this.zT.U(),this.VT.U(),this.OT.U(),this.Hm.U(),super.dispose()}Qd(){return[...this.MS,...this.Kf]}}const Kc=300;class Jc extends Ia{}class qc extends Jc{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Ms="Slice",this.S=0,this.um=!1,this.YT=z,this.fm=z,this.Am=this.S,this.ym=K((()=>this.Ki.cs.vs())),this.vm=()=>{this.xm=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this.bT=e.sc(r,hn.Simple).ds(this.getHighlight()),this.fs(this.bT),this.Ye=i.Dr(r).ds(this.getHighlight()),this.fs(this.Ye,{isText:!0})}setValue(t){return this.Ki.getAnimationsEnabled()?this.getVisible()&&this.wm(this.Am,t):this.Am=t,this.S=t,this.Ki.cs.vs(),this}getValue(){return this.S}setVisible(t){return!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.YT=t,this.fm=i,this.bT.ke(this.YT).Ce(e),this.Ye.ke(this.fm).Nh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},ed=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=td(i,r.x),s=td(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},m={x:0,y:n.bottom},y=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:m.x-x*o,y:m.y-o}),A=(i+c/u*(s-i))/2,g={x:a-A,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-S:S}`,10)},m={x:a+A,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&m.x>g.x&&p.bT.Sl([g,d,f,m])}};class id extends Qh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("funnelChart bg",0),r,i.cs.ts.funnelChartBackgroundFillStyle,i.cs.ts.funnelChartBackgroundStrokeStyle,i.cs.ts.funnelChartTitleFont,i.cs.ts.funnelChartTitleFillStyle,o),this.Cm=[],this.km=ka.None,this.Im=!0,this.Bm=0,this.HT=80,this.$T=20,this.XT=0,this.jT=e.FunnelSliceModes.VariableHeight,this.Em=!0,this.Vm=e.AutoCursorModes.onHover,this.Om=Ra,this.Nm=t=>{const e=this.Cm.indexOf(t);e>=0&&(this.Cm.splice(e,1),this.Gm())},this.cs.Gn(ah.lf),this.zm=this.ts.effectsText,this.Wm=i.Um("funnelChart bottom",0),this.Ym=i.Um("funnelChart top",1),this.bp.Eh("Funnel Chart"),this.Tm=this.ts.funnelChartSliceFillStylePalette,this.Fm=this.ts.funnelChartSliceStrokeStyle,this.Pm=this.ts.funnelChartSliceLabelFont,this.Dm=this.ts.funnelChartSliceLabelFillStyle,this.Hm=i.$m();const a=Ft(h?h.autoCursorBuilder:void 0,ba);this.Fp=a.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)),this.mp(n,this.pixelScale)}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 qc(this.Bm,this.Wm,this.Ym,this,this.pixelScale,this.Nm,this.ts,this.cs.hs);return this.Bm+=1,i.setName(t),i.setValue(e),i.hs.ns.Ss(this.zm),i.hs.os.Ss(this.Em),this.Cm.push(i),this.cs.vs(),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){return this.Dm="function"==typeof t?t(this.Dm):t,this.cs.vs(),this}getLabelFillStyle(){return this.Dm}setLabelFont(t){return this.Pm="function"==typeof t?t(this.Pm):t,this.cs.vs(),this}getLabelFont(){return this.Pm}setLabelEffect(t){return this.zm=t,this.Cm.forEach((e=>e.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);this.Cm=this.Cm.sort(this.km);for(let t=0,{length:e}=this.Cm;tt.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){t.setStyle(this.Gd?new G({color:this.Gd.getColors(t.getAnimatedValue())}):this.Tm(e,t),this.Fm,this.Dm,this.Pm)}Gm(){this.Cm=this.Cm.sort(this.km),this.cs.vs()}Qd(){return this.Cm}dispose(){return this.Cm.slice().forEach((t=>t.dispose())),this.Fp.dispose(),this.Wm.U(),this.Ym.U(),this.Hm.U(),super.dispose()}}const sd=(t,i,s)=>{const r=t.vl();if(r.length>0){let t;const n=(r[1].y-r[0].y)/2+r[0].y;return t=i===e.FunnelLabelSide.Left?(r[0].x-r[1].x)/2+r[1].x-s:(r[2].x-(4===r.length?r[3].x:r[1].x))/2+(4===r.length?r[3].x:r[1].x)+s,{x:t,y:n}}},rd=t=>{const e=t.vl();if(e.length>0)return{x:(e[2].x-e[1].x)/2+e[1].x,y:(e[1].y-e[0].y)/2+e[0].y}};class nd extends id{constructor(){super(...arguments),this.jm=Ca.NamePlusValue,this.ZT=10,this.QT=e.FunnelLabelSide.Left,this.JT=e.SliceLabelIndices.LabelsOnSides,this.Qm=[],this.ty=this.ts.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.ty=t;for(let t=0;t{const e=this.Cm.indexOf(t);e>=0&&this.Cm.splice(e,1)},this.cs.Gn(ah.uf),this.Ts=e.Um("gaugeChart layer",0),this.Ym=e.Um("gaugeChart top layer",1),this.bp.Eh("Gauge Chart"),this.mp(r,this.pixelScale);const h=Wi();this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),this.setAnimationsEnabled(void 0===o||o)}dispose(){return this.Ts.U(),this.Ym.U(),this.Cm.slice().forEach((t=>t.dispose())),super.dispose()}}class cd extends ud{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.jl=90,this.Zl=-270,this.tF={min:this.jl,max:this.Zl},this.iF=K((()=>this.Ts.vs())),this.sF=()=>{this.eF=void 0},this.hF=e.Um("radialGaugeChart bg arc",2),this.rF=this.Ts.Kc(this.pixelScale).ke(this.ts.gaugeChartEmptyGaugeFillStyle).Ce(this.ts.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.jl,s=this.Zl,r=this.tF;return this.getAnimationsEnabled()?this.nF(r,{min:t,max:e}):(r.min=t,r.max=e,this.jl=t,this.Zl=e),this.L.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.cs.vs(),this}getAngleInterval(){return{min:this.jl,max:this.Zl}}setGaugeFillStyle(t){return this.rF.ke(t),this.cs.vs(),this}setGaugeStrokeStyle(t){return this.rF.Ce(t),this.cs.vs(),this}nF(t,e,i){this.eF=this.iF(1e3,$.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.tF={min:t,max:e},this.jl=t,this.Zl=e,this.Ts.vs()})),this.eF.onEveryAnimationEnd(this.sF),i&&this.eF.onAnimationEnd(i)}onAngleIntervalChange(t){return this.L.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.L.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.hF.U(),this}}class dd extends Ia{oF(t){return this.L.on("valueChange",t)}aF(t){return this.L.on("valueIntervalChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}offIntervalChange(t){return this.L.off(t,"valueIntervalChange")}attach(t,e=!0,i=!1){return super.attach(t,e,i),this.styleAttachedEntry(t,e,i),this}styleAttachedEntry(t,e=!0,i=!1){le(t,this.ts,i,{fill:this.lF})}}class fd extends dd{onValueChange(t){return this.oF(t)}onIntervalChange(t){return this.aF(t)}}class gd extends fd{constructor(t,e,i,s,r,n,o){super(i,r,n,o),this.jl=0,this.Zl=0,this.uF=0,this.cF=0,this.dF=0,this.fF=100,this.AF=!0,this.Am=this.S,this.pm=this.getVisible(),this.ym=Me(),this.gF=t=>{this.Am=t,this.Ki.cs.vs()},this.pF=t,this.Br=e,this.Ki=i,this.scale=s,this.lF=this.ts.gaugeChartGaugeFillStyle,this._m=t.Kc(s).ke(this.lF).Ce(ot).ds(this.getHighlight()),this.fs(this._m),this.mF=e.Dr(s).ds(this.getHighlight()),this.fs(this.mF,{isText:!0}),this.yF=e.Dr(s).ds(this.getHighlight()),this.fs(this.yF,{isText:!0}),this.Ye=e.Dr(s).ds(this.getHighlight()),this.fs(this.Ye,{isText:!0}),this.mF.ke(n.gaugeChartIntervalLabelsFillStyle).Nh(n.gaugeChartIntervalLabelsFont),this.yF.ke(n.gaugeChartIntervalLabelsFillStyle).Nh(n.gaugeChartIntervalLabelsFont),this.Ye.ke(n.gaugeChartValueLabelFillStyle).Nh(n.gaugeChartValueLabelFont),this.setName("Gauge Slice")}Fe(){const t=this.Ki.getDataLabelFormatter(),e=this.jl/90r&&(i=r);const n=this.Zl-e*this.cF,o=this.jl+e*this.uF,h=this.fF-this.dF,a=(0!==h?(n-o)/h:1/0)*(i-this.dF);this._m.hu(o).Ve(o+a);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>r}):t.format(i);this.Ye.Eh(l)}SF(){const t=this.Ki.getIntervalLabelFormatter(),e="function"==typeof t?t(this.dF,{getInnerStart:()=>this.dF,getInnerEnd:()=>this.fF}):t.format(this.dF);return this.mF.Eh(e).Ds(),this.mF.ai()}vF(){const t=this.Ki.getIntervalLabelFormatter(),e="function"==typeof t?t(this.fF,{getInnerStart:()=>this.dF,getInnerEnd:()=>this.fF}):t.format(this.fF);return this.yF.Eh(e).Ds(),this.yF.ai()}setName(t){return super.setName(t),this.Ki.cs.vs(),this}setValue(t){const e=this.S;return this.Ki.getAnimationsEnabled()?this.pm&&this.ym(e,t,this.gF):this.Am=t,this.S=t,this.L.emit("valueChange",this,e,t),this.Ki.cs.vs(),this}getValue(){return this.S}setVisible(t){return this.pm=t,!1===t?this.Ki.getAnimationsEnabled()&&this.Am>0?this.ym(this.Am,0,this.gF,{onCompleted:()=>super.setVisible(!1)}):(this.Am=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(super.setVisible(!0),this.ym(this.Am,this.S,this.gF)):(this.Am=this.S,super.setVisible(!0)),this}setInterval(t,e){const i=this.dF,s=this.fF;return this.L.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.dF=t,this.fF=e,this.Ki.cs.vs(),this}setIntervalLabelsFont(t){return this.mF.Nh(t),this.yF.Nh(t),this.Ki.cs.vs(),this}getIntervalLabelsFont(){return this.mF.Oh()}setIntervalLabelsFillStyle(t){return this.mF.ke(t),this.yF.ke(t),this.Ki.cs.vs(),this}getIntervalLabelsFillStyle(){return this.mF.zh()}setIntervalLabelsVisible(t){return t?(this.mF.setVisible(!0),this.yF.setVisible(!0)):(this.mF.setVisible(!1),this.yF.setVisible(!1)),this.AF=t,this}getIntervalLabelsVisible(){return this.AF}setAngleInterval(t,e){return this.jl=t,this.Zl=e,this.Ki.cs.vs(),this}setMinAngle(t){return this.jl=t,this.Ki.cs.vs(),this}setMaxAngle(t){return this.Zl=t,this.Ki.cs.vs(),this}setMarginInDegrees(t=this.uF,e=this.cF){return t!==this.uF&&(this.uF=t),e!==this.cF&&(this.cF=e),this.Ki.cs.vs(),this}setFillStyle(t){this.lF="function"==typeof t?t(this.lF):t;const e=this.lF;this._m.ke(e);for(let t=0;tr?25*s:25*r))){const o=Array(n+2),h=Math.PI;let a=0,l=0;const c=e*h/180,d=(i*h/180-c)/n;for(o[a]=u(t.x,t.y),a+=1;a<=n+1;)o[a]=u(t.x+s*Math.cos(c+l*d),t.y+r*Math.sin(c+l*d)),a+=1,l+=1;return[o,n]}class yd extends cd{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Od=20,this.MF=new Intl.NumberFormat,this._F=new Intl.NumberFormat,this.wF=!1,this.CF=5;const h=new gd(this.Ts,this.Ym,this,this.pixelScale,this.Nm,this.ts,this.cs.hs);this.kF=h,this.Cm.push(h),this.setPadding(10)}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=ta.Cp(this.bp,this.Sp),i=Ze([this.kF.SF(),this.kF.vF()]),s=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right+2*i.max.x),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+1*i.max.y+e)),r=Math.max(.5*Math.min(s.x,s.y),0),n=u(this.ya.left+i.max.x+.5*s.x,this.ya.bottom+i.max.y+.5*s.y),o=this.wF?this.TF(n,r):n,h=this.rF.Me.getThickness(),a=r-.5*h,l=r-this.Od;let c=l/r*100;c=c>100||c<0?99:c;const d=100*(1-(this.Od-h)/r);this.FF(o,l)&&(this.rF.ru(r).au(c),this.kF._m.ru(a).au(d));const f=.5*(g=r,(m=this.Zl-this.jl)/(2*Math.PI*g*(m/360))*h);var g,m;this.rF.hu(this.jl).Ve(this.Zl).Ie(o),this.kF._m.Ie(o),this.kF.Ye.Ie(o),this.Gd&&this.kF.setFillStyle(new G({color:this.Gd.getColors(this.kF.getAnimatedValue())})),this.kF.setMinAngle(this.jl).setMaxAngle(this.Zl).setMarginInDegrees(f,f).Fe();const y=this.rF.Ql();if(this.kF.getIntervalLabelsVisible()){this.IF(this.jl,this.Zl,o,y+this.CF);const t=this.kF.mF.Ds().Ue(),e=this.kF.yF.Ds().Ue();Ne(t,e)&&this.PF(t,e,o,y+this.CF)}}FF(t,e){const i=ni(this.kF.Ye.Ds().ai(),.5),s=t.x+e,r=t.x-e,n=t.y+e,o=t.y-e;return!(t.x+i.x>s||t.x-i.xn||t.y-i.y=0?i=-s:s=-i),[i,s]}TF(t,e){const[i]=md(t,this.jl,this.Zl,e,e),s=Ze(i),r=.5*(s.max.x-s.min.x),n=.5*(s.max.y-s.min.y);return oi(hi(t,u(s.min.x+r,s.min.y+n)),t)}IF(t,e,i,s){const r=gi(t),n=gi(e);this.kF.mF.Ie(ti(u(i.x+s,i.y),i,-r)),this.kF.yF.Ie(ti(u(i.x+s,i.y),i,-n)),this.kF.mF.za(u(-Math.cos(r),-Math.sin(r))),this.kF.yF.za(u(-Math.cos(n),-Math.sin(n)))}getDefaultSlice(){return this.kF}setAutoScaling(t){return this.wF=t,this.cs.vs(),this}getAutoScaling(){return this.wF}setDataLabelFormatter(t){return this._F=t,this.cs.vs(),this}getDataLabelFormatter(){return this._F}setIntervalLabelFormatter(t){return this.MF=t,this.cs.vs(),this}getIntervalLabelFormatter(){return this.MF}setIntervalLabelPadding(t){return this.CF=t,this.cs.vs(),this}getIntervalLabelPadding(){return this.CF}setThickness(t){return this.Od=t,this}setLUT(t){return this.Gd=t,this.cs.vs(),this}setDataLabelFont(t){return this.kF.Ye.Nh(t),this.cs.vs(),this}getDataLabelFont(){return this.kF.Ye.Oh()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.kF.xF(t),this.cs.vs(),this}getDataLabelFillStyle(){return this.kF.bF()}Qd(){return this.Cm}dispose(){return this.kF.dispose(),super.dispose()}}class pd extends Ia{}class xd extends pd{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Ms="Slice",this.S=0,this.um=!1,this.YT=z,this.fm=z,this.Am=this.S,this.ym=K((()=>this.Ki.cs.vs())),this.vm=()=>{this.xm=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this.bT=e.sc(r,hn.Simple).ds(this.getHighlight()),this.fs(this.bT),this.Ye=i.Dr(r).ds(this.getHighlight()),this.fs(this.Ye,{isText:!0})}setValue(t){return this.Ki.getAnimationsEnabled()?this.getVisible()&&this.wm(this.Am,t):this.Am=t,this.S=t,this.Ki.cs.vs(),this}getValue(){return this.S}setVisible(t){return!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.YT=t,this.fm=i,this.bT.ke(this.YT).Ce(e),this.Ye.ke(this.fm).Nh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Ad=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=Sd(i,r.x),s=Sd(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},m={x:0,y:n.bottom},y=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:m.x-x*o,y:m.y-o}),A=(i+c/u*(s-i))/2,g={x:a-A,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-S:S}`,10)},m={x:a+A,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&m.x>=g.x&&p.bT.Sl([g,d,f,m])}};class vd extends Qh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("pyramidChart bg",0),r,i.cs.ts.pyramidChartBackgroundFillStyle,i.cs.ts.pyramidChartBackgroundStrokeStyle,i.cs.ts.pyramidChartTitleFont,i.cs.ts.pyramidChartTitleFillStyle,o),this.Cm=[],this.km=ka.None,this.Tm=this.ts.pyramidChartSliceFillStylePalette,this.Fm=this.ts.pyramidChartSliceStrokeStyle,this.Im=!0,this.Pm=this.ts.pyramidChartSliceLabelFont,this.Dm=this.ts.pyramidChartSliceLabelFillStyle,this.Bm=0,this.HT=0,this.$T=80,this.XT=0,this.jT=e.PyramidSliceModes.VariableHeight,this.Em=!0,this.Vm=e.AutoCursorModes.onHover,this.Om=Ra,this.Nm=t=>{const e=this.Cm.indexOf(t);e>=0&&(this.Cm.splice(e,1),this.Gm())},this.cs.Gn(ah.lf),this.zm=this.ts.effectsText,this.Wm=i.Um("pyramidChart bottom",0),this.Ym=i.Um("pyramidChart top",1),this.bp.Eh("Pyramid Chart"),this.Hm=i.$m();const a=Ft(h?h.autoCursorBuilder:void 0,ba);this.Fp=a.am(this.Hm,this.uiScale,this.uiScale,this.ts),this.mp(n,this.pixelScale),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 xd(this.Bm,this.Wm,this.Ym,this,this.pixelScale,this.Nm,this.ts,this.cs.hs);return this.Bm+=1,i.setName(t),i.setValue(e),i.hs.ns.Ss(this.zm),i.hs.os.Ss(this.Em),this.Cm.push(i),this.cs.vs(),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){return this.Dm="function"==typeof t?t(this.Dm):t,this.cs.vs(),this}getLabelFillStyle(){return this.Dm}setLabelFont(t){return this.Pm="function"==typeof t?t(this.Pm):t,this.cs.vs(),this}getLabelFont(){return this.Pm}setLabelEffect(t){return this.zm=t,this.Cm.forEach((e=>e.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);this.Cm=this.Cm.sort(this.km);for(let t=0,{length:e}=this.Cm;tt.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){t.setStyle(this.Gd?new G({color:this.Gd.getColors(t.getAnimatedValue())}):this.Tm(e,t),this.Fm,this.Dm,this.Pm)}Gm(){this.Cm=this.Cm.sort(this.km),this.cs.vs()}Qd(){return this.Cm}dispose(){return this.Cm.slice().forEach((t=>t.dispose())),this.Fp.dispose(),this.Wm.U(),this.Ym.U(),this.Hm.U(),super.dispose()}}const bd=(t,i,s)=>{const r=t.vl();if(r.length>0){let t;const n=(r[1].y-r[0].y)/2+r[0].y;return t=i===e.PyramidLabelSide.Left?(r[0].x-r[1].x)/2+r[1].x-s:(r[2].x-(4===r.length?r[3].x:r[1].x))/2+(4===r.length?r[3].x:r[1].x)+s,{x:t,y:n}}},Md=t=>{const e=t.vl();if(e.length>0)return{x:(e[2].x-e[1].x)/2+e[1].x,y:(e[1].y-e[0].y)/2+e[0].y}};class Ed extends vd{constructor(){super(...arguments),this.jm=Ca.NamePlusValue,this.ZT=10,this.QT=e.PyramidLabelSide.Left,this.JT=e.SliceLabelIndices.LabelsOnSides,this.Qm=[],this.ty=this.ts.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.ty=t;for(let t=0;t(t.alignmentX=(r+Math.PI/2)%(2*Math.PI)<=Math.PI?-1:1,t.alignmentY=r%(2*Math.PI)<=Math.PI?-1:1,t.paddingX=Math.cos(r)*n,t.paddingY=Math.sin(r)*n,t),Rd=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Id;e.SpiderWebMode=void 0,(Id=e.SpiderWebMode||(e.SpiderWebMode={}))[Id.Normal=0]="Normal",Id[Id.Circle=1]="Circle";class Fd{constructor(t,e,i,s,n,o,h,a){this.L=new r.Eventer,this.BF=t,this.Br=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.LF=h,this.RF=a,this.EF=this.BF.ze(this.scale).setMouseInteractions(!1),this.zF=this.Br.Dr(this.scale).Eh(this.tag).setMouseInteractions(!1),this.VF=this.LF(this,this.BF.sy(this.scale,void 0,[za.InternalUI])).Ee(this.chart.getNibStyle()),this.RF.As([this.zF])}Zm(t,i,s,r,n,o,h){const a=i.length,l=i[s>0?s-1:a-1],c=i[s],d=i[s{const n=s/i,o=[];for(let h=-s/2;h<=s/2;h+=r){const r=n*(h/s)+e,a=u(t.x+Math.cos(r)*i,t.y+Math.sin(r)*i);o.push(a)}return o})(t,r,n,f)),h?this.zF.setVisible(!0).Ie(oi(c,u(h.paddingX,h.paddingY))).Ba(h.alignmentX).Ra(h.alignmentY):this.zF.setVisible(!1)}getLabelSize(){return this.zF.Nh(this.chart.getAxisLabelFont()).ke(this.chart.getAxisLabelStyle()).Ds().ai()}dispose(){this.EF&&this.EF.dispose(),this.zF&&this.zF.dispose(),this.VF&&this.VF.dispose()}}const Dd=(t,e,i,s,r)=>{const n=e.getIcon();return n?t.addRow(n,e.getName()):t.addRow(e.getName()),t.addRow("Axis:","",s).addRow("Value:","",r(i))};class Ld extends Gl{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this.Ms="Spider Series",this.yu=new Map,this.$i=e.HighlightModes.onHover,this.Om=Dd,this.$b=8,this.ga=0,this.OF=Me(),this.NF={},this.GF={},this.pm=this.getVisible(),this.WF=1,this.UF=((t,e)=>{const i=K((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||$.ease,u=(null==a?void 0:a.durationMs)||1e3;s&&(s.finish(!1),s=void 0),!1===o?h&&n?(s=i(u,l)([[n,0]],(([e])=>{n=e,t(n)})),s.onAnimationEnd((()=>{s=void 0,e(!1)}))):(n=0,e(!1)):h?(e(!0),s=i(u,l)([[n,1]],(([e])=>{n=e,t(n)})),s.onAnimationEnd((()=>{s=void 0}))):(n=1,e(!0))}})((t=>{this.WF=t,this.Ts.cs.vs()}),(t=>{super.setVisible(t)})),this.Ki=t,this.Ts=i,this.Xb=r,this.YF=n,this.gx=o,this.HF=h,this.$F=a,this.scale=s,this.XF=fe(u.spiderSeriesFillStyle,c),this.jF=fe(u.spiderSeriesStrokeStyle,c),this.ZF=fe(u.spiderSeriesPointFillStyle,c)}qy(){return this.iS&&this.yu.size>0&&this.getVisible()}addPoints(...t){this.yu.size>0&&this.Ki.cs.Gn(ah.xf),t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.OF(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.yu.set(s,r+t*(e-r)),this.Ts.cs.vs()}))}),{easing:this.NF.easing,durationMs:this.NF.durationMs,onStart:()=>{i=new Map(this.yu)}})}else for(let e=0;e=3&&(this.bT||(this.bT=this.Ts.sc(this.scale,hn.Simple).Ce(this.jF).ke(this.XF).ds(this.getHighlight()),this.fs(this.bT)),this.bT.Sl(t),this.jb||(this.jb=this.Ts.bS(this.scale).tt(this.$b).sl(this.Xb).Gh(this.ga).ke(this.ZF).ds(this.getHighlight()),this.fs(this.jb)),this.jb.Gt().ol(t))}}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.XF,stroke:this.jF}),this}ks(){return this.bs||this.Xb}QF(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},_d=t=>Ze(t.zF.Ue()),Pd=t=>Ze(t.Ue()),Bd=(t,i,s,r)=>t.au(0).Ie(s).hu(90).Ve(-270).lu(i===e.SpiderWebMode.Circle?void 0:r.length),zd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Nd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Ud=()=>{Nd.alignmentX=0,Nd.alignmentY=0,Nd.paddingX=0,Nd.paddingY=0};class Od extends al{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("spiderChart bg",0),r,i.cs.ts.spiderChartBackgroundFillStyle,i.cs.ts.spiderChartBackgroundStrokeStyle,i.cs.ts.spiderChartTitleFont,i.cs.ts.spiderChartTitleFillStyle,h),this.ya=x(20,20,20,20),this.axisScale=ut.d1({scale1DConstructor:Di,dimension:"x"}).K(0,1),this.gx=[],this.JF=[],this.KF=[],this.qF=zs.expansion,this.tI=!0,this.iI=Rd,this.sI=Cd,this.Lo=!0,this.eI=e.SpiderWebMode.Normal,this.hI=4,this.rI=this.ts.spiderChartWebStyle,this.nI=this.ts.spiderChartScaleLabelFillStyle,this.oI=this.ts.spiderChartScaleLabelFont,this.aI=5,this.lI=this.ts.spiderChartAxisLabelFillStyle,this.uI=this.ts.spiderChartAxisLabelFont,this.cI=5,this.dI=this.ts.spiderChartAxisStrokeStyle,this.fI=this.ts.spiderChartAxisNibStrokeStyle,this.Df=10,this.AI=x(),this.Vm=e.AutoCursorModes.onHover,this.hasAxis=t=>this.gx.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.Bi(t,Ii.Numeric),this.gI=()=>{const t=this.gx.map(_d).concat(this.KF.map(Pd));return Oe(t)},this.pI=()=>this.mI.Kc(this.pixelScale).setMouseInteractions(!1),this.yI=t=>t.dispose(),this.SI=()=>this.bA.Dr(this.pixelScale).setMouseInteractions(!1),this.vI=t=>t.dispose(),this.xI=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.bI=(t,e)=>{let i,s;const r=()=>{void 0!==this.MI&&this.MI.finish(),i=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.qF,this.qF=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.gx.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=Vd(a,this.gx.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=ri(hi(t.EF.Pi(),t.EF.Fi())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.K(i.min,l),Zt(o),this.cs.vs()}},o=()=>{if(i=void 0,void 0!==s)if(this.ih){const t=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this._I(),i=s;if(void 0!==e){const s=i.start(t.min,t.max,e.min,e.max),r=i.end(t.min,t.max,e.min,e.max);this.MI=this.tp.cs.en(300,$.ease)([[0,1]],(([e])=>{this.axisScale.K(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.MI.onAnimationEnd((()=>{this.MI=void 0,this.qF=i}))}else this.qF=s}else this.qF=s;s=void 0};e.setMouseEnterEventHandler(this.wI).setMouseLeaveEventHandler(this.CI).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=Wi(new $i(((t,e,i)=>{this.wI(t),r(),Zt(i)}),n,((t,e,i,s)=>{this.CI(t),o(),Zt(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.kI=t=>{this.tI&&!this.hasAxis(t)&&this.addAxis(t)},this.HF=(t,e)=>{for(const i of this.gx)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return je(i.EF.Pi(),i.EF.Fi(),t)}},this.$F=t=>{if(0===this.gx.length)return;const e=hi(dt(t,this.engine.scale,this.pixelScale),this.gx[0].EF.Pi()),i=Math.atan2(e.y,e.x);let s,r=Le;for(const t of this.gx){const e=hi(t.EF.Fi(),t.EF.Pi()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.Lo&&(t.Ee(this.fI),this.cs.vs())},this.CI=t=>{t.Ee(this.fI),this.cs.vs()},this.cs.Gn(ah.cf),this.Wk=i.Ax("spiderChart series bg",0),this.mI=i.Um("spiderChart web shapes",0),this.TI=i.Um("spiderChart axis bg",1),this.Wx=i.Um("spiderChart plotting",2),this.bA=i.Um("spiderChart fg",3),this.RF=this.hs.yg().Ss(this.ts.effectsText),this.bp.Eh("Spider Chart"),this.IS=this.Wk.Kc(this.pixelScale).ke(this.ts.spiderChartSeriesBackgroundFillStyle).Ce(ot).hu(90).Ve(-270).au(0),this.PS=this.Wk.Kc(this.pixelScale).ke(z).Ce(this.ts.spiderChartSeriesBackgroundStrokeStyle).hu(90).Ve(-270).au(0),super.FS(this.IS,this.PS),this.Hm=i.$m();const a=Ft(o?o.autoCursorBuilder:void 0,Aa);this.Fp=a.am(this.Hm,this.uiScale,this.uiScale,this.ts),ia.Ip(this),this.RS(((t,e)=>{ia.Pp(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.mp(n,this.pixelScale)}getSeries(){return this.MS}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}solveNearest(t){const e=t||this.cs.Nn();if(e)return ia.$c(this,rh(e,this.cs),this.MS)}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Fd(this.TI,this.bA,this.pixelScale,this,t,this.axisScale,this.bI,this.RF);this.gx.push(e)}}else t&&this.gx.push(t);return this.RF.As(this.gx.map((t=>t.zF))),this.cs.vs(),this}addSeries(t){const i="object"==typeof t?t.pointShape?t.pointShape:e.PointShape.Circle:t||e.PointShape.Circle,s="object"==typeof t&&t.automaticColorIndex?t.automaticColorIndex:this.MS.length,r=new Ld(this,this.Wx,this.pixelScale,i,this.kI,this.gx,this.HF,this.$F,this.wS,this.ts,s,this.cs.hs);return this.DS(r),r}getSeriesCount(){return this.MS.length}setWebMode(t){return this.eI=t,this.cs.vs(),this}getWebMode(){return this.eI}setWebCount(t){return this.hI=t,this.cs.vs(),this}getWebCount(){return this.hI}setWebStyle(t){return this.rI="function"==typeof t?t(this.rI):t,this.cs.vs(),this}getWebStyle(){return this.rI}setScaleLabelStyle(t){return this.nI="function"==typeof t?t(this.nI):t,this.cs.vs(),this}getScaleLabelStyle(){return this.nI}setScaleLabelFont(t){return this.oI="function"==typeof t?t(this.oI):t,this.cs.vs(),this}getScaleLabelFont(){return this.oI}setScaleLabelPadding(t){return this.aI=t,this.cs.vs(),this}getScaleLabelPadding(){return this.aI}setScaleLabelStrategy(t){return this.iI=t,this.cs.vs(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.cs.vs(),this}setAxisLabelStyle(t){return this.lI="function"==typeof t?t(this.lI):t,this.cs.vs(),this}getAxisLabelStyle(){return this.lI}setAxisLabelFont(t){return this.uI="function"==typeof t?t(this.uI):t,this.cs.vs(),this}getAxisLabelFont(){return this.uI}setAxisLabelEffect(t){return this.RF.Ss(t),this.cs.vs(),this}getAxisLabelEffect(){return this.RF.xs()}setAxisLabelPadding(t){return this.cI=t,this.cs.vs(),this}getAxisLabelPadding(){return this.cI}setAxisLabelStrategy(t){return this.sI=t,this.cs.vs(),this}setAxisStyle(t){return this.dI="function"==typeof t?t(this.dI):t,this.cs.vs(),this}getAxisStyle(){return this.dI}setNibStyle(t){return this.fI="function"==typeof t?t(this.fI):t,this.cs.vs(),this}getNibStyle(){return this.fI}setNibLength(t){return this.Df=t,this.cs.vs(),this}getNibLength(){return this.Df}setAutoAxis(t){return this.tI=t,this}getAutoAxis(){return this.tI}setMouseInteractions(t){return this.Lo=t,this}getMouseInteractions(){return this.Lo}setAxisScrollStrategy(t){return this.qF=t,this.cs.vs(),this}getAxisScrollStrategy(){return this.qF}setAxisInterval(t,e=0){return this.axisScale.K(e,t),this.cs.vs(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp);const e=this.gx.length,i=ta.Cp(this.bp,this.Sp),s=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+i)),r=((t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}))(0,0,0,0);if(void 0!==this.sI){const t=Math.min(s.x,s.y)/2;for(let i=0;i0?r.right=Math.max(r.right,l.x+.5*(1-a.alignmentX)*h.x-t):r.left=Math.max(r.left,-l.x+.5*(a.alignmentX+1)*h.x-t),o>0?r.top=Math.max(r.top,l.y+.5*(1-a.alignmentY)*h.y-t):r.bottom=Math.max(r.bottom,-l.y+.5*(a.alignmentY+1)*h.y-t)}}if(this.qF){const t=this._I();if(void 0!==t){const e=this.qF.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.qF.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.K(e,i)}}const n=u(this.pixelScale.x.getInnerStart()+(r.left+this.pixelScale.x.getInnerInterval()-r.right)/2,this.pixelScale.y.getInnerStart()+(r.bottom+this.pixelScale.y.getInnerInterval()-r.top)/2),o=Math.min(s.x/2-(r.left+r.right)/2,s.y/2-(r.bottom+r.top)/2);this.AI=x(this.jt.left+this.ya.left+r.left,this.jt.top+this.ya.top+i+r.top,this.jt.right+this.ya.right+r.right,this.jt.bottom+this.ya.bottom+r.bottom),this.Zm(n,o);for(const t of this.MS)t.aS();for(const t of this.MS)t.Fe();super.pp(),ia.Tp(this,this.IS.getIsUnderMouse(),!1,this.MS,(t=>ia.$c(this,t,this.MS)),((t,e)=>t.$c(e,!0)));for(const t of this.MS)t.Ay()}dispose(){return this.Wk.U(),this.mI.U(),this.TI.U(),this.Wx.U(),this.bA.U(),this.Fp.dispose(),this.Hm.U(),super.dispose()}getMinimumSize(){return u(this.AI.left+this.AI.right+100,this.AI.bottom+this.AI.top+100)}Zm(t,e){const i=this.gx.length,s=[];for(let r=0;r{const a=t.length,l=n.length,u=e>0&&l>1;for(let l=0;l=a&&t.push(o());const h=t[l];Bd(h,i,s,n);const u=r*((l+1)/e);h.ru(u)}else l{const c=r.length,d=t.length;let f=0;if(void 0!==e)for(let a=0;a=d&&t.push(h());const e=t[f];f+=1;const s=(i-r)/i,c=je(n,o[a],s);e.Ie(oi(c,u(y.paddingX,y.paddingY))).Ba(y.alignmentX).Ra(y.alignmentY).Eh(l(s))}}}for(let e=f;e1;for(const s of this.gx)for(const r of this.MS){const n=r.getValue(s.tag,i);void 0!==n&&(t=void 0===t?n:Math.min(t,n),e=void 0===e?n:Math.max(e,n))}if(void 0!==t&&void 0!==e)return m(t,e)}}const Gd=(t,e)=>{const i=Math.floor(99999/e),s=Math.floor(99999/e),r=Math.floor(99998/e),n=Math.floor(99998/e),o=Math.floor(99999/(e+1)),h=Math.floor(89999/(e+1)),a=510001+e*h;let l=0;return{FI:()=>{const e=t.II("dashboard ui",a+l);return l+=1,e},DI:()=>t.II("dashboard legend",51e4),BI:e=>{const a=1+e*i,l=100001+e*s,u=200002+e*r,c=300002+e*n,d=400001+e*o,f=510001+e*h;let g=0;return{cs:t,yp:(e,i)=>{const s=a+i;return t.II(e,s)},Ax:(e,i)=>{const s=l+i;return t.II(e,s)},Yk:(e,i)=>{const s=u+i;return t.II(e,s)},Um:(e,i)=>{const s=c+i;return t.II(e,s)},ux:(e,i,s)=>{const r=c+i;return t.LI(e,r,s)},xp:(e,i)=>{const s=d+i;return t.II(e,s)},op:e=>{const i=f+g,s=t.II(e,i);return g+=1,s},lp:()=>t.II("panel legend",500002+e),$m:()=>t.II("panel cursor",600001+e)}}}};class Yd{constructor(t){this.L=new r.Eventer,this.S=t}M(t){return this.S=t,this.L.emit("set",t),this}_(){return this.S}N(t){return this.L.on("set",t)}W(t){return this.L.off(t,"set")}}const Hd={dh:()=>{},sh:!1,eh:0,hh:!1,oh:0,rh:!1,ah:0,lh:0,Ke:zs.fitting},Xd=t=>{if(!t||"object"!=typeof t||null===t)return!1;const e=t.type;return!(!e||!["spark-line","spark-bar","spark-win-loss","spark-area","spark-pie"].includes(e))},Wd=(t,e,i,s,r,n,o,h)=>{const{type:a,data:l}=t;if(0===l.length)return;const u=[s,r];"spark-line"===a&&ef(t,e,u,n,o,h),"spark-bar"===a&&sf({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&sf({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&rf(t,e,u,n,o,h),"spark-pie"===a&&nf(t,e,u,n,o,h)},jd=(t,e,i,s)=>({x:Zd(t.x,e.x,i.x,s),y:Kd(t.y,e.y,i.y,s)}),$d=(t,e,i,s)=>({position:Zd(t.position,e.x,i.x,s),high:Kd(t.high,e.y,i.y,s),low:Kd(t.low,e.y,i.y,s)}),Zd=(t,e,i,s)=>{const r=Rt(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},Kd=(t,e,i,s)=>{const r=Rt(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},Jd=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&qd(a,e,i,r,n,o,h),"axis-band"===a.type&&Qd(a,i,r,n,o,h),"constant-line"===a.type&&tf(a,i,s,r,n,o,h)},qd=(t,i,s,r,n,o,h)=>{const{value:a,fillStyle:l,shape:u,size:c,rotation:d}=t;let f={x:NaN,y:NaN};if("start"===a&&(f=i[0]),"end"===a&&(f=i[i.length-1]),"min"===a){f=i[0];for(const t of i)f=f.yt.y?f:t}("object"!=typeof a||(f=jd(a,s,r,n),((t,e)=>{const i=e[0],s=e[1],r=t.x,n=t.y;return i.x<=r&&r<=i.x+s.x&&i.y<=n&&n<=i.y+s.y})(f,n)))&&o.pointSet.add().Gt().sl(void 0!==u?u:e.PointShape.Circle).Gh(d||0).tt(c||5).ke(l||h.sparkPointChartFillStyle).ol(f)},Qd=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(Ve,Le),f=u(Ve,Le);"x"===o&&(d=jd({x:h,y:Ve},e,i,s),f=jd({x:a,y:Le},e,i,s)),"y"===o&&(d=jd({x:Ve,y:h},e,i,s),f=jd({x:Le,y:a},e,i,s));const g=s[0],m=s[1],y=Rt(d.x,g.x,g.x+m.x),p=Rt(d.y,g.y,g.y+m.y),x=Rt(f.x,g.x,g.x+m.x),S=Rt(f.y,g.y,g.y+m.y);r.rect.add().dl(y).fl(p).tt(u(x-y,S-p)).ke(l||n.sparkChartBandFillStyle).Ce(c||n.sparkChartBandStrokeStyle).Ce(ot)},tf=(t,e,i,s,r,n,o)=>{const{axis:h,value:a,strokeStyle:l}=t,c=a||0,d=e.y,f=i.y,g=e.x,m=i.x,y=[];if("y"===h&&d<=c&&c<=f){const t=jd(u(g,c),{x:g,y:d},s,r),e=jd(u(m,c),{x:g,y:d},s,r);y.push([t,e])}if("x"===h&&g<=c&&c<=m){const t=jd(u(c,d),{x:g,y:d},s,r),e=jd(u(c,f),{x:g,y:d},s,r);y.push([t,e])}y.length>0&&n.line.add().Ee(l||o.sparkChartConstantLineStrokeStyle).Oe(y[0][0]).Ve(y[0][1])},ef=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.$n&&bt.console.warn("LightningChart JS warning: SparkLineChart has over 10000 data points. This feature is not designed for large data sets which might show as performance drop. If you want to request improvements to this, contact https://lightningchart.com/js-charts/docs/contact. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let u=Le,c=Ve,d=Le,f=Ve;for(let t=0;tjd(t,{x:u,y:d},g,i)));e.lineSet.add().ds(n).Ee(o||s.sparkLineChartStrokeStyle).Gt().ol(m),a&&Jd(a,m,{x:u,y:d},{x:c,y:f},g,i,e,s)},sf=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,threshold:l,winFillStyle:u,lossFillStyle:c}=t,d=t.barSize||1,f=t.gap||1,g=t.winLoss,m=l||0,y=f/d*1;let p=Le,x=Ve;if(g)p=-1,x=1;else for(const t of o)p=Math.min(p,t),x=Math.max(x,t);const S={x:0,y:g?-1:Math.min(0,p)},A={x:1*o.length+(o.length-1)*y,y:g?2:Math.max(x,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*y,y:g?t>=m?1:0:t},r=jd({x:1*e+e*y,y:g?t>=m?0:-1:0},S,A,i),n=jd(s,S,A,i);return{value:t,position:r,width:n.x-r.x,height:n.y-r.y}})).forEach((t=>{var i;e.rect.add().ds(n).Ie(t.position).pl(t.height).Al(t.width).ke((i=t.value,g?(i>=m?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).Ce(a||s.sparkBarChartStrokeStyle)}))},rf=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.$n&&bt.console.warn("LightningChart JS warning: SparkAreaChart has over 10000 data points. This feature is not designed for large data sets which might show as performance drop. If you want to request improvements to this, contact https://lightningchart.com/js-charts/docs/contact. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let c=Le,f=Ve,g=Le,m=Ve;for(let t=0;t{const{data:o,strokeStyle:h}=t,a=o.map((t=>"number"==typeof t?t:t.value)),l=o.map((t=>"object"==typeof t?t.fillStyle:void 0)),c=a.reduce(((t,e)=>t+e),0),d=jd(u(50,50),{x:0,y:0},{x:100,y:100},i),f=i[1],g=f.x<=f.y?f.x/2:f.y/2;let m=90;a.forEach(((t,i)=>{const r=t/c*360;e.arc.add().ds(n).Ie(d).ru(g).au(0).hu(m).Ve(m+r).ke(l[i]||fe(s.sparkPieChartFillStyle,i)).Ce(h||s.sparkPieChartStrokeStyle),m+=r}))};var of,hf,af;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(of||(of={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(hf||(hf={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(af||(af={}));class lf extends fn{constructor(t,e,i,s,r){super(),this.Bs=!1,this.k_={x:0,y:0,height:20,width:20},this.RI={x:10,y:10},this.Ts=t,this.EI=r,this.zI=new mo(t,e,i,kt,s).setMouseInteractions(!0),this.VI=t.sc(e,hn.Simple).ke(s.dataGridScrollBarButtonArrowFillStyle).Ce(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.Mu(this),this.zI.onMouseEnter((t=>t.setHighlight(1))),this.zI.onMouseLeave((t=>t.setHighlight(0)))}OI(){switch(this.EI){case af.Up:this.VI.Sl([{x:this.k_.x,y:this.k_.y+this.RI.y/2},{x:this.k_.x+this.RI.x/2,y:this.k_.y-this.RI.y/2},{x:this.k_.x-this.RI.x/2,y:this.k_.y-this.RI.y/2}]);break;case af.Down:this.VI.Sl([{x:this.k_.x-this.RI.x/2,y:this.k_.y+this.RI.y/2},{x:this.k_.x+this.RI.x/2,y:this.k_.y+this.RI.y/2},{x:this.k_.x,y:this.k_.y-this.RI.y/2}]);break;case af.Left:this.VI.Sl([{x:this.k_.x-this.RI.x/2,y:this.k_.y},{x:this.k_.x+this.RI.x/2,y:this.k_.y+this.RI.y/2},{x:this.k_.x+this.RI.x/2,y:this.k_.y-this.RI.y/2}]);break;case af.Right:this.VI.Sl([{x:this.k_.x-this.RI.x/2,y:this.k_.y+this.RI.y/2},{x:this.k_.x+this.RI.x/2,y:this.k_.y},{x:this.k_.x-this.RI.x/2,y:this.k_.y-this.RI.y/2}])}}Ie(t){return this.k_.x=t.x,this.k_.y=t.y,this}Ia(){return u(this.k_.x,this.k_.y)}tt(t){return this.k_.height=t.x,this.k_.width=t.y,this}ai(){return{x:this.k_.height,y:this.k_.width}}onMouseDown(t){return this.zI.onMouseDown(t)}onMouseUp(t){return this.zI.onMouseUp(t)}setFillStyle(t){return this.zI.setFillStyle(t),this}getFillStyle(){return this.zI.getFillStyle()}setStrokeStyle(t){return this.zI.setStrokeStyle(t),this}getStrokeStyle(){return this.zI.getStrokeStyle()}Fe(){return this.zI.Fe(),this.OI(),this}Ds(){return this.zI.setSize(u(this.k_.height,this.k_.width)).setPosition(u(this.k_.x,this.k_.y)),this}setVisible(t){return this.zI.setVisible(t),this.VI.setVisible(t),this}dispose(){return this.zI.dispose(),this.VI.dispose(),this}setMouseInteractions(t){return this.zI.setMouseInteractions(t),this}getMouseInteractions(){return this.zI.getMouseInteractions()}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}getHighlight(){return this.zI.getHighlight()}setHighlight(t){return this.zI.setHighlight(Ae(t)),this.L.emit("highlight",this,Boolean(t)),this.Ts.vs(),this}}const uf=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class cf{constructor(t,i,s,n,o,h,a){this.qc={x:0,y:0},this.k_={x:0,y:0,height:0,width:0},this.L=new r.Eventer,this.NI={min:u(0,0),max:u(0,0)},this.CM=!1,this.kM=!1,this.GI={x:0,y:0},this.wu=void 0,this.WI=u(0,0),this.UI={x:0,y:0},this.YI=0,this.HI=15,this.TM=(t,i)=>{this.CM=!0,this.bA.vs();const s=this.$I.getDraggingMode();this.wu=this.bA.cs.Ur(s===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:s===e.UIDraggingModes.draggable?e.MouseStyles.Move:s===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical),this.XI&&clearInterval(this.XI)},this.FM=()=>{this.CM=!1,this.bA.vs(),this.bA.cs.Yr(this.wu)},this.IM=t=>(this.kM=!0,this.GI=dt(this.bA.cs.De(t.x,t.y),this.bA.cs.ft,this.scale),!0),this.jI=(t,e)=>(this.ZI(e),this.XI=setInterval((()=>this.ZI(e)),300),!0),this.QI=()=>(clearInterval(this.XI),!0),this.PM=(t,i)=>{const s=this.$I.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=dt(this.bA.cs.De(t.x,t.y),this.bA.cs.ft,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?uf(n.x,this.scale.x):this.k_.x,r!==e.UIDraggingModes.onlyHorizontal?uf(n.y,this.scale.y):this.k_.y),h=u(o.x-this.GI.x,o.y-this.GI.y),a=u(this.$I.getPosition().x+h.x,this.$I.getPosition().y+h.y),l=this.JI(a),c={x:Math.abs(this.WI.x-l.x),y:Math.abs(this.WI.y-l.y)};return this.KI(c),this.UI.y>h.y&&(this.GI=n),this.Fe(),!0}return!1},this.DM=(t,e)=>{this.kM=!1,Zt(e),this.bA.vs()},this.bA=t,this.tp=i,this.scale=n,this.contentScale=o,this.qI=a,this.tP=new lf(t,s,n,h,a===of.UpToDown?af.Up:af.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.iP=new lf(t,s,n,h,a===of.UpToDown?af.Down:af.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.$I=new mo(t,s,n,kt,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===of.UpToDown?e.UIDraggingModes.onlyVertical:a===of.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.sP=new mo(i,s,n,kt,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.$I.onMouseEnter(this.TM),this.$I.onMouseLeave(this.FM),this.$I.onMouseDragStart(((t,e)=>this.IM(u(e.clientX,e.clientY))&&Zt(e))),this.$I.onMouseDrag(((t,e)=>this.PM(u(e.clientX,e.clientY))&&Zt(e))),this.$I.onMouseDragStop(this.DM),this.$I.onTouchStart(((t,e)=>this.IM(u(e.clientX,e.clientY))&&Zt(e))),this.$I.onTouchMove(((t,e)=>this.PM(u(e.clientX,e.clientY))&&Zt(e))),this.$I.onTouchEnd(this.DM),this.tP.onMouseDown(((t,e)=>this.jI(t,e)&&Zt(e))),this.iP.onMouseDown(((t,e)=>this.jI(t,e)&&Zt(e))),this.tP.onMouseUp(((t,e)=>this.QI()&&Zt(e))),this.iP.onMouseUp(((t,e)=>this.QI()&&Zt(e))),this.sP.onMouseWheel(((t,e)=>this.eP(e))),this.$I.onMouseWheel(((t,e)=>this.eP(e))),this.sP.onMouseDown(((t,e)=>this.jI(t,e)&&Zt(e))),this.sP.onMouseUp(((t,e)=>this.QI()&&Zt(e)))}hP(t){return this.k_=t,this}Al(t){return this.k_.width=t,this}rP(){return this.k_.width}nP(t){return this.WI=t,this}oP(t){return this.qc=t,this}aP(){return this.qc}lP(t){return this.HI=t,this}uP(){return this.qI}cP(t){let e;switch(this.qI){case of.UpToDown:return e=t>0?Math.min(this.WI.y-this.NI.max.y,this.UI.y+t):Math.max(0,this.UI.y+t),e!==this.UI.y&&(this.KI({x:0,y:e}),this.Fe(),!0);case of.LeftToRight:return e=Math.min(this.NI.max.x-this.WI.x,this.UI.x+t),e!==this.UI.x&&(this.KI({y:0,x:e}),this.Fe(),!0);default:return!1}}dP(t){let e;switch(this.qI){case of.UpToDown:return e=Math.max(0,this.UI.y-t),e!==this.UI.y&&(this.KI({x:0,y:e}),this.Fe(),!0);case of.LeftToRight:return e=t>0?Math.max(0,this.UI.x-t):Math.min(this.NI.max.x-this.WI.x,this.UI.x-t),e!==this.UI.x&&(this.KI({x:e,y:0}),this.Fe(),!0);default:return!0}}fP(t){switch(this.qI){case of.UpToDown:return this.L.on("scrollY",t);case of.LeftToRight:return this.L.on("scrollX",t)}return this.L.on("scrollY",t)}JI(t){switch(this.qI){case of.UpToDown:if(t.y>this.NI.min.y)return u(t.x,this.NI.min.y);if(t.ythis.NI.max.x)return u(this.NI.max.x,t.y)}return t}eP(t){t.deltaY>0&&this.AP()&&Zt(t),t.deltaY<0&&this.gP()&&Zt(t)}ZI(t){const e=dt(this.bA.cs.De(t.clientX,t.clientY),this.bA.cs.ft,this.scale);let i;const s=this.$I.getPosition(),r=this.$I.getSize();this.pP(e,s,r)?clearInterval(this.XI):(i=this.qI===of.UpToDown?u(0,e.y-s.y>0?this.HI:-this.HI):u(s.x-e.x>0?this.HI:-this.HI,0),(i.x>0||i.y>0)&&this.mP(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.yP(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}pP(t,e,i){return this.qI===of.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.k_.height?Math.min(this.WI.y-this.NI.max.y,this.UI.y+t):0,e!==this.UI.y&&(this.KI({x:0,y:e}),this.Fe(),!0)}case of.LeftToRight:{const e=Math.min(this.NI.max.x-this.WI.x,this.UI.x+t);return e!==this.UI.x&&(this.KI({y:0,x:e}),this.Fe(),!0)}default:return!1}}gP(){return this.mP(this.HI)}AP(){return this.yP(this.HI)}KI(t){if(t.x===this.UI.x&&t.y===this.UI.y)return;let e;switch(this.UI=t,this.qI){case of.UpToDown:e=this.UI.y*this.YI*this.contentScale.Ui().y,this.L.emit("scrollY",hf.Vertical,e),this.bA.cs.vs();break;case of.LeftToRight:e=this.UI.x*this.YI*this.contentScale.Ui().x,this.L.emit("scrollX",hf.Horizontal,e)}}setVisible(t){return this.tP.setVisible(t),this.iP.setVisible(t),this.sP.setVisible(t),this.$I.setVisible(t),this}dispose(){return this.tP.dispose(),this.iP.dispose(),this.sP.dispose(),this.$I.dispose(),this.XI&&clearInterval(this.XI),this}Ds(){switch(this.vP(),this.xP(),this.qI){case of.UpToDown:this.tP.Ie({x:this.k_.x,y:this.k_.y+this.k_.height-this.tP.ai().x/2}).tt(u(this.k_.width,this.k_.width)).Ds(),this.iP.Ie({x:this.k_.x,y:this.k_.y+10}).tt(u(this.k_.width,this.k_.width)).Ds(),this.sP.setSize({x:this.k_.width,y:this.k_.height-2*this.tP.ai().x}).setPosition({x:this.k_.x,y:this.k_.y+this.iP.ai().y+this.sP.getSize().y/2}),this.$I.setSize(u(this.k_.width,this.bP())),this.WI={x:this.k_.x,y:this.tP.Ia().y-this.tP.ai().y/2-this.$I.getSize().y/2},this.SP({min:{x:this.k_.x,y:this.tP.Ia().y-this.tP.ai().y/2-this.$I.getSize().y/2},max:{x:this.k_.x,y:this.iP.Ia().y+this.iP.ai().x/2+this.$I.getSize().y/2}});break;case of.LeftToRight:this.tP.Ie({x:this.k_.x,y:this.k_.y}).tt(u(this.k_.height,this.k_.height)).Ds(),this.iP.Ie({x:this.k_.x+this.k_.width-this.iP.ai().x,y:this.k_.y}).tt(u(this.k_.height,this.k_.height)).Ds(),this.sP.setSize({y:this.k_.height,x:this.k_.width-2*this.tP.ai().y}).setPosition({x:this.k_.x+this.tP.ai().x/2+this.sP.getSize().x/2,y:this.k_.y}),this.$I.setSize(u(this.bP(),this.k_.height)),this.WI={x:this.tP.Ia().x+this.tP.ai().x/2+this.$I.getSize().x/2,y:this.k_.y},this.SP({min:{x:this.tP.Ia().x+this.tP.ai().x/2+this.$I.getSize().x/2,y:this.k_.y},max:{x:this.iP.Ia().x-this.iP.ai().x/2-this.$I.getSize().x/2,y:this.k_.y}})}return this.MP(),this}vP(){switch(this.qI){case of.UpToDown:this._P()||this.setVisible(!1),this._P()&&this.setVisible(!0);break;case of.LeftToRight:this.wP()||this.setVisible(!1),this.wP()&&this.setVisible(!0)}}xP(){switch(this.qI){case of.UpToDown:this._P()||this.KI({x:0,y:0});break;case of.LeftToRight:this.wP()||this.KI({x:0,y:0})}}_P(){return this.qc.x>this.k_.height}wP(){return this.qc.y>this.k_.width}bP(){switch(this.qI){case of.UpToDown:return this.k_.height*(this.k_.height-2*this.tP.ai().x)/this.qc.x;case of.LeftToRight:return this.k_.width*(this.k_.width-2*this.tP.ai().y)/this.qc.y;default:return 0}}MP(){switch(this.qI){case of.UpToDown:this.YI=(this.qc.x-this.k_.height)/(this.NI.min.y-this.NI.max.y);break;case of.LeftToRight:this.YI=(this.qc.y-this.k_.width)/(this.NI.max.x-this.NI.min.x)}}Fe(){switch(this.tP.Fe(),this.iP.Fe(),this.sP.Fe(),this.qI){case of.UpToDown:this.$I.setPosition({x:this.k_.x,y:this.tP.Ia().y-this.tP.ai().y/2-this.$I.getSize().y/2-this.UI.y}).Fe();break;case of.LeftToRight:this.$I.setPosition({y:this.k_.y,x:this.tP.Ia().x+this.tP.ai().x/2+this.$I.getSize().x/2+this.UI.x}).Fe()}return this}}class df{constructor(t,e,i,s,r,n,o){switch(this.bA=t,this.tp=e,this.scale=s,this.contentScale=r,o){case hf.Vertical:this.CP=this.kP(i,n,of.UpToDown);break;case hf.Horizontal:this.TP=this.kP(i,n,of.LeftToRight);break;case hf.Both:this.CP=this.kP(i,n,of.UpToDown),this.TP=this.kP(i,n,of.LeftToRight)}this.FP=Wi(new $i(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.TP)||void 0===n?void 0:n.dP(s.x))&&Zt(r),0!==s.y&&(null===(o=this.CP)||void 0===o?void 0:o.cP(s.y))&&Zt(r)})))}kP(t,e,i){return new cf(this.bA,this.tp,t,this.scale,this.contentScale,e,i)}rP(){return 20}oP(t){var e,i;return null===(e=this.CP)||void 0===e||e.oP(t),null===(i=this.TP)||void 0===i||i.oP(t),this}IP(t){var e;return null===(e=this.TP)||void 0===e||e.lP(t),this}PP(t){var e;return null===(e=this.CP)||void 0===e||e.lP(t),this}DP(t){const e=this.CP;return e&&e.eP(t),this}BP(t){return this.FP.onTouchStart(this,t),this}LP(t){return this.FP.onTouchMove(this,t),this}RP(t){return this.FP.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.TP)||void 0===e||e.fP(t),null===(i=this.CP)||void 0===i||i.fP(t),this}dispose(){var t,e;return null===(t=this.CP)||void 0===t||t.dispose(),null===(e=this.TP)||void 0===e||e.dispose(),this}Fe(){var t,e;return null===(t=this.CP)||void 0===t||t.Fe(),null===(e=this.TP)||void 0===e||e.Fe(),this}Ds(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.CP)||void 0===t||t.hP({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.TP)||void 0===e||e.hP({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.CP)||void 0===i||i.Ds(),null===(s=this.TP)||void 0===s||s.Ds(),this}}class ff extends Qh{constructor(t,e,i,s,r,n){super(t,e,i,e.yp("dataGrid bg",0),s,e.cs.ts.dataGridBackgroundFillStyle,e.cs.ts.dataGridBackgroundStrokeStyle,e.cs.ts.dataGridTitleFont,e.cs.ts.dataGridTitleFillStyle,n),this.EP=[],this.zP=[],this.VP=[],this.OP=new Map,this.NP=!0,this.GP=!0,this.WP=!0,this.UP=!0,this.YP=!0,this.HP=!0,this.$P=!0,this.XP=!0,this.jP=!0,this.ZP=!0,this.QP=!0,this.JP=!0,this.KP=!0,this.qP=!0,this.tD=!0,this.iD=!0,this.sD=new Set,this.eD=new Set,this.hD=!0,this.rD=!0,this.nD=(t,e)=>{t.borders=void 0===e?xf:{...t.borders,...e},this.oD(t),this.JP=!0,this.cs.vs()},this.oD=t=>{t.borders&&(!1===t.borders.top&&this.aD(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.lD,bottom:!1}})),!1===t.borders.bottom&&this.aD(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.lD,top:!1}})),!1===t.borders.left&&this.aD(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.lD,right:!1}})),!1===t.borders.right&&this.aD(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.lD,left:!1}})),!0===t.borders.top&&this.aD(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.lD,bottom:!0}})),!0===t.borders.bottom&&this.aD(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.lD,top:!0}})),!0===t.borders.left&&this.aD(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.lD,right:!0}})),!0===t.borders.right&&this.aD(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.lD,left:!0}})))},this.uD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseEnter,i,e)},this.cD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseLeave,i,e)},this.dD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseClick,i,e)},this.fD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDoubleClick,i,e)},this.AD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDown,i,e)},this.gD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseUp,i,e)},this.pD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseMove,i,e)},this.mD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDrag,i,e)},this.yD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDragStart,i,e)},this.SD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDragStop,i,e)},this.vD=(t,e)=>{const i=this.OP.get(t);i&&(this.L.emit(gf.cellMouseWheel,i,e),!e.defaultPrevented&&this.hD&&this.xD.DP(e))},this.bD=(t,e)=>{const i=this.OP.get(t);i&&(this.L.emit(gf.cellTouchStart,i,e),!e.defaultPrevented&&this.rD&&this.xD.BP(e))},this.MD=(t,e)=>{const i=this.OP.get(t);i&&(this.L.emit(gf.cellTouchMove,i,e),!e.defaultPrevented&&this.rD&&this.xD.LP(e))},this._D=(t,e)=>{const i=this.OP.get(t);i&&(this.L.emit(gf.cellTouchEnd,i,e),!e.defaultPrevented&&this.rD&&this.xD.RP(e))},this.cs.Gn(ah.sf),this.bp.Eh("Data Grid"),this.wD=i.d2({scaleXYConstructor:_i}),this.wD.x.sg=Hd,this.CD=i.d2({scaleXYConstructor:_i}),this.kD={x:0,y:0},this.TD=this.ts.dataGridTextFont,this.FD=this.ts.dataGridTextFillStyle,this.lD={top:!0,bottom:!0,left:!0,right:!0},this.ID=this.ts.dataGridCellBackgroundFillStyle,this.PD=this.ts.dataGridBorderStrokeStyle,this.DD="left-center",this.BD={left:5,right:5,bottom:5,top:5},this.LD=e.Ax("dataGrid grid bg",0),this.RD=e.Ax("dataGrid cell bg",1),this.ED=e.Um("dataGrid cell content",0),this.zD=e.Um("dataGrid scrollbar bg",1),this.VD=e.Um("dataGrid scrollbar fg",2),this.xD=this.OD(),this.onBackgroundMouseWheel(((t,e)=>{this.hD&&this.xD.DP(e)})),this.onBackgroundTouchStart(((t,e)=>{this.rD&&this.xD.BP(e)})),this.onBackgroundTouchMove(((t,e)=>{this.rD&&this.xD.LP(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.rD&&this.xD.RP(e)})),this.ND=this.LD.Te(this.wD).ke(this.ts.dataGridBackgroundFillStyle).Ce(ot).setMouseInteractions(!1),this.GD=this.ED.Rg(this.wD).setMouseInteractions(!1),this.WD=new Xa((()=>this.RD.Te(this.wD).setMouseInteractions(!0).setMouseEnterEventHandler(this.uD).setMouseLeaveEventHandler(this.cD).setMouseClickEventHandler(this.dD).setMouseDoubleClickEventHandler(this.fD).setMouseDownEventHandler(this.AD).setMouseUpEventHandler(this.gD).setMouseMoveEventHandler(this.pD).setMouseDragEventHandler(this.mD).setMouseDragStartEventHandler(this.yD).setMouseDragStopEventHandler(this.SD).setMouseWheelEventHandler(this.vD).setTouchStartEventHandler(this.bD).setTouchMoveEventHandler(this.MD).setTouchEndEventHandler(this._D))),this.UD=new Xa((()=>this.ED.Te(this.wD).setMouseInteractions(!1))),this.YD=new Xa((()=>this.ED.Dr(this.wD).setMouseInteractions(!1))),this.HD=new Xa((()=>this.ED.sy(this.wD,{},[za.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.$D=new Xa((()=>this.ED.ze(this.wD).setMouseInteractions(!1))),this.XD=new Xa((()=>this.ED.bS(this.wD).setMouseInteractions(!1))),this.jD=new Xa((()=>this.ED.Te(this.wD).setMouseInteractions(!1))),this.ZD=new Xa((()=>this.ED.uw(this.wD).setMouseInteractions(!1))),this.QD=new Xa((()=>this.ED.Kc(this.wD).setMouseInteractions(!1))),this.mp(r,this.uiScale),this.onResize((()=>{this.NP=!0,this.cs.vs(),this.wD.tt(this.pixelScale.ai()),this.CD.tt(this.pixelScale.ai())})),this.JD=this.hs.yg([this.ND])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}Qd(){return[]}dispose(){return super.dispose(),this.LD.U(),this.RD.U(),this.ED.U(),this.zD.U(),this.VD.U(),Kh(this.wD),Kh(this.CD),this.xD.dispose(),this.YD.my(),this.WD.my(),this.UD.my(),this.HD.my(),this.$D.my(),this.XD.my(),this.jD.my(),this.ZD.my(),this.QD.my(),this}Z(){return super.Z(),this.wD.Z(),this.CD.Z(),this}J(){return super.J(),this.wD.J(),this.CD.J(),this}setBackgroundEffect(t){return this.JD.Ss(t),this.cs.vs(),this}getBackgroundEffect(){return this.JD.xs()}setInteractionScrollOnWheel(t){return this.hD=t,this}getInteractionScrollOnWheel(){return this.hD}setInteractionPanOnTouch(t){return this.rD=t,this}getInteractionPanOnTouch(){return this.rD}onCellMouseEnter(t){return this.L.on(gf.cellMouseEnter,t)}offCellMouseEnter(t){return this.L.off(t)}onCellMouseLeave(t){return this.L.on(gf.cellMouseLeave,t)}offCellMouseLeave(t){return this.L.off(t)}onCellMouseClick(t){return this.L.on(gf.cellMouseClick,t)}offCellMouseClick(t){return this.L.off(t)}onCellMouseDoubleClick(t){return this.L.on(gf.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.L.off(t)}onCellMouseDown(t){return this.L.on(gf.cellMouseDown,t)}offCellMouseDown(t){return this.L.off(t)}onCellMouseUp(t){return this.L.on(gf.cellMouseUp,t)}offCellMouseUp(t){return this.L.off(t)}onCellMouseMove(t){return this.L.on(gf.cellMouseMove,t)}offCellMouseMove(t){return this.L.off(t)}onCellMouseDrag(t){return this.L.on(gf.cellMouseDrag,t)}offCellMouseDrag(t){return this.L.off(t)}onCellMouseDragStart(t){return this.L.on(gf.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.L.off(t)}onCellMouseDragStop(t){return this.L.on(gf.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.L.off(t)}onCellMouseWheel(t){return this.L.on(gf.cellMouseWheel,t)}offCellMouseWheel(t){return this.L.off(t)}onCellTouchStart(t){return this.L.on(gf.cellTouchStart,t)}offCellTouchStart(t){return this.L.off(t)}onCellTouchMove(t){return this.L.on(gf.cellTouchMove,t)}offCellTouchMove(t){return this.L.off(t)}onCellTouchEnd(t){return this.L.on(gf.cellTouchEnd,t)}offCellTouchEnd(t){return this.L.off(t)}setGridBackgroundFillStyle(t){return this.ND.ke(t),this.cs.vs(),this}getGridBackgroundFillStyle(){return this.ND.zh()}setCellContent(t,e,i,s,r){if("number"==typeof i&&void 0!==s&&void 0!==r){const n=i,o=s,h=r;let a=[];for(let i=t;ie.column===t));return i||(i={column:t,min:void 0,max:void 0},this.zP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.zP.splice(this.zP.indexOf(i),1):(i.min=e,i.max=e),this.HP=!0,this.cs.vs(),this}setRowHeight(t,e){let i=this.VP.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.VP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.VP.splice(this.VP.indexOf(i),1):(i.min=e,i.max=e),this.HP=!0,this.cs.vs(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=S(e,e,e,e)),this.qD(t,(t=>this.tB(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=S(e,e,e,e)),this.iB(t,(t=>this.tB(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=S(i,i,i,i)),this.aD(t,e,(t=>this.tB(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=S(t,t,t,t)),this.BD={...this.BD,...t},this.sB((t=>this.tB(t,this.BD))),this}setCellBorders(t,e,i){return this.aD(t,e,(t=>this.nD(t,i))),this}setRowBorders(t,e){return this.iB(t,(t=>this.nD(t,e))),this}setColumnBorders(t,e){return this.qD(t,(t=>this.nD(t,e))),this}setCellsBorders(t){return this.lD=void 0===t?xf:t,this.sB((t=>this.nD(t,this.lD))),this}setCellsBorderStrokeStyle(t){return this.PD="function"==typeof t?t(this.PD):t,this.qP=!0,this.cs.vs(),this}setColumnTextFillStyle(t,e){return this.qD(t,(t=>this.eB(t,e))),this}setRowTextFillStyle(t,e){return this.iB(t,(t=>this.eB(t,e))),this}setCellTextFillStyle(t,e,i){return this.aD(t,e,(t=>this.eB(t,i))),this}setCellsTextFillStyle(t){return this.FD="function"==typeof t?t(this.FD):t,this.sB((t=>this.eB(t,this.FD))),this}setColumnTextFont(t,e){return this.qD(t,(t=>this.hB(t,e))),this}setRowTextFont(t,e){return this.iB(t,(t=>this.hB(t,e))),this}setCellTextFont(t,e,i){return this.aD(t,e,(t=>this.hB(t,i))),this}setCellsTextFont(t){return this.TD="function"==typeof t?t(this.TD):t,this.sB((t=>this.hB(t,this.TD))),this}setColumnContentAlignment(t,e){return this.qD(t,(t=>this.rB(t,e))),this}setRowContentAlignment(t,e){return this.iB(t,(t=>this.rB(t,e))),this}setCellContentAlignment(t,e,i){return this.aD(t,e,(t=>this.rB(t,i))),this}setCellsContentAlignment(t){return this.DD=t,this.sB((t=>this.rB(t,this.DD))),this}setCellBackgroundFillStyle(t,e,i){return this.aD(t,e,(t=>this.nB(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.qD(t,(t=>this.nB(t,e))),this}setRowBackgroundFillStyle(t,e){return this.iB(t,(t=>this.nB(t,e))),this}setCellsBackgroundFillStyle(t){return this.ID="function"==typeof t?t(this.ID):t,this.sB((t=>this.nB(t,this.ID))),this}setCellHighlight(t,e,i){return this.aD(t,e,(t=>{t.highlight=Ae(i)})),this.KP=!0,this.cs.vs(),this}setColumnHighlight(t,e){const i=Ae(e);return this.qD(t,(t=>{t.highlight=i})),this.KP=!0,this.cs.vs(),this}setRowHighlight(t,e){const i=Ae(e);return this.iB(t,(t=>{t.highlight=i})),this.KP=!0,this.cs.vs(),this}removeCell(t,e){return this.aD(t,e,(t=>this.EP.splice(this.EP.indexOf(t),1))),this.YP=!0,this.cs.vs(),this}removeRow(t){return this.iB(t,(t=>this.EP.splice(this.EP.indexOf(t),1))),this.EP.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.YP=!0,this.cs.vs(),this}removeColumn(t){return this.qD(t,(t=>this.EP.splice(this.EP.indexOf(t),1))),this.EP.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.YP=!0,this.cs.vs(),this}removeCells(){return this.EP.splice(0),this.YP=!0,this.cs.vs(),this}getColumnMax(){return 0===this.EP.length?0:this.EP.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.EP.length?0:this.EP.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=Math.round(this.PD.O()),i=e/2;let s=this.GP||this.WP||this.UP||this.YP||this.HP||this.$P||this.QP||this.JP||this.qP||this.iD;if(s){this.EP.forEach((t=>{this.eD.add(t.column)})),this.EP.forEach((t=>{this.sD.add(t.row)}));const t=this.YD.gy(),r=this.oB(i,t);t.finishPlot();const n=this.aB(this.eD.size,r),o=this.lB(this.sD.size,r),h=n.reduce(Ge,0)+e,a=o.reduce(Ge,0)+e,l=new Array(n.length+1).fill(0).map(((t,e)=>n.reduce(((t,i,s)=>t+(so.reduce(((t,i,s)=>t+(st===n[e])),e=this.uB.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.uB={columnWidths:n,rowHeights:o,dataGridWidth:h,dataGridHeight:a,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:r}}const r=s||this.WP||this.UP||this.YP||this.XP||this.jP||this.ZP||this.JP||this.KP||this.qP||this.NP||this.iD;if((r||this.tD)&&this.uB){const t=this.pixelScale.getInnerIntervalPixels(),s=ta.Cp(this.bp,this.Sp),n=[this.ya.left+i,this.ya.right+i],o=[this.ya.bottom+i,this.ya.top+s+i],h={x:t.x-n[0]-n[1],y:t.y-o[0]-o[1]},a=[this.ya.left,this.ya.right],l=[this.ya.bottom,this.ya.top+s],u={x:Math.round(t.x-a[0]-a[1]),y:Math.round(t.y-l[0]-l[1])},c={x:Math.ceil(i),y:Math.floor(u.y-i)};this.CD.zi(n).Vi(o).Oi(0,h.x).Ni(0,h.y),this.xD.oP({x:this.uB.dataGridHeight,y:this.uB.dataGridWidth}).Ds().Fe();const d={x:Math.round(this.kD.x),y:Math.round(Math.min(0,this.kD.y))};this.wD.zi(a).Vi(l).Oi(d.x,u.x+d.x).Ni(d.y,u.y+d.y),this.ND.Ie({x:c.x,y:c.y});const f={x:this.wD.x.hi(),y:this.wD.y.hi()+this.xD.rP(),width:this.wD.x.ni()+e-this.xD.rP(),height:this.wD.y.ni()+e};this.ED.tx(f),this.RD.tx(f),this.LD.tx(f);const g=this.uB,m=[{x:this.wD.x.getInnerStart(),y:this.wD.y.getInnerStart()},{x:this.wD.x.getInnerEnd(),y:this.wD.y.getInnerStart()},{x:this.wD.x.getInnerEnd(),y:this.wD.y.getInnerEnd()},{x:this.wD.x.getInnerStart(),y:this.wD.y.getInnerEnd()}];g.cellsContentSizes.forEach((t=>{var e;const i={x:c.x+g.columnWidthsCumulative[t.cell.column],y:c.y-g.rowHeightsCumulative[t.cell.row+t.cell.rowSpan]},s={x:i.x+g.columnWidths[t.cell.column],y:i.y+g.rowHeights[t.cell.row]},r=Ne([i,{x:s.x,y:i.y},s,{x:i.x,y:s.y}],m);null===(e=t.text)||void 0===e||e.setVisible(r)})),r&&this.cB(c,this.uB,e)}this.NP=!1,this.GP=!1,this.WP=!1,this.UP=!1,this.YP=!1,this.HP=!1,this.$P=!1,this.XP=!1,this.jP=!1,this.ZP=!1,this.QP=!1,this.JP=!1,this.KP=!1,this.qP=!1,this.tD=!1,this.iD=!1}oB(t,e){const i=[],s={left:Math.ceil(t),right:Math.ceil(t),top:Math.ceil(t),bottom:Math.ceil(t)};for(const t of this.EP){const{content:r}=t,n={...this.BD,...t.padding};let o,h,a,l={x:0,y:0};if("string"==typeof r||"number"==typeof r){const i=String(r);o=e.add(),l=o.Eh(i).Nh(t.textFont||this.TD).Ds().Zc()}if(Xd(r)&&(h=r,l={x:200,y:50}),io(r)){const t=this.cs.dB(r);t.fB()?(a=r,l=a.ai()):t.AB((()=>{this.iD=!0,this.cs.vs()}))}if(o||h||a){n.top=Math.round(n.top),n.left=Math.round(n.left),n.right=Math.round(n.right),n.bottom=Math.round(n.bottom);const e={x:Math.round(l.x+n.left+n.right+s.left+s.right),y:Math.round(l.y+n.top+n.bottom+s.top+s.bottom)};i.push({cell:t,contentSize:e,text:o,sparkChart:h,icon:a,cellPadding:n,cellMargin:s})}}return i}cB(t,i,s){const{dataGridWidth:r,dataGridHeight:n,cellsContentSizes:o,columnWidths:h,columnWidthsCumulative:a,rowHeights:l,rowHeightsCumulative:u}=i,c={x:r-s,y:-n+s};this.ND.tt(c),this.GD.Ee(this.PD),this.OP.clear();const d={cellBackground:this.WD.gy(),cellIconRect:this.UD.gy(),lineSet:this.HD.gy(),line:this.$D.gy(),pointSet:this.XD.gy(),rect:this.jD.gy(),junction:this.ZD.gy(),arc:this.QD.gy()},f=[];for(const i of o){const{cell:r,text:n,sparkChart:o,icon:c,cellPadding:g,cellMargin:m}=i,y={column:r.column,row:r.row},p={x:t.x+a[r.column],y:t.y-u[r.row+r.rowSpan]},x={x:p.x+m.left,y:p.y+m.bottom},S={x:x.x+g.left,y:x.y+g.bottom},A={x:new Array(r.columnSpan).fill(0).reduce(((t,e,i)=>t+h[r.column+i]),0),y:new Array(r.rowSpan).fill(0).reduce(((t,e,i)=>t+l[r.row+i]),0)},v={x:A.x-m.left-m.right,y:A.y-m.top-m.bottom},b={x:v.x-g.left-g.right,y:v.y-g.top-g.bottom};if(n){const t=pf(S,b,r.contentAlignment||this.DD);n.Ie(t[0]).za({x:t[1],y:t[2]}).ke(this.gB(r.textFillStyle||this.FD,r.content,this.FD)).ds(r.highlight)}const M=this.gB(r.backgroundFillStyle||this.ID,r.content);if(M!==z){const t=d.cellBackground.add();t.Ie(p).tt(A).ke(M).Ce(ot).ds(r.highlight),this.OP.set(t,y)}const E=r.borders||this.lD;if(E&&yf(p,A,E,s,f),o){const t=S,e=b;Wd(o,d,this.wD,t,e,this.ts,this.dA,r.highlight)}if(c){const t=c.ai(),i=pf(S,b,r.contentAlignment||this.DD);d.cellIconRect.add().Ie({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).tt(t).ke(new $n({source:c.nc,fitMode:e.ImageFitMode.Stretch})).Ce(ot).ds(r.highlight)}}this.GD.Gt();for(const t of f)this.GD.Vr().zg(t[0],t[1]);d.cellBackground.finishPlot(),d.cellIconRect.finishPlot(),d.lineSet.finishPlot(),d.line.finishPlot(),d.pointSet.finishPlot(),d.rect.finishPlot(),d.junction.finishPlot(),d.arc.finishPlot()}aB(t,e){const i=new Array(t).fill(0);for(const t of this.eD.values()){const s=e.filter((e=>t>=e.cell.column&&t+1<=e.cell.column+e.cell.columnSpan)).reduce(((t,e)=>{const i=e.contentSize.x/e.cell.columnSpan;return Math.max(t,i)}),0),r=this.zP.find((e=>e.column===t)),n=r?Rt(s,void 0!==r.min?r.min:Ve,void 0!==r.max?r.max:Le):s;i[t]=n}return i}lB(t,e){const i=new Array(t).fill(0);for(const t of this.sD.values()){const s=e.filter((e=>t>=e.cell.row&&t+1<=e.cell.row+e.cell.rowSpan)).reduce(((t,e)=>{const i=e.contentSize.y/e.cell.rowSpan;return Math.max(t,i)}),0),r=this.VP.find((e=>e.row===t)),n=r?Rt(s,void 0!==r.min?r.min:Ve,void 0!==r.max?r.max:Le):s;i[t]=n}return i}gB(t,e,i){if(j(t)){try{const i=Number(e);return new G({color:t.getPalette().getColors(i)})}catch(t){}return i||z}return t}eB(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.FD):e,this.ZP=!0,this.cs.vs()}hB(t,e){t.textFont="function"==typeof e?e(t.textFont||this.TD):e,this.QP=!0,this.cs.vs()}nB(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.ID):e,this.jP=!0,this.cs.vs()}rB(t,e){t.contentAlignment=e,this.XP=!0,this.cs.vs()}tB(t,e){t.padding={...t.padding,...e},this.$P=!0,this.cs.vs()}KD(t,e,i){let s=this.aD(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.EP.push(s),this.UP=!0),"string"==typeof s.content||"number"==typeof s.content?this.GP=!0:this.WP=!0,this.cs.vs()}sB(t){this.EP.forEach((e=>t(e)))}aD(t,e,i){const s=this.EP.find((i=>t>=i.column&&t+1<=i.column+i.columnSpan&&e>=i.row&&e+1<=i.row+i.rowSpan));return s&&i&&i(s),s}qD(t,e){const i=this.EP.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}iB(t,e){const i=this.EP.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}OD(){return new df(this.VD,this.zD,this.CD,this.CD,this.wD,this.ts,hf.Both).onScroll(((t,e)=>{this.uB&&(t===hf.Vertical&&(this.kD.y=-e),t===hf.Horizontal&&(this.kD.x=e),this.tD=!0,this.cs.vs())})).IP(50).PP(12)}}const gf={cellMouseEnter:"cellMouseEnter",cellMouseLeave:"cellMouseLeave",cellMouseClick:"cellMouseClick",cellMouseDoubleClick:"cellMouseDoubleClick",cellMouseDown:"cellMouseDown",cellMouseUp:"cellMouseUp",cellMouseMove:"cellMouseMove",cellMouseDrag:"cellMouseDrag",cellMouseDragStart:"cellMouseDragStart",cellMouseDragStop:"cellMouseDragStop",cellMouseWheel:"cellMouseWheel",cellTouchStart:"cellTouchStart",cellTouchMove:"cellTouchMove",cellTouchEnd:"cellTouchEnd"};var mf;e.DataGridCellContentAlignmentOptions=void 0,(mf=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",mf.RightCenter="right-center",mf.LeftCenter="left-center",mf.RightTop="right-top",mf.LeftTop="left-top",mf.RightBottom="right-bottom",mf.LeftBottom="left-bottom",mf.CenterTop="center-top",mf.CenterBottom="center-bottom";const yf=(t,e,i,s,r)=>{const n={x:t.x,y:t.y},o={x:t.x,y:t.y+e.y},h={x:t.x+e.x,y:t.y},a={x:t.x+e.x,y:t.y+e.y};i.top&&r.push([o,a]),i.bottom&&r.push([n,h]),i.left&&r.push([n,o]),i.right&&r.push([h,a])},pf=(t,e,i)=>{const s=t.x,r=t.x+e.x,n=t.x+e.x/2,o=t.y+e.y,h=t.y,a=t.y+e.y/2;switch(i){case"left-center":return[u(s,a),-1,0];case"right-center":return[u(r,a),1,0];case"center":return[u(n,a),0,0];case"left-bottom":return[u(s,h),-1,-1];case"right-bottom":return[u(r,h),1,-1];case"center-bottom":return[u(n,h),0,-1];case"left-top":return[u(s,o),-1,1];case"right-top":return[u(r,o),1,1];case"center-top":return[u(n,o),0,1]}return be(0,`Unidentified DataGrid cell content alignment option: ${i}`)},xf={top:!1,bottom:!1,left:!1,right:!1};class Sf extends Js{constructor(t,e,i,s,r,n){super(t,{vr(){},Sr(){},Mr(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.hs=n,this.Ts=r,this.Rh=r.Dr(t.pB).Nh(this.ts.barChartCategoryAxisTitleFont||this.ts.xAxisTitleFont).ke(this.ts.barChartCategoryAxisTitleFillStyle||this.ts.xAxisTitleFillStyle),this.setTitleRotation(this.chart.Fs.getWidth({x:0,y:-90})),this.Uh=this.hs.yg([this.Rh]).Ss(e.effectsText),this.mB=r.ze(t.pB).Ee(e.barChartCategoryAxisStrokeStyle||e.xAxisStrokeStyle)}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}}setStrokeStyle(t){return this.mB.Ee(t),this.chart.cs.vs(),this}getStrokeStyle(){return this.mB.cu()}Ds(){if(!this.ji)return{Tg:0,Fg:0,Od:Rt(0,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Le)};const t=this.mB.cu().O()/2,e=this.chart.Fs.getHeight(this.Rh.Ds().Zc());return{Tg:t,Fg:e,Od:t+e}}Fe(t,e,i,s){const r=this.getInterval(),n=this.chart.valueAxis.getInterval();this.mB.Oe(this.chart.Fs.toPoint(r.start,n.start)).Ve(this.chart.Fs.toPoint(r.end,n.start)).setVisible(this.ji),this.Rh.Ie(this.chart.Fs.toPoint(.5*(r.start+r.end),this.chart.valueAxis.ft.mi(n.start,-(t.Tg+s.labelMarginBeforeCategoryAxisPixels)))).za(this.chart.Fs.toPoint(0,1)).setVisible(this.ji)}setMouseInteractions(t){return this}cr(t,e){return new qs(e,t,this.Ts,this.chart.pB)}dr(t,e){return{}}wr(t,e){return e}kr(t,e,i){return{min:t,max:e}}}class Af extends Js{constructor(t,e,i,s,r,n,o){super(t,{vr:()=>{var e;if(t.yB){if("positive"===t.SB||"bipolar"===t.SB){if("after-bar"===(null===(e=t.vB)||void 0===e?void 0:e.position)){const e=this.ft.ni();return this.ft.mi(t.yB.max,Math.min(this.chart.Fs.getHeight(this.chart.xB())+t.vB.labelMargin,.3*e))}return t.yB.max}return t.bB?Rt(-1,-1e-6,t.yB.max):0}},Sr:()=>{var e;if(t.yB){if("negative"===t.SB||"bipolar"===t.SB){if("after-bar"===(null===(e=t.vB)||void 0===e?void 0:e.position)){const e=this.ft.ni();return this.ft.mi(t.yB.min,-Math.min(this.chart.Fs.getHeight(this.chart.xB())+t.vB.labelMargin,.3*e))}return t.yB.min}return t.bB?Rt(1,1e-6,t.yB.min):0}},Mr:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.hs=n,this.Ts=r,this.Rh=r.Dr(t.pB).Nh(this.ts.barChartValueAxisTitleFont||this.ts.yAxisTitleFont).ke(this.ts.barChartValueAxisTitleFillStyle||this.ts.yAxisTitleFillStyle),this.setTitleRotation(this.chart.Fs.getHeight({x:0,y:-90})),this.Uh=this.hs.yg([this.Rh]).Ss(e.effectsText),this.mB=r.ze(t.pB).Ee(e.barChartValueAxisStrokeStyle||this.ts.yAxisStrokeStyle)}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}}setStrokeStyle(t){return this.mB.Ee(t),this.chart.cs.vs(),this}getStrokeStyle(){return this.mB.cu()}setTickStrategy(t,e){return super.Ih(t,e)}Ds(t){if(!this.ji)return this.Yh(),{Tg:0,Fg:0,Od:Rt(0,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Le)};const e=this.chart.Fs.getWidth(this.chart.pB).ni(),i=this.ft.ni();this.tr({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.Qe.values())for(const e of t.values()){const t=e.xh.ur,i=this.chart.Fs.getWidth(e.Ye.Zc()),r=t.getTickLength()+t.getTickPadding()+i+t.getLabelPadding();s=Math.max(s,r)}const r=s+this.mB.cu().O()/2,n=this.chart.Fs.getWidth(this.Rh.Ds().Zc());return{Tg:r,Fg:n,Od:Rt(r+n,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Le)}}Fe(t){const e=this.getInterval();this.mB.Oe(this.chart.Fs.toPoint(-.5,this.Ph)).Ve(this.chart.Fs.toPoint(-.5,this.Dh)).setVisible(this.ji);const i="logarithmic"===this.Th.type?Math.sqrt(e.start+e.end):.5*(e.start+e.end),s=this.chart.Fs.toPoint(this.chart.categoryAxis.ft.mi(-.5,t.Tg*this.chart.Fs.MB),i),r=this.chart.Fs.toPoint(this.chart.Fs._B,0);this.Rh.Ie(s).za(r).setVisible(this.ji)}setMouseInteractions(t){return this}cr(t,e){return new qs(e,t,this.Ts,this.chart.pB)}dr(t,e){const i=t.xh.ur,s=this.chart.Fs.toPoint(-.5,t.S),r=this.chart.pB.mi(s,this.chart.Fs.toPoint(i.getTickLength()*this.chart.Fs.MB,0)),n=this.chart.pB.mi(s,this.chart.Fs.toPoint(i.gridStrokeLength*e.oppositeAxisSize*-this.chart.Fs.MB,0)),o=this.chart.pB.mi(r,this.chart.Fs.toPoint(i.getTickPadding()*this.chart.Fs.MB,0));t.Ye.Ie(o).za(this.chart.Fs.toPoint(this.chart.Fs._B,i.getLabelAlignment())).Gh(i.getLabelRotation()),i.tickStyle!==ot&&0!==i.tickLength&&e.plotLines.add({positions:[s,r]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==ot&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,n]},{lineStyle:i.gridStrokeStyle})}wr(t,e){return"linear"===this.Th.type?oh(t,e,this.ft):hh(t,e,this.ft)}kr(t,e,i){return{min:t,max:e}}}class vf extends Gl{constructor(t,e,i,s,r,n,o){super(t,e,i,s),this.Go=Ie(),this.S=0,this.wB=!1,this.chart=t,this.Ki=t,this.category=r,this.subCategory=n,this.Ms=r,this.be=fe(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,o),this.Me=fe(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,o),this.onVisibleStateChanged((()=>{this.Ki.CB()})),this.onDispose((()=>{this.Ki.CB(),this.Ki.kB.delete(this)}))}setValue(t){return this.wB=!0,this.S=t,this.Ki.CB(),this.Ki.cs.vs(),this.Ki.kB.delete(this),this}getValue(){return this.S}get value(){return this.S}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ki.CB(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ki.CB(),this}getStrokeStyle(){return this.Me}qy(){return this.iS}$c(t,e){return Ta(t,this.Ki.engine.scale,this.Ki.Om(new la,this.category,this.S,this).Qu(),this,void 0)}solveNearestFromScreen(t){}setEffect(t){return this.Ki.setBarsEffect(t),this}}const bf=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),Mf=(t,e,i)=>{const s=t.Td.filter((t=>void 0!==t)),r=s.map((t=>i(t.sizePixels))).reduce(((t,e)=>Math.max(t,e)),1),n=Math.ceil(r/(e/s.length));return n<=1?s:s.filter(((t,e)=>e%n==0))};class Ef extends al{constructor(t,i,s,r,n,o,h){var a;let l;super(t,i,s,i.yp("barChart bg",0),r,i.cs.ts.barChartBackgroundFillStyle||i.cs.ts.chartXYBackgroundFillStyle,i.cs.ts.barChartBackgroundStrokeStyle||i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.barChartTitleFont||i.cs.ts.chartXYTitleFont,i.cs.ts.barChartTitleFillStyle||i.cs.ts.chartXYTitleFillStyle,o),this.coordsBars="barChart",this.TB=Tf.Descending,this.FB=this.ts.barChartCategoryLabels,this.vB=this.ts.barChartValueLabelsAfterBars,this.IB=!1,this.b_=Ce(),this.PB=new Map,this.kB=new Map,this.SB="positive",this.DB="columns",this.BB=!0,this.LB=new Map,this.RB={speed:1},this.xm={speed:1},this.EB=.08,this.Vm=e.AutoCursorModes.snapToClosest,this.Om=(t,e,i,s)=>{this.categoryAxis.getTitle().length>0&&t.addRow(this.categoryAxis.getTitle()),t.addRow({text:e,font:{weight:"bold"}}),this.valueAxis.getTitle().length>0&&t.addRow(this.valueAxis.getTitle());const r=[];return s.subCategory&&s.subCategory.length>0&&r.push(s.subCategory),r.push(this.valueAxis.formatValue(i)),t.addRow(...r),t},this.An=(t,e,i,s,r)=>{this.pB.tt(s,r)},this.cs.Gn(ah.af),this.Fs="horizontal"===(null==h?void 0:h.type)?kf:wf,this.bp.Eh("Bar Chart"),this.zB=i.Um("barChart plotting 1",0),this.VB=i.Um("barChart plotting 2",1),this.bB="logarithmic"===(null===(a=null==h?void 0:h.valueAxis)||void 0===a?void 0:a.type),this.bB?"horizontal"===this.Fs.OB?(l=s.d1({scale1DConstructor:Di,dimension:"y"}),this.pB=(new Pi).Ei(s.d1({scale1DConstructor:Mi,dimension:"x"}),l)):(l=s.d1({scale1DConstructor:Di,dimension:"x"}),this.pB=(new Pi).Ei(l,s.d1({scale1DConstructor:Mi,dimension:"y"}))):(this.pB=s.d2({scaleXYConstructor:_i}),l=this.Fs.getWidth(this.pB)),this.NB=this.hs.yg(),this.__=new Ha((()=>this.b_.wt(this.zB.$x(this.pB).Ko(0))),((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.bar),e.bar.ps([i]),i})))),(()=>{this.b_.Gt()}),(t=>{this.NB.As(t)})),this.IS=this.tp.Te(this.pB).ke(this.ts.barChartSeriesBackgroundFillStyle||z).Ce(ot),this.PS=this.tp.Te(this.pB).ke(z).Ce(this.ts.barChartSeriesBackgroundStrokeStyle||ot).setMouseInteractions(!1),super.FS(this.IS,this.PS),this.categoryAxis=new Sf(this,this.ts,!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled),l,this.VB,this.hs);const u=nh(null==h?void 0:h.valueAxis);this.valueAxis=new Af(this,this.ts,!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled),this.Fs.getHeight(this.pB),this.VB,this.hs,u.type),this.GB=new Xa((()=>this.VB.Dr(this.pB).Pr(Re).Ir(Re).Ko(1))),this.WB=new Ha((()=>this.tp.Rg(this.pB).setMouseInteractions(!1)),((t,e,i)=>(t.Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>(i||t.Vr()).zg(e[0],e[1])))))),this.Hm=i.$m();const c=Ft(h?h.autoCursorBuilder:void 0,va);this.Fp=c.am(this.Hm,this.uiScale,this.uiScale,this.ts),this.onResize(this.An),this.mp(n,this.pB),this.setAutoCursorMode(e.AutoCursorModes.onHover),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled)),this.RS(((t,e)=>{ia.Pp(this,e)}))}getSeries(){return this.MS}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}setBarsMargin(t){return this.EB=Rt(t,0,.49),this.IB=!0,this.cs.vs(),this}getBarsMargin(){return this.EB}setBarsEffect(t){return this.NB.Ss(t),this.cs.vs(),this}getBarsEffect(){return this.NB.xs()}setData(t){let e;if(Array.isArray(t))e=[],t.forEach(((t,i)=>{"string"==typeof t?e.push({category:t}):"number"==typeof t?e.push({category:`Category ${i+1}`,value:t}):"object"==typeof t&&e.push(t)}));else{e=[];const i=Object.keys(t);for(const s of i){const i=t[s];e.push({category:s,value:"number"==typeof i?i:void 0})}}return this.UB("columns",e),this}setDataStacked(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:r}=e;r.forEach(((e,r)=>{const n=t[r];i.push({category:n,subCategory:s,value:e})}))})),this.UB("stacks",i),this}setDataGrouped(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:r}=e;r.forEach(((e,r)=>{const n=t[r];i.push({category:n,subCategory:s,value:e})}))})),this.UB("groups",i),this}UB(t,e){this.MS.length>0&&this.cs.Gn(ah.xf),this.DB=t,this.YB(e);const i=xe(e.map((t=>t.category))),s=i.length,r=xe(e.map((t=>t.subCategory))).filter((t=>void 0!==t));if(e.forEach((t=>{let e=this.MS.find((e=>e.category===t.category&&e.subCategory===t.subCategory));if(!e){const s=i.indexOf(t.category),n=r.includes(t.subCategory)?r.indexOf(t.subCategory):void 0;e=new vf(this,this.wS,this.ts,this.cs.hs,t.category,t.subCategory,Ft(n,s)),this.DS(e),this.LB.set(e,{category:s,valueStart:this.bB?1e-6:0,valueEnd:void 0!==t.value?t.value:0})}void 0!==t.value&&e.setValue(t.value)})),this.MS.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category&&e.subCategory===t.subCategory))&&(t.dispose(),this.LB.delete(t))})),this.categoryAxis.setInterval(this.Fs.getWidth({x:{start:-.5,end:s-.5},y:{start:s-.5,end:-.5}})),this.yB=0===this.MS.length?void 0:"stacks"!==t?this.MS.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:Le,max:Ve}):{min:0,max:i.reduce(((t,i)=>Math.max(t,e.reduce(((t,e)=>e.category!==i?t:void 0!==e.value?t+e.value:t),0))),0)},this.yB&&(this.SB=this.yB.min>=0?"positive":this.yB.max<=0?"negative":"bipolar",("bipolar"===this.SB||"negative"===this.SB)&&this.bB))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");this.YB(this.MS),this.PB.clear(),this.kB.clear(),this.IB=!0,this.cs.vs()}setCategoryLabels(t){const e="function"==typeof t?this.FB?t(this.FB):this.FB:t;return this.FB=e?{...this.ts.barChartCategoryLabels,...e}:void 0,this.PB.clear(),this.cs.vs(),this}getCategoryLabels(){return this.FB}setValueLabels(t){var e;const i="function"==typeof t?this.vB?t(this.vB):this.vB:t,s=(null==i?void 0:i.position)||(null===(e=this.vB)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.vB={...this.ts.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.vB={...this.ts.barChartValueLabelsInsideBars,...i}):this.vB=void 0,this.kB.clear(),this.cs.vs(),this}getValueLabels(){return this.vB}setLabelFittingEnabled(t){return this.BB=t,this.cs.vs(),this}getLabelFittingEnabled(){return this.BB}getBar(t,e){if(("groups"===this.DB||"stacks"===this.DB)&&void 0===e)throw new Error("LightningChart JS BarChart.getBar() | `subCategory` parameter is required for grouped and stacked bar charts!");const i=this.MS.find((i=>i.category===t&&(void 0===e||e===i.subCategory)));if(!i)throw new Error(`BarChart.getBar() no such bar: "${t}" ${e?`"${e}"`:""}`);return i}getBars(){return this.MS}setSorting(t){return this.TB=t,this.YB(this.MS),this.cs.vs(),this}getSorting(){return this.TB}setAnimationCategoryPosition(t,e=1){return this.RB=t?{speed:e}:void 0,this.cs.vs(),this}setAnimationValues(t,e=1){return this.xm=t?{speed:e}:void 0,this.cs.vs(),this}translateCoordinate(t,e,i){if(i&&Oi(t)&&Ui(e))return super.translateCoordinate(t,e,i);const s=e;let r;if(Ni(t))r=this.cs.Do(t);else if(Oi(t)){const e=dt(t,this.pixelScale,this.cs.ft);r={engineX:e.x,engineY:e.y}}else{if(!bf(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=dt(this.Fs.toPoint(t.iCategory,t.value),this.pB,this.cs.ft);r={engineX:e.x,engineY:e.y}}}if(zi(s))return this.cs.Bo(r);if("barChart"===s){const t=dt({x:r.engineX,y:r.engineY},this.cs.ft,this.pB);return{iCategory:this.Fs.getWidth(t),value:this.Fs.getHeight(t)}}if(Ui(s))return dt({x:r.engineX,y:r.engineY},this.cs.ft,this.pixelScale);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}Qd(){if("columns"===this.DB)return this.MS;const t=xe(Se(this.MS.map((t=>t.subCategory))));return Se(t.map((t=>{const e=this.MS.filter((e=>e.subCategory===t)),i=e[0];if(i)return(t=>{let e=!1;t.forEach((i=>i.onHighlight(((s,r)=>{e||(e=!0,t.forEach((t=>i!==t?t.setHighlight(r):void 0)),e=!1)})))),t.forEach((e=>e.onDispose((()=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)}))))})(e),{attach(s,r){return ve(s,e,{toggleVisibilityOnClick:!0,label:t,style:i.getFillStyle()}),this}}})))}Fe(t){var e,i;super.Fe(t);const s=this.GB.gy(),r=this.WB.gy(),n=this.MS.filter((t=>t.getVisible()&&t.wB)),o=xe(n.map((t=>t.category))),h=xe(Se(n.map((t=>t.subCategory)))),a=5e-4*t*((null===(e=this.RB)||void 0===e?void 0:e.speed)||0),l=.003*t*((null===(i=this.RB)||void 0===i?void 0:i.speed)||0),u=this.valueAxis.ft,c=u instanceof Di?(t,e)=>{var i;return oh(t,e,u,(null===(i=this.xm)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return hh(t,e,u,(null===(i=this.xm)||void 0===i?void 0:i.speed)||0)};let d;"columns"===this.DB?d=n.map((t=>({bar:t,position:{category:o.indexOf(t.category),valueStart:this.bB?1e-6:0,valueEnd:t.value}}))):"groups"===this.DB?d=n.map((t=>{const e=o.indexOf(t.category),i=h.indexOf(t.subCategory),s=1/(h.length+2*(h.length+1)*this.EB),r=this.EB*s;return{bar:t,position:{category:e+(i-(h.length-1)/2)*(s+r),valueStart:this.bB?1e-6:0,valueEnd:t.value}}})):(d=[],o.forEach(((t,e)=>{const i=n.filter((e=>e.category===t));let s=this.bB?1e-6:0;i.forEach(((e,i)=>{d.push({bar:e,position:{category:o.indexOf(t),valueStart:s,valueEnd:s+e.value}}),s+=e.value}))}))),d.forEach((t=>{const{bar:e,position:i}=t;let s,r,n=this.LB.get(e);void 0===n&&(n=i);const o=i.valueStart;if(this.RB&&n.category!==i.category){const t=Math.sign(i.category-n.category);s=n.category+a*t+l*(i.category-n.category),t!==Math.sign(i.category-s)&&(s=i.category)}else s=i.category;if(this.xm&&n.valueEnd!==i.valueEnd){const t=Math.sign(i.valueEnd-n.valueEnd);r=c(n.valueEnd,i.valueEnd),t!==Math.sign(i.valueEnd-r)&&(r=i.valueEnd)}else r=i.valueEnd;this.LB.set(e,{category:s,valueStart:o,valueEnd:r}),s===i.category&&r===i.valueEnd||this.cs.vs(!0),s===n.category&&r===n.valueEnd||(this.IB=!0)})),ta.kp(this.bp,this.Sp);const f=n.length>0;this.categoryAxis._r(),this.valueAxis._r();const g=this.categoryAxis.setVisible(f).Ds(),m=this.valueAxis.setVisible(f).Ds(r),{labelMarginBeforeCategoryAxisPixels:y}=f?this.HB(o,n,s,r):{labelMarginBeforeCategoryAxisPixels:0};this.categoryAxis.Fe(g,s,r,{labelMarginBeforeCategoryAxisPixels:y}),this.valueAxis.Fe(m);const p=this.categoryAxis.getThickness(),x=Rt(g.Od+y,void 0!==p.min?p.min:0,void 0!==p.max?p.max:Le),S={x:Math.min(this.pB.x.getInnerStart(),this.pB.x.getInnerEnd()),y:Math.min(this.pB.y.getInnerStart(),this.pB.y.getInnerEnd())},A=Math.max(this.pB.x.getInnerStart(),this.pB.x.getInnerEnd()),v=Math.max(this.pB.y.getInnerStart(),this.pB.y.getInnerEnd()),b={x:A-S.x,y:v-S.y};this.IS.Ie(S),this.IS.tt(b),this.PS.Ie(S),this.PS.tt(b),super.pp(),ia.Tp(this,this.IS.getIsUnderMouse(),!1,this.MS,void 0,((t,e)=>t.$c(e,!0)));const M=ta.Cp(this.bp,this.Sp);if(this.pB.Vi([this.jt.bottom+this.ya.bottom+("vertical"===this.Fs.OB?x:0),this.jt.top+this.ya.top+M+("horizontal"===this.Fs.OB?m.Od:0)]),this.pB.zi([this.jt.left+this.ya.left+this.Fs.getHeight({x,y:m.Od}),this.jt.right+this.ya.right]),this.zB.tx({x:this.pB.x.hi(),y:this.pB.y.hi(),width:this.pB.x.ni(),height:this.pB.y.ni()}),this.Qg&&this.Qg(),this.IB){const t=this.__.gy(),e="groups"===this.DB?1/(h.length+2*(h.length+1)*this.EB):1-2*this.EB;n.forEach((i=>{const s=this.LB.get(i);if(void 0===s)return;const r=s.category-.5*e,n=s.category+.5*e,o=[this.Fs.toPoint(r,s.valueStart),this.Fs.toPoint(r,s.valueEnd),this.Fs.toPoint(n,s.valueEnd),this.Fs.toPoint(n,s.valueStart)];t.add({Go:i.Go,vertices:o,bar:i},{fillStyle:i.be,strokeStyle:i.Me})})),t.finishPlot()}s.finishPlot(),r.finishPlot(),this.IB=!1}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationCategoryPosition(t),this.setAnimationValues(t),this.valueAxis.setAnimationsEnabled(t),this.categoryAxis.setAnimationsEnabled(t),this}solveNearest(t){}dispose(){return this.VB.U(),this.zB.U(),this.Fp.dispose(),this.Hm.U(),super.dispose()}YB(t){const e=this.TB;e&&t.sort(((i,s)=>e({category:i.category,value:t.reduce(((t,e)=>t+(e.category===i.category&&e.value||0)),0)},{category:s.category,value:t.reduce(((t,e)=>t+(e.category===s.category&&e.value||0)),0)})))}HB(t,e,i,s){let r=0;const n=this.FB,o=this.vB,h=this.valueAxis.getInterval(),a=this.Fs.getWidth({x:this.pB.x.ni(),y:this.pB.y.ni()});if(n&&n.labelFillStyle!==z){const o=n.tickLength+n.labelMargin,l=this.Fs.toPoint(0,1),u={Td:t.map(((t,i)=>{const s=e.reduce(((e,i)=>i.category!==t?e:e+i.value),0),r=n.formatter(t,s);if(!r)return;const a=i;return void 0!==a?{text:r,position:this.Fs.toPoint(a,this.valueAxis.ft.mi(h.start,-o)),alignment:l,rotation:n.labelRotation,sizePixels:this.$B(t,s)}:void 0})),Gu:n.labelFont,ft:this.pB},c=u?this.BB?Mf(u,a,this.Fs.getWidth):u.Td:[];c.forEach((t=>{t&&i.add().Eh(t.text).Ie(t.position).za(t.alignment).Gh(t.rotation).ke(n.labelFillStyle).Nh(n.labelFont)})),n.tickStyle!==ot&&0!==n.tickLength&&c.forEach((t=>{if(!t)return;const e=this.Fs.getWidth(t.position);s.add({positions:[this.Fs.toPoint(e,this.valueAxis.ft.getInnerStart()),this.Fs.toPoint(e,this.valueAxis.ft.mi(h.start,-n.tickLength))]},{lineStyle:n.tickStyle})})),r=c.reduce(((t,e)=>e?Math.max(t,this.Fs.getHeight(e.sizePixels)):t),0)+n.tickLength+n.labelMargin}if(o&&o.labelFillStyle!==z){let t;"after-bar"===o.position?t={Td:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.LB.get(t);return void 0!==s?{text:i,position:this.Fs.toPoint(s.category,this.valueAxis.ft.mi(s.valueEnd,o.labelMargin*Math.sign(s.valueEnd))),alignment:this.Fs.toPoint(0,-1*Math.sign(s.valueEnd)),rotation:o.labelRotation,sizePixels:this.XB(t)}:void 0})),Gu:o.labelFont,ft:this.pB}:"inside-bar"!==o.position&&"inside-bar-start"!==o.position&&"inside-bar-centered"!==o.position&&"inside-bar-end"!==o.position||(t={Td:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.LB.get(t);if(void 0===s)return;const r="bipolar"===this.SB?Math.sign(s.valueEnd):"negative"===this.SB?-1:1,n=this.Fs.toPoint(0,"inside-bar"===o.position||"inside-bar-end"===o.position?1*r:"inside-bar-centered"===o.position?0:-1*r);return{text:i,position:this.Fs.toPoint(s.category,"inside-bar"===o.position||"inside-bar-end"===o.position?this.valueAxis.ft.mi(s.valueEnd,-o.labelMargin*r):"inside-bar-centered"===o.position?(s.valueStart+s.valueEnd)/2:this.valueAxis.ft.mi(s.valueStart,o.labelMargin*r)),alignment:n,rotation:o.labelRotation,sizePixels:this.XB(t)}})),Gu:o.labelFont,ft:this.pB}),t&&(t?this.BB?Mf(t,a,this.Fs.getWidth):t.Td:[]).forEach((t=>{t&&i.add().Eh(t.text).Ie(t.position).za(t.alignment).Gh(t.rotation).ke(o.labelFillStyle).Nh(o.labelFont).setMouseInteractions(!1)}))}return{labelMarginBeforeCategoryAxisPixels:r}}$B(t,e){if(!this.FB||this.FB.labelFillStyle===z)return{x:0,y:0};const i=this.PB.get(t);if(i)return i;const s=this.FB.formatter(t,e),r=this.cs.Pg.Ig(s,this.FB.labelFont,this.FB.labelRotation);return r.isEstimate?this.cs.vs(!0):this.PB.set(t,r),r}XB(t){if(!this.vB||this.vB.labelFillStyle===z)return{x:0,y:0};const e=this.kB.get(t);if(e)return e;const i=this.cs.Pg.Ig(this.vB.formatter(t,t.category,t.value),this.vB.labelFont,this.vB.labelRotation);return i.isEstimate?this.cs.vs(!0):this.kB.set(t,i),i}xB(){return this.MS.reduce(((t,e)=>{const i=this.XB(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}CB(){this.IB=!0,this.cs.vs()}getMinimumSize(){return{x:200,y:200}}}const Tf={Disabled:void 0,None:void 0,Ascending:(t,e)=>t.value-e.value,Descending:(t,e)=>e.value-t.value,Alphabetical:(t,e)=>t.category.localeCompare(e.category)},wf={...ch,OB:"vertical",MB:-1,_B:1},kf={...dh,OB:"horizontal",MB:1,_B:-1},Cf=(t,e)=>e?t.x:t.y,Rf=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),If=(t,e,i,s,r,n)=>{const o=e.length,h=Math.sign(s),a=[],l=e.reduce(((t,e)=>t+e));for(let t=1;t<=o-1;t+=1)a.push(Cf(r,n)*e.slice(0,t).reduce(((t,e)=>t+e),0)/l);const u=a.map((t=>0));let c=a[i-1]+s;for(let e=i;e>0&&eRf(t,h,n,e))).reduce(((t,e)=>Math.max(t,Cf(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>Cf(r,n)-s||-1===h&&c<0+s){u.fill(0);break}if(e!==i&&(1===h?o>c:oa[e]+t)),f=d.map(((t,e)=>(t-(e>0?d[e-1]:0))/Cf(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class Ff{constructor(t,e,i,s,n){this.coordsRelative="relative",this.coordsClient="client",this.Xi=!1,this.EP=new Array,this.L=new r.Eventer,this.jB=[],this.Xg=[],this.ZB=void 0,this.QB=!0,this.JB=!0,this.KB=!0,this.Jg=!1,this.qB=!0,this.tL=()=>{this.qB=!0,this.cs.vs()},this.iL=[],this.onInViewChange=t=>this.L.on("inViewChange",t),this.offInViewChange=t=>this.L.off(t,"inViewChange"),this.sL=t=>{for(let e=0;e{const e=this.jB.indexOf(t);e>=0&&this.jB.splice(e,1)},this.sp=t=>{const e=this.Xg.indexOf(t);e>=0&&this.Xg.splice(e,1)},this.hL=(t,e,i,s,r)=>{if(this.rL(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.EP.push(n),this.nL(n),this.QB=!0,t}throw new mt("Out of dashboard range.")},this.oL=e.numberOfRows,this.aL=e.numberOfColumns,this.dA=t,this.lL=e,this.uL=s;const o=this.aL*this.oL;this.cL={x:new Yd(new Array(this.aL).fill(1)),y:new Yd(new Array(this.oL).fill(1))},this.ts=i.ts,this.dL=this.ts.dashboardSplitterStyle,this.ih=!0!==(null==e?void 0:e.disableAnimations)&&!1!==(null==e?void 0:e.animationsEnabled),this.fL=Gd(i,o),this.AL=i.II("dashboard splitters",500001),this.NM=()=>this.fL.FI(),this.ap=this.fL.DI(),this.hs=i.hs.rs(this,{gL:{}}),this.hs.gL.Ss(this.ts.effectsDashboardSplitters);const h=i.ai();this.uiScale=ut.d2({scaleXYConstructor:_i}).Oi(0,100).Ni(0,100).tt(h),this.pixelScale=ut.d2({scaleXYConstructor:_i}).Oi(0,this.uiScale.x.getCellSize()).Ni(0,this.uiScale.y.getCellSize()).tt(h),this.pL=i.mL.bind(i),this.yL=i.SL.bind(i),this.vL=i.xL.bind(i),this.bL=i.ML.bind(i),this.ho=i.ho.bind(i),this.no=i.no.bind(i),this.engine=i.hp,this.cs=i.rp,i.ko((()=>this.tL())),i.vs();const a=i.Io((t=>{this.Jg=t,this.L.emit("inViewChange",this,t)}));this.fp=i.Po.bind(i,a),this._L(),this.setAnimationsEnabled(this.ih);const l=((t,e)=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.L);this.createChartXY=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Pc(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Od(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Zc(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=Df(t,this.lL,this.ih),i=e&&e.type?e.type:Ua;return this.hL(new i(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=Df(t,this.lL,this.ih),i=e&&e.type?e.type:yd;return this.hL(new i(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=Df(t,this.lL,this.ih),i=e&&e.type?e.type:nd;return this.hL(new i(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=Df(t,this.lL,this.ih),i=t&&t.type?t.type:Ed;return this.hL(new i(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Jh(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new vl(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Oc(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Rl(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=Df(t,this.lL,this.ih),i=new Sl(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e);return this.hL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=Df(t,this.lL,this.ih),i=new ff(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l);return this.hL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=Df(t,this.lL,this.ih),i=new Ef(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e);return this.hL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}wL(t,e){return t+e*this.aL}CL(t,e){return{d1:i=>new i.scale1DConstructor("x"===i.dimension?t.columnIndex:t.rowIndex,"x"===i.dimension?t.columnSpan:t.rowSpan,"x"===i.dimension?this.aL:this.oL,"x"===i.dimension?e.x:e.y),d2:i=>(new i.scaleXYConstructor).ut({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.aL,y:this.oL},e),d3:()=>new at({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.aL,y:this.oL},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.pL(t[0]),this.yL(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.vL(t[0]),this.bL(t[1]),this}getWidth(){return this.ho()}getHeight(){return this.no()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.AL.vs(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.AL.vs(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.ts}setSplitterStyle(t){const e=this.dL;return this.dL="function"==typeof t?t(this.dL):t,this.kL(e),this}getSplitterStyle(){return this.dL}setSplitterEffect(t){return this.hs.gL.Ss(t),this.cs.vs(),this}getSplitterEffect(){return this.hs.gL.xs()}setAnimationHighlight(t){return this.KB=t,this.iL.forEach((e=>this.cs.us.ws(e.line,t))),this}getAnimationHighlight(){return this.KB}kL(t){for(const t of this.iL)t.line.Ee(this.dL);this._L()}setColumnWidth(t,e){const i=this.cL.x._();return t>=0&&t=e.length)throw new mt("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.cL.y._();return t>=0&&t=e.length)throw new mt("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}onResize(t){return this.L.on("resize",t)}offResize(t){return this.L.off(t,"resize")}TL(t,e,i){if(i&&Math.abs(t.x)>0)this.FL(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.IL(e,t.y)}for(const t of this.EP)t.panel.J();this.tL()}IL(t,e){const i=If(this.EP,this.cL.y._(),t,e,this.pixelScale.ai(),!1);this.cL.y.M(i),this.tL()}FL(t,e){const i=If(this.EP,this.cL.x._(),t,e,this.pixelScale.ai(),!0);this.cL.x.M(i),this.tL()}PL(){this.iL.forEach((t=>t.line.dispose())),this.iL.length=0;for(let t=1;t<=this.aL-1;t+=1)for(let e=0;e<=this.oL-1;e+=1)if(void 0!==this.EP.find((i=>He(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=Wi(new $i((()=>{this.DL(t)}),((e,i,s,r,n)=>{this.TL(r,t,!0),Zt(n)}),(()=>{this.BL(t)}))),s=this.AL.ze(this.pixelScale).Ee(this.dL).setMouseEnterEventHandler((()=>{this.DL(t)})).setMouseLeaveEventHandler((()=>{this.BL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.TL(n,t,!0),Zt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.cs.us.ls(s,(t=>s.ds(t)),{animationEnabled:this.KB}),this.iL.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.oL-1;t+=1)for(let e=0;e<=this.aL-1;e+=1)if(void 0!==this.EP.find((i=>He(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=Wi(new $i((()=>{this.LL(t)}),((e,i,s,r,n)=>{this.TL(r,t,!1),Zt(n)}),(()=>{this.RL(t)}))),s=this.AL.ze(this.pixelScale).Ee(this.dL).setMouseEnterEventHandler((()=>{this.LL(t)})).setMouseLeaveEventHandler((()=>{this.RL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.TL(n,t,!1),Zt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.cs.us.ls(s,(t=>s.ds(t)),{animationEnabled:this.KB}),this.iL.push({row:t,column:e,line:s,alignment:"horizontal"})}this.hs.gL.As(this.iL.map((t=>t.line)))}EL(){const t=this.pixelScale.ai(),e=this.cL.x._(),i=e.reduce(((t,e)=>t+e)),s=this.cL.y._(),r=s.reduce(((t,e)=>t+e));this.iL.forEach((n=>{if("vertical"===n.alignment){const o=u(t.x*e.slice(0,n.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,n.row).reduce(((t,e)=>t+e),0)/r),h=u(o.x,t.y*s.slice(0,n.row+1).reduce(((t,e)=>t+e),0)/r);n.line.Oe(o).Ve(h)}else{const o=u(t.x*e.slice(0,n.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,n.row).reduce(((t,e)=>t+e),0)/r),h=u(t.x*e.slice(0,n.column+1).reduce(((t,e)=>t+e),0)/i,o.y);n.line.Oe(o).Ve(h)}}))}DL(t){this.iL.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.cs.us._s(e.line,1),this.AL.zL(e.line))})),this.ZB=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.cs.vs()}LL(t){this.iL.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.cs.us._s(e.line,1),this.AL.zL(e.line))})),this.ZB=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.cs.vs()}BL(t){this.iL.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.cs.us._s(e.line,0)})),this.engine.restoreMouseStyle(this.ZB),this.cs.vs()}RL(t){this.iL.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.cs.us._s(e.line,0)})),this.engine.restoreMouseStyle(this.ZB),this.cs.vs()}setAnimationsEnabled(t){return this.ih=t,this.getCells().filter((t=>t.panel instanceof Qh)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.ih),this}getAnimationsEnabled(){return this.ih}getCells(){return this.EP.slice()}dispose(){return this.Xi||(this.fp&&this.fp(),this.EP.slice().forEach((t=>t.panel.dispose())),this.jB.slice().forEach((t=>t.dispose())),this.Xg.slice().forEach((t=>t.dispose())),this.Xi=!0,this.uL(),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")}getIsInView(){return this.Jg}saveToFile(t,e,i){return Xh(this.engine,t,e,i),this}VL(t){if(this.qB){const t=this.cs.ft.ai(),e=t.x,i=t.y;this.uiScale.tt(e,i),this.pixelScale.tt(e,i);const s=this.uiScale.getInnerIntervalPixels();this.pixelScale.Oi(0,s.x).Ni(0,s.y),this.L.emit("resize",this,s.x,s.y,e,i),this.JB=!0}this.QB&&(this.PL(),this.QB=!1,this.JB=!0),this.JB&&(this.EL(),this.JB=!1);for(const e of this.EP)e.panel.Fe(t);return this.jB.forEach((t=>t.Ds())),this.jB.forEach((t=>t.Fe())),this.Xg.forEach((t=>t.Ds())),this.Xg.forEach((t=>t.Fe())),this.qB=!1,this}Z(){for(const t of this.EP)t.panel.Z();return this.pixelScale.x.Z(),this.pixelScale.y.Z(),this.uiScale.x.Z(),this.uiScale.y.Z(),this}J(){for(const t of this.EP)t.panel.J();return this.pixelScale.x.J(),this.pixelScale.y.J(),this.uiScale.x.J(),this.uiScale.y.J(),this}translateCoordinate(t,e,i){return $h(t,e,i,this.pixelScale,this.cs)}addUIElement(t=Po,e=this.uiScale){e=jh(e,this.pixelScale);const i=Wh(t,this.NM(),this.uiScale,e,this.eL,this.ts);return this.jB.push(i),i}addLegendBox(t=$o,i=this.uiScale){i=jh(i,this.pixelScale);const s=Wh(t,this.ap,this.uiScale,i,this.sp,this.ts);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.Xg.push(s),s}getLegendBoxes(){return this.Xg}rL(t,e,i,s){return e>=0&&t>=0&&e+s<=this.oL&&t+i<=this.aL}nL(t){const e=this.dL,i=e===ot?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Ir(s)}_L(){this.uiScale.x.ei([0,0]),this.uiScale.y.ei([0,0]),this.pixelScale.x.ei([0,0]),this.pixelScale.y.ei([0,0]);for(const t of this.EP)this.nL(t);this.cs.vs()}}const Df=(t,e,i)=>{const s={...t,columnSpan:t.columnSpan||1,rowSpan:t.rowSpan||1,animationsEnabled:void 0!==t.disableAnimations?!t.disableAnimations:void 0!==t.animationsEnabled?t.animationsEnabled:i};var r,n;return s.rowIndex=(r=s.rowIndex,n=s.rowSpan,e.numberOfRows-(r+n)),s},Lf={None:In,Rectangle:mo,Circle:yo,Diamond:po,Pointer:xo},Vf={ChartMarkerXY:au,SeriesMarkerXY:lu},_f={XY:hu,Spider:Aa,BarChart:va,Map:Ea,Polar:Aa},Pf={Angola:{name:"Angola",ISO_A3:"AGO"},Burundi:{name:"Burundi",ISO_A3:"BDI"},Benin:{name:"Benin",ISO_A3:"BEN"},"Burkina Faso":{name:"Burkina Faso",ISO_A3:"BFA"},Botswana:{name:"Botswana",ISO_A3:"BWA"},"Central African Republic":{name:"Central African Republic",ISO_A3:"CAF"},"Ivory Coast":{name:"Ivory Coast",ISO_A3:"CIV"},Cameroon:{name:"Cameroon",ISO_A3:"CMR"},"Democratic Republic of the Congo":{name:"Democratic Republic of the Congo",ISO_A3:"COD"},"Republic of Congo":{name:"Republic of Congo",ISO_A3:"COG"},Comoros:{name:"Comoros",ISO_A3:"COM"},"Cape Verde":{name:"Cape Verde",ISO_A3:"CPV"},Djibouti:{name:"Djibouti",ISO_A3:"DJI"},Algeria:{name:"Algeria",ISO_A3:"DZA"},Egypt:{name:"Egypt",ISO_A3:"EGY"},Eritrea:{name:"Eritrea",ISO_A3:"ERI"},Ethiopia:{name:"Ethiopia",ISO_A3:"ETH"},Gabon:{name:"Gabon",ISO_A3:"GAB"},Ghana:{name:"Ghana",ISO_A3:"GHA"},Guinea:{name:"Guinea",ISO_A3:"GIN"},Gambia:{name:"Gambia",ISO_A3:"GMB"},"Guinea Bissau":{name:"Guinea Bissau",ISO_A3:"GNB"},"Equatorial Guinea":{name:"Equatorial Guinea",ISO_A3:"GNQ"},Israel:{name:"Israel",ISO_A3:"ISR"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Kenya:{name:"Kenya",ISO_A3:"KEN"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},Liberia:{name:"Liberia",ISO_A3:"LBR"},Libya:{name:"Libya",ISO_A3:"LBY"},Lesotho:{name:"Lesotho",ISO_A3:"LSO"},Morocco:{name:"Morocco",ISO_A3:"MAR"},Madagascar:{name:"Madagascar",ISO_A3:"MDG"},Mali:{name:"Mali",ISO_A3:"MLI"},Malta:{name:"Malta",ISO_A3:"MLT"},Mozambique:{name:"Mozambique",ISO_A3:"MOZ"},Mauritania:{name:"Mauritania",ISO_A3:"MRT"},Mauritius:{name:"Mauritius",ISO_A3:"MUS"},Malawi:{name:"Malawi",ISO_A3:"MWI"},Namibia:{name:"Namibia",ISO_A3:"NAM"},Niger:{name:"Niger",ISO_A3:"NER"},Nigeria:{name:"Nigeria",ISO_A3:"NGA"},Oman:{name:"Oman",ISO_A3:"OMN"},Rwanda:{name:"Rwanda",ISO_A3:"RWA"},"Western Sahara":{name:"Western Sahara",ISO_A3:"ESH"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Sudan:{name:"Sudan",ISO_A3:"SDN"},"South Sudan":{name:"South Sudan",ISO_A3:"SSD"},Senegal:{name:"Senegal",ISO_A3:"SEN"},"Saint Helena":{name:"Saint Helena",ISO_A3:"SHN"},"Sierra Leone":{name:"Sierra Leone",ISO_A3:"SLE"},Somalia:{name:"Somalia",ISO_A3:"SOM"},Swaziland:{name:"Swaziland",ISO_A3:"SWZ"},Seychelles:{name:"Seychelles",ISO_A3:"SYC"},Syria:{name:"Syria",ISO_A3:"SYR"},Chad:{name:"Chad",ISO_A3:"TCD"},Togo:{name:"Togo",ISO_A3:"TGO"},Tunisia:{name:"Tunisia",ISO_A3:"TUN"},"United Republic of Tanzania":{name:"United Republic of Tanzania",ISO_A3:"TZA"},Uganda:{name:"Uganda",ISO_A3:"UGA"},Yemen:{name:"Yemen",ISO_A3:"YEM"},"South Africa":{name:"South Africa",ISO_A3:"ZAF"},Zambia:{name:"Zambia",ISO_A3:"ZMB"},Zimbabwe:{name:"Zimbabwe",ISO_A3:"ZWE"}},Bf={Afghanistan:{name:"Afghanistan",ISO_A3:"AFG"},"United Arab Emirates":{name:"United Arab Emirates",ISO_A3:"ARE"},Armenia:{name:"Armenia",ISO_A3:"ARM"},Australia:{name:"Australia",ISO_A3:"AUS"},Azerbaijan:{name:"Azerbaijan",ISO_A3:"AZE"},Bangladesh:{name:"Bangladesh",ISO_A3:"BGD"},Bahrain:{name:"Bahrain",ISO_A3:"BHR"},Brunei:{name:"Brunei",ISO_A3:"BRN"},Bhutan:{name:"Bhutan",ISO_A3:"BTN"},China:{name:"China",ISO_A3:"CHN"},Georgia:{name:"Georgia",ISO_A3:"GEO"},Indonesia:{name:"Indonesia",ISO_A3:"IDN"},India:{name:"India",ISO_A3:"IND"},Iran:{name:"Iran",ISO_A3:"IRN"},Iraq:{name:"Iraq",ISO_A3:"IRQ"},Israel:{name:"Israel",ISO_A3:"ISR"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Japan:{name:"Japan",ISO_A3:"JPN"},Kazakhstan:{name:"Kazakhstan",ISO_A3:"KAZ"},Kyrgyzstan:{name:"Kyrgyzstan",ISO_A3:"KGZ"},Cambodia:{name:"Cambodia",ISO_A3:"KHM"},"South Korea":{name:"South Korea",ISO_A3:"KOR"},Kuwait:{name:"Kuwait",ISO_A3:"KWT"},Laos:{name:"Laos",ISO_A3:"LAO"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},"Sri Lanka":{name:"Sri Lanka",ISO_A3:"LKA"},Maldives:{name:"Maldives",ISO_A3:"MDV"},Myanmar:{name:"Myanmar",ISO_A3:"MMR"},Mongolia:{name:"Mongolia",ISO_A3:"MNG"},Malaysia:{name:"Malaysia",ISO_A3:"MYS"},Nepal:{name:"Nepal",ISO_A3:"NPL"},Oman:{name:"Oman",ISO_A3:"OMN"},Pakistan:{name:"Pakistan",ISO_A3:"PAK"},Philippines:{name:"Philippines",ISO_A3:"PHL"},"Papua New Guinea":{name:"Papua New Guinea",ISO_A3:"PNG"},"North Korea":{name:"North Korea",ISO_A3:"PRK"},Palestine:{name:"Palestine",ISO_A3:"PSE"},Qatar:{name:"Qatar",ISO_A3:"QAT"},Russia:{name:"Russia",ISO_A3:"RUS"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Singapore:{name:"Singapore",ISO_A3:"SGP"},Syria:{name:"Syria",ISO_A3:"SYR"},Thailand:{name:"Thailand",ISO_A3:"THA"},Tajikistan:{name:"Tajikistan",ISO_A3:"TJK"},Turkmenistan:{name:"Turkmenistan",ISO_A3:"TKM"},Turkey:{name:"Turkey",ISO_A3:"TUR"},Taiwan:{name:"Taiwan",ISO_A3:"TWN"},Uzbekistan:{name:"Uzbekistan",ISO_A3:"UZB"},Vietnam:{name:"Vietnam",ISO_A3:"VNM"},Yemen:{name:"Yemen",ISO_A3:"YEM"}},zf={"New South Wales":{name:"New South Wales"},Victoria:{name:"Victoria"},Queensland:{name:"Queensland"},"South Australia":{name:"South Australia"},"Western Australia":{name:"Western Australia"},Tasmania:{name:"Tasmania"},"Northern Territory":{name:"Northern Territory"},"Australian Capital Territory":{name:"Australian Capital Territory"},"Other Territories":{name:"Other Territories"}},Nf={"British Columbia":{name:"British Columbia"},Quebec:{name:"Quebec"},Nunavut:{name:"Nunavut"},"Prince Edward Island":{name:"Prince Edward Island"},Saskatchewan:{name:"Saskatchewan"},Yukon:{name:"Yukon"},Manitoba:{name:"Manitoba"},Ontario:{name:"Ontario"},"New Brunswick":{name:"New Brunswick"},"Northwest Territories":{name:"Northwest Territories"},Alberta:{name:"Alberta"},"Newfoundland and Labrador":{name:"Newfoundland and Labrador"},"Nova Scotia":{name:"Nova Scotia"}},Uf={Albania:{name:"Albania",ISO_A3:"ALB"},Austria:{name:"Austria",ISO_A3:"AUT"},Belarus:{name:"Belarus",ISO_A3:"BLR"},Belgium:{name:"Belgium",ISO_A3:"BEL"},Bulgaria:{name:"Bulgaria",ISO_A3:"BGR"},"Bosnia and Herzegovina":{name:"Bosnia and Herzegovina",ISO_A3:"BIH"},Switzerland:{name:"Switzerland",ISO_A3:"CHE"},Cyprus:{name:"Cyprus",ISO_A3:"CYP"},"Czech Republic":{name:"Czech Republic",ISO_A3:"CZE"},Germany:{name:"Germany",ISO_A3:"DEU"},Denmark:{name:"Denmark",ISO_A3:"DNK"},Spain:{name:"Spain",ISO_A3:"ESP"},Estonia:{name:"Estonia",ISO_A3:"EST"},Finland:{name:"Finland",ISO_A3:"FIN"},France:{name:"France",ISO_A3:"FRA"},"United Kingdom":{name:"United Kingdom",ISO_A3:"GBR"},Greece:{name:"Greece",ISO_A3:"GRC"},Croatia:{name:"Croatia",ISO_A3:"HRV"},Hungary:{name:"Hungary",ISO_A3:"HUN"},Ireland:{name:"Ireland",ISO_A3:"IRL"},Iceland:{name:"Iceland",ISO_A3:"ISL"},Italy:{name:"Italy",ISO_A3:"ITA"},Kosovo:{name:"Kosovo",ISO_A3:"-99"},Lithuania:{name:"Lithuania",ISO_A3:"LTU"},Luxembourg:{name:"Luxembourg",ISO_A3:"LUX"},Latvia:{name:"Latvia",ISO_A3:"LVA"},Macedonia:{name:"Macedonia",ISO_A3:"MKD"},Malta:{name:"Malta",ISO_A3:"MLT"},Montenegro:{name:"Montenegro",ISO_A3:"MNE"},Netherlands:{name:"Netherlands",ISO_A3:"NLD"},Norway:{name:"Norway",ISO_A3:"NOR"},Poland:{name:"Poland",ISO_A3:"POL"},Portugal:{name:"Portugal",ISO_A3:"PRT"},Romania:{name:"Romania",ISO_A3:"ROU"},"Republic of Serbia":{name:"Republic of Serbia",ISO_A3:"SRB"},Slovakia:{name:"Slovakia",ISO_A3:"SVK"},Slovenia:{name:"Slovenia",ISO_A3:"SVN"},Sweden:{name:"Sweden",ISO_A3:"SWE"},Ukraine:{name:"Ukraine",ISO_A3:"UKR"},Moldova:{name:"Moldova",ISO_A3:"MDA"},Russia:{name:"Russia",ISO_A3:"RUS"},Turkey:{name:"Turkey",ISO_A3:"TUR"}},Of={Aruba:{name:"Aruba",ISO_A3:"ABW"},Afghanistan:{name:"Afghanistan",ISO_A3:"AFG"},Angola:{name:"Angola",ISO_A3:"AGO"},Anguilla:{name:"Anguilla",ISO_A3:"AIA"},Albania:{name:"Albania",ISO_A3:"ALB"},Aland:{name:"Aland",ISO_A3:"ALA"},Andorra:{name:"Andorra",ISO_A3:"AND"},"United Arab Emirates":{name:"United Arab Emirates",ISO_A3:"ARE"},Argentina:{name:"Argentina",ISO_A3:"ARG"},Armenia:{name:"Armenia",ISO_A3:"ARM"},"American Samoa":{name:"American Samoa",ISO_A3:"ASM"},Antarctica:{name:"Antarctica",ISO_A3:"ATA"},"French Southern and Antarctic Lands":{name:"French Southern and Antarctic Lands",ISO_A3:"ATF"},"Antigua and Barbuda":{name:"Antigua and Barbuda",ISO_A3:"ATG"},Australia:{name:"Australia",ISO_A3:"AUS"},Austria:{name:"Austria",ISO_A3:"AUT"},Azerbaijan:{name:"Azerbaijan",ISO_A3:"AZE"},Burundi:{name:"Burundi",ISO_A3:"BDI"},Belgium:{name:"Belgium",ISO_A3:"BEL"},Benin:{name:"Benin",ISO_A3:"BEN"},"Burkina Faso":{name:"Burkina Faso",ISO_A3:"BFA"},Bangladesh:{name:"Bangladesh",ISO_A3:"BGD"},Bulgaria:{name:"Bulgaria",ISO_A3:"BGR"},Bahrain:{name:"Bahrain",ISO_A3:"BHR"},"The Bahamas":{name:"The Bahamas",ISO_A3:"BHS"},"Bosnia and Herzegovina":{name:"Bosnia and Herzegovina",ISO_A3:"BIH"},Belarus:{name:"Belarus",ISO_A3:"BLR"},Belize:{name:"Belize",ISO_A3:"BLZ"},Bermuda:{name:"Bermuda",ISO_A3:"BMU"},Bolivia:{name:"Bolivia",ISO_A3:"BOL"},Brazil:{name:"Brazil",ISO_A3:"BRA"},Barbados:{name:"Barbados",ISO_A3:"BRB"},Brunei:{name:"Brunei",ISO_A3:"BRN"},Bhutan:{name:"Bhutan",ISO_A3:"BTN"},Botswana:{name:"Botswana",ISO_A3:"BWA"},"Central African Republic":{name:"Central African Republic",ISO_A3:"CAF"},Canada:{name:"Canada",ISO_A3:"CAN"},Switzerland:{name:"Switzerland",ISO_A3:"CHE"},Chile:{name:"Chile",ISO_A3:"CHL"},China:{name:"China",ISO_A3:"CHN"},"Ivory Coast":{name:"Ivory Coast",ISO_A3:"CIV"},Cameroon:{name:"Cameroon",ISO_A3:"CMR"},"Cyprus No Mans Area":{name:"Cyprus No Mans Area",ISO_A3:"-99"},"Democratic Republic of the Congo":{name:"Democratic Republic of the Congo",ISO_A3:"COD"},"Republic of Congo":{name:"Republic of Congo",ISO_A3:"COG"},"Cook Islands":{name:"Cook Islands",ISO_A3:"COK"},Colombia:{name:"Colombia",ISO_A3:"COL"},Comoros:{name:"Comoros",ISO_A3:"COM"},"Cape Verde":{name:"Cape Verde",ISO_A3:"CPV"},"Costa Rica":{name:"Costa Rica",ISO_A3:"CRI"},Cuba:{name:"Cuba",ISO_A3:"CUB"},Curaçao:{name:"Curaçao",ISO_A3:"CUW"},"Cayman Islands":{name:"Cayman Islands",ISO_A3:"CYM"},"Northern Cyprus":{name:"Northern Cyprus",ISO_A3:"-99"},Cyprus:{name:"Cyprus",ISO_A3:"CYP"},"Czech Republic":{name:"Czech Republic",ISO_A3:"CZE"},Germany:{name:"Germany",ISO_A3:"DEU"},Djibouti:{name:"Djibouti",ISO_A3:"DJI"},Dominica:{name:"Dominica",ISO_A3:"DMA"},Denmark:{name:"Denmark",ISO_A3:"DNK"},"Dominican Republic":{name:"Dominican Republic",ISO_A3:"DOM"},Algeria:{name:"Algeria",ISO_A3:"DZA"},Ecuador:{name:"Ecuador",ISO_A3:"ECU"},Egypt:{name:"Egypt",ISO_A3:"EGY"},Eritrea:{name:"Eritrea",ISO_A3:"ERI"},"Dhekelia Sovereign Base Area":{name:"Dhekelia Sovereign Base Area",ISO_A3:"-99"},Spain:{name:"Spain",ISO_A3:"ESP"},Estonia:{name:"Estonia",ISO_A3:"EST"},Ethiopia:{name:"Ethiopia",ISO_A3:"ETH"},Finland:{name:"Finland",ISO_A3:"FIN"},Fiji:{name:"Fiji",ISO_A3:"FJI"},"Falkland Islands":{name:"Falkland Islands",ISO_A3:"FLK"},France:{name:"France",ISO_A3:"FRA"},"Faroe Islands":{name:"Faroe Islands",ISO_A3:"FRO"},"Federated States of Micronesia":{name:"Federated States of Micronesia",ISO_A3:"FSM"},Gabon:{name:"Gabon",ISO_A3:"GAB"},"United Kingdom":{name:"United Kingdom",ISO_A3:"GBR"},Georgia:{name:"Georgia",ISO_A3:"GEO"},Guernsey:{name:"Guernsey",ISO_A3:"GGY"},Ghana:{name:"Ghana",ISO_A3:"GHA"},Guinea:{name:"Guinea",ISO_A3:"GIN"},Gambia:{name:"Gambia",ISO_A3:"GMB"},"Guinea Bissau":{name:"Guinea Bissau",ISO_A3:"GNB"},"Equatorial Guinea":{name:"Equatorial Guinea",ISO_A3:"GNQ"},Greece:{name:"Greece",ISO_A3:"GRC"},Grenada:{name:"Grenada",ISO_A3:"GRD"},Greenland:{name:"Greenland",ISO_A3:"GRL"},Guatemala:{name:"Guatemala",ISO_A3:"GTM"},Guam:{name:"Guam",ISO_A3:"GUM"},Guyana:{name:"Guyana",ISO_A3:"GUY"},"Hong Kong S.A.R.":{name:"Hong Kong S.A.R.",ISO_A3:"HKG"},"Heard Island and McDonald Islands":{name:"Heard Island and McDonald Islands",ISO_A3:"HMD"},Honduras:{name:"Honduras",ISO_A3:"HND"},Croatia:{name:"Croatia",ISO_A3:"HRV"},Haiti:{name:"Haiti",ISO_A3:"HTI"},Hungary:{name:"Hungary",ISO_A3:"HUN"},Indonesia:{name:"Indonesia",ISO_A3:"IDN"},"Isle of Man":{name:"Isle of Man",ISO_A3:"IMN"},India:{name:"India",ISO_A3:"IND"},"Indian Ocean Territories":{name:"Indian Ocean Territories",ISO_A3:"-99"},"British Indian Ocean Territory":{name:"British Indian Ocean Territory",ISO_A3:"IOT"},Ireland:{name:"Ireland",ISO_A3:"IRL"},Iran:{name:"Iran",ISO_A3:"IRN"},Iraq:{name:"Iraq",ISO_A3:"IRQ"},Iceland:{name:"Iceland",ISO_A3:"ISL"},Israel:{name:"Israel",ISO_A3:"ISR"},Italy:{name:"Italy",ISO_A3:"ITA"},Jamaica:{name:"Jamaica",ISO_A3:"JAM"},Jersey:{name:"Jersey",ISO_A3:"JEY"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Japan:{name:"Japan",ISO_A3:"JPN"},"Baykonur Cosmodrome":{name:"Baykonur Cosmodrome",ISO_A3:"-99"},"Siachen Glacier":{name:"Siachen Glacier",ISO_A3:"-99"},Kazakhstan:{name:"Kazakhstan",ISO_A3:"KAZ"},Kenya:{name:"Kenya",ISO_A3:"KEN"},Kyrgyzstan:{name:"Kyrgyzstan",ISO_A3:"KGZ"},Cambodia:{name:"Cambodia",ISO_A3:"KHM"},Kiribati:{name:"Kiribati",ISO_A3:"KIR"},"Saint Kitts and Nevis":{name:"Saint Kitts and Nevis",ISO_A3:"KNA"},"South Korea":{name:"South Korea",ISO_A3:"KOR"},Kosovo:{name:"Kosovo",ISO_A3:"-99"},Kuwait:{name:"Kuwait",ISO_A3:"KWT"},Laos:{name:"Laos",ISO_A3:"LAO"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},Liberia:{name:"Liberia",ISO_A3:"LBR"},Libya:{name:"Libya",ISO_A3:"LBY"},"Saint Lucia":{name:"Saint Lucia",ISO_A3:"LCA"},Liechtenstein:{name:"Liechtenstein",ISO_A3:"LIE"},"Sri Lanka":{name:"Sri Lanka",ISO_A3:"LKA"},Lesotho:{name:"Lesotho",ISO_A3:"LSO"},Lithuania:{name:"Lithuania",ISO_A3:"LTU"},Luxembourg:{name:"Luxembourg",ISO_A3:"LUX"},Latvia:{name:"Latvia",ISO_A3:"LVA"},"Macao S.A.R":{name:"Macao S.A.R",ISO_A3:"MAC"},"Saint Martin":{name:"Saint Martin",ISO_A3:"MAF"},Morocco:{name:"Morocco",ISO_A3:"MAR"},Moldova:{name:"Moldova",ISO_A3:"MDA"},Madagascar:{name:"Madagascar",ISO_A3:"MDG"},Maldives:{name:"Maldives",ISO_A3:"MDV"},Mexico:{name:"Mexico",ISO_A3:"MEX"},"Marshall Islands":{name:"Marshall Islands",ISO_A3:"MHL"},Macedonia:{name:"Macedonia",ISO_A3:"MKD"},Mali:{name:"Mali",ISO_A3:"MLI"},Malta:{name:"Malta",ISO_A3:"MLT"},Myanmar:{name:"Myanmar",ISO_A3:"MMR"},Montenegro:{name:"Montenegro",ISO_A3:"MNE"},Mongolia:{name:"Mongolia",ISO_A3:"MNG"},"Northern Mariana Islands":{name:"Northern Mariana Islands",ISO_A3:"MNP"},Mozambique:{name:"Mozambique",ISO_A3:"MOZ"},Mauritania:{name:"Mauritania",ISO_A3:"MRT"},Montserrat:{name:"Montserrat",ISO_A3:"MSR"},Mauritius:{name:"Mauritius",ISO_A3:"MUS"},Malawi:{name:"Malawi",ISO_A3:"MWI"},Malaysia:{name:"Malaysia",ISO_A3:"MYS"},Namibia:{name:"Namibia",ISO_A3:"NAM"},"New Caledonia":{name:"New Caledonia",ISO_A3:"NCL"},Niger:{name:"Niger",ISO_A3:"NER"},Nigeria:{name:"Nigeria",ISO_A3:"NGA"},Nicaragua:{name:"Nicaragua",ISO_A3:"NIC"},Niue:{name:"Niue",ISO_A3:"NIU"},Netherlands:{name:"Netherlands",ISO_A3:"NLD"},Norway:{name:"Norway",ISO_A3:"NOR"},Nepal:{name:"Nepal",ISO_A3:"NPL"},"New Zealand":{name:"New Zealand",ISO_A3:"NZL"},Oman:{name:"Oman",ISO_A3:"OMN"},Pakistan:{name:"Pakistan",ISO_A3:"PAK"},Panama:{name:"Panama",ISO_A3:"PAN"},"Pitcairn Islands":{name:"Pitcairn Islands",ISO_A3:"PCN"},Peru:{name:"Peru",ISO_A3:"PER"},"Spratly Islands":{name:"Spratly Islands",ISO_A3:"-99"},Philippines:{name:"Philippines",ISO_A3:"PHL"},Palau:{name:"Palau",ISO_A3:"PLW"},"Papua New Guinea":{name:"Papua New Guinea",ISO_A3:"PNG"},Poland:{name:"Poland",ISO_A3:"POL"},"Puerto Rico":{name:"Puerto Rico",ISO_A3:"PRI"},"North Korea":{name:"North Korea",ISO_A3:"PRK"},Portugal:{name:"Portugal",ISO_A3:"PRT"},Paraguay:{name:"Paraguay",ISO_A3:"PRY"},Palestine:{name:"Palestine",ISO_A3:"PSE"},"French Polynesia":{name:"French Polynesia",ISO_A3:"PYF"},Qatar:{name:"Qatar",ISO_A3:"QAT"},Romania:{name:"Romania",ISO_A3:"ROU"},Russia:{name:"Russia",ISO_A3:"RUS"},Rwanda:{name:"Rwanda",ISO_A3:"RWA"},"Western Sahara":{name:"Western Sahara",ISO_A3:"ESH"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Sudan:{name:"Sudan",ISO_A3:"SDN"},"South Sudan":{name:"South Sudan",ISO_A3:"SSD"},Senegal:{name:"Senegal",ISO_A3:"SEN"},Singapore:{name:"Singapore",ISO_A3:"SGP"},"South Georgia and South Sandwich Islands":{name:"South Georgia and South Sandwich Islands",ISO_A3:"SGS"},"Saint Helena":{name:"Saint Helena",ISO_A3:"SHN"},"Solomon Islands":{name:"Solomon Islands",ISO_A3:"SLB"},"Sierra Leone":{name:"Sierra Leone",ISO_A3:"SLE"},"El Salvador":{name:"El Salvador",ISO_A3:"SLV"},Somalia:{name:"Somalia",ISO_A3:"SOM"},"Saint Pierre and Miquelon":{name:"Saint Pierre and Miquelon",ISO_A3:"SPM"},"Republic of Serbia":{name:"Republic of Serbia",ISO_A3:"SRB"},"Sao Tome and Principe":{name:"Sao Tome and Principe",ISO_A3:"STP"},Suriname:{name:"Suriname",ISO_A3:"SUR"},Slovakia:{name:"Slovakia",ISO_A3:"SVK"},Slovenia:{name:"Slovenia",ISO_A3:"SVN"},Sweden:{name:"Sweden",ISO_A3:"SWE"},Swaziland:{name:"Swaziland",ISO_A3:"SWZ"},Seychelles:{name:"Seychelles",ISO_A3:"SYC"},Syria:{name:"Syria",ISO_A3:"SYR"},"Turks and Caicos Islands":{name:"Turks and Caicos Islands",ISO_A3:"TCA"},Chad:{name:"Chad",ISO_A3:"TCD"},Togo:{name:"Togo",ISO_A3:"TGO"},Thailand:{name:"Thailand",ISO_A3:"THA"},Tajikistan:{name:"Tajikistan",ISO_A3:"TJK"},Turkmenistan:{name:"Turkmenistan",ISO_A3:"TKM"},"East Timor":{name:"East Timor",ISO_A3:"TLS"},Tonga:{name:"Tonga",ISO_A3:"TON"},"Trinidad and Tobago":{name:"Trinidad and Tobago",ISO_A3:"TTO"},Tunisia:{name:"Tunisia",ISO_A3:"TUN"},Turkey:{name:"Turkey",ISO_A3:"TUR"},Tuvalu:{name:"Tuvalu",ISO_A3:"TUV"},Taiwan:{name:"Taiwan",ISO_A3:"TWN"},"United Republic of Tanzania":{name:"United Republic of Tanzania",ISO_A3:"TZA"},Uganda:{name:"Uganda",ISO_A3:"UGA"},Ukraine:{name:"Ukraine",ISO_A3:"UKR"},"United States Minor Outlying Islands":{name:"United States Minor Outlying Islands",ISO_A3:"UMI"},Uruguay:{name:"Uruguay",ISO_A3:"URY"},"United States of America":{name:"United States of America",ISO_A3:"USA"},"US Naval Base Guantanamo Bay":{name:"US Naval Base Guantanamo Bay",ISO_A3:"-99"},Uzbekistan:{name:"Uzbekistan",ISO_A3:"UZB"},"Saint Vincent and the Grenadines":{name:"Saint Vincent and the Grenadines",ISO_A3:"VCT"},Venezuela:{name:"Venezuela",ISO_A3:"VEN"},"British Virgin Islands":{name:"British Virgin Islands",ISO_A3:"VGB"},"United States Virgin Islands":{name:"United States Virgin Islands",ISO_A3:"VIR"},Vietnam:{name:"Vietnam",ISO_A3:"VNM"},Vanuatu:{name:"Vanuatu",ISO_A3:"VUT"},"Wallis and Futuna":{name:"Wallis and Futuna",ISO_A3:"WLF"},"Akrotiri Sovereign Base Area":{name:"Akrotiri Sovereign Base Area",ISO_A3:"-99"},Samoa:{name:"Samoa",ISO_A3:"WSM"},Yemen:{name:"Yemen",ISO_A3:"YEM"},"South Africa":{name:"South Africa",ISO_A3:"ZAF"},Zambia:{name:"Zambia",ISO_A3:"ZMB"},Zimbabwe:{name:"Zimbabwe",ISO_A3:"ZWE"},"French Guyana":{name:"French Guyana",ISO_A3:"GUF"}},Gf={Alabama:{name:"Alabama"},Alaska:{name:"Alaska"},Arizona:{name:"Arizona"},Arkansas:{name:"Arkansas"},California:{name:"California"},Colorado:{name:"Colorado"},Connecticut:{name:"Connecticut"},Delaware:{name:"Delaware"},"District of Columbia":{name:"District of Columbia"},Florida:{name:"Florida"},Georgia:{name:"Georgia"},Hawaii:{name:"Hawaii"},Idaho:{name:"Idaho"},Illinois:{name:"Illinois"},Indiana:{name:"Indiana"},Iowa:{name:"Iowa"},Kansas:{name:"Kansas"},Kentucky:{name:"Kentucky"},Louisiana:{name:"Louisiana"},Maine:{name:"Maine"},Maryland:{name:"Maryland"},Massachusetts:{name:"Massachusetts"},Michigan:{name:"Michigan"},Minnesota:{name:"Minnesota"},Mississippi:{name:"Mississippi"},Missouri:{name:"Missouri"},Montana:{name:"Montana"},Nebraska:{name:"Nebraska"},Nevada:{name:"Nevada"},"New Hampshire":{name:"New Hampshire"},"New Jersey":{name:"New Jersey"},"New Mexico":{name:"New Mexico"},"New York":{name:"New York"},"North Carolina":{name:"North Carolina"},"North Dakota":{name:"North Dakota"},Ohio:{name:"Ohio"},Oklahoma:{name:"Oklahoma"},Oregon:{name:"Oregon"},Pennsylvania:{name:"Pennsylvania"},"Rhode Island":{name:"Rhode Island"},"South Carolina":{name:"South Carolina"},"South Dakota":{name:"South Dakota"},Tennessee:{name:"Tennessee"},Texas:{name:"Texas"},Utah:{name:"Utah"},Vermont:{name:"Vermont"},Virginia:{name:"Virginia"},Washington:{name:"Washington"},"West Virginia":{name:"West Virginia"},Wisconsin:{name:"Wisconsin"},Wyoming:{name:"Wyoming"}},Yf={Anguilla:{name:"Anguilla",ISO_A3:"AIA"},"Antigua and Barbuda":{name:"Antigua and Barbuda",ISO_A3:"ATG"},"The Bahamas":{name:"The Bahamas",ISO_A3:"BHS"},Bermuda:{name:"Bermuda",ISO_A3:"BMU"},Barbados:{name:"Barbados",ISO_A3:"BRB"},Canada:{name:"Canada",ISO_A3:"CAN"},Cuba:{name:"Cuba",ISO_A3:"CUB"},"Cayman Islands":{name:"Cayman Islands",ISO_A3:"CYM"},Dominica:{name:"Dominica",ISO_A3:"DMA"},"Dominican Republic":{name:"Dominican Republic",ISO_A3:"DOM"},Grenada:{name:"Grenada",ISO_A3:"GRD"},Greenland:{name:"Greenland",ISO_A3:"GRL"},Haiti:{name:"Haiti",ISO_A3:"HTI"},Jamaica:{name:"Jamaica",ISO_A3:"JAM"},"Saint Kitts and Nevis":{name:"Saint Kitts and Nevis",ISO_A3:"KNA"},"Saint Lucia":{name:"Saint Lucia",ISO_A3:"LCA"},"Saint Martin":{name:"Saint Martin",ISO_A3:"MAF"},Mexico:{name:"Mexico",ISO_A3:"MEX"},Montserrat:{name:"Montserrat",ISO_A3:"MSR"},"Puerto Rico":{name:"Puerto Rico",ISO_A3:"PRI"},"Saint Pierre and Miquelon":{name:"Saint Pierre and Miquelon",ISO_A3:"SPM"},"Turks and Caicos Islands":{name:"Turks and Caicos Islands",ISO_A3:"TCA"},"Trinidad and Tobago":{name:"Trinidad and Tobago",ISO_A3:"TTO"},"United States of America":{name:"United States of America",ISO_A3:"USA"},"Saint Vincent and the Grenadines":{name:"Saint Vincent and the Grenadines",ISO_A3:"VCT"},"British Virgin Islands":{name:"British Virgin Islands",ISO_A3:"VGB"},"United States Virgin Islands":{name:"United States Virgin Islands",ISO_A3:"VIR"}},Hf={Argentina:{name:"Argentina",ISO_A3:"ARG"},Bolivia:{name:"Bolivia",ISO_A3:"BOL"},Brazil:{name:"Brazil",ISO_A3:"BRA"},Chile:{name:"Chile",ISO_A3:"CHL"},Colombia:{name:"Colombia",ISO_A3:"COL"},"Costa Rica":{name:"Costa Rica",ISO_A3:"CRI"},Ecuador:{name:"Ecuador",ISO_A3:"ECU"},"Falkland Islands":{name:"Falkland Islands",ISO_A3:"FLK"},Guyana:{name:"Guyana",ISO_A3:"GUY"},Nicaragua:{name:"Nicaragua",ISO_A3:"NIC"},Panama:{name:"Panama",ISO_A3:"PAN"},Peru:{name:"Peru",ISO_A3:"PER"},Paraguay:{name:"Paraguay",ISO_A3:"PRY"},Suriname:{name:"Suriname",ISO_A3:"SUR"},Uruguay:{name:"Uruguay",ISO_A3:"URY"},Venezuela:{name:"Venezuela",ISO_A3:"VEN"},"French Guyana":{name:"French Guyana",ISO_A3:"GUF"},Guatemala:{name:"Guatemala",ISO_A3:"GTM"},"El Salvador":{name:"El Salvador",ISO_A3:"SLV"},Honduras:{name:"Honduras",ISO_A3:"HND"}},Xf={World:Of,USA:Gf,NorthAmerica:Yf,SouthAmerica:Hf,Canada:Nf,Europe:Uf,Asia:Bf,Africa:Pf,Australia:zf},Wf={Solid:yd},jf=(t,e)=>Math.abs(t)+Math.abs(e);function $f(t,e){const i=t.reduce(jf,0),s=(r=t,Math.max(...r.map((t=>t))));var r;const n=(t=>Math.min(...t.map((t=>t))))(t);return Math.max(e**2*s/i**2,i**2/(e**2*n))}const Zf=({height:t,width:e})=>t>e?{value:e,vertical:!1}:{value:t,vertical:!0},Kf=({data:t,dimensions:e})=>{const{x:i,y:s,width:r,height:n}=e,o=t.map((t=>t.value)).reduce(jf,0),h=t.map((t=>t.animatedValue)).reduce(jf,0),a=t.map((t=>t.animatedValue*n*r/h)),l=a.reduce(((t,e)=>t+e),0),u=a.map((t=>t/l*100)),c=a.filter(((t,e)=>u[e])),d={children:[],id:0,parentID:-1,name:"Main Rectangle",value:o,animatedValue:h,x:i,y:s,width:r,height:n,nodeIndex:-1,userNode:{name:"Main Rectangle"}};if(1===t.length){const i={...t[0],x:e.x,y:e.y,width:e.width,height:e.height};d.children.push(i)}else qf(c,Zf(d).value,t,d);return d.children},Jf=(t,e,i,s,r)=>{const n=t.reduce(jf,0)/e;t.forEach(((t,e)=>{const o=Math.abs(t)/n,{x:h,y:a,children:l}=r,u={...s[l.length],x:h,y:a,width:i?n:o,height:i?o:n};i?r.y+=o:r.x+=o,l.push(u)})),i?(r.x+=n,r.y-=e,r.width-=n):(r.x-=e,r.y+=n,r.height-=n)},qf=(t,e,i,s)=>{const r=[{children:t,width:e,row:[]}];for(;r.length>0;){const t=r.pop();if(!t)continue;const{children:e,width:n,row:o}=t;let h=0;const a=[...o];for(;hl)){Jf(a,n,Zf(s).vertical,i,s),r.push({children:e.slice(h),width:Zf(s).value,row:[]});break}a.push(e[h]),h+=1}h===e.length&&Jf(a,n,Zf(s).vertical,i,s)}};class Qf extends Qh{constructor(t,i,s,r,n,o,h){if(super(t,i,s,i.yp("treeMapChart bg",0),r,i.cs.ts.treeMapChartBackgroundFillStyle||i.cs.ts.chartXYSeriesBackgroundFillStyle,i.cs.ts.treeMapChartBackgroundStrokeStyle||i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.treeMapChartTitleFont||i.cs.ts.chartXYTitleFont,i.cs.ts.treeMapChartTitleFillStyle||i.cs.ts.chartXYTitleFillStyle,h),this.OL=new Map,this.NL=[],this.GL={},this.WL=p([]),this.xm={speed:1},this.UL=Le,this.YL=!0,this.HL="Go Back",this.$L=[],this.XL=this.ts.treeMapChartPathLabelFillStyle||this.ts.uiTextFillStyle,this.jL=this.ts.treeMapChartPathLabelFont||this.ts.uiTextFont,this.ZL=this.ts.treeMapChartLabelHeaderFillStyle||this.ts.uiTextFillStyle,this.QL=this.ts.treeMapChartLabelHeaderFont||this.ts.uiTextFont,this.JL=this.ts.treeMapChartLabelFillStyle||this.ts.uiTextFillStyle,this.KL=this.ts.treeMapChartLabelFont||this.ts.uiTextFont,this.Hi=!0,this.Tx=e.AutoCursorModes.onHover,this.Om=tg,this.Ix=!0,this.qL=!1,this.tR=this.ts.treeMapChartParentColor||I,this.iR=this.ts.treeMapChartNodeStrokeStyle||this.ts.uiBackgroundStrokeStyle,this.onNodeMouseEnter=t=>this.L.on("mouseEnter",t),this.onNodeMouseLeave=t=>this.L.on("mouseLeave",t),this.onNodeMouseClick=t=>this.L.on("mouseClick",t),this.onNodeMouseDoubleClick=t=>this.L.on("mouseDoubleClick",t),this.onNodeMouseDown=t=>this.L.on("mouseDown",t),this.onNodeMouseUp=t=>this.L.on("mouseUp",t),this.onNodeMouseMove=t=>this.L.on("mouseMove",t),this.offNodeMouseEnter=t=>this.L.off(t,"mouseEnter"),this.offNodeMouseLeave=t=>this.L.off(t,"mouseLeave"),this.offNodeMouseClick=t=>this.L.off(t,"mouseClick"),this.offNodeMouseDoubleClick=t=>this.L.off(t,"mouseDoubleClick"),this.offNodeMouseDown=t=>this.L.off(t,"mouseDown"),this.offNodeMouseUp=t=>this.L.off(t,"mouseUp"),this.offNodeMouseMove=t=>this.L.off(t,"mouseMove"),this.offNodeMouseDragStart=t=>this.L.off(t,"mouseDragStart"),this.offNodeMouseDrag=t=>this.L.off(t,"mouseDrag"),this.offNodeMouseDragStop=t=>this.L.off(t,"mouseDragStop"),this.offNodeMouseWheel=t=>this.L.off(t,"mouseWheel"),this.Bx=(t,e,i,s,r)=>{this.cs.vs(),this.qL=!0},this.Ct=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=s,Zt(t)),this.Ix&&this.cs.us._s(i,!0),this.YL&&this.engine.setMouseStyle(e.MouseStyles.Point),this.L.emit("mouseEnter",this,t,s.userNode),this.cs.vs())},this.kt=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=void 0,t&&Zt(t)),this.Ix&&this.cs.us._s(i,!1),this.engine.setMouseStyle(e.MouseStyles.Default),this.L.emit("mouseLeave",this,t,s.userNode),this.cs.vs())},this.Dt=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=s,Zt(t)),this.Ix&&this.cs.us._s(i,!0),this.YL&&this.engine.setMouseStyle(e.MouseStyles.Point),this.L.emit("mouseEnter",this,t,s.userNode),this.cs.vs())},this.Tt=(t,e)=>{const i=this.sR(e);if(i){if(this.YL){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.GL[i.parentID]:void 0;e&&(this.WL.M([e]),this.Kx=void 0,this.L.emit("viewChange",this.WL._()),this.qL=!0),t&&Zt(t)}this.L.emit("mouseClick",this,t,i.userNode),this.cs.vs()}},this.Ft=(t,e)=>{var i;const s=null===(i=this.OL.get(e))||void 0===i?void 0:i.userNode;this.L.emit("mouseDoubleClick",this,t,s)},this.It=(t,e)=>{var i;const s=null===(i=this.OL.get(e))||void 0===i?void 0:i.userNode;this.L.emit("mouseDown",this,t,s)},this.Pt=(t,e)=>{var i;const s=null===(i=this.OL.get(e))||void 0===i?void 0:i.userNode;this.L.emit("mouseUp",this,t,s)},this.Lt=(t,e,i)=>{var s;const r=null===(s=this.OL.get(i))||void 0===s?void 0:s.userNode;this.L.emit("mouseDragStart",this,t,e,r)},this.Bt=(t,e,i,s,r)=>{var n;const o=null===(n=this.OL.get(r))||void 0===n?void 0:n.userNode;this.L.emit("mouseDrag",this,t,e,i,s,o)},this.Rt=(t,e,i,s)=>{var r;const n=null===(r=this.OL.get(s))||void 0===r?void 0:r.userNode;this.L.emit("mouseDragStop",this,t,e,i,n)},this.Et=(t,e)=>{var i;const s=null===(i=this.OL.get(e))||void 0===i?void 0:i.userNode;this.L.emit("mouseWheel",this,t,s)},this.zt=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=s),this.Ix&&this.cs.us._s(i,!0),this.L.emit("touchStart",this,t,s.userNode),this.cs.vs(),Zt(t))},this.Vt=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=s),this.Ix&&this.cs.us._s(i,!0),this.L.emit("touchMove",this,t,s.userNode),this.cs.vs(),Zt(t))},this.Ot=(t,i)=>{const s=this.sR(i);if(s){if(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=void 0),this.YL){const e=(null==s?void 0:s.children.length)?s:s.parentID?this.GL[s.parentID]:void 0;e&&(this.WL.M([e]),this.L.emit("viewChange",this.WL._()),this.qL=!0),t&&Zt(t)}this.Ix&&this.cs.us._s(i,!1),this.L.emit("touchEnd",this,t,s.userNode),this.cs.vs(),Zt(t)}},this.eR=t=>{const e=this.GL[this.$L[t].id]?[this.GL[this.$L[t].id]]:this.NL;this.WL.M(e),this.L.emit("viewChange",e),this.qL=!0,this.cs.vs()},this.ts.treeMapChartNodeColors)this.hR=this.ts.treeMapChartNodeColors;else{const t=this.ts.pointSeriesFillStyle,e=t=>Y(t)?t.getColor():I;this.hR="function"==typeof t?new Array(5).fill(0).map(((i,s)=>e(t(s)))):[e(t)]}this.cs.Gn(ah._f),this.Wm=i.Ax("TreeMapChart plotting",0),this.Ym=i.Ax("TreeMap UI plotting",1),this.onResize(this.Bx),this.bp.Eh("TreeMap Chart");const a=Ft(void 0,Ea);this.Ux=a.lm(i.$m(),this.pixelScale,this.pixelScale,this.ts).setVisible(!1),this.rR=this.hs.yg(),this.mp(n,this.uiScale),this.Hx=this.Wm.$x(this.pixelScale).ke(new H).Ce(this.iR),this.nR=this.cs.us.zr(this,{animationEnabled:!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)}),this.oR=new Xa((()=>this.Ym.Dr(this.pixelScale).setMouseInteractions(!1))),this.aR=new Xa((()=>this.Ym.Dr(this.uiScale))),this.Hx.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))),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled))}setData(t){t=Array.isArray(t)?t.slice():[t];const{lR:e}=(()=>{let t=0;return{lR:e=>{var i;const s=e.map(((t,e)=>({node:t,parent:null}))),r=[];for(;s.length>0;){const e=s.pop();if(!e)continue;const{node:n,parent:o}=e;t+=1;const h={id:t,parentID:null==o?void 0:o.id,name:n.name,value:n.value||0,animatedValue:n.value||0,children:[],nodeIndex:o?o.nodeIndex:-1,userNode:n};o?o.children.push(h):r.push(h),null===(i=n.children)||void 0===i||i.forEach((t=>{s.push({node:t,parent:h})}))}const n=t=>{t.children.forEach(n),t.children.length>0&&(t.value+=t.children.reduce(((t,e)=>t+e.value),0),t.animatedValue+=t.children.reduce(((t,e)=>t+e.animatedValue),0),t.children.sort(((t,e)=>e.animatedValue-t.animatedValue)))};r.forEach(n);const o=1===e.length?r[0].children:r;return o.sort(((t,e)=>e.animatedValue-t.animatedValue)),o.forEach(((t,e)=>{t.nodeIndex=e;const i=e=>{e.children.forEach((e=>{e.nodeIndex=t.nodeIndex,i(e)}))};i(t)})),r}}})(),i=e(t);return i.forEach((t=>{const e=this.GL[t.id];e&&this.uR(t,e)})),this.Kx=void 0,this.WL.M(i),this.NL=i,this.GL=this.cR(i),this.qL=!0,this.cs.vs(),this}setAnimationValues(t,e=1){return this.xm=t?{speed:e}:void 0,this.cs.vs(),this}setInitPathButtonText(t){return this.HL=t,this.qL=!0,this.cs.vs(),this}setDisplayedLevelsCount(t){return this.UL=t,this.qL=!0,this.cs.vs(),this}setDrillDownEnabled(t){return this.YL=t,this.qL=!0,this.cs.vs(),this}setDrillDownNode(t){var e,i;if(this.Kx=void 0,void 0===t)this.WL.M(this.NL);else{const s=[...this.NL];for(;s.length>0;){const r=s.pop();if(r){if(void 0!==r.value&&r.userNode===t||r.parentID&&Array.isArray(t)&&(null===(i=null===(e=this.GL[r.parentID])||void 0===e?void 0:e.userNode)||void 0===i?void 0:i.children)===t){const t=r.children.length?r:r.parentID?this.GL[r.parentID]:this.NL[0];this.WL.M([t]);break}if(r.children)for(let t=r.children.length-1;t>=0;t-=1)s.push(r.children[t])}}}return this.L.emit("viewChange",this.WL._()),this.qL=!0,this.cs.vs(),this}setNodeColoring(t){return t instanceof Array?(this.Hx.ke(new H),this.hR=t):this.Hx.ke(t),this.qL=!0,this.cs.vs(),this}setParentNodeColor(t){return this.tR=t,this.qL=!0,this.cs.vs(),this}setPathLabelFillStyle(t){return this.XL="function"==typeof t?t(this.XL):t,this.qL=!0,this.cs.vs(),this}getPathLabelFillStyle(){return this.XL}setPathLabelFont(t){return nr(t)?this.jL=t:this.jL=t(this.jL),this.qL=!0,this.cs.vs(),this}getPathLabelFont(){return this.jL}setHeaderFont(t){return nr(t)?this.QL=t:this.QL=t(this.QL),this.qL=!0,this.cs.vs(),this}getHeaderFont(){return this.QL}setHeaderFillStyle(t){return this.ZL="function"==typeof t?t(this.ZL):t,this.qL=!0,this.cs.vs(),this}getHeaderFillStyle(){return this.ZL}setLabelFont(t){return nr(t)?this.KL=t:this.KL=t(this.KL),this.qL=!0,this.cs.vs(),this}getLabelFont(){return this.KL}setLabelFillStyle(t){return this.JL="function"==typeof t?t(this.JL):t,this.qL=!0,this.cs.vs(),this}getLabelFillStyle(){return this.JL}setNodeBorderStyle(t){return this.Hx.Ce(t),this.qL=!0,this.cs.vs(),this}getNodeBorderStyle(){return this.Hx.lo()}setNodeEffect(t){return this.rR.Ss(t),this.cs.vs(),this}getNodeEffect(){return this.rR.xs()}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}onNodeMouseDragStart(t){return this.L.on("mouseDragStart",t)}onNodeMouseDrag(t){return this.L.on("mouseDrag",t)}onNodeMouseDragStop(t){return this.L.on("mouseDragStop",t)}onNodeMouseWheel(t){return this.L.on("mouseWheel",t)}onNodeTouchStart(t){return this.L.on("touchStart",t)}onNodeTouchMove(t){return this.L.on("touchMove",t)}onNodeTouchEnd(t){return this.L.on("touchEnd",t)}onViewChange(t){return this.L.on("viewChange",t)}offNodeTouchStart(t){return this.L.off(t,"touchStart")}offNodeTouchMove(t){return this.L.off(t,"touchMove")}offNodeTouchEnd(t){return this.L.off(t,"touchEnd")}offViewChange(t){return this.L.off(t,"viewChange")}setMouseInteractions(t){return this.Hi=t,this.Hx.setMouseInteractions(t),this}getMouseInteractions(){return this.Hi}setAnimationHighlight(t){return this.nR.Nr(t),this}getAnimationHighlight(){return this.nR.Gr()}setHighlightOnHover(t){return this.Ix=t,this}getHighlightOnHover(){return this.Ix}getMinimumSize(){}Qd(){return[this]}Fe(t){super.Fe(t),super.pp(),ta.kp(this.bp,this.Sp);const i=ta.Cp(this.bp,this.Sp);if(this.qL&&this.WL._().length){this.Hx.Gt(),this.OL.clear(),this.nR.Or(),this.ih&&this.dR(t);const s=Kf({data:this.WL._(),dimensions:{x:0+this.ya.left,y:0+this.ya.bottom,width:this.pixelScale.x.getInnerEnd()-this.ya.right-this.ya.left,height:this.pixelScale.y.getInnerEnd()-i-this.ya.top-this.ya.bottom}}),r=this.oR.gy();this.fR(s,r),r.finishPlot(),this.AR(),this.NL!==this.WL._()&&this.NL.length>1&&this.$L.unshift({name:this.HL,id:0});let n=0;const o=this.aR.gy(),h=this.jL;this.$L.forEach(((t,i)=>{const s=o.add(),r=this.cs.Pg.Ig(t.name,h,0);s.Eh(`← ${t.name}`).Nh(h).Ie({x:0,y:100}).za({x:-1,y:1}).Ir({left:this.ya.left+n,top:this.ya.top,right:0,bottom:0}).ke(this.XL).setMouseClickEventHandler((t=>this.eR(i))).setMouseEnterEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Point))).setMouseLeaveEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Default))),n+=r.x+25})),o.finishPlot(),this.WL._().every((t=>t.value===t.animatedValue))?this.qL=!1:this.cs.vs(!0)}const s=this.cs.Nn();if(this.Kx&&s){const t=s;this.Ux.setPosition(t).setVisible(!0).getResultTable().setContent(this.Om(new la,this.Kx).Qu())}else this.Ux.setVisible(!1);return this.Ux.Ds().Fe(),this}dispose(){return this.Ym.U(),this.Wm.U(),this.Ux.dispose(),this.Hx.dispose(),this.OL.clear(),this.oR.my(),this.aR.my(),super.dispose()}Z(){return super.Z(),this}J(){return super.J(),this}Wd(){return ue(this.Hx.zh())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),le(t,this.ts,i,{}),this}fR(t,e,i=!1,s=0){const r=t.map(((t,e)=>({node:t,isChild:i,depth:s})));for(;r.length>0;){const t=r.pop();if(!t)continue;const{node:i,depth:s,opacity:n}=t,{x:o,y:h,height:a,width:l,children:u,animatedValue:c,name:d,nodeIndex:f}=i,g=this.hR,m=0===s&&1===this.WL._().length?this.tR:g[f%g.length],y=[{x:o,y:h},{x:o,y:a+h},{x:l+o,y:a+h},{x:l+o,y:h}],p=this.Hx.Vr().Sl(y).gR(m.setA(n||250)).Jx(c);this.OL.set(p,i),this.nR.Vr(p,(t=>p.ds(t)));const x=o+5,S=h+5,A=Math.max(a-25-5,0),v=Math.max(l-5-5,0);if(u&&u.length&&s15&&A>15){const t=Kf({data:u,dimensions:{x:v>0?x:o,y:A>0?S:h,width:v,height:A}});for(let e=0;e7?50:150))/(u.length-1),h=1===i.id&&1===this.NL.length||this.NL===this.WL._()?250:n?n/(s+1):250-e*o;r.push({node:t[e],isChild:!0,depth:s+1,opacity:h})}}const b=0===s&&1===this.WL._().length?this.ZL:this.JL,M=0===s?this.QL:this.KL,E=this.pR(d,l-25,M),T=this.cs.Pg.Ig(E,M,0),w=e.add();l-25>T.x&&a>25?w.Eh(E).Ie({x:o+5,y:a+h-2.5}).za({x:-1,y:1}).ke(b).Nh(M):w.Eh("")}}cR(t){const e={},i=[...t];for(;i.length>0;){const t=i.pop();t&&(e[t.id]=t,t.children&&i.push(...t.children))}return e}sR(t){if(!this.qL&&t)return this.OL.get(t)}AR(){this.$L=[];const t=this.WL._()[0].id;let e=this.GL[t].parentID;for(;e;)this.$L.push({name:this.GL[e].name,id:e}),e=this.GL[e].parentID;return this.$L.reverse()}pR(t,e,i){let s=this.cs.Pg.Ig(t,i,0).x;if(s<=e)return t;const r=t.split(" ");let n=t;for(;r.length>1&&s>e;)r.pop(),n=`${r.join(" ")}...`,s=this.cs.Pg.Ig(n,i,0).x;if(s>e)for(n=`${r[0]}...`,s=this.cs.Pg.Ig(n,i,0).x;n.length>3&&s>e;)n=`${n.substring(0,n.length-4)}...`,s=this.cs.Pg.Ig(n,i,0).x;return n.length<=3&&s>e?"":n}dR(t){var e;const i=[...this.NL];for(;i.length>0;){const s=i.pop();if(!s)continue;const r=s.value-s.animatedValue;if(Math.abs(r)<.0015*s.value||void 0===this.xm)s.animatedValue=s.value;else{const i=r/250*((null===(e=this.xm)||void 0===e?void 0:e.speed)||1)*t;s.animatedValue+=i,(r>0&&s.animatedValue>s.value||r<0&&s.animatedValue0&&i.push(...s.children)}}uR(t,e){const i=[{current:t,previous:e}];for(;i.length>0;){const t=i.pop();if(!t)continue;const{current:e,previous:s}=t;e.animatedValue=this.ih?s.animatedValue:e.value,s.nodeIndex<0?e.nodeIndex=0:e.nodeIndex=s.nodeIndex;const r=new Map(s.children.map((t=>[t.id,t])));e.children.forEach(((t,e)=>{const n=r.get(t.id);i.push({current:t,previous:n||s})}))}}}const tg=(t,e)=>{const{name:i,value:s}=e;return t.addRow(`${i}`).addRow(`${s}`),t},eg=(t,i)=>{const s=(t=>{const i=new G({color:t.uiStrokeColorContrastHigh}),s=new G({color:t.uiStrokeColorContrastMedium}),r=new G({color:t.uiStrokeColorContrastLow}),n=new rr({family:t.fontFamily,weight:"normal",style:"normal"}),o=n.setSize(18*t.fontScaler),h=n.setSize(16*t.fontScaler),a=n.setSize(14*t.fontScaler),l=n.setSize(10*t.fontScaler),u=n.withMutations((e=>e.set("size",14*t.fontScaler).set("weight","bold"))),c=n.setSize(13*t.fontScaler),d=new Ji({thickness:2,fillStyle:r}),f=new G({color:t.dataHighlightOverlayColor}),g=new Ji({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),m=t.dataColorPalette.map((t=>new G({color:t.stroke}))),y=t=>m[t%m.length],p=m.map((t=>new Ji({thickness:2,fillStyle:t}))),x=t=>p[t%p.length],S=t.dataColorPalette.map((t=>new G({color:t.border}))).map((t=>new Ji({thickness:2,fillStyle:t}))),A=t=>S[t%S.length],v=t.dataColorPalette.map((t=>{const e=t.area;return new st({angle:180,stops:[{color:oe(e,E(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:oe(e,E(0,0,0,e.getA()),.3),offset:1}]})})),b=t=>v[t%v.length],M=t.dataColorPaletteInverted.map((t=>{const e=t.area;return new st({angle:180,stops:[{color:oe(e,E(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:oe(e,E(0,0,0,e.getA()),.3),offset:1}]})})),w=t=>M[t%M.length],k=t.dataColorPaletteInverted.map((t=>new G({color:t.border}))).map((t=>new Ji({thickness:2,fillStyle:t}))),C=t=>k[t%k.length],R=new G({color:t.dataColorPositive}),I=new G({color:t.dataColorNegative}),F=new Ji({thickness:1,fillStyle:new G({color:t.dataStrokeColorContrastHigh.setA(50)})}),D=new Ji({thickness:2,fillStyle:t.axisLineFillStyle}),L=ot,V=new G({color:E(0,0,0,1)}),_=new Ji({thickness:1,fillStyle:t.axisGridMajorFillStyle}),P=new Ji({thickness:1,fillStyle:t.axisTickMajorFillStyle}),B=a,N=t.axisLabelMajorFillStyle,U=new Ji({thickness:1,fillStyle:t.axisGridMajorFillStyle}),O=new Ji({thickness:1,fillStyle:t.axisTickMajorFillStyle}),Y=a,H=t.axisLabelMajorFillStyle,X=new Ji({thickness:1,fillStyle:t.axisGridMinorFillStyle}),W=new Ji({thickness:1,fillStyle:t.axisTickMinorFillStyle}),j=l,$=t.axisLabelMinorFillStyle,Z=ph,K=new mh({gridStrokeStyle:_,tickStyle:P,tickLength:50,tickPadding:-14,labelFont:B,labelPadding:0,labelFillStyle:N}),J=new mh({gridStrokeStyle:U,tickStyle:O,tickLength:7,tickPadding:5,labelFont:Y,labelPadding:0,labelFillStyle:H}),q=new mh({gridStrokeStyle:X,tickStyle:W,tickLength:4,tickPadding:10,labelFont:j,labelPadding:0,labelFillStyle:$}),Q=new Nh({extremeTickStyle:Z,majorTickStyle:J,minorTickStyle:q}),tt=new Fh({greatTickStyle:K,majorTickStyle:J,minorTickStyle:q}),et=new Hh({majorTickStyle:J,minorTickStyle:q}),it=new G({color:t.dataHighlightOverlayColor}),rt=new Ji({thickness:1,fillStyle:s}),nt=new Ji({thickness:2,fillStyle:s}),ht=t=>new gr.Triangulated({shape:"sphere",size:10,fillStyle:m[t%m.length]}),at=m[0],lt=t.uiTextFillStyle,ut=t.legendBackgroundFillStyle,ct=new Ji({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),dt=ae(t.legendButtonDefaultColor),ft=ae(t.isDark?E(70,70,70,255):E(170,170,170,255)),gt=new G({color:t.isDark?E(70,70,70,255):E(170,170,170,255)}),mt=new Ji({thickness:1,fillStyle:i}),yt=new qn({thickness:1,fillStyle:t.cursorGridFillStyle,pattern:Kn.DashedEqual,patternScale:3}),pt=t.zoomBandChartDefocusOverlayFillStyle,xt=new Ji({thickness:2,fillStyle:new G({color:t.zoomBandChartSplitterColor})});let St={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:ot,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new Ji({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:ot,chartXYTitleFont:o,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:d,chartXYZoomingRectangleFillStyle:f,chartXYZoomingRectangleStrokeStyle:g,chartXYFittingRectangleFillStyle:f,chartXYFittingRectangleStrokeStyle:g,lineSeriesStrokeStyle:x,pointLineSeriesStrokeStyle:x,pointLineSeriesFillStyle:y,pointSeriesFillStyle:y,ellipseSeriesFillStyle:y,ellipseSeriesStrokeStyle:x,polygonSeriesFillStyle:y,polygonSeriesStrokeStyle:x,rectangleSeriesFillStyle:y,rectangleSeriesStrokeStyle:ot,segmentSeriesStrokeStyle:x,boxSeriesBodyFillStyle:y(0),boxSeriesBodyStrokeStyle:ot,boxSeriesStrokeStyle:new Ji({thickness:1,fillStyle:m[0]}),boxSeriesMedianStrokeStyle:new Ji({thickness:1,fillStyle:new G({color:E(0,0,0)})}),ohlcCandleThicknessPixels:5,ohlcCandleBodyFillStylePositive:R,ohlcCandleBodyFillStyleNegative:I,ohlcCandleTailStrokeStylePositive:new Ji({thickness:1,fillStyle:new G({color:t.uiStrokeColorContrastHigh})}),ohlcCandleTailStrokeStyleNegative:new Ji({thickness:1,fillStyle:new G({color:t.uiStrokeColorContrastHigh})}),ohlcBarThicknessPixels:10,ohlcBarStrokeStylePositive:new Ji({thickness:2,fillStyle:R}),ohlcBarStrokeStyleNegative:new Ji({thickness:2,fillStyle:I}),heatmapGridSeriesFillStyle:y,heatmapGridSeriesWireframeStyle:F,heatmapScrollingGridSeriesFillStyle:y,heatmapScrollingGridSeriesWireframeStyle:F,areaRangeSeriesFillStyle:b,areaRangeSeriesStrokeStyle:A,areaRangeSeriesFillStyleInverted:w,areaRangeSeriesStrokeStyleInverted:C,areaSeriesBipolarHighFillStyle:b,areaSeriesBipolarHighStrokeStyle:A,areaSeriesBipolarLowFillStyle:w,areaSeriesBipolarLowStrokeStyle:C,areaSeriesPositiveFillStyle:b,areaSeriesPositiveStrokeStyle:A,areaSeriesNegativeFillStyle:w,areaSeriesNegativeStrokeStyle:C,xAxisTitleFont:h,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:D,xAxisNibStyle:L,xAxisOverlayStyle:V,xAxisZoomingBandFillStyle:f,xAxisZoomingBandStrokeStyle:ot,xAxisNumericTicks:Q,xAxisDateTimeTicks:tt,xAxisTimeTicks:et,yAxisTitleFont:h,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:D,yAxisNibStyle:L,yAxisOverlayStyle:V,yAxisZoomingBandFillStyle:f,yAxisZoomingBandStrokeStyle:ot,yAxisNumericTicks:Q,yAxisDateTimeTicks:tt,yAxisTimeTicks:et,bandFillStyle:it,bandStrokeStyle:rt,constantLineStrokeStyle:nt,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:ot,barChartTitleFont:o,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:z,barChartSeriesBackgroundStrokeStyle:ot,barChartBarFillStyle:y,barChartBarStrokeStyle:new Ji({thickness:1,fillStyle:r}),barChartValueAxisTitleFont:h,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:D,barChartValueAxisTicks:Q.setMajorTickStyle((t=>t.setGridStrokeStyle(ot))).setMinorTickStyle((t=>t.setGridStrokeStyle(ot))),barChartCategoryAxisTitleFont:h,barChartCategoryAxisTitleFillStyle:t.axisTitleFillStyle,barChartCategoryAxisStrokeStyle:D,barChartCategoryLabels:{formatter:(t,e)=>t,labelFillStyle:Q.majorTickStyle.labelFillStyle,labelFont:Q.majorTickStyle.labelFont,labelMargin:8,labelRotation:0,tickStyle:Q.majorTickStyle.tickStyle,tickLength:0},barChartValueLabelsAfterBars:{position:"after-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:Q.majorTickStyle.labelFillStyle,labelFont:Q.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},barChartValueLabelsInsideBars:{position:"inside-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:Q.majorTickStyle.labelFillStyle,labelFont:Q.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:ot,chart3DTitleFont:o,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:d,chart3DBoundingBoxStrokeStyle:ot,xAxis3DTitleFont:h,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:D,xAxis3DNumericTicks:Q,xAxis3DDateTimeTicks:tt,xAxis3DTimeTicks:et,yAxis3DTitleFont:h,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:D,yAxis3DNumericTicks:Q,yAxis3DDateTimeTicks:tt,yAxis3DTimeTicks:et,zAxis3DTitleFont:h,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:D,zAxis3DNumericTicks:Q,zAxis3DDateTimeTicks:tt,zAxis3DTimeTicks:et,lineSeries3DStrokeStyle:x,pointLineSeries3DStrokeStyle:x,pointLineSeries3DPointStyle:ht,pointSeries3DPointStyle:ht,pointCloudSeries3DPointStyle:t=>new gr.Pixelated({size:5,fillStyle:m[t%m.length]}),surfaceGridSeries3DFillStyle:y,surfaceGridSeries3DWireframeStyle:F,surfaceScrollingGridSeries3DFillStyle:y,surfaceScrollingGridSeries3DWireframeStyle:F,boxSeries3DFillStyle:y,meshModel3DFillStyle:y(0),polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:ot,polarChartTitleFont:o,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:d,polarSectorFillStyle:it,polarSectorStrokeStyle:rt,polarAmplitudeAxisTitleFont:h,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:D,polarAmplitudeAxisNumericTicks:Q,polarAmplitudeAxisDateTimeTicks:tt,polarAmplitudeAxisTimeTicks:et,polarRadialAxisTitleFont:h,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:D,polarRadialAxisTickStyle:J,polarLineSeriesStrokeStyle:x,polarPointLineSeriesFillStyle:y,polarPointLineSeriesStrokeStyle:x,polarPointSeriesFillStyle:y,polarPolygonSeriesFillStyle:b,polarPolygonSeriesStrokeStyle:A,polarAreaSeriesFillStyle:b,polarAreaSeriesStrokeStyle:A,polarHeatmapSeriesFillStyle:y,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:ot,mapChartTitleFont:o,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:at,mapChartStrokeStyle:new Ji({thickness:1,fillStyle:new G({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:z,mapChartOutlierRegionStrokeStyle:new Ji({thickness:1,fillStyle:r}),mapChartSeparateRegionFillStyle:ut,mapChartSeparateRegionStrokeStyle:ct,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:ot,dataGridTitleFont:o,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:a,dataGridTextFillStyle:at,dataGridCellBackgroundFillStyle:new G({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new Ji({thickness:.4,fillStyle:new G({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:ot,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ct,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ct,dataGridScrollBarButtonArrowFillStyle:dt,dataGridScrollBarButtonArrowStrokeStyle:ct,sparkLineChartStrokeStyle:x(0),sparkPointChartFillStyle:y(0),sparkBarChartFillStyle:y(0),sparkBarChartStrokeStyle:A(0),sparkAreaChartFillStyle:b(0),sparkAreaChartStrokeStyle:A(0),sparkPieChartFillStyle:y,sparkPieChartStrokeStyle:ct,sparkChartBandFillStyle:it,sparkChartBandStrokeStyle:rt,sparkChartConstantLineStrokeStyle:nt,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:ot,spiderChartTitleFont:o,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:d,spiderChartWebStyle:new Ji({thickness:2,fillStyle:r}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:a,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:h,spiderChartAxisStrokeStyle:new Ji({thickness:2,fillStyle:s}),spiderChartAxisNibStrokeStyle:new Ji({thickness:2,fillStyle:i}),spiderSeriesFillStyle:b,spiderSeriesStrokeStyle:A,spiderSeriesPointFillStyle:y,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:ot,pieChartTitleFont:o,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:y,pieChartSliceStrokeStyle:ct,pieChartSliceLabelFont:c,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:mt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:ot,funnelChartTitleFont:o,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:y,funnelChartSliceStrokeStyle:ct,funnelChartSliceLabelFont:c,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:mt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:ot,pyramidChartTitleFont:o,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:y,pyramidChartSliceStrokeStyle:ct,pyramidChartSliceLabelFont:c,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:mt,gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:ot,gaugeChartTitleFont:o,gaugeChartTitleFillStyle:t.titleFillStyle,gaugeChartEmptyGaugeFillStyle:new G({color:t.uiBackgroundColor}),gaugeChartEmptyGaugeStrokeStyle:ct,gaugeChartGaugeFillStyle:at,gaugeChartIntervalLabelsFillStyle:lt,gaugeChartIntervalLabelsFont:c,gaugeChartValueLabelFillStyle:lt,gaugeChartValueLabelFont:c,treeMapChartBackgroundFillStyle:t.panelBackgroundFillStyle,treeMapChartBackgroundStrokeStyle:ot,treeMapChartParentColor:t.treeMapChartParentColor,treeMapChartNodeColors:t.treeMapChartNodeColors,treeMapChartNodeStrokeStyle:new Ji({thickness:1,fillStyle:new G({color:T("000")})}),treeMapChartTitleFillStyle:t.titleFillStyle,treeMapChartTitleFont:o,treeMapChartPathLabelFillStyle:lt,treeMapChartPathLabelFont:c,treeMapChartLabelHeaderFillStyle:t.treeMapChartLabelHeaderFillStyle,treeMapChartLabelHeaderFont:o,treeMapChartLabelFillStyle:t.treeMapChartLabelFillStyle,treeMapChartLabelFont:c,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:ot,zoomBandChartDefocusOverlayFillStyle:pt,zoomBandChartSplitterStrokeStyle:xt,zoomBandChartKnobFillStyle:t.zoomBandChartKnobFillStyle,zoomBandChartKnobSize:t.zoomBandChartKnobSize,onScreenMenuBackgroundColor:E(254,204,0,.7),uiButtonFillStyle:dt,uiButtonFillStyleHidden:ft,uiButtonStrokeStyle:ct,uiButtonSize:10,uiBackgroundFillStyle:ut,uiBackgroundStrokeStyle:ct,uiTextFillStyle:lt,uiTextFillStyleHidden:gt,uiTextFont:c,legendTitleFillStyle:lt,legendTitleFont:u,cursorTickMarkerXBackgroundFillStyle:ut,cursorTickMarkerXBackgroundStrokeStyle:ct,cursorTickMarkerXTextFillStyle:lt,cursorTickMarkerXTextFont:c,cursorTickMarkerYBackgroundFillStyle:ut,cursorTickMarkerYBackgroundStrokeStyle:ct,cursorTickMarkerYTextFillStyle:lt,cursorTickMarkerYTextFont:c,cursorPointMarkerFillStyle:yt.getFillStyle(),cursorPointMarkerSize:{x:9,y:9},cursorPointMarkerShape:e.PointShape.Cross,cursorResultTableFillStyle:ut,cursorResultTableStrokeStyle:ct,cursorResultTableTextFillStyle:lt,cursorResultTableTextFont:c,cursorGridStrokeStyleX:yt,cursorGridStrokeStyleY:yt,chartMarkerPointMarkerFillStyle:yt.getFillStyle(),chartMarkerPointMarkerSize:{x:20,y:20},chartMarkerPointMarkerShape:e.PointShape.Star,seriesMarkerPointMarkerFillStyle:yt.getFillStyle(),seriesMarkerPointMarkerSize:{x:9,y:9},seriesMarkerPointMarkerShape:e.PointShape.Cross};return t.overrideThemeProperties&&(St={...St,...t.overrideThemeProperties}),St})(t),r={...i,header1Font:s.xAxisTitleFont,header2Font:s.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:s.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...s,examples:r}},ig=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/${e}`;return i.addEventListener("error",(e=>{we(t,s,"Theme resource",{shouldCrash:!1})})),i.src=s,i},sg=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:oe(e[s%e.length].stroke,E(255,255,255),.5);return new tt({stops:[{color:oe(r,E(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:oe(r,E(30,30,30),.5*i).setA(100),offset:1}]})},rg=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:oe(e[s%e.length].stroke,E(255,255,255),.2);return new tt({stops:[{color:oe(r,E(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:oe(r,E(0,0,0),.2*i),offset:1}]})},ng=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:oe(e[s%e.length].stroke,E(255,255,255),.2);return new st({angle:90,stops:[{color:oe(r,E(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:oe(r,E(30,30,30),.5*i),offset:1}]})},og=(t,e,i)=>(i=>{const s=new Map;return i=>{const r=s.get(i);if(r)return r;const n=(i=>{const s=!0===t?e[i%e.length].stroke:oe(e[i%e.length].stroke,E(255,255,255),.3);return new st({angle:90,stops:[{color:oe(s,E(255,255,255),.5),offset:0},{color:s,offset:.35},{color:oe(s,E(30,30,30),.5),offset:1}]})})(i);return s.set(i,n),n}})(),hg=(t,i,s)=>{const r=i[0].stroke;return new tt({shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner,position:{x:.5,y:.5},stops:[{color:!0===t?r:oe(r,E(255,255,255),.5*s),offset:0},{color:r,offset:.5},{color:!0===t?r:oe(r,E(0,0,0),.5*s),offset:1}]})},ag=Ee((()=>{const t=E(255,255,255),i=new G({color:t}),s=!0,r=new ro({spread:1,blur:9,offset:{x:0,y:0},color:E(0,0,0,150)}),n=new tt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:E(50,51,52)},{offset:.5,color:E(14,15,16)},{offset:1,color:E(0,0,0)}]}),o=new G({color:E(45,45,45)}),h=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(120,120,120,100)},{offset:1,color:E(0,0,0,50)}]}),a=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(30,30,30,200)},{offset:1,color:E(0,0,0,255)}]}),l=new G({color:E(255,255,220)}),u=new G({color:E(255,255,166)}),c=new G({color:E(255,255,220)}),d=new G({color:E(255,255,220,130)}),f=new G({color:E(255,255,200)}),g=f,m=g,y=new st({angle:45,stops:[{offset:0,color:E(230,230,230)},{offset:1,color:E(150,150,150)}]}),p=new G({color:E(220,220,220)}),x=new G({color:E(200,200,200,50)}),S=new G({color:E(200,200,200,150)}),A=new G({color:E(200,200,200,20)}),v=new G({color:E(150,150,150)}),b=new st({angle:0,stops:[{offset:0,color:E(10,10,10,220)},{offset:1,color:E(30,30,30,220)}]}),M=i,w=E(255,255,200),k=b,C=M,R=E(20,20,20),I=E(0,0,0),F=t,D=E(150,150,150),L=E(50,50,50),V=E(50,50,50),_=E(100,100,100),P=E(200,200,200),B=[E(255,255,91,255),E(255,205,91,255),E(255,155,91,255),E(255,196,188,255),E(255,148,184,255),E(219,148,198,255),E(235,196,224,255),E(169,148,198,255),E(148,226,198,255),E(148,255,176,255),E(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),z=t.setA(20),N=E(176,255,157,255),U=E(255,112,76,255),O={mapChartFillStyle:new st({angle:135,stops:[{color:E(255,255,91,255),offset:0},{color:E(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:sg(s,B,.5),pieChartSliceFillStylePalette:rg(s,B,1),funnelChartSliceFillStylePalette:ng(s,B,1),pyramidChartSliceFillStylePalette:ng(s,B,1),rectangleSeriesFillStyle:og(s,B),gaugeChartGaugeFillStyle:hg(s,B,1)},Y=new G({color:E(176,255,157,255)}),H=new G({color:E(255,146,146,255)}),X=new G({color:E(176,255,157,255)}),W=new G({color:E(230,63,63,255)}),j=new G({color:E(176,255,157,120)}),$=new G({color:E(229,63,63,180)}),Z=new G({color:E(27,37,36,255)}),K=new G({color:E(62,27,27,255)}),J=[E(255,0,0),E(255,255,0),E(0,255,0)],q=[E(10,10,255),E(10,190,255),E(251,255,0),E(255,38,0)],Q=[E(255,255,0),E(255,204,0),E(255,128,0),E(255,0,0)],et=[E(0,0,0),E(167,4,69,255),E(255,0,0),E(252,252,168,255)],it=new tt({stops:[{color:E(61,61,80,100),offset:0},{color:E(44,44,55,30),offset:1}]}),rt=new G({color:E(148,148,198,255)}),nt=j.getColor().setA(255),ot=E(100,100,100),ht=[E(255,241,149,200),E(255,230,65,200),E(238,211,32,200),E(238,176,32,200),E(255,159,13,200),E(254,120,37,200),E(253,91,56,200),E(253,75,84,200),E(254,95,124,200),E(227,56,160,200),E(226,53,134,200),E(216,90,166,200),E(254,151,206,200),E(237,151,254,200),E(243,177,255,200),E(233,133,252,200),E(210,101,230,200),E(178,61,200,200),E(193,81,156,200),E(217,95,145,200)];return eg({isDark:s,highlightColorOffset:E(60,60,60,60),highlightColorOffsetAxisOverlay:E(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:n,dashboardSplitterFillStyle:o,panelBackgroundFillStyle:h,seriesBackgroundFillStyle:a,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:l,axisTitleFillStyle:u,axisLabelMajorFillStyle:c,axisLabelMinorFillStyle:d,uiTitleFillStyle:f,uiTextFillStyle:g,cursorTextFillStyle:m,axisLineFillStyle:y,axisTickMajorFillStyle:p,axisGridMajorFillStyle:x,axisTickMinorFillStyle:S,axisGridMinorFillStyle:A,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:w,resultTableBackgroundFillStyle:k,resultTableBackgroundBorderFillStyle:C,uiBackgroundColor:R,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:F,uiStrokeColorContrastMedium:D,uiStrokeColorContrastLow:L,dataStrokeColorContrastHigh:V,dataStrokeColorContrastMedium:_,dataStrokeColorContrastLow:P,dataColorPalette:B,dataColorPaletteInverted:[{area:E(190,50,50,100),border:E(210,80,80)}],dataHighlightOverlayColor:z,dataColorPositive:N,dataColorNegative:U,zoomBandChartDefocusOverlayFillStyle:new G({color:E(0,0,0,180)}),zoomBandChartSplitterColor:T("#FBFB5A"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/darkgold-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:T("#181E21"),treeMapChartNodeColors:ht,treeMapChartLabelFillStyle:new G({color:E(33,33,33)}),treeMapChartLabelHeaderFillStyle:new G({color:E(250,250,250)})},{positiveTextFillStyle:Y,negativeTextFillStyle:H,positiveFillStyle:X,negativeFillStyle:W,positiveAreaFillStyle:j,negativeAreaFillStyle:$,positiveBackgroundFillStyle:Z,negativeBackgroundFillStyle:K,badGoodColorPalette:J,coldHotColorPalette:q,intensityColorPalette:Q,spectrogramColorPalette:et,bollingerFillStyle:it,bollingerBorderFillStyle:rt,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:ot})})),lg=Ee((()=>{const t=E(255,255,255),i=new G({color:t}),s=!0,r=new ro({spread:0,blur:9,offset:{x:0,y:0},color:E(105,255,236,40)}),n=new G({color:E(2,21,30)}),o=new tt({stops:[{color:E(19,40,66,150),offset:0},{color:E(0,0,0,150),offset:1}]}),h=new G({color:E(0,5,8,150)}),a=i,l=i,u=i,c=new G({color:E(255,255,220,130)}),d=i,f=i,g=f,m=new G({color:E(20,224,250,255)}),y=i,p=new G({color:E(61,94,110,100)}),x=new G({color:E(61,94,110,255)}),S=new G({color:E(61,94,110,40)}),A=i,v=new G({color:E(0,18,23,255)}),b=i,M=t,w=new G({color:E(0,17,22,240)}),k=i,C=E(0,38,48,220),R=E(0,0,0),I=t,F=E(150,150,150),D=E(19,78,93),L=E(50,50,50),V=E(0,36,48),_=E(200,200,200),P=[E(45,253,253,255),E(44,172,247,255),E(46,100,248,255),E(96,84,199,255),E(184,104,245,255),E(98,160,218,255),E(43,238,245,255),E(38,140,206,255),E(112,96,224,255),E(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),B=t.setA(50),z=E(3,217,194,255),N=E(230,63,63,255),U={mapChartFillStyle:new st({angle:135,stops:[{color:E(118,248,231,255),offset:0},{color:E(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:sg(s,P,1),pieChartSliceFillStylePalette:rg(s,P,1),funnelChartSliceFillStylePalette:ng(s,P,1),pyramidChartSliceFillStylePalette:ng(s,P,1),rectangleSeriesFillStyle:og(s,P),gaugeChartGaugeFillStyle:hg(s,P,1)},O=new G({color:E(45,253,253,255)}),Y=new G({color:E(255,146,146,255)}),H=new G({color:E(45,253,253,255)}),X=new G({color:E(230,63,63,255)}),W=new G({color:E(1,190,164,120)}),j=new G({color:E(229,63,63,180)}),$=new G({color:E(1,53,57,255)}),Z=new G({color:E(62,27,27,255)}),K=[E(1,104,119,255),E(0,165,144,255),E(0,246,214,255)],J=[E(0,87,95,255),E(0,125,124,255),E(1,209,182,255),E(0,255,221,255),E(218,112,112,255),E(172,47,47,255)],q=[E(126,255,253,255),E(50,233,230,255),E(0,196,193,255),E(62,138,178,255),E(139,88,191,255),E(162,55,143,255)],Q=[E(13,31,52,255),E(101,50,118,255),E(1,142,172,255),E(2,196,170,255),E(0,255,221,255)],et=new tt({stops:[{color:E(122,103,254,70),offset:0},{color:E(178,168,255,10),offset:1}]}),it=new G({color:E(122,103,254,255)}),rt=W.getColor().setA(255),nt=E(15,83,83),ot=[E(139,252,252,150),E(60,239,239,150),E(2,201,201,150),E(26,159,159,150),E(15,146,187,150),E(65,168,200,150),E(67,146,207,150),E(64,108,209,150),E(189,64,233,150),E(219,84,238,150),E(192,55,212,150),E(212,98,229,150),E(248,110,211,150),E(251,154,225,150),E(251,154,184,150),E(233,105,144,150),E(255,133,170,150),E(249,110,135,150),E(245,72,101,150),E(210,57,84,150)];return eg({isDark:s,highlightColorOffset:E(60,60,60,60),highlightColorOffsetAxisOverlay:E(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new $n({source:ig(t,"themes/turquoiseHexagon.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:n,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:y,axisGridMajorFillStyle:p,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:A,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:C,uiBackgroundBorderColor:R,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:V,dataStrokeColorContrastLow:_,dataColorPalette:P,dataColorPaletteInverted:[{area:E(170,60,210,100),border:E(210,100,250)}],dataHighlightOverlayColor:B,dataColorPositive:z,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new G({color:E(0,0,0,180)}),zoomBandChartSplitterColor:T("#2BF4F4"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/turquoise-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:U,treeMapChartParentColor:T("#002329"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new G({color:E(33,33,33)}),treeMapChartLabelHeaderFillStyle:new G({color:E(250,250,250)})},{positiveTextFillStyle:O,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:q,spectrogramColorPalette:Q,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),ug=Ee((()=>{const t=!1,i=new ro({spread:0,blur:6,offset:{x:2,y:-2},color:E(0,0,0,30)}),s=new tt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:E(255,255,255)},{offset:1,color:E(255,255,255)}]}),r=new G({color:E(219,227,233,255)}),n=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(255,255,255,200)},{offset:1,color:E(240,244,246,200)}]}),o=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(255,255,255,255)},{offset:1,color:E(255,255,255,255)}]}),h=new G({color:E(33,43,49)}),a=new G({color:E(33,43,49)}),l=new G({color:E(33,43,49)}),u=new G({color:E(33,43,49,150)}),c=new G({color:E(33,43,49)}),d=c,f=d,g=new st({angle:45,stops:[{offset:0,color:E(225,225,225)},{offset:1,color:E(225,225,225)}]}),m=new G({color:E(150,150,150,255)}),y=new G({color:E(150,150,150,170)}),p=new G({color:E(150,150,150,150)}),x=new G({color:E(150,150,150,100)}),S=new G({color:E(128,146,159)}),A=new st({angle:0,stops:[{offset:0,color:E(255,255,255,240)},{offset:1,color:E(255,255,255,240)}]}),v=new G({color:E(168,186,199)}),b=E(255,255,200),M=new G({color:E(255,255,255,240)}),w=new G({color:E(128,146,159,255)}),k=E(255,255,255,255),C=E(168,168,199,255),R=E(168,186,199,255),I=E(168,186,199,255),F=E(168,186,199,255),D=E(168,186,199,255),L=E(100,100,100),V=E(200,200,200),_=[E(28,181,140,255),E(255,132,0,255),E(240,39,39,255),E(86,121,251,255),E(2,181,213,255),E(13,212,158,255),E(22,167,3,255),E(234,103,232,255),E(62,183,179,255),E(140,93,3,255),E(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),P=E(150,150,150,80),B=E(46,182,120,255),z=E(255,66,66,255),N=new Ji({thickness:2,fillStyle:new G({color:E(168,186,199,255)})}),U={mapChartFillStyle:new st({angle:-45,stops:[{color:E(2,181,213,255),offset:0},{color:E(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:sg(t,_,.8),pieChartSliceFillStylePalette:rg(t,_,.8),funnelChartSliceFillStylePalette:ng(t,_,.5),pyramidChartSliceFillStylePalette:ng(t,_,.5),rectangleSeriesFillStyle:og(t,_),gaugeChartGaugeFillStyle:hg(t,_,.8),chartXYSeriesBackgroundStrokeStyle:N,chart3DSeriesBackgroundStrokeStyle:N,polarChartSeriesBackgroundStrokeStyle:N,spiderChartSeriesBackgroundStrokeStyle:N,dataGridTextFillStyle:new G({color:E(0,88,64,255)})},O=new G({color:E(4,146,108,255)}),Y=new G({color:E(240,39,39,255)}),H=new G({color:E(28,181,140,255)}),X=new G({color:E(230,88,88,255)}),W=new G({color:E(28,181,140,180)}),j=new G({color:E(230,88,88,180)}),$=new G({color:E(229,243,228)}),Z=new G({color:E(232,225,216)}),K=[E(193,48,48,255),E(240,234,60,255),E(45,191,55,255)],J=[E(10,19,255,255),E(15,191,250,255),E(249,255,2,255),E(253,133,0,255),E(255,24,0,255)],q=[E(50,99,213),E(8,179,77),E(255,246,0),E(255,126,0),E(189,36,30)],Q=[E(16,64,176),E(8,179,77),E(255,246,0),E(255,126,0),E(168,6,0)],et=new G({color:E(185,198,207,255)}),it=new tt({stops:[{color:E(151,190,220,10),offset:0},{color:E(151,190,220,50),offset:1}]}),rt=W.getColor().setA(255),nt=E(150,150,150),ot=[E(255,243,136,125),E(254,237,99,125),E(255,216,109,125),E(255,172,100,125),E(255,133,101,125),E(255,113,142,125),E(230,103,129,125),E(242,126,219,125),E(255,155,235,125),E(255,181,240,125),E(203,143,255,125),E(208,154,255,125),E(171,188,255,125),E(197,209,255,125),E(171,187,255,125),E(84,167,239,125),E(38,196,214,125),E(38,214,196,125),E(69,225,141,125),E(36,191,88,125)];return eg({isDark:t,highlightColorOffset:E(-60,-60,-60,60),highlightColorOffsetAxisOverlay:E(0,0,0,40),effect:i,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:s,dashboardSplitterFillStyle:r,panelBackgroundFillStyle:n,seriesBackgroundFillStyle:o,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:h,axisTitleFillStyle:a,axisLabelMajorFillStyle:l,axisLabelMinorFillStyle:u,uiTitleFillStyle:c,uiTextFillStyle:d,cursorTextFillStyle:f,axisLineFillStyle:g,axisTickMajorFillStyle:m,axisGridMajorFillStyle:y,axisTickMinorFillStyle:p,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:A,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:w,uiBackgroundColor:k,uiBackgroundBorderColor:C,uiStrokeColorContrastHigh:R,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:D,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:V,dataColorPalette:_,dataColorPaletteInverted:[{area:E(190,50,50,100),border:E(210,80,80)}],dataHighlightOverlayColor:P,dataColorPositive:B,dataColorNegative:z,zoomBandChartDefocusOverlayFillStyle:new G({color:E(255,255,255,180)}),zoomBandChartSplitterColor:T("#505D65"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/light-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:U,treeMapChartParentColor:T("#D9D9D9"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new G({color:E(0,0,0)}),treeMapChartLabelHeaderFillStyle:new G({color:E(33,33,33)})},{positiveTextFillStyle:O,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:q,spectrogramColorPalette:Q,bollingerFillStyle:it,bollingerBorderFillStyle:et,highlightPointColor:E(0,0,0),highlightDataGridColor:rt,unfocusedDataColor:nt})})),cg=Ee((()=>{const t=!1,i=new tt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:E(255,255,255)},{offset:1,color:E(255,255,255)}]}),s=new G({color:E(214,236,216,255)}),r=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(233,244,231,70)},{offset:1,color:E(233,244,231,200)}]}),n=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(255,255,255,255)},{offset:1,color:E(255,255,255,255)}]}),o=new G({color:E(1,61,53)}),h=new G({color:E(1,61,53)}),a=new G({color:E(1,61,53)}),l=new G({color:E(1,61,53,150)}),u=new G({color:E(1,61,53)}),c=u,d=c,f=new st({angle:45,stops:[{offset:0,color:E(225,225,225)},{offset:1,color:E(225,225,225)}]}),g=new G({color:E(188,211,186,255)}),m=new G({color:E(188,211,186,150)}),y=new G({color:E(188,211,186,50)}),p=new G({color:E(188,211,186,50)}),x=new G({color:E(104,148,111,255)}),S=new st({angle:0,stops:[{offset:0,color:E(255,255,255,240)},{offset:1,color:E(255,255,255,240)}]}),A=new G({color:E(104,148,111)}),v=E(255,255,200),b=new G({color:E(255,255,255,240)}),M=new G({color:E(104,148,111,255)}),w=E(255,255,255,255),k=E(179,201,183,255),C=E(188,211,186,255),R=E(188,211,186,255),I=E(188,211,186,255),F=E(188,211,186,255),D=E(100,100,100),L=E(200,200,200),V=[E(138,195,142,255),E(193,161,114,255),E(178,99,99,255),E(142,156,210,255),E(154,209,219,255),E(164,212,199,255),E(104,156,97,255),E(196,147,195,255),E(92,190,187,255),E(126,100,51,255),E(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),_=E(150,150,150,80),P=E(46,182,84,255),B=E(232,96,96,255),z=new Ji({thickness:2,fillStyle:new G({color:E(188,211,186,255)})}),N={mapChartFillStyle:new st({angle:-45,stops:[{color:E(118,160,121,255),offset:0},{color:E(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:sg(t,V,.8),pieChartSliceFillStylePalette:rg(t,V,.8),pyramidChartSliceFillStylePalette:ng(t,V,.5),funnelChartSliceFillStylePalette:ng(t,V,.5),rectangleSeriesFillStyle:og(t,V),gaugeChartGaugeFillStyle:hg(t,V,.8),chartXYSeriesBackgroundStrokeStyle:z,chart3DSeriesBackgroundStrokeStyle:z,polarChartSeriesBackgroundStrokeStyle:z,spiderChartSeriesBackgroundStrokeStyle:z,dataGridTextFillStyle:new G({color:E(77,66,21,255)})},U=new G({color:E(93,151,97,255)}),O=new G({color:E(178,99,99,255)}),Y=new G({color:E(138,195,142,255)}),H=new G({color:E(178,99,99,255)}),X=new G({color:E(138,195,142,180)}),W=new G({color:E(178,99,99,180)}),j=new G({color:E(224,240,237)}),$=new G({color:E(251,227,227)}),Z=[E(178,99,99,255),E(215,224,111,255),E(80,186,88,255)],K=[E(62,64,142,255),E(66,131,77,255),E(250,250,135,255),E(202,161,78,255),E(179,53,53,255)],J=[E(64,86,138),E(123,192,205),E(255,252,149),E(220,155,92),E(184,78,74)],q=[E(64,86,138),E(123,192,205),E(255,252,149),E(220,155,92),E(132,60,57)],Q=new G({color:E(185,198,207,255)}),et=new tt({stops:[{color:E(151,190,220,10),offset:0},{color:E(151,190,220,50),offset:1}]}),it=X.getColor().setA(255),rt=E(150,150,150),nt=[E(242,239,210,150),E(243,238,183,150),E(210,222,136,150),E(204,217,148,150),E(157,190,124,150),E(143,178,72,150),E(198,147,88,150),E(216,148,71,150),E(229,142,103,150),E(225,174,152,150),E(219,149,203,150),E(216,188,209,150),E(109,198,189,150),E(172,206,202,150),E(164,223,217,150),E(174,215,233,150),E(203,225,235,150),E(220,227,243,150),E(207,213,227,150),E(171,182,209,150)];return eg({isDark:t,highlightColorOffset:E(-60,-60,-60,60),highlightColorOffsetAxisOverlay:E(0,0,0,40),effect:void 0,effectsText:!1,effectsDashboardSplitters:!1,lcjsBackgroundFillStyle:i,dashboardSplitterFillStyle:s,panelBackgroundFillStyle:r,seriesBackgroundFillStyle:n,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:o,axisTitleFillStyle:h,axisLabelMajorFillStyle:a,axisLabelMinorFillStyle:l,uiTitleFillStyle:u,uiTextFillStyle:c,cursorTextFillStyle:d,axisLineFillStyle:f,axisTickMajorFillStyle:g,axisGridMajorFillStyle:m,axisTickMinorFillStyle:y,axisGridMinorFillStyle:p,cursorGridFillStyle:x,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:A,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:b,resultTableBackgroundBorderFillStyle:M,uiBackgroundColor:w,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:C,uiStrokeColorContrastMedium:R,uiStrokeColorContrastLow:I,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:D,dataStrokeColorContrastLow:L,dataColorPalette:V,dataColorPaletteInverted:[{area:E(210,70,70,100),border:E(200,110,110)}],dataHighlightOverlayColor:_,dataColorPositive:P,dataColorNegative:B,zoomBandChartDefocusOverlayFillStyle:new G({color:E(255,255,255,180)}),zoomBandChartSplitterColor:T("#446A40"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/lightnature-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N,treeMapChartParentColor:T("#EFF7EE"),treeMapChartNodeColors:nt,treeMapChartLabelFillStyle:new G({color:E(0,0,0)}),treeMapChartLabelHeaderFillStyle:new G({color:E(33,33,33)})},{positiveTextFillStyle:U,negativeTextFillStyle:O,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:W,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:$,badGoodColorPalette:Z,coldHotColorPalette:K,intensityColorPalette:J,spectrogramColorPalette:q,bollingerFillStyle:et,bollingerBorderFillStyle:Q,highlightPointColor:E(0,0,0),highlightDataGridColor:it,unfocusedDataColor:rt})})),dg=Ee((()=>{const t=E(255,255,255),i=new G({color:t}),s=!0,r=new ro({spread:1,blur:9,offset:{x:0,y:0},color:E(255,255,255,30)}),n=new G({color:E(6,15,36)}),o=new tt({stops:[{color:E(46,13,87,50),offset:0},{color:E(0,0,0,150),offset:1}]}),h=new G({color:E(0,5,8,150)}),a=i,l=i,u=i,c=new G({color:E(255,255,220,130)}),d=i,f=i,g=f,m=new st({angle:45,stops:[{offset:0,color:E(241,133,255,255)},{offset:1,color:E(115,207,238,255)}]}),y=i,p=new G({color:E(61,94,110,100)}),x=new G({color:E(61,94,110,255)}),S=new G({color:E(61,94,110,40)}),A=i,v=new G({color:E(0,18,23,255)}),b=i,M=E(115,207,238,255),w=new G({color:E(0,17,22,240)}),k=i,C=E(0,38,48,255),R=E(0,0,0),I=t,F=E(150,150,150),D=E(19,57,93),L=E(50,50,50),V=E(0,17,48),_=E(200,200,200),P=[E(20,211,237,255),E(98,147,252,255),E(164,73,250,255),E(129,117,253,255),E(95,134,252,255),E(22,133,212,255),E(35,200,242,255),E(104,121,233,255),E(137,69,232,255),E(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),B=t.setA(50),z=E(3,217,194,255),N=E(243,21,110,255),U={mapChartFillStyle:new st({angle:135,stops:[{color:E(118,248,231,255),offset:0},{color:E(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:sg(s,P,.5),pieChartSliceFillStylePalette:rg(s,P,2),funnelChartSliceFillStylePalette:ng(s,P,1),pyramidChartSliceFillStylePalette:ng(s,P,1),rectangleSeriesFillStyle:og(s,P),gaugeChartGaugeFillStyle:hg(s,P,1)},O=new G({color:E(20,211,237,255)}),Y=new G({color:E(253,145,178,255)}),H=new G({color:E(20,211,237,255)}),X=new G({color:E(239,68,121,255)}),W=new G({color:E(20,211,237,120)}),j=new G({color:E(239,68,121,180)}),$=new G({color:E(1,53,57,255)}),Z=new G({color:E(94,19,42,255)}),K=[E(174,51,132,255),E(204,107,218,255),E(189,215,253,255)],J=[E(0,63,95,255),E(0,149,255,255),E(0,225,255,255),E(255,154,254,255),E(204,98,170,255),E(139,39,84,255)],q=[E(197,241,255,255),E(70,210,255,255),E(0,164,217,255),E(90,99,222,255),E(138,75,192,255),E(151,27,162,255)],Q=[E(13,31,52,255),E(129,54,130,255),E(131,108,176,255),E(7,162,213,255),E(26,247,255,255)],et=new tt({stops:[{color:E(219,42,235,60),offset:0},{color:E(237,73,252,10),offset:1}]}),it=new G({color:E(237,73,252,255)}),rt=W.getColor().setA(255),nt=E(8,70,100),ot=[E(149,230,255,150),E(93,213,243,150),E(20,189,223,150),E(5,151,181,150),E(2,138,198,150),E(2,113,198,150),E(97,148,236,150),E(93,111,230,150),E(151,120,223,150),E(128,87,227,150),E(153,52,230,150),E(179,92,245,150),E(248,110,211,150),E(255,155,228,150),E(251,88,207,150),E(255,0,162,150),E(214,73,177,150),E(209,71,159,150),E(238,101,169,150),E(210,57,134,150)];return eg({isDark:s,highlightColorOffset:E(60,60,60,60),highlightColorOffsetAxisOverlay:E(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new $n({source:ig(t,"themes/cyberSpace.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:n,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:y,axisGridMajorFillStyle:p,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:A,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:C,uiBackgroundBorderColor:R,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:V,dataStrokeColorContrastLow:_,dataColorPalette:P,dataColorPaletteInverted:[{area:E(41,130,255,100),border:E(45,110,240)}],dataHighlightOverlayColor:B,dataColorPositive:z,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new G({color:E(0,0,0,180)}),zoomBandChartSplitterColor:T("#DB77FF"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/cyberspace-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:U,treeMapChartParentColor:T("#1E1E3B"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new G({color:E(33,33,33)}),treeMapChartLabelHeaderFillStyle:new G({color:E(250,250,250)})},{positiveTextFillStyle:O,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:q,spectrogramColorPalette:Q,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),fg={};Object.defineProperty(fg,"darkGold",{get:ag,enumerable:!0}),Object.defineProperty(fg,"turquoiseHexagon",{get:lg,enumerable:!0}),Object.defineProperty(fg,"light",{get:ug,enumerable:!0}),Object.defineProperty(fg,"lightNature",{get:cg,enumerable:!0}),Object.defineProperty(fg,"cyberSpace",{get:dg,enumerable:!0});const gg=fg,mg=gg.darkGold,yg=(t,i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAgCAYAAADwkoGKAAAsa2NhQlgAACxranVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAALEVqdW1iAAAAR2p1bWRjMm1hABEAEIAAAKoAOJtxA3Vybjp1dWlkOjlmZDBkZjkzLTVmMDMtNDczYi1hZThhLTFhNDM4NmMzNmJhYQAAAAGzanVtYgAAAClqdW1kYzJhcwARABCAAACqADibcQNjMnBhLmFzc2VydGlvbnMAAAAA12p1bWIAAAAmanVtZGNib3IAEQAQgAAAqgA4m3EDYzJwYS5hY3Rpb25zAAAAAKljYm9yoWdhY3Rpb25zgaNmYWN0aW9ua2MycGEuZWRpdGVkbXNvZnR3YXJlQWdlbnRtQWRvYmUgRmlyZWZseXFkaWdpdGFsU291cmNlVHlwZXhTaHR0cDovL2N2LmlwdGMub3JnL25ld3Njb2Rlcy9kaWdpdGFsc291cmNldHlwZS9jb21wb3NpdGVXaXRoVHJhaW5lZEFsZ29yaXRobWljTWVkaWEAAACranVtYgAAAChqdW1kY2JvcgARABCAAACqADibcQNjMnBhLmhhc2guZGF0YQAAAAB7Y2JvcqVqZXhjbHVzaW9uc4GiZXN0YXJ0GCFmbGVuZ3RoGSx3ZG5hbWVuanVtYmYgbWFuaWZlc3RjYWxnZnNoYTI1NmRoYXNoWCBvErgv+J0u7bVCYViyMUgw5yMb8idAv1erA3/DALx9NWNwYWRIAAAAAAAAAAAAAAIDanVtYgAAACRqdW1kYzJjbAARABCAAACqADibcQNjMnBhLmNsYWltAAAAAddjYm9yqGhkYzp0aXRsZW9HZW5lcmF0ZWQgaW1hZ2VpZGM6Zm9ybWF0aWltYWdlL3BuZ2ppbnN0YW5jZUlEeCh4bXAuaWlkOjI3NEMxQjdDN0E0MDExRUVBQkZFQUNFQjJDOTA0NzVCb2NsYWltX2dlbmVyYXRvcng2QWRvYmVfUGhvdG9zaG9wLzI1LjIuMCBhZG9iZV9jMnBhLzAuNy42IGMycGEtcnMvMC4yNS4ydGNsYWltX2dlbmVyYXRvcl9pbmZvgb9kbmFtZW9BZG9iZSBQaG90b3Nob3BndmVyc2lvbmYyNS4yLjD/aXNpZ25hdHVyZXgZc2VsZiNqdW1iZj1jMnBhLnNpZ25hdHVyZWphc3NlcnRpb25zgqJjdXJseCdzZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmFjdGlvbnNkaGFzaFggSmnBvf+o3kEweL4k7cz4MTrB0WSVNFZxoA1rBrM31K+iY3VybHgpc2VsZiNqdW1iZj1jMnBhLmFzc2VydGlvbnMvYzJwYS5oYXNoLmRhdGFkaGFzaFggL2g6Dghd536quyA5vPlS/9NGA5WvLRkkKJmqn0VxCoFjYWxnZnNoYTI1NgAAKEBqdW1iAAAAKGp1bWRjMmNzABEAEIAAAKoAOJtxA2MycGEuc2lnbmF0dXJlAAAAKBBjYm9y0oREoQE4JKNmc2lnVHN0oWl0c3RUb2tlbnOBoWN2YWxZDjYwgg4yMAMCAQAwgg4pBgkqhkiG9w0BBwKggg4aMIIOFgIBAzEPMA0GCWCGSAFlAwQCAQUAMIGCBgsqhkiG9w0BCRABBKBzBHEwbwIBAQYJYIZIAYb9bAcBMDEwDQYJYIZIAWUDBAIBBQAEIHj4VpJDPzaO0x4hOPnj/w1GTHuwXU0IpBf4VVocIQzoAhB3SsxvHza2JR1fKj3Mjr0yGA8yMDIzMTEwMzExNTcyNloCCQCyOL6wAOGCbaCCC70wggUHMIIC76ADAgECAhAFHp6R1x6RCrvkPVzt0N3ZMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwgSW5jLjE7MDkGA1UEAxMyRGlnaUNlcnQgVHJ1c3RlZCBHNCBSU0E0MDk2IFNIQTI1NiBUaW1lU3RhbXBpbmcgQ0EwHhcNMjMwOTA4MDAwMDAwWhcNMzQxMjA3MjM1OTU5WjBYMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xMDAuBgNVBAMTJ0RpZ2lDZXJ0IEFkb2JlIEFBVEwgVGltZXN0YW1wIFJlc3BvbmRlcjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABE0srlH5A/+15/MFl1asNh8Q8TubOsEVfu0qlJrF0smjtwL1IeHZ/AB7J59u1Trpho1BDN85lfTY30rNBsfT+myjggGLMIIBhzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADAWBgNVHSUBAf8EDDAKBggrBgEFBQcDCDAgBgNVHSAEGTAXMAgGBmeBDAEEAjALBglghkgBhv1sBwEwHwYDVR0jBBgwFoAUuhbZbU2FL3MpdpovdYxqII+eyG8wHQYDVR0OBBYEFLA1qlbDIamLztO4vIsWJVed7zThMFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNFJTQTQwOTZTSEEyNTZUaW1lU3RhbXBpbmdDQS5jcmwwgZAGCCsGAQUFBwEBBIGDMIGAMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wWAYIKwYBBQUHMAKGTGh0dHA6Ly9jYWNlcnRzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNFJTQTQwOTZTSEEyNTZUaW1lU3RhbXBpbmdDQS5jcnQwDQYJKoZIhvcNAQELBQADggIBAHgrjELHhBCEWJSCyRX7lsL0C9LJgbX1ryVYySNRxHkMR2LqC7PQZRJgDNR+kJop8P5v2Bzp/jMrzw4U4pY6rYv3I8HpFlJa4uBwUTIUgHWpi8Xxd1JEEX94POODi7HySekX60A055BozFb7GGVaxb0LreQTRXnkr6ggPNUPX9Gh+2ScOxlTdQQLgZbkdYvxo3Ap6cy9riZijRxOZqiOyWSxMUhgKxeKzwrFW6Xbe0awNhOUXZzIxc4ixpKzWSItpPJ30ZiBQn49U3ADYTnshbN9ZkTA1pHf/Nov2ZUvvddkZ8UYvwo9vBvLTDvnmABnRMBKaXYAs3ZCvw9CkDPOWTeUJMFRAtmUx52ohaA3nD8bCJ6UfpQ2pFfOdShwpb6GKv0g+BgcdIG2LHPJ0Ufmr+XmpgZgq/HIge0hjcCADpjDgq2z4B0L4xtAA1M8MrUx02hxb7104nFKqMuv5zJTQl3sgwqXUyP+9zHQP9y/Z5Fx/AQWrOXCW56dV7P4cFBJl8zHqinlhkOStZ1m22+9Hlq+eC0hJ2lkF1LuzRdJJb/51LXoPKRnopFDng6XpoD7eG6w4YpAx9+P00JuUoBsYSrdsuFiyWyQQGBAnjI69ggbSLcW+hJytuinaxawVlItJkS2eV5Z4XsxPg7f82uRkdtN0hTHeI93CN3OWeRebnK7MIIGrjCCBJagAwIBAgIQBzY3tyRUfNhHrP0oZipeWzANBgkqhkiG9w0BAQsFADBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwHhcNMjIwMzIzMDAwMDAwWhcNMzcwMzIyMjM1OTU5WjBjMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xOzA5BgNVBAMTMkRpZ2lDZXJ0IFRydXN0ZWQgRzQgUlNBNDA5NiBTSEEyNTYgVGltZVN0YW1waW5nIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxoY1BkmzwT1ySVFVxyUDxPKRN6mXUaHW0oPRnkyibaCwzIP5WvYRoUQVQl+kiPNo+n3znIkLf50fng8zH1ATCyZzlm34V6gCff1DtITaEfFzsbPuK4CEiiIY3+vaPcQXf6sZKz5C3GeO6lE98NZW1OcoLevTsbV15x8GZY2UKdPZ7Gnf2ZCHRgB720RBidx8ald68Dd5n12sy+iEZLRS8nZH92GDGd1ftFQLIWhuNyG7QKxfst5Kfc71ORJn7w6lY2zkpsUdzTYNXNXmG6jBZHRAp8ByxbpOH7G1WE15/tePc5OsLDnipUjW8LAxE6lXKZYnLvWHpo9OdhVVJnCYJn+gGkcgQ+NDY4B7dW4nJZCYOjgRs/b2nuY7W+yB3iIU2YIqx5K/oN7jPqJz+ucfWmyU8lKVEStYdEAoq3NDzt9KoRxrOMUp88qqlnNCaJ+2RrOdOqPVA+C/8KI8ykLcGEh/FDTP0kyr75s9/g64ZCr6dSgkQe1CvwWcZklSUPRR8zZJTYsg0ixXNXkrqPNFYLwjjVj33GHek/45wPmyMKVM1+mYSlg+0wOI/rOP015LdhJRk8mMDDtbiiKowSYI+RQQEgN9XyO7ZONj4KbhPvbCdLI/Hgl27KtdRnXiYKNYCQEoAA6EVO7O6V3IXjASvUaetdN2udIOa5kM0jO0zbECAwEAAaOCAV0wggFZMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFLoW2W1NhS9zKXaaL3WMaiCPnshvMB8GA1UdIwQYMBaAFOzX44LScV1kTN8uZz/nupiuHA9PMA4GA1UdDwEB/wQEAwIBhjATBgNVHSUEDDAKBggrBgEFBQcDCDB3BggrBgEFBQcBAQRrMGkwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBBBggrBgEFBQcwAoY1aHR0cDovL2NhY2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZFJvb3RHNC5jcnQwQwYDVR0fBDwwOjA4oDagNIYyaHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZFJvb3RHNC5jcmwwIAYDVR0gBBkwFzAIBgZngQwBBAIwCwYJYIZIAYb9bAcBMA0GCSqGSIb3DQEBCwUAA4ICAQB9WY7Ak7ZvmKlEIgF+ZtbYIULhsBguEE0TzzBTzr8Y+8dQXeJLKftwig2qKWn8acHPHQfpPmDI2AvlXFvXbYf6hCAlNDFnzbYSlm/EUExiHQwIgqgWvalWzxVzjQEiJc6VaT9Hd/tydBTX/6tPiix6q4XNQ1/tYLaqT5Fmniye4Iqs5f2MvGQmh2ySvZ180HAKfO+ovHVPulr3qRCyXen/KFSJ8NWKcXZl2szwcqMj+sAngkSumScbqyQeJsG33irr9p6xeZmBo1aGqwpFyd/EjaDnmPv7pp1yr8THwcFqcdnGE4AJxLafzYeHJLtPo0m5d2aR8XKc6UsCUqc3fpNTrDsdCEkPlM05et3/JWOZJyw9P2un8WbDQc1PtkCbISFA0LcTJM3cHXg65J6t5TRxktcma+Q4c6umAU+9Pzt4rUyt+8SVe+0KXzM5h0F4ejjpnOHdI/0dKNPH+ejxmF/7K9h+8kaddSweJywm228Vex4Ziza4k9Tm8heZWcpw8De/mADfIBZPJ/tgZxahZrrdVcA6KYawmKAr7ZVBtzrVFZgxtGIJDwq9gdkT/r+k0fNX2bwE+oLeMt8EifAAzV3C+dAjfwAL5HYCJtnwZXZCpimHCUcr5n8apIUP/JiW9lVUKx+A+sDyDivl1vupL0QVSucTDh3bNzgaoSv27dZ8/DGCAbgwggG0AgEBMHcwYzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJbmMuMTswOQYDVQQDEzJEaWdpQ2VydCBUcnVzdGVkIEc0IFJTQTQwOTYgU0hBMjU2IFRpbWVTdGFtcGluZyBDQQIQBR6ekdcekQq75D1c7dDd2TANBglghkgBZQMEAgEFAKCB0TAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZIhvcNAQkFMQ8XDTIzMTEwMzExNTcyNlowKwYLKoZIhvcNAQkQAgwxHDAaMBgwFgQU2Rq5M/4XremCHqYT9aQ6cU4+fn0wLwYJKoZIhvcNAQkEMSIEIGmY+GsCefCDmP0PFcYjdxBUfi0EgKYuEZb9pUMyLNuVMDcGCyqGSIb3DQEJEAIvMSgwJjAkMCIEIILa8ZSVezaEAkWP1ScAaf5ixxRW+p4Lhqv4J+hTICfZMAoGCCqGSM49BAMCBEcwRQIgcxxuf7QHV9Fkpj1VhPrFqhNFh8dZzl8qUU/2N3Sr4eoCIQDKu0KGYL++CSsDAXjJciMDbr5ImTy3jw0yQU5GYYeLimd4NWNoYWluglkGMzCCBi8wggQXoAMCAQICEBtbCzvasORd8vMNnlTR2tIwDQYJKoZIhvcNAQELBQAwdTELMAkGA1UEBhMCVVMxIzAhBgNVBAoTGkFkb2JlIFN5c3RlbXMgSW5jb3Jwb3JhdGVkMR0wGwYDVQQLExRBZG9iZSBUcnVzdCBTZXJ2aWNlczEiMCAGA1UEAxMZQWRvYmUgUHJvZHVjdCBTZXJ2aWNlcyBHMzAeFw0yMzAyMDEwMDAwMDBaFw0yNDAyMDEyMzU5NTlaMIGhMREwDwYDVQQDDAhjYWktcHJvZDEcMBoGA1UECwwTQ29udGVudCBDcmVkZW50aWFsczETMBEGA1UECgwKQWRvYmUgSW5jLjERMA8GA1UEBwwIU2FuIEpvc2UxEzARBgNVBAgMCkNhbGlmb3JuaWExCzAJBgNVBAYTAlVTMSQwIgYJKoZIhvcNAQkBFhVncnAtY2FpLW9wc0BhZG9iZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDv0wCnfYY9lkHDsykrTG7FYlnYHBcyualuD5u9ULjzv+FsTWOLg8Nhrz9RTxI9EeBbu3Wm7f4vqPsQYfxkEp0wIa6DVmEOZhbAeRfbhybWQ/D4Wvvck4mEZR+QZmTpIn7HX61gbtMFHlJUxkYBctIoAt9TBAFbz9d5Ig2WG0bsH39b6/8USXnIIk4FB6dtBRT1xeEwSDtwOd1YBpXXNBJmRWHXNJZZ85of2tBTesg/kMvTrOJJxYDZ97U416wcvbVomlees+NXUY3/ZB4xH+NsZils7m1bL2v2hSnHiLoqZeUKklbHUmT4ZpjrZCdtuIsWm5j2PPXKr7HKUuCbZSXBAgMBAAWjggGMMIIBiDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAeBgNVHSUEFzAVBgkqhkiG9y8BAQwGCCsGAQUFBwMEMIGOBgNVHSAEgYYwgYMwgYAGCSqGSIb3LwECAzBzMHEGCCsGAQUFBwICMGUMY1lvdSBhcmUgbm90IHBlcm1pdHRlZCB0byB1c2UgdGhpcyBMaWNlbnNlIENlcnRpZmljYXRlIGV4Y2VwdCBhcyBwZXJtaXR0ZWQgYnkgdGhlIGxpY2Vuc2UgYWdyZWVtZW50LjBdBgNVHR8EVjBUMFKgUKBOhkxodHRwOi8vcGtpLWNybC5zeW1hdXRoLmNvbS9jYV83YTVjM2EwYzczMTE3NDA2YWRkMTkzMTJiYzFiYzIzZi9MYXRlc3RDUkwuY3JsMDcGCCsGAQUFBwEBBCswKTAnBggrBgEFBQcwAYYbaHR0cDovL3BraS1vY3NwLnN5bWF1dGguY29tMB8GA1UdIwQYMBaAFFcpejJNzP7kNU7AHyRzznNTq99qMA0GCSqGSIb3DQEBCwUAA4ICAQBXjlGa3yAK/Gijn6n/JNU9FZm72MP6vc5czrWe9y0T+EawuRvhpD5Edi1TnXkrpe8sMkgSjTGdbY+yGhq8zlCWQeXN1/aWo3L9Xr1uNxY/oVpLn0uWWfnfJ7yR9gKl/yoMfhjydT4t1fXHi/MhfhrWSVRHqX2U31UFGz/e298P2kv+vqhzpIUo1bj+jibtoPLMMQcCOTtKiJOTh4o3VSZpwQDERCzo91NkF+LnZjwYl6fE5USIkg/oCoomXxSPpowybDrcRJ9ilbtJcER48/LGgwzv/c7OYdron4PnEXm1FkOaVj+QRf7OwiNTizonhIzLR5Vfp0QHOWv/bPzvCjPQd+Xr0Q4032WlSxQwostNTAPtoVAU4OCwVH3Ech38emJ00/6fkDCdr7MN8/4n2LSNrMUvaBEZdmLqDCBnO02dbFrmpg3pTc0FqRQ4GL/88pjRNSMy5tU9SoQnSCGYqIsjfL8AzgPEGiXXRgABYc1uXecf4/eayb3K2MPs7hnWTbUKpHHJIwxpdN3vTGdZNWpz9Oxfuo3eELQlkTvACHgqkaXi/FAanHe5PChn6fr1/4cNF8goD0buPApgS3zzwqjRhxrH8ISwPfJn8JqzurMaLDMnnc18tHzUiMtX73jf6oXh7voCxX/T4D3nFPlxU3om2cpcLQ1Wd4026x18rlSGR1kGpTCCBqEwggSJoAMCAQICEAyotlR7iebSBol1zYubieIwDQYJKoZIhvcNAQELBQAwbDELMAkGA1UEBhMCVVMxIzAhBgNVBAoTGkFkb2JlIFN5c3RlbXMgSW5jb3Jwb3JhdGVkMR0wGwYDVQQLExRBZG9iZSBUcnVzdCBTZXJ2aWNlczEZMBcGA1UEAxMQQWRvYmUgUm9vdCBDQSBHMjAeFw0xNjExMjkwMDAwMDBaFw00MTExMjgyMzU5NTlaMHUxCzAJBgNVBAYTAlVTMSMwIQYDVQQKExpBZG9iZSBTeXN0ZW1zIEluY29ycG9yYXRlZDEdMBsGA1UECxMUQWRvYmUgVHJ1c3QgU2VydmljZXMxIjAgBgNVBAMTGUFkb2JlIFByb2R1Y3QgU2VydmljZXMgRzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC3Hy69vQmzXEhs/gyDrmwB6lF4JaSAPomnsbKIZNr2iXaB+fkd85X8eJiNmI7P5O4cVT4Nc1p3zrESqBV4ZUyW8gcZ78QdwoHG8QNd2VNcHnMgSR+XT9Iafsnq9Nfww3Jt9KL3l5ANQ5n1+MJqr48EWNLll942bOL/JH4ywDSMoqhZqtJEIUUUGlQVBZ8CAvJc7LE6ddA5C52PE2Ppa7RfQgHXf4gfXVZwpxYRZcziPiOHqEvLb0J3cShUbejFxV6cwX8QyAPa1ePHg1RtM0HX+D34xHo3DkyGnmT+Ddq00TEDGG26AL5PdINKFIQl+zaq6KJFQe1fdGE5wrWzU4mBPmzaz3EbLn+7FWlwAhorYqIMldbfHE3ydc+aTU1JW7+bG19qmvhO9IluGtTtQDeqFBj2fg6faxsfVfVPD7stN6TwoIDlkOCE4RE+Iin8m3z3eqi/VsTmsmRqBxWDRaqOHz02EJoEDxXJG3ei+UbIIp01XZQvdufm90WxOTuqqan2ZqTPX9K5VdjEh/ovr7xFc5q1dZo+Sa5y4sTVM854/tLU3klOgUKzzSXYPYS3GhBcYJHjwr9xNRHnNX99D6F0g7OijScWfvtjxh13aTv/H0ETvymah4yfDpVdh9cK5YSCPqnuOlsujFAyhYwJXOWDvZZU2EkWVLDhoPx9zp7N4QIDAQABo4IBNDCCATAwEgYDVR0TAQH/BAgwBgEB/wIBADA1BgNVHR8ELjAsMCqgKKAmhiRodHRwOi8vY3JsLmFkb2JlLmNvbS9hZG9iZXJvb3RnMi5jcmwwDgYDVR0PAQH/BAQDAgEGMBQGA1UdJQQNMAsGCSqGSIb3LwEBBzBXBgNVHSAEUDBOMEwGCSqGSIb3LwECAzA/MD0GCCsGAQUFBwIBFjFodHRwczovL3d3dy5hZG9iZS5jb20vbWlzYy9wa2kvcHJvZF9zdmNlX2Nwcy5odG1sMCQGA1UdEQQdMBukGTAXMRUwEwYDVQQDEwxTWU1DLTQwOTYtMzMwHQYDVR0OBBYEFFcpejJNzP7kNU7AHyRzznNTq99qMB8GA1UdIwQYMBaAFKYc4W1UJEyoj0hyv26pjNXk7DHUMA0GCSqGSIb3DQEBCwUAA4ICAQBxzuUHjKbcLdzI4DtlXgCSgZXrlSAkr59pOF3JfPG42qVNAGU7JcEYXJ6+WbfcGwY7WYMl+jO7IvJPb7shXFYW9bnJgxX7lLU14KExchmcLNY1ee6IhBJ2Y8PzZMRUKSd5CkURPg0PBLGjz/KR/DofHx+G4rPTCOGORYxeYrd01lci5hVxvKccvIk7MD69ZTewfZPSM+0WnsU3f0Zmd7hgbRpUyWceG0eHFpdUKK/ZFWhHjDVC28odCnN885tHncKXviItK0ZUUo/AIthFKlhEXsnq9VL9fFbgvO83ZvpUQo5y8mY3cuGnEVGXdhjNb53CfC1u4dbpYmWaN99subUzEsUaUb3loLPfVfzDOpg2y9v37kBdy/wuXr20teY7U62xj/fAgs1QSnhUtlMTfCqbefyEycKVmKIrJkJLsvgTSYKVvH4FFIwfd5WjqOC97jX98rcVAzhAI0iSkazsWOMvL6m0L4nLJapx+85GsVX8Y6AHmEP4bmCElwil6KAP+UewJFiw5rmwV2pESHAhYuZJa03B8tl0nd2QJzvJGmbeBqXqpF9ORinFM3HErK8puRokOjFH2+1asLeI2tB31W/ELdNe27Ogduq6Z6qBwCp59YX27qydDhD0WRfN64kCs25K88iGAGNW2CAfTDS+b+WYJBiIL9jXYZ4LF+BiUvfdu2NwYWRZC70AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZZAQBKX2Q2ihN2fLDLReHISpfOF0xIqNpOZXbBwZ0XanWG98erbIBdawl7r9nVma/uZjYH457wp00TVpKYUTJHMnzJMKskvM2Df4K6t5pUKGtJqEvMXLUy3g9kJq53aYDwikcUE+8wv+CYtu/+vii4XYSXQIxT4NN+JKoTDXmrNH1G46Nmpfq6SKk0g9GQ2brbkW3fzGR0xDxY3BXRy71guSBxN9TAbQGqUjMnkIyBcwV9wUQ2oCW9oIMNKASjW0CRkcFEzzmrQ+y+zHYpNvUaG7QehHcyhvOec3plzlyP6DZeQWp3PHA5bmonI8t5j6Qj15X1KnQiXuJ0rW+xoMA89aIVmpx4VgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAOSaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjYyYTdmYWExLWJmZTMtMjE0Ny04MjAwLWMxM2NlMGU4ZTc1NCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyNzRDMUI3RDdBNDAxMUVFQUJGRUFDRUIyQzkwNDc1QiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyNzRDMUI3QzdBNDAxMUVFQUJGRUFDRUIyQzkwNDc1QiIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMiAoMjAyMzEwMjQubS4yMzc0IDRhYjk0MzkpICAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphYjQzZjNjYy1hNTY4LTRkNGQtOTdiZC1iYjk0YjBlZjhjYmQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NjJhN2ZhYTEtYmZlMy0yMTQ3LTgyMDAtYzEzY2UwZThlNzU0Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+HNvo5wAADZFJREFUeNrsXFtPVUkW3gc4yP0qDigKON517FFbHRGn1TamjaOJvvhsjIkvPplgfEKe1AefNDE+GP+AmWTszPTYcbpn2piJzc1GWwlOekRBEBFQ7jeZ9ZVrnVkUtfc5CGp3h5VU9qUuu3bVV9+67DonND4+7omEQiHPJaWlpYlxcXGLKX8epTCdB5aXNnHU6c2bN5POcaREp+O9dHxSX1/f5s3KL1ImYCkasMrKyvIISJspD+AyZSTpOrodDSaIBpQCkwtgSM8oVd2/f39M2quoqAijmcrKyjG/l7L77vde+v6sfCRgbdu2LY3AtJNSgg0qDa5oTOViKQtM9nXTgQMHaqmpPEoLKXUQqJpcYIqPj/cSEhLMUZgUbYyNjZkjRPpu50n+VEUvKtditMEb7Xom5OrVqzvpkOXIukFps5XXTunO4cOHR7heKp1/ye1gEX9BCcdv6H4330cbCyh9iXrRgJUQ1FmarFWUIqDS4ApiCT9AobxMpj24uI/209LSvMLCwiLKz6fyQModAlW73TeAac6cOV5SUpIBlasv9qKRvgBYIyMj3tDQkDmPdaLRPzwrHA6bhGsNWr9xsMfEZnC7XDSg+tzv4lRCCRPfjJtHjhzpu3LlCkDVx4BKZICsx9gy4PT4rmFQQbIpdfM5ynX7gWrS/Phl7NixI0SDWCCD52Is14vqAXIByoluAkl+fr43f/58Lyvr7cIaHh4OJSYmfkug6rXZApOamprqUb6vned3X4CBujj29/cbkEl/7EUj74o+og4S2gh6xkypk6mUPXnyZN25c+fCDKzm8vLyOuQzqCAtJ06cuH/+/PkwAytMLCR57VjQFy5cmKeAiXJZGOeLFy/iPBVt4Nqeb60dogKLBm9O/FvxXIwVxBAaUBpgixYt8np7e7329vYJZUtKSkwSefHihVdTU9N2586dXrtfmNj09HQz0dMRvAsYD0dhLryrvG8s7/w+ZCrPcJSdx8duAb+6l0WgWqeu/8uMZMoDWCTr+BpMVoZ8jLUq18XXgdohEFg0cXF6kF2s5Uf9NqBwxL0FCxaYSXz58qWZSNzr6+vzioqKIm01NTV5ZLgbT9HuExgGAzBdUOmJEeb6EKD5AJKt1KJ9TwAFNrpz6tSpljNnzgiQuuh8DbNSNx9HlF0mx26/cbTHLy6AsSKGcVCyjWepJwnS2trqbdiwwZyDJaDyUBbslZmZGTG6Hz9+7D18+NDdUSqTkpIyY6B6V5b4mYsBAIGm27rXR/f+DFXGKm5Ega6P7a5lqvw6sbMIcFkKlCUAI6esQI0QBCwBjxirNqCkDACSkZFhQKLVCSassbHR27Jli6kvsnDhQnN8/vy5t3Hjxsj95ubmSQ6CVoEA5a8IBO+LsSKgoskPKxaC1DKo1mmDXF1/AwAyCO+rNoX1FrANVqLA6V6sfuGGgwcPphBovrCBIuwCgRp7+vSpAUd2dra5bmtrM6pvdHTUu3fvnrGdNHhEbt265XV1dXn79+9/y8V0XltbGwkDkKpsqqqqqhG2AmgBrFn5+Qo0Uyw21gRm0kwCLwqAAgC2b99u2AQCVYWyACtUGkRUoC2bNm0yYBIBe/l5ncKaWmg1hrj/47TCRu32ebUam4LyAweEymK1QG+PUdk3PmXCrGZicrej9e99CD0znvs4NsPtRh2fmMMNLmBBYHgDmTC4ly1bNslWAbhu375tyh06dGgCw2kB+yDEAIEh39HR4RsjE+/NkgJKf0DwlNJ3jkndi2Yo/QXOZ5RxWElpOaUqSk99QLWPErzUr2OcD+j7T+GPUKqZocldyu2mWWbMv1mt4T3q2OObSVnNz46MD49xMfelE85ArOGGiA2FSR0cHDRggVe3fv16Lzc317cXCBeUlZUZu8sVBLUF7YrnaDMWygsjWpLJx1eOvCS8LKX+GFeYdPS1T356wLOC7NcOK/g4HSbaSmku2zZtlo0D6l8U5R2mIxmO91/F79iP8aY+lmhAR2Us09PXr439hAles2ZNoK2Tl5dnwgorV66clHfz5k1v165dk8CFuJYfWwm4/Twgn4FMZqO0U00OPg/lsgck0k3Ae6JACq8HamsAJgPl9fOAzef8VLpey1HtVGXUQoZ45b7QawzgojqpauJNZIYnpEXUFpWZw8ZxMqsdEdgUixlUqPMt1RlygE8mv4jO5/M7tFHZXs4HI+uJG4YFQvldnF+sAPRGjd8SSjl8fzGVG6I6Dxk76GcKl8uOlbESh4eHDVOBpWCcQ/1F88qQv2fPnknlnjx5YsIJOBYXF/9/NqhtANcV8ZbYlc8zswJYJJ8H5Eem7A3WxEYmjdVcigycyltBeV/RsVANbDKDrJnL5jom+Dsa+A5e0WDOn7g/Kx3PR/06qpPDjBS28gG6e6pfDT6gimeV5LF6iqh4focxHo84Ne8hzv8ng2sJA6tfjUedROkZbPkqRhbie8JauTEBi7y6ePncAQaaO3fulKLaWgDQgYEBoxrh+WlgiW3l9znFNtp5IBN5kv0YS6vJYgYVVlU120mfUPot58sqbeaBxJh8zqs7TIN+i573R2aMfykGQD2w21dcfx2DMI3yXjOosLqH6Fr6U8VqDHGhzVw2ns8T2BaTWNMefrc09a7PA1R1iNuuYibZwfXmUB8Qq/qrZa9tZjs1i65fcRswHf5O1zuYgZ7yeG1jdq3SbM9gauFF8yimOBYABaN66dKlUwKVS0TVQT2+evVqgjcIYAWxXxQ12O/jcWUq0MlqvwtQsIeo8zOUWoQHOcCTNMbqQsqPcTARE5PCk/+a64woB6HPYf/JMzq57KgqW8AAaKa8Jn4fbfOlKe92wGeoMq13GFQqdwD95aDmZ5Q+Z9AJwwwoYL5Wn3vqHH2JCOU9pkMjg7jWMgH8GYtspVx8cIwW6QYDrV271rccgATGAkhgm8GTfPDggbd161YTWIUqdLGVnPt4lQKsQQebJTCVj7CNlO4YmAwFlCUaBAo0XVR/nK6T+RqTNh5g7GuwLrTyMxlMfY760r/eKI4J+hJSffA1rlm9o989DK5SLtOmnpOm+pCr6zNoojpJVK6HnxFbuKGiomI5u5hRQVVdXW0+0UjowGa97u6Jn5ewewExMIAN3mA0lepjX8nLgsYXMy2P8SAmWJM6zGoJhnkrr7BEBRwbJLYHJJ/zQ5gwZhx7IkMMkEFWfZF8BcxOFU9zAes33L9+yzERMKLP66nMM8V4HjNFpgPI0r9kft4AmwLjzE4wD0Z58S0OMCvk/RMDgB1zHGtZtIoIgopKe/TokRNYnZ2dzroAIsAFo93Vrq0OAxgLdPZ7TZBsLOtBAl2vZbvqE1VWT4JWM/YkDfJk4P4+GtxqR5l07otrYjMdk6Ydj24ebxjwO23CZ6A+YGegiJOn+vY3xcC9jncY5TwA7E92+zGEW/r5+CnbUjdijbXYbJXs8E6ck11aWmp2G+B7oC1Qc2AsP+AAVHqT3RR3Vd5nQ9dO93hw6ik95hX9H7jonF/PIQBjj7ARC9f5rhUTQrlWrt/L9e/y/XbOq1ce0ihfy0A85useZop6K2gJ8P8A0FACo/7De7tV5Qd4sgIa8QDp2IBoDTNOvU7Mlo1sQ44rwNSzwS3t19l14WWq/tb4qLW76rn3Yp2gSd8KCVjwWMqC1JP6nmei8Ddu3DBRdgmI4jshDHbkByVpQ5+rY9P3339fk5OT46m9RVMNLGLQf2cxdCGff62M3I8m1EcY73nqVg4nhBYe/FK+EwJH+E4cpAozgxoQlhEQwGNctWqVUW2rV6+OGOx++96jbcm193bJBrx3lBQV3NRu8o+xgCrWvervsoddWD8pKamQ40Py9QEM00htNrzrnvxY3yeW/kUTIRlbO7kYa4OlxyMsZG87loQ8Yhdv9+7dJkIPYGk28mOrFStWGOMeux+wdx0foq9fvx7Z3QDGgmeK9D63y8j74D2QpI+unZHTAZdsgJzKxE33vfQzowEuluC3q57eyx/EWBn2DQQ3MdDa9bd/xrV8+fLIpx8beH4/HigoKHgbKi4u9s6ePeuVl5cbYOkOIxwB0M30Bj+0DRDhy4LE7KSfszJ9SbAMd0+5vxEjG6EB+SWMRq3eepycnGwMdq0mfX7aNWHbsrAhovvXrl2bpCKRB2DDSZjuKpd2AVa0qX9EMSszK3GOmEWCjopLgBMJE4GEyZajVh8OA9zJXBpUOL98+bJ37Ngxr6WlRbPbuIABrILPS+8KAtRD/3t6ekzsTBbLLKg+HLC0GrxLkzCmAaWTDSptm0QDGf92cMKvdy5duuQdPXpU6+sB7TAAWFCzOI8VTCiLOoinIeaGNqbyO8JZmXlg3a2srPyJANQqQHIBTIPLBlYQc8GTxM5SAdHevXvNr3NgSylGe2Z7owAG2AZHcSbshHJgOJQDoCSeNgumj2hjMbAMqHBBE/IAv0imiU6AjSUGvN9Pv1z2lAtc2AiILTg4r6mpMfGP48ePew0NDdJGU21t7SuXaysAt3e26l85z7LSx5cJ4YbTp0/PJVBN2G6wb9++PJrAzdif5fpBhTaK/f70I1qygPeMrqvq6upi0nmuPyWZlY8XJPWNY7mEVJX5GyNK8yiFg34J7fM3RYEgIyCN09H8jVF1dfXs3xj9CoD1PwEGAKorJqR4atjIAAAAAElFTkSuQmCC")=>{let s,r=0,n=0;const o=[],h=t=>{const i=new bt.Image;i.src=t,i.onload=()=>{o.forEach((t=>{var s;const o=new $n({source:i,fitMode:e.ImageFitMode.Stretch});null===(s=t.Ed)||void 0===s||s.ke(o),r=i.width,n=i.height,u(t)}))}};h(i);const a=t.Wn((t=>h(t)));let l;if(new bt.Image instanceof bt.HTMLImageElement){const t=new bt.Image;t.src=i,l=new $n({source:t,fitMode:e.ImageFitMode.Stretch})}else if(bt.lcjs_setup){const t=new bt.Image;t.src=i;const s=bt.lcjs_setup(t.naturalWidth,t.naturalHeight);s.getContext("2d").drawImage(t,0,0),l=new $n({source:s,fitMode:e.ImageFitMode.Stretch})}else l=new G({color:T("#f00")});const u=t=>{if(t.Ed){const e=t.ft.mi({x:t.ft.x.getInnerEnd(),y:t.ft.y.getInnerStart()},{x:-(3+r),y:3}),i=t.ft.mi({x:t.ft.x.getInnerEnd(),y:t.ft.y.getInnerStart()},{x:-3,y:3+n}),s={x:i.x-e.x,y:i.y-e.y};t.Ed.Ie(e).tt(s)}s&&s.vs()};return s=t.II("logo",Number.MAX_SAFE_INTEGER),i=>{const r={ft:i};return(i=>{i.Ed&&i.Ed.dispose(),s&&(i.Ed=s.Te(i.ft).ke(l).setMouseInteractions(!0).Ce(ot).setMouseEnterEventHandler((()=>{t.Ur(e.MouseStyles.Point)})).setMouseLeaveEventHandler((()=>{t.Ur(e.MouseStyles.None)})).setMouseClickEventHandler(pg).setTouchEndEventHandler(pg),u(i))})(r),o.push(r),{Ds:()=>u(r),U:()=>(e=>{e.Ed&&(e.Ed.dispose(),e.Ed=void 0);const i=o.indexOf(e);i>=0&&o.splice(i,1),o.length<=0&&t.Un(a)})(r)}}},pg=()=>bt.open("https://lightningchart.com/lightningchart-js/");class xg{constructor(){this.mR=this.fP.bind(this),bt.addEventListener("scroll",this.mR,{passive:!0})}U(){this.mR&&bt.removeEventListener("scroll",this.mR),this.mR=void 0}}class Sg{constructor(t,e){this.ma=t,this.j=e,this.yR=!0,this.SR=null,this.vR=null}}class Ag{constructor(t){this.xR=!1,this.bR=1,this.MR=t,this._R={ma:u(0,0),j:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),yR:!0,SR:null,vR:null},this.wR=u(64,64),this.CR=new Uint8ClampedArray(this.wR.x*this.wR.y*this.bR)}kR(t,e){if(!t.yR)return null;if(t.SR&&t.vR){const i=this.kR(t.SR,e);return null!==i?i:this.kR(t.vR,e)}const i=c(t.j.x,t.j.y);if(t.ma.x+t.j.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.wR.x-t.ma.x-1),t.ma.y+t.j.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.wR.y-t.ma.y-1),t.j.x===e.x&&t.j.y===e.y)return t.yR=!1,t;if(i.xt.j.y)),h?(s=new Sg(oi(t.ma,{x:0,y:1}),u(t.j.x,e.y)),r=new Sg(oi(t.ma,{x:0,y:e.y+1}),u(t.j.x,t.j.y-1-e.y))):(s=new Sg(oi(t.ma,{x:1,y:0}),u(e.x,t.j.y)),r=new Sg(oi(t.ma,{x:e.x+1,y:0}),u(t.j.x-1-e.x,t.j.y))),t.SR=s,t.vR=r,this.kR(t.SR,e)}TR(t,e){const i={FR:!1,ma:null};let s=this.kR(this._R,e);if(null===s)for(;null===s&&this.wR.xthis.MR||t.y>this.MR)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.bR);for(let i=0;i{this.ER.NR(t)})),this.RR.clear(),this}GR(t,e){const i=this.LR.get(e);if(i)return i.get(t)}WR(t,e,i){let s=this.LR.get(e);if(s||(s=new Map,this.LR.set(e,s)),s.has(t.glyph))return bg.Success;const r=this.zR.TR(i,t.size);if(!r||!r.ma)return bg.Fail;r.FR&&this.UR();const n=this.zR.DR(r.BR);if(!n)return bg.Fail;let o=this.RR.get(r.BR);if(!o){const t=this.ER.gl.createTexture();if(!t)throw new yt("Failed to create texture for font!");o=t,this.RR.set(r.BR,t)}const h=r.ma,a=n.wR.x,l=n.wR.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=h.x/a,m=(h.y+t.size.y)/l,y=(h.x+t.size.x)/a,p=h.y/l,x=[g,m,y,m,g,p,g,p,y,m,y,p],S=[u,c,d,c,u,f,u,f,d,c,d,f],A={origin:h,size:t.size,advanceX:t.advance,baseline:t.baseline,vertices:S,texCoords:x,packerId:r.BR,texture:o};s.set(t.glyph,A);const v=this.ER.gl;return v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),v.bindTexture(v.TEXTURE_2D,o),v.texImage2D(v.TEXTURE_2D,0,v.LUMINANCE,n.wR.x,n.wR.y,0,v.LUMINANCE,v.UNSIGNED_BYTE,this.ER.YR?n.CR:new Uint8Array(n.CR)),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),v.bindTexture(v.TEXTURE_2D,null),r.FR?bg.Resize:bg.Success}UR(){this.LR.forEach((t=>{t.forEach(((e,i)=>{const s=this.zR.DR(e.packerId);if(!s)return;const r=e.origin,n=s.wR.x,o=s.wR.y,h=r.x/n,a=(r.y+e.size.y)/o,l=(r.x+e.size.x)/n,u=r.y/o,c=[h,a,l,a,h,u,h,u,l,a,l,u];e.texCoords=c,t.set(i,e)}))}))}}const Tg=t=>{if(t instanceof _i||t instanceof $c)return t.wi()?"linear-highPrecision":"linear";if(t instanceof Pi){const e={};return t.x instanceof Mi&&(e.x={base:t.x.pi()}),t.y instanceof Mi&&(e.y={base:t.y.pi()}),["logarithmic",e]}return"linear"},wg=t=>{const e=Object.keys(t),i={};return e.forEach((e=>{const s=t[e];let r=!1;i[e]=t=>{if(!t)return r;const e=s();return r=e,e}})),i},kg=(t,e,i)=>"value"===t.getLookUpProperty()?i:"x"===t.getLookUpProperty()?{min:e.xt(),max:e.bt()}:"y"===t.getLookUpProperty()?{min:e.Mt(),max:e._t()}:"z"===t.getLookUpProperty()?{min:e.uS(),max:e.lS()}:void 0,Cg=t=>!(!t||"value"!==t.lookUpProperty||!t.lut.percentageValues),Rg=t=>(e,i)=>i%2?e:e+t;class Ig{constructor(t){this.HR=new Map,this.$R=ce("font"),this.XR=new Map,this.jR=new Set,this.ER=t}OR(t=!1){return(t||0===this.jR.size)&&(this.HR.forEach(((t,e)=>{t.OR(),this.HR.delete(e)})),this.jR.clear()),this}ZR(t){this.jR.add(t)}QR(t){this.jR.delete(t)}JR(t,e,i,s){const r=bt.devicePixelRatio,n=`${s?"dark":"light"} - ${pr(e,r).id}`,o=this.XR.get(n),h=this.HR.get(o);let a=0,l=0,u=0;const c=t.split(""),d=e.size,f=.45*e.size*r,g=Math.round(1*e.size);let m=!1;for(let t=0;t{if(0===i||360===i||180===i||i%180==0)return{x:t,y:e};if(90===i||-90===i||(i+90)%180==0)return{x:e,y:t};const s=i*Math.PI/180,r=Math.cos(s),n=Math.sin(s);return{x:Math.abs(t*r)+Math.abs(e*n),y:Math.abs(t*n)+Math.abs(e*r)}})(u/r,(l-a+1)/r,i);return{x:y.x,y:y.y,isEstimate:m}}KR(t,e,i){const s=`${i?"dark":"light"} - ${e.id}`;let r=this.XR.get(s);r||(r=this.$R(),this.HR.set(r,new Eg(this.ER)),this.XR.set(s,r));const n=this.HR.get(r);if(!n)throw new yt("Failed to get font texture!");let o=0,h=0,a=0;const l=t.split(""),c=new Map;let d=0;const f=e.properties.size;for(let t=0;t{t.ua.o=!0})),t=-1,d=0,h=0,o=0,c.clear();continue}if(l===bg.Fail)throw new yt("Failed to create glyph");if(a=n.GR(s,f),!a)throw new yt("Failed to get glyph after creation")}if(""!==s.trim()){let t=c.get(a.texture);t||(t={vertices:[],texCoords:[]},c.set(a.texture,t)),t.vertices.push(...a.vertices.map(Rg(r))),t.texCoords.push(...a.texCoords),h=Math.max(h,a.baseline),o=Math.min(o,a.baseline-(a.size.y-1))}d+=a.advanceX}a=d;const g=m(u(0,o),u(a,h)),y=[];return c.forEach(((t,e)=>{y.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[y,g]}}class Fg{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>Dg(t)));for(const i of e)t=i(t);return`${xe(this.modifiers.filter((t=>Lg(t)))).map((t=>t.tE)).join("\n")}\n${t}`}}const Dg=t=>"function"==typeof t,Lg=t=>t&&"object"==typeof t&&"iE"in t,Vg=(...t)=>e=>{t=t.reverse();for(let i of t)"string"==typeof i&&(i=i.includes("{")||i.endsWith(";")?i:`${i};`,i=i.trim(),e=e.replace("void main(void)",`${i}\nvoid main(void)`));return e},_g=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),Pg=(...t)=>e=>{const i=t.filter((t=>!1!==t));for(let t=0;ti=>{for(let t=0;t{if(!n.includes(e))throw new Error(`ShaderBefore misusage (not found: \n${e}\nmatch: \n${t}\nresult: \n${n}\n)`)})),n},zg=(t,...e)=>i=>{const s=e.filter((t=>"string"==typeof t));for(let t=0;t{if(!l.includes(e))throw new Error(`ShaderAfter misusage (not found: "${e}", match: "${t}", result: "${l}")`)})),l},Ng=(...t)=>e=>{for(let i of t)if("string"==typeof i){i=i.endsWith(";")?i:`${i};`,i=i.trim(),i=i.startsWith("\t")?i:`\t${i}`;const t=e.lastIndexOf("}");e=`${e.substring(0,t-1)}\n${i}\n}`}return e},Ug=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Vg(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Vg(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return Ng(`\t${r} = ${s};`)(i)},Og=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e},Gg={roundUnsigned:{iE:"roundUnsigned",tE:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{iE:"linearStep",tE:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{iE:"decodeUbyteRGBAEncodedFloat",tE:"\n // Denormalize 8-bit color channels to integers in the range 0 to 255.\n ivec4 floatsToBytes(vec4 inputFloats, bool littleEndian) {\n ivec4 bytes = ivec4(inputFloats * 255.0);\n return (\n littleEndian\n ? bytes.abgr\n : bytes\n );\n }\n \n // Break the four bytes down into an array of 32 bits.\n void bytesToBits(const in ivec4 bytes, out bool bits[32]) {\n for (int channelIndex = 0; channelIndex < 4; ++channelIndex) {\n float acc = float(bytes[channelIndex]);\n for (int indexInByte = 7; indexInByte >= 0; --indexInByte) {\n float powerOfTwo = exp2(float(indexInByte));\n bool bit = acc >= powerOfTwo;\n bits[channelIndex * 8 + (7 - indexInByte)] = bit;\n acc = mod(acc, powerOfTwo);\n }\n }\n }\n \n // Compute the exponent of the 32-bit float.\n float getExponent(bool bits[32]) {\n const int startIndex = 1;\n const int bitStringLength = 8;\n const int endBeforeIndex = startIndex + bitStringLength;\n float acc = 0.0;\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n \n // Compute the mantissa of the 32-bit float.\n float getMantissa(bool bits[32], bool subnormal) {\n const int startIndex = 9;\n const int bitStringLength = 23;\n const int endBeforeIndex = startIndex + bitStringLength;\n // Leading/implicit/hidden bit convention:\n // If the number is not subnormal (with exponent 0), we add a leading 1 digit.\n float acc = float(!subnormal) * exp2(float(bitStringLength));\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n \n // Parse the float from its 32 bits.\n float bitsToFloat(bool bits[32]) {\n float signBit = float(bits[0]) * -2.0 + 1.0;\n float exponent = getExponent(bits);\n bool subnormal = abs(exponent - 0.0) < 0.01;\n float mantissa = getMantissa(bits, subnormal);\n float exponentBias = 127.0;\n return signBit * mantissa * exp2(exponent - exponentBias - 23.0);\n }\n \n // Decode a 32-bit float from the RGBA color channels of a texel.\n float decodeUbyteRGBAEncodedFloat(vec4 rgba, bool littleEndian) {\n ivec4 rgbaBytes = floatsToBytes(rgba, littleEndian);\n bool bits[32];\n bytesToBits(rgbaBytes, bits);\n return bitsToFloat(bits);\n }\n "},texelFetchWithFallback:{webgl2:{iE:"texelFetchWithFallback",tE:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{iE:"texelFetchWithFallback",tE:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (vec2(iTexel) * 2.0 + 1.0) * halfTexel);\n}"}},texelFetchUnsignedWithFallback:{webgl2:{iE:"texelFetchUnsignedWithFallback",tE:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{iE:"texelFetchUnsignedWithFallback",tE:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (vec2(iTexel) * 2.0 + 1.0) * halfTexel);\n}"}},modulus:{iE:"modulus",tE:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{iE:"computeScreenSpaceWireframe",tE:"#extension GL_OES_standard_derivatives : enable\nfloat computeScreenSpaceWireframe (vec3 barycentric, float lineWidth) {\n vec3 dist = fwidth(barycentric);\n vec3 smoothed = smoothstep(dist * ((lineWidth * 0.5) - 0.5), dist * ((lineWidth * 0.5) + 0.5), barycentric);\n return 1.0 - min(min(smoothed.x, smoothed.y), smoothed.z);\n}"}},Yg=(t,e)=>{const i=e.steps,s=i.length-1,r=[Vg("uniform vec4 uFallbackColor")],n=[],o=[];for(let t=0;t= uLUTValue${s}) {\n colorLookup = uLUTColor${s};\n }`,...i.slice(0,-1).map(((t,e)=>`if (value >= uLUTValue${e} && value <= uLUTValue${e+1}) { colorLookup = uLUTColor${e} + vec4(\n uLUTColor${e+1}[0] - uLUTColor${e}[0],\n uLUTColor${e+1}[1] - uLUTColor${e}[1],\n uLUTColor${e+1}[2] - uLUTColor${e}[2],\n uLUTColor${e+1}[3] - uLUTColor${e}[3]\n ) * (value - uLUTValue${e})/(uLUTValue${e+1} - uLUTValue${e});}`)),"vec4 colorFragment = colorLookup")):r.push(Bg("colorFragment","vec4 colorLookup = vec4(uLUTValue0)",`if (${t} <= -340282346638528859811704183484516925440.0) {\n colorLookup = uFallbackColor;\n }`,"float value = "+(e.percentageValues?`clamp((${t} - uMinValue) / (uMaxValue - uMinValue), 0.0, 1.0);`:`${t}`),`if (${t} >= uLUTValue${s}) { colorLookup = uLUTColor${s};}`,...i.slice(1).reverse().map((t=>{const e=i[i.indexOf(t)-1];return`if (value < uLUTValue${i.indexOf(t)}) { colorLookup = uLUTColor${i.indexOf(e)};}`})),"vec4 colorFragment = colorLookup")),r},Hg=[Vg("uniform sampler2D uMaskTexture"),Vg("varying vec2 vMaskTextureCoord"),zg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],Xg=[Vg("uniform sampler2D uMaskTexture"),Vg("varying vec2 vMaskTextureCoord"),zg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.a")],Wg=[Vg("varying vec3 vPosWorld;","varying vec3 vNormal;","uniform vec3 uCameraLoc;","uniform vec3 uLightLoc;","uniform vec4 uLightColor;","uniform vec4 uAmbientColor;","uniform float uShininess;","uniform float uAmbientReflection;","uniform float uDiffuseReflection;","uniform float uSpecularReflection;"),zg("colorFragment =","float ambientReflection = uAmbientReflection","float diffuseReflection = uDiffuseReflection","float specularReflection = uSpecularReflection","vec3 ambientColor = uAmbientColor.rgb","vec3 diffuseColor = colorFragment.rgb","vec3 specularColor = uLightColor.rgb","vec3 vNormalNormalized = normalize(vNormal)","vNormalNormalized = (float(gl_FrontFacing) * 2.0 - 1.0) * vNormalNormalized","vec3 lightDir = normalize( uLightLoc - vPosWorld )","float lambertian = abs(dot(vNormalNormalized, lightDir))","float specular = 0.0","vec3 R = reflect(-lightDir, vNormalNormalized)","vec3 V = normalize(uCameraLoc - vPosWorld)","float specAngle = max(dot(R,V),0.0)","specular = pow(specAngle, uShininess)","colorFragment = vec4(ambientReflection * ambientColor + diffuseReflection * lambertian * diffuseColor + specularReflection * specular * specularColor, colorFragment.a)")];class jg extends Error{constructor(t,e,i){super(`Dynamic shader generation error\n(id: ${e})\n ${i?`when applying feature: ${i.idVertex?`vert: ${i.idVertex}`:""} ${i.idFragment?`frag: ${i.idFragment}`:""}`:""} | ${t}`)}}const $g=(...t)=>{let e="";for(const i of t){if("object"!=typeof i){e+=`${String(i)},`;continue}const t=[{prefix:"",obj:i}];for(;t.length>0;){const{prefix:i,obj:s}=t.shift();e+=`${i}:`;const r=Object.keys(s).sort();for(const i of r){const r=s[i];"object"==typeof r&&r.__proto__===Object.prototype||Array.isArray(r)?t.push({prefix:i,obj:r}):e+=`${i}=${String(r)},`}}}return e},Zg=t=>void 0!==t.find((t=>{var e;return null===(e=t.sE)||void 0===e?void 0:e.eE})),Kg=t=>void 0!==t.find((t=>{var e;return null===(e=t.sE)||void 0===e?void 0:e.hE})),Jg=(t,e,...i)=>{const s=[],r=e?"vec3":"vec2",{axisWorldTranslation:n,scaling:o,translation:h,offset:a,flipXY:l,flipXZ:u,splitPosAttribute:c,normalSource:d}=t,f=[];if("attribute"===d&&s.push(Vg("attribute vec3 aNormal"),Pg("vec3 normal = aNormal")),"linear-highPrecision"!==n?i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&void 0!==t.variableNameAxisCoord&&(!0!==c?s.push(Pg(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(Pg(`${r} ${t.variableNameAxisCoord} = ${e?`vec3(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y, ${t.attributeNameAxisCoord}Z)`:`vec2(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y)`}`)))})):i.forEach((e=>{!0!==t.splitPosAttribute?s.push(Pg(`${r} ${e.variableNameAxisCoord}_highpart = ${e.attributeNameAxisCoord}_highpart`),Pg(`${r} ${e.variableNameAxisCoord}_lowpart = ${e.attributeNameAxisCoord}_lowpart`)):s.push(Pg(`${r} ${e.variableNameAxisCoord}_highpart = vec2(${e.attributeNameAxisCoord}_highpartX, ${e.attributeNameAxisCoord}_highpartY)`),Pg(`${r} ${e.variableNameAxisCoord}_lowpart = vec2(${e.attributeNameAxisCoord}_lowpartX, ${e.attributeNameAxisCoord}_lowpartY)`))})),a&&a.rotation){const t=a.rotation.dataType,e="uniform"===t?"u":"a";if("attribute-deg"===t){s.push(Vg("attribute float aRotDeg"),Vg("uniform float uBaseRotDeg"));const t="cRot",e="aInstanceGeo";s.push(Pg(`vec2 ${t} = vec2(sin((aRotDeg + uBaseRotDeg) * 0.01745329252), cos((aRotDeg + uBaseRotDeg) * 0.01745329252))`,`vec2 rotatedGeo = vec2(${e}.x * ${t}.y + ${e}.y * ${t}.x, ${e}.y * ${t}.y - ${e}.x * ${t}.x)`))}else{const i=`${e}Rot`;s.push(Vg(`${t} vec2 ${i}`));const r="aInstanceGeo";s.push(Pg(`vec2 rotatedGeo = vec2(${r}.x * ${i}.y + ${r}.y * ${i}.x, ${r}.y * ${i}.y - ${r}.x * ${i}.x)`))}}if(a&&s.push(Vg(`attribute ${r} aInstanceGeo`)),!0===l){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + flipXY");i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${e?`vec3(${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x, ${t.variableNameAxisCoord}.z)`:`vec2(${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x)`}`)}))}if(!0===u){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + flipXZ");i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = vec3(${t.variableNameAxisCoord}.z, ${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x)`)}))}if(o){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + scaling");const t=("attribute"===o.dataType?"a":"u")+"Scaling",r=e?"vec3":"vec2";s.push(Vg(`${o.dataType} ${r} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} * ${t}`)}))}if(h&&"axis"===h.sizeUnit){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + translation (axis)");const t=("attribute"===h.dataType?"a":"u")+"TranslationAxis",r=e?"vec3":"vec2";s.push(Vg(`${h.dataType} ${r} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} + ${t}`)}))}if(a&&"axis"===a.sizeUnit){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + offset (axis)");const t=("attribute"===a.dataType?"a":"u")+"OffsetAxis",o=!0===a.symmetric?"float":r;s.push(Vg(`${a.dataType} ${o} ${t}`));const h=a.halved?" * 0.5":"",l=a.rotation?"rotatedGeo":"aInstanceGeo",u="offsetGeometry";f.push(`${r} ${u} = ${t} * ${l}${h} * sign(uScale)`),e&&"gpu-calculate"===d&&f.push(`${r} normal = ${l}`),i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${t.variableNameAxisCoord} + ${u}`)}))}if(void 0===n||"linear"===n)s.push(Vg(`uniform ${r} uDisp`,`uniform ${r} uScale`)),i.forEach((t=>{f.push(`${r} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord} - uDisp) / uScale`)}));else if("linear-highPrecision"===n)s.push(Vg(`uniform ${r} uDisp`,`uniform ${r} uScale`,`uniform ${r} uScaleStart_highpart`,`uniform ${r} uScaleStart_lowpart`)),i.forEach((t=>{f.push(`${r} ${t.variableNameAxisCoord}_hprecision = (${t.variableNameAxisCoord}_highpart - uScaleStart_highpart) + (${t.variableNameAxisCoord}_lowpart - uScaleStart_lowpart)`,`${r} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord}_hprecision - uDisp) / uScale`,`${r} ${t.variableNameAxisCoord} = ${t.variableNameAxisCoord}_highpart + ${t.variableNameAxisCoord}_lowpart`)}));else if("matrix"===n)s.push(Vg("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("matrix4"===n)s.push(Vg("uniform mat4 uMatrix")),i.forEach((t=>{f.push(`vec4 ${t.variableNameWorldCoord} = uMatrix * ${t.attributeNameAxisCoord}`)}));else if("logarithmic"===n[0]){s.push(Vg(`uniform ${r} uScaleStart`,`uniform ${r} uScaleStartLog`,`uniform ${r} uScaleInterval`,`uniform ${r} uScaleIntervalLog`,`uniform ${r} uViewportStart`,`uniform ${r} uViewportSize`));const t=e?["x","y","z"]:["x","y"],o=[];t.forEach((t=>{const e=n[1][t];if(void 0!==e){const t=e.base;if("e"===t)return;const i=`float cLog${t} = 1.0 / log(${Ti(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(Vg(...o)),i.forEach(((e,i)=>{const s=`${i}`,o=[];t.forEach((t=>{const i=t.toUpperCase(),r=n[1][t];if(void 0===r)f.push(`float posPercent${i}${s} = (${e.variableNameAxisCoord}.${t} - uScaleStart.${t}) / uScaleInterval.${t}`);else{const n=r.base,o="e"===n;f.push(`float posLog${i}${s} = log(${e.variableNameAxisCoord}.${t})${o?"":` * cLog${n}`}`,`float posPercent${i}${s} = (posLog${i}${s} - uScaleStartLog.${t}) / uScaleIntervalLog.${t}`)}o.push(`posPercent${i}${s}`)})),f.push(`${r} ${e.variableNameWorldCoord} = uViewportStart + ${r}(${o.join(", ")}) * uViewportSize`)}))}if(a&&"px"===a.sizeUnit){s.push(Vg("uniform vec2 uRatioPxClip"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Vg("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("attribute"===a.dataType?"a":"u")+"OffsetPixels",n=!0===a.symmetric?"float":r;s.push(Vg(`${a.dataType} ${n} ${e}`));const o=a.halved?" * 0.5":"",h=`(${a.rotation?"rotatedGeo":"aInstanceGeo"} + ${t}) * ${e}${o} * uRatioPxClip`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${h}`)}))}if(a&&"scale"===a.sizeUnit){s.push(Vg("uniform vec2 uRatioPxClip")),s.push(Vg("uniform vec2 uSizePixels"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Vg("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("uniform"===a.dataType?"u":"a")+"OffsetScale";s.push(Vg(`${a.dataType} float ${e}`));const r=`(${a.rotation?"rotatedGeo":"aInstanceGeo"} + ${t}) * ${e} * uSizePixels * uRatioPxClip`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${r}`)}))}if(a&&"wu"===a.sizeUnit){const t=("attribute"===a.dataType?"a":"u")+"OffsetWU",n=!0===a.symmetric?"float":r;s.push(Vg(`${a.dataType} ${n} ${t}`));const o=a.halved?" * 0.5":"",h=a.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${r} ${l} = ${t} * ${h}${o}`),e&&"gpu-calculate"===d&&f.push(`${r} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l}`)}))}if(a&&"nwu"===a.sizeUnit){s.push(Vg("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(Vg(`${a.dataType} ${n} ${t}`));const o=a.halved?" * 0.5":"",h=a.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${r} ${l} = ${t} * ${h}${o}`),e&&"gpu-calculate"===d&&f.push(`${r} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l} * uRatioNwuWu`)}))}return t.snapToNearestPixel&&(s.push(Vg("uniform vec2 uViewportSizePx")),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = 2.0 * floor(((${t.variableNameWorldCoord} + 1.0) * 0.5) * uViewportSizePx + 0.5) / uViewportSizePx - 1.0`)}))),s.push(Bg("gl_Position =",...f)),s},qg=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(zg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(zg(i,`${o} ${s} = ${i} * uScale + uDisp + uScaleStart_highpart + uScaleStart_lowpart`));else{if("matrix"===n)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("matrix4"===n)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("logarithmic"!==n[0])throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");{const t=[`${o} ${i}_percent = (${i} - uViewportStart) / uViewportSize`];(e?["x","y","z"]:["x","y"]).forEach((e=>{const s=e.toUpperCase(),r=n[1][e];if(void 0===r)t.push(`float pos${s}Back = ${i}_percent.${e} * uScaleInterval.${e} + uScaleStart.${e}`);else{const n=r.base,o="e"===n?"1.0":`cLog${n}`;t.push(`float pos${s}Back = pow(2.71828, (${i}_percent.${e} * uScaleIntervalLog.${e} + uScaleStartLog.${e}) / ${o})`)}})),t.push(`${o} ${s} = ${o}(posXBack, posYBack${e?", posZBack":""})`),r.push(zg(i,...t))}}return r},Qg=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.sE)||void 0===e?void 0:e.rE})))(t)?[_g("attribute vec4 aColor"),_g("vColor = aColor"),Vg("attribute vec4 aColorA"),Vg("attribute vec4 aColorB"),Ng("vColor = mix(aColorA, aColorB, aSegmentSide)")]:[],tm=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.sE)||void 0===e?void 0:e.nE})))(t)?[_g("attribute float aLookupValue"),_g("vLookupValue = aLookupValue"),Vg("attribute float aLookupValueA"),Vg("attribute float aLookupValueB"),Ng("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],em={"2D":{idFeature:"2D",apply:t=>({idVertex:"2D",idFragment:"2D",defaultVertexShader:"2D",defaultFragmentShader:"FragmentShader"})},"2DCompose":{idFeature:"2DCompose",apply:t=>({idVertex:"2DCompose",idFragment:"2DCompose",defaultVertexShader:"2DMatrix",defaultFragmentShader:"Empty"})},"3D":{idFeature:"3D",sE:{eE:!0},apply:t=>({idVertex:"3D",idFragment:"3D",defaultVertexShader:"3D",defaultFragmentShader:"FragmentShader"})},PointSize:t=>({idFeature:"PointSize",apply:e=>{const i="uniform"===t?"u":"a";return{idVertex:`SizePrimitive:${$g(t)}`,idFragment:void 0,vertexShaderModifiers:[Vg(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Ng(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTextureText,r=t&&t.maskTexture,n=t&&t.overrideOpacity;return{idFeature:"Color",sE:{hE:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,nE:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0,rE:"attribute"===t.dataType||void 0},apply:(o,h)=>{let a,l=`Color:${$g(t)}`;const u=[];let c="FragmentShader";const d=[];if("uniform"===i)d.push(Vg("uniform vec4 uColor"),Pg("vec4 colorFragment = uColor"),...s?Hg:[],...r?Xg:[]);else if("attribute"===i)a="colorAttribute",u.push(Ug("attribute vec4 aColor","varying vec4 vColor")),d.push(Vg("varying vec4 vColor"),Pg("vec4 colorFragment = vColor"),...s?Hg:[],...r?Xg:[]);else if("texture"===i)a="colorTexCoord",u.push(Ug("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),d.push(Vg("varying vec2 vTextureCoord"),Vg("uniform sampler2D uColorTexture"),Vg("uniform vec4 uColor"),Pg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.) {\n colorFragment = uColor;\n }"),...s?Hg:[],...r?Xg:[]);else if("texture-coord-calc-gpu"===i)a="colorTexCoord",c="Empty",u.push(Vg("attribute vec2 aTextureCoord"),Vg("varying vec2 vTextureCoord"),Ng("vTextureCoord = gl_Position.xy * 0.5 + 0.5")),d.push(Vg("varying vec2 vTextureCoord"),Vg("uniform sampler2D uColorTexture"),Pg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","gl_FragColor = colorFragment;"));else if(Array.isArray(i)&&"image"===i[0])a="colorTexCoord",u.push(Ug("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1].fitMode===e.ImageFitMode.Tile?d.push(Vg("uniform sampler2D uColorTexture"),Vg("varying vec2 vTextureCoord"),Pg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);")):d.push(Vg("uniform sampler2D uColorTexture"),Vg("varying vec2 vTextureCoord"),Vg("uniform vec4 uColor"),Pg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.){\n colorFragment = uColor;\n }"));else if(Array.isArray(i)&&"lookup"===i[0]){const t=i[1];if("value"===t)a="lookup:value",u.push(Ug("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;a=`lookup:${t}`,u.push(Ug(e,"varying float vLookupValue"))}d.push(Vg("varying float vLookupValue"),...Yg("vLookupValue",i[2]),...s?Hg:[],...r?Xg:[])}else if(Array.isArray(i)&&"gradient"===i[0]){const t=i[1],e=t.getColorStops();et(t)?(l=`rgradient${e.length},${r},${s}`,d.push(Vg("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Vg(...It(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Gg.linearStep,Pg("vec2 uv = vec2((((gl_FragCoord.x)-uBounds.x)/(uBounds.z))*uAspect,((gl_FragCoord.y)-uBounds.y)/(uBounds.w))","float mixVal = distance(uv/uDistance, uCenter/uDistance)","vec4 color = mix(color_0, color_1, linearStep(stop_0, stop_1, mixVal))",...e.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, mixVal));`)),"vec4 colorFragment = color"),...s?Hg:[],...r?Xg:[])):rt(t)&&(l=`lgradient${e.length},${r},${s}`,d.push(Vg("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Vg(...It(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Gg.linearStep,Pg("vec2 uv = gl_FragCoord.xy - uBounds.xy","float magnitude = ((uv.x-uStartPoint.x) * (uEndPoint.x-uStartPoint.x) + (uv.y-uStartPoint.y) * (uEndPoint.y-uStartPoint.y)) / (pow(uEndPoint.x - uStartPoint.x, 2.0) + pow(uEndPoint.y-uStartPoint.y,2.0))","vec4 color = mix(color_0, color_1, linearStep(stop_0, stop_1, magnitude))",...e.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, magnitude))`)),"vec4 colorFragment = color"),...s?Hg:[],...r?Xg:[]))}if(s||r){const t="maskTexture";a=a?`${a} ${t}`:`Color:${t}`,u.push(Ug("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return n&&d.push(Vg("uniform float uOpacity"),zg("colorFragment =","colorFragment.a *= uOpacity")),{vertexShaderModifiers:u,fragmentShader:c,fragmentShaderModifiers:d,idVertex:a,idFragment:l}}}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let r;const n=`ColorShaded3D:${$g(t)}`;return{idFeature:"ColorShaded3D",sE:{hE:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,nE:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const h=[],a=[];if(h.push("phong"===i&&Ug("normal","varying vec3 vNormal"),Ug("posWorld","varying vec3 vPosWorld")),"uniform"===e)a.push(Vg("uniform vec4 uColorDiffuse"),Pg("vec4 colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",h.push(Ug("attribute vec4 aColor","varying vec4 vColor")),a.push(Vg("varying vec4 vColor"),Pg("vec4 colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",h.push(Ug("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,h.push(Ug(e,"varying float vLookupValue"))}a.push(Vg("varying float vLookupValue"),...Yg("vLookupValue",e[2]))}if(s){const t="wireframe";r=r?`${r},${t}`:t,h.push(Ug("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),a.push(Vg("varying vec3 vTriangleBary"),Vg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Gg.computeScreenSpaceWireframe,zg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&a.push(...Wg),{idVertex:r,idFragment:n,vertexShaderModifiers:h,fragmentShader:"FragmentShader",fragmentShaderModifiers:a}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=[],s=Zg(e),r=t.coordType?t.coordType:s?"vec3":"vec2";return"linear-highPrecision"!==t.axisWorldTranslation?!0!==t.splitPosAttribute?i.push(Vg(`attribute ${r} aPos`)):i.push(Vg("attribute float aPosX"),Vg("attribute float aPosY"),s&&Vg("attribute float aPosZ")):!0===t.splitPosAttribute?i.push(Vg("attribute float aPos_highpartX"),Vg("attribute float aPos_lowpartX"),Vg("attribute float aPos_highpartY"),Vg("attribute float aPos_lowpartY")):i.push(Vg(`attribute ${r} aPos_highpart`),Vg(`attribute ${r} aPos_lowpart`)),i.push(...Jg(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"vec4"===t.coordType?void 0:"posAxis",variableNameWorldCoord:"posWorld"})),{idVertex:`VertexLocation:${$g(t)}`,idFragment:void 0,vertexShaderModifiers:i}}}),Model3D:t=>({idFeature:"Model3D",apply:e=>{const i=[];return i.push(Vg("attribute vec3 aGeoPos"),Vg("uniform mat4 uModelRotation"),Vg("uniform mat4 uModelRotationNormals"),Vg("uniform vec3 uLocationAxis"),Vg("uniform vec3 uModelAlignment"),Vg("uniform vec3 uModelScale"),Vg("uniform vec3 uModelSize"),...Jg({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,{attributeNameAxisCoord:"uLocationAxis",variableNameAxisCoord:"locationAxis",variableNameWorldCoord:"locationWorld"}),Bg("gl_Position =","vec3 posWorld = locationWorld + ((uModelRotation * vec4(aGeoPos, 1.0)).xyz - (uModelAlignment + 1.0) * uModelSize/2.0) * uModelScale;"),"attribute"===t.normalSource&&zg("vec3 normal ="," normal = (uModelRotationNormals * vec4(normal, 1.0)).xyz;"),...Kg(e)?qg({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,"posWorld","posAxis"):[]),{vertexShaderModifiers:i,idVertex:`Model3D:${$g(t)}`,idFragment:void 0}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",apply:e=>({idVertex:`LineInstanced2D:${$g(t)}`,idFragment:void 0,vertexShaderModifiers:[Vg("uniform float uThicknessPixels"),Vg("uniform vec2 uRatioPxClip"),..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Vg("attribute vec2 aLocationA"),Vg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Vg("attribute vec2 aLocationA_highpart"),Vg("attribute vec2 aLocationB_highpart"),Vg("attribute vec2 aLocationA_lowpart"),Vg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Vg("attribute float aLocationAX"),Vg("attribute float aLocationAY"),Vg("attribute float aLocationBX"),Vg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Vg("attribute float aLocationA_highpartX"),Vg("attribute float aLocationA_highpartY"),Vg("attribute float aLocationB_highpartX"),Vg("attribute float aLocationB_highpartY"),Vg("attribute float aLocationA_lowpartX"),Vg("attribute float aLocationA_lowpartY"),Vg("attribute float aLocationB_lowpartX"),Vg("attribute float aLocationB_lowpartY")]:[],Vg("attribute vec2 aSegmentPosition"),Vg("attribute float aSegmentSide"),...Jg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),t.ensureMinimumSegmentLength&&Vg("uniform vec2 uMinSegmentPixelVector"),zg("worldB = ",t.ensureMinimumSegmentLength&&"float segmentLengthPixels = sqrt(pow(worldB.x - worldA.x, 2.0) + pow(worldB.y - worldA.y, 2.0)) / length(uRatioPxClip)",t.ensureMinimumSegmentLength&&"if (segmentLengthPixels == 0.0 || segmentLengthPixels < length(uMinSegmentPixelVector)) {\n worldB = worldA + uMinSegmentPixelVector * uRatioPxClip;\n }","vec2 directionBasis = worldB - worldA","vec2 directionBasisNorm = normalize(directionBasis)","vec2 perpendBasisNorm = vec2(-directionBasisNorm.y, directionBasisNorm.x)","vec2 offset = mix(worldA, worldB, aSegmentSide)","vec2 thicknessDirection = aSegmentPosition.x * directionBasisNorm + aSegmentPosition.y * perpendBasisNorm","vec2 posWorld = offset + thicknessDirection * uThicknessPixels * uRatioPxClip"),...tm(e),...Qg(e),...Kg(e)?qg(t,!1,"posWorld","posAxis"):[]]})}),Area2D:t=>({idFeature:"Area2D",apply:e=>({idVertex:`Area2D:${$g(t)}`,idFragment:void 0,vertexShaderModifiers:[..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Vg("attribute vec2 aLocationA"),Vg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Vg("attribute vec2 aLocationA_highpart"),Vg("attribute vec2 aLocationB_highpart"),Vg("attribute vec2 aLocationA_lowpart"),Vg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Vg("attribute float aLocationAX"),Vg("attribute float aLocationAY"),Vg("attribute float aLocationBX"),Vg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Vg("attribute float aLocationA_highpartX"),Vg("attribute float aLocationA_highpartY"),Vg("attribute float aLocationB_highpartX"),Vg("attribute float aLocationB_highpartY"),Vg("attribute float aLocationA_lowpartX"),Vg("attribute float aLocationA_lowpartY"),Vg("attribute float aLocationB_lowpartX"),Vg("attribute float aLocationB_lowpartY")]:[],Vg("attribute float aCurveOrBaseline"),Vg("attribute float aSegmentSide"),...Jg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),zg("worldB = ","vec2 posCoord = mix(worldA, worldB, aSegmentSide)","float baseline = min(posCoord.y, -1.0)","vec2 posWorld = vec2(posCoord.x, mix(posCoord.y, baseline, aCurveOrBaseline))"),...tm(e),...Qg(e),...Kg(e)?qg(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${$g(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Vg("uniform float uOffsetWU"),Vg("attribute vec3 aLocationA"),Vg("attribute vec3 aLocationB"),Vg("attribute float aSegmentPosition"),Vg("attribute float aPerpendHorizontal"),Vg("attribute float aPerpendVertical"),...Jg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Zg(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),zg("worldB = ","vec3 directionBasis = worldB - worldA","vec3 directionBasisNorm = normalize(directionBasis)","vec3 notParallel = normalize(mix( vec3( 0.0, 1.0, 0.0 ), vec3( 0.2, 0.8, 0.0 ), step( abs(directionBasis.y), 0.9 ) ))","vec3 horizontalBasis = normalize( cross( notParallel, directionBasisNorm ) )","vec3 verticalBasis = normalize( cross( horizontalBasis, directionBasisNorm ) )","vec3 normal = aPerpendHorizontal * horizontalBasis + aPerpendVertical * verticalBasis","vec3 posWorld = worldA + aSegmentPosition * directionBasis + normal * uOffsetWU * 0.5"),...Kg(e)?qg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[Vg("attribute vec3 aEdge"),Vg("uniform float uEdgeRoundness"),zg("posWorld =","vec3 boxSizeWorld = abs( aOffsetAxis / uScale )","float boxMinDimensionWorldXZ = min( boxSizeWorld.x, boxSizeWorld.z )","vec3 edgeRoundAmount = uEdgeRoundness * vec3( boxMinDimensionWorldXZ, min( boxMinDimensionWorldXZ, boxSizeWorld.y ), boxMinDimensionWorldXZ )","posWorld = posWorld + aEdge * edgeRoundAmount")]})},ColorGrid2D:t=>{const e=t.flipXY,i=t.intensityTextureType,s=t.littleEndian;return{idFeature:"ColorGrid2D",apply:(r,n)=>({idVertex:void 0,idFragment:`ColorGrid2D:${$g(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[Vg("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&Gg.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?Pg("vec2 cellSizePx = uTileBounds.zw / (uTileDimensions - 1.0)","vec2 cellIndex = (gl_FragCoord.xy - uTileBounds.xy) / cellSizePx","vec2 cellStart = floor(cellIndex)","vec2 cellEnd = ceil(cellIndex)","vec2 cellStartNormalized = cellStart / (uTileDimensions - 1.0)","vec2 cellEndNormalized = cellEnd / (uTileDimensions - 1.0)",`vec4 sample00 = texture2D(uTileIntensityValues, ${e?"cellStartNormalized":"vec2(cellStartNormalized.y, cellStartNormalized.x)"})`,`vec4 sample01 = texture2D(uTileIntensityValues, ${e?"vec2(cellStartNormalized.x, cellEndNormalized.y)":"vec2(cellStartNormalized.y, cellEndNormalized.x)"})`,`vec4 sample10 = texture2D(uTileIntensityValues, ${e?"vec2(cellEndNormalized.x, cellStartNormalized.y)":"vec2(cellEndNormalized.y, cellStartNormalized.x)"})`,`vec4 sample11 = texture2D(uTileIntensityValues, ${e?"cellEndNormalized":"vec2(cellEndNormalized.y, cellEndNormalized.x)"})`,"float intensity00 = "+("float"===i?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${s})`),"float intensity01 = "+("float"===i?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${s})`),"float intensity10 = "+("float"===i?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${s})`),"float intensity11 = "+("float"===i?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${s})`),"vec2 lerpFactors = cellIndex - cellStart",`float intensityR1 = mix(intensity00, intensity10, ${e?"lerpFactors.x":"lerpFactors.y"})`,`float intensityR2 = mix(intensity01, intensity11, ${e?"lerpFactors.x":"lerpFactors.y"})`,`float intensityP = mix(intensityR1, intensityR2, ${e?"lerpFactors.y":"lerpFactors.x"})`):Pg("vec2 cellSizePx = uTileBounds.zw / (uTileDimensions)","vec2 cellIndex = (gl_FragCoord.xy - uTileBounds.xy) / cellSizePx","vec2 cellIndexNormalized = cellIndex / uTileDimensions",`vec4 sample0 = texture2D(uTileIntensityValues, ${e?"cellIndexNormalized":"vec2(cellIndexNormalized.y, cellIndexNormalized.x)"})`,"float intensityP = "+("float"===i?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${s})`)),...Yg("intensityP",t.lut)]})}},DrawToNormalTexture:t=>{const e=t.flipXZ,i=t.vertexIdSource,s=t.normalTextureType,r=t.heightmapTextureType,n=t.littleEndian;return{idFeature:"DrawToNormalTexture",apply:(o,h)=>{const a=[],l=[];return a.push(Vg("uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB","attribute"===i&&"attribute float aVertexID"),void 0!==i&&Gg.roundUnsigned,Gg.modulus,Gg.texelFetchWithFallback[h],"ubyte"===r&&Gg.decodeUbyteRGBAEncodedFloat,Pg(void 0===i?"int iVertex = gl_VertexID":"int iVertex = int(roundUnsigned(aVertexID))","int iSecondary = modulus(iVertex, (uTileDimensions.y - 1))","int iPrimary = iVertex / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 uTileDimensionsMinus1 = vec2(uTileDimensions) - 1.0","vec2 halfTexelWorld = 2.0 / (uTileDimensionsMinus1 * 2.0)","vec2 posWorld = vec2(-1.0 + halfTexelWorld.y + iCell.y * 2.0 * halfTexelWorld.y, -1.0 + halfTexelWorld.x + iCell.x * 2.0 * halfTexelWorld.x)","vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)",`vec3 posAxis0 = vec3(\n uTileStartLocationAxisXZ.x + iCell.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`} ,\n uTileStartLocationAxisXZ.y + iCell.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell1 = iCell + vec2(1.0, 0.0)",`vec3 posAxis1 = vec3(\n uTileStartLocationAxisXZ.x + iCell1.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`},\n uTileStartLocationAxisXZ.y + iCell1.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell2 = iCell + vec2(0.0, 1.0)",`vec3 posAxis2 = vec3(\n uTileStartLocationAxisXZ.x + iCell2.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`},\n uTileStartLocationAxisXZ.y + iCell2.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell3 = iCell + vec2(1.0, 1.0)",`vec3 posAxis3 = vec3(\n uTileStartLocationAxisXZ.x + iCell3.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`},\n uTileStartLocationAxisXZ.y + iCell3.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec3 normal = normalize(cross(posAxis2 - posAxis0, posAxis1 - posAxis0) + cross(posAxis1 - posAxis3, posAxis2 - posAxis3))","uint"===s?"vNormalRGB = uvec3(((normal / 2.0) + 0.5) * float(-1u))":"vNormalRGB = (normal / 2.0) + 0.5","gl_PointSize = 1.0")),l.push(Vg("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),Pg("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${$g(t)}`,idFragment:`DrawToNormalTexture:${$g(t)}`,vertexShaderModifiers:a,fragmentShaderModifiers:l,fragmentShader:"Empty",hints:["uint"===s&&{type:"fragOutput",fragOutput:"uvec4"}]}}}},SurfaceGrid:t=>{const e=t.fillColor,i=t.interpolation,s=t.flipXZ,r=t.shadingStyle,n=t.wireframe,o=t.instanceIdSource,h=t.normalTextureType,a=t.heightmapTextureType,l=t.intensityTextureType,u=t.littleEndian;return{idFeature:"SurfaceGrid",apply:(c,d)=>{const f=[],g=[];return f.push(Vg("attribute vec2 aGeoCellOffset","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","attribute"===o&&"attribute float aInstanceID"),void 0!==o&&Gg.roundUnsigned,Gg.modulus,Gg.texelFetchWithFallback[d],"ubyte"===a&&Gg.decodeUbyteRGBAEncodedFloat,Pg(void 0===o?"int iInstance = gl_InstanceID":"int iInstance = int(roundUnsigned(aInstanceID))","iInstance = iInstance + uBaseInstance","int iSecondary = modulus(iInstance, (uTileDimensions.y - 1))","int iPrimary = iInstance / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 iCellVertex = iCell + aGeoCellOffset","vec2 uTileDimensionsMinus1 = vec2(float(uTileDimensions.x), float(uTileDimensions.y)) - 1.0","vec2 ySampleCoordinate = vec2(iCellVertex.y, iCellVertex.x) / vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x)","float y = "+("float"===a?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${u})`),"vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)","vec2 posAxisXZ = uTileStartLocationAxisXZ + cellSizeAxis * "+(s?"vec2(iCellVertex.y, iCellVertex.x)":"iCellVertex"),"vec3 posAxis = vec3(posAxisXZ.x, y, posAxisXZ.y)")),f.push(...Jg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&f.push(Ug("posWorld","varying vec3 vPosWorld"),..."uint"===h?[Gg.texelFetchUnsignedWithFallback[d],Ng("vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Ng("vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Ng("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),Vg("varying vec3 vNormal",..."uint"===h?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),g.push(Vg("varying vec3 vTriangleBary")),"uniform"===e?g.push(Vg("uniform vec4 uColorDiffuse"),Pg("vec4 colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]?"value"===e[1]?(f.push(Ug("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),g.push(Vg("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===l&&Gg.decodeUbyteRGBAEncodedFloat,"bilinear"===i?Pg("vec2 cellSizeAxisXZ = uTileBoundsAxisXZ.zw / (uTileDimensionsXZ - 1.0)","vec2 cellIndex = (vVertexLocationAxisXZ - uTileBoundsAxisXZ.xy) / cellSizeAxisXZ","vec2 cellStart = floor(cellIndex)","vec2 cellEnd = ceil(cellIndex)","vec2 cellStartNormalized = cellStart / (uTileDimensionsXZ - 1.0)","vec2 cellEndNormalized = cellEnd / (uTileDimensionsXZ - 1.0)",`vec4 sample00 = texture2D(uTileIntensityValues, ${s?"cellStartNormalized":"vec2(cellStartNormalized.y, cellStartNormalized.x)"})`,`vec4 sample01 = texture2D(uTileIntensityValues, ${s?"vec2(cellStartNormalized.x, cellEndNormalized.y)":"vec2(cellStartNormalized.y, cellEndNormalized.x)"})`,`vec4 sample10 = texture2D(uTileIntensityValues, ${s?"vec2(cellEndNormalized.x, cellStartNormalized.y)":"vec2(cellEndNormalized.y, cellStartNormalized.x)"})`,`vec4 sample11 = texture2D(uTileIntensityValues, ${s?"cellEndNormalized":"vec2(cellEndNormalized.y, cellEndNormalized.x)"})`,"float intensity00 = "+("float"===l?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${u})`),"float intensity01 = "+("float"===l?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${u})`),"float intensity10 = "+("float"===l?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${u})`),"float intensity11 = "+("float"===l?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${u})`),"vec2 lerpFactors = cellIndex - cellStart",`float intensityR1 = mix(intensity00, intensity10, ${s?"lerpFactors.x":"lerpFactors.y"})`,`float intensityR2 = mix(intensity01, intensity11, ${s?"lerpFactors.x":"lerpFactors.y"})`,`float intensityP = mix(intensityR1, intensityR2, ${s?"lerpFactors.y":"lerpFactors.x"})`):Pg("vec2 cellSizeAxisXZ = uTileBoundsAxisXZ.zw / (uTileDimensionsXZ - 1.0)","vec2 cellIndex = floor((vVertexLocationAxisXZ - uTileBoundsAxisXZ.xy) / cellSizeAxisXZ)","vec2 cellIndexNormalized = cellIndex / (uTileDimensionsXZ - 1.0)",`vec4 sample0 = texture2D(uTileIntensityValues, ${s?"cellIndexNormalized":"vec2(cellIndexNormalized.y, cellIndexNormalized.x)"})`,"float intensityP = sample0.x"),...Yg("intensityP",e[2]))):(f.push(Ug(`posAxis.${e[1]}`,"varying float vLookupValue")),g.push(Vg("varying float vLookupValue"),...Yg("vLookupValue",e[2]))):void 0===e&&g.push(Pg("vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0)")),"phong"===r&&g.push(...Wg),n&&(f.push(Vg("attribute vec3 aTriangleBary"),Ug("aTriangleBary","varying vec3 vTriangleBary")),g.push(Vg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Gg.computeScreenSpaceWireframe,zg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)",e?"if (edge > 0.0) {\n colorFragment = vec4(mix(colorFragment.rgb, uWireframeColor.rgb, edge * uWireframeColor.a), max(colorFragment.a, uWireframeColor.a));\n }":"if (edge > 0.0) {\n colorFragment = uWireframeColor;\n } else {\n discard;\n }"))),{idVertex:`SurfaceGrid:${$g(t)}`,idFragment:`SurfaceGrid:${$g(t)}`,vertexShaderModifiers:f,fragmentShader:"FragmentShader",fragmentShaderModifiers:g}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${$g(t)}`,idFragment:`DebugSurfaceGridNormals:${$g(t)}`,vertexShaderModifiers:[Vg("attribute float aNormalArrow","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","attribute"===t.instanceIdSource&&"attribute float aInstanceID",..."uint"===t.normalTextureType?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"]),Gg.roundUnsigned,Gg.modulus,Gg.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&Gg.decodeUbyteRGBAEncodedFloat,Pg(void 0===t.instanceIdSource?"int iInstance = gl_InstanceID":"int iInstance = int(roundUnsigned(aInstanceID))","iInstance = iInstance + uBaseInstance","int iSecondary = modulus(iInstance, (uTileDimensions.y - 1))","int iPrimary = iInstance / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 uTileDimensionsMinus1 = vec2(float(uTileDimensions.x), float(uTileDimensions.y)) - 1.0","float y00 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y01 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y10 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y11 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y = (y00 + y01 + y10 + y11) / 4.0","vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)",`vec2 posAxisXZ = uTileStartLocationAxisXZ + cellSizeAxis * (0.5 + ${t.flipXZ?"vec2(iCell.y, iCell.x)":"iCell"})`,"vec3 posAxis = vec3(posAxisXZ.x, y, posAxisXZ.y)",..."uint"===t.normalTextureType?["vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)"]:["vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))"],"vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vec3 normalWorld = normalize(normalAxis * uScale)"),..."uint"===t.normalTextureType?[Gg.texelFetchUnsignedWithFallback[i]]:[],...Jg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),zg("posWorld =","vec3 dirArrow = normalWorld","vec3 posArrowStart = posWorld","vec3 posArrowEnd = posWorld + dirArrow * 0.010","vec3 notParallel = normalize(mix( vec3( 0.0, 1.0, 0.0 ), vec3( 0.2, 0.8, 0.0 ), step( abs(dirArrow.y), 0.9 ) ))","vec3 dirArrowLeft = normalize(-dirArrow + 0.50 * normalize(cross(dirArrow, notParallel)))","vec3 dirArrowRight = normalize(-dirArrow + 0.50 * normalize(cross(notParallel, dirArrow)))","vec3 posArrowLeft = posArrowEnd + dirArrowLeft * 0.0025","vec3 posArrowRight = posArrowEnd + dirArrowRight * 0.0025","if (aNormalArrow == 0.0) {\n posWorld = posArrowStart;\n } else if (aNormalArrow == 1.0) {\n posWorld = posArrowEnd;\n } else if (aNormalArrow == 2.0) {\n posWorld = posArrowLeft;\n } else if (aNormalArrow == 3.0) {\n posWorld = posArrowRight;\n }")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Ng("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",apply:t=>({idVertex:"OffsetTowardsCamera",idFragment:void 0,vertexShaderModifiers:[Vg("uniform vec3 uCameraLoc"),zg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[Vg("attribute float aSegmentInside"),Vg("varying float vSegmentInside"),Vg("varying float vSegmentSide"),zg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[Og("#extension GL_OES_standard_derivatives : enable"),Vg("uniform float uAALimit"),Vg("varying float vSegmentInside"),Vg("varying float vSegmentSide"),zg("antiAliasFactor = ","\n float dist = (uAALimit - vSegmentInside);\n vec2 ddist = vec2(dFdx(dist), dFdy(dist));\n float pixelDist = dist / length(ddist);\n // additional blurring\n pixelDist *= 0.5;\n\n float aa = clamp(0.5 - pixelDist, 0.0, 1.0);\n if((vSegmentSide <= 0.0 || vSegmentSide >= 1.0) && aa <=0.99){\n aa *= 0.5;\n }\n antiAliasFactor = aa;\n ")]})},Glow1D:t=>({idFeature:"Glow1D",apply:()=>{const e=Math.round(t.spreadPx),i=Math.round(t.blurPx),s=e+i,r=t.firstPass,n=[];for(let t=-s;t<=s;t+=1){const e=Math.abs(t);n.push(r?{x:t.toFixed(1),y:"0.0",distPx:e.toFixed(1)}:{x:"0.0",y:t.toFixed(1),distPx:e.toFixed(1)})}return{idVertex:`Glow1D:${$g(t)}`,idFragment:`Glow1D:${$g(t)}`,vertexShaderModifiers:[Ug("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Vg("uniform sampler2D uTexture"),Vg("varying vec2 vTextureCoord"),Vg("uniform vec2 uTextureSize"),r&&Vg("uniform vec2 uOffsetPx"),!r&&Vg("uniform sampler2D uTextureFirstGlowPass"),!r&&Vg("uniform vec4 uGlowColor"),zg("antiAliasFactor =","vec2 oneTexel = vec2(1.0, 1.0) / uTextureSize",...r?[]:["float inverseIntensity =\n 0.25 * texture2D(uTexture, vTextureCoord).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, 0.0)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, 0.0)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(0.0, -oneTexel.y)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(0.0, oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, -oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, -oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, oneTexel.y)).a","antiAliasFactor *= 1.0 - (inverseIntensity * inverseIntensity)","if (antiAliasFactor <= 0.0) { discard; }"],"float distancePx = 255.0","vec2 sample_tx = vec2(0.0)",...r?["vec2 texCoordOffset = vTextureCoord - uOffsetPx * oneTexel",...n.map(((t,e)=>[`sample_tx = texCoordOffset + oneTexel * vec2(${t.x}, ${t.y})`,`if (distancePx > ${t.distPx} && sample_tx.x <= 1.0 && sample_tx.y <= 1.0 && sample_tx.x >= 0.0 && sample_tx.y >= 0.0 && texture2D(uTexture, sample_tx).a > 0.0) { distancePx = ${t.distPx}; }`])).flat(),"vec4 colorFragment = vec4(distancePx / 255.0, 0.0, 0.0, 1.0)"]:["vec4 sample_horizontal = vec4(0.0)","float horizontal_dist = 255.0","float min_horizontal_dist = 255.0",...n.map(((t,e)=>[`sample_tx = vTextureCoord + oneTexel * vec2(${t.x}, ${t.y})`,"if (sample_tx.x <= 1.0 && sample_tx.y <= 1.0 && sample_tx.x >= 0.0 && sample_tx.y >= 0.0) {\n sample_horizontal = texture2D(uTextureFirstGlowPass, sample_tx);\n horizontal_dist = sample_horizontal.r * 255.0;\n }","if (sample_horizontal.a < 0.9) { horizontal_dist = 255.0; }","min_horizontal_dist = min(min_horizontal_dist, horizontal_dist)",`distancePx = min(distancePx, pow(horizontal_dist * horizontal_dist + ${t.y} * ${t.y}, 0.5))`])).flat(),`if (distancePx > ${s.toFixed(1)}) { discard; }`,"vec4 pixelGlowColor = vec4(0.0, 0.0, 0.0, 0.0)",`if (distancePx > ${e.toFixed(1)}) {\n float lerpAmount = (distancePx - ${e.toFixed(1)}) / ${(i+1).toFixed(1)};\n pixelGlowColor = mix(uGlowColor, vec4(uGlowColor.rgb, 0.0), 1.0 - (1.0 - lerpAmount) * (1.0 - lerpAmount));\n } else {\n pixelGlowColor = uGlowColor;\n }`,"vec4 colorFragment = pixelGlowColor"])]}}}),MousePicking:{idFeature:"MousePicking",apply:t=>({idVertex:void 0,idFragment:"MousePicking",fragmentShaderModifiers:[Vg("uniform vec4 uColor"),Pg("vec4 colorFragment = uColor"),t=>t.replace("gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor)","if (antiAliasFactor <= 0.0) { discard; }\ngl_FragColor = fragColorEnd")]})},MousePickingAttribute:{idFeature:"MousePickingAttribute",apply:t=>({idVertex:"MousePickingAttribute",idFragment:"MousePickingAttribute",vertexShaderModifiers:[Ug("attribute vec4 aColor","varying vec4 vColor")],fragmentShaderModifiers:[Vg("varying vec4 vColor"),Pg("vec4 colorFragment = vColor"),t=>t.replace("gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor)","if (antiAliasFactor <= 0.0) { discard; }\ngl_FragColor = fragColorEnd")]})},AttributeHighlight:{idFeature:"AttributeHighlight",apply:t=>({idVertex:"AttributeHighlight",idFragment:"AttributeHighlight",vertexShaderModifiers:[Ug("attribute float aIsHighlighted","varying float vIsHighlighted")],fragmentShaderModifiers:[t=>t.replace("uniform float uIsHighlighted","varying float vIsHighlighted").replace("uIsHighlighted","vIsHighlighted")]})},StippleTexture:{idFeature:"StippleTexture",apply:(t,e)=>({idVertex:"StippleTexture",idFragment:"StippleTexture",vertexShaderModifiers:[Vg("attribute vec2 aLengthSoFar"),Vg("varying float vLengthSoFar"),Vg("uniform vec2 uStippleCount"),Ng("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Vg("uniform sampler2D uStippleTexture"),Vg("uniform float uStippleScale"),Vg("varying float vLengthSoFar"),"webgl1"===e&&Vg("uniform float uStippleTextureWidthLimiter"),zg("antiAliasFactor = ",`\n float stippleSampleY = texture2D(\n uStippleTexture, \n ${"webgl1"===e?"vec2(mod((vLengthSoFar / uStippleScale) , uStippleTextureWidthLimiter), 0)":"vec2((vLengthSoFar / uStippleScale), 0)"}\n ).r;\n float stippleAA = (stippleSampleY - 0.5) * 2.0;\n antiAliasFactor *= stippleAA;\n if (antiAliasFactor <= 0.0) { discard; }`)]})},StippleTextureInstanced:{idFeature:"StippleTextureInstanced",apply:(t,e)=>({idVertex:"StippleTextureInstanced",idFragment:"StippleTextureInstanced",vertexShaderModifiers:[Vg("attribute vec2 aLengthSoFarA"),Vg("attribute vec2 aLengthSoFarB"),Vg("varying float vLengthSoFar"),Vg("uniform vec2 uStippleCount"),Ng("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Vg("uniform sampler2D uStippleTexture"),Vg("uniform float uStippleScale"),Vg("varying float vLengthSoFar"),"webgl1"===e&&Vg("uniform float uStippleTextureWidthLimiter"),zg("antiAliasFactor = ",`\n float stippleSampleY = texture2D(\n uStippleTexture, \n ${"webgl1"===e?"vec2(mod((vLengthSoFar / uStippleScale) , uStippleTextureWidthLimiter), 0)":"vec2((vLengthSoFar / uStippleScale), 0)"}\n ).r;\n float stippleAA = (stippleSampleY - 0.5) * 2.0;\n antiAliasFactor *= stippleAA;\n if (antiAliasFactor <= 0.0) { discard; }`)]})},PolarHeatmap:t=>({idFeature:"PolarHeatmap",apply:(e,i)=>{const s="dataType"in t,r="interpolation"in t?t:void 0,n="bilinear"===(null==r?void 0:r.interpolation),o=null==r?void 0:r.intensityTextureType,h=null==r?void 0:r.littleEndian;return{idVertex:void 0,idFragment:`PolarHeatmap:${$g(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[Vg("uniform vec2 uViewportSize","uniform vec2 uScale","uniform vec2 uDisp","uniform float uSectors","uniform float uAnnuli","uniform float uAmplitudeStart","uniform float uAmplitudeStep","uniform float uAmplitudeAxisStart","uniform float uAmplitudeAxisEnd","uniform float uAngleOffset","uniform float uAngleDirection",r&&"uniform sampler2D uTileIntensityValues",s&&"uniform vec4 uColor"),Gg.texelFetchWithFallback[i],"ubyte"===o&&Gg.decodeUbyteRGBAEncodedFloat,Pg("vec2 posWorld = (2.0 * gl_FragCoord.xy / uViewportSize) - 1.0","vec2 posAxis = posWorld * uScale + uDisp","float amplitudeAxisInterval = uAmplitudeAxisEnd - uAmplitudeAxisStart","float amplitude = uAmplitudeAxisStart + sign(amplitudeAxisInterval) * sqrt(posAxis.x * posAxis.x + posAxis.y * posAxis.y)","float iAnnulus = (amplitude - uAmplitudeStart) / uAmplitudeStep","if (iAnnulus < 0.0 || iAnnulus > uAnnuli) { discard; }"),s&&Pg("vec4 colorFragment = uColor"),r&&zg("if (iAnnulus","float angRad = atan(posAxis.y, posAxis.x) * uAngleDirection + uAngleOffset","if (angRad < 0.0) { angRad = angRad + 2.0 * 3.1415926538; }","if (angRad > 2.0 * 3.1415926538) { angRad = angRad - 2.0 * 3.1415926538; }","float iSector = uSectors * angRad / (2.0 * 3.1415926538)","vec2 cellIndex = vec2(iSector, iAnnulus)","ivec2 cellStart = ivec2(floor(cellIndex))","ivec2 cellEnd = cellStart + ivec2(1)","if (cellEnd.x >= int(uSectors)) { cellEnd = ivec2(0, cellEnd.y); }",r.flipXY&&"cellIndex = vec2(cellIndex.y, cellIndex.x)",r.flipXY&&"cellStart = ivec2(cellStart.y, cellStart.x)",r.flipXY&&"cellEnd = ivec2(cellEnd.y, cellEnd.x)","vec2 tileDimensions = "+(r.flipXY?"vec2(uAnnuli, uSectors)":"vec2(uSectors, uAnnuli)"),n&&"vec4 sample00 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",n&&"vec4 sample01 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellStart.x, cellEnd.y), tileDimensions)",n&&"vec4 sample10 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellEnd.x, cellStart.y), tileDimensions)",n&&"vec4 sample11 = texelFetchWithFallback(uTileIntensityValues, cellEnd, tileDimensions)",n&&"float intensity00 = "+("float"===o?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${h})`),n&&"float intensity01 = "+("float"===o?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${h})`),n&&"float intensity10 = "+("float"===o?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${h})`),n&&"float intensity11 = "+("float"===o?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${h})`),n&&"vec2 lerpFactors = cellIndex - vec2(cellStart)",n&&"float intensityR1 = mix(intensity00, intensity10, lerpFactors.x)",n&&"float intensityR2 = mix(intensity01, intensity11, lerpFactors.x)",n&&"float intensityP = mix(intensityR1, intensityR2, lerpFactors.y)",!n&&"vec4 sample0 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",!n&&"float intensityP = "+("float"===o?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${h})`)),...r?Yg("intensityP",r.lut):[]]}}})},im={"2D":"\nvoid main(void) {\n gl_Position = vec4(posWorld, 0.0, 1.0 );\n}\n","2DMatrix":"\nvoid main(void) {\n gl_Position = posWorld;\n}\n","3D":"\nuniform mat4 uViewProjectionMatrix;\nvoid main(void) {\n gl_Position = uViewProjectionMatrix * vec4(posWorld, 1.0);\n}\n"},sm={FragmentShader:"\nuniform float uIsHighlighted;\nuniform vec4 uHighlightColorOffset;\nuniform float uRenderEffectMask;\nvoid main(void) {\n float antiAliasFactor = 1.0;\n vec4 fragColorEnd = colorFragment;\n if (fragColorEnd.a <= 0.0) { discard; }\n fragColorEnd = clamp(fragColorEnd + uIsHighlighted * uHighlightColorOffset, vec4(0.0), vec4(1.0));\n fragColorEnd = mix(fragColorEnd, vec4(1.0), uRenderEffectMask * fragColorEnd.a * 1000.0);\n gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor);\n}\n",Empty:"\nvoid main(void) {\n}\n"};class rm{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new pt(`Could not find ${this.oE()} ${this.aE()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}oE(){return this.id.toString()}aE(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class nm extends rm{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class om extends rm{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class hm{constructor(t,e,i,s){this.lE=new Map,this.uE=new Map,this.cE=i,this.dE=i.createProgram(),this.fE=`${t.oE()} vertex`,this.AE=`${e.oE()} fragment`,i.attachShader(this.dE,t.shader),i.attachShader(this.dE,e.shader),i.bindAttribLocation(this.dE,0,"aPos"),i.linkProgram(this.dE),i.deleteShader(t.shader),i.deleteShader(e.shader),this.allAttributeNames=t.info.allAttributeNames,this.allUniformNames=Array.from(new Set(t.info.allUniformNames.concat(e.info.allUniformNames)).values()),this.vertexSharedRemovedVariables=t.info.removedVariableNames,this.fragmentSharedRemovedVariables=e.info.removedVariableNames}get vertexShaderSrc(){return""}get fragmentShaderSrc(){return""}gE(t){return me(0,(()=>ye()))}pE(t){const e=this.mE(t);if(void 0===e)throw this.gE(`Could not get ${t} uniform from ${this.fE} and ${this.AE} shaders.`);return e}mE(t){const e=this.lE.get(t);if(e)return e;const i=this.cE.getUniformLocation(this.dE,t);return i?(this.lE.set(t,i),i):void 0}yE(t){const e=this.SE(t);if(void 0===e)throw this.gE(`Could not get ${t} attribute from ${this.fE} and ${this.AE} shaders.`);return e}SE(t){const e=this.uE.get(t);if(e||0===e)return e;const i=this.cE.getAttribLocation(this.dE,t);return i>=0?(this.uE.set(t,i),i):void 0}U(){this.cE.deleteProgram(this.dE)}}const am=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/,lm=t=>{let e;try{e=bt.getComputedStyle(t)}catch(t){return null}return e};function um(t){const e=lm(t);return!!e&&("fixed"===e.position||!!("auto"!==e.zIndex&&"static"!==e.position||function(t){const e=lm(gm(t)),i=e?e.display:"auto";return"flex"===i||"inline-flex"===i}(t))||+e.opacity<1||"transform"in e&&"none"!==e.transform||"webkitTransform"in e&&"none"!==e.webkitTransform||"mixBlendMode"in e&&"normal"!==e.mixBlendMode||"filter"in e&&"none"!==e.filter||"webkitFilter"in e&&"none"!==e.webkitFilter||"isolation"in e&&"isolate"===e.isolation||!!am.test(e.willChange)||"touch"===e.webkitOverflowScrolling)}function cm(t){let e=t.length;for(;e--;)if(um(t[e]))return t[e];return null}function dm(t){var e;return t&&Number((null===(e=lm(t))||void 0===e?void 0:e.zIndex)||0)||0}function fm(t){const e=[];for(;t;)e.push(t),t=gm(t);return e}function gm(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.host)||t.parentNode}class mm extends xg{constructor(t){if(super(),this.vE=new Map,this.xE=new Map,this.bE=new Map,this.ME=!0,this._E=null,this.wE=null,this.CE=null,this.kE=null,this.TE=0,this.FE=0,this.IE=0,this.PE=!1,this.DE=!0,this.Xi=!1,this.BE=ce(`chart-engine-${(new Date).getTime()}${Math.trunc(1e6*Math.random()).toString()}`),this.j={x:100,y:100},this.LE=()=>{this.RE&&clearTimeout(this.RE),this.RE=setTimeout((()=>this.Qr()),12)},this.EE=t=>{const e=t.intersectionRatio>0,i=t.target.getAttribute("data-lcjs-engine-id");if(i){const t=this.vE.get(i);if(t){const s=t.zE();t.VE(e),e?this.xE.set(i,t):this.xE.delete(i),s!==e&&t.vs()}}},this.OE=(t,e,i,s,r)=>{const n=r[0],o=this.gl;if(o.bindFramebuffer(null==o?void 0:o.FRAMEBUFFER,null),o.useProgram(this.wE.dE),o.clear(o.COLOR_BUFFER_BIT),n.Wr.getBoundingClientRect()){const t=n.NE();o.viewport(0,0,t.x,t.y),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.GE),o.uniform1i(this.TE,0),o.uniformMatrix4fv(this.FE,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o.bindBuffer(o.ARRAY_BUFFER,this.CE),o.enableVertexAttribArray(0),o.vertexAttribPointer(this.IE,2,o.FLOAT,!1,0,0),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),n.WE&&(n.WE.clearRect(0,0,n.WE.canvas.width,n.WE.canvas.height),n.WE.drawImage(this.UE,0,this.UE.height-t.y,t.x,t.y,0,0,n.WE.canvas.width,n.WE.canvas.height))}},this.YE=(t,e,i,s,r)=>{const n=this.gl;n.bindFramebuffer(null==n?void 0:n.FRAMEBUFFER,null),n.useProgram(this.wE.dE),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.Wr.getBoundingClientRect();if(r){const i=r.right-r.left,o=r.bottom-r.top,h=r.left,a=s-r.bottom;n.viewport(h*this.HE-t*this.HE,a*this.HE+e*this.HE,i*this.HE,o*this.HE)}n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,i.GE),n.uniform1i(this.TE,0),n.uniformMatrix4fv(this.FE,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),n.bindBuffer(n.ARRAY_BUFFER,this.CE),n.enableVertexAttribArray(0),n.vertexAttribPointer(this.IE,2,n.FLOAT,!1,0,0),n.drawArrays(n.TRIANGLES,0,6)})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.$E=(t,e,i,s,r)=>{const n=r[0],o=this.gl2.ctx;o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),o.clear(o.COLOR_BUFFER_BIT);const h=n.NE();o.bindFramebuffer(o.READ_FRAMEBUFFER,n.XE[1]),o.blitFramebuffer(0,0,h.x,h.y,0,this.UE.height-h.y,h.x,this.UE.height,o.COLOR_BUFFER_BIT,o.LINEAR),n.WE&&(n.WE.clearRect(0,0,n.WE.canvas.width,n.WE.canvas.height),n.WE.drawImage(this.UE,0,0)),o.bindFramebuffer(o.FRAMEBUFFER,null)},this.jE=(t,e,i,s,r)=>{const n=this.gl2.ctx;n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.Wr.getBoundingClientRect();if(r){const o=r.right-r.left,h=r.bottom-r.top,a=r.left,l=s-r.bottom,u=i.NE();n.bindFramebuffer(n.READ_FRAMEBUFFER,i.XE[1]),n.blitFramebuffer(0,0,u.x,u.y,a*this.HE-t*this.HE,l*this.HE+e*this.HE,(a-t+o)*this.HE,(l+e+h)*this.HE,n.COLOR_BUFFER_BIT,n.LINEAR)}})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.RE=void 0,this.Yn=t,!bt.requestAnimationFrame||!bt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");let e=1;if(t&&t.ZE)e=!0===t.ZE?bt.devicePixelRatio||1:t.ZE||1;else{const t=bt.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(e=bt.devicePixelRatio||1)}this.HE=e,t.$n=!0===t.$n,this.DE=!1!==t.QE,this.JE=!1!==t.KE,this.qE=t.qE||!1;let i=!1;if(t.UE)if("string"==typeof t.UE){const e=bt.document.getElementById(t.UE);if(!e)throw new Error(`Canvas "${t.UE}" doesn't exist.`);this.UE=e,i=!0}else this.UE=t.UE,i=!0;else this.UE=bt.document.createElement("canvas");const s={preserveDrawingBuffer:!0,alpha:!0,antialias:!1};if(2!==t.tz&&t.tz){const e=this.UE.getContext("webgl",{...s,antialias:!!t.QE})||this.UE.getContext("experimental-webgl",{...s,antialias:!!t.QE});this.gl=e,this.iz=!1}else{const t=this.UE.getContext("webgl2",s);this.gl2={ctx:t},this.gl=t,this.iz=!0}if(!this.gl)throw new yt("No WebGL context available."+((null==t?void 0:t.tz)?`\nSelected explicit target: WebGL ${t.tz}`:""));const r=[];if(this.sz={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.sz).forEach((t=>{null===this.sz[t]&&r.push(t)})),this.iz)this.ez=!0;else{const t={ANGLE_instanced_arrays:this.gl.getExtension("ANGLE_instanced_arrays"),EXT_blend_minmax:this.gl.getExtension("EXT_blend_minmax"),OES_element_index_uint:this.gl.getExtension("OES_element_index_uint"),OES_standard_derivatives:this.gl.getExtension("OES_standard_derivatives"),OES_vertex_array_object:this.gl.getExtension("OES_vertex_array_object")};t.OES_standard_derivatives||(this.ME=!1),Object.keys(t).forEach((e=>{null===t[e]&&r.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.ez=!!e.OES_texture_float,this.gl1={ctx:this.gl,sz:t,optional:e}}const n=r;if(n.length>0&&!1!==t.$n){const t=bt.document.createElement("div");t.innerText="LightningChart JS: Some features might not work properly, due to missing WebGL features.",t.style.cssText="position:absolute;top:0;background:red;width:100%;padding:10px;text-align:center;color:white;z-index:1;";const e=bt.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),bt.document.body.appendChild(t),t.appendChild(e),bt.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",n.join(", "))}if(this.hz=this.qE?this.rz(this.iz?this.$E.bind(this):this.OE.bind(this)).bind(this):this.nz(this.iz?this.jE.bind(this):this.YE.bind(this)).bind(this),bt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.UE&&this.oz()};this.Qn=new bt.ResizeObserver(t.bind(this)),this.Qn.observe(this.UE)}if(this.az=((t,e)=>{const i=t,s=new Map,r=new Map,n=new Map,o={totalMs:0,vertexShaders:0,fragmentShaders:0,programs:0},h=(t,i,s=[])=>{const r=[],n=[],o={allAttributeNames:Array.from(t.matchAll(/attribute\s[^\s]*\s(.*);/g)).map((t=>t[1])),allUniformNames:Array.from(t.matchAll(/uniform\s[^\s]*\s(.*);/g)).map((t=>t[1])),allVaryingNames:Array.from(t.matchAll(/varying\s[^\s]*\s(.*);/g)).map((t=>t[1])),removedVariableNames:[]};if(e){const e=t.match(/#extension.*/g);e&&n.push(...e),t=t.replace(/#extension.*/g,"")}else if(r.push("#version 300 es"),(t=(t=(t=t.replace(/#extension.*/g,"")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).includes("usampler2D")&&r.push("precision highp usampler2D;"),"vertex"===i)t=t.replace(/varying/g,"out");else{t=t.replace(/varying/g,"in");const e=s.find((t=>"fragOutput"===t.type));t=(t=e?`out ${e.fragOutput} fragOutput;\n${t}`:`out vec4 fragOutput;\n${t}`).replace(/gl_FragColor/g,"fragOutput")}return n&&r.push(...n),r.push("precision highp float;"),r.push("precision highp int;"),{source:t=`${r.join("\n")}\n${t}`,info:o}};return(...t)=>{const a=e?"webgl1":"webgl2";let l,u,c,d,f,g,m,y,p;try{const e=bt.performance.now();l=t.filter((t=>!1!==t&&void 0!==t)),u=((t,e)=>{const i=t.map((i=>i.apply(t,e))),s=i.map((t=>t.idVertex)).filter((t=>void 0!==t)).sort().join(" "),r=i.map((t=>t.idFragment)).filter((t=>void 0!==t)).sort().join(" "),n=`vert: ${s} frag: ${r}`;let o,h=!1,a=!1;const l=[];let u;const c=[],d=[];if(i.forEach((t=>{if(t.defaultVertexShader&&(h||(o=t.defaultVertexShader)),t.vertexShader){if(o&&h&&o!==t.vertexShader)throw new jg(`Conflicting vertex shader templates ${o} vs ${t.vertexShader}`,n,t);o=t.vertexShader,h=!0}if(t.vertexShaderModifiers)for(const e of t.vertexShaderModifiers)void 0!==e&&!1!==e&&l.push(e);if(t.defaultFragmentShader&&(a||(u=t.defaultFragmentShader)),t.fragmentShader){if(u&&a&&u!==t.fragmentShader)throw new jg(`Conflicting fragment shader templates ${u} vs ${t.fragmentShader}`,n,t);u=t.fragmentShader,a=!0}if(t.fragmentShaderModifiers)for(const e of t.fragmentShaderModifiers)void 0!==e&&!1!==e&&c.push(e);t.hints&&t.hints.forEach((t=>{t&&d.push(t)}))})),!o)throw new jg("No vertex shader template defined",n);if(!u)throw new jg("Fragment shader not defined",n);return{id:n,vertexShader:{id:s,template:o,modifiers:l},fragmentShader:{id:r,template:u,modifiers:c},hints:d}})(l,a);const x=n.get(u.id);if(c="new",x)return c="existing",g=x.vertexShaderSrc,m=x.fragmentShaderSrc,x;const S=u.vertexShader.id;let A=s.get(S);if(A)g=A.src,d="existing";else{d="new";const t=new Fg(u.vertexShader.modifiers).build(im[u.vertexShader.template]),{source:e,info:r}=h(t,"vertex");g=e,y=r,A=new nm(S,e,i,r),s.set(S,A),o.vertexShaders+=1}const v=u.fragmentShader;let b;const M=v.id;if(b=r.get(M),b)m=b.src,f="existing";else{f="new";const t=sm[v.template],e=new Fg([...v.modifiers]).build(t),{source:s,info:n}=h(e,"fragment",u.hints);m=s,p=n,b=new om(M,s,i,n),r.set(M,b),o.fragmentShaders+=1}const E=new hm(A,b,i,u);return n.set(u.id,E),o.programs+=1,o.totalMs+=bt.performance.now()-e,E}catch(t){throw me(0,(()=>{const t="Unexpected LightningChart JS rendering error.\nThis can mean a bug in the library, or that it is simply used in unsupported manner (passing wrong type to method, using disposed component, etc).";return bt.alert(t),new Error(t)}))}}})(this.gl,!this.iz),this.qR=(()=>{const t=bt.document.createElement("canvas"),e=t.getContext("2d",{willReadFrequently:!0});if(!e)throw new yt("Failed to get Text canvas rendering context");return e.fillStyle="#fff",(i,s,r,n)=>{const o=`${s.style} ${s.weight} ${s.size*r}px ${s.family}`;e.font=o,e.textBaseline="alphabetic",e.textAlign="left";const h=e.measureText(i);if(0===h.width)return;const a=void 0!==h.actualBoundingBoxLeft&&void 0!==h.actualBoundingBoxRight?Math.ceil(h.actualBoundingBoxLeft+h.actualBoundingBoxRight):Math.ceil(h.width),l=h.width,c=Math.round(s.size*r),d=void 0!==h.actualBoundingBoxLeft?h.actualBoundingBoxLeft:0;t.width=a>0?a:l,t.height=2*c,e.font=o,e.textBaseline="alphabetic",e.textAlign="left",n?(e.clearRect(0,0,t.width,t.height),e.fillStyle="#fff"):(e.fillStyle="rgba(255,255,255,0)",e.fillRect(0,0,t.width,t.height),e.fillStyle="#000"),e.fillText(i,d,c);const f=e.getImageData(0,0,t.width,t.height);let g=0,m=0;const y=f.width;for(let t=0;t=0;t-=1){for(let e=0;e{for(let e=0;ee/100))})),bt.addEventListener("resize",this.LE,{passive:!0}),!this.iz){if(this.wE=this.az(em["2DCompose"],em.Color({dataType:"texture-coord-calc-gpu"}),em.VertexLocation({axisWorldTranslation:"matrix4",normalSource:void 0,coordType:"vec4"})),!this.wE.dE)throw new yt("Unable to setup composition shader!");const t=this.gl,e=t.getUniformLocation(this.wE.dE,"uColorTexture");if(!e)throw new yt("Unable to setup composition shader! Failed to find uColorTexture");const i=t.getUniformLocation(this.wE.dE,"uMatrix");if(!i)throw new yt("Unable to setup composition shader! Failed to find uMatrix");this.TE=e,this.FE=i,this.IE=t.getAttribLocation(this.wE.dE,"aPos"),this.CE=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.CE),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this.kE=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.kE),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,0,0,1,1,1]),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null)}}rz(t){return e=>{this._E=null;const i=this.gl.canvas,s=Array.from(this.xE.values());this.PE=!1,s.forEach((s=>{const r=s.NE();(this.j.x{this._E=null,"style"in this.gl.canvas&&!this.Yn.fz&&(this.gl.canvas.style.transform=`translateX(${window.scrollX}px) translateY(${window.scrollY}px)`);const i=this.gl.canvas,s=this.UE.clientHeight,r=this.UE.clientWidth;let n=0,o=0;if(i instanceof HTMLCanvasElement){i.width===r*this.HE&&i.height===s*this.HE||(i.width=r*this.HE,i.height=s*this.HE);const t=i.getBoundingClientRect();n=t.x,o=t.y}const h=Array.from(this.xE.values());this.PE=!1,h.sort(((t,e)=>t.Az()-e.Az())).forEach((t=>{t.rn&&t.dz(e)})),t(n,o,r,s,h),this.PE&&this.oz()}}oz(t){return!this.PE&&t&&(this.PE=!0),this._E||this.Xi||(this._E=bt.requestAnimationFrame(this.hz)),this}gz(t){const e=this.BE();return t.Wr.setAttribute("data-lcjs-engine-id",e),this.vE.set(e,t),t.pz(this.vE.size-1),t.VE(!0),this.xE.set(e,t),this.cz&&this.cz.observe(t.Wr),this.RE&&clearTimeout(this.RE),this.RE=setTimeout((()=>this.Qr()),0),this}mz(t){const e=t.Wr.getAttribute("data-lcjs-engine-id");return e?(this.vE.delete(e),this.xE.delete(e),this.cz&&this.cz.unobserve(t.Wr),t.Wr.removeAttribute("data-lcjs-engine-id"),this):this}Qr(){if(this.cz){const t=this.cz.takeRecords();for(let e=0;efunction(t,e){if(t===e)throw new Error("Cannot compare node with itself");const i={a:fm(t),b:fm(e)};let s;for(;i.a[i.a.length-1]===i.b[i.b.length-1];)t=i.a.pop(),e=i.b.pop(),s=t;const r=dm(cm(i.a)),n=dm(cm(i.b));if(r===n&&s){const t=s.childNodes,e={a:i.a[i.a.length-1],b:i.b[i.b.length-1]};let r=t.length;for(;r--;){const i=t[r];if(i===e.a)return 1;if(i===e.b)return-1}}return Math.sign(r-n)}(t.Wr,e.Wr))).forEach(((t,e)=>t.pz(e))),this.oz(!0),this}fP(){return this.oz(),this}yz(){this.Xi||this.vE.forEach((t=>t.hp.layout()))}U(){var t;if(this.Xi)return;this.Xi=!0,super.U(),this._E&&(bt.cancelAnimationFrame(this._E),this._E=null),this.PE=!1,this.Qn&&(this.Qn.disconnect(),this.Qn=void 0),this.cz&&(this.cz.disconnect(),this.cz=void 0),bt.removeEventListener("resize",this.LE),this.LE=void 0,this.vE.forEach((t=>{t.U()})),this.vE.clear(),Array.from(this.bE.values()).forEach((t=>{t.OR(!0)})),this.bE.clear();const e=this.gl;e.deleteBuffer(this.CE),e.deleteBuffer(this.kE),this.UE&&!this.Yn.UE?(this.UE.width=1,this.UE.height=1,null===(t=this.UE.parentElement)||void 0===t||t.removeChild(this.UE),this.UE=void 0):this.UE=void 0,this.az=void 0,this.qR=void 0,this.hz=()=>{},this.sz.WEBGL_lose_context&&this.sz.WEBGL_lose_context.loseContext()}}const ym=(t,e,i,s)=>r=>{const n={theme:mg,...i,...r},o=t(n),h=e||s?yg(o,s):void 0,a=new Ff(o.Yn,r,o,o.U.bind(o),h);return o.co((t=>a.VL(t))).uo((()=>a.Z())).vs(),a},pm=(t,e)=>{t.co((t=>{e.Fe(t)})).uo((()=>e.Z())).vs()},xm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Jh(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h);return pm(o,a),a},Sm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Pc(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a},Am=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Od(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a},vm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Zc(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a},bm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new(r&&r.type?r.type:Ua)(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},Mm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new(r&&r.type?r.type:yd)(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,!0!==(null==r?void 0:r.disableAnimations)&&!1!==(null==r?void 0:r.animationsEnabled));return pm(o,a),a},Em=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new(r&&r.type?r.type:nd)(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},Tm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new(r&&r.type?r.type:Ed)(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},wm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Rl(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r,void 0);return pm(o,a),a},km=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Sl(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},Cm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new ff(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0);return pm(o,a),a},Rm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Ef(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},Im=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Oc(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a},Fm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Qf(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a};function Dm(t,i,s,r,n,o){let h=i.x.dt(t.max.x),a=i.x.dt(t.min.x),l=i.y.dt(t.max.y),u=i.y.dt(t.min.y),c=h-a,d=l-u;if(c<1){const t=(a+h)/2;a=t-.5,h=t+.5,c=1}if(d<1){const t=(u+l)/2;u=t-.5,l=t+.5,d=1}const f=c/d,g=c*s.x,m=d*s.y,y=c-g,p=d-m,x=g>y?[y,g]:[g,y],S=m>p?[p,m]:[m,p];let A,v,b=1,M=1;switch(r){default:case e.GradientExtent.closestSide:if(A=x[0]/c,v=S[0]/d,n===e.GradientShape.circle){const t=Math.min(A*f,v);b=t,M=t}else b=A*f,M=v;break;case e.GradientExtent.farthestSide:if(A=x[1]/c,v=S[1]/d,n===e.GradientShape.circle){const t=Math.max(A*f,v);b=t,M=t}else b=A*f,M=v;break;case e.GradientExtent.closestCorner:if(v=S[0]/d,n===e.GradientShape.circle){A=x[0]/c*f;const t=Math.sqrt(A*A+v*v);b=t,M=t}else{A=x[0]/c;const t=Math.sqrt(A*A+v*v);b=t*f,M=t}break;case e.GradientExtent.farthestCorner:if(v=S[1]/d,n===e.GradientShape.circle){A=x[1]/c*f;const t=Math.sqrt(A*A+v*v);b=t,M=t}else{A=x[1]/c;const t=Math.sqrt(A*A+v*v);b=t*f,M=t}}return{bounds:[a*o,u*o,c*o,d*o],center:[s.x*f,s.y],distance:[Math.max(b,1e-4),Math.max(M,1e-4)],aspectRatio:f}}function Lm(t,e,i,s){const r=e.x.dt(t.max.x),n=e.x.dt(t.min.x),o=e.y.dt(t.max.y),h=e.y.dt(t.min.y),a=r-n,l=o-h,c=Math.abs(a*Math.sin(i))+Math.abs(l*Math.cos(i)),d=u(a/2-Math.sin(i)*(c/2),l/2-Math.cos(i)*(c/2)),f=u(a/2+Math.sin(i)*(c/2),l/2+Math.cos(i)*(c/2));return{bounds:[n*s,h*s,a*s,l*s],startPoint:[d.x*s,d.y*s],endPoint:[f.x*s,f.y*s]}}class Vm{constructor(t){this.ER=t}}class _m{constructor(){this.Sz=new Array,this.vz=t=>(this.Sz.push(t),t),this.xz=this.vz(new Map),this.bz=this.vz(new Map),this.Mz=this.vz(new Map),this._z=this.vz(new Map),this.wz=this.vz(new Map),this.Cz=this.vz(new Map),this.kz=this.vz(new Map)}Tz(){this.Sz.forEach((t=>{t.forEach((t=>t.Tz())),t.clear()}))}}const Pm=(t,e,i)=>()=>{t.Fz=e,i&&i()},Bm=(t,i,s,r,n)=>{const o=Math.min(s/t,r/i),h=t*o,a=i*o,l=s/h,u=r/a,c=h/s,d=a/r;let f=0,g=1,m=0,y=1;switch(n){case e.ImageFitMode.Fill:u{this.Lz=!0,this.Oz()})),this.nc.addEventListener("error",(()=>{this.Rz=!0})),this.nc.complete&&(this.Lz=!0,this.Oz());else if(this.nc instanceof bt.HTMLVideoElement){const t=this;this.nc.addEventListener("canplay",(function(){t.Pz=this.videoHeight,t.Iz=this.videoWidth,t.Lz=!0,t.Oz()}),!0),this.nc.addEventListener("play",Pm(this,!0,(()=>this.Oz()))),this.nc.addEventListener("playing",Pm(this,!0,(()=>this.Oz()))),this.nc.addEventListener("pause",Pm(this,!1)),this.nc.addEventListener("ended",Pm(this,!1)),this.nc.readyState>=1&&(this.Iz=this.nc.videoWidth,this.Pz=this.nc.videoHeight,this.Fz=!this.nc.paused,this.Lz=!0,this.Oz())}else this.Lz=!0,this.Oz()}ZR(t){0===this.zz.size&&this.Lz&&this.Oz(),this.zz.add(t)}QR(t){this.zz.delete(t),0===this.zz.size&&this.unbindResources()}Nz(t){this.Ez.add(t),this.Bz&&(t(),this.Gz(t))}Gz(t){this.Ez.delete(t)}Oz(){if(this.Rz||this.Bz||!this.Lz)return;const t=this.cE.gl;if(!this.Vz&&this.nc&&t){this.Vz=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.Vz),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.nc,o=this.Iz>0?this.Iz:n.width,h=this.Pz>0?this.Pz:n.height;t.texImage2D(t.TEXTURE_2D,e,i,s,r,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.Iz=o,this.Pz=h,t.bindTexture(t.TEXTURE_2D,null)}this.Bz=!0,this.Ez&&this.Ez.forEach((t=>{t(),this.Gz(t)}))}Ds(){const t=this.cE.gl;if(!this.Rz&&this.Bz&&this.Vz){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.nc;n&&(t.bindTexture(t.TEXTURE_2D,this.Vz),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}Wz(){return this.Vz}unbindResources(){return this.Bz&&(this.Vz&&(this.cE.NR(this.Vz),this.Vz=null),this.Bz=!1),this}}class Nm extends Gr{constructor(t,e,i){super(t.cs,e,i),this.sS=!0,this.Zy={},this.tS=p(Gn),this.Ts=t,this.ft=t.ft}Uz(){var t;return this.tS.o&&this.tS._().type!==(null===(t=this.Yz)||void 0===t?void 0:t.type)}oS(t){return this.sS=t,this}$z(t){return this.Zy=t,this}}class Um{constructor(t){this.SV=[],this.ER=t}vV(t,e){((t,e,i,s)=>{const r=t.Xz(),n=Math.round(Math.min(i.spread,10)*r),o=Math.round(Math.min(i.blur,10)*r),h={x:Math.round(i.offset.x*r),y:Math.round(i.offset.y*r)},a=t.jz(),l=t.Zz(),u=t.Qz(),c=t.Jz(),d=t.Kz();t.qz("disabled"),t.oS(!1),t.tV(!1);const f=e.iV(),g=n+o/2;((t,e,i,s)=>{const r=t.gl,n=t.Xz(),o=t.sV();t.eV(r.FRAMEBUFFER,s.frameBuffer),r.bindRenderbuffer(r.RENDERBUFFER,s.depthBuffer),r.bindTexture(r.TEXTURE_2D,s.texture),r.clearDepth(1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT);const h=s.sizeDpr;t.hV(0,0,h.x,h.y),e.forEach((e=>{let s;if(e instanceof Hr?s=e.Ts.wp():e instanceof Nm&&(s=e.Ts.qv()),s){const e=s.x+i.left,r=s.y+i.bottom,o=Math.max(s.width-(i.left+i.right),0),h=Math.max(s.height-(i.bottom+i.top),0);t.rV(e*n,r*n,o*n,h*n)}else t.tV(!1);e.VL(2)})),t.eV(r.FRAMEBUFFER,o),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindTexture(r.TEXTURE_2D,null),t.tV(!1)})(t,s,{left:g+(h.x<0?-h.x:0),top:g+(h.y>0?h.y:0),right:g+(h.x>0?h.x:0),bottom:g+(h.y<0?-h.y:0)},f);let m=f;const y=n+o+5,p=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;ize(r,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),r=Je(r,s))}while(s);e.push(r)}return e})(e.map((t=>{const e=t instanceof Hr||t instanceof Nm?t.Ts.nV(t):_e;if(pe(e))return _e;const r={min:{x:Math.max(e.min.x-i.left,0),y:Math.max(e.min.y-i.bottom,0)},max:{x:Math.min(e.max.x+i.right,s.x),y:Math.min(e.max.y+i.top,s.y)}};return r.max.x<=r.min.x||r.max.y<=r.min.y?_e:r})).filter((t=>!pe(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=li(t.min,s),i=li(t.max,s),r=e,n=i;o[h+0]=e.x,o[h+1]=e.y,o[h+2]=r.x,o[h+3]=r.y,o[h+4]=i.x,o[h+5]=e.y,o[h+6]=n.x,o[h+7]=r.y,o[h+8]=i.x,o[h+9]=i.y,o[h+10]=n.x,o[h+11]=n.y,o[h+12]=i.x,o[h+13]=i.y,o[h+14]=n.x,o[h+15]=n.y,o[h+16]=e.x,o[h+17]=i.y,o[h+18]=r.x,o[h+19]=n.y,o[h+20]=e.x,o[h+21]=e.y,o[h+22]=r.x,o[h+23]=r.y,h+=24})),{vertexBuffer:t.oV(o),vertexCount:n}})(t,s,{left:y+(h.x<0?-h.x:0),top:y+(h.y>0?h.y:0),right:y+(h.x>0?h.x:0),bottom:y+(h.y<0?-h.y:0)},e.aV()),x=e.iV(f,m),S=t.az(em["2D"],em.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r,n)=>{const o=t.gl,h=t.sV();t.eV(o.FRAMEBUFFER,i.frameBuffer),o.bindRenderbuffer(o.RENDERBUFFER,i.depthBuffer),o.bindTexture(o.TEXTURE_2D,i.texture),o.clearDepth(1),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),t.hV(0,0,i.sizeDpr.x,i.sizeDpr.y),t.lV(s,((h,a,l,u)=>(t.ZR(s),n&&n(h),t.fV(h("uIsHighlighted"),0).gR(h("uHighlightColorOffset"),R).fV(h("uRenderEffectMask"),0).dV(h("uTexture"),e.texture,0).cV(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).cV(h("uScale"),i.uniforms.AV()).cV(h("uDisp"),i.uniforms.gV()).cV(h("uScaling"),[i.size.x,i.size.y]).cV(h("uTranslationAxis"),[0,0]).uV(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).Zm(o.TRIANGLES,r.vertexCount,0),!0))),t.eV(o.FRAMEBUFFER,h),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,m,x,S,p,((e,i,s,r)=>(t.cV(e("uOffsetPx"),[h.x,h.y]),!0))),m=x,t.tV(l),t.pV(d);const A=t.az(em["2D"],em.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r)=>{const n=t.gl,o={x:t.cs.ai().x,y:t.cs.ai().y};t.hV(0,0,o.x*t.Xz(),o.y*t.Xz());const h=ut.d2({scaleXYConstructor:_i}).tt(o).Oi(0,o.x).Ni(0,o.y),a=new Ym;a.mV(h),t.lV(i,((h,l,u,c)=>(t.ZR(i),r&&r(h),t.fV(h("uIsHighlighted"),0).gR(h("uHighlightColorOffset"),R).fV(h("uRenderEffectMask"),0).dV(h("uTexture"),e.texture,0).cV(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).cV(h("uScale"),a.AV()).cV(h("uDisp"),a.gV()).cV(h("uScaling"),[o.x,o.y]).cV(h("uTranslationAxis"),[0,0]).uV(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).Zm(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,A,p,((e,s,r,n)=>(t.dV(e("uTextureFirstGlowPass"),x.texture,1).gR(e("uGlowColor"),i.color),!0))),t.hV(a.x,a.y,a.width,a.height),t.qz(u),t.oS(c),t.yV(p.vertexBuffer)})(this.ER,this,e,t)}aV(){const t=this.ER.cs.ai();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}iV(...t){const e=this.SV,i=this.aV(),s={x:Math.ceil(i.x*this.ER.Xz()),y:Math.ceil(i.y*this.ER.Xz())},r=this.ER.gl,n=e.find((e=>!t.includes(e)));if(n)return n.sizeDpr.x===s.x&&n.sizeDpr.y===s.y||(n.size=i,n.sizeDpr=s,r.bindTexture(r.TEXTURE_2D,n.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,s.x,s.y,0,r.RGBA,r.UNSIGNED_BYTE,null),r.bindRenderbuffer(r.RENDERBUFFER,n.depthBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,s.x,s.y),r.bindTexture(r.TEXTURE_2D,null),r.bindRenderbuffer(r.RENDERBUFFER,null),n.scale.tt(i).Oi(0,i.x).Ni(0,i.y),n.uniforms.mV(n.scale)),n;const o=r.createTexture(),h=this.ER.xV(),a=this.ER.bV();r.bindTexture(r.TEXTURE_2D,o),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,s.x,s.y,0,r.RGBA,r.UNSIGNED_BYTE,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const l=this.ER.sV();this.ER.eV(r.FRAMEBUFFER,h),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,o,0),r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,s.x,s.y),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a),r.bindTexture(r.TEXTURE_2D,null),this.ER.eV(r.FRAMEBUFFER,l),r.bindRenderbuffer(r.RENDERBUFFER,null);const u=ut.d2({scaleXYConstructor:_i}).tt(i).Oi(0,i.x).Ni(0,i.y),c=new Ym;c.mV(u);const d={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:u,uniforms:c};return e.push(d),d}U(){[this.SV].forEach((t=>{t.forEach((t=>{this.ER.MV(t.depthBuffer),this.ER._V(t.frameBuffer),this.ER.NR(t.texture)})),t.length=0}))}}class Om{constructor(t,i,s,r,n=!0){this.wV=new _m,this.CV=new Map,this.kV=new Map,this.TV=[],this.ZE=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(bt.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.sS=!1,this.cV=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.FV=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.IV=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.PV=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.DV=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.BV=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.gR=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.fV=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.LV=(t,e)=>(this.gl.uniform1i(t,e),this),this.dV=(t,e,i)=>{if(void 0===t)return this;if(e){const s=this.gl.TEXTURE0+i;return this.gl.activeTexture(s),this.gl.bindTexture(this.gl.TEXTURE_2D,e),this.gl.uniform1i(t,i),this}throw new yt("Could not bind a texture.")},this.RV=t=>(((t,i)=>{i===e.ImageFitMode.Tile?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE))})(this.gl,t),this),this.oV=(t,e=!1,i,s=Float32Array)=>{const r=t.length,n=this.EV(r,i);if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof s?t:new s(t),e?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),n)return n;throw new yt("Could not create vertex buffer")},this.zV=(t,e,i,s=Float32Array)=>{const r=i||this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,r),e&&e.length===t?this.gl.bufferData(this.gl.ARRAY_BUFFER,e instanceof s?e:new s(e),this.gl.STATIC_DRAW):(this.gl.bufferData(this.gl.ARRAY_BUFFER,new s(t),this.gl.STATIC_DRAW),e&&this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,e instanceof s?e:new s(e))),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),r)return r;throw new yt("Could not create vertex buffer")},this.VV=(t,e,i,s=Float32Array)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferSubData(this.gl.ARRAY_BUFFER,e*s.BYTES_PER_ELEMENT,i instanceof s?i:new s(i)),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.OV=(t,e,i=!1)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferData(this.gl.ARRAY_BUFFER,e,i?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.NV=(t,e)=>{const i=t.length,s=this.EV(i,e);if(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,s),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),s)return s;throw new yt("Could not create index buffer")},this.GV=t=>{const e=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof Float32Array?t:new Float32Array(t),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),e)return e;throw new yt("Could not create float buffer")},this.WV=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,2,this.gl.FLOAT,!1,0,0)),this),this.UV=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.vertexAttribPointer(t,3,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(t)),this),this.uV=(t,e,...i)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t);const s=i.length;let r=0;for(let t=0;t-1&&this.gl.enableVertexAttribArray(e)}let n=0;for(let t=0;t-1&&this.gl.vertexAttribPointer(e.location,e.size,this.gl.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),n+=e.size}if(void 0!==e)for(let t=0;t-1&&this.YV(s,e)}return this},this.HV=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.$V=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,4,this.gl.FLOAT,!1,0,0)),this),this.XV=(t,e,i)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(t),void 0!==i&&this.YV(t,i)),this),this.jV=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.ZV=null,this.Zm=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.QV=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.JV=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.sz.ANGLE_instanced_arrays)return bt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.sz.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.KV=(t,e,i,s,r=this.gl.UNSIGNED_SHORT)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawElementsInstanced(t,e,r,i,s),this.gl1)){if(!this.gl1.sz.ANGLE_instanced_arrays)return bt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.sz.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.YV=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.sz.ANGLE_instanced_arrays)return bt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.sz.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.qV=(t,e,i,s=0)=>{const r=this.gl.TEXTURE0+s;this.gl.activeTexture(r);const n=this.sV();this.eV(this.gl.FRAMEBUFFER,e),this.gl.bindTexture(this.gl.TEXTURE_2D,i),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,i,0);const o=this.Zz();o&&this.tV(!1),t(),o&&this.tV(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.eV(this.gl.FRAMEBUFFER,n)},this.Gt=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this),this.tO=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.ZR=t=>(this.gl.useProgram(t.dE),this),this.iO=!1,this.sO=[],this.cs=t,this.dA=i,this.cs=t,this.gl=s.ctx,this.eO=s.antialias,this.hO=!!this.cs.Jr.ME&&s.lineAntialias,this.ez=this.cs.Jr.ez,this.rO=new Map,this.gl1=this.cs.Jr.gl1,this.gl2=this.cs.Jr.gl2,n&&(this.pV(!0),this.nO()),this.sz=this.cs.Jr.sz,this.VR=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.YR=this.oO(),this.az=this.cs.Jr.az,this.aO=new Xm(this),this.qR=this.cs.Jr.qR,this.lO=new Um(this),this.bE=this.cs.Jr.bE,this.uO=this.oV([0,0,1,0,1,1,0,1]),this.cO=this.oV([0,0,1,0,0,1,0,1,1,0,1,1])}qz(t){return t!==this.dO&&(this.dO=t,"disabled"===t?this.gl.disable(this.gl.CULL_FACE):"cull-back"===t?(this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.BACK)):"cull-front"===t&&(this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.FRONT))),this}Qz(){return this.dO||"disabled"}oS(t){return t!==this.sS&&(this.sS=t,t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)),this}Jz(){return this.sS}fO(t){return this.ZE=t,this}Xz(){return this.ZE}EV(t,e){let i;if(e){const s=this.rO.get(e);s&&s.size>=t&&s.size-t<1e6?i=e:this.yV(e)}return i||(i=this.gl.createBuffer(),this.rO.set(i,{size:t})),i}AO(t,e=this.gl.RGBA,i=!1,s,r,n=!1,o=this.gl.UNSIGNED_BYTE,h=e){const a=this.gl.createTexture();if(!a)throw new yt("Couldn't reserve Texture.");return this.gl.bindTexture(this.gl.TEXTURE_2D,a),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),t&&null===r?this.gl.texImage2D(this.gl.TEXTURE_2D,0,h,e,o,t):r&&this.gl.texImage2D(this.gl.TEXTURE_2D,0,h,r.x,r.y,0,e,o,t),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,s?this.gl.NEAREST:this.gl.LINEAR),i?(this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR_MIPMAP_LINEAR),this.gl.generateMipmap(this.gl.TEXTURE_2D)):this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,s?this.gl.NEAREST:this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),a}NR(t){this.gl.deleteTexture(t)}xV(){const t=this.gl.createFramebuffer();if(!t)throw new yt("Couldn't reserve Framebuffer.");return t}eV(t,e){this.ZV=e,this.gl.bindFramebuffer(t,e)}sV(){return this.ZV}_V(t){this.gl.deleteFramebuffer(t)}bV(){const t=this.gl.createRenderbuffer();if(!t)throw new yt("Couldn't reserve Render buffer.");return t}MV(t){this.gl.deleteRenderbuffer(t)}hV(t,e,i,s){return this.gl.viewport(t,e,i,s),this.gO&&t===this.gO.x&&e===this.gO.y&&i===this.gO.width&&s===this.gO.height||(this.gO={x:t,y:e,width:i,height:s}),this}jz(){return this.gO||{x:0,y:0,width:0,height:0}}rV(t,e,i,s){return this.tV(!0),this.gl.scissor(Math.max(t,0),Math.max(e,0),Math.max(i,0),Math.max(s,0)),this}tV(t){return t===this.pO||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.pO=t),this}pV(t){return t!==this.iO&&(this.iO=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}Kz(){return this.iO}nO(t,e,i,s){return t?(void 0!==t&&void 0!==e&&(void 0!==i&&void 0!==s?this.gl.blendFuncSeparate(t,e,i,s):this.gl.blendFunc(t,e)),this):(this.gl.blendFuncSeparate(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA),this)}Zz(){return void 0!==this.pO&&this.pO}lV(t,e){const i=new Wm(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}yV(t){t&&(this.gl.deleteBuffer(t),this.rO.delete(t))}mO(t,e,i){this.cV(t.uniform("uCenter"),e.center).cV(t.uniform("uDistance"),e.distance).IV(t.uniform("uBounds"),e.bounds).fV(t.uniform("uAspect"),e.aspectRatio);const s=i.getColorStops();if(s.length<2)throw new Error("Minimum two color stops required");for(let e=0;e=t)return this._O.buffer;this._O&&(this.yV(this._O.buffer),this._O=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.sO.splice(this.sO.indexOf(l),1)}))}IO(t,e,i,s,r,n,o,h){const a=this.gl,l=this.sV();this.eV(a.FRAMEBUFFER,t),a.readPixels(e,i,s,r,n,o,h),this.eV(this.gl.FRAMEBUFFER,l)}PO(t){const e=this.kV.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new yt("Couldn't reserve Texture.");this.gl.bindTexture(this.gl.TEXTURE_2D,e);const s=[];let r=255;for(let e=0;e{t-=1;for(let e=1;e<32;e<<=1)t|=t>>1;return t+1})(s.length);for(let e=s.length;e{})),this;this.fV(s("uMinValue"),i.min),this.fV(s("uMaxValue"),i.max)}return this}EO(t,i,s,r,n,o){const h=s&&s.getSource()||r&&r.nc,a=s?s.getFitMode():e.ImageFitMode.Stretch,l=t=>{t.texCoordsBuffer=this.oV(o(t.texture.Iz,t.texture.Pz,a),!1,t.texCoordsBuffer)};if(h){let e=i;if((!i||h!==i.source)&&h){i&&(i.texture.QR(t),this.yV(i.texCoordsBuffer));const r=this.SO(h);r.ZR(t);const n=s?s.getSourceMissingColor():ks.color;e={texture:r,source:h,texCoordsBuffer:this.oV([]),sourceMissingTexture:this.AO(new Uint8Array([n.getR(),n.getG(),n.getB(),n.getA()]),this.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{e&&h&&(l(e),this.cs.vs())}},r.Nz(e.textureReadyCallback),l(e)}return e&&e.texture.Bz&&e.texture.Dz&&e.texture.Fz&&(e.texture.Ds(),this.cs.vs()),n&&e&&e.texture.Bz&&l(e),e}i&&this.zO(t,i)}zO(t,e){e&&(e.texture.QR(t),e.texture.Gz(e.textureReadyCallback),this.NR(e.sourceMissingTexture),this.yV(e.texCoordsBuffer))}VO(t,e,i,s){const{uniform:r,uniformOptional:n,attribute:o}=t,h=i.ft,a=this.Xz();this.fV(r("uIsHighlighted"),1===e||2===e?0:i.Vo).gR(r("uHighlightColorOffset"),1===e||2===e?I:i.Wo).fV(r("uRenderEffectMask"),2===e?1:0).cV(n("uRatioPxClip"),[2/this.cs.ai().x,2/this.cs.ai().y]).fV(n("uDevicePixelRatio"),a),h instanceof _i||h instanceof $c?this.cV(r("uScale"),s.uniforms.AV()).cV(r("uDisp"),s.uniforms.gV()).cV(n("uScaleStart_highpart"),s.uniforms.OO()).cV(n("uScaleStart_lowpart"),s.uniforms.NO()):h instanceof Pi&&this.cV(n("uScaleStart"),s.uniforms.MixedScaleXY.uScaleStart).cV(n("uScaleStartLog"),s.uniforms.MixedScaleXY.uScaleStartLog).cV(n("uScaleInterval"),s.uniforms.MixedScaleXY.uScaleInterval).cV(n("uScaleIntervalLog"),s.uniforms.MixedScaleXY.uScaleIntervalLog).cV(r("uViewportStart"),s.uniforms.MixedScaleXY.uViewportStart).cV(r("uViewportSize"),s.uniforms.MixedScaleXY.uViewportSize);const l=!0===s.coordsHighPrecision;if(s.coordsX)if(l){const t=o("aPos_highpartX"),e=o("aPos_lowpartX");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.coordsX),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(e,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,1*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(e)}else this.XV(o("aPosX"),s.coordsX);if(s.coordsY)if(l){const t=o("aPos_highpartY"),e=o("aPos_lowpartY");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.coordsY),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(e,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,1*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(e)}else this.XV(o("aPosY"),s.coordsY);if(1===e)this.gR(r("uColor"),s.mousePickingColor);else{if(s.fillStyleSolid&&this.gR(r("uColor"),s.fillStyleSolid.getColor()),s.fillStylePaletted){if("value"===s.fillStylePaletted.getLookUpProperty()&&null!==s.lookupValueBuffer){if(!s.lookupValueBuffer)return!1;const t=o("aLookupValue");this.XV(t,s.lookupValueBuffer),void 0!==s.lookupValueAttribDivisor&&this.YV(t,s.lookupValueAttribDivisor)}this.RO(t,s.fillStylePaletted.lut,s.lookupValueRange)}if(s.fillStyleLinearGradient){if(!s.linearGradientInfo)return!1;this.yO(t,s.linearGradientInfo,s.fillStyleLinearGradient)}if(s.fillStyleRadialGradient){if(!s.radialGradientInfo)return!1;this.mO(t,s.radialGradientInfo,s.fillStyleRadialGradient)}if(s.fillStyleIndividual&&null!==s.colorBuffer){if(!s.colorBuffer)return!1;const t=o("aColor");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.colorBuffer),this.gl.vertexAttribPointer(t,4,this.gl.UNSIGNED_BYTE,!0,0,0),this.gl.enableVertexAttribArray(t),void 0!==s.colorAttribDivisor&&this.YV(t,s.colorAttribDivisor)}if(s.fillStyleImage){if(!s.texturedFillGLInfo)return!1;const t=s.texturedFillGLInfo&&s.texturedFillGLInfo.texture.Wz();this.gR(n("uColor"),s.fillStyleImage.getSurroundingColor()).dV(r("uColorTexture"),t||s.texturedFillGLInfo.sourceMissingTexture,0).uV(s.texturedFillGLInfo.texCoordsBuffer,s.texCoordAttribDivisor,{location:o("aTextureCoord"),size:2}).RV(s.fillStyleImage.fitMode)}if(s.maskTexture){const t=s.maskTexture&&s.maskTexture.texture.Wz();this.dV(r("uMaskTexture"),t||s.maskTexture.sourceMissingTexture,0).uV(s.maskTexture.texCoordsBuffer,s.maskTextureCoordsAttribDivisor,{location:o("aMaskTextureCoord"),size:2})}}return!0}GO(t,e,i){if(t)return Lm(i||e.$o(),e.ft,t.getAngle(!0),this.Xz())}WO(t,e,i){if(t)return Dm(i||e.$o(),e.ft,t.getPosition(),t.getExtent(),t.getShape(),this.Xz())}}const Gm=async(t,e,i,s,r,n,o)=>{const h=t.fenceSync(t.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),((t,e,i)=>{const s=void 0!==i.flags?i.flags:0,r=void 0!==i.retryTimeout?i.retryTimeout:10;return new Promise(((i,n)=>{const o=()=>{const h=t.clientWaitSync(e,s,0);return h===t.WAIT_FAILED?n(new Error(`WebGL Sync WAIT_FAILED ${t.getError()}`)):h!==t.TIMEOUT_EXPIRED?i(void 0):void bt.setTimeout(o,r)};bt.setTimeout(o,0)}))})(t,h,{retryTimeout:10}).then((()=>(t.deleteSync(h),t.bindBuffer(e,i),t.getBufferSubData(e,s,r,n,o),t.bindBuffer(e,null),r))).catch((t=>{throw t}))};class Ym{mV(t){if(t instanceof _i||t instanceof $c){const e=t.Si();this.UO=e.x.scaling,this.YO=-e.x.displacement,this.HO=e.y.scaling,this.$O=-e.y.displacement,this.XO=e.x.highPrecisionOffset,this.jO=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.ZO=e.y.highPrecisionOffset,this.QO=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof Pi&&(this.MixedScaleXY=t.Si());return this}gV(){return[this.YO,this.$O]}AV(){return[this.UO,this.HO]}OO(){return[this.XO,this.ZO]}NO(){return[this.jO,this.QO]}}class Hm{constructor(){this.UO=0,this.HO=0,this.JO=0,this.YO=0,this.$O=0,this.KO=0}qO(t){return this.UO=t.ht(),this.YO=t.getInnerStart()+.5*this.UO*t.rt(),this}tN(t){return this.HO=t.ht(),this.$O=t.getInnerStart()+.5*this.HO*t.rt(),this}iN(t){return this.JO=t.ht(),this.KO=t.getInnerStart()+.5*this.JO*t.rt(),this}AV(){return[this.UO,this.HO,this.JO]}gV(){return[this.YO,this.$O,this.KO]}sN(t,e,i,s,r){const n=u(2*(t-i.x)/(i.width-i.x)-1,2*(e-i.y)/(i.height-i.y)-1),o=pl.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class Xm{constructor(t){this.ER=t}VL(t,e,i,s,r,n=0){const o=this.ER,h=void 0===s;if(!(s=s||o.xV()))throw new yt("Could not bind a framebuffer.");const a=o.jz(),l=o.Kz();o.pV(!1),o.qV((()=>{o.hV(0,0,i.x,i.y),t()}),s,e,n),h&&o._V(s),this.ER.tO(r),this.ER.hV(a.x,a.y,a.width,a.height),o.pV(l)}}class Wm{constructor(t,e){this.eN=[],this.hN=[],this.uniform=t=>{const e=this.shader.pE(t);return this.hN.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.mE(t);return this.hN.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.yE(t);return this.eN.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.eN)this.glUtils.HV(t.location),this.glUtils.YV(t.location,0)}}class jm extends Hr{constructor(t,e,i,s,r){super(t,e,i,s),this.rN=new Map,this.nN=t,this.oN=e,this.ER=t.aN(),this.lN=r,this.oN=e}uN(t){return!1}OR(){return this}VL(t){if(!this.lN||0!==t||0===this.rN.size)return this;const e=Array.from(this.rN.values()).map((t=>t.cN.filter((t=>t.dN)).map((t=>t.ss)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===e.length)return this;const i=this.lN;return this.ER.lO.vV(e,i),this}Ds(){return this}bt(){return 0}xt(){return 0}_t(){return 0}Mt(){return 0}xl(){return 0}bl(){return 0}rs(t,e){const i={cN:[]},s=(t,e)=>{const s={ss:t||[],dN:void 0===e||e};i.cN.push(s);const r={As:t=>(s.ss=t,r),Ss:t=>(s.dN=t,r),xs:()=>s.dN};return r},r={};Object.keys(e).forEach((t=>{const i=e[t],n=i.shapes||[],o=void 0===i.themeEffectEnabled||i.themeEffectEnabled,h=s(n,o);r[t]=h}));const n={yg:s,...r};this.rN.set(t,i);const o=t.onDispose((()=>{this.rN.delete(t),t.offDispose(o)}));return n}}const $m=(t,e,i)=>((t,e,i,s)=>{const r=[];let n=0;const o=ni(e,i/2);let h,a,l,c,d=t[t.length-1],f=0;for(let i=0;i0&&(d=t[i-1]),Mt(h,d)&&(d=oi(h,ii(ni(hi(a,h),-1)))),Mt(h,a)&&(a=oi(h,ii(ni(hi(d,h),-1))));const s=li(d,e),g=li(h,e),m=li(a,e),y=ii(hi(g,s)),p=ii(hi(m,g)),x=oi(y,p),S=u(-x.y,x.x),A=u(-y.y,y.x),v=1/ci(S,A),b=ri(S),M=ii(hi(y,p)),E=Math.sign(ci(S,M))||1,T=ai(S,ni(o,v)),w=ai(S,ni(o,-v));if(b<1||v===1/0){let t={x:0,y:0},e={x:0,y:0},i={x:0,y:0},s={x:0,y:0};const l=u(-p.y,p.x),c=Math.sign(ci(y,S))||E,g=ai(A,ni(o,c)),m=ai(l,ni(o,c));1===E?(t=g,e=w,i=m,s=w):(t=T,e=g,i=T,s=m);const x=4*Xe(d,h),b=4*Xe(h,a);(v>x||v>b)&&(1===E?(t=g,e=m,i=m,s=g):(t=m,e=g,i=g,s=m));const M=oi(h,t),k=oi(h,e),C=oi(h,i),R=oi(h,s);r[n]=M,n+=1,r[n]=k,n+=1,r[n]=C,n+=1,r[n]=R,n+=1,f=4}else{const t=oi(h,T),e=oi(h,w);r[n]=t,n+=1,r[n]=e,n+=1,f=2}c=l,l=t[i]}return r[n]=r[0],n+=1,r[n]=r[1],n+=1,[r,f,[c,l]]})(t,e,i)[0];class Zm extends on{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.fN=_e,this.AN=_e,this.gN=wg({arcStyleSolid:()=>Y(this.be)&&this.be,arcStyleRadialGradient:()=>et(this.be)&&this.be,arcStyleLinearGradient:()=>rt(this.be)&&this.be}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN()}yN(t,e){let i=0,s=Array(0),r=0;if(void 0!==e){const r=t.length,n=Array(r+e.length);let o=0,h=0;for(;o0?md(this.ca._(),this.Wl._(),this.Ii._(),this.Ul._()*l/100,this.Yl._()*l/100,a)[0]:[this.ca._()],d=h.length-1;if(2===d){const t=(h[d-1].x+h[1].x)/2,e=(h[d-1].y+h[1].y)/2;this.Xl=u(t,e)}else{const t=Math.floor(d/2);this.Xl=u(h[t].x,h[t].y)}this.jl=h[1];const f=h.length-1;this.Zl=h[f],this.Hl._()&&(h.shift(),c.shift());let g=!1;(this.ca.o||this.Wl.o||this.Ii.o||this.Ul.o||this.Yl.o||this.Hl.o||this.$l.o||s)&&(this.AN=m(u(this.Ia().x-n,this.Ia().y-o),u(this.Ia().x+n,this.Ia().y+o)),g=!0,this.ca.o=!1,this.Wl.o=!1,this.Ii.o=!1,this.Ul.o=!1,this.Yl.o=!1,this.Hl.o=!1,this.$l.o=!1);const y=this.ia();(g||y)&&this.be!==z&&(this.Hl._()?(this.vN&&this.ER.yV(this.vN),[this.xN,this.vN,this.bN,this.MN]=this.yN(h,c)):(this.vN&&this.ER.yV(this.vN),[this.xN,this.vN,this.bN,this.MN]=this.yN(h,void 0)),et(this.be)?this._N=Dm(this.AN,this.ft,this.be.getPosition(),this.be.getExtent(),this.be.getShape(),this.ER.Xz()):rt(this.be)?this.wN=Lm(this.AN,this.ft,this.be.getAngle(!0),this.ER.Xz()):(this._N=void 0,this.wN=void 0));const p=this.gN.arcStyleSolid(y),x=this.gN.arcStyleLinearGradient(y),S=this.gN.arcStyleRadialGradient(y),A=p||x||S;y&&(this.CN=A?this.ER.az(em["2D"],em.Color({dataType:et(this.be)||rt(this.be)?["gradient",this.be]:"uniform"}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})):void 0,this.ra(this.be));const v=this.Me;if(qi(v)&&(g||this.aa(v.getThickness())||s)){this.Hl._()?360===i?(h.pop(),c.pop(),[this.kN,this.TN]=this.SN(h,void 0,v.getThickness(),r),this.FN&&this.kN?this.ER.OV(this.FN,this.kN,!0):!this.FN&&this.kN?this.FN=this.ER.oV(this.kN,!0):this.FN&&!this.kN&&(this.ER.yV(this.FN),this.FN=void 0),[this.IN,this.PN]=this.SN(c,void 0,v.getThickness(),r),this.DN&&this.IN?this.ER.OV(this.DN,this.IN,!0):!this.DN&&this.IN?this.DN=this.ER.oV(this.IN,!0):this.DN&&!this.IN&&(this.ER.yV(this.DN),this.DN=void 0)):([this.kN,this.TN]=this.SN(h,c,v.getThickness(),r),this.FN&&this.kN?this.ER.OV(this.FN,this.kN,!0):!this.FN&&this.kN?this.FN=this.ER.oV(this.kN,!0):this.FN&&!this.kN&&(this.ER.yV(this.FN),this.FN=void 0),this.IN&&(this.DN&&this.ER.yV(this.DN),this.DN=void 0,this.PN=0)):(360===i&&(h.shift(),h.pop()),[this.kN,this.TN]=this.SN(h,void 0,v.getThickness(),r),this.FN&&this.kN?this.ER.OV(this.FN,this.kN,!0):!this.FN&&this.kN?this.FN=this.ER.oV(this.kN,!0):this.FN&&!this.kN&&(this.ER.yV(this.FN),this.FN=void 0));const t=v.getFillStyle();et(t)?this.LN=Dm(this.AN,this.ft,t.getPosition(),t.getExtent(),t.getShape(),this.ER.Xz()):rt(t)?this.RN=Lm(this.AN,this.ft,t.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),this.EN=t===z?void 0:this.ER.az(em["2D"],em.Color({dataType:et(t)||rt(t)?["gradient",t]:"uniform"}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})),this.la(v)}if(g){let t=1,e=1;qi(v)&&(t=v.getThickness()*r.x,e=v.getThickness()*r.y),this.fN=m(u(this.AN.min.x-t,this.AN.min.y-e),u(this.AN.max.x+t,this.AN.max.y+e))}this.zN=e&&A?this.zN||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})):void 0,this.VN=e&&this.Me!==ot?this.VN||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})):void 0}return this}VL(t){if(this.ha()){const e=1===t?this.zN:this.CN,i=this.be,s=this.vN;e&&s&&this.ER.ZR(e).lV(e,((e,r,n,o)=>{if(this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(o("uScaleStart_highpart"),this.lE.OO()).cV(o("uScaleStart_lowpart"),this.lE.NO()).xO(n,s,this.ft.wi(),void 0).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1===t)this.ER.gR(e("uColor"),this.mN);else if(Y(i))this.ER.gR(e("uColor"),i.getColor());else if(et(i)){if(!this._N)return!1;this.ER.mO(n,this._N,i)}else if(rt(i)){if(!this.wN)return!1;this.ER.yO(n,this.wN,i)}return this.ER.Zm(this.MN,this.bN),!0}));const r=this.Me;qi(r)&&(void 0!==this.FN&&this.ON(t,this.FN,this.TN,r),void 0!==this.DN&&this.ON(t,this.DN,this.PN,r))}return this}ON(t,e,i,s){const r=1===t?this.VN:this.EN,n=s.getFillStyle();r&&this.ER.ZR(r).lV(r,((r,o,h,a)=>{if(this.ER.cV(r("uScale"),this.lE.AV()).cV(r("uDisp"),this.lE.gV()).xO(h,e,this.ft.wi(),void 0).fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0),1===t)this.ER.gR(r("uColor"),this.mN);else if(Y(n))this.ER.gR(r("uColor"),n.getColor());else if(et(n)){if(!this.LN)return!1;this.ER.mO(h,this.LN,n)}else if(rt(n)){if(!this.RN)return!1;this.ER.yO(h,this.RN,n)}const l=s.getThickness(),u=-1===l||1===l;return this.ER.Zm(u?this.ER.gl.LINE_LOOP:this.ER.gl.TRIANGLE_STRIP,i),!0}))}uN(t){return this.pN===t&&{}}OR(){return this.NN&&(this.ER.yV(this.NN),this.NN=void 0),this.GN&&(this.ER.yV(this.GN),this.GN=void 0),this.vN&&(this.ER.yV(this.vN),this.vN=void 0),this.FN&&(this.ER.yV(this.FN),this.FN=void 0),this.DN&&(this.ER.yV(this.DN),this.DN=void 0),this.CN=void 0,this.EN=void 0,this.zN=void 0,this.VN=void 0,this}bt(){return this.AN.max.x}xt(){return this.AN.min.x}_t(){return this.AN.max.y}Mt(){return this.AN.min.y}xl(){return Te(this.Me)}bl(){return Te(this.Me)}}class Km{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}WN(t){return this.first=t,this.second=t+1,this.third=t+2,this.fourth=t+3,this.fifth=t+4,this.sixth=t+5,t+=6,this}UN(){return this.first=this.second,this.second=this.third,this.third=this.fourth,this.fourth=this.fifth,this.fifth=this.sixth,this.sixth+=1,this}YN(){return this.first=this.third,this.second=this.fourth,this.third=this.fifth,this.fourth=this.sixth,this.fifth=this.fourth+1,this.sixth=this.fifth+1,this}HN(t){const e=t.buffer;let{position:i}=t;return e[i]=this.first,e[i+1]=this.second,e[i+2]=this.third,i+=3,t.position=i,t.next&&this.UN(),this}$N(t){const e=t.buffer;let{position:i}=t;return e[i]=this.first,e[i+1]=this.third,e[i+2]=this.second,e[i+3]=this.third,e[i+4]=this.fourth,e[i+5]=this.second,i+=6,t.position=i,t.next&&this.YN(),this}XN(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new Km).WN(t))(),qm=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||Jm.UN(),n.push(t,e),r.push(Jm.first,Jm.second,Jm.third),h=void 0,o=void 0,r.push(Jm.third,Jm.fourth,Jm.second),a=Jm.third,Jm.YN(),l&&n.push(i,s),[o,h,a]),Qm=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||Jm.UN(),o.push(t,e),r.push(Jm.first,Jm.second,Jm.third);const c=Si(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(Jm.third,Jm.fourth,Jm.fifth),l=Jm.fourth),Jm.YN(),u&&o.push(i,s),[h,a,l]},ty=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||Jm.UN(),r.push(t,e),s.push(Jm.first,Jm.second,Jm.third),n=i,o=void 0,h=Jm.third,l?r.push(i):a=!0,[n,o,h,a]),ey=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||Jm.UN(),Jm.UN()):a>0&&(Jm.UN(),u>0&&(u-=1)),n.push(t),r.push(Jm.first,Jm.second,Jm.third),a=Jm.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),iy=(t,e=0)=>{Jm.WN(e);const[i,s]=t,r=i.length,n=[],o=[],h=[];let a,l,u=e,c=0,d=i[c],f=s[c],g=i[c],m=s[c],y=!1,p=u>0?g.y!==m.y?2:1:0;if(r>1)for(;cm.y?d.y>f.y?[a,l,u]=qm(g,m,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=Qm(g,m,d,f,o,n,h,a,l,u,t):[a,l,u,y]=ty(g,m,d,o,h,a,l,u,y,t):d.y===f.y?(a=g,y&&(h.push(g),y=!1,Jm.UN()),0===h.length&&u>0&&p>0&&(p-=1)):d.y>f.y?[a,l,u,p]=ey(g,0,d,f,n,h,a,l,u,t,p):[a,l,u,p]=ey(g,0,d,f,o,h,a,l,u,t,p)}return[h,new Uint16Array(n),new Uint16Array(o),u,p]};class sy extends nn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.ZN=0,this.Na=Array(),this.QN=0,this.JN=new Uint16Array(0),this.KN=new Uint16Array(0),this.gN=wg({hightFillSolid:()=>Y(this.be)&&this.be,hightFillRadialGradient:()=>et(this.be)&&this.be,hightFillLinearGradient:()=>rt(this.be)&&this.be,hightFillPaletted:()=>j(this.be)&&this.be,lowFillSolid:()=>Y(this.Fl)&&this.Fl,lowFillRadialGradient:()=>et(this.Fl)&&this.Fl,lowFillLinearGradient:()=>rt(this.Fl)&&this.Fl,lowFillPaletted:()=>j(this.Fl)&&this.Fl}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN()}Ds(){const t=this.ea(),e=this.Lo._(),i=this.Ja;if(this.ha()){this.lE.mV(this.ft);const s=this.ft instanceof Pi==0,r=s?this.ft.Ui():void 0,n=this.Bl(),o=this.ft.Gi()||t,h=i||this.wl.o||o&&"disabled"!==n.type;if(h){if(this.ZN=0,this.JN=new Uint16Array(0),this.KN=new Uint16Array(0),this.Na.length=0,this.QN=0,this.Cl>1){const[t,e,i,o]=iy([s?n.packager(this.Ml,r,.5):this.Ml,s?n.packager(this._l,r,.5):this._l]);this.ZN=o,this.JN=e,this.KN=i,this.Na=t,this.QN=t.length}this.wl.o=!1}if(this.Tl&&this.Xa[0].length>1){const[t,e]=this.Xa,i=t.length,[o,h,a,l,u]=iy([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.ZN);this.ZN=l;const c=o.length;for(let t=u;t0||this.Cl>0?1:u;s{if(this.ER.xO(o,e,this.ft.wi(),void 0).jV(r).fV(s("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(s("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(s("uRenderEffectMask"),2===t?1:0),this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(s("uScale"),this.lE.AV()).cV(s("uDisp"),this.lE.gV()).cV(h("uScaleStart_highpart"),this.lE.OO()).cV(h("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Pi&&this.ER.cV(h("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(h("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(h("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(h("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(s("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(s("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(s("uColor"),this.mN);else if(Y(i))this.ER.gR(s("uColor"),i.getColor());else if(et(i)){if(!this.iG)return!1;this.ER.mO(o,this.iG,i)}else if(rt(i)){if(!this.sG)return!1;this.ER.yO(o,this.sG,i)}else if(j(i)){const t=kg(i,this,void 0);if(!t&&i.lut.percentageValues)return!1;this.ER.RO(o,i.lut,t)}return this.ER.QV(this.oG),!0}))}const r=1===t?this.zN:this.qN;if(r&&this.eG&&this.hG){const i=this.eG,s=this.hG;this.ER.ZR(r).lV(r,((r,n,o,h)=>{if(this.ER.xO(o,i,this.ft.wi(),void 0).jV(s).fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0),this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(r("uScale"),this.lE.AV()).cV(r("uDisp"),this.lE.gV()).cV(h("uScaleStart_highpart"),this.lE.OO()).cV(h("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Pi&&this.ER.cV(h("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(h("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(h("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(h("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(r("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(r("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(r("uColor"),this.mN);else if(Y(e))this.ER.gR(r("uColor"),e.getColor());else if(et(e)){if(!this._N)return!1;this.ER.mO(o,this._N,e)}else if(rt(e)){if(!this.wN)return!1;this.ER.yO(o,this.wN,e)}else if(j(e)){const t=kg(e,this,void 0);if(!t&&e.lut.percentageValues)return!1;this.ER.RO(o,e.lut,t)}return this.ER.QV(this.rG),!0}))}return this}uN(t){return this.pN===t&&{}}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}Yb(t){this.ll()>0&&this.Ds();const[e,i]=this.il(),s=e.length>2&&e[1].x0&&this.Ds();const[e,i]=this.il(),s=e.length;if(0===s)return;const r=this.Il?1:0,n=s-(this.Pl?2:1),o=e.length>2&&e[1].x{const i=1===e?.5*Math.PI:1.5*Math.PI;for(let s=0;s<=this.aG;s+=1){const r=i-s*Math.PI/this.aG;t.push(.5*Math.cos(r),.5*Math.sin(r),e,0)}})),t.push(0,0,1,1),t.push(0,0,0,1);const e=t.length/4,i=[];for(let t=0;t((t,e)=>{let i=t.wV.Mz.get(e);return i||(i=new ry(t,e),t.wV.Mz.set(e,i),i)})(t,i?e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2:1),oy={AG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),a=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.YV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.YV(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.YV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.YV(a,1),h.enableVertexAttribArray(a)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.YV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.YV(i,1),h.enableVertexAttribArray(i)}},gG:(t,e,i,s,r,n,o)=>{const h=t.gl;h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(s,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.YV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.YV(r,1),h.enableVertexAttribArray(r)},pG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),a=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.YV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.YV(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.YV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.YV(a,1),h.enableVertexAttribArray(a)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.YV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.YV(i,1),h.enableVertexAttribArray(i)}},mG:(t,e,i,s,r,n,o)=>{const h=t.gl;h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(s,n,h.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.YV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.YV(r,1),h.enableVertexAttribArray(r)},VL:(t,e,i,s,r,n,o)=>{const h=t.aN(),{uniform:a,uniformOptional:l}=i,u=1/t.Yn.Xn,c=(r?Math.max(n,u):Math.max(n,0))+1;h.fV(a("uThicknessPixels"),c).fV(l("uAALimit"),1-(c-1)/c).cV(a("uRatioPxClip"),[2/t.ai().x,2/t.ai().y]),e.ZR(i,s).Zm(o)}},hy={AG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aPos_highpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t);const e=o("aPos_lowpart");h.vertexAttribPointer(e,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(e)}else{const t=o("aPos");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t)}},gG:(t,e,i,s,r,n)=>{const o=t.gl;o.bindBuffer(o.ARRAY_BUFFER,i),o.vertexAttribPointer(s,r,o.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),o.enableVertexAttribArray(s)},pG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),!t){const t=o("aPos");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t)}},yG:(t,e)=>{const i=t.aN();i.Zm(i.gl.LINE_STRIP,e,0)},SG:(t,e)=>{const i=t.aN();i.Zm(i.gl.LINES,2*e,0)}};class ay extends ln{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.Ha=_e,this.gN=wg({lineStyleSolid:()=>qi(this.uu)&&this.uu,lineStyleDashed:()=>Qn(this.uu)&&this.uu,strokeFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.uu.getFillStyle();return rt(t)&&t},strokeFillRadialGradient:()=>{const t=this.uu.getFillStyle();return et(t)&&t},strokeFillPaletted:()=>{const t=this.uu.getFillStyle();return j(t)&&t}}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN(),this.vG=this.ER.hO}Ds(){const t=this.na(),e=this.uu,i=this.gN.lineStyleSolid(t),s=this.gN.lineStyleDashed(t),r=i||s,n=this.gN.strokeFillSolid(t),o=this.gN.strokeFillLinearGradient(t),h=this.gN.strokeFillRadialGradient(t),a=this.gN.strokeFillPaletted(t),l=n||o||h||a&&["x","y"].includes(a.getLookUpProperty())&&a,c=this.Pi(),d=this.Fi(),f=this.Lo._(),g=this.Lo.o,y=e.O();if(s&&this.ft instanceof Pi)return bt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.lE.mV(this.ft),this.gu&&(this.xG=this.ER.oV(Jt([c,d],this.ft.wi()),!1,this.xG),this.Ha=m(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.ha()&&r&&l&&y>0,e=o?["gradient",o]:h?["gradient",h]:a?["lookup",a.getLookUpProperty(),a.lut]:"uniform";this.bG=t?{type:"triangulated",shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.LineInstanced2D({axisWorldTranslation:Tg(this.ft),normalSource:void 0}),this.vG?em.AliasedEdge:void 0,s&&em.StippleTextureInstanced),mousePickingShader:f?this.ER.az(em["2D"],em.MousePicking,em.LineInstanced2D({axisWorldTranslation:Tg(this.ft),normalSource:void 0}),s&&em.StippleTextureInstanced):void 0,geometry:ny(this.ER,y),thickness:y,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}:void 0}if(h?this.LN=Dm(Wr(this.Ha,{x:this.xl(),y:this.bl()},this.ft),this.ft,h.getPosition(),h.getExtent(),h.getShape(),this.ER.Xz()):o?this.RN=Lm(Wr(this.Ha,{x:this.xl(),y:this.bl()},this.ft),this.ft,o.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),s){if(t||this.gu){const t=[0,0,Math.abs(d.x-c.x),Math.abs(d.y-c.y)];this.MG=this.ER.oV(t,!1,this.MG)}this._G=this.ER.PO(s.getPattern())}else this.MG&&(this.ER.yV(this.MG),this.MG=void 0),this._G=void 0;return this.Au(e),this.gu=!1,this.Lo.o=!1,this}VL(t){var e,i;const s=this.xG;if(!s)return this;const r=this.bG;if(!r)return this;const{fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a,lineStyleDashed:l,thickness:u}=r,c=1===t?null===(e=this.bG)||void 0===e?void 0:e.mousePickingShader:null===(i=this.bG)||void 0===i?void 0:i.shader;return c?(this.ER.ZR(c).lV(c,((e,i,c,d)=>{if(this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(d("uScaleStart_highpart"),this.lE.OO()).cV(d("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Pi&&this.ER.cV(d("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(d("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(d("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(d("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(e("uColor"),this.mN);else if(n)this.ER.gR(e("uColor"),n.getColor());else if(h){if(!this.LN)return!1;this.ER.mO(c,this.LN,h)}else if(o){if(!this.RN)return!1;this.ER.yO(c,this.RN,o)}else if(a){const t=kg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.ER.RO(c,a.lut,t)}if(l){if(!this.MG||!this._G)return!1;oy.gG(this.ER,c,this.MG,i("aLengthSoFarA"),i("aLengthSoFarB"),2,0),this.ER.cV(e("uStippleCount"),[this.cs.ai().x/this._G.LO,this.cs.ai().y/this._G.LO]).fV(d("uStippleTextureWidthLimiter"),this._G.BO/this._G.LO).fV(e("uStippleScale"),l.getPatternScale()).dV(e("uStippleTexture"),this._G.DO,1)}return oy.AG(this.ft.wi(),this.ER,s,c,this.ft.wi()?4:2,0),oy.VL(this.nN,r.geometry,c,this.vG&&1!==t,1===t,u,1),!0})),this):this}uN(t){return this.pN===t&&{}}dispose(){return super.dispose(),this.bG=void 0,this.xG&&(this.ER.yV(this.xG),this.xG=void 0),this.MG&&(this.ER.yV(this.MG),this.MG=void 0),this._G=void 0,this}OR(){return this}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 Te(this.uu)}bl(){return Te(this.uu)}}class ly extends un{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.wG=[],this.CG=!1,this.kG=!1,this.TG=!1,this.FG=!1,this.lE=new Ym,this.Ha=_e,this.gN=wg({lineStyleSolid:()=>qi(this.uu)&&this.uu,lineStyleDashed:()=>Qn(this.uu)&&this.uu,lineFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},lineFillRadialGradient:()=>{const t=this.uu.getFillStyle();return et(t)&&t},lineFillLinearGradient:()=>{const t=this.uu.getFillStyle();return rt(t)&&t},lineIndividualPointFill:()=>{const t=this.uu.getFillStyle();return X(t)&&t}}),this.nN=t,this.oN=e,this.IG=n,this.ER=t.aN(),this.vG=this.ER.hO,this.PG=t.Yn.Zn;const{color:o,id:h}=this.IG();this.mN=o,this.pN=h}Vr(){const t=this.mu?void 0:this.IG(),e={ys:t=>this.DG(e,t),ds:t=>this.BG(e,t),zg:(t,i)=>this.LG(e,t,i),gR:t=>this.EG(e,t),Di:{x:0,y:0},Ii:{x:0,y:0},Vo:0,zG:void 0,pN:null==t?void 0:t.id,mN:null==t?void 0:t.color};return this.wG.push(e),e}Gt(){var t;return this.wG.length=0,this.CG=!0,this.Zi&&this.Fn&&(null===(t=this.cs.kn)||void 0===t?void 0:t.entity)===this&&this.Fn(this,void 0,this.cs.kn.collectionMember),this}VG(){return this.wG.length}_(t){const e=this.wG[t];return[e.Di,e.Ii]}py(){return this.wG}bd(t){var e;const i=this.wG.indexOf(t);i>=0&&(this.wG.splice(i,1),this.CG=!0,this.Zi&&this.Fn&&(null===(e=this.cs.kn)||void 0===e?void 0:e.entity)===this&&this.Fn(this,void 0,this.cs.kn.collectionMember))}DG(t,e){if(e&&!this.wG.includes(t))this.wG.push(t);else if(!e){const e=this.wG.indexOf(t);this.wG.splice(e,1)}return this.TG=!0,t}BG(t,e){return t.Vo=e,this.kG=!0,t}LG(t,e,i){return t.Di=e,t.Ii=i,this.CG=!0,t}EG(t,e){return t.zG=e,this.FG=!0,t}Ds(){const t=this.Lo._(),e=this.Lo.o,i=this.na(),s=this.uu,r=this.wG,n=this.kG,o=this.CG,h=this.TG,a=this.FG,l=this.gN.lineStyleSolid(i),u=this.gN.lineStyleDashed(i),c=l||u,d=this.gN.lineFillSolid(i),f=this.gN.lineIndividualPointFill(i),g=this.gN.lineFillRadialGradient(i),m=this.gN.lineFillLinearGradient(i),y=d||f||m||g,p=s.O(),x=u?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(u&&this.ft instanceof Pi)return bt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this.lE.mV(this.ft);const S=o||h;if(S){const t=[];for(let e=0;e0&&e;this.bG=i?"triangulated"===x?{type:"triangulated",shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.LineInstanced2D({axisWorldTranslation:Tg(this.ft),normalSource:void 0,snapToNearestPixel:this.PG,ensureMinimumSegmentLength:void 0!==this.pu}),this.vG?em.AliasedEdge:void 0,u&&em.StippleTextureInstanced,em.AttributeHighlight),mousePicking:t?{shader:this.ER.az(em["2D"],this.mu?em.MousePicking:em.MousePickingAttribute,em.LineInstanced2D({axisWorldTranslation:Tg(this.ft),normalSource:void 0,snapToNearestPixel:this.PG,ensureMinimumSegmentLength:void 0!==this.pu}),u&&em.StippleTextureInstanced,em.AttributeHighlight)}:void 0,geometry:ny(this.ER,p,!1),thickness:p,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:m,fillStyleRadialGradient:g}:{type:"primitive",shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0,snapToNearestPixel:this.PG}),em.AttributeHighlight),mousePicking:t?{shader:this.ER.az(em["2D"],this.mu?em.MousePicking:em.MousePickingAttribute,em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0,snapToNearestPixel:this.PG}),em.AttributeHighlight)}:void 0,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:m,fillStyleRadialGradient:g}:void 0}if(u){if(i||S){const t=new Float32Array(4*r.length);let e=0;for(let i=0;i{t[e]=i.Vo,e+=1})),this.OG=this.ER.oV(t,!0,this.OG)}else{const t=new Float32Array(2*r.length);let e=0;r.forEach((i=>{for(let s=e;s{const s=i.zG||f.color;t[e]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=s.a,e+=4})),this.NG=this.ER.oV(t,!1,this.NG)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{const s=i.zG||f.color;for(let i=e;i{var s,r,n,o;t[e+0]=(null===(s=i.mN)||void 0===s?void 0:s.r)||0,t[e+1]=(null===(r=i.mN)||void 0===r?void 0:r.g)||0,t[e+2]=(null===(n=i.mN)||void 0===n?void 0:n.b)||0,t[e+3]=(null===(o=i.mN)||void 0===o?void 0:o.a)||0,e+=4})),this.GG=this.ER.oV(t,!0,this.GG)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{var s,r,n,o;for(let h=e;h{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(g("uScaleStart_highpart"),this.lE.OO()).cV(g("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Pi&&this.ER.cV(g("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(g("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(g("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(g("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),this.PG&&this.ER.cV(g("uViewportSizePx"),[this.cs.ai().x*this.ER.Xz(),this.cs.ai().y*this.ER.Xz()]),void 0!==this.pu&&this.ER.cV(e("uMinSegmentPixelVector"),[this.pu.x,this.pu.y]),this.ER.gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1===t)if(this.mu)this.ER.gR(e("uColor"),this.mN);else{if(!r)return!1;"triangulated"===o?this.ER.uV(r,1,{location:d("aColor"),size:4}):this.ER.$V(d("aColor"),r)}else if(h)this.ER.gR(e("uColor"),h.getColor());else if(a){if(!this.NG)return!1;this.ER.uV(this.NG,"triangulated"===o?1:void 0,{location:d("aColor"),size:4})}else if(u){if(!this._N)return!1;this.ER.mO(f,this._N,u)}else if(l){if(!this.wN)return!1;this.ER.yO(f,this.wN,l)}if(c){if(!this.MG||!this._G)return!1;oy.mG(this.ER,f,this.MG,d("aLengthSoFarA"),d("aLengthSoFarB"),2,0),this.ER.cV(e("uStippleCount"),[this.cs.ai().x/this._G.LO,this.cs.ai().y/this._G.LO]).fV(g("uStippleTextureWidthLimiter"),this._G.BO/this._G.LO).fV(e("uStippleScale"),c.getPatternScale()).dV(e("uStippleTexture"),this._G.DO,0)}if("triangulated"===o){const{geometry:e,thickness:r}=n;oy.pG(this.ft.wi(),this.ER,i,f,this.ft.wi()?4:2,0),this.ER.uV(s,1,{location:d("aIsHighlighted"),size:1}),oy.VL(this.nN,e,f,this.vG&&1!==t,1===t,r,this.wG.length)}else hy.pG(this.ft.wi(),this.ER,i,f,this.ft.wi()?4:2,0),this.ER.XV(d("aIsHighlighted"),s),hy.SG(this.nN,this.wG.length);return!0})),this):this}uN(t){if(t===this.pN)return{};const e=this.wG.find((e=>e.pN===t));return!!e&&{collectionMember:e}}dispose(){return super.dispose(),this.bG=void 0,this.xG&&(this.ER.yV(this.xG),this.xG=void 0),this.MG&&(this.ER.yV(this.MG),this.MG=void 0),this.OG&&(this.ER.yV(this.OG),this.OG=void 0),this.GG&&(this.ER.yV(this.GG),this.GG=void 0),this.NG&&(this.ER.yV(this.NG),this.NG=void 0),this._G=void 0,this}OR(){return this}ds(t){super.ds(t);for(const e of this.wG)e.ds(t);return this}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 Te(this.uu)}bl(){return Te(this.uu)}}class uy{constructor(t,e){this.WG=!1,this.UG=!1,this.YG=!1,this.ft=t,this.HG=e,this.HG.Yo("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.WG="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.WG="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.UG=!0),!0===t.regularProgressiveStep&&(this.YG=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.WG?t[0].x:t[0].y,end:"x"===this.WG?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.WG?"x"===this.WG?function(t){const e=t.length;if(e>0){const i=Math.max(t[e-1].x,t[0].x),s=Math.min(t[e-1].x,t[0].x);let r=t[0].y,n=t[0].y;for(let i=0;ir&&(r=e.y),e.y0){const i=Math.max(t[e-1].y,t[0].y),s=Math.min(t[e-1].y,t[0].y);let r=t[0].x,n=t[0].x;for(let i=0;ir&&(r=e.x),e.x{!1===t.allowDataGrouping&&(this.$G=!0)}))}QG(t,e=!1){if(this.$G||!this.WG||"linear"!==this.ZG.type)return!1;!1===e&&this.JG&&(clearTimeout(this.JG),this.JG=void 0);const i="x"===this.WG?this.ZG.scale.x.sg:this.ZG.scale.y.sg;if(!i)throw new Error("CP helper has no information about Axis state.");const s=t.length;if(s<2)return!1;const r=t[0],n=t[s-1],o=this.calculateAvgStepBetweenDataPoints("x"===this.WG?r.x:r.y,"x"===this.WG?n.x:n.y,s),h=this.ZG.scale,a=Math.abs("x"===this.WG?h.Ui().x:h.Ui().y),l=a/o,u=Math.floor(l*cy),c=u*o,d=bt.performance.now(),f=!(d-i.lh<500)&&(i.sh?d-i.ah<1e3:d-i.eh<2e3||i.rh),g=s>2*this.XG.totalDataPointsAtTime;if(f&&!g)return this.JG=setTimeout((()=>this.KG(t)),1e3),!1;const m=u>=10,y=this.XG.enabled?this.XG.columnWidthAxis/a<1.5:void 0,p=this.XG.enabled&&u>this.XG.dataPointsPerColumn?u/this.XG.dataPointsPerColumn>=2:void 0;let x;!0===this.XG.enabled?y?p&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):x=m?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:m&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const S=!1===e;return x?(S&&(this.XG=x),!0):(S&&(this.XG={...this.XG,totalDataPointsAtTime:s}),!1)}Zp(){this.qG=void 0,this.jG.length=0,this.JG&&(clearTimeout(this.JG),this.JG=void 0)}tW(t){if(0===t.length)return t;if(this.$G||!this.WG||"linear"!==this.ZG.type||!this.XG.enabled)return t;let e;e=this.jG.length>0?ne(this.jG,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.qG,h=-1,a=-1,l=0,u=0;if("x"!==this.WG||this.UG)if("x"===this.WG&&this.UG){const t=this.XG.columnWidthAxis;let c=this.qG?this.qG.x:e[0].x,d=c-t;for(let f=0;f=d?((!r||i.y>r.y)&&(r=i,h=f),(!n||i.y=d?((!r||i.x>r.x)&&(r=i,h=f),(!n||i.xr.x)&&(r=i,h=f),(!n||i.xr.y)&&(r=i,h=f),(!n||i.y0&&(this.qG=s[c-1]),s}iW(t){if(this.WG&&"linear"===this.ZG.type){const e="x"===this.WG?this.ZG.scale.x.sg:this.ZG.scale.y.sg;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Ke===zs.progressive||e.Ke===zs.regressive){const e=Math.abs("x"===this.WG?this.ZG.scale.x.getInnerInterval():this.ZG.scale.y.getInnerInterval());if(this.XG.enabled)return 2*e/this.XG.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.WG?s.x:s.y,"x"===this.WG?r.x:r.y,i)}}}sW(t,e,i){if(!this.WG)return e;const s=i.length;let r=Nr(i,t.min,this.WG,this.UG,0,s-1);void 0===r&&(r=this.UG?s-1:0);let n=Nr(i,t.max,this.WG,this.UG,0,s-1);return void 0===n&&(n=this.UG?0:s-1),1+Math.abs(n-r)}eW(){this.JG&&(clearTimeout(this.JG),this.JG=void 0)}KG(t){this.QG(t,!0)&&this.vs()}}class fy extends uy{renderVisibleOnly(t,e){const i=this.ft.x.getInnerStart(),s=this.ft.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.ft.y.getInnerStart(),h=this.ft.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);t.forEach(((t,i)=>{t.existingCoordinatesCount<=1||t.boundaries.max.xn||t.boundaries.max.yl||e(t)}))}}class gy{constructor(t,e,i){this.hW=e,this.rW=i,this.nW=t,this.oW=[]}aW(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.nW[this.nW.length-1];do{const t=this.nW.length;let r;h||(h=this.lW(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.rW&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.nW[t-1].lastDataPoint;e?(n.splice(0,0,e),a=1,o+=1):console.error("SegmentationHelper _connectSegments = true, but segment has no lastDataPoint information!")}if(h)r=Math.min(o,h.allocatedCoordinatesCount-h.existingCoordinatesCount),s(h,n.slice(0,r),r,a);else{const t=Math.ceil(e)+a;r=Math.min(t,o);const s={...i(t,n.slice(0,r),r,a),isDropped:!1};this.nW.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.uW()}cW(t){const e=t,i=this.nW.indexOf(e);i>=0&&this.nW.splice(i,1),e.droppedTimestamp=bt.performance.now(),this.oW.push(e)}dW(){this.nW.slice().forEach((t=>this.cW(t)))}fW(){this.nW.forEach((t=>this.hW(t))),this.oW.forEach((t=>this.hW(t))),this.nW.length=0,this.oW.length=0}lW(t,e){const i=2*t/3,s=4*t/3,r=this.oW.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.oW[r];return this.oW.splice(r,1),this.nW.push(t),t}}uW(){if(this.oW.length>5){const t=bt.performance.now();for(let e=0;e=1e4)&&(this.hW(i),this.oW.splice(e,1),e-=1)}}}}class my extends uy{AW(t,e){if(!e||"object"!=typeof e)return 0;const i=this.ft.x.getInnerStart(),s=this.ft.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.ft.y.getInnerStart(),h=this.ft.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);if("maxDataPointCount"in e)return this.gW(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.pW(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.mW(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}gW(t,e,i,s,r,n){if(void 0===e||e<=0)return 0;const o=t.reduce(((t,e)=>t+e.existingDataPointsCount),0);if(o<=e)return 0;let h=0,a=o;for(let i=0;ie&&(h+=1,a-=s.existingDataPointsCount)}return h}mW(t,e,i,s,r,n){if(void 0===e||!this.WG)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.WG?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.WG?a.boundaries.max.x2))break;o+=1}return o}pW(t,e,i,s,r,n){if(void 0===e||0===e)return 0;let o=0,h=0;for(let a=t.length-1;a>=0;a-=1){const l=t[a];if(h>e)if(this.WG){if(this.UG?"x"===this.WG?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.WG?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}yW(t,e){const i=t.reduce(((t,e)=>Je(t,e.boundaries)),_e);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.WG||this.UG?"x"===this.WG&&this.UG?i.max.x=Math.min(i.max.x,t):"y"!==this.WG||this.UG?"y"===this.WG&&this.UG&&(i.max.y=Math.min(i.max.y,t)):i.min.y=Math.max(i.min.y,t):i.min.x=Math.max(i.min.x,t)}return i}}class yy extends cn{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r),this.lE=new Ym,this.JM=[],this.SW=new fy(this.ft,this),this.vW=new dy(this.ft,this,(()=>this.cs.vs())),this.xW=new gy(this.JM,(t=>{t.coordsBuffer&&this.ER.yV(t.coordsBuffer),t.MG&&this.ER.yV(t.MG)}),!0),this.bW=new my(this.ft,this),this.MW=0,this._W=0,this.wW=!1,this.gN=wg({lineStyleSolid:()=>qi(this.uu)&&this.uu,lineStyleDashed:()=>Qn(this.uu)&&this.uu,strokeFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.uu.getFillStyle();return rt(t)&&t},strokeFillRadialGradient:()=>{const t=this.uu.getFillStyle();return et(t)&&t},strokeFillPaletted:()=>{const t=this.uu.getFillStyle();return j(t)&&t}}),this.oN=e,this.pN=n,this.mN=o,this.Yn=h,this.bG={type:"none"},this.ER=t.aN(),this.nN=t,this.vG=this.ER.hO;const a=this.ft.wi(),l=!0===(null==h?void 0:h.individualLookupValuesEnabled);let u,c,d,f=0;a||(u=f,f+=2),a&&(c=f,f+=4),l&&(d=f,f+=1);const g=((t,e)=>e?(e,i)=>((t,e)=>{if(!e){const e=t.length,i=new Float32Array(3*e);for(let s=0,r=0;sJt(e,t))(a,l);this.kW={individualLookupValuesEnabled:l,attributesPerVertex:f,attributeOffsetCoordinateLowPrecision:u,attributeOffsetCoordinateHighPrecision:c,attributeOffsetLookUpValue:d,prepareRenderData:(t,e)=>g(t,this.uu.getFillStyle())}}TW(t,e,i){const s=new Float32Array(2*e);let r=0,n=i||t[0];for(let i=0;i0,o=this.Lo._(),h=this.Lo.o,a=this.gN.lineStyleSolid(i),l=this.gN.lineStyleDashed(i),u=a||l,c=u&&u.getThickness(),d=this.gN.strokeFillSolid(i),f=this.gN.strokeFillLinearGradient(i),g=this.gN.strokeFillRadialGradient(i),m=this.gN.strokeFillPaletted(i),y=d||f||g||m,p=this.kW.individualLookupValuesEnabled;if(l&&this.ft instanceof Pi)return bt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;n&&(this.yu=ne(this.yu,s,{canReturnB:!0}),this.$a+=r);let x=this.Su.o;const S=this.bW.AW(this.JM,this.Su._());if(S>0){let t=0;for(let e=0;e{t.MG&&(this.ER.yV(t.MG),t.MG=void 0)})),this.wW=!1),v&&(this.vW.Zp(),this.JM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=_e,t.lastDataPoint=void 0})),this.xW.dW(),A=this.yu,this.MW=0,this._W=0);const b=this.vW.tW(A),M=b.length;if(M>0){let t=this.vW.iW(this.yu)||(this.Yo("ApplicationType",(t=>"InternalUI"===t.type))?this.$a:1e5);M/t>10&&(t=M/10),this.xW.aW(b,t,((t,e,i,s)=>{const r=this.SW.calculateUserDataPointsBoundaries(e),n=this.vW.sW(r,i,this.yu)-s;return this.FW=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:n,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.ER.zV(t*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i)),lastDataPoint:e[i-1],MG:this.wW?this.ER.zV(2*t,this.TW(e,i,this.FW)):void 0}}),((t,e,i,s)=>{const r=Je(t.boundaries,this.SW.calculateUserDataPointsBoundaries(e)),n=this.vW.sW(r,t.existingCoordinatesCount+i,this.yu)-(t.jointPointsCount+s);this.ER.VV(t.coordsBuffer,t.existingCoordinatesCount*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i)),this.wW&&t.MG&&this.ER.VV(t.MG,2*t.existingCoordinatesCount,this.TW(e,i,this.FW)),this.FW=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}if(x&&(this.Ha=this.bW.yW(this.JM,this.Su._())),this.lE.mV(this.ft),g?this.LN=Dm(this.zo||this.Ha,this.ft,g.getPosition(),g.getExtent(),g.getShape(),this.ER.Xz()):f?this.RN=Lm(this.zo||this.Ha,this.ft,f.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),i||h){if(m&&"value"===m.getLookUpProperty()&&!p){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw bt.alert(t),new Error(t)}if(y&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=f?["gradient",f]:g?["gradient",g]:m?["lookup",m.getLookUpProperty(),m.lut]:"uniform";this.bG="primitive"===t?{type:t,shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0}),l&&em.StippleTexture),mousePickingShader:o?this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0}),l&&em.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:"triangulated"===t?{type:t,shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.LineInstanced2D({axisWorldTranslation:Tg(this.ft),normalSource:void 0}),this.vG?em.AliasedEdge:void 0,l&&em.StippleTextureInstanced),mousePickingShader:o?this.ER.az(em["2D"],em.MousePicking,em.LineInstanced2D({axisWorldTranslation:Tg(this.ft),normalSource:void 0}),l&&em.StippleTextureInstanced):void 0,geometry:ny(this.ER,c),thickness:c,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:{type:"none"}}else this.bG={type:"none"}}return this._G=l?this.ER.PO(l.getPattern()):void 0,this.Au(e),this.Ja=!1,this.Xa=[],this.Lo.o=!1,this.Su.o=!1,this}VL(t){const e=this.ER.gl,i=this.bG;if(!i||"none"===i.type)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const{lineStyleDashed:r,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}=i;return this.ER.ZR(s).lV(s,((s,l,u,c)=>{let d=!1;if(this.ER.fV(s("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(s("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(s("uRenderEffectMask"),2===t?1:0),this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(s("uScale"),this.lE.AV()).cV(s("uDisp"),this.lE.gV()).cV(c("uScaleStart_highpart"),this.lE.OO()).cV(c("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Pi&&this.ER.cV(c("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(c("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(c("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(c("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(s("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(s("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(s("uColor"),this.mN);else if(n)this.ER.gR(s("uColor"),n.getColor());else if(h){if(!this.LN)return!1;this.ER.mO(u,this.LN,h)}else if(o){if(!this.RN)return!1;this.ER.yO(u,this.RN,o)}else if(a){const t=kg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.ER.RO(u,a.lut,t)}return this.SW.renderVisibleOnly(this.JM,(n=>{const{coordsBuffer:o}=n;if(!o)return;e.bindBuffer(e.ARRAY_BUFFER,o);const h="triangulated"===i.type?oy.AG:hy.AG;if(this.ft.wi()||void 0===this.kW.attributeOffsetCoordinateLowPrecision?this.ft.wi()&&void 0!==this.kW.attributeOffsetCoordinateHighPrecision&&h(!0,this.ER,o,u,this.kW.attributesPerVertex,this.kW.attributeOffsetCoordinateHighPrecision):h(!1,this.ER,o,u,this.kW.attributesPerVertex,this.kW.attributeOffsetCoordinateLowPrecision),r){if(!n.MG||!this._G)return;"triangulated"===i.type?oy.gG(this.ER,u,n.MG,l("aLengthSoFarA"),l("aLengthSoFarB"),2,0):hy.gG(this.ER,u,n.MG,l("aLengthSoFar"),2,0),this.ER.cV(s("uStippleCount"),[this.cs.ai().x/this._G.LO,this.cs.ai().y/this._G.LO]).fV(c("uStippleTextureWidthLimiter"),this._G.BO/this._G.LO).fV(s("uStippleScale"),r.getPatternScale()).dV(s("uStippleTexture"),this._G.DO,1)}if(a&&"value"===a.lookUpProperty&&void 0!==this.kW.attributeOffsetLookUpValue&&1!==t)if("triangulated"===i.type){const t=l("aLookupValueA");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(t,1),e.enableVertexAttribArray(t);const i=l("aLookupValueB");e.vertexAttribPointer(i,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.kW.attributeOffsetLookUpValue+this.kW.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(i,1),e.enableVertexAttribArray(i)}else{const t=l("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}if("triangulated"===i.type){const{thickness:e}=i;oy.VL(this.nN,i.geometry,u,this.vG&&1!==t,1===t,e,n.existingCoordinatesCount-1)}else hy.yG(this.nN,n.existingCoordinatesCount);d=!0})),e.bindBuffer(e.ARRAY_BUFFER,null),d})),this}uN(t){return this.pN===t&&{}}ol(t,e){return Array.isArray(t)||(t=[t]),this.Xa=ne(this.Xa,t,{canReturnB:!0}),this.Ha=Je(this.Ha,e||e||this.SW.calculateUserDataPointsBoundaries(t)),this}Gt(){return super.Gt(),this.MW=0,this._W=0,this.FW=void 0,this}dispose(){return super.dispose(),this.xW.fW(),this.vW.eW(),this.bG={type:"none"},this._G=void 0,this}OR(){return this}Yb(t){this.ll()>0&&this.Ds();const e=this.il(),i=_r(e,t,this.Qa,this.Il,this.Pl,this.ft,this.engine.ft,this.Ha,this.SW.WG,this.SW.UG);return void 0!==i?e[i]:void 0}ew(t){this.ll()>0&&this.Ds();const e=this.il(),i=e.length;if(0===i)return;const s=this.Il?1:0,r=i-(this.Pl?2:1);if(this.Qa===Lr.Nearest){let s,r,n=Le;for(let o=0;o1}Zm(t,e,i,s,r){return"object"==typeof s?e?this.ER.XV(t.attribute("aOffsetScale"),e,1).cV(t.uniform("uSizePixels"),[s.width,s.height]):this.ER.fV(t.uniform("uOffsetScale"),s.scale).cV(t.uniform("uSizePixels"),[s.width,s.height]):r?e?this.ER.XV(t.attribute("aOffsetPixels"),e,1):this.ER.fV(t.uniform("uOffsetPixels"),s):this.ER.fV(t.uniform("uPointSize"),s),r?this.ER.uV(this.CR,0,{location:t.attribute("aInstanceGeo"),size:2}).JV(this.fG,0,this.DW,i):this.ER.Zm(this.ER.gl.POINTS,i),this}Tz(){this.ER.yV(this.CR)}}const xy=(t,e=0)=>{const i=[u(-.5,-.5),u(.5,-.5),u(.5,.5),u(-.5,.5)];return new py(t,i,t.gl.TRIANGLE_FAN,e)},Sy=(t,e=0)=>{const i=.05,s=[u(-.5,-.05),u(.5,-.05),u(.5,i),u(.5,i),u(-.5,i),u(-.5,-.05),u(-.05,-.5),u(i,-.5),u(i,.5),u(i,.5),u(-.05,.5),u(-.05,-.5)];return new py(t,s,t.gl.TRIANGLES,e)},Ay=(t,i,s)=>{if(io(t))return Ay(e.PointShape.Square,i,s);let r=i.wV.xz.get(t);if(t===e.PointShape.Circle){const t=s<=3?4:s<=5?8:s<=10?16:24;return r=i.wV.bz.get(t)||((t,e,i=0)=>{const s=function(t=25){return md(u(0,0),0,360,.5,.5,t)[0]}(e);return new py(t,s,t.gl.TRIANGLE_FAN,i)})(i,t),i.wV.bz.set(t,r),r}if(!r){switch(t){case e.PointShape.Triangle:r=((t,e=0)=>{const i=function(){const t=[],e=2/1.73205080757;return t.push(u(-e/2,.3333333333333333)),t.push(u(0,-.6666666666666666)),t.push(u(e/2,.3333333333333333)),t}();return new py(t,i,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Square:r=xy(i);break;case e.PointShape.Plus:r=Sy(i);break;case e.PointShape.Cross:r=Sy(i,45);break;case e.PointShape.Diamond:r=xy(i,45);break;case e.PointShape.Arrow:r=((t,e=0)=>{const i=.05,s=[u(-.05,-.5),u(i,-.5),u(i,.45),u(i,.45),u(-.05,.45),u(-.05,-.5),u(-.5,0),u(-.4,0),u(0,.4),u(0,.4),u(0,.5),u(-.5,0),u(.5,0),u(.4,0),u(0,.4),u(0,.4),u(0,.5),u(.5,0)];return new py(t,s,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Star:r=((t,e=0)=>new py(t,[{x:0,y:0},{x:0,y:.5},{x:.1,y:.1},{x:.5,y:.1},{x:.2,y:-.1},{x:.3,y:-.5},{x:0,y:-.25},{x:-.3,y:-.5},{x:-.2,y:-.1},{x:-.5,y:.1},{x:-.1,y:.1},{x:0,y:.5}],t.gl.TRIANGLE_FAN,e))(i);break;case e.PointShape.Minus:r=((t,e=0)=>{const i=.05,s=[u(-.5,-.05),u(.5,-.05),u(.5,i),u(.5,i),u(-.5,i),u(-.5,-.05)];return new py(t,s,t.gl.TRIANGLES,e)})(i);break;default:return be(0,"LightningChart JS unidentified point shape")}i.wV.xz.set(t,r)}return r};class vy extends tn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.fN=m(c(Ve,Ve),c(Le,Le)),this.gN=wg({pointStyleSolid:()=>Y(this.be)&&this.be,pointStyleRadialGradient:()=>et(this.be)&&this.be,pointStyleLinearGradient:()=>rt(this.be)&&this.be,pointStylePaletted:()=>j(this.be)&&this.be,pointStyleIndividual:()=>X(this.be)&&this.be}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN()}Ds(){var t;const e=this.Lo._(),i=this.Lo.o,s=this.Xa,r=s.length,n=r>0,o=this.Ga._(),h=this.be,a=this.size._(),l=this.Ga.o||this.ga.o,u=this.ft.Gi(),c=this.size.o||this.Ga.o,d=this.Ja||s&&s.length>0,f=u||c,g=this.ia(),m=this.gN.pointStyleSolid(g),y=this.gN.pointStyleRadialGradient(g),p=this.gN.pointStyleLinearGradient(g),x=this.gN.pointStylePaletted(g),S=this.gN.pointStyleIndividual(g),A=m||y||p||x||S;if(n&&(this.Na=ne(this.Na,s,{canReturnB:!0}),this.$a+=r),n||this.Ja){this.Ha=this.Za?Je(this.Ha,this.Za):Je(this.Ha,Ze(this.Na));const t=Jt(this.Na,this.ft.wi());this.RW=this.$a,this.EW=this.ER.oV(t,!1,this.EW)}this.lE.mV(this.ft),h!==z?f&&(this.zW&&(this.zW=void 0),a>1||this.Wa._()?a<=1&&!this.Wa._()?this.fG=this.ER.gl.POINTS:(this.zW=Ay(o,this.ER,this.Wa._()?25:a),this.fG=this.zW.fG):this.fG=this.ER.gl.POINTS):this.zW&&(this.zW=void 0);const v=(null===(t=this.zW)||void 0===t?void 0:t.BW)||0,b=this.ga._()+v;if(c||g||i||l){const t=this.Wa._()?"attribute":"uniform",i=a<=1&&em.PointSize(t),s=em.VertexLocation({offset:a>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:(this.Ua._()||b%360!=0)&&{dataType:this.Ua._()?"attribute":"uniform"}}:void 0,axisWorldTranslation:Tg(this.ft),normalSource:void 0});this.dE=A?this.ER.az(em["2D"],i,s,m?em.Color({dataType:"uniform"}):S?em.Color({dataType:"attribute"}):x?em.Color({dataType:["lookup",x.getLookUpProperty(),x.lut]}):y?em.Color({dataType:["gradient",y]}):p?em.Color({dataType:["gradient",p]}):void 0):void 0,this.zN=e&&A?this.ER.az(em["2D"],i,s,em.MousePicking):void 0}if(d||g){const t=this.Na.length;if(X(h)&&this.RW&&this.RW>0){const e=h.getFallbackColor(),i=new Float32Array(4*t);for(let s=0;s0&&a>1){const e=new Float32Array(t);for(let i=0;i0&&a>1){const e=new Float32Array(2*t),i=gi(b),s=Math.sin(i),r=Math.cos(i);for(let i=0;i0){const e=new Float32Array(t);for(let i=0;it&&(t=s.value)}this.Ka={min:e,max:t}}return this.sa=h,this.Ga.o=!1,this.size.o=!1,this.ga.o=!1,this.Lo.o=!1,this.Ja=!1,this}VL(t){const e=1===t?this.zN:this.dE,i=this.EW,s=this.RW;return e&&i&&s&&(this.ER.ZR(e),this.ER.lV(e,((e,r,n,o)=>{var h;if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(o("uScaleStart_highpart"),this.lE.OO()).cV(o("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Pi&&this.ER.cV(o("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(o("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(o("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(o("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),this.ER.xO(n,i,this.ft.wi(),this.zW?1:void 0).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).fV(o("uDevicePixelRatio"),this.ER.Xz()),this.zW){const t=r("aInstanceGeo");this.ER.WV(t,this.zW.CR).YV(t,0)}if(1===t)this.ER.gR(e("uColor"),this.mN);else if(Y(this.be))this.ER.gR(e("uColor"),this.be.getColor());else if(X(this.be)&&this.VW){const t=r("aColor");this.ER.$V(t,this.VW),this.fG!==this.ER.gl.POINTS&&this.ER.YV(t,1)}else if(j(this.be)){if("value"===this.be.getLookUpProperty()&&this.GW){const t=r("aLookupValue");this.ER.XV(t,this.GW),this.fG!==this.ER.gl.POINTS&&this.ER.YV(t,1)}const t=kg(this.be,this,this.Ka);if(!t&&this.be.lut.percentageValues)return!1;this.ER.RO(n,this.be.lut,t)}else if(et(this.be)){if(!this._N)return!1;this.ER.mO(n,this._N,this.be)}else if(rt(this.be)){if(!this.wN)return!1;this.ER.yO(n,this.wN,this.be)}if(this.OW&&this.fG!==this.ER.gl.POINTS){const t=r("aOffsetPixels");this.ER.XV(t,this.OW),this.fG!==this.ER.gl.POINTS&&this.ER.YV(t,1)}else if(this.fG!==this.ER.gl.POINTS){const t=e("uOffsetPixels");this.ER.fV(t,this.size._())}const a=((null===(h=this.zW)||void 0===h?void 0:h.BW)||0)+this.ga._();if(this.NW&&this.fG!==this.ER.gl.POINTS){const t=r("aRot");this.ER.WV(t,this.NW),this.fG!==this.ER.gl.POINTS&&this.ER.YV(t,1)}else if(this.fG!==this.ER.gl.POINTS&&a%360!=0){const t=gi(a),i=Math.sin(t),s=Math.cos(t);this.ER.cV(e("uRot"),[i,s])}if(this.fG===this.ER.gl.POINTS)this.ER.fV(e("uPointSize"),this.size._());else{const t={x:2/this.cs.ai().x,y:2/this.cs.ai().y};this.ER.cV(e("uRatioPxClip"),[t.x,t.y])}let l=!1;return this.fG===this.ER.gl.POINTS?(this.ER.Zm(this.fG,s),l=!0):this.zW&&(this.ER.JV(this.fG,0,this.zW.DW,s),l=!0),l}))),this}uN(t){return this.pN===t&&{}}$c(t){this.ll()>0&&this.Ds();const e=this.il(),i=_r(e,t,this.Qa,!1,!1,this.ft,this.cs.ft,this.Ha,void 0,void 0);return void 0!==i?e[i]:void 0}ke(t){return super.ke(t)}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 this.Wa._()?25:this.size._()}bl(){return this.Wa._()?25:this.size._()}OR(){return this.EW&&(this.ER.yV(this.EW),this.EW=void 0),this.zW&&(this.zW=void 0),this.VW&&(this.ER.yV(this.VW),this.VW=void 0),this.NW&&(this.ER.yV(this.NW),this.NW=void 0),this.GW&&(this.ER.yV(this.GW),this.GW=void 0),this}}class by extends Jr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.bG={fill:void 0,border:void 0},this.lE=new Ym,this.Ha=_e,this.WW=!1,this.UW=!1,this.YW=!1,this.HW=!1,this.$W=!1,this.vd=[],this.gN=wg({polygonStyleSolid:()=>Y(this.be)&&this.be,polygonStyleImage:()=>Zn(this.be)&&this.be,polygonStyleRadialGradient:()=>et(this.be)&&this.be,polygonStyleLinearGradient:()=>rt(this.be)&&this.be,polygonStylePaletted:()=>j(this.be)&&this.be,polygonStyleIndividual:()=>X(this.be)&&this.be,lineStyleSolid:()=>qi(this.Me)&&this.Me,lineStyleFilled:()=>{const t=this.Me&&this.Me.getFillStyle();return Y(t)&&t}}),this.nN=t,this.oN=e,this.IG=n,this.ER=t.aN(),this.vG=this.ER.hO}Vr(){const t=this.IG(),e={ys:t=>this.DG(e,t),ds:t=>this.BG(e,t),Sl:t=>this.XW(e,t),Jx:t=>this.jW(e,t),gR:t=>this.EG(e,t),Na:[],S:void 0,ZW:void 0,Vo:0,QW:!0,pN:t.id,mN:t.color};return this.vd.push(e),e}Gt(){var t;return this.vd.length=0,this.WW=!0,this.Zi&&this.Fn&&(null===(t=this.cs.kn)||void 0===t?void 0:t.entity)===this&&this.Fn(this,void 0,this.cs.kn.collectionMember),this}py(){return this.vd}bd(t){var e;const i=this.vd.indexOf(t);i>=0&&(this.vd.splice(i,1),this.$W=!0,this.Zi&&this.Fn&&(null===(e=this.cs.kn)||void 0===e?void 0:e.entity)===this&&this.cs.kn.collectionMember===t&&this.Fn(this,void 0,this.cs.kn.collectionMember))}DG(t,e){var i;return t.QW=e,this.$W=!0,this.Zi&&this.Fn&&(null===(i=this.cs.kn)||void 0===i?void 0:i.entity)===this&&this.cs.kn.collectionMember===t&&this.Fn(this,void 0,this.cs.kn.collectionMember),t}BG(t,e){return t.Vo=e,this.HW=!0,t}XW(t,e){return t.Na=e,this.WW=!0,t}jW(t,e){return t.S=e,this.UW=!0,t}EG(t,e){return t.ZW=null==e?void 0:e.toUint32(),this.YW=!0,t}Ds(){const t=this.Lo._(),e=this.Lo.o,i=this.ia(),s=this.HW,r=this.WW,n=this.UW,o=this.YW,a=this.$W,l=this.Me,u=this.na(),c=this.vd.filter((t=>t.QW&&t.Na.length>0));if(this.lE.mV(this.ft),(r||a)&&(this.Ha=Je(...c.map((t=>Ze(t.Na))))),r||a){const t=Jt(c.map((t=>[...t.Na,t.Na[0],{x:Number.NaN,y:Number.NaN}])).flat(),this.ft.wi()),e=this.ft.wi()?4:2;this.xG=this.ER.oV(t,!1,this.xG);let i=[];c.reduce(((s,r)=>{const n=s,o=(r.Na.length+1)*e,a=new Float32Array(t.buffer,n,o),l=h.default(a,void 0,e),u=s/(Float32Array.BYTES_PER_ELEMENT*e);for(let t=0;tt+e.Na.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Na.length+2;for(let r=i;rt+e.Na.length+2),0),e=new Float32Array(4*t);let i=0;c.forEach((t=>{const s=t.Na.length+2;for(let r=i;rt+e.Na.length+2),0),e=new Float32Array(t);let i=0;const s={min:Le,max:Ve};c.forEach((t=>{const r=void 0!==t.S?t.S:-34028234663852886e22,n=t.Na.length+2;for(let t=i;tt+e.Na.length+2),0),e=new Uint32Array(t);let i=0;const s=g?g.getFallbackColor().toUint32():R.toUint32();c.forEach((t=>{const r=void 0!==t.ZW?t.ZW:s,n=t.Na.length+2;for(let t=i;tthis.nU(t,e,i,c))),this.HW=!1,this.$W=!1,this.WW=!1,this.UW=!1,this.YW=!1,this.Lo.o=!1,this.ra(this.be),this.la(l),this}VL(t){var e,i;const{fill:s,border:r}=this.bG,n=this.xG,o=this.tU,h=this.iU;if(!n||!o)return this;if(s){const{fillStyleSolid:i,fillStyleLinearGradient:r,fillStyleRadialGradient:a,fillStylePaletted:l,fillStyleImage:u,fillStyleIndividual:c}=s,d=this.JW,f=this.KW,g=1===t?null===(e=s.mousePicking)||void 0===e?void 0:e.shader:s.shader;if(!g||!n||!d||void 0===f)return this;this.ER.ZR(g).lV(g,((e,s,g,m)=>{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(m("uScaleStart_highpart"),this.lE.OO()).cV(m("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Pi&&this.ER.cV(m("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(m("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(m("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(m("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),this.ER.xO(g,n,this.ft.wi(),void 0).jV(d).XV(s("aIsHighlighted"),o).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.ER.$V(s("aColor"),h)}else if(i)this.ER.gR(e("uColor"),i.getColor());else if(a){if(!this._N)return!1;this.ER.mO(g,this._N,a)}else if(r){if(!this.wN)return!1;this.ER.yO(g,this.wN,r)}else if(l){const t=kg(l,this,this.sU);if(!t&&l.lut.percentageValues)return!1;if(this.ER.RO(g,l.lut,t),"value"===l.getLookUpProperty()){if(!this.eU)return!1;this.ER.XV(s("aLookupValue"),this.eU)}}else if(u){if(!this.rU)return!1;this.ER.gR(m("uColor"),u.getSurroundingColor()).dV(e("uColorTexture"),this.rU.texture.Wz()||this.rU.sourceMissingTexture,0).uV(this.rU.texCoordsBuffer,void 0,{location:s("aTextureCoord"),size:2}).RV(u.fitMode)}else if(c){if(!this.hU)return!1;const t=s("aColor");this.ER.gl.bindBuffer(this.ER.gl.ARRAY_BUFFER,this.hU),this.ER.gl.vertexAttribPointer(t,4,this.ER.gl.UNSIGNED_BYTE,!0,0,0),this.ER.gl.enableVertexAttribArray(t)}return this.ER.QV(f,void 0,void 0,this.ER.gl.UNSIGNED_INT),!0}))}if(r){const{geometry:e,fillStyleSolid:s,thickness:a}=r,l=this.qW,u=1===t?null===(i=r.mousePicking)||void 0===i?void 0:i.shader:r.shader;if(!u||!n||!l)return this;this.ER.ZR(u).lV(u,((i,r,u,c)=>{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(i("uScale"),this.lE.AV()).cV(i("uDisp"),this.lE.gV()).cV(c("uScaleStart_highpart"),this.lE.OO()).cV(c("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Pi&&this.ER.cV(c("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(c("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(c("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(c("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(i("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(i("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),this.ER.uV(o,1,{location:r("aIsHighlighted"),size:1}).gR(i("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.ER.uV(h,1,{location:r("aColor"),size:4})}else s&&this.ER.gR(i("uColor"),s.getColor());return oy.AG(this.ft.wi(),this.ER,n,u,this.ft.wi()?4:2,0),oy.VL(this.nN,e,u,this.vG&&1!==t,1===t,a,l),!0}))}return this}nU(t,e,i,s){const r=dt({x:this.Ha.min.x,y:this.Ha.min.y},this.ft,this.cs.ft),n=dt({x:this.Ha.max.x,y:this.Ha.max.y},this.ft,this.cs.ft),o={x:Math.abs(r.x-n.x),y:Math.abs(r.y-n.y)},h=Bm(t,e,o.x,o.y,i),a=h[1],l=h[4],u=h[6],c=h[7],d=s.reduce(((t,e)=>t+e.Na.length+2),0),f=new Float32Array(2*d),g=this.Ha.max.x-this.Ha.min.x,m=this.Ha.max.y-this.Ha.min.y,y=l-u,p=c-a;let x=0;for(const t of s){for(const e of t.Na){const t=u+y*((e.x-this.Ha.min.x)/g),i=a+p*((e.y-this.Ha.min.y)/m);f[x]=t,f[x+1]=i,x+=2}const e=u+y*((t.Na[0].x-this.Ha.min.x)/g),i=a+p*((t.Na[0].y-this.Ha.min.y)/m);f[x]=e,f[x+1]=i,x+=2,f[x]=Number.NaN,f[x+1]=Number.NaN,x+=2}return f}uN(t){const e=this.vd.find((e=>e.pN===t));return!!e&&{collectionMember:e}}OR(){return this.JW&&(this.ER.yV(this.JW),this.JW=void 0),this.xG&&(this.ER.yV(this.xG),this.xG=void 0),this.tU&&(this.ER.yV(this.tU),this.tU=void 0),this.iU&&(this.ER.yV(this.iU),this.iU=void 0),this.eU&&(this.ER.yV(this.eU),this.eU=void 0),this.hU&&(this.ER.yV(this.hU),this.hU=void 0),this.bG={fill:void 0,border:void 0},this.rU=this.ER.zO(this,this.rU),this}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 Te(this.Me)}bl(){return Te(this.Me)}}class My extends en{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.oU=_e,this.gN=wg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStyleRadialGradient:()=>et(this.be)&&this.be,fillStyleLinearGradient:()=>rt(this.be)&&this.be,fillStyleImage:()=>Zn(this.be)&&this.be,strokeStyleSolid:()=>qi(this.Me)&&this.Me,strokeFillSolid:()=>{const t=this.Me.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.Me.getFillStyle();return rt(t)&&t},strokeFillRadialGradient:()=>{const t=this.Me.getFillStyle();return et(t)&&t}}),this.nU=(t,e,i)=>{const s=dt(this.Ia(),this.ft,this.cs.ft),r=hi(dt(oi(this.Ia(),this.ai()),this.ft,this.cs.ft),s);return Bm(t,e,r.x,r.y,i)},this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN(),this.oN=e}Ds(){super.Ds();const t=this.Lo._(),e=this.ia(),i=this.ca.o||this.j.o||this.ga.o||this.ma.o,s=this.Me,r=this.na(),n=s.getThickness(),o=this.ga._();this.lE.mV(this.ft);const h=this.ft.Gi();if(i){const t=this.j._();this.Na=function(t,e,i,s,r){const n=((t,e,i)=>[t,u(t.x+e,t.y),u(t.x+e,t.y+i),u(t.x,t.y+i)])(t,e,i);if(0!==s||s%360!=0){const t=s*Math.PI/180;n[0]=ti(n[0],r,t),n[1]=ti(n[1],r,t),n[2]=ti(n[2],r,t),n[3]=ti(n[3],r,t)}return n}(this.ca._(),t.x,t.y,o,this.ma._());const e=Jt(this.Na,this.ft.wi());this.vN=this.ER.oV(e,!1,this.vN),this.bN=this.Na.length,this.oU=Ze(this.Na)}const a=this.gN.fillStyleSolid(e),l=this.gN.fillStyleRadialGradient(e),c=this.gN.fillStyleLinearGradient(e),d=this.gN.fillStyleImage(e),f=a||l||c||d;e&&(this.CN=f?this.ER.az(em["2D"],a&&em.Color({dataType:"uniform"}),c&&em.Color({dataType:["gradient",c]}),l&&em.Color({dataType:["gradient",l]}),d&&em.Color({dataType:["image",d]}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})):void 0),l?this._N=Dm(this.zo||this.oU,this.ft,l.getPosition(),l.getExtent(),l.getShape(),this.ER.Xz()):c?this.wN=Lm(this.zo||this.oU,this.ft,c.getAngle(!0),this.ER.Xz()):(this._N=void 0,this.wN=void 0),this.rU=this.ER.EO(this,this.rU,d,void 0,h||i,this.nU);const g=this.gN.strokeStyleSolid(r),m=this.gN.strokeFillSolid(r),y=this.gN.strokeFillLinearGradient(r),p=this.gN.strokeFillRadialGradient(r),x=g,S=m||y||p;if(x&&(i||r||h&&1!==n)){if(1===n||-1===n)[this.kN,this.aU]=[this.Na,void 0];else{const t=this.ft;[this.kN,this.aU]=t instanceof Pi?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.Yi(s,r,h,-h),i.Yi(r,s,-h,-h),i.Yi(o,n,-h,-h),i.Yi(n,o,h,-h),i.Yi(s,r,-h,h),i.Yi(r,s,h,h),i.Yi(o,n,h,h),i.Yi(n,o,-h,h)],[0,4,5,0,5,1,1,5,7,1,3,7,3,7,6,3,2,6,2,4,0,2,6,4]]})(this.Na,n,t):((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=u(e.x*i*.5,e.y*i*.5),a=ii(ei(r,s)),l=ii(ei(o,s)),c=ui(a),d=ui(l);return[[oi(s,oi(ni(c,h.x),ni(d,h.y))),oi(r,oi(ni(a,h.x),ni(d,h.y))),oi(o,oi(ni(c,h.x),ni(l,h.y))),oi(n,oi(ni(a,h.x),ni(l,h.y))),oi(s,oi(ni(a,h.x),ni(l,h.y))),oi(r,oi(ni(c,h.x),ni(l,h.y))),oi(o,oi(ni(a,h.x),ni(d,h.y))),oi(n,oi(ni(c,h.x),ni(d,h.y)))],[0,4,5,0,5,1,1,5,7,1,3,7,3,7,6,3,2,6,2,4,0,2,6,4]]})(this.Na,t.Ui(),n)}this.FN=this.ER.oV(Jt(this.kN,this.ft.wi()),!1,this.FN),this.aU?(this.cG=this.ER.NV(new Uint16Array(this.aU),this.cG),this.TN=this.aU.length):(this.cG&&this.ER.yV(this.cG),this.cG=void 0,this.TN=this.kN.length)}return r&&(this.EN=x&&S?this.ER.az(em["2D"],em.Color({dataType:p?["gradient",p]:y?["gradient",y]:"uniform"}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})):void 0),p?this.LN=Dm(this.oU,this.ft,p.getPosition(),p.getExtent(),p.getShape(),this.ER.Xz()):y?this.RN=Lm(this.oU,this.ft,y.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),this.zN=t&&f?this.zN||this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})):void 0,this.VN=t&&this.Me!==ot?this.VN||this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})):void 0,this.ra(this.be),this.la(s),this.ca.o=!1,this.ga.o=!1,this.j.o=!1,this.ma.o=!1,this}uN(t){return this.pN===t&&{}}VL(t){const e=1===t?this.zN:this.CN,i=this.vN,s=this.bN,r=this.gN.fillStyleSolid(!1),n=this.gN.fillStyleRadialGradient(!1),o=this.gN.fillStyleLinearGradient(!1),h=this.gN.fillStyleImage(!1);e&&i&&s&&this.be!==z&&(this.ER.ZR(e),this.ER.lV(e,((e,a,l,u)=>{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(u("uScaleStart_highpart"),this.lE.OO()).cV(u("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Pi&&this.ER.cV(u("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(u("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(u("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(u("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(e("uColor"),this.mN);else if(r)this.ER.gR(e("uColor"),r.getColor());else if(n){if(!this._N)return!1;this.ER.mO(l,this._N,n)}else if(o){if(!this.wN)return!1;this.ER.yO(l,this.wN,o)}else if(h){if(!this.rU)return!1;const t=this.rU&&this.rU.texture.Wz();this.ER.gR(u("uColor"),h.getSurroundingColor()).dV(e("uColorTexture"),t||this.rU.sourceMissingTexture,0).uV(this.rU.texCoordsBuffer,void 0,{location:a("aTextureCoord"),size:2}).RV(h.fitMode)}return this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).xO(l,i,this.ft.wi(),void 0).Zm(this.ER.gl.TRIANGLE_FAN,s),!0})));const a=1===t?this.VN:this.EN,l=this.gN.strokeStyleSolid(!1),u=this.gN.strokeFillSolid(!1),c=this.gN.strokeFillLinearGradient(!1),d=this.gN.strokeFillRadialGradient(!1),f=this.FN;return a&&f&&l&&(this.ER.ZR(a),this.ER.lV(a,((e,i,s,r)=>{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(r("uScaleStart_highpart"),this.lE.OO()).cV(r("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Pi&&this.ER.cV(r("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(r("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(r("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(r("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(e("uColor"),this.mN);else if(u)this.ER.gR(e("uColor"),u.getColor());else if(d){if(!this.LN)return!1;this.ER.mO(s,this.LN,d)}else if(c){if(!this.RN)return!1;this.ER.yO(s,this.RN,c)}return this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).xO(s,f,this.ft.wi(),void 0),this.cG?this.ER.jV(this.cG).QV(this.TN):this.ER.Zm(this.ER.gl.LINE_LOOP,this.TN),!0}))),this}OR(){return this.cG&&(this.ER.yV(this.cG),this.cG=void 0),this.vN&&(this.ER.yV(this.vN),this.vN=void 0),this.FN&&(this.ER.yV(this.FN),this.FN=void 0),this.rU=this.ER.zO(this,this.rU),this.CN=void 0,this.EN=void 0,this.zN=void 0,this.VN=void 0,this}bt(){return Math.max(this.ca._().x,this.ca._().x+this.j._().x)}xt(){return Math.min(this.ca._().x,this.ca._().x+this.j._().x)}_t(){return Math.max(this.ca._().y,this.ca._().y+this.j._().y)}Mt(){return Math.min(this.ca._().y,this.ca._().y+this.j._().y)}xl(){return Te(this.Me)}bl(){return Te(this.Me)}}class Ey extends rn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.gN=wg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be,fillStyleRadialGradient:()=>et(this.be)&&this.be,fillStyleLinearGradient:()=>rt(this.be)&&this.be,fillStyleImage:()=>Zn(this.be)&&this.be,strokeLineStyleSolid:()=>qi(this.Me)&&this.Me,strokeLineSolidFill:()=>{const t=this.Me.getFillStyle();return Y(t)&&t},strokeLinearGradientFill:()=>{const t=this.Me.getFillStyle();return rt(t)&&t},strokeRadialGradientFill:()=>{const t=this.Me.getFillStyle();return et(t)&&t}}),this.nU=(t,e,i)=>{const s=dt({x:this.Ha.min.x,y:this.Ha.min.y},this.ft,this.cs.ft),r=dt({x:this.Ha.max.x,y:this.Ha.max.y},this.ft,this.cs.ft),n={x:Math.abs(s.x-r.x),y:Math.abs(s.y-r.y)},o=Bm(t,e,n.x,n.y,i),h=o[1],a=o[4],l=o[6],u=o[7],c=new Float32Array(2*this.Na.length),d=this.Ha.max.x-this.Ha.min.x,f=this.Ha.max.y-this.Ha.min.y,g=a-l,m=u-h;let y=0;for(const t of this.Na){const e=l+g*((t.x-this.Ha.min.x)/d),i=h+m*((t.y-this.Ha.min.y)/f);c[y]=e,c[y+1]=i,y+=2}return c},this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN(),this.oN=e}$c(t){let e,i=Number.MAX_VALUE;for(const s of this.Na){const r=Xe(dt(s,this.ft,this.cs.ft),t);r=3,r=this.Me,n=this.na(),o=r.getThickness(),a=this.aa(o);this.lE.mV(this.ft),this.IT=this.ft.Ui();const l=this.ft.Gi();if(i&&(this.Ha=Ze(this.Na)),i&&s){const t=Jt(this.Na,this.ft.wi());this.vN=this.ER.oV(t,!1,this.vN),this.lU=new Uint16Array(h.default(t)),this.uU=this.ER.NV(this.lU,this.uU),this.bN=this.lU.length}const u=this.gN.fillStyleSolid(e),c=this.gN.fillStylePaletted(e),d=this.gN.fillStyleRadialGradient(e),f=this.gN.fillStyleLinearGradient(e),g=this.gN.fillStyleImage(e),m=u||c&&"value"!==c.getLookUpProperty()&&c||f||d||g;if(e&&(this.CN=m?this.ER.az(em["2D"],u&&em.Color({dataType:"uniform"}),f&&em.Color({dataType:["gradient",f]}),d&&em.Color({dataType:["gradient",d]}),c&&em.Color({dataType:["lookup",c.getLookUpProperty(),c.lut]}),g&&em.Color({dataType:["image",g]}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})):void 0),d?this._N=Dm(this.zo||this.Ha,this.ft,d.getPosition(),d.getExtent(),d.getShape(),this.ER.Xz()):f?this.wN=Lm(this.zo||this.Ha,this.ft,f.getAngle(!0),this.ER.Xz()):(this._N=void 0,this.wN=void 0),this.rU=this.ER.EO(this,this.rU,g,void 0,l||i,this.nU),(i||a||l&&1!==o)&&s){const t=1===o||-1===o?this.Na:$m(this.Na,this.IT,o);this.kN=Jt(t,this.ft.wi()),this.FN=this.ER.oV(this.kN,!0,this.FN),this.TN=t.length}const y=this.gN.strokeLineStyleSolid(n),p=this.gN.strokeLineSolidFill(n),x=this.gN.strokeLinearGradientFill(n),S=this.gN.strokeRadialGradientFill(n),A=y,v=p||x||S;return n&&(this.EN=A&&v?this.ER.az(em["2D"],em.Color({dataType:S?["gradient",S]:x?["gradient",x]:"uniform"}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})):void 0),S?this.LN=Dm(this.zo||this.Ha,this.ft,S.getPosition(),S.getExtent(),S.getShape(),this.ER.Xz()):x?this.RN=Lm(this.zo||this.Ha,this.ft,x.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),this.zN=t&&m?this.zN||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})):void 0,this.VN=t&&this.Me!==ot?this.zN||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})):void 0,this.yl=!1,this.ra(this.be),this.la(r),this}VL(t){const e=1===t?this.zN:this.CN,i=this.vN,s=this.bN,r=this.gN.fillStyleSolid(!1),n=this.gN.fillStyleRadialGradient(!1),o=this.gN.fillStyleLinearGradient(!1),h=this.gN.fillStylePaletted(!1),a=this.gN.fillStyleImage(!1);e&&i&&s&&this.ER.ZR(e).lV(e,((e,s,l,u)=>{if(this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(u("uScaleStart_highpart"),this.lE.OO()).cV(u("uScaleStart_lowpart"),this.lE.NO()).xO(l,i,this.ft.wi(),void 0).jV(this.uU).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1===t)this.ER.gR(e("uColor"),this.mN);else if(r)this.ER.gR(e("uColor"),r.getColor());else if(n){if(!this._N)return!1;this.ER.mO(l,this._N,n)}else if(o){if(!this.wN)return!1;this.ER.yO(l,this.wN,o)}else if(h){const t=kg(h,this,void 0);if(!t&&h.lut.percentageValues)return!1;this.ER.RO(l,h.lut,t)}else if(a){if(!this.rU)return!1;this.ER.gR(u("uColor"),a.getSurroundingColor()).dV(e("uColorTexture"),this.rU.texture.Wz()||this.rU.sourceMissingTexture,0).uV(this.rU.texCoordsBuffer,void 0,{location:s("aTextureCoord"),size:2}).RV(a.fitMode)}return this.ER.QV(this.bN),!0}));const l=1===t?this.VN:this.EN,u=this.Me,c=this.FN,d=this.TN;return l&&c&&d&&this.ER.ZR(l).lV(l,((e,i,s,r)=>{this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).xO(s,c,this.ft.wi(),void 0);const n=u.getFillStyle();if(1===t)this.ER.gR(e("uColor"),this.mN);else if(Y(n))this.ER.gR(e("uColor"),n.getColor());else if(et(n)){if(!this.LN)return!1;this.ER.mO(s,this.LN,n)}else if(rt(n)){if(!this.RN)return!1;this.ER.yO(s,this.RN,n)}const o=u.getThickness(),h=-1===o||1===o;return this.ER.Zm(h?this.ER.gl.LINE_LOOP:this.ER.gl.TRIANGLE_STRIP,this.TN),!0})),this}uN(t){return this.pN===t&&{}}OR(){return this.uU&&(this.ER.yV(this.uU),this.uU=void 0),this.vN&&(this.ER.yV(this.vN),this.vN=void 0),this.FN&&(this.ER.yV(this.FN),this.FN=void 0),this.CN=void 0,this.EN=void 0,this.zN=void 0,this.VN=void 0,this.rU=this.ER.zO(this,this.rU),this}}const Ty=(t,e)=>{let i=0;const s=[];for(;i0;n-=o?1:0,n-=i+n{let i=0;const s=[];for(;i0;n-=o?1:0,n-=0;const h=Math.min(n,t-r),a=i-(o?1:0),l={start:a,startUnique:r,sizeData:Math.min(e,t-a),sizeUniqueData:h};s.push(l),i+=h}return s},ky=(t,e,i,s)=>{if(i){const t=new Map;return e.gridTiles.forEach((e=>{t.set(e,{type:i,dataInvalidationRanges:[{tileInvalidationOffset:{primary:0,secondary:0},tileInvalidationLength:e.sizeHeatmapDataVectors}]})})),t}const r=new Map;for(let i=0;i{const e=t.iFirstVector,i=s(t),o={x:e.primary+i.primary-1,y:e.secondary+i.secondary-1},h=[{x:e.primary,y:e.secondary},{x:o.x,y:e.secondary},o,{x:e.primary,y:o.y}];if(!Ne(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const u=Ue(a,h),c={primary:u.min.x-e.primary,secondary:u.min.y-e.secondary},d={primary:1+u.max.x-u.min.x,secondary:1+u.max.y-u.min.y};let f=!1;const g=[{x:c.primary,y:c.secondary},{x:c.primary+d.primary,y:c.secondary},{x:c.primary+d.primary,y:c.secondary+d.secondary},{x:c.primary,y:c.secondary+d.secondary}];for(let t=0;t{if(1!==t.length||0!==e.startPrimary||0!==e.startSecondary||e.lengthPrimary!==t[0].sizeHeatmapDataVectors.primary||e.lengthSecondary!==t[0].sizeHeatmapDataVectors.secondary)t.forEach((t=>{const s=i(t),r=Math.max(e.startPrimary,t.iFirstVector.primary),n=Math.min(e.startPrimary+e.lengthPrimary-1,t.iFirstVector.primary+t.sizeHeatmapDataVectors.primary-1),o=Math.max(e.startSecondary,t.iFirstVector.secondary),h=Math.min(e.startSecondary+e.lengthSecondary-1,t.iFirstVector.secondary+t.sizeHeatmapDataVectors.secondary-1);for(let i=r;i<=n;i+=1){const r=i-e.startPrimary,n=e.values[r],a=(i-t.iFirstVector.primary)*t.sizeHeatmapDataVectors.secondary;for(let i=o;i<=h;i+=1){const r=i-e.startSecondary,o=i-t.iFirstVector.secondary,h=n[r];s[a+o]=h}}}));else{const s=t[0],r=i(s);for(let t=0;t{var s,r;const n=null===(s=t.gl2)||void 0===s?void 0:s.ctx;if(n)return t.AO(null,n.RED,!1,!0,{x:e,y:i},!1,n.FLOAT,n.R32F);const o=t.gl;return(null===(r=t.gl1)||void 0===r?void 0:r.optional.OES_texture_float)?t.AO(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.AO(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},Iy=(t,e,i,s)=>{e.forEach(((e,r)=>{var n,o;const h=i(r),a=s(r),l=t.gl;l.bindTexture(l.TEXTURE_2D,a),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const u=null===(n=t.gl2)||void 0===n?void 0:n.ctx,c=e.dataInvalidationRanges.length,d=e.dataInvalidationRanges.reduce(((t,e)=>t+e.tileInvalidationLength.primary),0)/r.sizeHeatmapDataVectors.primary;1===c&&d<1||d<.5&&c<10?e.dataInvalidationRanges.forEach((e=>{var i;const s=e.tileInvalidationOffset.primary*r.sizeHeatmapDataVectors.secondary,n=s+e.tileInvalidationLength.primary*r.sizeHeatmapDataVectors.secondary;if(u)u.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,u.RED,u.FLOAT,h.subarray(s,n));else if(null===(i=t.gl1)||void 0===i?void 0:i.optional.OES_texture_float)l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.LUMINANCE,l.FLOAT,h.subarray(s,n));else{const t=new Uint8Array(h.buffer).subarray(4*s,4*n);l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.RGBA,l.UNSIGNED_BYTE,t)}})):u?u.texImage2D(l.TEXTURE_2D,0,u.R32F,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,u.RED,u.FLOAT,h):(null===(o=t.gl1)||void 0===o?void 0:o.optional.OES_texture_float)?l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,l.LUMINANCE,l.FLOAT,h):l.texImage2D(l.TEXTURE_2D,0,l.RGBA,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array(h.buffer)),l.bindTexture(l.TEXTURE_2D,null)}))};class Fy extends Kr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.cU=p("bilinear"),this.Di={x:0,y:0},this.Xw={x:1,y:1},this.pv=Tr.lineStyle,this.engine=t;const o="columns"===n.dataOrder?n.columns:n.rows,h="columns"===n.dataOrder?n.rows:n.columns;this.Yn={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}Mv(t){return this.cU.M(t),this}_v(){return this.cU._()}vv(t,e){return this.Di=t,this.Xw=e,this}xv(){return{start:this.Di,step:this.Xw,end:{x:this.Di.x+this.Xw.x*this.Yn.columns,y:this.Di.y+this.Xw.y*this.Yn.rows}}}mv(t){return this.pv="function"==typeof t?t(this.pv):t,this}bv(){return this.pv}}class Dy extends Fy{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.lE=new Ym,this.bG={},this.dU=[],this.fU=!1,this.Ja=!1,this.gN=wg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be,wireframeStyleLine:()=>qi(this.pv)&&this.pv,wireframeStyleFill:()=>{const t=this.pv&&this.pv.getFillStyle();return Y(t)&&t}}),this.AU=Ty,this.nN=t,this.oN=e,this.pN=o,this.mN=h,this.ER=t.aN(),this.oN=e;const a=Math.min(this.ER.VR,void 0!==n.gU?n.gU:2048),l={x:Math.min(a,this.Yn.primaryDimensionVectorsCount),y:Math.min(a,this.Yn.secondaryDimensionVectorsCount)},u=((t,e,i,s)=>{const r=[],n=i(t.primaryDimensionVectorsCount,e.x),o=i(t.secondaryDimensionVectorsCount,e.y);let h;return n.forEach((t=>o.forEach((e=>{const i={iFirstVector:{primary:t.start,secondary:e.start},iFirstUniqueVector:{primary:t.startUnique,secondary:e.startUnique},sizeHeatmapDataVectors:{primary:t.sizeData,secondary:e.sizeData},sizeUniqueHeatmapDataVectors:{primary:t.sizeUniqueData,secondary:e.sizeUniqueData}};r.push(i)})))),h=[],r.forEach((t=>{let e=h.find((e=>e.sizeHeatmapData.primary===t.sizeHeatmapDataVectors.primary&&e.sizeHeatmapData.secondary===t.sizeHeatmapDataVectors.secondary));e||(e={sizeHeatmapData:t.sizeHeatmapDataVectors,tiles:[]},h.push(e)),e.tiles.push(t)})),{gridTiles:r,gridTileSizes:h}})(this.Yn,l,this.AU),c=u.gridTiles.map((t=>{const e=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary);return{...t,intensityData:e,hasIntensityData:!1}})),d=u.gridTileSizes.map((t=>({...t,tiles:c.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary))})));this.pU={gridTiles:c,gridTileSizes:d},this.vv(this.Di,this.Xw)}Ds(){const t=this.dU,e=this.be,i=this.ia(),s=this.pv,r=s!==this.mU,n=this.gN.fillStylePaletted(i),o=this.gN.fillStyleSolid(i),h=this.cU.o,a=this.cU._(),l=this.Ja,u=this.Lo._();this.yU=this.yU||this.SU();const c=this.yU,d=ky(t,c,l?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));d.size>0&&(Iy(this.ER,d,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.fU=!0),this.lE.mV(this.ft);const f=this.bG;if((i||h)&&(f.tile=n?{renderMode:"paletted",fillStylePaletted:n,shader:this.ER.az(em["2D"],em.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===a&&"bilinear",flipXY:"rows"===this.Yn.dataOrder,intensityTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN,lut:n.lut}),em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Tg(this.ft),flipXY:"rows"===this.Yn.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Tg(this.ft),flipXY:"rows"===this.Yn.dataOrder,normalSource:void 0}))}:void 0),r){const t=this.gN.wireframeStyleLine(r),e=this.gN.wireframeStyleFill(r);f.wireframe=t&&e?-1===t.getThickness()?{renderMode:"primitive",shader:this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Yn.dataOrder,axisWorldTranslation:Tg(this.ft),normalSource:void 0})),fillStyleSolid:e}:{renderMode:"triangulated",shader:this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Yn.dataOrder,axisWorldTranslation:Tg(this.ft),normalSource:void 0})),geometry:ny(this.ER,1),solidLine:t,fillStyleSolid:e}:void 0,f.wireframe?this.vU=this.vU||this.xU():this.vU&&(this.ER.yV(this.vU.wireframeCoordinatesBuffer),this.vU=void 0)}if(f.mousePicking=u?this.bG.mousePicking||{shader:this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Tg(this.ft),flipXY:"rows"===this.Yn.dataOrder,normalSource:void 0}))}:void 0,this.bG=f,void 0===this.Ka&&n&&"value"===n.lookUpProperty&&n.lut.percentageValues){let t=Le,e=Ve;this.yU.gridTiles.forEach((i=>{for(let s=0;se&&(e=r)}})),this.Ka={min:t,max:e}}return this.Ja=!1,this.dU.length=0,this.ra(e),this.mU=s,this.cU.o=!1,this}SU(){const t=this.pU.gridTiles.map((t=>{const e=Ry(this.ER,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e,tileData:t}})),e=this.pU.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.ER.oV([0,0,1,0,0,1,1,1]),s=this.ER.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}xU(){const t=this.Yn.primaryDimensionVectorsCount+1+this.Yn.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{const e="columns"===this.Yn.dataOrder?{x:this.Di.x+this.Xw.x*t.iFirstVector.primary,y:this.Di.y+this.Xw.y*t.iFirstVector.secondary}:{x:this.Di.x+this.Xw.x*t.iFirstVector.secondary,y:this.Di.y+this.Xw.y*t.iFirstVector.primary},i="columns"===this.Yn.dataOrder?{x:this.Xw.x*t.sizeHeatmapDataVectors.primary,y:this.Xw.y*t.sizeHeatmapDataVectors.secondary}:{x:this.Xw.x*t.sizeHeatmapDataVectors.secondary,y:this.Xw.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.Yn.dataOrder?{x:this.Di.x+this.Xw.x*t.iFirstUniqueVector.primary,y:this.Di.y+this.Xw.y*t.iFirstUniqueVector.secondary}:{x:this.Di.x+this.Xw.x*t.iFirstUniqueVector.secondary,y:this.Di.y+this.Xw.y*t.iFirstUniqueVector.primary},n="columns"===this.Yn.dataOrder?{x:this.Xw.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.Xw.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.Xw.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.Xw.y*t.sizeUniqueHeatmapDataVectors.primary};r.set(t,{startLocationAxis:e,sizeAxis:i,startRenderLocationAxis:s,renderSizeAxis:n})})),this.bU={boundaries:s,tilesInfo:r},this}VL(t){var e,i;const s=this.yU,r=this.bU,n=1===t?null===(e=this.bG.mousePicking)||void 0===e?void 0:e.shader:null===(i=this.bG.tile)||void 0===i?void 0:i.shader;if(this.bG.tile&&n&&s&&r){const e=n,i=this.bG.tile,o={x:(r.boundaries.max.x-r.boundaries.min.x)*Math.sign(this.Xw.x),y:(r.boundaries.max.y-r.boundaries.min.y)*Math.sign(this.Xw.y)},h={x:o.x/this.Yn.columns,y:o.y/this.Yn.rows},a=this.ft.Ui(),l={x:h.x/a.x,y:h.y/a.y};if("solid"===i.renderMode||1===t)this.ER.ZR(e).lV(e,((e,r,n)=>{if(1===t)this.ER.gR(e("uColor"),this.mN);else if("solid"===i.renderMode){const{fillStyleSolid:t}=i;this.ER.gR(e("uColor"),t.getColor())}return this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).uV(s.rectangleLocationsBuffer,void 0,{location:r("aPos"),size:2}).cV(e("uScaling"),[this.Xw.x*this.Yn.columns,this.Xw.y*this.Yn.rows]).cV(e("uTranslationAxis"),[this.Di.x,this.Di.y]).Zm(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),!0}));else if("paletted"===i.renderMode){const{fillStylePaletted:n}=i,o=this.Ka;this.ER.lV(e,((i,h,a)=>{let u=!1;var c,d;return this.ER.ZR(e).cV(i("uScale"),this.lE.AV()).cV(i("uDisp"),this.lE.gV()).RO(a,n.lut,o).uV(s.rectangleLocationsBuffer,void 0,{location:h("aPos"),size:2}).fV(i("uIsHighlighted"),this.Vo).gR(i("uHighlightColorOffset"),2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0),c=t=>{this.ER.cV(i("uTileDimensions"),["columns"===this.Yn.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.Yn.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},d=(t,e)=>{const n=r.tilesInfo.get(t.tileData);if(!n)return;let o;const h=this.ER.Xz();if("bilinear"===this.cU._()){const t=(this.ft.x.dt(n.startLocationAxis.x)+l.x/2)*h,e=(this.ft.y.dt(n.startLocationAxis.y)+l.y/2)*h;o=[t,e,(this.ft.x.dt(n.startLocationAxis.x+n.sizeAxis.x)-l.x/2)*h-t,(this.ft.y.dt(n.startLocationAxis.y+n.sizeAxis.y)-l.y/2)*h-e]}else{const t=this.ft.x.dt(n.startLocationAxis.x)*h,e=this.ft.y.dt(n.startLocationAxis.y)*h;o=[t,e,this.ft.x.dt(n.startLocationAxis.x+n.sizeAxis.x)*h-t,this.ft.y.dt(n.startLocationAxis.y+n.sizeAxis.y)*h-e]}this.ER.IV(i("uTileBounds"),o).cV(i("uScaling"),[n.renderSizeAxis.x,n.renderSizeAxis.y]).cV(i("uTranslationAxis"),[n.startRenderLocationAxis.x,n.startRenderLocationAxis.y]).dV(i("uTileIntensityValues"),t.intensityDataTexture,1).Zm(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),u=!0},s.gridTileSizes.forEach((t=>{c(t),t.tiles.forEach((t=>{d(t)}))})),u}))}}const o=this.vU,h=this.bG.wireframe,a=1===t||null==h?void 0:h.shader;if(o&&h&&a&&"primitive"===h.renderMode){const{fillStyleSolid:e}=h;this.ER.ZR(a).lV(a,((i,s,r)=>((this.ft instanceof _i||this.ft instanceof $c)&&this.ER.cV(i("uScale"),this.lE.AV()).cV(i("uDisp"),this.lE.gV()),this.ER.fV(i("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(i("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0).gR(i("uColor"),e.getColor()).uV(o.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).cV(i("uScaling"),[this.Xw.x,this.Xw.y]).cV(i("uTranslationAxis"),[this.Di.x,this.Di.y]).Zm(this.ER.gl.LINES,2*o.wireframeSegmentsLength),!0)))}else if(o&&h&&a&&"triangulated"===h.renderMode){const{geometry:e,solidLine:i,fillStyleSolid:s}=h;this.ER.ZR(a).lV(a,((r,n,h)=>((this.ft instanceof _i||this.ft instanceof $c)&&this.ER.cV(r("uScale"),this.lE.AV()).cV(r("uDisp"),this.lE.gV()),this.ER.fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0).gR(r("uColor"),s.getColor()).fV(r("uThicknessPixels"),i.getThickness()).cV(r("uRatioPxClip"),[2/this.cs.ai().x,2/this.cs.ai().y]).uV(o.wireframeCoordinatesBuffer,1,{location:n("aLocationA"),size:2},{location:n("aLocationB"),size:2}).cV(r("uScaling"),[this.Xw.x,this.Xw.y]).cV(r("uTranslationAxis"),[this.Di.x,this.Di.y]),e.ZR(h,!1).Zm(o.wireframeSegmentsLength),!0)))}return this}wv(t){return this.dU.push(t),Cy(this.pU.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this.Ka=void 0,this}Gt(){return this.fU&&(this.pU.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.Ja=!0,this.fU=!1,this.Ka=void 0),this}dispose(){super.dispose();const t=this.yU;t&&(t.gridTiles.forEach((t=>{this.ER.NR(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.ER.yV(t.rectangleLocationsBuffer)),this.yU=void 0;const e=this.vU;return e&&this.ER.yV(e.wireframeCoordinatesBuffer),this.vU=void 0,this.bG={},this}OR(){return this.dispose(),this}uN(t){return this.pN===t&&{}}$c(t){const e=t,i="columns"===this.Yn.dataOrder?e.x:e.y,s="columns"===this.Yn.dataOrder?e.y:e.x,r="columns"===this.Yn.dataOrder?this.Di.x:this.Di.y,n="columns"===this.Yn.dataOrder?this.Di.y:this.Di.x;let o=(i-r)/("columns"===this.Yn.dataOrder?this.Xw.x:this.Xw.y),h=(s-n)/("columns"===this.Yn.dataOrder?this.Xw.y:this.Xw.x);o=Math.floor(Rt(o,0,this.Yn.primaryDimensionVectorsCount-1)),h=Math.floor(Rt(h,0,this.Yn.secondaryDimensionVectorsCount-1));const a=this.MU(o,h),l="columns"===this.Yn.dataOrder?{x:this.Di.x+(o+.5)*this.Xw.x,y:this.Di.y+(h+.5)*this.Xw.y}:{x:this.Di.x+(h+.5)*this.Xw.x,y:this.Di.y+(o+.5)*this.Xw.y},u="columns"===this.Yn.dataOrder?o:h,c="columns"===this.Yn.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}Vb(t){const e=this.bU;if(!e||t.xe.boundaries.max.x||t.ye.boundaries.max.y)return;const i=t,s="columns"===this.Yn.dataOrder?i.x:i.y,r="columns"===this.Yn.dataOrder?i.y:i.x,n="columns"===this.Yn.dataOrder?this.Di.x:this.Di.y,o="columns"===this.Yn.dataOrder?this.Di.y:this.Di.x,h="columns"===this.Yn.dataOrder?this.Xw.x:this.Xw.y,a="columns"===this.Yn.dataOrder?this.Xw.y:this.Xw.x,l=Rt((s-n)/h-.5,0,this.Yn.primaryDimensionVectorsCount-1),u=Rt((r-o)/a-.5,0,this.Yn.secondaryDimensionVectorsCount-1),c=Rt(Math.ceil(l)-1,0,this.Yn.primaryDimensionVectorsCount-1),d=Rt(Math.ceil(u)-1,0,this.Yn.secondaryDimensionVectorsCount-1),f={point:{x:c,y:d},value:this.MU(c,d)},g={point:{x:c,y:d+1},value:this.MU(c,d+1)},m={point:{x:c+1,y:d},value:this.MU(c+1,d)},y={point:{x:c+1,y:d+1},value:this.MU(c+1,d+1)},p=_n({x:l,y:u},f,g,m,y);if(void 0===p)return;const x=Rt(Math.floor(l+.5),0,this.Yn.primaryDimensionVectorsCount-1),S=Rt(Math.floor(u+.5),0,this.Yn.secondaryDimensionVectorsCount-1),A="columns"===this.Yn.dataOrder?x:S,v="columns"===this.Yn.dataOrder?S:x,b=t;return{x:b.x,y:b.y,column:A,row:v,cellValue:p}}MU(t,e){for(let i=0;i=s.iFirstVector.primary&&t<=s.iFirstVector.primary+s.sizeHeatmapDataVectors.primary-1&&e>=s.iFirstVector.secondary&&e<=s.iFirstVector.secondary+s.sizeHeatmapDataVectors.secondary-1){const i=t-s.iFirstVector.primary,r=e-s.iFirstVector.secondary,n=i*s.sizeHeatmapDataVectors.secondary+r;return s.intensityData[n]}}return 0}bt(){var t;return(null===(t=this.bU)||void 0===t?void 0:t.boundaries.max.x)||0}xt(){var t;return(null===(t=this.bU)||void 0===t?void 0:t.boundaries.min.x)||0}_t(){var t;return(null===(t=this.bU)||void 0===t?void 0:t.boundaries.max.y)||0}Mt(){var t;return(null===(t=this.bU)||void 0===t?void 0:t.boundaries.min.y)||0}xl(){return 0}bl(){return 0}B_(){const t=[];return this.pU.gridTiles.forEach((e=>{if(!e.hasIntensityData)return;const i=new Array(e.sizeUniqueHeatmapDataVectors.primary).fill(0).map((t=>new Array(e.sizeUniqueHeatmapDataVectors.secondary).fill(0)));for(let t=0;t0?"ProgressiveX":"RegressiveX":this.Xw.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}),this.bW=new my(this.ft,this));const t=this.bW.AW(this.JM,this.Su._());if(t>0){for(let e=0;e0?this.JM[0].boundaries.min.x:Le:this.Ha.min.y=this.JM.length>0?this.JM[0].boundaries.min.y:Le}this.JM.forEach((t=>t.shape.Ds()));const e=this.JM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Ft(null===(i=e.shape.Ka)||void 0===i?void 0:i.min,Le)),t.max=Math.max(t.max,Ft(null===(s=e.shape.Ka)||void 0===s?void 0:s.max,Ve)),t}),{min:Le,max:Ve});return this.JM.forEach((t=>{t.shape.Ka=e})),this.Su.o=!1,this}VL(t){return this.JM.forEach((e=>e.shape.VL(t))),this}Iv(t){if(0===t.length)return this;let e=0;const i=this.wU.dataPerSegment,s=t.length;do{let r=this.JM[this.JM.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this.Yn.scrollDimension?i:this.Yn.resolution,rows:"rows"===this.Yn.scrollDimension?i:this.Yn.resolution,heatmapDataType:this.Yn.heatmapDataType,dataOrder:this.Yn.scrollDimension};let e="columns"===this.Yn.scrollDimension?{x:this.Di.x+this.Xw.x*this._U,y:this.Di.y}:{x:this.Di.x,y:this.Di.y+this.Xw.y*this._U};this.JM.length>0&&(e="columns"===this.Yn.scrollDimension?{x:e.x-1*this.Xw.x,y:e.y}:{x:e.x,y:e.y-1*this.Xw.y},o=!0);const s=new Dy(this.nN,this.oN,this.ft,kt,[],t,this.pN,this.mN).Mv(this.cU._()).ke(this.be).mv(this.pv).vv(e,this.Xw);r={shape:s,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this._U,hasJoint:!1,boundaries:{min:{x:s.xt(),y:s.Mt()},max:{x:s.bt(),y:s._t()}}},this.JM.push(r),n=i-(o?1:0)}const h=s-e,a=Math.min(n,h),l=t.slice(e,e+a),u={type:"intensity",values:l,startPrimary:r.existingDataPointsCount+(r.hasJoint?1:0),startSecondary:0,lengthPrimary:a,lengthSecondary:this.Yn.resolution};o&&(u.values.unshift(this.CU),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.wv(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),this.CU=l[l.length-1],this._U+=a,e+=a}while(e{const n=t.dataStartIndex,o=t.dataStartIndex+t.existingDataPointsCount-1;if(so)return;const h=i-n,a=Math.min(s,o),l=a-h+1,u=e.slice(h-i,a-i+1),c={type:"intensity",startSecondary:0,lengthSecondary:r,startPrimary:h,lengthPrimary:l,values:u};t.shape.wv(c)}));const n=this._U-1;if(s>n){const t=s-n,i=e.slice(-t);if(i.length{t.shape.dispose().OR()})),this.JM.length=0,this.Ha="columns"===this.Yn.scrollDimension?m({x:this.Di.x,y:this.Di.y},{x:this.Di.x,y:this.Di.y+this.Yn.resolution*this.Xw.y}):m({x:this.Di.x,y:this.Di.y},{x:this.Di.x+this.Yn.resolution*this.Xw.x,y:this.Di.y}),this._U=0,this.CU=void 0,this}vv(t,e){return super.vv(t,e),this.JM.forEach(((i,s)=>{const r={x:t.x+i.dataStartIndex*e.x,y:t.y+i.dataStartIndex*e.y};i.shape.vv(r,e),i.boundaries={min:{x:i.shape.xt(),y:i.shape.Mt()},max:{x:i.shape.bt(),y:i.shape._t()}}})),this.JM.length>0?this.Ha=Je(...this.JM.map((t=>t.boundaries))):this.Ha="columns"===this.Yn.scrollDimension?m({x:this.Di.x,y:this.Di.y},{x:this.Di.x,y:this.Di.y+this.Yn.resolution*this.Xw.y}):m({x:this.Di.x,y:this.Di.y},{x:this.Di.x+this.Yn.resolution*this.Xw.x,y:this.Di.y}),this}ke(t){return super.ke(t),this.JM.forEach((t=>t.shape.ke(this.be))),this}mv(t){return super.mv(t),this.JM.forEach((t=>t.shape.mv(this.pv))),this}Mv(t){return super.Mv(t),this.JM.forEach((e=>e.shape.Mv(t))),this}dispose(){return super.dispose(),this.JM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.JM.forEach((e=>e.shape.setVisible(t))),this}OR(){return this.JM.forEach((t=>t.shape.OR())),this}uN(t){return this.pN===t&&{}}$c(t){const e=dt(t,this.ft,this.engine.ft),i=this.JM.reduce(((i,s)=>{const r=s.shape.$c(t);if(r){const t=We(dt(r,this.ft,this.engine.ft),e);if(void 0===i||t=this._U||"rows"===this.Yn.scrollDimension&&e>=this._U)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}Vb(t){const e=dt(t,this.ft,this.engine.ft),i=this.JM.reduce(((i,s)=>{const r=s.shape.Vb(t);if(r){const t=We(dt(r,this.ft,this.engine.ft),e);if(void 0===i||t=this._U||"rows"===this.Yn.scrollDimension&&e>=this._U)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}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}ds(t){return super.ds(t),this.JM.forEach((e=>e.shape.ds(t))),this}}class _y extends Kr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.cU=p("bilinear"),this.pv=Tr.lineStyle,this.Yn=n}Mv(t){return this.cU.M(t),this}_v(){return this.cU._()}mv(t){return this.pv="function"==typeof t?t(this.pv):t,this}bv(){return this.pv}}class Py extends _y{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.lE=new Ym,this.bG={},this.gN=wg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be}),this.nN=t,this.oN=e,this.pN=o,this.mN=h,this.ER=t.aN(),this.oN=e,this.P_=new Dy(this.nN,t.kU,t.ft,kt,[],{columns:n.sectors,rows:n.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===n.dataOrder?"rows":"columns",gU:this.ER.VR},-1,R).mv(ot);const a=2*Math.PI/360,l=new Float32Array(724);let u=0;l[u+0]=0,l[u+1]=0,u+=2;for(let t=0;t<=360;t+=1){const e=t*a,i=Math.cos(e),s=Math.sin(e);l[u+0]=i,l[u+1]=s,u+=2}this.TU={vertexBuffer:this.ER.oV(l),drawMode:this.ER.gl.TRIANGLE_FAN,drawLength:362}}Ds(){const t=this.ia(),e=this.be,i=this.gN.fillStyleSolid(t),s=this.gN.fillStylePaletted(t),r=i||s,n=this.cU._(),o=this.cU.o,h=this.Lo._(),a=this.Lo.o;return this.lE.mV(this.ft),this.P_.Ds(),this.P_.yU?((t||o)&&(this.bG.fill=r?{shader:this.ER.az(em["2D"],em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Tg(this.ft),normalSource:void 0}),s&&em.PolarHeatmap({interpolation:"bilinear"===n&&"bilinear",intensityTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this.Yn.dataOrder,lut:s.lut}),i&&em.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:s,fillStyleSolid:i}:void 0),a&&(this.bG.mousePicking=h?{shader:this.ER.az(em["2D"],em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Tg(this.ft),normalSource:void 0}),em.Color({dataType:"uniform"}))}:void 0),this.ra(e),this.cU.o=!1,this.Lo.o=!1,this):this}VL(t){var e;const{vertexBuffer:i,drawLength:s,drawMode:r}=this.TU,n=this.P_.yU;if(!this.bG.fill||!n)return this;const{fillStylePaletted:o,fillStyleSolid:h}=this.bG.fill,a=1===t?null===(e=this.bG.mousePicking)||void 0===e?void 0:e.shader:this.bG.fill.shader;if(!a)return this;const l=this.ft.yb(),u=Math.min(l.start,l.end),c=Math.max(l.start,l.end),d=Math.min(this.Yn.amplitudeStart,this.Yn.amplitudeStart+(this.Yn.annuli-1)*this.Yn.amplitudeStep),f=Math.max(this.Yn.amplitudeStart,this.Yn.amplitudeStart+(this.Yn.annuli-1)*this.Yn.amplitudeStep);let g;return g=l.end>l.start?Math.min(f,c)-l.start:Math.max(d,u)-l.start,this.ER.ZR(a).lV(a,((e,a,l,u)=>{if(this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).cV(u("uViewportSize"),[this.nN.ai().x*this.ER.Xz(),this.nN.ai().y*this.ER.Xz()]).cV(e("uScaling"),[g,g]).cV(e("uTranslationAxis"),[0,0]).uV(i,void 0,{location:a("aPos"),size:2}).fV(u("uAngleOffset"),this.ft.Mb()%(2*Math.PI)).fV(u("uAngleDirection"),this.ft.Tb()?1:-1).fV(u("uSectors"),this.Yn.sectors).fV(u("uAnnuli"),this.Yn.annuli),1===t)this.ER.gR(e("uColor"),this.mN);else{if(this.ER.fV(e("uAmplitudeStart"),this.Yn.amplitudeStart).fV(e("uAmplitudeStep"),this.Yn.amplitudeStep).fV(e("uAmplitudeAxisStart"),this.ft.yb().start).fV(e("uAmplitudeAxisEnd"),this.ft.yb().end),o){const t=this.P_.Ka;this.ER.RO(l,o.lut,t).dV(e("uTileIntensityValues"),n.gridTiles[0].intensityDataTexture,0)}h&&this.ER.gR(e("uColor"),h.getColor())}return this.ER.Zm(r,s),!0})),this}wv(t){return this.P_.wv(t),this}Gt(){return this.P_.Gt(),this}dispose(){return super.dispose(),this.P_.dispose(),this.bG={},this.ER.yV(this.TU.vertexBuffer),this}OR(){return this.dispose(),this}ke(t){return super.ke(t),this.P_.ke(this.be),this}uN(t){return this.pN===t&&{}}$c(t){const e=this.Yn.amplitudeStart,i=this.Yn.amplitudeStart+(this.Yn.annuli-1)*this.Yn.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituder)return;let n=Math.round((t.angle-0)/360*this.Yn.sectors);n>=this.Yn.sectors&&(n=0);const o=Math.round((t.amplitude-e)/(i-e)*(this.Yn.annuli-1));return{iAnnulus:o,iSector:n,cellValue:this.MU(o,n),angle:n*(360/this.Yn.sectors),amplitude:e+o*(i-e)/(this.Yn.annuli-1)}}Vb(t){const e=this.Yn.amplitudeStart,i=this.Yn.amplitudeStart+(this.Yn.annuli-1)*this.Yn.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituder)return;const n=(t.angle-0)/360*this.Yn.sectors,o=(t.amplitude-e)/(i-e)*(this.Yn.annuli-1),h=Math.floor(n),a=Math.floor(o),l={point:{x:a,y:h},value:this.MU(a,h)},u={point:{x:a,y:h+1},value:this.MU(a,h+1)},c={point:{x:a+1,y:h},value:this.MU(a+1,h)},d={point:{x:a+1,y:h+1},value:this.MU(a+1,h+1)},f=_n({x:o,y:n},l,u,c,d);return void 0!==f?{iAnnulus:a,iSector:h,cellValue:f,angle:t.angle,amplitude:t.amplitude}:void 0}MU(t,e){const i="annuli"===this.Yn.dataOrder?t:e,s="annuli"===this.Yn.dataOrder?e:t;for(let t=0;t=e.iFirstVector.primary&&i<=e.iFirstVector.primary+e.sizeHeatmapDataVectors.primary-1&&s>=e.iFirstVector.secondary&&s<=e.iFirstVector.secondary+e.sizeHeatmapDataVectors.secondary-1){const t=i-e.iFirstVector.primary,r=s-e.iFirstVector.secondary,n=t*e.sizeHeatmapDataVectors.secondary+r;return e.intensityData[n]}}return 0}bt(){return 0}xt(){return 0}_t(){return 0}Mt(){return 0}xl(){return 0}bl(){return 0}}class By extends Vm{constructor(t){super(t);const{vertices:e,drawMode:i,drawSize:s}=this.lG();this.uG=t.oV(e),this.dG=s,this.fG=i}ZR(t){return this.ER.uV(this.uG,0,{location:t.attribute("aCurveOrBaseline"),size:1},{location:t.attribute("aSegmentSide"),size:1}),this}Zm(t,e,i){return this.ER.JV(void 0!==e?e:this.fG,i||0,this.dG,t),this}lG(){return{vertices:new Float32Array([1,0,0,0,0,1,0,1,1,1,1,0]),drawMode:this.ER.gl.TRIANGLES,drawSize:6}}Tz(){this.ER.yV(this.uG)}}const zy=t=>{let e=t.wV._z.get(void 0);return e||(e=new By(t),t.wV._z.set(void 0,e),e)};class Ny extends an{constructor(t,i,s,r){super(t,i,s,r,[{type:"DataPattern",args:{pattern:"ProgressiveX"}}]),this.FU=Tr.fillStyle,this.IU=Tr.fillStyle,this.PU=p(e.PointShape.Circle),this.DU=p(5),this.BU=p(0),this.LU=p(void 0),this.jC=!0,this.RU={x:0,y:0}}dd(t){return this.FU=jr(this.FU,t),this}QC(){return this.FU}EU(){return $r(this.zU,this.FU)}VU(){return $r(this.OU,this.IU)}ud(t){return this.IU=jr(this.IU,t),Zn(this.IU)&&(this.Ad(e.PointShape.Square),this.Sd(1)),this}yd(){return this.IU}Ad(t){return this.PU.M(t),io(this.PU._())&&this.Sd(1),this}gd(){return this.PU._()}Sd(t){return this.DU.M(t),this}JC(){return this.DU._()}pd(t){return this.BU.M(t),this}md(){return this.BU._()}KC(t){return this.RU=t,this}qC(){return this.RU}XC(t){return this.LU.M(t),this}tk(){return this.LU._()}}class Uy extends uy{constructor(t,e){super(t,e),this.$G=!1,this.XG={enabled:!1,totalDataPointsAtTime:0},this.ZG=t instanceof _i?{type:"linear",scale:t}:{type:"unknown"},this.HG.Yo("DataPattern",(t=>{!1===t.allowDataGrouping&&(this.$G=!0)}))}NU(t,e){var i,s;const r=null==t?void 0:t.kc,n=null==t?void 0:t.Tc,o=null==t?void 0:t.uc,h=null==t?void 0:t.lc;if(!t||this.$G||!this.WG||"linear"!==this.ZG.type||!r||!n||void 0===o||void 0===h||!e)return{cpStateChanged:!1,cpActive:!1};const a=null===(i=t.Cc())||void 0===i?void 0:i.x,l=null===(s=t.Hc())||void 0===s?void 0:s.x;if(o<2||void 0===a||void 0===l)return{cpStateChanged:!1,cpActive:!1};const u=this.calculateAvgStepBetweenDataPoints(l,a,o),c=this.ZG.scale,d=Math.abs("x"===this.WG?c.Ui().x:c.Ui().y),f=d/u,g=Math.floor(.8*f),m=g*u,y=g>=4,p=this.XG.enabled?this.XG.columnWidthAxis/d<1.5:void 0,x=this.XG.enabled&&g>this.XG.dataPointsPerColumn?g/this.XG.dataPointsPerColumn>=2:void 0;let S;return!0===this.XG.enabled?p?x&&(S={enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}):S=y?{enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}:{enabled:!1,totalDataPointsAtTime:o}:y&&(S={enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}),this.XG=S||{...this.XG,totalDataPointsAtTime:o},!!S&&this.Zp(),{cpStateChanged:!!S,cpActive:this.XG.enabled}}GU(t,e){var i,s,r;const n=t.kc,o=t.Tc,h=t.cc,a=t.uc,l=t.lc;if(this.$G||!this.XG.enabled||!n||!o||void 0===e)return;const u=n.length,c=this.XG.columnWidthAxis,d=this.ft.x.getInnerStart(),f=this.ft.x.getInnerEnd(),g=ho(d,f,n,h,a,l,e,1);if(!g)return;const m=n[g.iFirstSampleDataArray];if(this.WU){if(this.WU.iFirstPackedSample0)if(this.WU.packedColumnsCount-=t,this.WU.packedColumnsCount>0){this.WU.packedDataX.splice(0,2*t),this.WU.packedDataY.splice(0,2*t),this.WU.packedDataColors&&this.WU.packedDataColors.splice(0,2*t),this.WU.packedDataLookupValues&&this.WU.packedDataLookupValues.splice(0,2*t),this.WU.origin+=t*c;const e=ao(this.WU.origin,Math.max(h-1-u+1,0),h-1,(t=>n[oo(t,h,u)])),i=oo(e,h,u);this.WU.iFirstPackedSample=n[i]>=this.WU.origin?e:e+1}else this.WU=void 0}if(void 0!==(null===(i=this.WU)||void 0===i?void 0:i.iLastPackedSample)&&this.WU.iLastPackedSample>g.iLastSample){const t=n[g.iLastSampleDataArray],e=Math.min(Math.floor((this.WU.origin+this.WU.packedColumnsCount*c-t)/c),this.WU.packedColumnsCount);if(e>0)if(this.WU.packedColumnsCount-=e,this.WU.packedColumnsCount>0){for(let t=0;t<2*e;t+=1)this.WU.packedDataX.pop(),this.WU.packedDataY.pop(),this.WU.packedDataColors&&this.WU.packedDataColors.pop(),this.WU.packedDataLookupValues&&this.WU.packedDataLookupValues.pop();const t=ao(this.WU.origin+this.WU.packedColumnsCount*c,Math.max(h-1-u+1,0),h-1,(t=>n[oo(t,h,u)])),i=oo(t,h,u);this.WU.iLastPackedSample=n[i]<=this.WU.origin+this.WU.packedColumnsCount*c?t:t-1}else this.WU=void 0}}const y=this.WU||{origin:m,packedColumnsCount:0,packedDataX:[],packedDataY:[],packedDataColors:t.Ec?[]:void 0,packedDataLookupValues:t.Rc?[]:void 0,packedDataSize:t.zc?[]:void 0,packedDataRotation:t.Vc?[]:void 0,iFirstPackedSample:g.iFirstSample,iLastPackedSample:void 0},p=(t,e,i)=>{let s=Math.min(t,t+e*c),r=Math.max(t,t+e*c),a=i;const l=[];let m=Ve,p=Ve,x=-1,S=Le,A=Le,v=-1,b=0;for(;a<=g.iLastSample&&a>=g.iFirstSample;){const i=a%u,g=n[i],M=o[i];if(s<=g&&g<=r)b+=1,Number.isNaN(M)||(M>p&&(m=g,p=M,x=a),M0)m=m===Ve?Number.NaN:m,p=p===Ve?Number.NaN:p,S=S===Le?Number.NaN:S,A=A===Le?Number.NaN:A,x0?(y.packedDataX.push(m),y.packedDataY.push(p),y.packedDataX.push(S),y.packedDataY.push(A)):(y.packedDataX.unshift(S),y.packedDataY.unshift(A),y.packedDataX.unshift(m),y.packedDataY.unshift(p))):(l.push({iFirst:v,iSecond:x}),e>0?(y.packedDataX.push(S),y.packedDataY.push(A),y.packedDataX.push(m),y.packedDataY.push(p)):(y.packedDataX.unshift(m),y.packedDataY.unshift(p),y.packedDataX.unshift(S),y.packedDataY.unshift(A)));else{const t=e>0?y.iLastPackedSample:y.iFirstPackedSample;if(void 0===t)l.push({iFirst:0,iSecond:0}),e>0?(y.packedDataX.push(Number.NaN),y.packedDataY.push(Number.NaN),y.packedDataX.push(Number.NaN),y.packedDataY.push(Number.NaN)):(y.packedDataX.unshift(Number.NaN),y.packedDataY.unshift(Number.NaN),y.packedDataX.unshift(Number.NaN),y.packedDataY.unshift(Number.NaN));else{const i=oo(t,h,u),a=n[i],d=o[i],f=(s+r)/2,m=f-e*c/6,p=d+(m-a)/(g-a)*(M-d),x=f+e*c/6,S=d+(x-a)/(g-a)*(M-d);l.push({iFirst:t,iSecond:t}),e>0?(y.packedDataX.push(m),y.packedDataY.push(p),y.packedDataX.push(x),y.packedDataY.push(S)):(y.packedDataX.unshift(m),y.packedDataY.unshift(p),y.packedDataX.unshift(x),y.packedDataY.unshift(S))}}if(y.packedColumnsCount+=1,e>0?y.iLastPackedSample=a-1:(y.iFirstPackedSample=a+1,y.origin=s),s=Math.min(t+l.length*e*c,t+(l.length+1)*e*c),r=Math.max(t+l.length*e*c,t+(l.length+1)*e*c),b=0,m=Ve,p=Ve,x=-1,S=Le,A=Le,v=-1,sf)break}}return l},x=p(y.origin+y.packedColumnsCount*c,1,void 0!==(null===(s=this.WU)||void 0===s?void 0:s.iLastPackedSample)?this.WU.iLastPackedSample+1:g.iFirstSample),S=p(y.origin,-1,void 0!==(null===(r=this.WU)||void 0===r?void 0:r.iFirstPackedSample)?this.WU.iFirstPackedSample-1:g.iFirstSample),A=t.Ec&&y.packedDataColors?[t.Ec,y.packedDataColors]:void 0,v=t.Rc&&y.packedDataLookupValues?[t.Rc,y.packedDataLookupValues]:void 0,b=t.zc&&y.packedDataSize?[t.zc,y.packedDataSize]:void 0,M=t.Vc&&y.packedDataRotation?[t.Vc,y.packedDataRotation]:void 0;if(A||v||b||M){for(const t of x){const e=oo(t.iFirst,h,u),i=oo(t.iSecond,h,u);A&&A[1].push(A[0][e],A[0][i]),v&&v[1].push(v[0][e],v[0][i]),b&&b[1].push(b[0][e],b[0][i]),M&&M[1].push(M[0][e],M[0][i])}for(const t of S){const e=oo(t.iFirst,h,u),i=oo(t.iSecond,h,u);A&&A[1].unshift(A[0][i],A[0][e]),v&&v[1].unshift(v[0][i],v[0][e]),b&&b[1].unshift(b[0][i],b[0][e]),M&&M[1].unshift(M[0][i],M[0][e])}}return this.WU=y.packedColumnsCount>0?y:void 0,{x:y.packedDataX,y:y.packedDataY,color:y.packedDataColors,lookup:y.packedDataLookupValues,size:y.packedDataSize,rotation:y.packedDataRotation}}Zp(){this.WU=void 0}iW(t){if(this.WG&&"linear"===this.ZG.type){const e="x"===this.WG?this.ZG.scale.x.sg:this.ZG.scale.y.sg;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Ke===zs.progressive||e.Ke===zs.regressive){const e=Math.abs("x"===this.WG?this.ZG.scale.x.getInnerInterval():this.ZG.scale.y.getInnerInterval());if(this.XG.enabled)return 2*e/this.XG.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.WG?s.x:s.y,"x"===this.WG?r.x:r.y,i)}}}sW(t,e,i){if(!this.WG)return e;const s=i.length;let r=Nr(i,t.min,this.WG,this.UG,0,s-1);void 0===r&&(r=this.UG?s-1:0);let n=Nr(i,t.max,this.WG,this.UG,0,s-1);return void 0===n&&(n=this.UG?0:s-1),1+Math.abs(n-r)}eW(){}}class Oy extends Ny{constructor(t,e,i,s,r,n){super(t,e,i,s),this.lE=new Ym,this.vW=new Uy(this.ft,this),this.gN=wg({lineStyleSolid:()=>qi(this.uu)&&this.uu,lineStyleDashed:()=>Qn(this.uu)&&this.uu,strokeFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.uu.getFillStyle();return rt(t)&&t},strokeFillRadialGradient:()=>{const t=this.uu.getFillStyle();return et(t)&&t},strokeFillIndividual:()=>{const t=this.uu.getFillStyle();return X(t)&&t},strokeFillPaletted:()=>{const t=this.uu.getFillStyle();return j(t)&&t},areaFillSolid:()=>Y(this.FU)&&this.FU,areaFillLinearGradient:()=>rt(this.FU)&&this.FU,areaFillRadialGradient:()=>et(this.FU)&&this.FU,areaFillIndividual:()=>X(this.FU)&&this.FU,areaFillPaletted:()=>j(this.FU)&&this.FU,markerFillSolid:()=>Y(this.IU)&&this.IU,markerFillLinearGradient:()=>rt(this.IU)&&this.IU,markerFillRadialGradient:()=>et(this.IU)&&this.IU,markerFillPaletted:()=>j(this.IU)&&this.IU,markerFillIndividual:()=>X(this.IU)&&this.IU,markerFillImage:()=>Zn(this.IU)&&this.IU,markerShapeIcon:()=>{const t=this.PU._();return io(t)&&t}}),this.ad=p(void 0),this.UU=[],this.Ja=!1,this.YU=[],this.HU=void 0,this.nU=(t,e,i)=>{var s;const r=null===(s=this.$U)||void 0===s?void 0:s.shapeIcon;let n=t,o=e;return r&&(n=r.ai().x,o=r.ai().y),Bm(t,e,n*this.DU._(),o*this.DU._(),i)},this.oN=e,this.bG={type:"none"},this.ER=t.aN(),this.nN=t,this.vG=this.ER.hO,this.pN=r,this.mN=n}ld(t){return this.ad.M(Fe(t,this.ad._(),(()=>[t.Xc(((e,i)=>{this.UU.push({min:e,max:i}),void 0===t.Wc()&&this.XU&&this.YU.push({min:e,max:i})})),t.jc((()=>{this.Ja=!0,this.XU=void 0,this.HU=void 0,this.vW.Zp()}))]))),this.HU=void 0,this}Ds(){var t,i,s,r,n,o,h,a,l,c,d,f,g,m,y;const p=null===(t=this.ad._())||void 0===t?void 0:t.Ut,x=this.ad.o,S=null==p?void 0:p.kc,A=null==p?void 0:p.Tc;if(!p||!S||!A)return this;const v=p.Rc,b=p.Ec,M=p.zc,E=p.Vc,T=p.cc,w=p.uc,k=p.lc,C=this.uu,R=this.FU,I=x||this.na()||this.EU()||this.VU(),F=this.gN.lineStyleSolid(I),D=this.gN.lineStyleDashed(I),L=F||D,V=L&&L.getThickness(),_=this.gN.strokeFillSolid(I),P=this.gN.strokeFillLinearGradient(I),B=this.gN.strokeFillRadialGradient(I),z=this.gN.strokeFillIndividual(I),N=this.gN.strokeFillPaletted(I),U=_||P||B||z||N,O=this.gN.areaFillSolid(I),G=this.gN.areaFillLinearGradient(I),Y=this.gN.areaFillRadialGradient(I),H=this.gN.areaFillIndividual(I),X=this.gN.areaFillPaletted(I),W=O||G||Y||H||X,j=this.gN.markerFillSolid(I),$=this.gN.markerFillLinearGradient(I),Z=this.gN.markerFillRadialGradient(I),K=this.gN.markerFillPaletted(I),J=this.gN.markerFillIndividual(I),q=this.gN.markerFillImage(I),Q=j||$||Z||K||J||q,tt=this.PU._(),et=this.PU.o,it=this.gN.markerShapeIcon(et),st=this.DU._(),rt=this.DU.o,nt=this.LU.o,ot=this.UU.length>0||nt,ht=this.Ja,at=ht?[p.Uc()]:(t=>{const e=[];for(const i of t){let t=!1;for(const s of e)if(i.min>=s.min&&i.min<=s.max||i.max>=s.min&&i.max<=s.max){s.min=Math.min(s.min,i.min),s.max=Math.min(s.max,i.max),t=!0;break}t||e.push(i)}return e})(this.UU),lt=this.ft.x.Ht,ut=this.ft.x.getInnerStart(),ct=this.ft.x.getInnerEnd(),dt=p.Wc(),ft=!!D,gt=this.Lo._(),mt=this.Lo.o,{cpStateChanged:yt,cpActive:pt}=this.vW.NU(p,this.jC);if(dt&&pt&&(yt||ht||ot||lt||I)){const t=this.vW.GU(p,dt);if(t){const e=!yt&&!ht&&!I;this.jU=Gy(this.ER,[t.x,t.y],t.color,t.lookup,t.size,t.rotation,ft,this.jU,e,dt,1e3,this.ft.wi(),(t=>Kt(t,this.ft.wi()))),this.ZU={min:Le,max:Ve};const s=t.y.length;for(let e=0;ethis.KU.iLastSample||I){let i,s,r,n,o,h;if(1===t.dataRanges.length){const e=t.dataRanges[0];i=S.subarray(e.offset,e.offset+e.count),s=A.subarray(e.offset,e.offset+e.count),r=b?b.subarray(e.offset,e.offset+e.count):void 0,n=v?v.subarray(e.offset,e.offset+e.count):void 0,o=M?M.subarray(e.offset,e.offset+e.count):void 0,h=E?E.subarray(e.offset,e.offset+e.count):void 0}else{const e=t.dataRanges[0],a=t.dataRanges[1],l=e.count+a.count;i=new Float32Array(l),i.set(S.subarray(e.offset),0),i.set(S.subarray(a.offset,a.offset+a.count),e.count),s=new Float32Array(l),s.set(A.subarray(e.offset),0),s.set(A.subarray(a.offset,a.offset+a.count),e.count),b&&(r=new Uint32Array(l),r.set(b.subarray(e.offset),0),r.set(b.subarray(a.offset,a.offset+a.count),e.count)),v&&(n=new Float32Array(l),n.set(v.subarray(e.offset),0),n.set(v.subarray(a.offset,a.offset+a.count),e.count)),M&&(o=new Float32Array(l),o.set(M.subarray(e.offset),0),o.set(M.subarray(a.offset,a.offset+a.count),e.count)),E&&(h=new Float32Array(l),h.set(E.subarray(e.offset),0),h.set(E.subarray(a.offset,a.offset+a.count),e.count))}const l=!yt&&!ht&&!I;this.JU=Gy(this.ER,[i,s],r,n,o,h,ft,this.JU,l,dt,1e3,this.ft.wi(),(t=>Kt(t,this.ft.wi())));let c=i,d=s,f=r,g=n;const m=this.LU._();if(m){const t="spline"===m.type?((t,e)=>{const{xValues:i,yValues:s,lookupValues:r,colors:n}=t;if(i.length<=2)return{xValues:Array.from(i),yValues:Array.from(s),lookupValues:r?Array.from(r):void 0,colors:n?Array.from(n):void 0};const o=((t,e)=>{const i=1e-5,s=t.length-1,r=Array(s);if(s>1){let n=u(0,0),o=u(0,0),h=u(0,0),a=ii(hi({x:t[1],y:e[1]},{x:t[0],y:e[0]}));const l=3;let c=0,d=0;for(let f=0;fi?Math.abs(e/(l*n.x)):1,d=Math.abs(o.x)>i?Math.abs(e/(l*o.x)):1}g[1]=oi(ni(n,c),g[1]),g[2]=hi(g[2],ni(o,d)),r[f]=g}}return r.length>0?r:[]})(i,s),h=o.length,a=[],l=[],c=[],d=[];for(let t=0;t{const{xValues:s,yValues:r,lookupValues:n,colors:o}=t,h=[],a=[],l=[],u=[],c=s.length,d=i;if(c>0){let t=0,e=s[0],i=r[0];h[t]=e,a[t]=i,t+=1;for(let n=1;nKt(t,this.ft.wi()))),this.KU=t}}if(!dt&&(ht||ot||I)){if(!this.jU||this.jU.bufferSize{var s,r,n,o;const h=S.subarray(i.min,i.max+1),a=A.subarray(i.min,i.max+1);if(this.ER.VV(t,i.min*(this.ft.wi()?2:1),Kt(h,this.ft.wi())),this.ER.VV(e,i.min*(this.ft.wi()?2:1),Kt(a,this.ft.wi())),b&&(null===(s=this.jU)||void 0===s?void 0:s.bufferColors)){const t=b.subarray(i.min,i.max+1);this.ER.VV(this.jU.bufferColors,i.min,t,Uint32Array)}if(v&&(null===(r=this.jU)||void 0===r?void 0:r.bufferLookupValues)){const t=v.subarray(i.min,i.max+1);this.ER.VV(this.jU.bufferLookupValues,i.min,t,Float32Array)}if(E&&(null===(n=this.jU)||void 0===n?void 0:n.bufferRotations)){const t=E.subarray(i.min,i.max+1);this.ER.VV(this.jU.bufferRotations,i.min,t,Float32Array)}if(M&&(null===(o=this.jU)||void 0===o?void 0:o.bufferSizes)){const t=M.subarray(i.min,i.max+1);this.ER.VV(this.jU.bufferSizes,i.min,t,Float32Array)}})),this.jU.valueCount=p.uc}this.JU=this.jU}if(this.lE.mV(this.ft),I||rt||et||mt){if(U&&L&&!1!==V){const t=-1===V?"primitive":"triangulated",e=N?["lookup",N.lookUpProperty,N.lut]:z?"attribute":P?["gradient",P]:B?["gradient",B]:"uniform";this.bG="primitive"===t?{type:t,shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0,splitPosAttribute:!0}),D&&em.StippleTexture),lineStyleSolid:F,lineStyleDashed:D,fillStyleSolid:_,fillStyleLinearGradient:P,fillStyleRadialGradient:B,fillStyleIndividual:z,fillStylePaletted:N,mousePickingShader:gt&&this.ER.az(em["2D"],em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0,splitPosAttribute:!0}),D&&em.StippleTexture,em.MousePicking)}:"triangulated"===t?{type:t,shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.LineInstanced2D({axisWorldTranslation:Tg(this.ft),normalSource:void 0,splitPosAttribute:!0}),this.vG?em.AliasedEdge:void 0,D&&em.StippleTextureInstanced),geometry:ny(this.ER,V),thickness:V,lineStyleSolid:F,lineStyleDashed:D,fillStyleSolid:_,fillStyleLinearGradient:P,fillStyleRadialGradient:B,fillStyleIndividual:z,fillStylePaletted:N,mousePickingShader:gt&&this.ER.az(em["2D"],em.LineInstanced2D({axisWorldTranslation:Tg(this.ft),normalSource:void 0,splitPosAttribute:!0}),D&&em.StippleTextureInstanced,em.MousePicking)}:{type:"none"}}else this.bG={type:"none"};if(this.qU=W?{shader:this.ER.az(em["2D"],X&&em.Color({dataType:["lookup",X.lookUpProperty,X.lut]}),H&&em.Color({dataType:"attribute"}),O&&em.Color({dataType:"uniform"}),G&&em.Color({dataType:["gradient",G]}),Y&&em.Color({dataType:["gradient",Y]}),em.Area2D({axisWorldTranslation:Tg(this.ft),normalSource:void 0,splitPosAttribute:!0})),geometry:zy(this.ER),fillStyleSolid:O,fillStyleLinearGradient:G,fillStyleRadialGradient:Y,fillStyleIndividual:H,fillStylePaletted:X,mousePickingShader:gt&&this.ER.az(em["2D"],em.Area2D({axisWorldTranslation:Tg(this.ft),normalSource:void 0,splitPosAttribute:!0}),em.MousePicking)}:void 0,Q){const t=!(!q&&!it),e=st>1||t,i=M?"attribute":"uniform",s=!e&&em.PointSize("uniform"),r=em.VertexLocation({offset:e&&!t?{dataType:i,sizeUnit:"px",symmetric:!0,rotation:{dataType:E?"attribute-deg":"uniform"},useAlignment:!0}:e&&t?{dataType:i,sizeUnit:"scale",rotation:{dataType:E?"attribute-deg":"uniform"},useAlignment:!0}:void 0,axisWorldTranslation:Tg(this.ft),normalSource:void 0,splitPosAttribute:!0});this.$U={shader:this.ER.az(em["2D"],s,r,j&&em.Color({dataType:"uniform",overrideOpacity:!0,maskTexture:!!it}),$&&em.Color({dataType:["gradient",$],overrideOpacity:!0,maskTexture:!!it}),Z&&em.Color({dataType:["gradient",Z],overrideOpacity:!0,maskTexture:!!it}),K&&em.Color({dataType:["lookup",K.getLookUpProperty(),K.getPalette()],overrideOpacity:!0,maskTexture:!!it}),J&&em.Color({dataType:"attribute",overrideOpacity:!0,maskTexture:!!it}),q&&em.Color({dataType:["image",q],overrideOpacity:!0,maskTexture:!!it})),geometry:Ay(tt,this.ER,"uniform"===i?st:25),fillStyleSolid:j,fillStyleLinearGradient:$,fillStyleRadialGradient:Z,fillStylePaletted:K,fillStyleIndividual:J,fillStyleImage:q,mousePickingShader:gt&&this.ER.az(em["2D"],s,r,em.MousePicking),shapeIcon:it,pointSizeAsScale:t,instancedRendering:e}}else this.$U=void 0}const xt=Wr({min:{x:this.xt(),y:this.ft.y.getInnerStart()},max:{x:this.bt(),y:this._t()}},{x:this.xl(),y:this.bl()},this.ft),St=Wr({min:{x:this.xt(),y:this.Mt()},max:{x:this.bt(),y:this._t()}},{x:this.xl(),y:this.bl()},this.ft);if(this.tY=this.ER.GO(P,this,St),this.iY=this.ER.WO(B,this,St),this.sY=this.ER.GO(G,this,xt),this.eY=this.ER.WO(Y,this,xt),this.hY=this.ER.GO($,this,St),this.rY=this.ER.WO(Z,this,St),(void 0===this.HU||ot)&&v&&(Cg(N)||Cg(X)||Cg(K))){const t=this.HU?at:[p.Uc()];let e=this.HU?this.HU.max:Ve,i=this.HU?this.HU.min:Le;const s=v;t.forEach((t=>{for(let r=t.min;r<=t.max;r+=1){const t=s[r];i=te?t:e}})),this.HU={min:i,max:e}}return this._G=D?this.ER.PO(D.getPattern()):void 0,this.rU=this.ER.EO(this,this.rU,q,it,rt,this.nU),this.Au(C),this.zU=R,this.OU=this.IU,this.PU.o=!1,this.DU.o=!1,this.UU.length=0,this.Ja=!1,this.LU.o=!1,this.ad.o=!1,this.Lo.o=!1,this}VL(t){var e,i,s,r,n,o,h,a,l,u,c,d,f,g,m,y,p;const x=this.ER.gl,S=null===(e=this.jU)||void 0===e?void 0:e.bufferX,A=null===(i=this.jU)||void 0===i?void 0:i.bufferY,v=null===(s=this.jU)||void 0===s?void 0:s.bufferColors,b=null===(r=this.jU)||void 0===r?void 0:r.bufferLookupValues,M=null===(n=this.jU)||void 0===n?void 0:n.valueCount,E=null===(o=this.JU)||void 0===o?void 0:o.valueCount,T=null===(h=this.ad._())||void 0===h?void 0:h.Ut,w=null==T?void 0:T.Wc();if(!S||!A||!T)return this;const k=(e,i,s)=>{if(Hy(this.ER,e,this.ft.wi(),S,"aLocation","X",1,!1,x.FLOAT,Float32Array.BYTES_PER_ELEMENT),Hy(this.ER,e,this.ft.wi(),A,"aLocation","Y",1,!1,x.FLOAT,Float32Array.BYTES_PER_ELEMENT),i&&1!==t){if(!v)return!1;Hy(this.ER,e,!1,v,"aColor","",4,!0,x.UNSIGNED_BYTE,1)}if(s&&"value"===s.lookUpProperty&&1!==t){if(!b)return!1;Hy(this.ER,e,!1,b,"aLookupValue","",1,!1,x.FLOAT,Float32Array.BYTES_PER_ELEMENT)}return!0},C=1===t?null===(a=this.qU)||void 0===a?void 0:a.mousePickingShader:null===(l=this.qU)||void 0===l?void 0:l.shader;if(this.qU&&C&&void 0!==M&&M>0&&w){const e=this.qU;this.ER.ZR(C).lV(C,((i,s,r,n)=>!!this.ER.VO(r,t,this,{uniforms:this.lE,mousePickingColor:this.mN,fillStyleSolid:e.fillStyleSolid,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,fillStylePaletted:e.fillStylePaletted,linearGradientInfo:this.sY,radialGradientInfo:this.eY,lookupValueRange:e.fillStylePaletted?kg(e.fillStylePaletted,this,this.HU):void 0,lookupValueBuffer:null})&&!!k(r,e.fillStyleIndividual,e.fillStylePaletted)&&(null==e||e.geometry.ZR(r).Zm(M-1),!0)))}const R="none"===this.bG.type?void 0:1===t?this.bG.mousePickingShader:this.bG.shader;if("none"!==this.bG.type&&R&&void 0!==M&&M>0){const e=this.bG;this.ER.ZR(R).lV(R,((i,s,r,n)=>{var o,h;if(!this.ER.VO(r,t,this,{uniforms:this.lE,mousePickingColor:this.mN,fillStyleSolid:e.fillStyleSolid,fillStylePaletted:e.fillStylePaletted,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,fillStyleIndividual:e.fillStyleIndividual,linearGradientInfo:this.tY,radialGradientInfo:this.iY,lookupValueRange:e.fillStylePaletted?kg(e.fillStylePaletted,this,this.HU):void 0,lookupValueBuffer:"primitive"===e.type?b:null,colorBuffer:"primitive"===e.type?v:null,coordsX:"primitive"===e.type?S:void 0,coordsY:"primitive"===e.type?A:void 0,coordsHighPrecision:this.ft.wi()}))return!1;if(e.lineStyleDashed){if(!this._G)return!1;this.ER.cV(i("uStippleCount"),[this.cs.ai().x/this._G.LO,this.cs.ai().y/this._G.LO]).fV(n("uStippleTextureWidthLimiter"),this._G.BO/this._G.LO).fV(i("uStippleScale"),e.lineStyleDashed.getPatternScale()).dV(i("uStippleTexture"),this._G.DO,1)}if("primitive"===e.type){if(e.lineStyleDashed){if(!(null===(o=this.jU)||void 0===o?void 0:o.bufferLengthSoFar))return!1;this.ER.WV(s("aLengthSoFar"),this.jU.bufferLengthSoFar)}hy.yG(this.nN,M)}else{if(!k(r,e.fillStyleIndividual,e.fillStylePaletted))return!1;if(e.lineStyleDashed){if(!(null===(h=this.jU)||void 0===h?void 0:h.bufferLengthSoFar))return!1;Hy(this.ER,r,!1,this.jU.bufferLengthSoFar,"aLengthSoFar","",2,!1,x.FLOAT,Float32Array.BYTES_PER_ELEMENT)}oy.VL(this.nN,e.geometry,r,this.vG&&1!==t,1===t,e.thickness,M-1)}return!0}))}const I=null===(u=this.JU)||void 0===u?void 0:u.bufferX,F=null===(c=this.JU)||void 0===c?void 0:c.bufferY,D=null===(d=this.JU)||void 0===d?void 0:d.bufferColors,L=null===(f=this.JU)||void 0===f?void 0:f.bufferLookupValues,V=null===(g=this.JU)||void 0===g?void 0:g.bufferSizes,_=null===(m=this.JU)||void 0===m?void 0:m.bufferRotations,P=1===t?null===(y=this.$U)||void 0===y?void 0:y.mousePickingShader:null===(p=this.$U)||void 0===p?void 0:p.shader,B=this.$U;let z=1;if(w){const t=this.ad?Math.abs((this.bt()-this.xt())/T.getSampleCount()):0,e=this.ft.x.getInnerInterval()/t,i=this.DU._(),s=this.ft.x.ni()/i/1,r=2*s;z=e<=s?1:Math.max(1-(e-s)/(r-s),0)}if(P&&B&&I&&F&&z>0&&void 0!==E&&E>0){const e=B,i=e.instancedRendering?1:0;this.ER.ZR(P).lV(P,((s,r,n,o)=>{if(!this.ER.VO(n,t,this,{uniforms:this.lE,mousePickingColor:this.mN,fillStyleSolid:e.fillStyleSolid,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,linearGradientInfo:this.hY,radialGradientInfo:this.rY,fillStylePaletted:e.fillStylePaletted,fillStyleIndividual:e.fillStyleIndividual,lookupValueRange:e.fillStylePaletted?kg(e.fillStylePaletted,this,this.HU):void 0,lookupValueBuffer:L,lookupValueAttribDivisor:i,colorBuffer:D,colorAttribDivisor:i,fillStyleImage:e.fillStyleImage,texturedFillGLInfo:this.rU,texCoordAttribDivisor:0,maskTexture:e.shapeIcon&&this.rU,maskTextureCoordsAttribDivisor:0}))return!1;if(this.ft.wi()?this.ER.uV(I,i,{location:r("aPos_highpartX"),size:1},{location:r("aPos_lowpartX"),size:1}).uV(F,i,{location:r("aPos_highpartY"),size:1},{location:r("aPos_lowpartY"),size:1}):this.ER.XV(r("aPosX"),I,i).XV(r("aPosY"),F,i),1!==t&&this.ER.fV(s("uOpacity"),z),e.instancedRendering)if(_)this.ER.XV(r("aRotDeg"),_,i).fV(s("uBaseRotDeg"),e.geometry.BW);else{const t=gi(this.BU._()+e.geometry.BW),i=Math.sin(t),r=Math.cos(t);this.ER.cV(s("uRot"),[i,r])}return this.ER.cV(o("uOffsetAlignment"),[-this.RU.x/2,-this.RU.y/2]),e.geometry.Zm(n,V,E,e.pointSizeAsScale&&this.rU?{scale:this.DU._(),width:e.shapeIcon?e.shapeIcon.ai().x:this.rU.texture.Iz,height:e.shapeIcon?e.shapeIcon.ai().y:this.rU.texture.Pz}:this.DU._(),e.instancedRendering),!0}))}return this}uN(t){return this.pN===t&&{}}dispose(){var t,e,i,s,r,n,o,h,a;return super.dispose(),this.ER.yV(null===(t=this.jU)||void 0===t?void 0:t.bufferX),this.ER.yV(null===(e=this.jU)||void 0===e?void 0:e.bufferY),this.ER.yV(null===(i=this.jU)||void 0===i?void 0:i.bufferColors),this.ER.yV(null===(s=this.jU)||void 0===s?void 0:s.bufferLookupValues),this.ER.yV(null===(r=this.JU)||void 0===r?void 0:r.bufferX),this.ER.yV(null===(n=this.JU)||void 0===n?void 0:n.bufferY),this.ER.yV(null===(o=this.JU)||void 0===o?void 0:o.bufferColors),this.ER.yV(null===(h=this.JU)||void 0===h?void 0:h.bufferLookupValues),this.bG={type:"none"},this.qU=void 0,this.$U=void 0,this.vW.Zp(),null===(a=this.ad._())||void 0===a||a.Wt(),this.jU=void 0,this.JU=void 0,this.tY=void 0,this.iY=void 0,this.sY=void 0,this.eY=void 0,this.hY=void 0,this.rY=void 0,this.ER.zO(this,this.rU),this}OR(){return this.dispose(),this}nY(t){if(!this.XU){const{xValues:e,yValues:i}=t.readBack();this.XU={min:{x:Le,y:Le},max:{x:Ve,y:Ve}};const s=e.length;for(let t=0;tthis.XU.max.x?s:this.XU.max.x,this.XU.max.y=r>this.XU.max.y?r:this.XU.max.y}return this.YU.length=0,this.XU}const e=t.kc,i=t.Tc;if(this.YU.length>0&&e&&i){for(const t of this.YU){for(let s=t.min;s<=t.max;s+=1){const t=e[s],r=i[s];this.XU.min.x=tthis.XU.max.x?t:this.XU.max.x,this.XU.max.y=r>this.XU.max.y?r:this.XU.max.y}this.YU.length=0}return this.XU}return this.XU}bt(){var t,e,i,s,r;const n=null===(t=this.ad._())||void 0===t?void 0:t.Ut;if(!n)return 0;const o=n.Wc();return"ProgressiveX"===o?(null===(e=n.Cc())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Hc())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.ZU)||void 0===s?void 0:s.max)||0:"RegressiveY"===o?(null===(r=this.ZU)||void 0===r?void 0:r.max)||0:this.nY(n).max.x}xt(){var t,e,i,s,r;const n=null===(t=this.ad._())||void 0===t?void 0:t.Ut;if(!n)return 0;const o=n.Wc();return"ProgressiveX"===o?(null===(e=n.Hc())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Cc())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.ZU)||void 0===s?void 0:s.min)||0:"RegressiveY"===o?(null===(r=this.ZU)||void 0===r?void 0:r.min)||0:this.nY(n).min.x}_t(){var t,e,i,s,r;const n=null===(t=this.ad._())||void 0===t?void 0:t.Ut;if(!n)return 0;const o=n.Wc();return"ProgressiveX"===o?Ft(null===(e=this.ZU)||void 0===e?void 0:e.max,0):"RegressiveX"===o?Ft(null===(i=this.ZU)||void 0===i?void 0:i.max,0):"ProgressiveY"===o?Ft(null===(s=n.Cc())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Ft(null===(r=n.Hc())||void 0===r?void 0:r.y,0):this.nY(n).max.y}Mt(){var t,e,i,s,r;const n=null===(t=this.ad._())||void 0===t?void 0:t.Ut;if(!n)return 0;const o=n.Wc();return"ProgressiveX"===o?Ft(null===(e=this.ZU)||void 0===e?void 0:e.min,0):"RegressiveX"===o?Ft(null===(i=this.ZU)||void 0===i?void 0:i.min,0):"ProgressiveY"===o?Ft(null===(s=n.Hc())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Ft(null===(r=n.Cc())||void 0===r?void 0:r.y,0):this.nY(n).min.y}xl(){var t,e;let i=this.DU._();this.rU&&(i=Math.max(this.rU.texture.Iz,this.rU.texture.Pz)*this.DU._());const s=Math.max(Te(this.uu),(null===(t=this.ad._())||void 0===t?void 0:t.Ut.xc)?25:i),r=null===(e=this.ad._())||void 0===e?void 0:e.Ut.Wc();return!r||"ProgressiveX"!==r&&"RegressiveX"!==r?s:0}bl(){var t,e;let i=this.DU._();this.rU&&(i=Math.max(this.rU.texture.Iz,this.rU.texture.Pz)*this.DU._());const s=Math.max(Te(this.uu),(null===(t=this.ad._())||void 0===t?void 0:t.Ut.xc)?25:i),r=null===(e=this.ad._())||void 0===e?void 0:e.Ut.Wc();return!r||"ProgressiveY"!==r&&"RegressiveY"!==r?s:0}}const Gy=(t,e,i,s,r,n,o,h,a,l,u,c,d)=>{if("ProgressiveX"!==l)throw new Error("Unimplemented data pattern");const f=e[0],g=e[1],m=f.length,y=f[0],p=f[m-1],x=g[0],S=g[m-1],A=c?2:1;if(h&&a&&h.firstX&&h.lastX&&y>=h.firstX){const e=ao(h.lastX,0,m-1,(t=>f[t]));if(f[e]===h.lastX){const a=h.bufferSize-h.valueCount,l=e+1,u=m-l;if(0===u)return h;if(a>=u){const e=co(f,l,void 0),a=co(g,l,void 0);if(t.VV(h.bufferX,h.valueCount*A,d(e)),t.VV(h.bufferY,h.valueCount*A,d(a)),i&&h.bufferColors){const e=i.slice(l);t.VV(h.bufferColors,h.valueCount,e,Uint32Array)}if(s&&h.bufferLookupValues){const e=s.slice(l);t.VV(h.bufferLookupValues,h.valueCount,e,Float32Array)}if(r&&h.bufferSizes){const e=r.slice(l);t.VV(h.bufferSizes,h.valueCount,e,Float32Array)}if(n&&h.bufferRotations){const e=n.slice(l);t.VV(h.bufferRotations,h.valueCount,e,Float32Array)}if(o&&h.bufferLengthSoFar){const[i,s,r]=Yy(e,a,h.lastX||0,h.lastY||0,h.lengthSoFarX,h.lengthSoFarY);t.VV(h.bufferLengthSoFar,2*h.valueCount,i,Float32Array),h.lengthSoFarX=s,h.lengthSoFarY=r}return h.valueCount+=u,h.lastX=p,h.lastY=S,h}}}const v=m+u,b=t.zV(v*A,d(f),null==h?void 0:h.bufferX),M=t.zV(v*A,d(g),null==h?void 0:h.bufferY),E=i?t.zV(v,i,null==h?void 0:h.bufferColors,Uint32Array):void 0,T=s?t.zV(v,s,null==h?void 0:h.bufferLookupValues,Float32Array):void 0,w=r?t.zV(v,r,null==h?void 0:h.bufferSizes,Float32Array):void 0,k=n?t.zV(v,n,null==h?void 0:h.bufferRotations,Float32Array):void 0;let C,R=0,I=0;if(o){const e=Yy(f,g,f[0],g[0],0,0);C=t.zV(2*v,e[0],null==h?void 0:h.bufferLengthSoFar,Float32Array),R=e[1],I=e[2]}return{bufferX:b,bufferY:M,bufferColors:E,bufferLookupValues:T,bufferSizes:w,bufferRotations:k,bufferSize:v,bufferLengthSoFar:C,valueCount:m,firstX:y,lastX:p,firstY:x,lastY:S,lengthSoFarX:R,lengthSoFarY:I}},Yy=(t,e,i,s,r,n)=>{const o=t.length,h=new Float32Array(2*o);if(0===o)return[h,0,0];let a=0,l=i,u=s,c=r,d=n;for(let i=0;i{const u=t.gl;if(i){const i=e.attribute(`${r}A_highpart${n}`),c=e.attribute(`${r}A_lowpart${n}`),d=e.attribute(`${r}B_highpart${n}`),f=e.attribute(`${r}B_lowpart${n}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,a,h,2*o*l,0*l),u.vertexAttribPointer(c,o,a,h,2*o*l,o*l),t.YV(i,1),t.YV(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.vertexAttribPointer(d,o,a,h,2*o*l,2*o*l),u.vertexAttribPointer(f,o,a,h,2*o*l,3*o*l),t.YV(d,1),t.YV(f,1),u.enableVertexAttribArray(d),u.enableVertexAttribArray(f),u.bindBuffer(u.ARRAY_BUFFER,null)}else{const i=e.attribute(`${r}A${n}`),c=e.attribute(`${r}B${n}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,a,h,o*l,0*l),u.vertexAttribPointer(c,o,a,h,o*l,o*l),t.YV(i,1),t.YV(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.bindBuffer(u.ARRAY_BUFFER,null)}},Xy={translation:(t,e)=>[1,0,0,0,1,0,t,e,1],rotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,-i,0,i,e,0,0,0,1]},scaling:(t,e)=>[t,0,0,0,e,0,0,0,1],translate:(t,e,i)=>Xy.multiply(t,Xy.translation(e,i)),rotate:(t,e)=>Xy.multiply(t,Xy.rotation(e)),scale:(t,e,i)=>Xy.multiply(t,Xy.scaling(e,i)),multiply(t,e){const 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=e[0],d=e[1],f=e[2],g=e[3],m=e[4],y=e[5],p=e[6],x=e[7],S=e[8];return[c*i+d*n+f*a,c*s+d*o+f*l,c*r+d*h+f*u,g*i+m*n+y*a,g*s+m*o+y*l,g*r+m*h+y*u,p*i+x*n+S*a,p*s+x*o+S*l,p*r+x*h+S*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class Wy extends Qr{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.oY=[],this.lE=new Ym,this.aY=[u(0,0),u(0,0),u(0,0),u(0,0)],this.lY=m(u(0,0),u(0,0)),this.uY=m(u(0,0),u(0,0)),this.cY=u(0,0),this.dY=u(0,0),this.IT=u(0,0),this.fY=u(0,0),this.AY=0,this.gY=0,this.gN=wg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStyleRadialGradient:()=>et(this.be)&&this.be,fillStyleLinearGradient:()=>rt(this.be)&&this.be}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN(),this.oN=e,this.PG=t.Yn.Zn}Ds(){const t=this.ha(),e=this.ea(),i=this.Lo._();if(t){const t=this.ia(),s=this.gN.fillStyleSolid(t),r=this.gN.fillStyleRadialGradient(t),n=this.gN.fillStyleLinearGradient(t),o=s||r||n,h=this.ER,a=this.ER.Xz(),l=a!==this.gY;if(this.gY=a,this.lE.mV(this.ft),this.pa.o||l){this.pY&&this.pY.QR(this),this.font.M(pr(this.pa._(),a));const t=this.font._();this.pY=this.ER.Oh(t.properties.family),this.pY.ZR(this)}const c=this.font.o,d=c||this.ua.o;if(d&&this.pY){const t=this.font._();[this.mY,this.uY]=this.pY.KR(this.ua._(),t,this.nN.ts.isDark),this.oY.forEach((t=>{t.texCoordBuff&&h.yV(t.texCoordBuff),t.vertexBuff&&h.yV(t.vertexBuff)})),this.oY=this.mY.map((t=>({texCoordBuff:h.oV(t.texCoords,!1),texture:t.texture,info:t}))),this.pa.o=!1,this.font.o=!1,this.ua.o=!1}const f=this.ft.Gi()||e,g=this.ca.o||this.fa.o||this.da.o||this.Aa.o||this.ya.o||this.jt.o||d||f,m=this.ya._(),y=ni(u(this.fa._()+1,this.da._()+1),.5);if(g&&this.mY&&(this.cY=u(-(m.left*a+this.uY.max.x-this.uY.min.x+m.right*a)*y.x-this.uY.min.x+m.right*a,-(m.bottom*a+this.uY.max.y-this.uY.min.y+m.top*a)*y.y-this.uY.min.y+m.top*a)),(g||f||this.ga.o||this.ia())&&this.be!==z){if(this.mY){const t=oi(this.ca._(),this.Aa._()),e=dt(t,this.ft,this.cs.ft),i=ni(e,a);this.fY=i;const s=gi(this.ga._());this.AY=s,d&&this.oY.forEach((t=>{const e=t.info;e&&(t.vertexBuffLen=e.vertices.length/2,t.vertexBuff=h.oV(e.vertices,!0,t.vertexBuff))}));const r=this.jt._(),n=[oi(ti(u((this.uY.min.x+(-r.left-m.left)*a+this.cY.x)/a,(this.uY.max.y+(r.top+m.top)*a+this.cY.y)/a),this.ma,s),e),oi(ti(u((this.uY.max.x+(r.right+m.right)*a+this.cY.x)/a,(this.uY.max.y+(r.top+m.top)*a+this.cY.y)/a),this.ma,s),e),oi(ti(u((this.uY.max.x+(r.right+m.right)*a+this.cY.x)/a,(this.uY.min.y+(-r.bottom-m.bottom)*a+this.cY.y)/a),this.ma,s),e),oi(ti(u((this.uY.min.x+(-r.left-m.left)*a+this.cY.x)/a,(this.uY.min.y+(-r.bottom-m.bottom)*a+this.cY.y)/a),this.ma,s),e)];this.aY=[dt(n[0],this.cs.ft,this.ft),dt(n[1],this.cs.ft,this.ft),dt(n[2],this.cs.ft,this.ft),dt(n[3],this.cs.ft,this.ft)];const o=Ze(n);this.dY=u(-(o.max.x-o.min.x)*a*y.x-o.min.x*a+this.fY.x,-(o.max.y-o.min.y)*a*y.y-o.min.y*a+this.fY.y),this.Ig=hi(o.max,o.min);const l=Ze(this.aY),c=this.ft.mi(l.min,this.dY),f=this.ft.mi(l.max,this.dY);this.lY=Ze([c,f])}r?this._N=Dm(this.lY,this.ft,r.getPosition(),r.getExtent(),r.getShape(),this.ER.Xz()):n?this.wN=Lm(this.lY,this.ft,n.getAngle(!0),this.ER.Xz()):(this._N=void 0,this.wN=void 0)}(this.ia()||c)&&(this.dE=o?this.ER.az(em["2D"],em.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.PG}),em.Color({dataType:r?["gradient",r]:n?["gradient",n]:"uniform",maskTextureText:!0})):void 0),this.yY=i&&o?this.yY||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.PG})):void 0,this.ca.o=!1,this.fa.o=!1,this.da.o=!1,this.Aa.o=!1,this.ga.o=!1,this.ra(this.be)}return this.Sa=t,this}VL(t){if(this.ha()){const e=1===t?this.yY:this.dE;if(!e||0===this.oY.length)return this;const i=this.gN.fillStyleSolid(!1),s=this.gN.fillStyleRadialGradient(!1),r=this.gN.fillStyleLinearGradient(!1),n=this.cs.NE(),o=n.x,h=n.y;let a=Xy.projection(o,h,-1);const l=Xy.translation(this.cY.x,this.cY.y),u=Xy.translation(this.dY.x,this.dY.y);a=Xy.translate(a,this.fY.x,this.fY.y),a=Xy.multiply(a,u),a=Xy.rotate(a,this.AY),a=Xy.multiply(a,l),1===t&&(a=Xy.scale(a,this.uY.max.x,this.uY.max.y)),this.ER.ZR(e).lV(e,((e,o,h,l)=>{if(this.ER.DV(e("uMatrix"),a).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),this.PG&&this.ER.cV(l("uViewportSizePx"),[n.x*this.ER.Xz(),n.y*this.ER.Xz()]),1===t)this.ER.gR(e("uColor"),this.mN);else if(i)this.ER.gR(e("uColor"),i.getColor());else if(s&&this._N){this.ER.cV(e("uCenter"),this._N.center).cV(e("uDistance"),this._N.distance).IV(e("uBounds"),this._N.bounds).fV(e("uAspect"),this._N.aspectRatio);const t=s.getColorStops();for(let i=0;i{this.ER.WV(o("aPos"),t.vertexBuff).WV(o("aMaskTextureCoord"),t.texCoordBuff).dV(e("uMaskTexture"),t.texture,0).Zm(this.ER.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return this}uN(t){return this.pN===t&&{}}Ue(){return this.ha()?this.aY:[]}Zc(){return this.ha()&&this.Ig?this.Ig:u(0,0)}ai(){if(this.ha()&&this.lY){const t=this.lY;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}OR(){return this.oY.forEach((t=>{t.texCoordBuff&&this.ER.yV(t.texCoordBuff),t.vertexBuff&&this.ER.yV(t.vertexBuff)})),this.oY=[],this.pY&&this.pY.QR(this),this}bt(){return this.lY.max.x}xt(){return this.lY.min.x}_t(){return this.lY.max.y}Mt(){return this.lY.min.y}xl(){return 0}bl(){return 0}}class jy{constructor(t,e,i){this.SY=new Set,this.vY=t=>(this.SY.add(t),t),this.xY=t=>(this.SY.delete(t),t.OR(),this),this.cs=t,this.Qo=e,this.bY=i}zL(t){this.SY.delete(t)&&this.SY.add(t)}U(){for(const t of this.SY)t.OR().dispose();this.cs.Mn(this.Qo)}vs(){return this.cs.vs(),this}bn(){return this.Qo}}class $y extends jy{constructor(){super(...arguments),this.MY=p(void 0),this.Jo=!1}tx(t){return this.MY.M(t),this}wp(){return this.MY._()}}class Zy extends $y{constructor(t,e,i){super(t,e,i),this.nN=t,this.gl=t.aN(),this._Y=this.SY}nV(t){const e=t instanceof Xr&&t;if(!e)return _e;const i=e.xt(),s=e.bt(),r=e.Mt(),n=e._t();if(i===Le||s===Ve||r===Le||n===Ve)return _e;const o=e.xl(),h=e.bl(),a=Wr({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.ft),l={min:dt(a.min,e.ft,t.cs.ft),max:dt(a.max,e.ft,t.cs.ft)},u=this.MY._();let c;if(u){if(c={min:{x:Math.max(l.min.x,u.x),y:Math.max(l.min.y,u.y)},max:{x:Math.min(l.max.x,u.x+u.width),y:Math.min(l.max.y,u.y+u.height)}},c.max.x{const t=this.nN.CY();return{id:t,color:this.nN.kY(t)}})))}sy(t,e,i){const s=this.nN.CY();return this.vY(new yy(this.nN,this,t,this.xY,i,s,this.nN.kY(s),e))}fd(t){const e=this.nN.CY();return this.vY(new Oy(this.nN,this,t,this.xY,e,this.nN.kY(e)))}Dr(t){const e=this.nN.CY();return this.vY(new Wy(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}bS(t){const e=this.nN.CY();return this.vY(new vy(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}sc(t,e=hn.Simple){const i=this.nN.CY();if(e===hn.Simple)return this.vY(new Ey(this.nN,this,t,this.xY,[],i,this.nN.kY(i)));throw new Error("GlEngine.addPolygon | No such polygon type!")}$x(t){return this.vY(new by(this.nN,this,t,this.xY,[],(()=>{const t=this.nN.CY();return{id:t,color:this.nN.kY(t)}})))}Te(t){const e=this.nN.CY();return this.vY(new My(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}uw(t){const e=this.nN.CY();return this.vY(new sy(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}Kc(t){const e=this.nN.CY();return this.vY(new Zm(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}O_(t,e,i){if("intensity"===i.heatmapDataType){const s=this.nN.CY();return this.vY(new Vy(this.nN,this,t,this.xY,e,s,this.nN.kY(s),i))}throw new yt("Unimplemented Heatmap Grid Static type")}D_(t,e,i){const s=this.nN.CY();return this.vY(new Dy(this.nN,this,t,this.xY,e,i,s,this.nN.kY(s)))}zb(t,e,i){const s=this.nN.CY();return this.vY(new Py(this.nN,this,t,this.xY,e,i,s,this.nN.kY(s)))}TY(t){return this.vY(new jm(this.nN,this,this.xY,[],t))}Ds(){if(this.Jo){this.Jo=!1;const t=Array.from(this.SY).sort(((t,e)=>t.qo()-e.qo()));this.SY.clear();for(const e of t)this.SY.add(e)}for(const t of this.SY)t.Ds();return this}VL(t,e){const i=this.MY._();if(i&&this.gl.rV(i.x*this.gl.Xz()*e,i.y*this.gl.Xz()*e,i.width*this.gl.Xz()*e,i.height*this.gl.Xz()*e),1!==t)for(const e of this.SY)e.getVisible()&&e.VL(t);else for(const e of this.SY)e.getMouseInteractions()&&e.getVisible()&&e.VL(t);return this.gl.tV(!1),this}}class Ky extends Vm{constructor(t){super(t)}}class Jy extends Ky{constructor(t){super(t),this.FY="attribute";const{vertices:e,drawSize:i,drawMode:s}=qy(t.gl);this.CR=t.oV(e),this.dG=i,this.fG=s}Zm(t,e,i,s){return this.ER.uV(this.CR,0,{location:t.attribute("aInstanceGeo"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:s?t.attribute("aTriangleBary"):void 0,size:3}).JV(this.fG,0,this.dG,e),this}Tz(){this.ER.yV(this.CR)}}const qy=t=>{const e=new Float32Array(324);let i=0;return e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,{vertices:e,drawSize:i/9,drawMode:t.TRIANGLES}};class Qy extends Ky{constructor(t,e){super(t),this.FY="attribute",this.IY=e;const{vertices:i,indices:s}=tp();this.CR=t.oV(i),this.cG=t.NV(s),this.dG=s.length,this.fG=t.gl.TRIANGLES}Zm(t,e,i,s){return this.ER.uV(this.CR,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).jV(this.cG).fV(t.uniform("uEdgeRoundness"),this.IY/2).KV(this.fG,this.dG,0,e),this}Tz(){this.ER.yV(this.CR),this.ER.yV(this.cG)}PY(t){return this.IY=t,this}DY(){return this.IY}}const tp=()=>{const t=[{normal:{x:0,y:1,z:0},perpendA:{x:0,y:0,z:1},perpendB:{x:-1,y:0,z:0}},{normal:{x:0,y:0,z:-1},perpendA:{x:0,y:1,z:0},perpendB:{x:-1,y:0,z:0}},{normal:{x:-1,y:0,z:0},perpendA:{x:0,y:1,z:0},perpendB:{x:0,y:0,z:1}},{normal:{x:1,y:0,z:0},perpendA:{x:0,y:1,z:0},perpendB:{x:0,y:0,z:-1}},{normal:{x:0,y:0,z:1},perpendA:{x:0,y:1,z:0},perpendB:{x:1,y:0,z:0}},{normal:{x:0,y:-1,z:0},perpendA:{x:0,y:0,z:-1},perpendB:{x:-1,y:0,z:0}}],e=[];let i=0;const s=[];let r=0;for(const n of t){const{normal:t,perpendA:o,perpendB:h}=n,a=De.multiply(o,-1),l=De.multiply(h,-1),u=i;e[i]={thicknessDirection:De.addVec(t,o,h),edge:De.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:De.addVec(t,a,h),edge:De.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:De.addVec(t,a,l),edge:De.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:De.addVec(t,o,l),edge:De.addVec(a,h),normal:t},i+=1,s[r+0]=d,s[r+1]=u,s[r+2]=f,s[r+3]=d,s[r+4]=c,s[r+5]=u,r+=6;const g=[{A:o,B:h},{A:a,B:h},{A:a,B:l},{A:o,B:l}];for(const s of g){s.thicknessDirection=De.addVec(t,s.A,s.B),s.stripVerticesA=[],s.stripVerticesB=[];const r=[{direction:s.A,other:s.B,vertices:s.stripVerticesA},{direction:s.B,other:s.A,vertices:s.stripVerticesB}];for(const n of r)for(let r=0;r<8;r+=1){const o=.5*r/7,h=De.normalize(De.lerp(t,n.direction,o)),a=Math.PI/2-De.angle(h,t),l=De.addVec(De.multiply(De.multiply(n.direction,-1),1-Math.cos(a)),De.multiply(De.multiply(t,-1),1-Math.sin(a)),De.multiply(n.other,-1)),u=i;e[i]={thicknessDirection:s.thicknessDirection,normal:h,edge:l};const c=e[i];i+=1,n.vertices.push({index:u,vertex:c})}}for(let t=0;t{let i=t.wV.kz.get(e);return i||(i=void 0!==e&&e>0?new Qy(t,Rt(e,0,1)):new Jy(t),t.wV.kz.set(e,i),i)};class ip extends Nm{nS(t){return this.Yz=this.tS._(),this.tS.M(t),this}kv(t){return this.BY=t,this}Tv(){return this.BY}}class sp extends ip{constructor(t,e,i,s,r){super(t,e,i),this.LY=t,this.pN=s,this.mN=r,this.nN=t.nN,this.ER=this.nN.aN()}uN(t){return t===this.pN&&{}}}class rp extends sp{constructor(t,e,i,s,r){super(t,e,i,s,r),this.BY="cull-back",this.Ha=Pe,this.RY={},this.EY=[],this.gN=wg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStyleIndividual:()=>X(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be}),this.be=Tr.fillStyle,this.tS.M(Hn)}Ds(t){const e=this.EY,i=this.be,s=i!==z,r=this.zY,n=this.ia()||this.VY!==r,o=this.Uz(),h=this.Lo._(),a=this.Lo.o;if(s){for(const t of e)t.id=void 0!==t.id?String(t.id):void 0,t.xSize=void 0!==t.xSize&&t.xSize<0?-t.xSize:t.xSize,t.ySize=void 0!==t.ySize&&t.ySize<0?-t.ySize:t.ySize,t.zSize=void 0!==t.zSize&&t.zSize<0?-t.zSize:t.zSize;const t=11,s=this.OY||0;let r=s;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.RY[e]||(r+=1)}let l,u=!1,c=!1;if(u=r!==s,c=u,l=!c&&(e.length<100?"chunks":"all"),u){const e=r*t,i=new Float32Array(e);this.PW&&i.set(this.PW),this.PW=i,this.NY=e,this.GY=s*t}const d=X(i)?i.getFallbackColor():void 0;for(const i of e){const e=i.id,s=void 0!==e&&this.RY[e],r=[i.xCenter,i.yCenter,i.zCenter,i.xSize,i.ySize,i.zSize,i.color?i.color.r:d?d.r:void 0,i.color?i.color.g:d?d.g:void 0,i.color?i.color.b:d?d.b:void 0,i.color?i.color.a:d?d.a:void 0,i.value];if(s){for(let e=0;e0){const e=m({x:Le,y:Le,z:Le},{x:Ve,y:Ve,z:Ve});for(let i=0;in?e.max.x:n,e.max.y=e.max.y>l?e.max.y:l,e.max.z=e.max.z>f?e.max.z:f}this.Ha=e}this.OY=r,this.EY.length=0}return this.ra(i),this.VY=r,this.tS.o=!1,this.Lo.o=!1,this}VL(t){const e=1===t?this.yY:this.dE,i=this.WY,s=this.uG,r=this.be,n=this.OY,o=this.tS._();return e&&s&&void 0!==n&&this.ER.lV(e,((h,a,l)=>{let u=!1;const c=a("aPos"),d=a("aOffsetAxis");this.ER.ZR(e).PV(h("uScale"),this.LY.lE.AV()).PV(h("uDisp"),this.LY.lE.gV()).BV(h("uViewProjectionMatrix"),this.YY).fV(h("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(h("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(h("uRenderEffectMask"),2===t?1:0);const f={location:c,size:3},g={location:d,size:3},m={location:void 0,size:4};if(1!==t&&"phong"===o.type&&this.ER.PV(h("uCameraLoc"),this.HY).PV(h("uLightLoc"),this.$Y).fV(h("uAmbientReflection"),o.ambientReflection).fV(h("uSpecularReflection"),o.specularReflection).fV(h("uDiffuseReflection"),o.diffuseReflection).fV(h("uShininess"),o.shininess).gR(h("uLightColor"),o.specularColor).gR(h("uAmbientColor"),o.ambientColor),1===t)this.ER.gR(h("uColor"),this.mN);else if(Y(r))this.ER.gR(h("uColorDiffuse"),r.getColor());else if(X(r)){const t=a("aColor");m.location=t}else if(j(r)){const t=kg(r,this,void 0);if(!t&&r.lut.percentageValues)return!1;this.ER.RO(l,r.lut,t)}return s&&(this.ER.uV(s,1,f,g,m,{location:void 0,size:1}),i.Zm(l,n,"phong"===o.type&&1!==t,!1),u=!0),u})),this}dispose(){return super.dispose(),this.uG&&(this.ER.yV(this.uG),this.uG=void 0),this.dE=void 0,this}OR(){return this.dispose(),this}pS(t){this.EY=ne(this.EY,t,{canReturnB:!0})}ke(t){return this.be=jr(this.be,t),this}zh(){return this.be}AS(t){return this.zY=void 0!==t&&t>0?Rt(t,0,1):void 0,this}UY(){return this.zY}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}lS(){return this.Ha.max.z}uS(){return this.Ha.min.z}xl(){return 0}bl(){return 0}cS(){return 0}ia(){return $r(this.sa,this.be)}ra(t){this.sa=t}}class np extends Vm{constructor(t,e){super(t),this.FY="custom",this.aG=e;const{vertices:i,drawSize:s}=this.lG();this.uG=t.oV(i),this.dG=s}ZR(t){return this.ER.uV(this.uG,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Zm(t){return this.ER.JV(this.ER.gl.TRIANGLE_STRIP,0,this.dG,t),this}lG(){const t=this.aG,e=new Float32Array(2*(t+1)*3);let i=0;for(let s=0;s<=t;s+=1){const r=2*Math.PI*s/t,n=Math.cos(r),o=Math.sin(r);for(const t of[0,1])e[i+0]=t,e[i+1]=n,e[i+2]=o,i+=3}return{vertices:e,drawSize:i/3}}Tz(){this.ER.yV(this.uG)}}const op=(t,e=16)=>{let i=t.wV.wz.get(e);return i||(i=new np(t,e),t.wV.wz.set(e,i),i)};class hp extends sp{constructor(t,e,i,s,r){super(t,e,i,s,r),this.BY="cull-back",this.jY=Pe,this.ZY=[],this.QY=!1,this.uu=Tr.lineStyle,this.tS.M(Gn)}Ds(t){const e=this.QY,i=this.uu,s=this.du!==i,r=this.Uz(),n=e;if(e){const t=qt(this.ZY);this.JY=this.ER.oV(t,!1,this.JY)}if(n&&(this.jY=Ke(this.ZY)),s||r){const t=8,e=qi(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.bG=void 0,Y(e)&&("primitive"===s?this.bG={type:s,shader:this.ER.az(em["3D"],em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0}),em.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.bG={type:s,shader:this.ER.az(em["3D"],em.ColorShaded3D({dataType:"uniform",shadingStyle:this.tS._().type}),em.LineInstanced3D({axisWorldTranslation:Tg(this.ft)})),geometry:op(this.ER,t),fillStyle:e}))}return this.QY=!1,this.du=i,this.tS.o=!1,this}VL(t){if(1===t)return this;const e=this.ER.gl,i=this.bG,s=this.JY,r=this.uu,n=this.tS._();if(i&&s&&qi(r))switch(i.type){case"instanced":{const o=.5*this.Ts.Gy(r.thickness),h=i.fillStyle.getColor(),a=i.shader,l=i.geometry;this.ER.lV(a,((i,r,u)=>{this.ER.ZR(a).PV(i("uScale"),this.LY.lE.AV()).PV(i("uDisp"),this.LY.lE.gV()).BV(i("uViewProjectionMatrix"),this.YY).gR(i("uColorDiffuse"),h).fV(i("uOffsetWU"),o).fV(i("uIsHighlighted"),this.Vo).gR(i("uHighlightColorOffset"),2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0),"phong"===n.type&&this.ER.PV(i("uCameraLoc"),this.HY).PV(i("uLightLoc"),this.$Y).fV(i("uAmbientReflection"),n.ambientReflection).fV(i("uSpecularReflection"),n.specularReflection).fV(i("uDiffuseReflection"),n.diffuseReflection).fV(i("uShininess"),n.shininess).gR(i("uLightColor"),n.specularColor).gR(i("uAmbientColor"),n.ambientColor),e.bindBuffer(e.ARRAY_BUFFER,s);const c=r("aLocationA"),d=r("aLocationB");return e.vertexAttribPointer(c,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(c,1),e.enableVertexAttribArray(c),e.vertexAttribPointer(d,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(d,1),e.enableVertexAttribArray(d),l.ZR(u).Zm(this.ZY.length/2),!0}));break}case"primitive":{const n=qi(r)?r.getFillStyle():void 0,o=n&&Y(n)?n.getColor():void 0;if(o){const r=i.shader;this.ER.lV(r,((i,n)=>(this.ER.ZR(r).PV(i("uScale"),this.LY.lE.AV()).PV(i("uDisp"),this.LY.lE.gV()).BV(i("uViewProjectionMatrix"),this.YY).gR(i("uColor"),o).fV(i("uIsHighlighted"),this.Vo).gR(i("uHighlightColorOffset"),2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0).uV(s,void 0,{location:n("aPos"),size:3}).Zm(e.LINES,this.ZY.length),!0)))}break}}return this}ol(t){for(let e=0;e{const l=e*r,u=Math.PI/2-t*n,c=Math.cos(u),d=c*Math.cos(l),f=c*Math.sin(l),g=Math.sin(u);i[s]=d,i[s+1]=g,i[s+2]=f,i[s+3]=o,i[s+4]=h,i[s+5]=a,s+=6};for(let i=0;i0&&(o(i,s,1,0,0),o(i,s+1,1,1,0),o(i+1,s,0,0,1)),i{this.ER.dA.$n&&s>i.length&&bt.console.warn("LightningChart JS unexpected error scenario, sphere geometry buffer size mismatch.\nA point series 3D component might have missing points.\n\nThis warning can be omitted with LightningChartOptions.warnings")})),{vertices:i,drawSize:s/6}}Tz(){this.ER.yV(this.uG)}}const lp=(t,e)=>{const i=Math.round(e);i<3&&me(0,kt);const s=i;let r=t.wV.Cz.get(Array.from(t.wV.Cz.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new ap(t,i,s),t.wV.Cz.set({sectors:i,stacks:s},r),r)};class up extends sp{constructor(t,e,i,s,r){super(t,e,i,s,r),this.BY="cull-back",this.JM=[],this.bG={},this.xW=new gy(this.JM,(t=>t.vertexBuffer&&this.ER.yV(t.vertexBuffer)),!0),this.yu=[],this.$a=0,this.Xa=[],this.ja=0,this.Ha=Pe,this.Za=Pe,this.gN=wg({lineStyleSolid:()=>{const t=this.uu;return qi(t)&&t},lineFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},lineFillPaletted:()=>{const t=this.uu.getFillStyle();return j(t)&&t},jointStyleTriangulatedPoints:()=>ur(this.mS)&&this.mS,jointSizeTriangulated:()=>{const t=this.mS;return ur(t)&&t.getSize()},jointFillSolid:()=>{const t=this.mS.getFillStyle();return Y(t)&&t},jointFillPaletted:()=>{const t=this.mS.getFillStyle();return j(t)&&t},wireframeLineStyleSolid:()=>{const t=ur(this.mS)&&this.mS.getWireframeStyle();return qi(t)&&t},wireframeFillSolid:()=>{const t=ur(this.mS)&&this.mS.getWireframeStyle(),e=t&&t.getFillStyle();return Y(e)&&e}}),this.Ja=!1,this.uu=Tr.lineStyle,this.mS=Tr.pointStyle3D,this.tS.M(Hn),this.kW={attributesPerVertex:3,prepareRenderData:(t,e)=>qt(t)}}Ds(t){const e=this.Ja,i=this.Xa,s=this.ja,r=s>0,n=this.uu,o=n!==this.du,h=this.mS,a=h!==this.tH,l=this.Uz(),u=this.Lo.o,c=this.Lo._();this.Za&&(this.Ha=qe(this.Ha,this.Za),this.Za=void 0),r&&(this.yu=ne(this.yu,i,{canReturnB:!0}),this.$a+=s);let d=i,f=s;if(e&&(this.JM.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=Pe})),this.xW.dW(),d=this.yu,f=this.$a),f>0){const t=1e5,e=Math.floor(this.nN.iH/(this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.Yo("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=Rt(i,t,e);this.xW.aW(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:Pe,vertexBuffer:this.ER.zV(t*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i))})),((t,e,i,s)=>{this.ER.VV(t.vertexBuffer,t.existingCoordinatesCount*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i)),t.existingDataPointsCount+=i-s,t.existingCoordinatesCount+=i,t.jointPointsCount+=s,t.lastDataPoint=e[i-1]}))}if(o||a||l||u){const t={},e=this.gN.lineStyleSolid(o),i=this.gN.lineFillSolid(o),s=this.gN.lineFillPaletted(o),r=i||s,h=this.gN.jointStyleTriangulatedPoints(a),l=this.gN.jointSizeTriangulated(a),u=this.gN.jointFillSolid(a),d=this.gN.jointFillPaletted(a),f=u||d,g=this.gN.wireframeLineStyleSolid(a),m=this.gN.wireframeFillSolid(a),y=n.getThickness()<0||1===n.getThickness()&&this.Yo("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",p=s?["lookup",s.getLookUpProperty(),s.lut]:"uniform";if("primitive"===y&&r?t.lines={type:"primitive",fillStyleSolid:i,fillStylePaletted:s,shader:this.ER.az(em["3D"],em.Color({dataType:p}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})),mousePicking:c?{shader:this.ER.az(em["3D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0}))}:void 0}:"instanced"===y&&e&&r&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:i,fillStylePaletted:s,shader:this.ER.az(em["3D"],em.ColorShaded3D({dataType:p,shadingStyle:this.tS._().type}),em.LineInstanced3D({axisWorldTranslation:Tg(this.ft)})),geometry:cp(this.ER,e.getThickness()),mousePicking:c?{shader:this.ER.az(em["3D"],em.MousePicking,em.LineInstanced3D({axisWorldTranslation:Tg(this.ft)}))}:void 0}),t.markers=void 0,f&&h){const e=se(h.getShape(),{cube:()=>ep(this.ER),sphere:()=>dp(this.ER,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof l&&l,pointSizeAxis:"object"==typeof l&&l,fillStyleSolid:u,fillStylePaletted:d,shader:this.ER.az(em["3D"],em.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty(),d.lut]:"uniform",shadingStyle:this.tS._().type,wireframe:!1!==m}),em.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:Tg(this.ft),normalSource:e.FY})),mousePicking:c?{shader:this.ER.az(em["3D"],em.MousePicking,em.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:Tg(this.ft),normalSource:void 0}))}:void 0,wireframe:g&&m&&{thickness:g.getThickness(),fillStyleSolid:m}}}this.bG=t}return this.Ja=!1,this.Xa=[],this.ja=0,this.du=n,this.tH=h,this.tS.o=!1,this.Lo.o=!1,this}VL(t){var e,i;const s=this.ER.gl,{lines:r,markers:n}=this.bG,o=this.tS._(),h=1===t?null===(e=null==r?void 0:r.mousePicking)||void 0===e?void 0:e.shader:null==r?void 0:r.shader;if(r&&h&&"instanced"===r.type){const e=h,{geometry:i,lineStyleSolid:n,fillStyleSolid:a,fillStylePaletted:l}=r;this.ER.lV(e,((r,h,u)=>{let c=!1;if(this.ER.ZR(e).PV(r("uScale"),this.LY.lE.AV()).PV(r("uDisp"),this.LY.lE.gV()).BV(r("uViewProjectionMatrix"),this.YY).fV(r("uOffsetWU"),this.Ts.Gy(n.getThickness())).fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.ER.PV(r("uCameraLoc"),this.HY).PV(r("uLightLoc"),this.$Y).fV(r("uAmbientReflection"),o.ambientReflection).fV(r("uSpecularReflection"),o.specularReflection).fV(r("uDiffuseReflection"),o.diffuseReflection).fV(r("uShininess"),o.shininess).gR(r("uLightColor"),o.specularColor).gR(r("uAmbientColor"),o.ambientColor),1===t)this.ER.gR(r("uColor"),this.mN);else if(a)this.ER.gR(r("uColorDiffuse"),a.getColor());else if(l){const t=kg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.ER.RO(u,l.lut,t)}return this.JM.forEach((t=>{s.bindBuffer(s.ARRAY_BUFFER,t.vertexBuffer);const e=h("aLocationA"),r=h("aLocationB");s.vertexAttribPointer(e,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(e,1),s.enableVertexAttribArray(e),s.vertexAttribPointer(r,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(r,1),s.enableVertexAttribArray(r),i.ZR(u).Zm(t.existingCoordinatesCount-1),c=!0})),c}))}if(r&&h&&"primitive"===r.type){const e=h,{fillStyleSolid:i,fillStylePaletted:n}=r;this.ER.lV(e,((r,o,h)=>{let a=!1;if(this.ER.ZR(e).PV(r("uScale"),this.LY.lE.AV()).PV(r("uDisp"),this.LY.lE.gV()).BV(r("uViewProjectionMatrix"),this.YY).fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0),1===t)this.ER.gR(r("uColor"),this.mN);else if(i)this.ER.gR(r("uColor"),i.getColor());else if(n){const t=kg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.ER.RO(h,n.lut,t)}return this.JM.forEach((t=>{this.ER.uV(t.vertexBuffer,void 0,{location:o("aPos"),size:3}).Zm(s.LINE_STRIP,t.existingCoordinatesCount),a=!0})),a}))}const a=1===t?null===(i=null==n?void 0:n.mousePicking)||void 0===i?void 0:i.shader:null==n?void 0:n.shader;if(n&&a){const e=a,{geometry:i,fillStyleSolid:s,fillStylePaletted:r,pointSizeAxis:h,pointSizeNWU:l,wireframe:u}=n;this.ER.lV(e,((n,a,c,d)=>{let f=!1;if(this.ER.ZR(e).PV(n("uScale"),this.LY.lE.AV()).PV(n("uDisp"),this.LY.lE.gV()).BV(n("uViewProjectionMatrix"),this.YY).fV(d("uRatioNwuWu"),this.LY.sH()).fV(n("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(n("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.ER.PV(n("uCameraLoc"),this.HY).PV(n("uLightLoc"),this.$Y).fV(n("uAmbientReflection"),o.ambientReflection).fV(n("uSpecularReflection"),o.specularReflection).fV(n("uDiffuseReflection"),o.diffuseReflection).fV(n("uShininess"),o.shininess).gR(n("uLightColor"),o.specularColor).gR(n("uAmbientColor"),o.ambientColor),1===t)this.ER.gR(n("uColor"),this.mN);else if(s)this.ER.gR(n("uColorDiffuse"),s.getColor());else if(r){const t=kg(r,this,void 0);if(!t&&r.lut.percentageValues)return!1;this.ER.RO(c,r.lut,t)}return u&&1!==t&&this.ER.fV(n("uWireframeThickness"),u.thickness).gR(n("uWireframeColor"),u.fillStyleSolid.getColor()),!1!==h&&this.ER.PV(n("uOffsetAxis"),[h.x,h.y,h.z]),!1!==l&&this.ER.fV(n("uOffsetNWU"),l),this.JM.forEach((e=>{this.ER.uV(e.vertexBuffer,1,{location:a("aPos"),size:3}),i.Zm(c,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(u)&&1!==t),f=!0})),f}))}return this}ol(t,e){Array.isArray(t)||(t=[t]),this.Xa=ne(this.Xa,t,{canReturnB:!0}),this.ja+=t.length;const i=e||Ke(t);return this.Za=this.Za?qe(this.Za,i):i,this}Ee(t){return this.uu="function"==typeof t?t(this.uu):t,this}cu(){return this.uu}zy(t){return this.mS="function"==typeof t?t(this.mS):t,this}eH(){return this.mS}bt(){return this.Za?Math.max(this.Za.max.x,this.Ha.max.x):this.Ha.max.x}xt(){return this.Za?Math.min(this.Za.min.x,this.Ha.min.x):this.Ha.min.x}_t(){return this.Za?Math.max(this.Za.max.y,this.Ha.max.y):this.Ha.max.y}Mt(){return this.Za?Math.min(this.Za.min.y,this.Ha.min.y):this.Ha.min.y}lS(){return this.Za?Math.max(this.Za.max.z,this.Ha.max.z):this.Ha.max.z}uS(){return this.Za?Math.min(this.Za.min.z,this.Ha.min.z):this.Ha.min.z}xl(){return Te(this.uu)}bl(){return Te(this.uu)}cS(){return Te(this.uu)}il(){return this.yu}tl(){return this.Xa}al(){return this.$a}ll(){return this.ja}Gt(){return this.Ja=!0,this.yu.length=0,this.$a=0,this.Xa=[],this.ja=0,this.Ha=Pe,this.Za=void 0,this}dispose(){return super.dispose(),this.xW.fW(),this.bG={},this}OR(){return this.dispose(),this}}const cp=(t,e)=>op(t,e>50?20:e>20?16:e>10?12:e>5?8:6),dp=(t,e)=>{const i=e.getSize();return lp(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class fp extends sp{constructor(t,e,i,s,r){super(t,e,i,s,r),this.BY="disabled",this.hH=!1,this.rH=!1,this.nH={x:1,y:1,z:1},this.Bv={x:0,y:0,z:0},this.Dv={x:0,y:0,z:0},this.Lv={x:0,y:0,z:0},this.Rv={x:1,y:1,z:1},this.oH=pl.projectionOrthographic(-1,1,-1,1,1,-1),this.aH=pl.projectionOrthographic(-1,1,-1,1,1,-1),this.lH=!1,this.gN=wg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStyleValuePalette:()=>j(this.be)&&"value"===this.be.lookUpProperty&&this.be}),this.be=Tr.fillStyle,this.tS.M(Hn)}Ds(t){var e;const i=this.Uz(),s=this.Lo._(),r=this.Lo.o,n=this.ia();this.gN.fillStyleSolid(n);const o=this.gN.fillStyleValuePalette(n),h=this.Lv,a=this.Rv;if(this.hH&&this.uH&&(this.uG=this.ER.oV(this.uH.vertices,void 0,this.uG),this.cG=this.ER.NV(this.uH.indices,this.cG),this.cH=this.uH.indices.length),"phong"===this.tS._().type&&(i||this.hH)&&(null===(e=this.uH)||void 0===e?void 0:e.normals)&&(this.dH=this.ER.oV(this.uH.normals,void 0,this.dH)),!this.fH&&o&&"value"===o.lookUpProperty&&this.uH&&(this.fH=new Float32Array(this.uH.vertices.length/3),this.rH=!0),this.fH&&this.rH&&(this.AH=this.ER.oV(this.fH,void 0,this.AH)),i||n||r){if(o&&"value"!==o.lookUpProperty)throw new Error("LightningChart JS MeshModel3D does not support look up by x/y/z. Must be value");this.dE=this.ER.az(em["3D"],em.ColorShaded3D({dataType:o?["lookup","value",o.lut]:"uniform",shadingStyle:this.tS._().type,wireframe:!1}),em.Model3D({normalSource:"phong"===this.tS._().type?"attribute":void 0})),this.yY=s?this.ER.az(em["3D"],em.MousePicking,em.Model3D({normalSource:void 0})):void 0}if(this.lH){const t=pl.projectionOrthographic(-1,1,-1,1,1,-1);this.aH=pl.rotateXYZ(t,h),this.oH=pl.translate(t,a.x/2,a.y/2,a.z/2),this.oH=pl.rotateXYZ(this.oH,h),this.oH=pl.translate(this.oH,-a.x/2,-a.y/2,-a.z/2),this.lH=!1}return this.tS.o=!1,this.ra(this.be),this.Lo.o=!1,this.hH=!1,this.rH=!1,this}VL(t){const e=1===t?this.yY:this.dE,i=1===t,s=this.cG,r=this.cH,n=this.uG,o=this.dH,h=this.AH,a=this.Bv,l=this.Dv,u=this.nH,c=this.Rv,d=this.oH,f=this.aH,g=this.gN.fillStyleValuePalette(!1),m=this.gN.fillStyleSolid(!1),y=this.tS._(),p={location:void 0,size:1};return e&&n&&s&&r?(this.ER.lV(e,((x,S,A,v)=>{if(this.ER.ZR(e).PV(x("uScale"),this.LY.lE.AV()).PV(x("uDisp"),this.LY.lE.gV()).BV(x("uViewProjectionMatrix"),this.YY).fV(x("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(x("uHighlightColorOffset"),this.Wo).fV(x("uRenderEffectMask"),2===t?1:0),i)this.ER.gR(x("uColor"),this.mN);else{if(this.be===z)return!1;if(m)this.ER.gR(x("uColorDiffuse"),m.getColor());else if(g){if(!h)return!1;const t=g.getPalette();p.location=S("aLookupValue"),this.ER.RO(A,t,void 0).uV(h,void 0,p)}}return"phong"!==y.type||i||(this.ER.PV(x("uCameraLoc"),this.HY).PV(x("uLightLoc"),this.$Y).fV(x("uAmbientReflection"),y.ambientReflection).fV(x("uSpecularReflection"),y.specularReflection).fV(x("uDiffuseReflection"),y.diffuseReflection).fV(x("uShininess"),y.shininess).gR(x("uLightColor"),y.specularColor).gR(x("uAmbientColor"),y.ambientColor).BV(x("uModelRotationNormals"),f),o&&this.ER.uV(o,void 0,{location:A.attribute("aNormal"),size:3})),this.ER.BV(x("uModelRotation"),d).PV(x("uModelScale"),[u.x,u.y,u.z]).PV(x("uLocationAxis"),[a.x,a.y,a.z]).PV(x("uModelAlignment"),[l.x,l.y,l.z]).PV(x("uModelSize"),[c.x,c.y,c.z]),this.ER.uV(n,0,{location:A.attribute("aGeoPos"),size:3}).jV(s).QV(r,this.ER.gl.TRIANGLES),!0})),this):this}dispose(){return super.dispose(),this.uG&&(this.ER.yV(this.uG),this.uG=void 0),this.cG&&(this.ER.yV(this.cG),this.cG=void 0),this.dH&&(this.ER.yV(this.dH),this.dH=void 0),this.AH&&(this.ER.yV(this.AH),this.AH=void 0),this.dE=void 0,this.yY=void 0,this.uH=void 0,this.fH=void 0,this}OR(){return this.dispose(),this}zv(t){return this.uH=t,this.hH=!0,this.Rv=t.modelSize,this}Ov(t){return this.fH=t,this.rH=!0,this}ke(t){return this.be=jr(this.be,t),this}zh(){return this.be}Nv(t){return this.nH=t,this}AV(){return this.nH}Gv(t){return this.Bv=t,this}Wv(t){return this.Dv=t,this}Uv(t){return this.Lv=t,this.lH=!0,this}Yv(t){return this.BY=t,this}Hv(){return this.BY}bt(){return Ve}xt(){return Le}_t(){return Ve}Mt(){return Le}lS(){return Ve}uS(){return Le}xl(){return 0}bl(){return 0}cS(){return 0}ia(){return $r(this.sa,this.be)}ra(t){this.sa=t}}class gp extends sp{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.BY="cull-back",this.JM=[],this.xW=new gy(this.JM,(t=>t.vertexBuffer&&this.ER.yV(t.vertexBuffer)),!1),this.yu=[],this.$a=0,this.Xa=[],this.ja=0,this.Ha=Pe,this.Za=Pe,this.Ja=!1,this.gN=wg({fillStyleSolid:()=>{const t=this.vS.getFillStyle();return Y(t)&&t},fillStyleIndividual:()=>{const t=this.vS.getFillStyle();return X(t)&&t},fillStylePalette:()=>{const t=this.vS.getFillStyle();return j(t)&&t},triangulatedPointStyle:()=>{const t=this.vS;return ur(t)&&t},wireframeLineStyleSolid:()=>{const t=ur(this.vS)&&this.vS,e=t&&t.getWireframeStyle();return qi(e)&&e},wireframeFillStyleSolid:()=>{const t=ur(this.vS)&&this.vS,e=t&&t.getWireframeStyle(),i=e&&e.getFillStyle();return Y(i)&&i}}),this.Ka=void 0,this.Yn=n,this.vS=Tr.pointStyle3D,this.tS.M(Hn);const o=!0===(null==n?void 0:n.individualPointColorEnabled),h=!0===(null==n?void 0:n.individualPointSizeEnabled),a=!0===(null==n?void 0:n.individualLookupValuesEnabled),l=!0===(null==n?void 0:n.individualPointSizeAxisEnabled);let u,c,d,f,g=0;g+=3,o&&(u=g,g+=4),h&&(c=g,g+=1),a&&(d=g,g+=1),l&&(f=g,g+=3);const m=((t,e,i,s)=>t||e||i||s?!t||e||i||s?t||!e||i||s?t||e||!i||s?t||e||i||!s?(r,n,o)=>{const h=3+(t?4:0)+(e?1:0)+(i?1:0)+(s?3:0),a=r.length,l=new Float32Array(a*h);let u=0,c=u;for(let t=0;t((t,e)=>{const i=e&&e.getSize();let s={x:1,y:1,z:1};"object"==typeof i&&(s=i);const r=t.length,n=new Float32Array(6*r);let o=0;for(let e=0;e(t=>{const e=t.length,i=new Float32Array(4*e);for(let s=0,r=0;s((t,e)=>{const i=e&&e.getSize();let s=1;"number"==typeof i&&(s=i);const r=t.length,n=new Float32Array(4*r);for(let e=0,i=0;e((t,e)=>{const i=e&&X(e)&&e.getFallbackColor()||R,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;eqt(t))(o,h,a,l);this.kW={individualPointColorEnabled:o,individualPointSizeEnabled:h,individualLookupValuesEnabled:a,individualPointSizeAxisEnabled:l,attributesPerVertex:g,attributeOffsetCoordinate:0,attributeOffsetColor:u,attributeOffsetSize:c,attributeOffsetLookUpValue:d,attributeOffsetPointSize3D:f,prepareRenderData:(t,e)=>m(t,this.vS,this.vS.fillStyle)}}Ds(t){const e=this.Ja,i=this.Xa,s=this.ja,r=s>0,n=this.vS,o=this.vS!==this.gH,h=this.Lo._(),a=this.Lo.o,l=this.Uz();this.Za&&(this.Ha=qe(this.Ha,this.Za),this.Za=void 0),r&&(this.yu=ne(this.yu,i,{canReturnB:!0}),this.$a+=s);let u=i,c=s;if(e&&(this.JM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=Pe})),this.xW.dW(),u=this.yu,c=this.$a),c>0){const t=Math.floor(this.nN.iH/(this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=Rt(c,1e5,t);this.xW.aW(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:Pe,vertexBuffer:this.ER.zV(t*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i))})),((t,e,i)=>{this.ER.VV(t.vertexBuffer,t.existingCoordinatesCount*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}const d=n.getFillStyle(),f=this.gN.fillStyleSolid(o),g=this.gN.fillStyleIndividual(o),m=this.gN.fillStylePalette(o),y=d===z&&z;if(o||l||a){let t;const e=n.getSize(),i=this.kW.individualPointColorEnabled,s=this.kW.individualPointSizeEnabled,r=this.kW.individualPointSizeAxisEnabled,a=this.kW.individualLookupValuesEnabled;if(g&&!i){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw bt.alert(t),new Error(t)}if(m&&"value"===m.getLookUpProperty()&&!a){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw bt.alert(t),new Error(t)}const l=this.gN.wireframeLineStyleSolid(o),u=this.gN.wireframeFillStyleSolid(o);if(f||g||m||u){const i=g?"attribute":m?["lookup",m.getLookUpProperty(),m.lut]:"uniform",o=s&&"number"==typeof e,a=r&&"object"==typeof e,c=o||a?"attribute":"uniform";if(ur(n)){const r=se(n.getShape(),{cube:()=>ep(this.ER),sphere:()=>mp(this.ER,n,s)});t={type:"instanced",shader:this.ER.az(em["3D"],em.ColorShaded3D({dataType:i,shadingStyle:this.tS._().type,wireframe:!1!==u}),em.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:Tg(this.ft),normalSource:r.FY})),pointStyle:n,useIndividualPointSize:o,useIndividualPointSize3D:a,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,fillStyleEmpty:y,mousePickingShader:h&&this.ER.az(em["3D"],em.MousePicking,em.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:Tg(this.ft),normalSource:void 0})),geometry:r,wireframe:l&&u&&{thickness:l.getThickness()<0?1:l.getThickness(),fillStyleSolid:u}}}else fr(n)&&"number"==typeof e&&(t={type:"primitive",shader:this.ER.az(em["3D"],em.PointSize(c),em.Color({dataType:i}),em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:o,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,mousePickingShader:h&&this.ER.az(em["3D"],em.PointSize(c),em.MousePicking,em.VertexLocation({axisWorldTranslation:Tg(this.ft),normalSource:void 0}))})}this.bG=t}if(void 0===this.Ka&&m&&"value"===m.lookUpProperty&&m.lut.percentageValues){let t=Ve,e=Le;for(let i=0;it&&(t=s.value)}this.Ka={min:e,max:t}}return this.Ja=!1,this.Xa=[],this.ja=0,this.gH=n,this.tS.o=!1,this}VL(t){const e=this.ER.gl,i=this.bG;if(!i)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const r=this.tS._(),{fillStyleSolid:n,fillStylePaletted:o,useIndividualPointSize:h}=i,a="instanced"===i.type&&i.useIndividualPointSize3D,l="instanced"===i.type&&i.wireframe;return this.ER.lV(s,((u,c,d,f)=>{let g=!1;if(this.ER.ZR(s).PV(u("uScale"),this.LY.lE.AV()).PV(u("uDisp"),this.LY.lE.gV()).BV(u("uViewProjectionMatrix"),this.YY).fV(u("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(u("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(u("uRenderEffectMask"),2===t?1:0),"instanced"===i.type){const{pointSizeAxis:t,pointSizeNWU:e}=i;!1!==t&&!1===a&&this.ER.PV(u("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===h&&this.ER.fV(u("uOffsetNWU"),e).fV(f("uRatioNwuWu"),this.LY.sH())}else if("primitive"===i.type){const{pointSizePixels:t}=i;h||this.ER.fV(u("uPointSize"),t).fV(u("uDevicePixelRatio"),this.ER.Xz())}if(1===t)this.ER.gR(u("uColor"),this.mN);else if("instanced"===i.type?("phong"===r.type&&this.ER.PV(u("uCameraLoc"),this.HY).PV(u("uLightLoc"),this.$Y).fV(u("uAmbientReflection"),r.ambientReflection).fV(u("uSpecularReflection"),r.specularReflection).fV(u("uDiffuseReflection"),r.diffuseReflection).fV(u("uShininess"),r.shininess).gR(u("uLightColor"),r.specularColor).gR(u("uAmbientColor"),r.ambientColor),l&&this.ER.fV(u("uWireframeThickness"),l.thickness).gR(u("uWireframeColor"),l.fillStyleSolid.getColor()),n&&this.ER.gR(u("uColorDiffuse"),n.getColor()),i.fillStyleEmpty&&this.ER.gR(u("uColorDiffuse"),I)):"primitive"===i.type&&n&&this.ER.gR(u("uColor"),n.getColor()),o){const t=kg(o,this,this.Ka);if(!t&&o.lut.percentageValues)return!1;this.ER.RO(d,o.lut,t)}return this.JM.forEach(((s,n)=>{e.bindBuffer(e.ARRAY_BUFFER,s.vertexBuffer);const o=c("aPos");if(e.vertexAttribPointer(o,3,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(o,1),e.enableVertexAttribArray(o),i.fillStyleIndividual&&void 0!==this.kW.attributeOffsetColor&&1!==t){const t=c("aColor");e.vertexAttribPointer(t,4,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(t,1),e.enableVertexAttribArray(t)}if(h&&void 0!==this.kW.attributeOffsetSize){"instanced"===i.type?this.ER.fV(f("uRatioNwuWu"),this.LY.sH()):"primitive"===i.type&&this.ER.fV(u("uDevicePixelRatio"),this.ER.Xz());const t=c("instanced"===i.type?"aOffsetNWU":"aPointSize");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(t,1),e.enableVertexAttribArray(t)}if(a&&void 0!==this.kW.attributeOffsetPointSize3D&&"instanced"===i.type){const t=c("aOffsetAxis");e.vertexAttribPointer(t,3,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(t,1),e.enableVertexAttribArray(t)}if(i.fillStylePaletted&&"value"===i.fillStylePaletted.getLookUpProperty()&&void 0!==this.kW.attributeOffsetLookUpValue&&1!==t){const t=c("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(t,1),e.enableVertexAttribArray(t)}"instanced"===i.type?(i.geometry.Zm(d,s.existingCoordinatesCount,"phong"===r.type&&1!==t,Boolean(l)&&1!==t),g=!0):"primitive"===i.type&&(this.ER.Zm(e.POINTS,s.existingCoordinatesCount),g=!0)})),g})),this}ol(t,e){Array.isArray(t)||(t=[t]),this.Xa=ne(this.Xa,t,{canReturnB:!0}),this.ja+=t.length;const i=e||Ke(t);return this.Za=this.Za?qe(this.Za,i):i,this.Ka=void 0,this}xS(t){return this.vS="function"==typeof t?t(this.vS):t,this}pH(){return this.vS}bt(){return this.Za?Math.max(this.Za.max.x,this.Ha.max.x):this.Ha.max.x}xt(){return this.Za?Math.min(this.Za.min.x,this.Ha.min.x):this.Ha.min.x}_t(){return this.Za?Math.max(this.Za.max.y,this.Ha.max.y):this.Ha.max.y}Mt(){return this.Za?Math.min(this.Za.min.y,this.Ha.min.y):this.Ha.min.y}lS(){return this.Za?Math.max(this.Za.max.z,this.Ha.max.z):this.Ha.max.z}uS(){return this.Za?Math.min(this.Za.min.z,this.Ha.min.z):this.Ha.min.z}xl(){const t=this.vS,e=t.getSize();return"number"==typeof e?ur(t)?e/2:fr(t)?5:0:0}bl(){return this.xl()}cS(){return this.xl()}il(){return this.yu}tl(){return this.Xa}al(){return this.$a}ll(){return this.ja}Gt(){return this.Ja=!0,this.yu.length=0,this.$a=0,this.Xa=[],this.ja=0,this.Ha=Pe,this.Za=void 0,this.Ka=void 0,this}dispose(){return super.dispose(),this.xW.fW(),this.bG=void 0,this}OR(){return this.dispose(),this}}const mp=(t,e,i)=>{const s=e.getSize();return lp(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class yp extends sp{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.BY="disabled",this.be=Tr.fillStyle,this.pv=Tr.lineStyle,this.cU=p("bilinear"),this.mH=[],this.yH=void 0,this.bG={},this.SH=!1,this.gN=wg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be,wireframeStyleLine:()=>qi(this.pv)&&this.pv,wireframeStyleFill:()=>{const t=this.pv&&this.pv.getFillStyle();return Y(t)&&t}}),this.Di={x:0,z:0},this.Xw={x:1,z:1},this.tS.M(Gn);const o="columns"===s.dataOrder?s.columns:s.rows,h="columns"===s.dataOrder?s.rows:s.columns;this.Yn={...s,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h},this.vH=new Array(this.Yn.primaryDimensionVectorsCount).fill(void 0),this.P_=new Dy(this.nN,t.nN.kU,t.cs.ft,kt,[],this.Yn,-1,R).mv(ot),this.P_.AU=wy;const a=this.P_.pU.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,r=t.iFirstUniqueVector,n=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary),o={primary:t.sizeHeatmapDataVectors.primary-1,secondary:t.sizeHeatmapDataVectors.secondary-1};return{iFirstVector:t.iFirstVector,iFirstUniqueVector:t.iFirstUniqueVector,sizeHeatmapDataVectors:t.sizeHeatmapDataVectors,sizeUniqueHeatmapDataVectors:t.sizeUniqueHeatmapDataVectors,iFirstGeometryVector:s,iFirstGeometryUniqueVector:r,sizeGeometryDataVectors:e,sizeUniqueGeometryDataVectors:i,heightmapData:n,normalmapSize:o}})),l=this.P_.pU.gridTileSizes.map((t=>{const e=a.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary)),i=e[0].sizeGeometryDataVectors;return{...t,tiles:e,sizeGeometryData:i}})),u=a.reduce(((t,e)=>{const i=e.sizeHeatmapDataVectors.primary,s=e.sizeHeatmapDataVectors.secondary,r=i*s;return r>t.cells?{primary:i,secondary:s,cells:r}:t}),{primary:0,secondary:0,cells:0});this.xH={gridTiles:a,gridTileSizes:l,largestGridTileSize:u},this.vv(this.Di,this.Xw)}bH(t){this.MH=t,this.yH=void 0}vv(t,e){this.Di=t,this.Xw=e;const i=this.Yn,s={min:{x:Math.min(this.Di.x,this.Di.x+(i.columns-1)*this.Xw.x),z:Math.min(this.Di.z,this.Di.z+(i.rows-1)*this.Xw.z)},max:{x:Math.max(this.Di.x,this.Di.x+(i.columns-1)*this.Xw.x),z:Math.max(this.Di.z,this.Di.z+(i.rows-1)*this.Xw.z)}},r=new Map;return this.xH.gridTiles.forEach((t=>{const e="columns"===this.Yn.dataOrder?{x:this.Xw.x*(t.sizeHeatmapDataVectors.primary-1),z:this.Xw.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.Xw.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.Xw.z*(t.sizeHeatmapDataVectors.primary-1)},i="columns"===this.Yn.dataOrder?{x:this.Di.x+this.Xw.x*t.iFirstVector.primary,z:this.Di.z+this.Xw.z*t.iFirstVector.secondary}:{x:this.Di.x+this.Xw.x*t.iFirstVector.secondary,z:this.Di.z+this.Xw.z*t.iFirstVector.primary};r.set(t,{sizeAxis:e,startLocationAxis:i})})),this.bU={_H:s,tilesInfo:r},this}xv(){return{start:this.Di,step:this.Xw,end:{x:this.Di.x+this.Xw.x*this.Yn.columns,z:this.Di.z+this.Xw.z*this.Yn.rows}}}Ds(t){const e=this.mH,i=$r(this.sa,this.be),s=this.gN.fillStyleSolid(i),r=this.gN.fillStylePaletted(i),n=this.pv,o=this.pv!==this.mU,h=this.gN.wireframeStyleLine(o),a=this.gN.wireframeStyleFill(o),l=!1!==a,u=this.cU.o,c=this.cU._(),d=this.tS._(),f=this.Uz(),g=this.Lo._();this.P_.Ds();const m=this.P_.yU;if(!m)return this;this.wH=this.wH||this.CH(m);const y=this.wH;this.kH(y);const p=ky(e,y,void 0,(t=>t.sizeGeometryDataVectors));if(p.size>0&&(Iy(this.ER,p,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.SH=!0),"phong"===d.type&&(p.size>0||f)){const t=this.ER.gl,e=this.ER.az(em["2D"],em.DrawToNormalTexture({flipXZ:"rows"===this.Yn.dataOrder,vertexIdSource:this.ER.wO(),normalTextureType:this.ER.gl2?"uint":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN}));y.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{var r;const n=s.normalmapTexture,o=null===(r=this.bU)||void 0===r?void 0:r.tilesInfo.get(s.tileData);if(!n||!o)return;const h={x:s.normalmapSize.secondary,y:s.normalmapSize.primary},a=h.x*h.y;this.ER.aO.VL((()=>{this.ER.lV(e,((r,n,h,l)=>(this.ER.ZR(e).CO(h,a).cV(r("uTileDimensionsXZ"),["columns"===this.Yn.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.Yn.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).FV(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).cV(r("uTileStartLocationAxisXZ"),[o.startLocationAxis.x,o.startLocationAxis.z]).cV(r("uTileSizeAxisXZ"),[o.sizeAxis.x,o.sizeAxis.z]).dV(r("uHeightmapTexture"),s.heightmapDataTexture,1).Zm(t.POINTS,a),!0)))}),n,h,void 0,this.cs.mn(),0)}))}))}const x=this.bG;if(i||o||u){const t=h&&a?{wireframeSolid:h,wireframeFillSolid:a}:void 0;s?x.surface={shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:Tg(this.ft),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:r&&"value"===r.getLookUpProperty()?x.surface={shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:Tg(this.ft),fillColor:["lookup","value",r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r},wireframe:t}:r?x.surface={shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:Tg(this.ft),fillColor:["lookup",r.getLookUpProperty(),r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r},wireframe:t}:l&&(x.surface={shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:Tg(this.ft),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return x.mousePicking=g?this.bG.mousePicking||{shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:Tg(this.ft),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:"simple",wireframe:!1,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.bG=x,this.mH.length=0,this.sa=this.be,this.mU=n,this.tS.o=!1,this}CH(t){const e=this.xH.gridTiles.map((e=>{const i=Ry(this.ER,e.sizeHeatmapDataVectors.secondary,e.sizeHeatmapDataVectors.primary),s=t.gridTiles.find((t=>t.iFirstUniqueVector.primary===e.iFirstUniqueVector.primary&&t.iFirstUniqueVector.secondary===e.iFirstUniqueVector.secondary));if(!s)throw new Error("Internal LC JS error prepare surface data 2D render data not found");return{...e,intensityDataTexture:s.intensityDataTexture,heightmapDataTexture:i,normalmap:void 0,tileData:e}})),i=this.xH.gridTileSizes.map((t=>{const i=e.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary));return{...t,tiles:i}})),s=this.ER.oV([0,0,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,0]),r=this.ER.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}kH(t){var e;if("phong"===this.tS._().type)for(let i=0;i{t.normalmapTexture&&(this.ER.NR(t.normalmapTexture),t.normalmapTexture=void 0)}))}VL(t){var e,i,s,r;const n=this.ER.gl,o=this.wH;if(!o)return this;const h=this.tS._(),a=this.bG,l=1===t?null===(e=a.mousePicking)||void 0===e?void 0:e.shader:null===(i=a.surface)||void 0===i?void 0:i.shader;if(!l)return this;const u=1!==t?null===(s=a.surface)||void 0===s?void 0:s.wireframe:void 0,c=1!==t?null===(r=a.surface)||void 0===r?void 0:r.fill:void 0;return this.ER.lV(l,((e,i,s,r)=>{let a=!1;if(this.ER.ZR(l).TO(s,this.xH.largestGridTileSize.cells).PV(e("uScale"),this.LY.lE.AV()).PV(e("uDisp"),this.LY.lE.gV()).BV(e("uViewProjectionMatrix"),this.YY).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===h.type&&this.ER.PV(e("uCameraLoc"),this.HY).PV(e("uLightLoc"),this.$Y).fV(e("uAmbientReflection"),h.ambientReflection).fV(e("uSpecularReflection"),h.specularReflection).fV(e("uDiffuseReflection"),h.diffuseReflection).fV(e("uShininess"),h.shininess).gR(e("uLightColor"),h.specularColor).gR(e("uAmbientColor"),h.ambientColor),u)){const{wireframeFillSolid:t,wireframeSolid:i}=u,s=i.getThickness()<0?1:i.getThickness();this.ER.gR(e("uWireframeColor"),t.getColor()).fV(e("uWireframeThickness"),s)}return 1===t?this.ER.gR(e("uColorDiffuse"),this.mN):"solid"===(null==c?void 0:c.fillMode)&&this.ER.gR(e("uColorDiffuse"),c.fillStyleSolid.getColor()),o.gridTileSizes.forEach((r=>{this.ER.cV(e("uTileDimensionsXZ"),["columns"===this.Yn.dataOrder?r.sizeHeatmapData.primary:r.sizeHeatmapData.secondary,"columns"===this.Yn.dataOrder?r.sizeHeatmapData.secondary:r.sizeHeatmapData.primary]).FV(e("uTileDimensions"),[r.sizeHeatmapData.primary,r.sizeHeatmapData.secondary]),r.tiles.forEach((h=>{var l;const d=null===(l=this.bU)||void 0===l?void 0:l.tilesInfo.get(h.tileData);if(!d)return;let f=0,g=(h.sizeHeatmapDataVectors.primary-1)*(h.sizeHeatmapDataVectors.secondary-1);if(this.MH){const t=this.MH.fill.iFirstPrimary,e=this.MH.fill.iFirstPrimary+this.MH.fill.amountPrimary-1,i=h.iFirstVector.primary,s=h.iFirstVector.primary+h.sizeHeatmapDataVectors.primary-1;if(i>e||sm(Math.max(t,i),Math.min(e,s)))(t,e,i,s);f=(n.min-h.iFirstVector.primary)*(r.sizeGeometryData.secondary-1),g=(n.max-n.min)*(r.sizeGeometryData.secondary-1)}if(!(f<0||g<=0)){if("intensity"===(null==c?void 0:c.fillMode)){const{fillStylePaletted:t}=c,i=this.P_.Ka;this.ER.RO(s,t.lut,i).dV(e("uTileIntensityValues"),h.intensityDataTexture,2).IV(e("uTileBoundsAxisXZ"),[d.startLocationAxis.x,d.startLocationAxis.z,d.sizeAxis.x,d.sizeAxis.z])}if("xyz"===(null==c?void 0:c.fillMode)){const{fillStylePaletted:t}=c,e="x"===t.getLookUpProperty()?{min:this.xt(),max:this.bt()}:"y"===t.getLookUpProperty()?{min:this.Mt(),max:this._t()}:"z"===t.getLookUpProperty()?{min:this.uS(),max:this.lS()}:void 0;if(!e&&t.lut.percentageValues)return;this.ER.RO(s,t.lut,e)}1!==t&&"phong"===this.tS._().type&&h.normalmapTexture&&this.ER.dV(e("uNormalmapTexture"),h.normalmapTexture,3),this.ER.uV(o.rectangleLocationsBuffer,0,{location:i("aGeoCellOffset"),size:2},{location:u?i("aTriangleBary"):void 0,size:3}).LV(e("uBaseInstance"),f).cV(e("uTileStartLocationAxisXZ"),[d.startLocationAxis.x,d.startLocationAxis.z]).cV(e("uTileSizeAxisXZ"),[d.sizeAxis.x,d.sizeAxis.z]).dV(e("uHeightmapTexture"),h.heightmapDataTexture,0).JV(o.rectangleLocationsDrawMode,0,o.rectangleLocationsDrawLength,g),a=!0,n.bindBuffer(n.ARRAY_BUFFER,null)}}))})),a})),this}dispose(){return super.dispose(),this.P_.dispose(),this.wH&&(this.wH.gridTileSizes.forEach((t=>{})),this.wH.gridTiles.forEach((t=>{this.ER.NR(t.heightmapDataTexture),t.normalmapTexture&&this.ER.NR(t.normalmapTexture)})),this.ER.yV(this.wH.rectangleLocationsBuffer),this.wH=void 0),this.bG={},this}OR(){return this.dispose(),this.P_.OR(),this}wv(t){return this.P_.wv(t),this}Cv(t){this.mH.push(t),Cy(this.xH.gridTiles,t,(t=>t.heightmapData));for(let e=t.startPrimary;e{for(let n=Math.max(t,r.iFirstUniqueVector.primary);n<=Math.min(e,r.iFirstUniqueVector.primary+r.sizeUniqueHeatmapDataVectors.primary-1);n+=1){const t=(n-r.iFirstUniqueVector.primary)*r.sizeHeatmapDataVectors.secondary;let e=this.vH[n];if(e)i=ie.max?s:e.max;else{e={min:Le,max:Ve},this.vH[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.yH={min:i,max:s},this.yH}}class pp extends sp{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.BY="disabled",this._U=0,this.CU={},this.Di={x:0,z:0},this.Xw={x:1,z:1},this.Yn={...s,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this._H={min:{x:this.Di.x,z:this.Di.z},max:{x:"rows"===s.scrollDimension?this.Di.x+(s.columns-1)*this.Xw.x:this.Di.x,z:"columns"===s.scrollDimension?this.Di.z+(s.rows-1)*this.Xw.z:this.Di.z}};const o=()=>({shape:new yp(this.LY,kt,this.No,{columns:s.columns+("columns"===s.scrollDimension?1:0),rows:s.rows+("rows"===s.scrollDimension?1:0),dataOrder:s.scrollDimension,heatmapDataType:"intensity"},this.pN,this.mN).setVisible(!1),hasData:!1});this.JM=[o(),o()]}Ds(t){this.JM.forEach((e=>{e.shape.Ds(t)}));const e=this.JM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Ft(null===(i=e.shape.P_.Ka)||void 0===i?void 0:i.min,Le)),t.max=Math.max(t.max,Ft(null===(s=e.shape.P_.Ka)||void 0===s?void 0:s.max,Ve)),t}),{min:Le,max:Ve}),i=this.JM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Ft(null===(i=e.shape.yH)||void 0===i?void 0:i.min,Le)),t.max=Math.max(t.max,Ft(null===(s=e.shape.yH)||void 0===s?void 0:s.max,Ve)),t}),{min:Le,max:Ve});return this.JM.forEach((t=>{t.shape.P_.Ka=e,t.shape.yH=i})),this}VL(t){return this.JM.forEach((e=>{e.hasData&&(e.shape.YY=this.YY,e.shape.HY=this.HY,e.shape.$Y=this.$Y,e.shape.VL(t))})),this}vv(t,e){return this.Di=t,this.Xw=e,this.JM.forEach((t=>{t.shape.vv("columns"===this.Yn.scrollDimension?{x:t.shape.xv().start.x,z:this.Di.z}:{x:this.Di.x,z:t.shape.xv().start.z},this.Xw)})),"columns"===this.Yn.scrollDimension?(this._H.min.z=t.z,this._H.max.z=this.Di.z+(this.Yn.rows-1)*this.Xw.z):(this._H.min.x=t.x,this._H.max.x=this.Di.x+(this.Yn.columns-1)*this.Xw.x),this}xv(){return{start:this.Di,step:this.Xw}}Gt(){return this._U=0,this.CU={},this._H={min:{x:this.Di.x,z:this.Di.z},max:{x:"rows"===this.Yn.scrollDimension?this.Di.x+(this.Yn.columns-1)*this.Xw.x:this.Di.x,z:"columns"===this.Yn.scrollDimension?this.Di.z+(this.Yn.rows-1)*this.Xw.z:this.Di.z}},this.JM.forEach((t=>{t.shape.setVisible(!1),t.shape.SH=!1,t.hasData=!1})),this}Iv(t){var e;const i=this.JM[0],s=this.JM[1],r=t.heightMapValues?t.heightMapValues.length:null===(e=t.intensityValues)||void 0===e?void 0:e.length;let n=0;if(!r)return this;do{const e=Math.floor(this._U/this.Yn.scrollDimensionSize)%this.JM.length,o=this.JM[e],h=this._U%this.Yn.scrollDimensionSize,a=this.Yn.scrollDimensionSize-h,l=0===h,u=Math.min(a,r),c=h+u,d=h,f=d+1,g=n,m=n+u,y=this._U>=this.Yn.scrollDimensionSize&&c<=this.Yn.scrollDimensionSize-1,p=l;l&&(o.shape.vv("columns"===this.Yn.scrollDimension?{x:this.Di.x+(this._U-1)*this.Xw.x,z:this.Di.z}:{x:this.Di.x,z:this.Di.z+(this._U-1)*this.Xw.z},this.Xw),o.shape.setVisible(!0));const x=y?0:1,S=c+(y?1:0);o.shape.bH({fill:{iFirstPrimary:x,amountPrimary:S},wireframe:{iFirstPrimary:x,amountPrimary:S,connectNext:!1}});const A=o===i?s:i,v=c+1,b=1+this.Yn.scrollDimensionSize-v;A.shape.bH({fill:{iFirstPrimary:v,amountPrimary:b},wireframe:{iFirstPrimary:v,amountPrimary:b-1,connectNext:!0}});const M={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,m);let i=!1;p&&this.CU.yValues&&(i=!0,e.splice(0,0,this.CU.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Yn.staticDimensionSize,values:e,type:"y"};o.shape.Cv(s),o.hasData=!0,M.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,m);let i=!1;p&&this.CU.intensityValues&&(i=!0,e.splice(0,0,this.CU.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Yn.staticDimensionSize,values:e,type:"intensity"};o.shape.wv(s),o.hasData=!0,M.intensityValues=e[u-1]}this._U+=u,n+=u,this.CU=M}while(ne.shape.Mv(t))),this}_v(){return this.JM[0].shape._v()}ke(t){return this.JM.forEach((e=>e.shape.ke(t))),this}zh(){return this.JM[0].shape.zh()}mv(t){return this.JM.forEach((e=>e.shape.mv(t))),this}bv(){return this.JM[0].shape.bv()}OR(){return this.dispose(),this.JM.forEach((t=>t.shape.OR())),this}dispose(){return super.dispose(),this.JM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.JM.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}nS(t){return super.nS(t),this.JM.forEach((e=>e.shape.nS(t))),this}bt(){return this._H.max.x}xt(){return this._H.min.x}_t(){return Math.max(this.JM[0].shape._t(),this.JM[1].shape._t())}Mt(){return Math.min(this.JM[0].shape.Mt(),this.JM[1].shape.Mt())}lS(){return this._H.max.z}uS(){return this._H.min.z}xl(){return 0}bl(){return 0}cS(){return 0}ds(t){return super.ds(t),this.JM.forEach((e=>e.shape.ds(t))),this}}class xp extends jy{constructor(t,e,i,s){super(t,e,i),this.FH=45,this.IH=.1,this.PH=100,this.HY=f(0,0,1),this.DH=f(0,0,-1),this.BH=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.tS=new On,this.ft=s}qv(){const{cellIndex:t,cellSpan:e,cellsAmount:i}=this.ft,s=e.x/i.x,r=e.y/i.y,n=t.x/i.x,o=t.y/i.y,h=this.cs.ai();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.HY=t,this}getCameraLocation(){return this.HY}setCameraDirection(t){return this.DH=De.normalize(t),this}getCameraDirection(){return this.DH}setLightLocation(t){return this.$Y=t,this}getLightLocation(){return this.$Y}LH(){return f(this.BH[0],this.BH[1],this.BH[2])}RH(){return f(this.BH[4],this.BH[5],this.BH[6])}}class Sp extends xp{constructor(t,e,i,s){super(t,e,i,s),this.lE=new Hm,this.EH=!0,this.nN=t,this.gl=t.aN(),this._Y=this.SY,this.zH=this.cs.ko((()=>{this.EH=!0})),this.VH=s.Y((()=>{this.EH=!0}))}nV(t){const e=t.xt(),i=t.Mt(),s=t.uS(),r=t.bt(),n=t._t(),o=t.lS();if(e===Le||r===Ve||i===Le||n===Ve||s===Le||o===Ve)return _e;const h=t.xl(),a=t.bl(),l=t.cS(),u=Math.abs(t.Ts.Gy(h)*t.ft.x.ht()),c=Math.abs(t.Ts.Gy(a)*t.ft.y.ht()),d=Math.abs(t.Ts.Gy(l)*t.ft.z.ht()),f=e-u,g=r+u,m=i-c,y=n+c,p=s-d,x=o+d;let S;return[{x:f,y:m,z:p},{x:g,y:m,z:p},{x:f,y,z:p},{x:g,y,z:p},{x:f,y:m,z:x},{x:g,y:m,z:x},{x:f,y,z:x},{x:g,y,z:x}].map((e=>t.Ts.Uy(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};S=S?Je(S,{min:t,max:t}):e})),S||_e}wY(t){const e=Array.from(this._Y.values());for(let i=0;iye()));const{viewProjectionMatrix:s}=this.OH();this.NH();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.SY.forEach((t=>{t.YY=s,t.HY=r,t.$Y=n,t.Ds(i)})),this}OH(){if(!this.EH&&this.YY)return{viewProjectionMatrix:this.YY};const t=this.qv(),e=t.width/t.height;this.GH=pl.projectionPerspective(this.FH,e,this.IH,this.PH);const i=this.HY;this.BH[12]=i.x,this.BH[13]=i.y,this.BH[14]=i.z;const s=this.DH,r=f(0,1,0),n=De.multiply(s,-1),o=De.normalize(De.cross(r,n)),h=De.normalize(De.cross(n,o));this.BH[0]=o.x,this.BH[1]=o.y,this.BH[2]=o.z,this.BH[4]=h.x,this.BH[5]=h.y,this.BH[6]=h.z,this.BH[8]=n.x,this.BH[9]=n.y,this.BH[10]=n.z,this.WH=pl.inverse(this.BH);const{cellIndex:a,cellSpan:l,cellsAmount:u}=this.ft,c=l.x/u.x,d=l.y/u.y,g=(a.x+l.x/2)/u.x,m=(a.y+l.y/2)/u.y,y=pl.multiply(pl.translation(Vn(-1,1,g),Vn(-1,1,m),0),pl.scaling(c,d,1));return this.YY=pl.multiply(y,pl.multiply(this.GH,this.WH)),this.UH=pl.inverse(this.YY),this.EH=!1,{viewProjectionMatrix:this.YY}}NH(){this.lE.qO(this.ft.x),this.lE.tN(this.ft.y),this.lE.iN(this.ft.z)}VL(t,e){const i=this.gl.Xz(),s=this.qv(),r={x:s.x*i*e,y:s.y*i*e,width:s.width*i*e,height:s.height*i*e};return this.gl.rV(r.x,r.y,r.width,r.height),this.SY.forEach((e=>{e.getVisible()&&(this.gl.qz(e.BY),1!==t&&this.gl.oS(e.sS),(1!==t||e.getMouseInteractions())&&e.VL(t))})),this.gl.qz("disabled"),this.gl.oS(!1),this.gl.tV(!1),this}setCameraLocation(t){return this.HY.x===t.x&&this.HY.y===t.y&&this.HY.z===t.z||(this.EH=!0),super.setCameraLocation(t),this}setCameraDirection(t){return this.DH.x===t.x&&this.DH.y===t.y&&this.DH.z===t.z||(this.EH=!0),super.setCameraDirection(t),this}U(){super.U(),this.cs.To(this.zH),this.ft.H(this.VH)}bS(t){const e=this.nN.CY();return this.vY(new gp(this,this.xY,[],e,this.nN.kY(e),t))}sy(t){const e=this.nN.CY();return this.vY(new up(this,this.xY,t,e,this.nN.kY(e)))}gS(){const t=this.nN.CY();return this.vY(new rp(this,this.xY,[],t,this.nN.kY(t)))}Ev(){const t=this.nN.CY();return this.vY(new fp(this,this.xY,[],t,this.nN.kY(t)))}Rg(){const t=this.nN.CY();return this.vY(new hp(this,this.xY,[],t,this.nN.kY(t)))}yv(t){const e=this.nN.CY();return this.vY(new yp(this,this.xY,[],t,e,this.nN.kY(e)))}Fv(t){const e=this.nN.CY();return this.vY(new pp(this,this.xY,[],t,e,this.nN.kY(e)))}}class Ap extends wr{constructor(t,e,i,s=Om){if(super(t,e,i),this.j=c(1,1),this.YH=!1,this.HH=0,this.$H=!0,this.XH=0,this.iH=8388608,this.XE=[null,null],this.jH=null,this.ZH=null,this.QH=0,this.Jg=!1,this.JH=0,this.vs=(t=!1)=>(this.Xi||this.fn||this.KH()||(t&&(this.YH=!0),this.rn=!0,this.qH||this.Jr.oz(t)),this),this.qH=!1,this.dz=t=>{if(this.Xi||this.fn)return;const e=t-this.HH;if(e>=this.Jn||-1===this.Jn){this.qH=!0,this.HH=t,this.YH=!1;const i=e>50?1e3/60:e;this.nn&&this.nn(i),this.rn=!1,-1!==this.Jn&&this.YH&&(this.Jr.oz(this.YH),this.rn=!0),this.us.Ds(e),this.Sn(),this.vn(),this.an&&this.an(),this.qH=!1,this.L.emit("render"),this.rn&&this.vs(this.YH)}else this.rn=!0,this.Jr.oz()},this.t$=new Map,this.aN=()=>this.ER,this.i$=()=>{var t,e,i;const s=this.Nn(),r=this.$H,n=bt.performance.now(),o=null===(t=this.s$)||void 0===t?void 0:t.e$.reduce(((t,e)=>t?e.h$&&t.h$&&e.h$>t.h$?e:t:e),void 0),h=null==o?void 0:o.h$,a=null===(e=this.Bn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.Mo)||void 0===i?void 0:i.timeStamp;return r?(this.vs(!0),!1):void 0===o||(void 0===o||!o.r$)&&(void 0!==l&&void 0!==h&&l>h||(void 0!==h&&void 0===s?n-h>=1e3:!(void 0!==h&&void 0!==a&&n-a>=2e3)||n-h>=1e3))},this.n$=()=>{var t,e;this.o$=void 0;const i=null===(e=null===(t=this.s$)||void 0===t?void 0:t.a$)||void 0===e?void 0:e.l$;void 0===i||i>=this.XH||this.u$()},this.vn=()=>{if(this.Xi||this.fn)return this;const t=this.ER.gl,e=bt.performance.now();this.ER.eV(t.FRAMEBUFFER,this.Jr.iz?this.XE[0]:null);const i=this.j,s=i.x>0&&i.y>0;if(this.pn.o&&this.ER.tO(this.pn._()),t.resize&&s&&t.resize(i.x*this.ER.Xz(),i.y*this.ER.Xz()),this.ER.hV(0,0,i.x*this.ER.Xz(),i.y*this.ER.Xz()),this.ER.rV(0,0,i.x*this.ER.Xz(),i.y*this.ER.Xz()),this.ER.Gt(),s)for(const t of this.sn.values())t.VL(0,1);if(this.Yn.jn&&s&&(this.o$&&(bt.clearTimeout(this.o$),this.o$=void 0),this.i$()?(this.u$(),this.ER.eV(t.FRAMEBUFFER,this.Jr.iz?this.XE[0]:null)):this.o$=bt.setTimeout(this.n$,500)),this.Z(),this.Zr(),this.wn&&this._n(this.wn),this.Jr.iz){const e=this.ER.gl2.ctx;e.bindFramebuffer(e.READ_FRAMEBUFFER,this.XE[0]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.XE[1]),e.clearBufferfv(e.COLOR,0,[1,1,1,1]),e.blitFramebuffer(0,0,this.j.x*this.ER.Xz(),this.j.y*this.ER.Xz(),0,0,this.j.x*this.ER.Xz(),this.j.y*this.ER.Xz(),t.COLOR_BUFFER_BIT,t.LINEAR)}else t.bindTexture(t.TEXTURE_2D,this.GE),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,this.j.x*this.ER.Xz(),this.j.y*this.ER.Xz(),0),t.bindTexture(t.TEXTURE_2D,null);return this.ER.eV(t.FRAMEBUFFER,null),this.Jr.oz(),this.$H=!1,this.XH=e,this},this.Sn=()=>{if("use-window"===this.c$.mode){const t=bt.devicePixelRatio||1;this.ER.fO(t)}const t=this.j;if(0===t.x||0===t.y)return this;this.ao.tt(t);for(const t of this.sn.values())t.Ds();return this.Z(),this},this.d$=1,this.Jr=t,this.Jr.qE){this.f$=bt.document.createElement("canvas"),this.f$.style.width="100%",this.f$.style.height="100%",this.f$.style.display="block",this.f$.style.boxSizing="content-box",this.f$.style.position="absolute";const t=this.f$.getContext("2d",{willReadFrequently:!1,alpha:!0,desynchronized:!1});if(!t)throw new yt("No Canvas context available.");this.WE=t,this.Wr.appendChild(this.f$)}this.Jr.gz(this);const r={preserveDrawingBuffer:!0,antialias:e?e.antialias:void 0,alpha:!0,lineAntialias:!e||(!0===e.lineAntiAlias||!1===e.lineAntiAlias?e.lineAntiAlias:!1!==e.antialias)};let n;if(this.Jr.iz&&t.gl2&&(n=new s(this,this.Yn,{type:"webgl2",ctx:t.gl2.ctx,antialias:r.antialias,lineAntialias:r.lineAntialias},this.ts.isDark)),n||this.Jr.iz||(n=new s(this,this.Yn,{type:"webgl1",ctx:t.gl,antialias:r.antialias,lineAntialias:r.lineAntialias},this.ts.isDark)),!n)throw new yt("No WebGL context available");if(this.ER=n,"number"==typeof(null==e?void 0:e.devicePixelRatio))this.c$={mode:"fixed",value:e.devicePixelRatio},this.ER.fO(e.devicePixelRatio);else{const t=bt.document.head.querySelector('meta[name="viewport"]'),i=!0===e.devicePixelRatio||(null==t?void 0:t.content.includes("width=device-width")),s=bt.devicePixelRatio||1;this.c$=i?{mode:"use-window"}:{mode:"fixed",value:s},this.ER.fO(s)}const o=e?e.width:void 0,h=e?e.height:void 0;this.ro=this.A$(o),this.oo=this.A$(h),this.g$(this.ro,this.oo),this.kU=this.II("engine offscreen",1e6),this.p$=this.II("engine bg",0);const a="function"==typeof this.ts.lcjsBackgroundFillStyle?this.ts.lcjsBackgroundFillStyle(this.Yn.Xs):this.ts.lcjsBackgroundFillStyle;this.ao=this.p$.Te(this.ft).ke(a).Ce(this.ts.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Ie({x:0,y:0});const l=this.II("engine effects",200001).TY(this.ts.effect);this.hs=l;const u=this.Jr.iz,d=this.ai();u&&(this.XE=[n.xV(),n.xV()]);const f=this.ER.gl;u&&(this.jH=f.createRenderbuffer(),this.ZH=f.createRenderbuffer()),this.GE=f.createTexture();const g=d.x*this.ER.Xz(),m=d.y*this.ER.Xz();if(u){f.bindRenderbuffer(f.RENDERBUFFER,this.jH);const t=this.ER.gl2.ctx;this.QH=this.Jr.DE&&!1!==e.antialias?t.getParameter(t.MAX_SAMPLES):0,t.renderbufferStorageMultisample(t.RENDERBUFFER,this.QH,t.RGBA8,g,m),f.bindRenderbuffer(f.RENDERBUFFER,this.ZH),f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,g,m),t.renderbufferStorageMultisample(t.RENDERBUFFER,this.QH,t.DEPTH_COMPONENT16,g,m)}u&&(this.ER.eV(f.FRAMEBUFFER,this.XE[0]),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.RENDERBUFFER,this.jH),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,this.ZH)),f.bindTexture(f.TEXTURE_2D,this.GE),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,g,m,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),u&&(this.ER.eV(f.FRAMEBUFFER,this.XE[1]),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,this.GE,0)),this.ER.eV(f.FRAMEBUFFER,null),this.An(),this.Zr(),this.hp=Ar(this),this.rp={ts:this.ts,us:this.us,ft:this.ft,vs:t=>this.vs(t),Nn:()=>this.Nn(),dB:t=>this.dB(t),Yn:this.Yn,Gn:t=>this.Gn(t),hs:this.hs,Do:t=>this.Do(t),Bo:t=>this.Bo(t),Pg:{Ig:(t,e,i)=>this.ER.Oh(e.family).JR(t,e,i,this.ts.isDark)}};const y=()=>{this.U()};bt.addEventListener("unload",y),this.ln.push((()=>{bt.removeEventListener("unload",y)}))}get m$(){return this.sn}Kr(t,e){let i=this.t$.get(t);if(!i){const e=this.ER.SO(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.t$.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{fB:()=>e.Bz,AB:t=>{e.Bz?t():o.push(t)}}},this.t$.set(t,i),e.ZR(this),e.Nz((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new eo(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}dB(t){const e=Array.from(this.t$.values()).find((e=>e.instances.has(t)));if(!e)throw me(0,(()=>new Error("LightningChart JS error, attempted to use Icon that is disposed. Please check that you are not disposing an Icon that is still in use, or attempting to use a previously disposed Icon!")));return e.sharedEngineReference}Cn(t,e){var i;const s=null===(i=this.s$)||void 0===i?void 0:i.a$;if(!s)return;const r=this.De(e.x,e.y),n=Math.round(r.x*this.ER.Xz()),o=Math.round(r.y*this.ER.Xz());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.y$(s,n+t[0]/s.S$,o+t[1]/s.S$))).reduce(((t,e)=>{if(void 0===e)return t||void 0;const i=1e6*e.layerIndex+e.entityIndex;return!t||i>t.zIndexForComparison?{zIndexForComparison:i,entity:e.entity,collectionMember:e.collectionMember}:t}),void 0)}y$(t,e,i){const s=Math.round(e*t.S$),r=Math.round(i*t.S$);if(s<0||s>=t.j.x||r<0||r>=t.j.y)return;const n=4*(s+r*t.j.x),o=t.v$[n+0],h=t.v$[n+1],a=t.v$[n+2],l=t.v$[n+3];return void 0!==o&&void 0!==h&&void 0!==a&&void 0!==l?this.x$(o,h,a,l):void 0}$r(t,e,i){const s=this.ER.gl;this.Jr.iz?(this.ER.eV(s.FRAMEBUFFER,this.XE[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.GE,0)):this.ER.eV(s.FRAMEBUFFER,null);const r=this.NE(),n=r.x,o=r.y,h=new Uint8Array(n*o*4);this.Jr.iz||this.vn(),s.readPixels(0,0,n,o,s.RGBA,s.UNSIGNED_BYTE,h);const a=new ImageData(new Uint8ClampedArray(h),n,o),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)throw new Error("Failed to create 2D context for saving image.");l.width=n,l.height=o,u.putImageData(a,0,0),u.translate(0,o),u.scale(1,-1),u.drawImage(l,0,0),this.Jr.iz&&(this.ER.eV(s.FRAMEBUFFER,this.XE[0]),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,this.jH),this.ER.eV(s.FRAMEBUFFER,this.XE[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.GE,0)),this.ER.eV(s.FRAMEBUFFER,null);const c=l.toDataURL(t,e);return i?c:(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=bt.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof Zy))throw new Error("Unexpected Engine Layer error");return i}return this.xn(new Zy(this,e,t))}LI(t,e,i){const s=this.do(e);if(s){if(me(0,(()=>{})),!(s instanceof Sp))throw new Error("Unexpected Engine Layer error");return s}return this.xn(new Sp(this,e,t,i))}ai(){return this.j}NE(){const t=this.ER.Xz();return{x:Math.round(this.j.x*t),y:Math.round(this.j.y*t)}}A$(t){return t instanceof Array||(t=[t,t]),t}b$(){return this.Jr.UE}KH(){const t=this.ER.gl;return t&&"resize"in t}u$(){var t;const e=this.ER.gl,i=bt.performance.now(),s=this.Nn(),r=this.Yn.Xn,n={x:Math.ceil(this.j.x*this.ER.Xz()*r),y:Math.ceil(this.j.y*this.ER.Xz()*r)};this.s$||(this.s$={S$:r,M$:n,e$:[],a$:void 0});let o=this.s$.e$.find((t=>!t.r$)),h=!1;o||(h=!0,o={r$:!1,j:n,DO:e.createTexture(),_$:this.ER.xV(),ZH:this.ER.bV(),w$:new Uint8Array,h$:void 0},this.s$.e$.push(o));const a=o;(h||a.j.x!==n.x||a.j.y!==n.y)&&(e.bindTexture(e.TEXTURE_2D,a.DO),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.x,n.y,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),this.ER.eV(e.FRAMEBUFFER,a._$),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a.DO,0),e.bindRenderbuffer(e.RENDERBUFFER,a.ZH),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.x,n.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,a.ZH),a.w$=new Uint8Array(n.x*n.y*4),a.j=n),a.r$=!0,a.h$=i,this.ER.eV(e.FRAMEBUFFER,a._$),e.clearDepth(1),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.disable(e.BLEND),e.resize&&e.resize(n.x,n.y),this.ER.hV(0,0,n.x,n.y);for(const t of this.sn.values())t.VL(1,r);this.ER.eV(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.ER.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.s$){const t=this.s$.a$;if(t&&t.l$>i)return;this.s$.a$={l$:i,S$:r,j:n,v$:a.w$,C$:s}}};l?this.ER.FO(l,a._$,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.w$).then((()=>{this.Xi||(a.r$=!1,u())})).catch((t=>{this.Xi||(a.r$=!1,bt.console.warn("LightningChart JS mouse picking failed unexpectedly. This could mean that user interactions on charts are compromised.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact"))})):(this.ER.IO(a._$,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.w$),a.r$=!1,u())}An(t){if("use-window"===this.c$.mode){const t=bt.devicePixelRatio||1;this.ER.fO(t)}const e=this.j.x,i=this.j.y,s=t||{x:this.Wr.offsetWidth,y:this.Wr.offsetHeight};if(0!==s.x&&0!==s.y&&(s.x!==e||s.y!==i)){this.j=s,this.ft.x.K(0,s.x).tt(s.x),this.ft.y.K(0,s.y).tt(s.y);const t=s.x*this.ER.Xz(),e=s.y*this.ER.Xz(),i=this.ER.gl;this.Jr.qE&&this.WE&&(this.WE.canvas.width=t,this.WE.canvas.height=e);const r=this.Jr.iz;if(this.GE&&(i.bindTexture(i.TEXTURE_2D,this.GE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null)),r){const s=this.ER.gl2.ctx;this.jH&&(i.bindRenderbuffer(i.RENDERBUFFER,this.jH),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.QH,s.RGBA8,t,e)),this.ZH&&(i.bindRenderbuffer(i.RENDERBUFFER,this.ZH),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_COMPONENT16,t,e),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.QH,s.DEPTH_COMPONENT16,t,e))}i.bindRenderbuffer(i.RENDERBUFFER,null),this.L.emit("resize",[this.j.x,this.j.y])}}U(){var t;this.Xi||(super.U(),this.o$&&(bt.clearTimeout(this.o$),this.o$=void 0),Array.from(this.ER.bE.entries()).forEach((([t,e])=>{e.OR(!1),this.ER.bE.delete(t)})),Array.from(this.ER.CV.values()).forEach((t=>{t.unbindResources()})),this.ER.CV.clear(),this.ER.wV.Tz(),this.ER.lO.U(),this.ER.yV(this.ER.uO),this.ER.yV(this.ER.cO),this.ER.rO.forEach(((t,e)=>{this.ER.gl.deleteBuffer(e)})),this.ER.rO.clear(),this.ER._O&&(this.ER.yV(this.ER._O.buffer),this.ER._O=void 0),this.ER._V(this.XE[0]),this.ER._V(this.XE[1]),this.ER.MV(this.jH),this.ER.NR(this.GE),this.ER.MV(this.ZH),this.s$&&(this.s$.e$.forEach((t=>{this.ER.MV(t.ZH),this.ER._V(t._$),this.ER.NR(t.DO)})),this.s$=void 0),this.ER.sO.forEach((t=>this.ER.yV(t))),this.t$.clear(),this.Jr.mz(this),this.f$&&(null===(t=this.f$.parentElement)||void 0===t||t.removeChild(this.f$),this.f$=void 0),this.WE&&(this.WE=void 0),this.ER.gl=void 0)}CY(){const t=this.d$;return t>4294967295&&(console.warn("LightningChart JS picking ID overflow.\nThis is an unexpected error that could compromise user interactions on the chart.\nPlease report the issue to https://lightningchart.com/js-charts/docs/contact!"),this.d$=1),this.d$+=1,t}kY(t){let e=t;const i=Math.floor(e/16777216);e-=16777216*i;const s=Math.floor(e/65536);e-=65536*s;const r=Math.floor(e/256);return e-=256*r,E(i,s,r,e)}x$(t,e,i,s){if(0===t&&0===e&&0===i&&0===s)return;const r=16777216*t+65536*e+256*i+s;for(const t of this.m$.values()){const e=t.wY(r);if(e)return{entity:e.entity,collectionMember:e.collectionMember,entityIndex:e.index,layerIndex:t.bn()}}}}var vp="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},bp={exports:{}};!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function s(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this.Oz(t||0,e||10,i||"be"))}var n;"object"==typeof bp?bp.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=(void 0).Buffer}catch(t){}function o(t,e,s){for(var r=0,n=Math.min(t.length,s),o=0,h=e;h=49&&l<=54?l-49+10:l>=17&&l<=22?l-17+10:l,o|=a}return i(!(240&o),"Invalid character in "+t),r}function h(t,e,s,r){for(var n=0,o=0,h=Math.min(t.length,s),a=e;a=49?l-49+10:l>=17?l-17+10:l,i(l>=0&&o0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype.Oz=function(t,e,s){if("number"==typeof t)return this.k$(t,e,s);if("object"==typeof t)return this.T$(t,e,s);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this.F$(t,r):this.I$(t,e,r),"-"===t[0]&&(this.negative=1),this.P$(),"le"===s&&this.T$(this.toArray(),e,s)},r.prototype.k$=function(t,e,s){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===s&&this.T$(this.toArray(),e,s)},r.prototype.T$=function(t,e,s){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<>>26-h&67108863,(h+=24)>=26&&(h-=26,n++);else if("le"===s)for(r=0,n=0;r>>26-h&67108863,(h+=24)>=26&&(h-=26,n++);return this.P$()},r.prototype.F$=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=6)r=o(t,i,i+6),this.words[s]|=r<>>26-n&4194303,(n+=24)>=26&&(n-=26,s++);i+6!==e&&(r=o(t,e,i+6),this.words[s]|=r<>>26-n&4194303),this.P$()},r.prototype.I$=function(t,e,i){this.words=[0],this.length=1;for(var s=0,r=1;r<=67108863;r*=e)s++;s--,r=r/e|0;for(var n=t.length-i,o=n%s,a=Math.min(n,n-o)+i,l=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this.R$()},r.prototype.R$=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){r.prototype.inspect=l}else r.prototype.inspect=l;function l(){return(this.red?""}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,i){i.negative=e.negative^t.negative;var s=t.length+e.length|0;i.length=s,s=s-1|0;var r=0|t.words[0],n=0|e.words[0],o=r*n,h=67108863&o,a=o/67108864|0;i.words[0]=h;for(var l=1;l>>26,c=67108863&a,d=Math.min(l,e.length-1),f=Math.max(0,l-t.length+1);f<=d;f++){var g=l-f|0;u+=(o=(r=0|t.words[g])*(n=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[l]=0|c,a=0|u}return 0!==a?i.words[l]=0|a:i.length--,i.P$()}r.prototype.toString=function(t,e){var s;if(e=0|e||1,16===(t=t||10)||"hex"===t){s="";for(var r=0,n=0,o=0;o>>24-r&16777215)||o!==this.length-1?u[6-a.length]+a+s:a+s,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(s=n.toString(16)+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],f=d[t];s="";var g=this.clone();for(g.negative=0;!g.isZero();){var m=g.modrn(f).toString(t);s=(g=g.idivn(f)).isZero()?m+s:u[l-m.length]+m+s}for(this.isZero()&&(s="0"+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}i(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16,2)},n&&(r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)}),r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,s){this.P$();var r=this.byteLength(),n=s||Math.max(1,r);i(r<=n,"byte array longer than desired length"),i(n>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,n);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,r),o},r.prototype.E$=function(t,e){for(var i=0,s=0,r=0,n=0;r>8&255),i>16&255),6===n?(i>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i=0&&(t[i--]=o>>8&255),i>=0&&(t[i--]=o>>16&255),6===n?(i>=0&&(t[i--]=o>>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i>=0)for(t[i--]=s;i>=0;)t[i--]=0},Math.clz32?r.prototype.V$=function(t){return 32-Math.clz32(t)}:r.prototype.V$=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype.O$=function(t){if(0===t)return 26;var e=t,i=0;return!(8191&e)&&(i+=13,e>>>=13),!(127&e)&&(i+=7,e>>>=7),!(15&e)&&(i+=4,e>>>=4),!(3&e)&&(i+=2,e>>>=2),!(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this.V$(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var s=0;st.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),s=t%26;this.L$(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.P$()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var s=t/26|0,r=t%26;return this.L$(s+1),this.words[s]=e?this.words[s]|1<t.length?(i=this,s=t):(i=t,s=this);for(var r=0,n=0;n>>26;for(;0!==r&&n>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;nt.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e.R$()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.R$();var i,s,r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,s=t):(i=t,s=this);for(var n=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==n&&o>26,this.words[o]=67108863&e;if(0===n&&o>>13,f=0|o[1],g=8191&f,m=f>>>13,y=0|o[2],p=8191&y,x=y>>>13,S=0|o[3],A=8191&S,v=S>>>13,b=0|o[4],M=8191&b,E=b>>>13,T=0|o[5],w=8191&T,k=T>>>13,C=0|o[6],R=8191&C,I=C>>>13,F=0|o[7],D=8191&F,L=F>>>13,V=0|o[8],_=8191&V,P=V>>>13,B=0|o[9],z=8191&B,N=B>>>13,U=0|h[0],O=8191&U,G=U>>>13,Y=0|h[1],H=8191&Y,X=Y>>>13,W=0|h[2],j=8191&W,$=W>>>13,Z=0|h[3],K=8191&Z,J=Z>>>13,q=0|h[4],Q=8191&q,tt=q>>>13,et=0|h[5],it=8191&et,st=et>>>13,rt=0|h[6],nt=8191&rt,ot=rt>>>13,ht=0|h[7],at=8191&ht,lt=ht>>>13,ut=0|h[8],ct=8191&ut,dt=ut>>>13,ft=0|h[9],gt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var yt=(l+(s=Math.imul(c,O))|0)+((8191&(r=(r=Math.imul(c,G))+Math.imul(d,O)|0))<<13)|0;l=((n=Math.imul(d,G))+(r>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(g,O),r=(r=Math.imul(g,G))+Math.imul(m,O)|0,n=Math.imul(m,G);var pt=(l+(s=s+Math.imul(c,H)|0)|0)+((8191&(r=(r=r+Math.imul(c,X)|0)+Math.imul(d,H)|0))<<13)|0;l=((n=n+Math.imul(d,X)|0)+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(p,O),r=(r=Math.imul(p,G))+Math.imul(x,O)|0,n=Math.imul(x,G),s=s+Math.imul(g,H)|0,r=(r=r+Math.imul(g,X)|0)+Math.imul(m,H)|0,n=n+Math.imul(m,X)|0;var xt=(l+(s=s+Math.imul(c,j)|0)|0)+((8191&(r=(r=r+Math.imul(c,$)|0)+Math.imul(d,j)|0))<<13)|0;l=((n=n+Math.imul(d,$)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(A,O),r=(r=Math.imul(A,G))+Math.imul(v,O)|0,n=Math.imul(v,G),s=s+Math.imul(p,H)|0,r=(r=r+Math.imul(p,X)|0)+Math.imul(x,H)|0,n=n+Math.imul(x,X)|0,s=s+Math.imul(g,j)|0,r=(r=r+Math.imul(g,$)|0)+Math.imul(m,j)|0,n=n+Math.imul(m,$)|0;var St=(l+(s=s+Math.imul(c,K)|0)|0)+((8191&(r=(r=r+Math.imul(c,J)|0)+Math.imul(d,K)|0))<<13)|0;l=((n=n+Math.imul(d,J)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(M,O),r=(r=Math.imul(M,G))+Math.imul(E,O)|0,n=Math.imul(E,G),s=s+Math.imul(A,H)|0,r=(r=r+Math.imul(A,X)|0)+Math.imul(v,H)|0,n=n+Math.imul(v,X)|0,s=s+Math.imul(p,j)|0,r=(r=r+Math.imul(p,$)|0)+Math.imul(x,j)|0,n=n+Math.imul(x,$)|0,s=s+Math.imul(g,K)|0,r=(r=r+Math.imul(g,J)|0)+Math.imul(m,K)|0,n=n+Math.imul(m,J)|0;var At=(l+(s=s+Math.imul(c,Q)|0)|0)+((8191&(r=(r=r+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;l=((n=n+Math.imul(d,tt)|0)+(r>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(w,O),r=(r=Math.imul(w,G))+Math.imul(k,O)|0,n=Math.imul(k,G),s=s+Math.imul(M,H)|0,r=(r=r+Math.imul(M,X)|0)+Math.imul(E,H)|0,n=n+Math.imul(E,X)|0,s=s+Math.imul(A,j)|0,r=(r=r+Math.imul(A,$)|0)+Math.imul(v,j)|0,n=n+Math.imul(v,$)|0,s=s+Math.imul(p,K)|0,r=(r=r+Math.imul(p,J)|0)+Math.imul(x,K)|0,n=n+Math.imul(x,J)|0,s=s+Math.imul(g,Q)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(m,Q)|0,n=n+Math.imul(m,tt)|0;var vt=(l+(s=s+Math.imul(c,it)|0)|0)+((8191&(r=(r=r+Math.imul(c,st)|0)+Math.imul(d,it)|0))<<13)|0;l=((n=n+Math.imul(d,st)|0)+(r>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(R,O),r=(r=Math.imul(R,G))+Math.imul(I,O)|0,n=Math.imul(I,G),s=s+Math.imul(w,H)|0,r=(r=r+Math.imul(w,X)|0)+Math.imul(k,H)|0,n=n+Math.imul(k,X)|0,s=s+Math.imul(M,j)|0,r=(r=r+Math.imul(M,$)|0)+Math.imul(E,j)|0,n=n+Math.imul(E,$)|0,s=s+Math.imul(A,K)|0,r=(r=r+Math.imul(A,J)|0)+Math.imul(v,K)|0,n=n+Math.imul(v,J)|0,s=s+Math.imul(p,Q)|0,r=(r=r+Math.imul(p,tt)|0)+Math.imul(x,Q)|0,n=n+Math.imul(x,tt)|0,s=s+Math.imul(g,it)|0,r=(r=r+Math.imul(g,st)|0)+Math.imul(m,it)|0,n=n+Math.imul(m,st)|0;var bt=(l+(s=s+Math.imul(c,nt)|0)|0)+((8191&(r=(r=r+Math.imul(c,ot)|0)+Math.imul(d,nt)|0))<<13)|0;l=((n=n+Math.imul(d,ot)|0)+(r>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(D,O),r=(r=Math.imul(D,G))+Math.imul(L,O)|0,n=Math.imul(L,G),s=s+Math.imul(R,H)|0,r=(r=r+Math.imul(R,X)|0)+Math.imul(I,H)|0,n=n+Math.imul(I,X)|0,s=s+Math.imul(w,j)|0,r=(r=r+Math.imul(w,$)|0)+Math.imul(k,j)|0,n=n+Math.imul(k,$)|0,s=s+Math.imul(M,K)|0,r=(r=r+Math.imul(M,J)|0)+Math.imul(E,K)|0,n=n+Math.imul(E,J)|0,s=s+Math.imul(A,Q)|0,r=(r=r+Math.imul(A,tt)|0)+Math.imul(v,Q)|0,n=n+Math.imul(v,tt)|0,s=s+Math.imul(p,it)|0,r=(r=r+Math.imul(p,st)|0)+Math.imul(x,it)|0,n=n+Math.imul(x,st)|0,s=s+Math.imul(g,nt)|0,r=(r=r+Math.imul(g,ot)|0)+Math.imul(m,nt)|0,n=n+Math.imul(m,ot)|0;var Mt=(l+(s=s+Math.imul(c,at)|0)|0)+((8191&(r=(r=r+Math.imul(c,lt)|0)+Math.imul(d,at)|0))<<13)|0;l=((n=n+Math.imul(d,lt)|0)+(r>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(_,O),r=(r=Math.imul(_,G))+Math.imul(P,O)|0,n=Math.imul(P,G),s=s+Math.imul(D,H)|0,r=(r=r+Math.imul(D,X)|0)+Math.imul(L,H)|0,n=n+Math.imul(L,X)|0,s=s+Math.imul(R,j)|0,r=(r=r+Math.imul(R,$)|0)+Math.imul(I,j)|0,n=n+Math.imul(I,$)|0,s=s+Math.imul(w,K)|0,r=(r=r+Math.imul(w,J)|0)+Math.imul(k,K)|0,n=n+Math.imul(k,J)|0,s=s+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,tt)|0)+Math.imul(E,Q)|0,n=n+Math.imul(E,tt)|0,s=s+Math.imul(A,it)|0,r=(r=r+Math.imul(A,st)|0)+Math.imul(v,it)|0,n=n+Math.imul(v,st)|0,s=s+Math.imul(p,nt)|0,r=(r=r+Math.imul(p,ot)|0)+Math.imul(x,nt)|0,n=n+Math.imul(x,ot)|0,s=s+Math.imul(g,at)|0,r=(r=r+Math.imul(g,lt)|0)+Math.imul(m,at)|0,n=n+Math.imul(m,lt)|0;var Et=(l+(s=s+Math.imul(c,ct)|0)|0)+((8191&(r=(r=r+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;l=((n=n+Math.imul(d,dt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,O),r=(r=Math.imul(z,G))+Math.imul(N,O)|0,n=Math.imul(N,G),s=s+Math.imul(_,H)|0,r=(r=r+Math.imul(_,X)|0)+Math.imul(P,H)|0,n=n+Math.imul(P,X)|0,s=s+Math.imul(D,j)|0,r=(r=r+Math.imul(D,$)|0)+Math.imul(L,j)|0,n=n+Math.imul(L,$)|0,s=s+Math.imul(R,K)|0,r=(r=r+Math.imul(R,J)|0)+Math.imul(I,K)|0,n=n+Math.imul(I,J)|0,s=s+Math.imul(w,Q)|0,r=(r=r+Math.imul(w,tt)|0)+Math.imul(k,Q)|0,n=n+Math.imul(k,tt)|0,s=s+Math.imul(M,it)|0,r=(r=r+Math.imul(M,st)|0)+Math.imul(E,it)|0,n=n+Math.imul(E,st)|0,s=s+Math.imul(A,nt)|0,r=(r=r+Math.imul(A,ot)|0)+Math.imul(v,nt)|0,n=n+Math.imul(v,ot)|0,s=s+Math.imul(p,at)|0,r=(r=r+Math.imul(p,lt)|0)+Math.imul(x,at)|0,n=n+Math.imul(x,lt)|0,s=s+Math.imul(g,ct)|0,r=(r=r+Math.imul(g,dt)|0)+Math.imul(m,ct)|0,n=n+Math.imul(m,dt)|0;var Tt=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(r=(r=r+Math.imul(c,mt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((n=n+Math.imul(d,mt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(z,H),r=(r=Math.imul(z,X))+Math.imul(N,H)|0,n=Math.imul(N,X),s=s+Math.imul(_,j)|0,r=(r=r+Math.imul(_,$)|0)+Math.imul(P,j)|0,n=n+Math.imul(P,$)|0,s=s+Math.imul(D,K)|0,r=(r=r+Math.imul(D,J)|0)+Math.imul(L,K)|0,n=n+Math.imul(L,J)|0,s=s+Math.imul(R,Q)|0,r=(r=r+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,n=n+Math.imul(I,tt)|0,s=s+Math.imul(w,it)|0,r=(r=r+Math.imul(w,st)|0)+Math.imul(k,it)|0,n=n+Math.imul(k,st)|0,s=s+Math.imul(M,nt)|0,r=(r=r+Math.imul(M,ot)|0)+Math.imul(E,nt)|0,n=n+Math.imul(E,ot)|0,s=s+Math.imul(A,at)|0,r=(r=r+Math.imul(A,lt)|0)+Math.imul(v,at)|0,n=n+Math.imul(v,lt)|0,s=s+Math.imul(p,ct)|0,r=(r=r+Math.imul(p,dt)|0)+Math.imul(x,ct)|0,n=n+Math.imul(x,dt)|0;var wt=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(r=(r=r+Math.imul(g,mt)|0)+Math.imul(m,gt)|0))<<13)|0;l=((n=n+Math.imul(m,mt)|0)+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(z,j),r=(r=Math.imul(z,$))+Math.imul(N,j)|0,n=Math.imul(N,$),s=s+Math.imul(_,K)|0,r=(r=r+Math.imul(_,J)|0)+Math.imul(P,K)|0,n=n+Math.imul(P,J)|0,s=s+Math.imul(D,Q)|0,r=(r=r+Math.imul(D,tt)|0)+Math.imul(L,Q)|0,n=n+Math.imul(L,tt)|0,s=s+Math.imul(R,it)|0,r=(r=r+Math.imul(R,st)|0)+Math.imul(I,it)|0,n=n+Math.imul(I,st)|0,s=s+Math.imul(w,nt)|0,r=(r=r+Math.imul(w,ot)|0)+Math.imul(k,nt)|0,n=n+Math.imul(k,ot)|0,s=s+Math.imul(M,at)|0,r=(r=r+Math.imul(M,lt)|0)+Math.imul(E,at)|0,n=n+Math.imul(E,lt)|0,s=s+Math.imul(A,ct)|0,r=(r=r+Math.imul(A,dt)|0)+Math.imul(v,ct)|0,n=n+Math.imul(v,dt)|0;var kt=(l+(s=s+Math.imul(p,gt)|0)|0)+((8191&(r=(r=r+Math.imul(p,mt)|0)+Math.imul(x,gt)|0))<<13)|0;l=((n=n+Math.imul(x,mt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(z,K),r=(r=Math.imul(z,J))+Math.imul(N,K)|0,n=Math.imul(N,J),s=s+Math.imul(_,Q)|0,r=(r=r+Math.imul(_,tt)|0)+Math.imul(P,Q)|0,n=n+Math.imul(P,tt)|0,s=s+Math.imul(D,it)|0,r=(r=r+Math.imul(D,st)|0)+Math.imul(L,it)|0,n=n+Math.imul(L,st)|0,s=s+Math.imul(R,nt)|0,r=(r=r+Math.imul(R,ot)|0)+Math.imul(I,nt)|0,n=n+Math.imul(I,ot)|0,s=s+Math.imul(w,at)|0,r=(r=r+Math.imul(w,lt)|0)+Math.imul(k,at)|0,n=n+Math.imul(k,lt)|0,s=s+Math.imul(M,ct)|0,r=(r=r+Math.imul(M,dt)|0)+Math.imul(E,ct)|0,n=n+Math.imul(E,dt)|0;var Ct=(l+(s=s+Math.imul(A,gt)|0)|0)+((8191&(r=(r=r+Math.imul(A,mt)|0)+Math.imul(v,gt)|0))<<13)|0;l=((n=n+Math.imul(v,mt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(z,Q),r=(r=Math.imul(z,tt))+Math.imul(N,Q)|0,n=Math.imul(N,tt),s=s+Math.imul(_,it)|0,r=(r=r+Math.imul(_,st)|0)+Math.imul(P,it)|0,n=n+Math.imul(P,st)|0,s=s+Math.imul(D,nt)|0,r=(r=r+Math.imul(D,ot)|0)+Math.imul(L,nt)|0,n=n+Math.imul(L,ot)|0,s=s+Math.imul(R,at)|0,r=(r=r+Math.imul(R,lt)|0)+Math.imul(I,at)|0,n=n+Math.imul(I,lt)|0,s=s+Math.imul(w,ct)|0,r=(r=r+Math.imul(w,dt)|0)+Math.imul(k,ct)|0,n=n+Math.imul(k,dt)|0;var Rt=(l+(s=s+Math.imul(M,gt)|0)|0)+((8191&(r=(r=r+Math.imul(M,mt)|0)+Math.imul(E,gt)|0))<<13)|0;l=((n=n+Math.imul(E,mt)|0)+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,s=Math.imul(z,it),r=(r=Math.imul(z,st))+Math.imul(N,it)|0,n=Math.imul(N,st),s=s+Math.imul(_,nt)|0,r=(r=r+Math.imul(_,ot)|0)+Math.imul(P,nt)|0,n=n+Math.imul(P,ot)|0,s=s+Math.imul(D,at)|0,r=(r=r+Math.imul(D,lt)|0)+Math.imul(L,at)|0,n=n+Math.imul(L,lt)|0,s=s+Math.imul(R,ct)|0,r=(r=r+Math.imul(R,dt)|0)+Math.imul(I,ct)|0,n=n+Math.imul(I,dt)|0;var It=(l+(s=s+Math.imul(w,gt)|0)|0)+((8191&(r=(r=r+Math.imul(w,mt)|0)+Math.imul(k,gt)|0))<<13)|0;l=((n=n+Math.imul(k,mt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(z,nt),r=(r=Math.imul(z,ot))+Math.imul(N,nt)|0,n=Math.imul(N,ot),s=s+Math.imul(_,at)|0,r=(r=r+Math.imul(_,lt)|0)+Math.imul(P,at)|0,n=n+Math.imul(P,lt)|0,s=s+Math.imul(D,ct)|0,r=(r=r+Math.imul(D,dt)|0)+Math.imul(L,ct)|0,n=n+Math.imul(L,dt)|0;var Ft=(l+(s=s+Math.imul(R,gt)|0)|0)+((8191&(r=(r=r+Math.imul(R,mt)|0)+Math.imul(I,gt)|0))<<13)|0;l=((n=n+Math.imul(I,mt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(z,at),r=(r=Math.imul(z,lt))+Math.imul(N,at)|0,n=Math.imul(N,lt),s=s+Math.imul(_,ct)|0,r=(r=r+Math.imul(_,dt)|0)+Math.imul(P,ct)|0,n=n+Math.imul(P,dt)|0;var Dt=(l+(s=s+Math.imul(D,gt)|0)|0)+((8191&(r=(r=r+Math.imul(D,mt)|0)+Math.imul(L,gt)|0))<<13)|0;l=((n=n+Math.imul(L,mt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,s=Math.imul(z,ct),r=(r=Math.imul(z,dt))+Math.imul(N,ct)|0,n=Math.imul(N,dt);var Lt=(l+(s=s+Math.imul(_,gt)|0)|0)+((8191&(r=(r=r+Math.imul(_,mt)|0)+Math.imul(P,gt)|0))<<13)|0;l=((n=n+Math.imul(P,mt)|0)+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Vt=(l+(s=Math.imul(z,gt))|0)+((8191&(r=(r=Math.imul(z,mt))+Math.imul(N,gt)|0))<<13)|0;return l=((n=Math.imul(N,mt))+(r>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,a[0]=yt,a[1]=pt,a[2]=xt,a[3]=St,a[4]=At,a[5]=vt,a[6]=bt,a[7]=Mt,a[8]=Et,a[9]=Tt,a[10]=wt,a[11]=kt,a[12]=Ct,a[13]=Rt,a[14]=It,a[15]=Ft,a[16]=Dt,a[17]=Lt,a[18]=Vt,0!==l&&(a[19]=l,i.length++),i};function m(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var s=0,r=0,n=0;n>>26)|0)>>>26,o&=67108863}i.words[n]=h,s=o,o=r}return 0!==s?i.words[n]=s:i.length--,i.P$()}function y(t,e,i){return m(t,e,i)}Math.imul||(g=f),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):i<63?f(this,t,e):i<1024?m(this,t,e):y(this,t,e)},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),y(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){var e=t<0;e&&(t=-t),i("number"==typeof t),i(t<67108864);for(var s=0,r=0;r>=26,s+=n/67108864|0,s+=o>>>26,this.words[r]=67108863&o}return 0!==s&&(this.words[r]=s,this.length++),e?this.ineg():this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>r&1}return e}(t);if(0===e.length)return new r(1);for(var i=this,s=0;s=0);var e,s=t%26,r=(t-s)/26,n=67108863>>>26-s<<26-s;if(0!==s){var o=0;for(e=0;e>>26-s}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e=0),r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),h=67108863^67108863>>>n<o)for(this.length-=o,l=0;l=0&&(0!==u||l>=r);l--){var c=0|this.words[l];this.words[l]=u<<26-n|c>>>n,u=c&h}return a&&0!==u&&(a.words[a.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.P$()},r.prototype.ishrn=function(t,e,s){return i(0===this.negative),this.iushrn(t,e,s)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,s=(t-e)/26,r=1<=0);var e=t%26,s=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==e&&s++,this.length=Math.min(s,this.length),0!==e){var r=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(a/67108864|0),this.words[r+s]=67108863&n}for(;r>26,this.words[r+s]=67108863&n;if(0===h)return this.P$();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.P$()},r.prototype.G$=function(t,e){var i=(this.length,t.length),s=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this.V$(o))&&(n=n.ushln(i),s.iushln(i),o=0|n.words[n.length-1]);var h,a=s.length-n.length;if("mod"!==e){(h=new r(null)).length=a+1,h.words=new Array(h.length);for(var l=0;l=0;c--){var d=67108864*(0|s.words[n.length+c])+(0|s.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),s.N$(n,d,c);0!==s.negative;)d--,s.negative=0,s.N$(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.P$(),s.P$(),"div"!==e&&0!==i&&s.iushrn(i),{div:h||null,mod:s}},r.prototype.divmod=function(t,e,s){return i(!t.isZero()),this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,e),"mod"!==e&&(n=h.div.neg()),"div"!==e&&(o=h.mod.neg(),s&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),e),"mod"!==e&&(n=h.div.neg()),{div:n,mod:h.mod}):this.negative&t.negative?(h=this.neg().divmod(t.neg(),e),"div"!==e&&(o=h.mod.neg(),s&&0!==o.negative&&o.isub(t)),{div:h.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modrn(t.words[0]))}:this.G$(t,e);var n,o,h},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,s=t.ushrn(1),r=t.andln(1),n=i.cmp(s);return n<0||1===r&&0===n?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(s*r+(0|this.words[n]))%t;return e?-r:r},r.prototype.modn=function(t){return this.modrn(t)},r.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*s;this.words[r]=n/t|0,s=n%t}return this.P$(),e?this.ineg():this},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,s=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),h=new r(0),a=new r(1),l=0;e.isEven()&&s.isEven();)e.iushrn(1),s.iushrn(1),++l;for(var u=s.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;!(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var g=0,m=1;!(s.words[0]&m)&&g<26;++g,m<<=1);if(g>0)for(s.iushrn(g);g-- >0;)(h.isOdd()||a.isOdd())&&(h.iadd(u),a.isub(c)),h.iushrn(1),a.iushrn(1);e.cmp(s)>=0?(e.isub(s),n.isub(h),o.isub(a)):(s.isub(e),h.isub(n),a.isub(o))}return{a:h,b:a,gcd:s.iushln(l)}},r.prototype.W$=function(t){i(0===t.negative),i(!t.isZero());var e=this,s=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),h=new r(0),a=s.clone();e.cmpn(1)>0&&s.cmpn(1)>0;){for(var l=0,u=1;!(e.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,d=1;!(s.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(s.iushrn(c);c-- >0;)h.isOdd()&&h.iadd(a),h.iushrn(1);e.cmp(s)>=0?(e.isub(s),o.isub(h)):(s.isub(e),h.isub(o))}return(n=0===e.cmpn(1)?o:h).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var s=0;e.isEven()&&i.isEven();s++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var r=e.cmp(i);if(r<0){var n=e;e=i,i=n}else if(0===r||0===i.cmpn(1))break;e.isub(i)}return i.iushln(s)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return!(1&this.words[0])},r.prototype.isOdd=function(){return!(1&~this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,s=(t-e)/26,r=1<>>26,h&=67108863,this.words[o]=h}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,s=t<0;if(0!==this.negative&&!s)return-1;if(0===this.negative&&s)return 1;if(this.P$(),this.length>1)e=1;else{s&&(t=-t),i(t<=67108863,"Number is too big");var r=0|this.words[0];e=r===t?0:rt.length)return 1;if(this.length=0;i--){var s=0|this.words[i],r=0|t.words[i];if(s!==r){sr&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new M(t)},r.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this).U$(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.U$=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.U$(t)},r.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},r.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},r.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},r.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},r.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},r.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.Y$(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.Y$(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.H$(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.H$(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.H$(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.H$(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.H$(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.H$(this),this.red.pow(this,t)};var p={k256:null,p224:null,p192:null,p25519:null};function x(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this.$$()}function S(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=r.X$(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r.W$(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype.$$=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},x.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var s=e0?i.isub(this.p):void 0!==i.strip?i.strip():i.P$(),i},x.prototype.split=function(t,e){t.iushrn(this.n,0,e)},x.prototype.imulK=function(t){return t.imul(this.k)},s(S,x),S.prototype.split=function(t,e){for(var i=4194303,s=Math.min(t.length,9),r=0;r>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},S.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=r,e=s}return 0!==e&&(t.words[t.length++]=e),t},r.X$=function(t){if(p[t])return p[t];var e;if("k256"===t)e=new S;else if("p224"===t)e=new A;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new b}return p[t]=e,e},M.prototype.H$=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype.Y$=function(t,e){i(!(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t).U$(this):(a(t,t.umod(this.m).U$(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).U$(this)},M.prototype.add=function(t,e){this.Y$(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.U$(this)},M.prototype.iadd=function(t,e){this.Y$(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function(t,e){this.Y$(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.U$(this)},M.prototype.isub=function(t,e){this.Y$(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function(t,e){return this.H$(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this.Y$(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this.Y$(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var s=this.m.add(new r(1)).iushrn(2);return this.pow(t,s)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var h=new r(1).toRed(this),a=h.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new r(2*u*u).toRed(this);0!==this.pow(u,l).cmp(a);)u.redIAdd(a);for(var c=this.pow(u,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),g=o;0!==f.cmp(h);){for(var m=f,y=0;0!==m.cmp(h);y++)m=m.redSqr();i(y=0;s--){for(var l=e.words[s],u=a-1;u>=0;u--){var c=l>>u&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++h||0===s&&0===u)&&(n=this.mul(n,i[o]),h=0,o=0)):h=0}a=26}return n},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new E(t)},s(E,M),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(s).iushrn(this.shift),n=r;return r.cmp(this.m)>=0?n=r.isub(this.m):r.cmpn(0)<0&&(n=r.iadd(this.m)),n.U$(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).U$(this);var i=t.mul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(s).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o.U$(this)},E.prototype.invm=function(t){return this.imod(t.W$(this.m).mul(this.r2)).U$(this)}}(0,vp);var Mp=bp.exports;function Ep(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];const i=[];if("string"!=typeof t){for(let e=0;e>8,n=255&s;r?i.push(r,n):i.push(n)}return i}const Tp=function(t,e,i){const s=new Array(Math.max(t.bitLength(),i)+1);s.fill(0);const r=1<(r>>1)-1?(r>>1)-i:i,n.isubn(e)):e=0,s[t]=e,n.iushrn(1)}return s},wp=function(t,e){const i=[[],[]];t=t.clone(),e=e.clone();let s=0,r=0;for(;t.cmpn(-s)>0||e.cmpn(-r)>0;){let n,o,h=t.andln(3)+s&3,a=e.andln(3)+r&3;if(3===h&&(h=-1),3===a&&(a=-1),1&h){const e=t.andln(7)+s&7;n=3!==e&&5!==e||2!==a?h:-h}else n=0;if(i[0].push(n),1&a){const t=e.andln(7)+r&7;o=3!==t&&5!==t||2!==h?a:-a}else o=0;i[1].push(o),2*s===n+1&&(s=1-s),2*r===o+1&&(r=1-r),t.iushrn(1),e.iushrn(1)}return i};class kp{constructor(t,e){this.type=t,this.p=new Mp(e.p,16),this.red=e.prime?Mp.red(e.prime):Mp.mont(this.p),this.zero=new Mp(0).toRed(this.red),this.one=new Mp(1).toRed(this.red),this.two=new Mp(2).toRed(this.red),this.n=e.n&&new Mp(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.j$=new Array(4),this.Z$=new Array(4),this.Q$=new Array(4),this.J$=new Array(4),this.K$=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.q$=!0,this.redN=this.n.toRed(this.red))}tX(t,e){const i=t.iX(),s=Tp(e,1,this.K$);let r=(1<=t;r--)e=(e<<1)+s[r];n.push(e)}let o=this.jpoint(null,null,null),h=this.jpoint(null,null,null);for(let t=r;t>0;t--){for(let e=0;e=0;i--){for(let t=0;i>=0&&0===n[i];i--)t++;if(i>=0&&e++,o=o.dblp(e),i<0)break;const s=n[i];o="affine"===t.type?s>0?o.mixedAdd(r[s-1>>1]):o.mixedAdd(r[-s-1>>1].neg()):s>0?o.add(r[s-1>>1]):o.add(r[-s-1>>1].neg())}return"affine"===t.type?o.toP():o}hX(t,e,i,s,r){const n=this.j$,o=this.Z$,h=this.Q$;let a=0;for(let i=0;i=1;t-=2){const s=t-1,r=t;if(1!==n[s]||1!==n[r]){h[s]=Tp(i[s],n[s],this.K$),h[r]=Tp(i[r],n[r],this.K$),a=Math.max(h[s].length,a),a=Math.max(h[r].length,a);continue}const l=[e[s],null,null,e[r]];0===e[s].y.cmp(e[r].y)?(l[1]=e[s].add(e[r]),l[2]=e[s].toJ().mixedAdd(e[r].neg())):0===e[s].y.cmp(e[r].y.redNeg())?(l[1]=e[s].toJ().mixedAdd(e[r]),l[2]=e[s].add(e[r].neg())):(l[1]=e[s].toJ().mixedAdd(e[r]),l[2]=e[s].toJ().mixedAdd(e[r].neg()));const u=[-3,-1,-5,-7,0,7,5,1,3],c=wp(i[s],i[r]);a=Math.max(c[0].length,a),h[s]=new Array(a),h[r]=new Array(a);for(let t=0;t=0;t--){let e=0;for(;t>=0;){let i=!0;for(let e=0;e=0&&e++,l=l.dblp(e),t<0)break;for(let t=0;t0?i=o[t][e-1>>1]:e<0&&(i=o[t][-e-1>>1].neg()),l="affine"===i.type?l.mixedAdd(i):l.add(i))}}for(let t=0;t=Math.ceil((t.bitLength()+1)/e.step)}iX(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;const i=[this];let s=this;for(let r=0;r({a:new Mp(t.a,16),b:new Mp(t.b,16)}))):this.dX(i),{beta:e,lambda:i,basis:s}}cX(t){const e=t===this.p?this.red:Mp.mont(t),i=new Mp(2).toRed(e).redInvm(),s=i.redNeg(),r=new Mp(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}dX(t){const e=this.n.ushrn(Math.floor(this.n.bitLength()/2));let i,s,r,n,o,h,a,l,u,c=t,d=this.n.clone(),f=new Mp(1),g=new Mp(0),m=new Mp(0),y=new Mp(1),p=0;for(;0!==c.cmpn(0);){const t=d.div(c);l=d.sub(t.mul(c)),u=m.sub(t.mul(f));const o=y.sub(t.mul(g));if(!r&&l.cmp(e)<0)i=a.neg(),s=f,r=l.neg(),n=u;else if(r&&2==++p)break;a=l,d=c,c=l,m=f,f=u,y=g,g=o}o=l.neg(),h=u;const x=r.sqr().add(n.sqr());return o.sqr().add(h.sqr()).cmp(x)>=0&&(o=i,h=s),r.negative&&(r=r.neg(),n=n.neg()),o.negative&&(o=o.neg(),h=h.neg()),[{a:r,b:n},{a:o,b:h}]}fX(t){const e=this.endo.basis,i=e[0],s=e[1],r=s.b.mul(t).divRound(this.n),n=i.b.neg().mul(t).divRound(this.n),o=r.mul(i.a),h=n.mul(s.a),a=r.mul(i.b),l=n.mul(s.b);return{k1:t.sub(o).sub(h),k2:a.add(l).neg()}}point(t,e,i){return new Ip(this,t,e,i)}pointFromX(t,e){(t=new Mp(t,16)).red||(t=t.toRed(this.red));const i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b);let s=i.redSqrt();if(0!==s.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");const r=s.fromRed().isOdd();return(e&&!r||!e&&r)&&(s=s.redNeg()),this.point(t,s)}validate(t){if(t.inf)return!0;const e=t.x,i=t.y,s=this.a.redMul(e),r=e.redSqr().redMul(e).redIAdd(s).redIAdd(this.b);return 0===i.redSqr().redISub(r).cmpn(0)}AX(t,e,i){const s=this.lX,r=this.uX;let n=0;for(n=0;n":``}isInfinity(){return this.inf}add(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);let e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));const i=e.redSqr().redISub(this.x).redISub(t.x),s=e.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)}dbl(){if(this.inf)return this;const t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);const e=this.curve.a,i=this.x.redSqr(),s=t.redInvm(),r=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(s),n=r.redSqr().redISub(this.x.redAdd(this.x)),o=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,o)}getX(){return this.x.fromRed()}getY(){return this.y.fromRed()}mul(t){return t=new Mp(t,16),this.isInfinity()?this:this.oX(t)?this.curve.tX(this,t):this.curve.endo?this.curve.AX([this],[t]):this.curve.sX(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.AX(s,r):this.curve.hX(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.AX(s,r,!0):this.curve.hX(1,s,r,2,!0)}eq(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))}neg(t){if(this.inf)return this;const e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){const t=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}toJ(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)}}class Fp extends Cp{constructor(t,e,i,s){super(t,"jacobian"),null===e&&null===i&&null===s?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Mp(0)):(this.x=new Mp(e,16),this.y=new Mp(i,16),this.z=new Mp(s,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}getY(){throw new Error("Method not implemented.")}getX(){throw new Error("Method not implemented.")}pointFromX(t,e){throw new Error("Method not implemented.")}point(t,e,i){throw new Error("Method not implemented.")}jpoint(t,e,i){return new Fp(this,t,e,i)}toP(){if(this.isInfinity())return this.curve.point(null,null);const t=this.z.redInvm(),e=t.redSqr(),i=this.x.redMul(e),s=this.y.redMul(e).redMul(t);return this.curve.point(i,s)}neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;const e=t.z.redSqr(),i=this.z.redSqr(),s=this.x.redMul(e),r=t.x.redMul(i),n=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(i.redMul(this.z)),h=s.redSub(r),a=n.redSub(o);if(0===h.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const l=h.redSqr(),u=l.redMul(h),c=s.redMul(l),d=a.redSqr().redIAdd(u).redISub(c).redISub(c),f=a.redMul(c.redISub(d)).redISub(n.redMul(u)),g=this.z.redMul(t.z).redMul(h);return this.curve.jpoint(d,f,g)}mixedAdd(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;const e=this.z.redSqr(),i=this.x,s=t.x.redMul(e),r=this.y,n=t.y.redMul(e).redMul(this.z),o=i.redSub(s),h=r.redSub(n);if(0===o.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const a=o.redSqr(),l=a.redMul(o),u=i.redMul(a),c=h.redSqr().redIAdd(l).redISub(u).redISub(u),d=h.redMul(u.redISub(c)).redISub(r.redMul(l)),f=this.z.redMul(o);return this.curve.jpoint(c,d,f)}dblp(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){let e=this;for(let i=0;i=0)return!1;if(i.redIAdd(r),0===this.x.cmp(i))return!0}}inspect(){return this.isInfinity()?"":``}isInfinity(){return 0===this.z.cmpn(0)}}class Dp{constructor(t){this.curve=new Rp(t),this.g=this.curve.g,this.n=this.curve.n}}const Lp={};var Vp;Lp.PresetCurve=Dp,Vp={type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",{doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}]},Object.defineProperty(Lp,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new Dp(Vp);return Object.defineProperty(Lp,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class _p{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.yX(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof _p?e:new _p(t,{pub:e,pubEnc:i})}validate(){const t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}}getPublic(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub}yX(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type||"short"===this.ec.curve.type||this.ec.curve.type,void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)}verify(t,e){return this.ec.verify(t,e,this)}}function Pp(t,e){const i=t[e.place++];if(!(128&i))return i;const s=15&i;if(0===s||s>4)return!1;let r=0,n=e.place;for(let e=0;e>>=0;return!(r<=127)&&(e.place=n,r)}class Bp{constructor(){this.place=0}}class zp{constructor(t,e){if(t instanceof zp)return t;this.SX(t,e)||(this.r=new Mp(t.r,16),this.s=new Mp(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}SX(t,e){t=Ep(t,e);const i=new Bp;if(48!==t[i.place++])return!1;const s=Pp(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=Pp(t,i);if(!1===r)return!1;let n=t.slice(i.place,r+i.place);if(i.place+=r,2!==t[i.place++])return!1;const o=Pp(t,i);if(!1===o)return!1;if(t.length!==o+i.place)return!1;let h=t.slice(i.place,o+i.place);if(0===n[0]){if(!(128&n[1]))return!1;n=n.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new Mp(n),this.s=new Mp(h),this.recoveryParam=null,!0}}class Np{constructor(t){if(!(this instanceof Np))return new Np(t);"string"==typeof t&&(t=Lp[t]),t instanceof Lp.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1)}keyFromPublic(t,e){return _p.fromPublic(this,t,e)}vX(t,e){const i=8*t.byteLength()-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t}verify(t,e,i,s){t=this.vX(new Mp(t,16)),i=this.keyFromPublic(i,s);const r=(e=new zp(e,"hex")).r,n=e.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;const o=n.invm(this.n),h=o.mul(t).umod(this.n),a=o.mul(r).umod(this.n);if(!this.curve.q$){const t=this.g.mulAdd(h,i.getPublic(),a);return!t.isInfinity()&&0===t.getX().umod(this.n).cmp(r)}const l=this.g.jmulAdd(h,i.getPublic(),a);return!l.isInfinity()&&l.eqXToP(r)}}var Up,Op={exports:{}};Op.exports=(Up=Up||function(t,e){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==vp&&vp.crypto&&(i=vp.crypto),!i)try{i=e}catch(t){}var s=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function t(){}return function(e){var i;return t.prototype=e,i=new t,t.prototype=null,i}}(),n={},o=n.lib={},h=o.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=o.WordArray=h.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,i=t.words,s=this.sigBytes,r=t.sigBytes;if(this.clamp(),s%4)for(var n=0;n>>2]>>>24-n%4*8&255;e[s+n>>>2]|=o<<24-(s+n)%4*8}else for(var h=0;h>>2]=i[h>>>2];return this.sigBytes+=r,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4)},clone:function(){var t=h.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i>>2]>>>24-r%4*8&255;s.push((n>>>4).toString(16)),s.push((15&n).toString(16))}return s.join("")},parse:function(t){for(var e=t.length,i=[],s=0;s>>3]|=parseInt(t.substr(s,2),16)<<24-s%8*4;return new a.init(i,e/2)}},c=l.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,s=[],r=0;r>>2]>>>24-r%4*8&255;s.push(String.fromCharCode(n))}return s.join("")},parse:function(t){for(var e=t.length,i=[],s=0;s>>2]|=(255&t.charCodeAt(s))<<24-s%4*8;return new a.init(i,e)}},d=l.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},f=o.BufferedBlockAlgorithm=h.extend({reset:function(){this.Kw=new a.init,this.xX=0},bX:function(t){"string"==typeof t&&(t=d.parse(t)),this.Kw.concat(t),this.xX+=t.sigBytes},MX:function(e){var i,s=this.Kw,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this._X,0))*o,u=t.min(4*l,n);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,y=l[f-2],p=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;l[f]=m+l[f-7]+p+l[f-16]}var x=s&r^s&n^r&n,S=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),A=d+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&u^~h&c)+a[f]+l[f];d=c,c=u,u=h,h=o+A|0,o=n,n=r,r=s,s=A+(S+x)|0}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+o|0,i[4]=i[4]+h|0,i[5]=i[5]+u|0,i[6]=i[6]+c|0,i[7]=i[7]+d|0},kX:function(){var t=this.Kw,i=t.words,s=8*this.xX,r=8*t.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=e.floor(s/4294967296),i[15+(r+64>>>9<<4)]=s,t.sigBytes=4*i.length,this.MX(),this.IX},clone:function(){var t=n.clone.call(this);return t.IX=this.IX.clone(),t}});i.SHA256=n.TX(u),i.HmacSHA256=n.FX(u)}(Math),t.SHA256}(Op.exports),Wp={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({CX:function(){this.IX=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},kX:function(){var t=r.kX.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.TX(n),e.HmacSHA224=r.FX(n),t.SHA224;var e,i,s,r,n}(Op.exports),jp={exports:{}}.exports=Op.exports.enc.Hex,$p={exports:{}}.exports=Op.exports.enc.Utf8;!function(t){return i=(e=t).lib.WordArray,e.enc.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,s=this.PX;t.clamp();for(var r=[],n=0;n>>2]>>>24-n%4*8&255)<<16|(e[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|e[n+2>>>2]>>>24-(n+2)%4*8&255,h=0;h<4&&n+.75*h>>6*(3-h)&63));var a=s.charAt(64);if(a)for(;r.length%4;)r.push(a);return r.join("")},parse:function(t){var e=t.length,s=this.PX,r=this.DX;if(!r){r=this.DX=[];for(var n=0;n>>6-o%4*2;r[n>>>2]|=h<<24-n%4*8,n++}return i.create(r,n)}(t,e,r)},PX:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(Op.exports),function(t){(function(e){var i=t,s=i.lib,r=s.WordArray,n=s.Hasher,o=i.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var a=o.MD5=n.extend({CX:function(){this.IX=new r.init([1732584193,4023233417,2562383102,271733878])},wX:function(t,e){for(var i=0;i<16;i++){var s=e+i,r=t[s];t[s]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var n=this.IX.words,o=t[e+0],a=t[e+1],f=t[e+2],g=t[e+3],m=t[e+4],y=t[e+5],p=t[e+6],x=t[e+7],S=t[e+8],A=t[e+9],v=t[e+10],b=t[e+11],M=t[e+12],E=t[e+13],T=t[e+14],w=t[e+15],k=n[0],C=n[1],R=n[2],I=n[3];k=l(k,C,R,I,o,7,h[0]),I=l(I,k,C,R,a,12,h[1]),R=l(R,I,k,C,f,17,h[2]),C=l(C,R,I,k,g,22,h[3]),k=l(k,C,R,I,m,7,h[4]),I=l(I,k,C,R,y,12,h[5]),R=l(R,I,k,C,p,17,h[6]),C=l(C,R,I,k,x,22,h[7]),k=l(k,C,R,I,S,7,h[8]),I=l(I,k,C,R,A,12,h[9]),R=l(R,I,k,C,v,17,h[10]),C=l(C,R,I,k,b,22,h[11]),k=l(k,C,R,I,M,7,h[12]),I=l(I,k,C,R,E,12,h[13]),R=l(R,I,k,C,T,17,h[14]),k=u(k,C=l(C,R,I,k,w,22,h[15]),R,I,a,5,h[16]),I=u(I,k,C,R,p,9,h[17]),R=u(R,I,k,C,b,14,h[18]),C=u(C,R,I,k,o,20,h[19]),k=u(k,C,R,I,y,5,h[20]),I=u(I,k,C,R,v,9,h[21]),R=u(R,I,k,C,w,14,h[22]),C=u(C,R,I,k,m,20,h[23]),k=u(k,C,R,I,A,5,h[24]),I=u(I,k,C,R,T,9,h[25]),R=u(R,I,k,C,g,14,h[26]),C=u(C,R,I,k,S,20,h[27]),k=u(k,C,R,I,E,5,h[28]),I=u(I,k,C,R,f,9,h[29]),R=u(R,I,k,C,x,14,h[30]),k=c(k,C=u(C,R,I,k,M,20,h[31]),R,I,y,4,h[32]),I=c(I,k,C,R,S,11,h[33]),R=c(R,I,k,C,b,16,h[34]),C=c(C,R,I,k,T,23,h[35]),k=c(k,C,R,I,a,4,h[36]),I=c(I,k,C,R,m,11,h[37]),R=c(R,I,k,C,x,16,h[38]),C=c(C,R,I,k,v,23,h[39]),k=c(k,C,R,I,E,4,h[40]),I=c(I,k,C,R,o,11,h[41]),R=c(R,I,k,C,g,16,h[42]),C=c(C,R,I,k,p,23,h[43]),k=c(k,C,R,I,A,4,h[44]),I=c(I,k,C,R,M,11,h[45]),R=c(R,I,k,C,w,16,h[46]),k=d(k,C=c(C,R,I,k,f,23,h[47]),R,I,o,6,h[48]),I=d(I,k,C,R,x,10,h[49]),R=d(R,I,k,C,T,15,h[50]),C=d(C,R,I,k,y,21,h[51]),k=d(k,C,R,I,M,6,h[52]),I=d(I,k,C,R,g,10,h[53]),R=d(R,I,k,C,v,15,h[54]),C=d(C,R,I,k,a,21,h[55]),k=d(k,C,R,I,S,6,h[56]),I=d(I,k,C,R,w,10,h[57]),R=d(R,I,k,C,p,15,h[58]),C=d(C,R,I,k,E,21,h[59]),k=d(k,C,R,I,m,6,h[60]),I=d(I,k,C,R,b,10,h[61]),R=d(R,I,k,C,f,15,h[62]),C=d(C,R,I,k,A,21,h[63]),n[0]=n[0]+k|0,n[1]=n[1]+C|0,n[2]=n[2]+R|0,n[3]=n[3]+I|0},kX:function(){var t=this.Kw,i=t.words,s=8*this.xX,r=8*t.sigBytes;i[r>>>5]|=128<<24-r%32;var n=e.floor(s/4294967296),o=s;i[15+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),i[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(i.length+1),this.MX();for(var h=this.IX,a=h.words,l=0;l<4;l++){var u=a[l];a[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return h},clone:function(){var t=n.clone.call(this);return t.IX=this.IX.clone(),t}});function l(t,e,i,s,r,n,o){var h=t+(e&i|~e&s)+r+o;return(h<>>32-n)+e}function u(t,e,i,s,r,n,o){var h=t+(e&s|i&~s)+r+o;return(h<>>32-n)+e}function c(t,e,i,s,r,n,o){var h=t+(e^i^s)+r+o;return(h<>>32-n)+e}function d(t,e,i,s,r,n,o){var h=t+(i^(e|~s))+r+o;return(h<>>32-n)+e}i.MD5=n.TX(a),i.HmacMD5=n.FX(a)})(Math),t.MD5}(Op.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({CX:function(){this.IX=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},wX:function(t,e){for(var i=this.IX.words,s=i[0],r=i[1],n=i[2],h=i[3],a=i[4],l=0;l<80;l++){if(l<16)o[l]=0|t[e+l];else{var u=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=u<<1|u>>>31}var c=(s<<5|s>>>27)+a+o[l];c+=l<20?1518500249+(r&n|~r&h):l<40?1859775393+(r^n^h):l<60?(r&n|r&h|n&h)-1894007588:(r^n^h)-899497514,a=h,h=n,n=r<<30|r>>>2,r=s,s=c}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+h|0,i[4]=i[4]+a|0},kX:function(){var t=this.Kw,e=t.words,i=8*this.xX,s=8*t.sigBytes;return e[s>>>5]|=128<<24-s%32,e[14+(s+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(s+64>>>9<<4)]=i,t.sigBytes=4*e.length,this.MX(),this.IX},clone:function(){var t=r.clone.call(this);return t.IX=this.IX.clone(),t}}),e.SHA1=r.TX(h),e.HmacSHA1=r.FX(h),t.SHA1;var e,i,s,r,n,o,h}(Op.exports),Yp=(Gp=Op.exports).lib.Base,Hp=Gp.enc.Utf8,Gp.algo.HMAC=Yp.extend({init:function(t,e){t=this.BX=new t.init,"string"==typeof e&&(e=Hp.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.LX=e.clone(),n=this.RX=e.clone(),o=r.words,h=n.words,a=0;a>>2];t.sigBytes-=e}};s.BlockCipher=u.extend({cfg:u.cfg.extend({mode:f,padding:g}),reset:function(){var t;u.reset.call(this);var e=this.cfg,i=e.iv,s=e.mode;this.VX==this.EX?t=s.createEncryptor:(t=s.createDecryptor,this._X=1),this.UX&&this.UX.YX==t?this.UX.init(this,i&&i.words):(this.UX=t.call(s,this,i&&i.words),this.UX.YX=t)},wX:function(t,e){this.UX.processBlock(t,e)},kX:function(){var t,e=this.cfg.padding;return this.VX==this.EX?(e.pad(this.Kw,this.blockSize),t=this.MX(!0)):(t=this.MX(!0),e.unpad(t)),t},blockSize:4});var m=s.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),y=(i.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return(i?n.create([1398893684,1701076831]).concat(i).concat(e):e).toString(a)},parse:function(t){var e,i=a.parse(t),s=i.words;return 1398893684==s[0]&&1701076831==s[1]&&(e=n.create(s.slice(2,4)),s.splice(0,4),i.sigBytes-=16),m.create({ciphertext:i,salt:e})}},p=s.SerializableCipher=r.extend({cfg:r.extend({format:y}),encrypt:function(t,e,i,s){s=this.cfg.extend(s);var r=t.createEncryptor(i,s),n=r.finalize(e),o=r.cfg;return m.create({ciphertext:n,key:i,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:s.format})},decrypt:function(t,e,i,s){return s=this.cfg.extend(s),e=this.HX(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},HX:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),x=(i.kdf={}).OpenSSL={execute:function(t,e,i,s){s||(s=n.random(8));var r=l.create({keySize:e+i}).compute(t,s),o=n.create(r.words.slice(e),4*i);return r.sigBytes=4*e,m.create({key:r,iv:o,salt:s})}},S=s.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:x}),encrypt:function(t,e,i,s){var r=(s=this.cfg.extend(s)).kdf.execute(i,t.keySize,t.ivSize);s.iv=r.iv;var n=p.encrypt.call(this,t,e,r.key,s);return n.mixIn(r),n},decrypt:function(t,e,i,s){s=this.cfg.extend(s),e=this.HX(e,s.format);var r=s.kdf.execute(i,t.keySize,t.ivSize,e.salt);return s.iv=r.iv,p.decrypt.call(this,t,e,r.key,s)}})}()}(Op.exports);var Zp={exports:{}}.exports=function(t){return function(){var e=t,i=e.lib.BlockCipher,s=e.algo,r=[],n=[],o=[],h=[],a=[],l=[],u=[],c=[],d=[],f=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,s=0;for(e=0;e<256;e++){var g=s^s<<1^s<<2^s<<3^s<<4;g=g>>>8^255&g^99,r[i]=g,n[g]=i;var m=t[i],y=t[m],p=t[y],x=257*t[g]^16843008*g;o[i]=x<<24|x>>>8,h[i]=x<<16|x>>>16,a[i]=x<<8|x>>>24,l[i]=x,x=16843009*p^65537*y^257*m^16843008*i,u[g]=x<<24|x>>>8,c[g]=x<<16|x>>>16,d[g]=x<<8|x>>>24,f[g]=x,i?(i=m^t[t[t[p^m]]],s^=t[t[s]]):i=s=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],m=s.AES=i.extend({CX:function(){if(!this.$X||this.XX!==this.OX){for(var t=this.XX=this.OX,e=t.words,i=t.sigBytes/4,s=4*((this.$X=i+6)+1),n=this.jX=[],o=0;o6&&o%i==4&&(l=r[l>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l]):(l=r[(l=l<<8|l>>>24)>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l],l^=g[o/i|0]<<24),n[o]=n[o-i]^l);for(var h=this.ZX=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.QX(t,e,this.jX,o,h,a,l,r)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this.QX(t,e,this.ZX,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},QX:function(t,e,i,s,r,n,o,h){for(var a=this.$X,l=t[e]^i[0],u=t[e+1]^i[1],c=t[e+2]^i[2],d=t[e+3]^i[3],f=4,g=1;g>>24]^r[u>>>16&255]^n[c>>>8&255]^o[255&d]^i[f++],y=s[u>>>24]^r[c>>>16&255]^n[d>>>8&255]^o[255&l]^i[f++],p=s[c>>>24]^r[d>>>16&255]^n[l>>>8&255]^o[255&u]^i[f++],x=s[d>>>24]^r[l>>>16&255]^n[u>>>8&255]^o[255&c]^i[f++];l=m,u=y,c=p,d=x}m=(h[l>>>24]<<24|h[u>>>16&255]<<16|h[c>>>8&255]<<8|h[255&d])^i[f++],y=(h[u>>>24]<<24|h[c>>>16&255]<<16|h[d>>>8&255]<<8|h[255&l])^i[f++],p=(h[c>>>24]<<24|h[d>>>16&255]<<16|h[l>>>8&255]<<8|h[255&u])^i[f++],x=(h[d>>>24]<<24|h[l>>>16&255]<<16|h[u>>>8&255]<<8|h[255&c])^i[f++],t[e]=m,t[e+1]=y,t[e+2]=p,t[e+3]=x},keySize:8});e.AES=i.TX(m)}(),t.AES}(Op.exports),Kp={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.NX,s=i.blockSize,r=this.GX,n=this.JX;r&&(n=this.JX=r.slice(0),this.GX=void 0);var o=n.slice(0);i.encryptBlock(o,0),n[s-1]=n[s-1]+1|0;for(var h=0;h>>2]|=t[r]<<24-r%4*8;i.call(this,s,e)}else i.apply(this,arguments)};s.prototype=e}}(),t.lib.WordArray}(Op.exports),qp={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(Op.exports);const Qp={"-4":["MDQxMmQ1MWU5MjFhYTMzODUwMWE4ZGYzN2ViZTE4NTU3ZDViYmRlZDg1Yzk0OGI3YTJkMDBmZTNhZGVlMjdjY2VmNzBiMWVlOWI3MDZjMTIwYTAzZDZlZTNkNmYyOTc5Y2E2NGEzN2Y3YjY4N2E1ZjljZWY2ODYxN2I1NWU5ZmJjMA=="],"-3":["MjAxODAxMjA="],"-2":["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2Vzc2lvbg==","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvdHJvdWJsZXNob290aW5nL3Jlc3RyaWN0ZWQtZmVhdHVyZXMv","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzLw=="],"-1":["WE1MSHR0cFJlcXVlc3Q=","ZG9jdW1lbnQ=","ZGVmYXVsdFZpZXc=","YQ==","Yg==","bGljZW5zZV9leHBpcmF0aW9uX2RhdGU=","bG9jYXRpb24=","aG9zdG5hbWU=","dGVzdF9kb21haW4=","ZG9tYWlucw==","Y3J5cHRv","U2lnbmF0dXJl","RUNEU0E=","U0hBMjI0d2l0aEVDRFNB","YWxn","Y3VydmU=","c2VjcDI1Nmsx","YWRkRXZlbnRMaXN0ZW5lcg==","cmVtb3ZlRXZlbnRMaXN0ZW5lcg==","bG9hZGVuZA==","ZXJyb3I=","YWJvcnQ=","dGltZW91dA==","cmVzcG9uc2VUZXh0","Q29udGVudC1UeXBl","YXBwbGljYXRpb24vanNvbg==","TWVzc2FnZURpZ2VzdA==","c2hhMjU2","Y3J5cHRvanM=","dXBkYXRlU3RyaW5n","ZGlnZXN0","Y29tcGFueQ==","YXBwVGl0bGU=","bGNqcy1zZXNzaW9u","bG9jYWxTdG9yYWdl","Z2V0SXRlbQ==","c2V0SXRlbQ==","ZA==","dA==","bGNqcy1zZXNzaW9uLTI="],0:["TGljZW5zZQ==","IA==","a2V5","aGFz","ZXhwaXJlZA==","Lg==","dmVyc2lvbg==","aXM=","dG9v","bmV3","b2xk","b3I=","aW52YWxpZA==","MDAwMQ==","SW52YWxpZA==","bnVtYmVy","b2Y=","ZG9tYWlucw==","ZGVwbG95bWVudA==","aW4=","ZG9tYWlu","RGVwbG95bWVudA==","ZG9tYWlu","dmFsaWRhdGlvbg==","ZmFpbGVk","Og==","UE9TVA==","c2VydmVy","cmVzcG9uZGVk","d2l0aA==","dW5leHBlY3RlZA==","dmFsdWU=","cmVxdWVzdA==","VEVTVA==","REVQTE9ZTUVOVA==","S2V5","VGFtcGVyaW5n","YmVlbg==","ZGV0ZWN0ZWQ=","TWlzc2luZw==","TGljZW5zZQ==","aW5mb3JtYXRpb24=","ZG9lcw==","bm90","aW5jbHVkZQ==","cGVybWlzc2lvbg==","dG8=","dXNl","Q2hhcnQ=","M0Q=","WFk=","RGF0YUdyaWQ=","TWFw","UG9sYXI=","RnVubmVs","R2F1Z2U=","UGll","UHlyYW1pZA==","U3BpZGVy","Zm9y","dGhpcw==","VHJhZGluZw==","ZmVhdHVyZXM=","Y2xpY2s=","aGVyZQ==","bW9yZQ==","c3VwcGxpZWQ=","Z2V0","bGljZW5zZQ==","VHJlZQ=="],1:["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2FuZGJveA=="]},tx=bt,ex=(...t)=>t.slice(1).reduce(((e,i)=>e+tx.atob(Qp[t[0]][i].toString())),"");let ix,sx,rx,nx=new Uint8Array([]);class ox{set e(t){ix=t}get e(){sx={tf:!1,if:!1,sf:!1,ef:!1,hf:!1,rf:!1,nf:!1,af:!1,lf:!1,uf:!1,cf:!1,df:!1,ff:!1,Af:!1,gf:!1,pf:!1,mf:!1,yf:!1,Sf:!1,vf:!1,xf:!1,bf:!1,Mf:!1,_f:!1};const t=nx.length,e=t>=1?nx[0]:void 0,i=t>=2?nx[1]:void 0,s=t>=3?nx[2]:void 0;return void 0!==e&&(sx.tf=!!(1&e),sx.if=!!(2&e),sx.sf=!!(4&e),sx.ef=!!(8&e),sx.hf=!!(16&e),sx.rf=!!(32&e),sx.nf=!!(64&e),sx.af=!!(128&e)),void 0!==i&&(sx.lf=!!(1&i),sx.uf=!!(2&i),sx.cf=!!(4&i),sx.df=!!(8&i),sx.ff=!!(16&i),sx.Af=!!(32&i),sx.gf=!!(64&i),sx.pf=!!(128&i)),void 0!==s&&(sx.mf=!!(1&s),sx.yf=!!(2&s),sx.Sf=!!(4&s),sx.vf=!!(8&s),sx.xf=!!(16&s),sx.bf=!!(32&s),sx.Mf=!!(64&s),sx._f=!!(128&s)),sx.rf}set l(t){rx=t}get l(){return rx}}let hx=!1;const ax=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},lx=t=>{if(4===t.byteLength)return`${t[0].toString().padStart(2,"0")}${t[1].toString().padStart(2,"0")}${t[2].toString().padStart(2,"0")}${t[3].toString().padStart(2,"0")}`},ux=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),cx=t=>{const e={},i=t.split("-");if(3!==i.length)return{KX:ex(0,0,1,7,1,12,5)};let s=0;const r=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(0)));s+=1;const n=r.subarray(s,s+=20),o=new DataView(r.buffer).getUint16(s,!0);s+=2;const h=Uint8Array.from(Array(o));for(let t=0;tt+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");return gx(d,f)?e:{KX:ex(0,0,1,7,1,12,5)}},dx=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(ax(i,2)),e=t.slice(36,40),s=new Uint8Array(4),r=(t=>{let e;const i=[];for(let t=0;t<256;t+=1){e=t;for(let t=0;t<8;t+=1)e=1&e?3988292384^e>>>1:e>>>1;i[t]=e}let s=-1;for(let e=0;e>>8^i[255&(s^t[e])];return~s>>>0})(t.slice(0,36));new DataView(s.buffer).setUint32(0,r,!0);const n=t.slice(28,34);let o=0;for(let t=n.length-1;t>0;t-=1)o+=n[t]*2**(8*t);const h=new Date(o);if(ux(h)s[e]===t)))return{};break}case"0002":return cx(t);default:return{KX:ex(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}return{KX:ex(0,0,1,2,1,7,1,12,5)}},fx=t=>{if(!t)return{KX:ex(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5)};const e=(t[ex(-1,9)]||t[ex(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(tx[ex(-1,6)][ex(-1,7)])>-1)return{sj:!0};const i=e.filter((t=>t.indexOf("*")>-1));if(Sx(tx[ex(-1,6)][ex(-1,7)],i))return{sj:!0};const s=t[ex(-1,8)]||t[ex(-1,38)];if(""!==s&&null!=s){if(Sx(tx[ex(-1,6)][ex(-1,7)],[s]))return{sj:!1};if(s===tx[ex(-1,6)][ex(-1,7)])return{sj:!1}}return{KX:ex(0,14,1,20,5)}},gx=(t,e)=>{const i=new Np("secp256k1").keyFromPublic(ex(-4,0),"hex"),s=Wp(t).toString();return i.verify(s,e)},mx=t=>{switch(t.slice(0,4)){case"0001":return(t=>{let e,i="";try{const e=t.split("-"),s=e[1],r=e[2],n=e[3];if(!gx(r,n))return{KX:ex(0,21,1,2,1,7,1,12,5)};const o=jp.parse(r);i=Zp.decrypt({ciphertext:jp.parse(s)},o,{mode:Kp,padding:qp,iv:jp.parse("00000000000000000000000000000001")}).toString($p)}catch(t){return{KX:ex(0,21,1,2,1,7,1,12,5)}}try{e=JSON.parse(i)}catch(t){return{KX:ex(0,21,1,2,1,7,1,12,5)}}if(void 0===e[ex(-1,5)]||null===e[ex(-1,4)]||!e[ex(-1,9)])return{KX:ex(0,21,1,2,1,7,1,12,5)};const s=parseInt(ex(-3,0),10)||Number(parseInt(ex(-3,0),10));return e[ex(-1,5)]{const e=cx(t),i=e.qX,s=e.ij;if(e.KX||void 0===i||void 0===s)return e;let r,n="";try{const t=i.slice(e.ij,s+16),r=new DataView(t.buffer),o=new Int32Array(4);for(let t=0;t{switch(t.slice(0,4)){case"0001":return((t,e)=>{if(!e)return{KX:ex(0,39,1,40,1,41,5)};const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!gx(`${s}-${r}`,n))return{KX:ex(0,21,1,2,1,7,1,12,5)};const o=Uint8Array.from(ax(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(ex(-3,0),10)||Number(parseInt(ex(-3,0),10))))return{KX:ex(0,21,1,2,1,3,1,4,5)};const a=Int32Array.from(ax(s,8)),l=Xp(e[ex(-1,31)]).toString(jp),u=Int32Array.from(ax(l,8)),c=Xp(e[ex(-1,32)]).toString(jp),d=Int32Array.from(ax(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t))?{}:{KX:ex(0,21,1,2,1,7,1,12,5)}})(t,e);case"0002":return((t,e)=>{if(!e)return{KX:ex(0,39,1,40,1,41,5)};const i=cx(t),s=i.qX,r=i.ij;if(i.KX||void 0===s||void 0===r)return i;const n=s.slice(r,s.length),o=new DataView(n.buffer),h=new Int32Array(8);for(let t=0;td[e]===t))?{}:{KX:ex(0,21,1,2,1,7,1,12,5)}})(t,e);default:return{KX:ex(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}},px=(t,e,i=!0,s)=>{hx=!1,e.eo();const r=e.Wr,n=!!r&&(r===bt.document.body||bt.document.body.contains(r)),o=r&&n?r:document.body;if(void 0===Array.from(o.children).find((t=>"lcjs-error"===t.id))){const e=bt.document.createElement("div");e.id="lcjs-error",o.append(e),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="black",e.style.boxSizing="border-box",e.style.padding="20px",e.style.font="Arial",e.style.fontSize="20px";let r,n=(t||"LICENSE_ERROR").toLowerCase().split("_").join(" ");if(n=(i?ex(0,0,1,2,1,23,1,24,25,1):"")+n.charAt(0).toUpperCase()+n.substr(1),s){const t=bt.document.createElement("a");t.href=s,r=t}else r=bt.document.createElement("p1");e.append(r),r.innerHTML=n,r.style.color="red"}},xx=(t,e,i)=>{e?(t[ex(-1,17)](ex(-1,19),i),t[ex(-1,17)](ex(-1,20),i),t[ex(-1,17)](ex(-1,21),i),t[ex(-1,17)](ex(-1,22),i)):(t[ex(-1,18)](ex(-1,19),i),t[ex(-1,18)](ex(-1,20),i),t[ex(-1,18)](ex(-1,21),i),t[ex(-1,18)](ex(-1,22),i))},Sx=(t,e)=>{const i=t.split(".").reverse();return e.some((t=>{const e=t.split(".").reverse();let s=!1;const r=e.findIndex((t=>"*"===t)),n=i.every(((t,i)=>{if(!s){if(!(i2,!s&&t!==e[i])return!1}return!0}));return!(r>i.length-1||!n)}))},Ax=new Map;e.Animation=Z,e.AnimationEasings=$,e.Animator=K,e.AreaRangeSeries=$u,e.AreaSeries=Ou,e.AreaSeriesBipolar=Gu,e.AreaSeriesMonopolar=Yu,e.AreaSeriesNegative=Hu,e.AreaSeriesPositive=Xu,e.AreaSeriesTypes=Wu,e.AutoCursor2DBuilder=ma,e.AutoCursorBuilders=_f,e.AutoCursorXYBuilder=nu,e.AutoFitStrategies=ha,e.AutoFitStrategy=ra,e.Axis=uh,e.Axis3D=ja,e.AxisScrollStrategies=zs,e.AxisTickStrategies=Ns,e.Band=Ps,e.BarChart=Ef,e.BarChartBar=vf,e.BarChartCategoryAxis=Sf,e.BarChartSorting=Tf,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=Af,e.BasicSeries=vu,e.BorderedPicture=Dn,e.BoxFigure=tu,e.BoxSeries=Tu,e.BoxSeries3D=tl,e.Button=zo,e.Chart=Qh,e.Chart3D=Sl,e.ChartComponent=Yi,e.ChartMarker=du,e.ChartMarker2D=class extends du{constructor(t,e,i,s,r,n){super(t,e,i,s.lm(t,e,i,n),r,n)}},e.ChartMarkerXY=gu,e.ChartWithSeries=al,e.ChartXY=Pc,e.Color=b,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return E(i[0],i[1],i[2],255*i[3])}if(t.startsWith("rgb")){const e=t.substr(4).slice(0,-1),i=JSON.parse(`[${e}]`);return E(i[0],i[1],i[2])}if(t.startsWith("hsl")){const e=t.substr(4).slice(0,-1).split(",").map(parseFloat),i=((t,e,i)=>{e/=100,i/=100;const s=(1-Math.abs(2*i-1))*e,r=t/60,n=s*(1-Math.abs(r%2-1));let o=[];isNaN(t)?o=[0,0,0]:r<=1?o=[s,n,0]:r<=2?o=[n,s,0]:r<=3?o=[0,s,n]:r<=4?o=[0,n,s]:r<=5?o=[n,0,s]:r<=6&&(o=[s,0,n]);const h=i-.5*s;return[Math.round(255*(o[0]+h)),Math.round(255*(o[1]+h)),Math.round(255*(o[2]+h))]})(e[0],e[1],e[2]);return E(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?T(t):T((t=>{const e=C[t.toLowerCase()];if(e)return e;throw new Error(`Unknown color code: ${t}`)})(t))}catch(t){}return console.warn(`ColorCSS parsing error: ${t}`),T("#fff")},e.ColorHEX=T,e.ColorHSV=w,e.ColorPalettes=Pn,e.ColorRGBA=E,e.ColorShadingStyles=Xn,e.ColorUint32=k,e.ConstantLine=Bs,e.CursorBuilder=ga,e.CursorBuilderXY=ru,e.CustomTick=An,e.Dashboard=Ff,e.DashedLine=qn,e.DataGrid=ff,e.DataPatternsNew=Dr,e.DataSetXY=no,e.DateTimeTickStrategy=Fh,e.EllipseFigure=wu,e.EllipseSeries=ku,e.EmptyFill=B,e.EmptyUIElement=Rn,e.Figure=Ql,e.FigureSeries=Mu,e.FontSettings=rr,e.FormattingFunctions=Ii,e.FunnelChart=id,e.FunnelChartTypes=hd,e.FunnelChartWithLabelsInsideSlices=od,e.FunnelChartWithLabelsOnSides=nd,e.FunnelSlice=Jc,e.GaugeChart=ud,e.GaugeChartTypes=Wf,e.GaugeSlice=dd,e.GenericAxis=Js,e.GlowEffect=ro,e.HeatmapGridSeries=_u,e.HeatmapGridSeriesIntensityValues=Pu,e.HeatmapScrollingGridSeries=Bu,e.HeatmapScrollingGridSeriesIntensityValues=zu,e.Highlighter=Hi,e.Icon=eo,e.ImageFill=$n,e.IndividualPointFill=H,e.LUT=_,e.LegendBoxBuilders=sh,e.LineAndPointSeries3D=el,e.LineSeries=vc,e.LineSeries3D=il,e.LinearGradientFill=st,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new st({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=Rl,e.MapRegions=Xf,e.MapRegionsAfrica=Pf,e.MapRegionsAsia=Bf,e.MapRegionsAustralia=zf,e.MapRegionsCanada=Nf,e.MapRegionsEurope=Uf,e.MapRegionsNorthAmerica=Yf,e.MapRegionsSouthAmerica=Hf,e.MapRegionsUSA=Gf,e.MapRegionsWorld=Of,e.MapTypes=bl,e.MarkerBuilders=Vf,e.MeshModel3D=xl,e.NumericTickStrategy=Nh,e.OHLCSeries=mc,e.OHLCSeriesBars=pc,e.OHLCSeriesCandlesticks=yc,e.OHLCSeriesTypes=xc,e.OnScreenMenu=Mc,e.OnScreenMenuAnimationsButton=vs,e.OnScreenMenuButton=fs,e.OnScreenMenuControlBase=Qi,e.OnScreenMenuCustomButton=Ms,e.OnScreenMenuOsmToggleButton=Es,e.OnScreenMenuToggleButton=gs,e.OnScreenMenuZoomInButton=ms,e.OnScreenMenuZoomInXButton=ys,e.OnScreenMenuZoomInYButton=ps,e.OnScreenMenuZoomOutButton=xs,e.OnScreenMenuZoomOutXButton=Ss,e.OnScreenMenuZoomOutYButton=As,e.OnScreenMenuZoomToFitButton=bs,e.PalettedFill=class extends W{constructor(t){super({...t,fillType:"palette"})}toString(){return`palettedFill:lut=${this.lut.toString()},lookUpProperty=${this.lookUpProperty}`}getPalette(){return this.get("lut")}setLookUpProperty(t){return"function"==typeof t?this.set("lookUpProperty",t(this.get("lookUpProperty"))):this.set("lookUpProperty",t)}getLookUpProperty(){return this.get("lookUpProperty")}},e.Panel=Zh,e.PhongShadingStyle=Yn,e.Picture=Fn,e.PieChart=Ba,e.PieChartTypes=Ga,e.PieChartWithLabelsInsideSlices=Oa,e.PieChartWithLabelsOnSides=Ua,e.PieSlice=Da,e.PixelatedPoints3D=dr,e.PointCloudSeries3D=ol,e.PointLineAreaSeries=Ec,e.PointLineSeries=Qu,e.PointLineSeries3D=sl,e.PointSeries=bc,e.PointSeries3D=nl,e.PointSeriesTypes3D=hl,e.PointStyle3D=gr,e.PolarAreaSeries=Wc,e.PolarAreaSeriesInterior=jc,e.PolarAxis=Dl,e.PolarAxisAmplitude=Vl,e.PolarAxisTick=Ll,e.PolarChart=Zc,e.PolarHeatmapSeries=Zl,e.PolarLineSeries=Jl,e.PolarPointLineSeries=ql,e.PolarPointSeries=Yc,e.PolarPolygon=Hc,e.PolarPolygonSeries=Xc,e.PolarSector=Ol,e.PolarSeries=Yl,e.PolygonFigure=Cu,e.PolygonSeries=Ru,e.PyramidChart=vd,e.PyramidChartTypes=wd,e.PyramidChartWithLabelsInsideSlices=Td,e.PyramidChartWithLabelsOnSides=Ed,e.PyramidSlice=pd,e.RadialGauge=cd,e.RadialGradientFill=tt,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new tt({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=Nu,e.RectangleFigure=Iu,e.RectangleSeries=Fu,e.SegmentFigure=Du,e.SegmentSeries=Lu,e.Series2D=Gl,e.Series3D=Qa,e.SeriesMarkerXY=mu,e.SeriesXY=yu,e.SimpleShadingStyle=On,e.Slice=Ia,e.SliceLabelFormatters=Ca,e.SliceSorters=ka,e.SolidFill=G,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new G({color:s(t)})},e.SolidGauge=yd,e.SolidGaugeSlice=fd,e.SolidLine=Ji,e.SpiderAxis=Fd,e.SpiderChart=Od,e.SpiderSeries=Ld,e.SplineSeries=ic,e.StaticCursor2DBuilder=ya,e.StaticCursorXYBuilder=ou,e.StepSeries=gc,e.StipplePatterns=Kn,e.SurfaceGridSeries3D=fl,e.SurfaceScrollingGridSeries3D=gl,e.TableContentBuilder=aa,e.Themes=gg,e.Tick=lh,e.TickStyle=mh,e.TimeFormattingFunctions=Gh,e.TimeTickStrategy=Hh,e.TreeMapChart=Qf,e.TriangulatedPoints3D=lr,e.UIBackgrounds=Lf,e.UICircle=yo,e.UIColumnGrid=class extends Mo{constructor(){super(...arguments),this.vd=[]}addColumn(){return this.addElement(Co,void 0)}getColumn(t,e=!1){return e&&this.vd.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.vd[t]}},e.UIDiamond=po,e.UIElementBuilders=ih,e.UIElementColumn=Eo,e.UIElementLine=bo,e.UIElementRow=Mo,e.UIElementWithBackground=xn,e.UIEmptyBackground=In,e.UILabel=fo,e.UILayoutBuilders=Al,e.UILayoutGap=vo,e.UILegendBoxPanel=vl,e.UIObject=fn,e.UIOrigins=ws,e.UIPanel=Jh,e.UIPoint=So,e.UIPointer=xo,e.UIPolygon=Ln,e.UIRectangle=mo,e.UIRowGrid=wo,e.VisibleFill=O,e.ZoomBandChart=Oc,e.defaultOsmBackgroundColor=Vs,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=z,e.emptyLine=ot,e.emptyPoints3D=hr,e.emptyTick=ph,e.formatLongitudeLatitude=Fl,e.formatNumberAsUnicodeSuperscript=Fi,e.isColor=M,e.isCoordinate3D=yl,e.isCoordinateBarChart=bf,e.isCoordinateClient=Ni,e.isCoordinatePolar=Ul,e.isCoordinateXY=Oi,e.isDashedLine=Qn,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=N,e.isEmptyTick=xh,e.isFontSettings=nr,e.isGlowEffect=t=>!(!t||"object"!=typeof t||!("type"in t)||"glow"!==t.type),e.isIcon=io,e.isIndividualPointFill=X,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=rt,e.isNumericTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"numeric-ticks"!==t.type),e.isPalettedFill=j,e.isPhongShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"phong"!==t.type),e.isPixelatedPoints3D=fr,e.isRadialGradientFill=et,e.isSeriesSupportedByZoomBandChart=t=>t instanceof vu||t instanceof Ou||t instanceof $u||t instanceof Pu||t instanceof mc||t instanceof gc||t instanceof Ec,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=Y,e.isSolidLine=qi,e.isTickStyle=yh,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=ur,e.lightningChart=(t,e)=>{const i="object"==typeof t?t.license:t,s="object"==typeof t?t.licenseInformation:e,n="object"==typeof t?t:void 0,o=new ox;o.e=i;let h=Ax.get(i||"E");return h||(h=((t,e)=>{let i,s,n=!1,o=!1,h=!1,a=!1,l="",u=!1,c=!1;try{if(ix){const s=(t=>{if(!ix)return;const e=ix.split("-");if(e.length>0)switch(e[0]){case"0001":return"0001";case"0002":return"0002";case"T001":return"T001";default:return}})();if("0001"===s){nx=new Uint8Array([2]);const e=(t=>{if(!ix)return;const e=ix.split("-");return 4===e.length?e[1].startsWith("m")?2:1:0})();if(1===e){const t=mx(ix);h=!t.sj,i=t,n=!0}else 2===e?(i=yx(ix,t),o=!0):(hx=!0,i=dx(ix),a=!0)}else if("0002"===s){const e=(t=>{if(!ix)return;const e=ix.split("-");return e.length>=2?Uint8Array.from(atob(e[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)hx=!0,i=dx(ix),a=!0;else if(189===e){const t=mx(ix);h=!t.sj,i=t,n=!0}else 159===e?(i=yx(ix,t),o=!0):i={KX:ex(0,0,1,7,1,12,5)}}else if("T001"===s){const s=((t,e)=>{const i=ix.split("-");if(3!==i.length)return{KX:ex(0,0,1,7,1,12,5)};const s=`${i[1]}`,r=Array.prototype.reduce.call(atob(i[2]),((t,e)=>t+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");if(!gx(s,r))return{KX:ex(0,0,1,7,1,12,5)};let n=0;const o=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(n))),h=o.subarray(n,n+=20),a=new DataView(o.buffer).getUint16(n,!0);n+=2;const l=Uint8Array.from(Array(a));for(let t=0;ty)return{KX:ex(0,0,1,2,1,3,1,4,5)};const p=u.getUint16(n,!0),x=l.subarray(n+=2,n+p);if(nx=new Uint8Array(x),e&&"dHJhZGVy"in e&&"dGVjaG5pY2FsIGFuYWx5c2lz"===e.dHJhZGVy)return{ej:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="};if(e&&"logoGraphic"in e&&e.logoGraphic){const t=e.logoGraphic.split("-");return 3===t.length&&gx(t[0],t[2])?{ej:t[0]}:{KX:ex(0,0,1,7,1,12,5)}}return{KX:ex(0,0,1,7,1,12,5)}})(0,t);i=s;const r=s.ej;r&&e?("string"==typeof r&&(e.l=r),n=!0):i={KX:ex(0,0,1,7,1,12,5)}}else i={KX:ex(0,0,1,7,1,12,5)}}else{const t=/^(10\.|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168)\./;["localhost","127.0.0.1","::1"].includes(window.location.hostname)||t.test(window.location.hostname)?i={KX:ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68),tj:ex(-2,2)}:window.location.host===tx.atob("c3RhY2tzbmlwcGV0cy5uZXQ=")?(c=!0,u=!1,nx=new Uint8Array([38]),i={}):(c=!0,u=!0,nx=new Uint8Array([38]),i={})}}catch(t){i={KX:ex(0,0,1,7,1,12,5)}}try{a&&(s=tx[ex(-1,34)][ex(-1,35)](ex(-1,39))||void 0)}catch(t){tx.console.error(t)}let d=!1;if(s){const t=s.split("-");if(2===t.length&&gx(t[0],t[1])){const[e,i]=t[0].split(":").map((t=>Number(t)));Date.now()-i<.95*e*1e3&&(d=!0)}}const f=!(c||u||i.KX||n||o||d),g=(()=>{const t=new(tx[ex(-1,0)]);return t.open(ex(0,26),ex(-2,0)),t.setRequestHeader(ex(-1,24),ex(-1,25)),t.withCredentials=!0,t})(),m=new r.Eventer;if(f){let t;try{t=parseInt(ix?ix.split("-")[1]:Math.floor(1e6*Math.random()).toString(),16)}catch(e){t=Math.floor(1e6*Math.random())}const e=Math.floor(1e6*Math.random());l=(t^e).toString();const i={};let s="",r="",n="";ix=ix||"";const o=ex(-4,0);for(let t=0;t{const n=[],o={Gn:t=>{n.indexOf(t)>=0||(n.push(t),a())},Wn:t=>m.on("logoChange",t),Un:t=>m.off(t)},a=()=>{n.forEach((t=>{const e=d(t);if(!e)return;const{hj:i,rj:s}=e,r=s?ex(-2,1):void 0,n=`${ex(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${i}${r?ex(0,1,63,1,64,1,59,1,65,1,41):""}`;px(n,y,!1,r)}))},c=t=>t.toLowerCase().split("_").join(" "),d=t=>{var e;const i=null===(e=Object.entries(ah).find((e=>e[1]===t)))||void 0===e?void 0:e[0];if(i){switch(t){case ah.sf:return sx.tf||sx.sf?void 0:{hj:c(i),rj:!0};case ah.nf:return sx.tf||sx.nf?void 0:{hj:c(i),rj:!0};case ah.af:return sx.tf||sx.if||sx.af?void 0:{hj:c(i)};case ah.if:return sx.tf||sx.if?void 0:{hj:c(i)};case ah.ff:return sx.tf||sx.if||sx.ff?void 0:{hj:c(i)};case ah.pf:return sx.tf||sx.if||sx.pf?void 0:{hj:c(i)};case ah.vf:return sx.tf||sx.if||sx.vf?void 0:{hj:c(i)};case ah.bf:return sx.tf||sx.if||sx.bf?void 0:{hj:c(i)};case ah.Mf:return sx.tf||sx.if||sx.Mf?void 0:{hj:c(i)};case ah.xf:return sx.tf||sx.if||sx.xf?void 0:{hj:c(i)};case ah.uf:return sx.tf||sx.if||sx.uf?void 0:{hj:c(i)};case ah.gf:return sx.tf||sx.if||sx.gf?void 0:{hj:c(i)};case ah.df:return sx.tf||sx.if||sx.df?void 0:{hj:c(i)};case ah.mf:return sx.tf||sx.if||sx.mf?void 0:{hj:c(i)};case ah.Sf:return sx.tf||sx.if||sx.Sf?void 0:{hj:c(i)};case ah.yf:return sx.tf||sx.if||sx.yf?void 0:{hj:c(i)};case ah.lf:return sx.tf||sx.if||sx.lf?void 0:{hj:c(i)};case ah.cf:return sx.tf||sx.if||sx.cf?void 0:{hj:c(i)};case ah.Af:return sx.tf||sx.if||sx.Af?void 0:{hj:c(i)};case ah._f:return sx.tf||sx.if||sx._f?void 0:{hj:c(i)};case ah.tf:case ah.ef:case ah.rf:case ah.hf:return}return be(0,"")}},y=new Ap(r,t,o);(null==i?void 0:i.KX)&&px(i.KX,y,void 0,i.tj);const p=t=>{if("error"===(null==t?void 0:t.type)&&s){const t=s.split("-");if(2===t.length&&gx(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return hx=!1,void xx(g,!1,x)}}if(g.readyState===tx[ex(-1,0)].DONE)if(200===g.status){const t=JSON.parse(g[ex(-1,23)]);if(!gx(l+ex(-3,0),t.h)){const t=ex(0,0,1,27,1,28,1,29,1,30,1,31,5);px(t,y)}tx[ex(-1,34)][ex(-1,36)](ex(-1,39),t.t),tx[ex(-1,34)][ex(-1,36)](ex(-1,33),t.s),hx=!1}else{let e="";try{e=t&&"loadend"!==t.type?ex(0,0,1,23,1,32,1,24,5):JSON.parse(g[ex(-1,23)]).message,xx(g,!1,x)}catch(t){console.error(t)}px(ex(0,0,1,2,1,7,1,12,5)+e,y)}},x=t=>{p(t)};if(xx(g,!0,x),f?setTimeout((()=>{if(hx){let t=!0;if(s){const e=s.split("-");if(2===e.length&&gx(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&px(ex(0,25,1,23,1,32,1,24,5),y)}}),1e4):xx(g,!1,x),u){const t=(()=>{const t=new(tx[ex(-1,0)]);return t.open(ex(0,26),ex(1,0)),t.setRequestHeader("Content-Type","text/plain"),t.withCredentials=!0,t})(),i=Array.from({length:10},(()=>String.fromCharCode(Math.floor(256*Math.random())))).join(""),s=s=>{if("error"===(null==s?void 0:s.type)){const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}if(t.readyState===tx.XMLHttpRequest.DONE){const s=t.getResponseHeader("X-LCJS-SANDBOX-V");if(200!==t.status||s&&"1"!==s){const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}else{const s=JSON.parse(t.responseText);if(!gx(i,s.s)){const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}void 0!==e&&(e.l=s.l),m.emit("logoChange",s.l)}}else{const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}},r=t=>{s(t)};xx(t,!0,r),t.send(i),setTimeout((()=>{if(t.readyState<2){const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}}),1e4)}return h?(t=>{let e;hx=!1;const i=t.ai(),s=()=>{e&&(t.Mn(e.bn()),e=void 0),e=t.II("deployment test"),e.Dr(t.ft).Eh(ex(0,34,1,33)).Ie({x:i.x/2,y:i.y/2}).ba(50).Gh(13).ke(new G({color:E(128,128,128,100)})).va("Arial")._a(500).setMouseInteractions(!1),t.Sn().vn()};t.ko((()=>{s()})),setTimeout(s,0),setInterval((()=>{e&&e.bn(){var r,n,o,h,a,l,u,c,d,f;let g;if(i&&i.license){const t=i.license.split("-");g=t[t.length-1]}const m=(null===(r=null==i?void 0:i.webgl)||void 0===r?void 0:r.version)||(null===(o=null===(n=null==i?void 0:i.sharedContextOptions)||void 0===n?void 0:n.webgl)||void 0===o?void 0:o.version),y={UE:null===(h=null==i?void 0:i.sharedContextOptions)||void 0===h?void 0:h.canvas,$n:null==i?void 0:i.warnings,tz:"webgl1"===m?1:"webgl2"===m?2:void 0,QE:!1!==(null===(a=null==i?void 0:i.sharedContextOptions)||void 0===a?void 0:a.antialias),ZE:(null===(l=null==i?void 0:i.sharedContextOptions)||void 0===l?void 0:l.devicePixelRatio)||void 0,lz:(null===(u=null==i?void 0:i.sharedContextOptions)||void 0===u?void 0:u.noCanvasStyles)||void 0,fz:(null===(c=null==i?void 0:i.sharedContextOptions)||void 0===c?void 0:c.noCanvasTransform)||void 0,KE:!1!==(null===(d=null==i?void 0:i.sharedContextOptions)||void 0===d?void 0:d.useStackingOrder),qE:!1!==(null===(f=null==i?void 0:i.sharedContextOptions)||void 0===f?void 0:f.useIndividualCanvas),uz:g||void 0},p=new mm(y),x=e=>t(e,p);return{Dashboard:ym(x,e,i,s),ChartXY:Sm(x,e,i,s),Spider:Am(x,e,i,s),Polar:vm(x,e,i,s),Pie:bm(x,e,i,s),UIPanel:xm(x,e,i,s),Gauge:Mm(x,e,i,s),Funnel:Em(x,e,i,s),Pyramid:Tm(x,e,i,s),Chart3D:km(x,e,i,s),Map:wm(x,e,i,s),DataGrid:Cm(x,e,i,s),BarChart:Rm(x,e,i,s),ZoomBandChart:Im(x,e,i,s),TreeMapChart:Fm(x,e,i,s),dispose:p.U.bind(p),layout:p.yz.bind(p)}})(h,o.e,n,o.l)},e.onScreenMenuControlBaseHeight=Rs,e.onScreenMenuControlBaseWidth=Is,e.onScreenMenuControlOpacity=Fs,e.onScreenMenuDefaultButtonShape=Ls,e.onScreenMenuSpriteURL=Ds,e.regularColorSteps=(t,e,i,s)=>{if(!i||0===i.length)throw new Error("Invalid use regularColorSteps 'colorPalette' is undefined or empty");const r=null==s?void 0:s.formatLabels,n=null==s?void 0:s.alpha;return i.map(((s,o)=>{const h=t+o/(i.length-1)*(e-t);return{color:void 0!==n?s.setA(n):s,value:h,label:r?r(h):void 0}}))},e.saveToFile=Xh,e.synchronizeAxisIntervals=gt,e.translatePoint=dt,e.translatePoint3D=ft,e.transparentFill=ks,e.transparentLine=Cs,e.uint32ColorFromObject=t=>F(255*t.r,255*t.g,255*t.b,255*t.a),e.uint32ColorFromRGBA=F,e.vec3Utils=De,e.xDimensionStrategy=ch,e.yDimensionStrategy=dh}}]); \ No newline at end of file diff --git a/js/vendor.a2fc4f246becc51c9c1c.bundle.js b/js/vendor.a2fc4f246becc51c9c1c.bundle.js new file mode 100644 index 0000000..0cdcd77 --- /dev/null +++ b/js/vendor.a2fc4f246becc51c9c1c.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see vendor.a2fc4f246becc51c9c1c.bundle.js.LICENSE.txt */ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[502],{243:(t,e,i)=>{i.r(e),i.d(e,{EventError:()=>o,Eventer:()=>u,TokenFactory:()=>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+=1);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,y=e&&e.length,m=y?e[0]*s:t.length,p=i(t,0,m,s,!0),x=[];if(!p||p.next===p.prev)return x;if(y&&(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 A=s;Ah&&(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===T(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)&&(w(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!==m(s.prev,s,s.next))s=s.next;else{if(w(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,y,m=t;t.prev!==t.next;)if(g=t.prev,y=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(y.i/i|0),w(t),t=y.next,m=y.next;else if((t=y)===m){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(m(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,y=s.next;y!==e;){if(y.x>=u&&y.x<=d&&y.y>=c&&y.y<=f&&g(r,h,n,a,o,l,y.x,y.y)&&m(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(m(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,y=ha?h>l?h:l:a>l?a:l,A=u>c?u>f?u:f:c>f?c:f,S=d(y,p,e,i,s),v=d(x,A,e,i,s),b=t.prevZ,M=t.nextZ;b&&b.z>=S&&M&&M.z<=v;){if(b.x>=y&&b.x<=x&&b.y>=p&&b.y<=A&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,M.x>=y&&M.x<=x&&M.y>=p&&M.y<=A&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;b&&b.z>=S;){if(b.x>=y&&b.x<=x&&b.y>=p&&b.y<=A&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;M&&M.z<=v;){if(M.x>=y&&M.x<=x&&M.y>=p&&M.y<=A&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(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),w(r),w(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&&y(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 m(t.prev,t,e.prev)<0&&m(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 y(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)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||p(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(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=S(m(t,e,i)),n=S(m(t,e,s)),o=S(m(i,s,t)),h=S(m(i,s,e));return r!==n&&o!==h||!(0!==r||!A(t,i,e))||!(0!==n||!A(t,s,e))||!(0!==o||!A(i,t,s))||!(0!==h||!A(i,e,s))}function A(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 S(t){return t>0?1:t<0?-1:0}function v(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function b(t,e){var i=new C(t.i,t.x,t.y),s=new C(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 C(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 w(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 C(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 T(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:()=>C,Iterable:()=>Rs,List:()=>ai,Map:()=>ze,OrderedMap:()=>bi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>Hi,Record:()=>ys,Repeat:()=>bs,Seq:()=>Q,Set:()=>Ni,Stack:()=>Ei,default:()=>Es,fromJS:()=>Ms,get:()=>ae,getIn:()=>Wi,has:()=>he,hasIn:()=>Ki,hash:()=>pt,is:()=>ft,isAssociative:()=>w,isCollection:()=>A,isImmutable:()=>P,isIndexed:()=>M,isKeyed:()=>v,isList:()=>hi,isMap:()=>ut,isOrdered:()=>V,isOrderedMap:()=>ct,isOrderedSet:()=>Vi,isPlainObject:()=>re,isRecord:()=>D,isSeq:()=>I,isSet:()=>Li,isStack:()=>Ri,isValueObject:()=>dt,merge:()=>we,mergeDeep:()=>Te,mergeDeepWith:()=>Re,mergeWith:()=>Ce,remove:()=>ue,removeIn:()=>me,set:()=>ce,setIn:()=>ge,update:()=>xe,updateIn:()=>de,version:()=>Ts});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 m(t,e,0)}function y(t,e){return m(t,e,e)}function m(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 A(t){return Boolean(t&&t[x])}var S="@@__IMMUTABLE_KEYED__@@";function v(t){return Boolean(t&&t[S])}var b="@@__IMMUTABLE_INDEXED__@@";function M(t){return Boolean(t&&t[b])}function w(t){return v(t)||M(t)}var C=function(t){return A(t)?t:Q(t)},T=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}(C),R=function(t){function e(t){return M(t)?t:J(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C),E=function(t){function e(t){return A(t)&&!w(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C);C.Keyed=T,C.Indexed=R,C.Set=E;var k="@@__IMMUTABLE_SEQ__@@";function I(t){return Boolean(t&&t[k])}var F="@@__IMMUTABLE_RECORD__@@";function D(t){return Boolean(t&&t[F])}function P(t){return A(t)||D(t)}var L="@@__IMMUTABLE_ORDERED__@@";function V(t){return Boolean(t&&t[L])}var _=0,B=1,z=2,N="function"==typeof Symbol&&Symbol.iterator,O="@@iterator",U=N||O,Y=function(t){this.next=t};function G(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 X(){return{value:void 0,done:!0}}function Z(t){return!!Array.isArray(t)||!!j(t)}function H(t){return t&&"function"==typeof t.next}function W(t){var e=j(t);return e&&e.call(t)}function j(t){var e=t&&(N&&t[N]||t[O]);if("function"==typeof e)return e}Y.prototype.toString=function(){return"[Iterator]"},Y.KEYS=_,Y.VALUES=B,Y.ENTRIES=z,Y.prototype.inspect=Y.prototype.toSource=function(){return this.toString()},Y.prototype[U]=function(){return this};var K=Object.prototype.hasOwnProperty;function $(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 Q=function(t){function e(t){return null==t?nt():P(t)?t.toSeq():function(t){var e,i,s=at(t);if(s)return(i=j(e=t))&&i===e.entries?s.fromEntrySeq():function(t){var e=j(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 Y((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return G(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(C),q=function(t){function e(t){return null==t?nt().toKeyedSeq():A(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}(Q),J=function(t){function e(t){return null==t?nt():A(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}(Q),tt=function(t){function e(t){return(A(t)&&!w(t)?t:J(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}(Q);Q.isSeq=I,Q.Keyed=q,Q.Set=tt,Q.Indexed=J,Q.prototype[k]=!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 Y((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return G(t,n,i[n])}))},e}(J),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 K.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 Y((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return G(t,o,i[o])}))},e}(q);it.prototype[L]=!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=W(this._collection),s=0;if(H(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=W(this._collection);if(!H(i))return new Y(X);var s=0;return new Y((function(){var e=i.next();return e.done?e:G(t,s++,e.value)}))},e}(J);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 $(t)?new et(t):Z(t)?new rt(t):void 0}var lt="@@__IMMUTABLE_MAP__@@";function ut(t){return Boolean(t&&t[lt])}function ct(t){return ut(t)&&V(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 yt(t){return t>>>1&1073741824|3221225471&t}var mt=Object.prototype.valueOf;function pt(t){if(null==t)return xt(t);if("function"==typeof t.hashCode)return yt(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==mt&&"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 yt(e)}(r);case"string":return r.length>Et?(void 0===(s=Ft[i=r])&&(s=At(i),It===kt&&(It=0,Ft={}),It++,Ft[i]=s),s):At(r);case"object":case"function":return function(t){var e;if(wt&&void 0!==(e=Mt.get(t)))return e;if(void 0!==(e=t[Rt]))return e;if(!vt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Rt]))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(),wt)Mt.set(t,e);else{if(void 0!==St&&!1===St(t))throw new Error("Non-extensible objects are not allowed as keys.");if(vt)Object.defineProperty(t,Rt,{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[Rt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Rt]=e}}return e}(r);case"symbol":return function(t){var e=Ct[t];return void 0!==e||(e=bt(),Ct[t]=e),e}(r);default:if("function"==typeof r.toString)return At(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function xt(t){return null===t?1108378658:1108378659}function At(t){for(var e=0,i=0;i=0&&(a.get=function(e,i){return(e=c(this,e))>=0&&en)return{value:void 0,done:!0};var t=r.next();return s||e===B||t.done?t:G(e,a-1,e===_?void 0:t.value[1],t)}))},a}function Ut(t,e,i,s){var r=$t(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 Y((function(){var t,n,u;do{if((t=h.next()).done)return s||r===B?t:G(r,l++,r===_?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:G(r,n,u,t)}))},r}function Yt(t,e,i){var s=$t(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 Ht(t,e,i,s){var r=$t(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=C(t),W(r?t.reverse():t)})),o=0,h=!1;return new Y((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}:G(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function Wt(t,e){return t===e?t:I(t)?e:t.constructor(e)}function jt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Kt(t){return v(t)?T:M(t)?R:E}function $t(t){return Object.create((v(t)?q:M(t)?J:tt).prototype)}function Qt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Q.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 ke(t,e)}function Ce(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return ke(e,i,t)}function Te(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Ee(t,e)}function Re(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Ee(e,i,t)}function Ee(t,e,i){return ke(t,e,function(t){return function e(i,s,r){return ne(i)&&ne(s)&&(n=s,o=Q(i),h=Q(n),M(o)===M(h)&&v(o)===v(h))?ke(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function ke(t,e,i){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(P(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?R:T,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=K.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 Ee(this,e,t)}function De(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,$e(),(function(t){return ke(t,e)}))}function Pe(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,$e(),(function(t){return Ee(t,e)}))}function Le(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Ve(){return this.__ownerID?this:this.__ensureOwner(new l)}function _e(){return this.__ensureOwner()}function Be(){return this.__altered}var ze=function(t){function e(e){return null==e?$e():ut(e)&&!V(e)?e:$e().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 $e().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 Qe(this,t,e)},e.prototype.remove=function(t){return Qe(this,t,h)},e.prototype.deleteAll=function(t){var e=C(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):$e()},e.prototype.sort=function(t){return bi(Gt(this,t))},e.prototype.sortBy=function(t,e){return bi(Gt(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 He(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?Ke(this.size,this._root,t,this.__hash):0===this.size?$e():(this.__ownerID=t,this.__altered=!1,this)},e}(T);ze.isMap=ut;var Ne=ze.prototype;Ne[lt]=!0,Ne[s]=Ne.remove,Ne.removeAll=Ne.deleteAll,Ne.setIn=ye,Ne.removeIn=Ne.deleteIn=pe,Ne.update=Ae,Ne.updateIn=Se,Ne.merge=Ne.concat=ve,Ne.mergeWith=be,Ne.mergeDeep=Ie,Ne.mergeDeepWith=Fe,Ne.mergeIn=De,Ne.mergeDeepIn=Pe,Ne.withMutations=Le,Ne.wasAltered=Be,Ne.asImmutable=_e,Ne["@@transducer/init"]=Ne.asMutable=Ve,Ne["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ne["@@transducer/result"]=function(t){return t.asImmutable()};var Oe=function(t,e){this.ownerID=t,this.entries=e};Oe.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 Xe(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},Ue.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 Ye(t,o+1,h)}(t,m,f,c,x);if(g&&!x&&2===m.length&&Je(m[1^y]))return m[1^y];if(g&&x&&1===m.length&&Je(x))return x;var A=t&&t===this.ownerID,S=g?x?f:f^d:f|d,v=g?x?ii(m,y,x,A):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},Ye.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 y=this.count;if(f){if(!g&&--y>>i)&o,l=(0===i?s:s>>>i)&o,u=a===l?[ti(t,e,i+r,s,n)]:(h=new Xe(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:Jt(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=yi();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?Ai(t,e).set(0,i):Ai(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=Si(t._capacity)?s=mi(s,t.__ownerID,0,e,i,n):r=mi(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):yi()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){Ai(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=Si(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=mi(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>=Si(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&o],s-=r;return i}}function Ai(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=Si(h),y=Si(u);y>=1<g?new ui([],s):m;if(m&&y>g&&ar;A-=r){var S=g>>>A&o;x=x.array[S]=pi(x.array[S],s)}x.array[g>>>r&o]=m}if(u=y)a-=y,u-=y,c=r,d=null,p=p&&p.removeBefore(s,0,a);else if(a>n||y>>c&o;if(v!==y>>>c&o)break;v&&(f+=(1<n&&(d=d.removeBefore(s,c,a-f)),d&&y>>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[L]=!0,bi.prototype[s]=bi.prototype.remove;var Ti="@@__IMMUTABLE_STACK__@@";function Ri(t){return Boolean(t&&t[Ti])}var Ei=function(t){function e(t){return null==t?Di():Ri(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&&Ri(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(y(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 Y((function(){if(s){var e=s.value;return s=s.next,G(t,i++,e)}return{value:void 0,done:!0}}))},e}(R);Ei.isStack=Ri;var ki,Ii=Ei.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 ki||(ki=Fi(0))}Ii[Ti]=!0,Ii.shift=Ii.pop,Ii.unshift=Ii.push,Ii.unshiftAll=Ii.pushAll,Ii.withMutations=Le,Ii.wasAltered=Be,Ii.asImmutable=_e,Ii["@@transducer/init"]=Ii.asMutable=Ve,Ii["@@transducer/step"]=function(t,e){return t.unshift(e)},Ii["@@transducer/result"]=function(t){return t.asImmutable()};var Pi="@@__IMMUTABLE_SET__@@";function Li(t){return Boolean(t&&t[Pi])}function Vi(t){return Li(t)&&V(t)}function _i(t,e){if(t===e)return!0;if(!A(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)||V(t)!==V(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!w(t);if(V(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(!A(t)){if(!ne(t))return t;t=Q(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?Xi():Li(e)&&!V(e)?e:Xi().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(T(t).keySeq())},e.intersect=function(t){return(t=C(t).toArray()).length?Ui.intersect.apply(e(t.pop()),t):Xi()},e.union=function(t){return(t=C(t).toArray()).length?Ui.union.apply(e(t.pop()),t):Xi()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Yi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Yi(this,this._map.remove(t))},e.prototype.clear=function(){return Yi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Yi(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=yt((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 Qi=C.prototype;Qi[x]=!0,Qi[U]=Qi.values,Qi.toJSON=Qi.toArray,Qi.__toStringMapper=oe,Qi.inspect=Qi.toSource=function(){return this.toString()},Qi.chain=Qi.flatMap,Qi.contains=Qi.includes,Bi(T,{flip:function(){return Wt(this,_t(this))},mapEntries:function(t,e){var i=this,s=0;return Wt(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return Wt(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var qi=T.prototype;qi[S]=!0,qi[U]=Qi.entries,qi.toJSON=$i,qi.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Bi(R,{toKeyedSeq:function(){return new Dt(this,!1)},filter:function(t,e){return Wt(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 Wt(this,zt(this,!1))},slice:function(t,e){return Wt(this,Ot(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 Wt(this,1===i?s:s.concat(Jt(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 Wt(this,Yt(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=Qi.includes,ts.contains=ts.includes,ts.keys=ts.values,Bi(q,qi),Bi(J,Ji),Bi(tt,ts);var ls=function(t){function e(t){return null==t?fs():Vi(t)?t:fs().withMutations((function(e){var i=E(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(T(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Ni);ls.isOrderedSet=Vi;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(wi()))}cs[L]=!0,cs.zip=Ji.zip,cs.zipWith=Ji.zipWith,cs.zipAll=Ji.zipAll,cs.__empty=fs,cs.__make=ds;var gs={LeftThenRight:-1,RightThenLeft:1},ys=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(P(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 ws(t,e,i,s,r,n){if("string"!=typeof i&&!P(i)&&($(i)||Z(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,Q(i).map((function(s,n){return ws(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function Cs(t,e){return M(e)?e.toList():v(e)?e.toMap():e.toSet()}var Ts="4.3.7",Rs=C;const Es={version:Ts,Collection:C,Iterable:C,Seq:Q,Map:ze,OrderedMap:bi,List:ai,Stack:Ei,Set:Ni,OrderedSet:ls,PairSorting:gs,Record:ys,Range:Hi,Repeat:bs,is:ft,fromJS:Ms,hash:pt,isImmutable:P,isCollection:A,isKeyed:v,isIndexed:M,isAssociative:w,isOrdered:V,isValueObject:dt,isPlainObject:re,isSeq:I,isList:hi,isMap:ut,isOrderedMap:ct,isStack:Ri,isSet:Li,isOrderedSet:Vi,isRecord:D,get:ae,getIn:Wi,has:he,hasIn:Ki,merge:we,mergeDeep:Te,mergeWith:Ce,mergeDeepWith:Re,remove:ue,removeIn:me,set:ce,setIn:ge,update:xe,updateIn:de}},377:(t,e,i)=>{Object.defineProperty(e,"o",{value:!0});var s=i(568),r=i(243),n=i(570),o=function(t){if(t&&t.o)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.u=!0}S(){return this.u}}class l extends a{constructor(t,e){super(),this.M=t,this.u=e}_(t){return t!==this.M&&(this.M=t,this.u=!0),this}C(){return this.M}S(){return super.S()}}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]},y=(t,e)=>({min:t,max:e}),m=(t,e,i,s)=>({x:t,y:e,width:i,height: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}),A=x,S=(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.T||(this.T=I(this.getR(),this.getG(),this.getB(),this.getA())),this.T}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.F||(this.F=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.F}getLighter(){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}getDarker(){return this.P||(this.P=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.P}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),w=(t,e,i,s=255)=>new b({r:t/255,g:e/255,b:i/255,a:s/255}),C=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}`)}},T=(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})},R={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"},E=new b({}),k=w(0,0,0,0),I=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,F=(t,e)=>t.value-e.value,D=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:w(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1}),P=t=>{const{steps:e}=t,i=e.length;e.sort(F);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 L extends D{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,P(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(P({...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 V=s.Record({type:"fillstyle",fillType:"empty"});class _ extends V{toString(){return"emptyFill"}}const B=new _,z=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),N=s.Record({type:"fillstyle",fillType:"solid",color:w(255,255,255)});class O extends N{}class U 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 G 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),Z=s.Record({type:"fillstyle",fillType:"palette",lut:new L({steps:[]}),lookUpProperty:"value"}),H=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),W={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=se(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.L)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.V=n,this.eases=t.map((([t,e])=>s(t,e,i)))}O(){this.R.emit("start")}start(){return this.V.includes(this)||this.V.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 j(t,e,i,s,this.V);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.R.on("start",t,e)}onAnimationEnd(t,e){return this.R.on("end",t,e)}onEveryAnimationEnd(t,e){return this.R.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.R.on("allEnd",t,e)}allOffAnimationEnd(){return this.R.topicOff("end"),this}allOffEveryAnimationEnd(){return this.R.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.R.topicOff("allEnd"),this}offAnimationEnd(t){return this.R.off(t,"end")}offEveryAnimationEnd(t){return this.R.off(t,"everyEnd")}offAllAnimationEnd(t){return this.R.off(t,"allEnd")}finish(t=!0){if(this.L=!0,this.V.splice(this.V.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.R.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.R.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.R.emit("end",e),this.R.emit("everyEnd",e)),e}t&&(this.R.emit("end",void 0),this.R.emit("everyEnd",void 0),this.R.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(Rt):this.values.map(Rt)}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.O(),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=wt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=W.linear)=>(r,n,h=t)=>{const a=new j(r,n,h,e,i).start();return s||(s=wt.requestAnimationFrame(o)),a}};var $,Q;e.GradientShape=void 0,($=e.GradientShape||(e.GradientShape={})).circle="circle",$.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:C("#f00"),offset:0},{color:C("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class J 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 tt=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),et=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:C("#f00"),offset:0},{color:C("#0f0"),offset:1}],angle:0});class it extends et{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?function(t){return 180*t/Math.PI}(t):t)}getAngle(t){return t?xi(this.get("angle")):this.get("angle")}}const st=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),rt=s.Record({type:"linestyle",lineType:"empty"}),nt=new class extends rt{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}N(){return 0}setFillStyle(t){return this}getFillStyle(){return B}},ot=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class ht{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new at,this.y=new at,this.z=new at,this.R=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(He,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(He,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.U(e),s.y.U(r)}}}Y(){return this.W&&(this.W(),this.W=void 0),this}H(t){return this.R.on("cell-resize",t)}$(t){return this.R.off(t,"cell-resize")}}class at extends a{constructor(){super(...arguments),this.X=0,this.j=10,this.Z=1}J(){return this.u=!1,this}K(){return this.u=!0,this}getInnerStart(){return this.X}getInnerEnd(){return this.j}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}q(t,e){return this.X=t,this.j=e,this.tt(),this}it(t){return this.Z=t,this.tt(),this}st(t){return t/this.Z}tt(){const t=this.st(this.j-this.X),e=this.Z;void 0!==this.et&&!1!==It(t,this.et)||(this.u=!0,this.ht=e,this.et=t)}rt(){return this.et}nt(){return this.ht}ot(){return this.jnew t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).ct({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new ht({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},ut=(t,e,i)=>e===i?t:i.dt(e.ft(t)),ct=(t,e,i)=>{if(e===i)return t;const s=e instanceof _i?e.x:e.x instanceof _i?e.x.x:e.x.At,r=e instanceof _i?e.y:e.y instanceof _i?e.y.y:e.y.At,n=i instanceof _i?i.x:i.x instanceof _i?i.x.x:i.x.At,o=i instanceof _i?i.y:i.y instanceof _i?i.y.y:i.y.At;return{...t,x:ut(t.x,s,n),y:ut(t.y,r,o)}},dt=(...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.yt(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])}))}}},ft=t=>t&&"object"==typeof t&&"column"in t&&"row"in t,gt=t=>t&&"object"==typeof t&&"z"in t&&"column"in t&&"row"in t,yt=t=>t&&"object"==typeof t&&"annulus"in t&&"sector"in t,mt=t=>t&&"object"==typeof t&&"index"in t;class pt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,pt.prototype)}}class xt extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&wt.alert(s),Object.setPrototypeOf(this,xt.prototype)}}class At extends xt{constructor(t){super(t),Object.setPrototypeOf(this,At.prototype)}}var St,vt,bt,Mt;e.UISpace=void 0,(St=e.UISpace||(e.UISpace={}))[St.Content=0]="Content",St[St.PaddedContent=1]="PaddedContent",St[St.PaddedBackground=2]="PaddedBackground",St[St.Everything=3]="Everything",e.UIVisibilityModes=void 0,(vt=e.UIVisibilityModes||(e.UIVisibilityModes={}))[vt.never=0]="never",vt[vt.always=1]="always",vt[vt.whenHovered=2]="whenHovered",vt[vt.whenDragged=3]="whenDragged",vt[vt.whenNotDragged=4]="whenNotDragged",vt[vt.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(bt=e.UIDraggingModes||(e.UIDraggingModes={}))[bt.notDraggable=0]="notDraggable",bt[bt.draggable=1]="draggable",bt[bt.onlyHorizontal=2]="onlyHorizontal",bt[bt.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(Mt=e.UIDirections||(e.UIDirections={}))[Mt.Up=0]="Up",Mt[Mt.Right=1]="Right",Mt[Mt.Down=2]="Down",Mt[Mt.Left=3]="Left";const wt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},Ct=(t,e)=>t.x===e.x&&t.y===e.y,Tt=t=>t!==Be&&t!==ze&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Rt=t=>t[1],Et=t=>t.dispose(),kt=()=>{},It=(t,e)=>t===e,Ft=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Dt=t=>Array.prototype.concat.apply([],t),Pt=(t,e)=>void 0===t||Number.isNaN(t)?e:t,Lt=t=>t.vt(),Vt=t=>t.St(),_t=t=>t.xt(),Bt=t=>t.bt(),zt=t=>t.min.x,Nt=t=>t.max.x,Ot=t=>t.min.y,Ut=t=>t.max.y,Yt=(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,Xt=u(0,1),Zt=u(1,0),Ht=u(0,-1),Wt=u(-1,0),jt=u(0,0),Kt=t=>{switch(t){case e.UIDirections.Up:return Xt;case e.UIDirections.Right:return Zt;case e.UIDirections.Down:return Ht;case e.UIDirections.Left:return Wt;default:return jt}},$t=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Qt=t=>{t.stopPropagation(),t.preventDefault()},qt=(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,s=new i(2*e);let r=0;for(let i=0;i{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)},ie=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},re=se(Math.E),ne=(t,e)=>{const i=e[t];return i?i():void 0},oe=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;iAi(ci(t,i))-Ai(ci(e,i))))},he=(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:w(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())),le=t=>255===t.getA()?t:t.setA(255),ue=(()=>{const t=w(0,0,0);return i=>(i=le(i),new J({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:ae(i,t,.5)}]}))})(),ce=(()=>{const t=t=>{var e;if(t){if(Y(t)){if(0===t.getColor().getA())return;return t.getColor()}if(tt(t)||st(t)){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}H(t)}};return(e,i,s,r)=>{var n;const o=[];if(r.fill&&o.push(r.fill),r.fill2&&o.push(r.fill2),r.stroke){const t=r.stroke.getFillStyle();t!==B&&("stroke"===(null===(n=r.behavior)||void 0===n?void 0:n.priority)?o.unshift(t):o.push(t))}if(r.point3D){const t=r.point3D;o.push(t.getFillStyle())}let h;if(r.behavior&&!0===r.behavior.colorStep){const[e,s]=o.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]);h=e&&s?(a=e)===(l=s)||a.getR()===l.getR()&&a.getG()===l.getG()&&a.getB()===l.getB()?ue(a):(a=le(a),l=le(l),new it({angle:0,stops:[{offset:0,color:l},{offset:.5,color:l},{offset:.5,color:a},{offset:1,color:a}]})):i.uiButtonFillStyle}else{const e=o.reduce(((e,i)=>e||t(i)),void 0);h=e?s?new U({color:e}):ue(e):i.uiButtonFillStyle}var a,l;e.setButtonOnFillStyle(h)}})(),de=t=>{const e=t;if(H(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},fe=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},ge=(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,me=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),pe=(t,e)=>e(),xe=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new U({color:w(255,255,255,1)});const Ae=t=>t===Ne||t.min.x===Ne.min.x&&t.max.x===Ne.max.x&&t.min.y===Ne.min.y&&t.max.y===Ne.max.y,Se=t=>Array.from(new Set(t)),ve=t=>t.filter((t=>void 0!==t)),be=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,Me=(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))))))},we=(t,e)=>{throw new Error(e)},Ce=t=>{let e;return()=>e||(e=t(),e)},Te=t=>{if(t===nt)return 0;const e=t.getThickness();return e<0?1:1*e},Re=(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 wt.alert(r),new Error(r);wt.console.warn(r)},Ee=(t,e,i,s=0)=>{if(t{const t=new Map;return{Mt:e=>(e.setMouseEnterEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n._t(e,i,s,r)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.wt(e,i,s)})),e.setMouseClickEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Ct(e,i,s,r)})),e.setMouseDoubleClickEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.kt(e,i,s,r)})),e.setMouseDownEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Tt(e,i,s,r)})),e.setMouseUpEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Ft(e,i,s,r)})),e.setMouseMoveEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.It(e,i,s,r)})),e.setMouseDragEventHandler(((e,i,s,r,n,o,h)=>{const a=o&&t.get(o);a&&a.Pt(e,i,s,r,n,o,h)})),e.setMouseDragStartEventHandler(((e,i,s,r,n)=>{const o=r&&t.get(r);o&&o.Dt(e,i,s,r,n)})),e.setMouseDragStopEventHandler(((e,i,s,r,n,o)=>{const h=n&&t.get(n);h&&h.Bt(e,i,s,r,n,o)})),e.setMouseWheelEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Lt(e,i,s,r)})),e.setTouchStartEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Rt(e,i,s,r)})),e.setTouchMoveEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Et(e,i,s,r)})),e.setTouchEndEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.zt(e,i,s,r)})),e),Vt:(e,i)=>{t.set(e,i)},Ot:()=>{t.clear()}}},Ie={left:0,right:0,top:0,bottom:0},Fe=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),De=(t,e,i)=>{e&&e.Nt();const s=i();return{Gt:t,Nt:()=>{s.forEach((e=>t.Wt(e)))}}},Pe=(t,e,i)=>{let s;const r=()=>(s=i(),s),n={...t,resolve:()=>s||r()};for(const t of Object.keys(e))Object.defineProperty(n,t,{get:function(){return s?s[t]:r()[t]}});return n},Le=t=>{if(t)return"resolve"in t?t.resolve():t},Ve=t=>{let e=t;return{Ut:t=>{const i=e;return e=i+t,[i,t]}}},_e={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=>_e.divide(t,_e.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(_e.dot(t,e)/(_e.length(t)*_e.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=_e.dot(e,t),o=_e.cross(e,t);return _e.addVec(_e.multiply(t,s),_e.addVec(_e.multiply(e,(1-s)*n),_e.multiply(o,r)))},lerp:(t,e,i)=>(i=Ft(i,0,1),_e.addVec(_e.multiply(t,1-i),_e.multiply(e,i))),equals:(t,e)=>It(t.x,e.x)&&It(t.y,e.y)&&It(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)})},Be=Number.MAX_SAFE_INTEGER,ze=-Number.MAX_SAFE_INTEGER,Ne=y(u(Be,Be),u(ze,ze)),Oe=y(f(Be,Be,Be),f(ze,ze,ze)),Ue=(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))},Ye=(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),Xe=(t,e)=>({min:{x:Math.min(t[0].x,e[0].x),y:Math.min(t[0].y,e[0].y)},max:{x:Math.max(t[2].x,e[2].x),y:Math.max(t[2].y,e[2].y)}}),Ze=t=>{const e=t.length;for(let i=0;ie+t,We=(t,e,i)=>{const s=ci(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=ci(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)},je=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,Ke=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},$e=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},Qe=(t,e,i)=>ui(t,li(ci(e,t),i)),qe=(t,e,i)=>_e.addVec(t,_e.multiply(_e.subtractVec(e,t),i));function Je(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:Be,y:Be},max:{x:ze,y:ze}};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},ii=(t,e)=>y(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 si(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 ri(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 ni(t,e){return u(t.x-e.x,t.y-e.y)}function oi(t){const e=ai(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function hi(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=oi(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 ai(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function li(t,e){return u(t.x*e,t.y*e)}function ui(t,e){return u(t.x+e.x,t.y+e.y)}function ci(t,e){return u(t.x-e.x,t.y-e.y)}function di(t,e){return u(t.x*e.x,t.y*e.y)}function fi(t,e){return u(t.x/e.x,t.y/e.y)}function gi(t){return li(t,-1)}function yi(t,e){return t.x*e.x+t.y*e.y}const mi=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},pi=(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 xi(t){return t*Math.PI/180}function Ai(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function Si(t){return u(Math.cos(t),Math.sin(t))}const vi=(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)},bi=(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 Mi{constructor(){this.Yt=!0}getInnerStart(){return this.X}getInnerEnd(){return this.j}getInnerInterval(){return Math.abs(this.j-this.X)}q(t,e){return this.Yt=t!==this.X||e!==this.j,this.X=t,this.j=e,this}J(){return this.Yt=!1,this}K(){return this.Yt=!0,this}}class wi extends Mi{constructor(t,e,i,s){if(super(),this.Ht=!0,this.$t=!0,this.Xt=[0,0],this.jt=!0,this.Zt=t,this.Qt=e,this.Jt=i,this.Kt=t,this.qt=e,s){const t=s.G(this.ti.bind(this));this.ti(s.C()),this.ii=()=>s.U(t)}}it(t){return this.Z=t,this.$t=!0,this}si(t){return this.Xt=t.map(Math.abs),this.jt=!0,this}ei(){return this.Zt/this.Jt*this.Z+this.Xt[0]}hi(){return(this.Zt+this.Qt)/this.Jt*this.Z-this.Xt[1]}ri(){return this.getCellSize()-this.ni()}oi(){return this.Z}getCellSize(){return this.ai(this.Z)}ni(){return this.Xt[0]+this.Xt[1]}li(){return this.Xt}ti(t){this.Jt=t.reduce(He,0),this.Zt=t.reduce(((t,e,i)=>i>=this.Kt?t:t+e),0),this.Qt=t.reduce(((t,e,i)=>i>=this.Kt&&iki;return!n&&!o||!!r&&(e>t?{start:n?Ei:t,end:o?ki:e}:{start:o?ki:t,end:n?Ei:e})}ft(t){const e=this.ei(),i=this.hi(),s=Math.max(t,Ei);return e+(this.ci.function(s)-this.di.scaleStartLog)/this.di.scaleIntervalLog*(i-e)}dt(t){const e=this.ei(),i=(t-e)/(this.hi()-e),s=this.di.scaleStartLog+i*this.di.scaleIntervalLog;return this.ci.number**s}ui(){this.ci&&this.fi()}q(t,e){return super.q(t,e),this.ci&&this.fi(),this}si(t){return super.si(t),this.ci&&this.fi(),this}it(t){return super.it(t),this.ci&&this.fi(),this}Ai(t){return this.ci={internal:t,function:Ti(t),number:Ri(t)},this}gi(){return this.ci.internal}pi(t,e){const i=this.ft(t)+e;return this.dt(i)}yi(){return this.$t||this.Yt||this.jt||this.Ht}fi(){const t=this.ci.function(this.X),e=this.ci.function(this.j)-t,i=2*this.ei()/this.Z-1,s=2*this.hi()/this.Z-1-i;return this.di={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.di}mi(){return this.di}}const Ti=t=>"e"===t?re:se(t),Ri=t=>"e"===t?Math.E:t,Ei=.9*10**-4,ki=1.1*10**25,Ii=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],Fi=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Ue(s,10),0);return t.toFixed(r)},Di={Numeric:(t,e)=>Fi(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 Ii){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=Ue(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-Ue(i,10)):"")}return r+=n,r},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const r=Ti(s)(t);return`${s}${Pi(r)}`},LogarithmicExponents:(t,e,i,s=10)=>{const r=Ti(s),n=Math.floor(r(t)),o=t/Ri(s)**n;return`${Math.round(o)}×${s}${Pi(n)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const r=Ti(s),n=Math.floor(r(t));return`${(t/Ri(s)**n).toFixed(2)}×${s}${Pi(n)}`},LogarithmicNoExponents:(t,e,i,s=10)=>{const r=Ti(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))},Scientific:(t,e)=>{const i=Math.max(Math.abs(e.getInnerStart()),Math.abs(e.getInnerEnd())),s=Math.floor(Math.log10(i));return 0===t?`0.00e${s<0?"":"+"}${s}`:t.toExponential(2)}},Pi=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 Li extends wi{constructor(t,e,i,s){super(t,e,i,s),this.vi=!1,this.Si=!1,this.xi=0,this.Z=1e3,this.q(0,10),this.tt()}yi(){return this.Si}ut(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(eze&&tze){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}}ui(){this.tt()}ft(t){return this.ei()+(t-this.X)/(this.j-this.X)*(this.hi()-this.ei())}dt(t){return this.X+(t-this.ei())/(this.hi()-this.ei())*(this.j-this.X)}q(t,e){return super.q(t,e),this.tt(),this}si(t){return super.si(t),this.tt(),this}it(t){return super.it(t),this.bi=Vi(this.j-this.X,this.Xt,this.Z,this.Qt,this.Jt),this.tt(),this}Mi(){return this.vi=!0,this}_i(){return this.vi}wi(){return Math.abs(this.Ci)}ki(){return this.wi()/this.bi}Ti(){return this.Fi}Ii(){return this.Pi}getPixelSize(){return this.bi}mi(){return this.di}K(){return super.K(),this.Si=!0,this}J(){return super.J(),this.Si=!1,this}Di(t,e=Di.Numeric){return e(t,this)}Bi(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}Li(t){return Vi(t,this.Xt,this.Z,this.Qt,this.Jt)}tt(){let t=this.X,e=this.j,i=0;this.vi&&(t=0,e=this.j-this.X,i=this.X);const s=e-t,r=Vi(s,this.Xt,this.Z,this.Qt,this.Jt);this.Pi=t-this.Xt[0]*r,this.Fi=e+this.Xt[1]*r;const n=this.Fi-this.Pi,o=n-this.Ci,h=Math.abs(o/r),a=s-this.xi,l=Math.abs(a/r);(!this.di||h>=.4||l>=.4)&&(this.xi=s,this.Ci=n,this.bi=r,this.Si=!0);const u=this.Ci*this.Jt/(2*this.Qt),c=-(this.Pi-this.Ci*this.Zt/this.Qt)-u,d=2*this.ei()/this.Z-1,f=2*this.hi()/this.Z-1-d;this.di={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}pi(t,e){return t+this.bi*e}}const Vi=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class _i{Ri(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}J(){return this.x.J(),this.y.J(),this}K(){return this.x.K(),this.y.K(),this}it(t,e){return"object"==typeof t?(this.x.it(t.x),this.y.it(t.y)):(this.x.it(t),this.y.it(e)),this}oi(){return u(this.x.oi(),this.y.oi())}Ei(t){return this.x.si(t),this}zi(t){return this.y.si(t),this}ni(){return u(this.x.ni(),this.y.ni())}Vi(t,e){return this.x.q(t,e),this}Oi(t,e){return this.y.q(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.ni(),y:e-this.y.ni()}}Ni(){return this.x.yi()||this.y.yi()}}class Bi extends _i{constructor(){super(...arguments),this.Gi="LinearScaleXY"}ct(t,e,i,s){return this.x=new Li(t.x,e.x,i.x,s?s.x:void 0),this.y=new Li(t.y,e.y,i.y,s?s.y:void 0),this}_i(){return this.x._i()||this.y._i()}Wi(){return u(this.x.getPixelSize(),this.y.getPixelSize())}mi(){return{x:this.x.mi(),y:this.y.mi()}}pi(t,e){const i=this.Wi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Ui(t,e,i,s){const r=this.Wi(),n=hi(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 zi extends _i{constructor(){super(...arguments),this.Gi="MixedScaleXY"}_i(){return!1}pi(t,e){const i=this.x.ft(t.x),s=this.y.ft(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.dt(r.x),y:this.y.dt(r.y)}}Ui(t,e,i,s){const r={x:this.x.ft(t.x),y:this.y.ft(t.y)},n={x:this.x.ft(e.x),y:this.y.ft(e.y)},o=oi(ci(n,r)),h=hi(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.dt(a.x),y:this.y.dt(a.y)}}mi(){const t=this.x.mi(),e=this.y.mi();return{uScaleStart:[this.x.X,this.y.X],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 Ni=(t,e)=>t instanceof Ci||e instanceof Ci?(new zi).Ri(t,e):(new Bi).Ri(t,e),Oi=t=>"client"===t,Ui=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),Yi=t=>"relative"===t,Gi=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y);var Xi;e.HighlightModes=void 0,(Xi=e.HighlightModes||(e.HighlightModes={}))[Xi.noHighlighting=0]="noHighlighting",Xi[Xi.onHover=1]="onHover";class Zi{constructor(t,i,s,n){this.Yi=!0,this.Hi=e.HighlightModes.onHover,this.$i=!1,this.Xi=!0,this.R=new r.Eventer,this.ji=[],this.Zi=[],this.onMouseEnter=t=>this.R.on("mouseEnter",t),this.onMouseLeave=t=>this.R.on("mouseLeave",t),this.onMouseClick=t=>this.R.on("mouseClick",t),this.onMouseDoubleClick=t=>this.R.on("mouseDoubleClick",t),this.onMouseDown=t=>this.R.on("mouseDown",t),this.onMouseUp=t=>this.R.on("mouseUp",t),this.onMouseMove=t=>this.R.on("mouseMove",t),this.offMouseEnter=t=>this.R.off(t,"mouseEnter"),this.offMouseLeave=t=>this.R.off(t,"mouseLeave"),this.offMouseClick=t=>this.R.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.R.off(t,"mouseDown"),this.offMouseUp=t=>this.R.off(t,"mouseUp"),this.offMouseMove=t=>this.R.off(t,"mouseMove"),this.offMouseDragStart=t=>this.R.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.R.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.R.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.R.off(t,"mouseWheel"),this._t=(t,i,s,r)=>{const n=this.Qi(r,i);this.R.emit("mouseEnter",this,i,n),this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.wt=(t,i,s)=>{this.R.emit("mouseLeave",this,i,void 0),this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.It=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseMove",this,e,r)},this.Ct=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseClick",this,e,r)},this.kt=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseDoubleClick",this,e,r)},this.Tt=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseDown",this,e,r)},this.Ft=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseUp",this,e,r)},this.Dt=(t,e,i,s,r)=>{const n=this.Qi(r,e);this.R.emit("mouseDragStart",this,e,i,n)},this.Pt=(t,e,i,s,r,n,o)=>{const h=this.Qi(o,e);this.R.emit("mouseDrag",this,e,i,s,r,h)},this.Bt=(t,e,i,s,r,n)=>{const o=this.Qi(n,e);this.R.emit("mouseDragStop",this,e,i,s,o)},this.Lt=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseWheel",this,e,r)},this.Rt=(t,i,s,r)=>{const n=this.Qi(r,i);this.R.emit("touchStart",this,i,n),this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Et=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("touchMove",this,e,r)},this.zt=(t,i,s,r)=>{const n=this.Qi(r,i);this.R.emit("touchEnd",this,i,n),this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.chart=t,this.Ji=i,this.Ki=s,this.qi=new Map,this.ts=n,this.ss=this.ts.es(this,{hs:{themeEffectEnabled:this.Ki.effectsText},rs:{}}),this.chart.ls.os.ns(this,(t=>{this.qi.forEach(((e,i)=>i.us(t))),this.Zi.forEach((e=>e.setHighlight(t))),this.ji.forEach((e=>e.us(t)))}),{animationEnabled:this.chart.getAnimationsEnabled()})}cs(){}ds(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.qi.set(t,{isText:s});const r=Array.from(this.qi);this.ss.hs.fs(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.ss.rs.fs(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Yi).setVisible(this.Xi).us(this.chart.ls.os.As(this,!0)),i&&t.setMouseEnterEventHandler(this._t).setMouseLeaveEventHandler(this.wt).setMouseClickEventHandler(this.Ct).setMouseDoubleClickEventHandler(this.kt).setMouseDownEventHandler(this.Tt).setMouseUpEventHandler(this.Ft).setMouseMoveEventHandler(this.It).setMouseDragStartEventHandler(this.Dt).setMouseDragEventHandler(this.Pt).setMouseDragStopEventHandler(this.Bt).setMouseWheelEventHandler(this.Lt).setTouchStartEventHandler(this.Rt).setTouchMoveEventHandler(this.Et).setTouchEndEventHandler(this.zt);const n=t.onDispose((()=>{t.offDispose(n),this.qi.delete(t)}))}gs(t){this.ji=t;const e=this.chart.ls.os.As(this,!0);t.forEach((t=>{t.us(e).ps(this.Xi)}))}Qi(t,e){}ys(t){const e=this.chart.ls.vs(t);if(e&&Array.from(this.qi.keys()).includes(e.entity))return this.Qi(e.info,t)}setEffect(t){return this.ss.hs.Ss(t&&this.Ki.effectsText),this.ss.rs.Ss(t),this.chart.ls.xs(),this}getEffect(){return this.ss.hs.bs()||this.ss.rs.bs()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setIcon(t){return this.Ms=t,this.chart.ls.xs(),this}getIcon(){return this.Ms}setName(t){return this._s=t,this.Zi.forEach((e=>e.setText(t))),this}getName(){return this._s||"Component"}dispose(){return this.$i||(this.$i=!0,this.qi.forEach(((t,e)=>e.dispose())),this.Ji(this),this.Zi.forEach((t=>{t.dispose()})),this.Zi.length=0,this.R.emit("dispose",this),this.chart.ls.xs()),this}setVisible(t){return t===this.Xi||(this.Xi=t,this.qi.forEach(((e,i)=>i.setVisible(t))),this.ji.forEach((e=>e.ps(t))),this.Zi.forEach((e=>e.setOn(t))),this.R.emit("visibleStateChanged",this,this.Xi),this.chart.ls.xs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}setHighlight(t){return this.chart.ls.os.ws(this,t),this.R.emit("highlight",this,t),this}getHighlight(){return this.chart.ls.os.As(this)}setAnimationHighlight(t){return this.chart.ls.os.Cs(this,t),this}getAnimationHighlight(){return this.chart.ls.os.ks(this)}setMouseInteractions(t){return this.Yi=t,this.qi.forEach(((e,i)=>i.setMouseInteractions(t))),this.chart.ls.xs(),this}getMouseInteractions(){return this.Yi}getIsUnderMouse(){for(const t of this.qi)if(t[0].Ts)return!0;return!1}setHighlightOnHover(t){return this.Hi=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Hi!==e.HighlightModes.noHighlighting}attach(t,e=!0,i=!1){return this.styleLegendEntry(t,i),Me(t,[this],{toggleVisibilityOnClick:e,label:this.getName(),style:void 0}),this.Zi.push(t),t.onDispose((()=>{const e=this.Zi.indexOf(t);e>=0&&this.Zi.splice(e,1)})),this}Fs(){return this.Ms}onMouseDragStart(t){return this.R.on("mouseDragStart",t)}onMouseDrag(t){return this.R.on("mouseDrag",t)}onMouseDragStop(t){return this.R.on("mouseDragStop",t)}onMouseWheel(t){return this.R.on("mouseWheel",t)}onTouchStart(t){return this.R.on("touchStart",t)}onTouchMove(t){return this.R.on("touchMove",t)}onTouchEnd(t){return this.R.on("touchEnd",t)}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offTouchStart(t){return this.R.off(t,"touchStart")}offTouchMove(t){return this.R.off(t,"touchMove")}offTouchEnd(t){return this.R.off(t,"touchEnd")}offDispose(t){return this.R.off(t,"dispose")}}class Hi extends Zi{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Is=t,this.axis=s,this.At=r,this.Ps=n,this.Ds()}}const Wi=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.zs?(this.Es.splice(t,1),t-=1):this.Es[t].state&&(s=!0);return this.Rs?0===e.interactions.length&&(this.Es.push({state:!1,time:i}),this.Rs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Es.push({state:!0,time:i}),s=!0,this.Rs=!0),s}Ls(t,e,i){if(i){const i=this.Es.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Vs(t,e),this.Es.length=0)}}},$i=class{constructor(t,e,i,s=1,r=100){this.Os=t,this.Ns=e,this.Gs=i,this.Ws=s,this.Us=r}Bs(t,e){const i=e.interactions.length;if(i===this.Ws){if(void 0!==this.Ys)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=Wi(t);let s=0;for(let r=0;r!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class es{constructor(t,e){this.Zs=t,this.Qs=e,this.Js=e.rows*Fs,this.Ks=e.columns*Ds}}var is,ss;e.OnScreenMenuButtonType=void 0,(is=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[is.ZoomIn=0]="ZoomIn",is[is.ZoomInX=1]="ZoomInX",is[is.ZoomInY=2]="ZoomInY",is[is.ZoomOut=3]="ZoomOut",is[is.ZoomOutX=4]="ZoomOutX",is[is.ZoomOutY=5]="ZoomOutY",is[is.ZoomToFit=6]="ZoomToFit",is[is.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(ss=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[ss.Circle=0]="Circle",ss[ss.Rectangle=1]="Rectangle",ss[ss.RoundedRectangle=2]="RoundedRectangle";const rs={x:-43,y:0},ns={x:-65,y:0},os={x:-86,y:0},hs={x:-107,y:-1},as={x:-128,y:-3},ls={x:-150,y:0},us={x:-171,y:0},cs={x:-276,y:0},ds={x:-298,y:0},fs={x:0,y:0},gs={x:-21,y:0};class ys extends es{constructor(t,e,i,s){super(t,i),this.qs=wt.document.createElement("button"),this.te=wt.document.createElement("div"),this.ie=wt.document.createElement("label"),this.Qs=i,this.se=e,this.ee=s}he(t,e,i,s){this.re(t,s),this.ne(),this.oe(e),this.ae(),this.ie.textContent=i||"";const r=wt.document.createElement("div");this.le(r),this.qs.onclick=this.onClick.bind(this),r.appendChild(this.te),r.appendChild(this.ie),this.qs.appendChild(r)}ae(){this.qs.style.cursor="pointer"}le(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}oe(t){"string"==typeof t?(this.te.style.backgroundImage=`url(${t})`,this.te.style.backgroundSize="100%",this.te.style.backgroundRepeat="no-repeat",this.te.style.backgroundPosition="center",this.te.style.width="20px",this.te.style.height="20px"):this.applyStyleForSprite(t),this.te.style.margin="auto"}ne(){switch(this.se){case e.OnScreenMenuButtonShape.RoundedRectangle:this.qs.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.qs.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.qs.style.borderRadius="31px"}}re(t,e){this.qs.style.width=`${this.Ks.toString()}px`,this.qs.style.height=`${this.Js.toString()}px`,this.qs.style.backgroundColor=t,this.qs.style.opacity=e||Ps,this.qs.style.alignItems="center",this.qs.style.border="2px solid #707070",this.qs.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.te.style.backgroundImage=`url(${this.Zs}/${Ls})`,this.te.style.backgroundPositionX=`${t.x}px`,this.te.style.backgroundPositionY=`${t.y}px`,this.te.style.backgroundSize="1600%",this.te.style.backgroundRepeat="no-repeat",this.te.style.width="20px",this.te.style.height="20px"}ue(t){return t.appendChild(this.qs),t}ce(){return this.qs}}class ms extends ys{constructor(t,e,i,s){super(t,e,i,s),this.de="",this.fe="",this.Ae=!1,this.ee=s}ge(){this.pe(),this.onToggledStateAction()}ye(){this.me(),this.onInitialStateAction()}me(){this.ve(this.de)}pe(){this.ve(this.fe)}ve(t){"string"==typeof t?this.te.style.background=t:(this.te.style.backgroundImage=`url(${this.Zs}/${Ls})`,this.te.style.backgroundPositionX=`${t.x}px`,this.te.style.backgroundPositionY=`${t.y}px`)}onClick(){this.Ae?this.ye():this.ge(),this.Ae=!this.Ae}}class ps extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),rs)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:-1,y:-1})}}class xs extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),hs)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:-1,y:0})}}class As extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),ls)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:0,y:-1})}}class Ss extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),ns)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:1,y:1})}}class vs extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),as)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:1,y:0})}}class bs extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),us)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:0,y:1})}}class Ms extends ms{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.de=cs,this.fe=ds,this.he(s.onScreenMenuBackgroundColor.toRGBAString(),this.de)}onToggledStateAction(){this.ee.setAnimationsEnabled(!1)}onInitialStateAction(){this.ee.setAnimationsEnabled(!0)}}class ws extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),os)}onClick(){this.ee.forEachAxis((t=>{t.fit(!0)}))}}class Cs extends ys{constructor(t,e,i){super(t,e.shape||Vs,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.he(r,n,o,h),this.xe=e.action}onClick(){this.xe(this.ee)}}class Ts extends ms{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.ee=i,this.be=s,this.de=gs,this.fe=fs,this.he(_s,this.de)}me(){this.ve(this.de),this.qs.style.backgroundColor=_s,this.qs.style.border="2px solid #707070",this.qs.style.margin="0px"}pe(){this.ve(this.fe),this.qs.style.background="#FECC00 0% 0% no-repeat padding-box",this.qs.style.border="10px solid #BCBCBC12",this.qs.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.be)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.be)||void 0===t||t.style.setProperty("display","none")}}var Rs;e.MouseStyles=void 0,(Rs=e.MouseStyles||(e.MouseStyles={})).Move="move",Rs.ResizeColumn="col-resize",Rs.ResizeRow="row-resize",Rs.Horizontal="ew-resize",Rs.Vertical="ns-resize",Rs.NorthWest="nw-resize",Rs.NorthEast="ne-resize",Rs.Copy="copy",Rs.CrossHair="crosshair",Rs.Default="default",Rs.Help="help",Rs.Restricted="not-allowed",Rs.None="none",Rs.Point="pointer",Rs.Text="text",Rs.Wait="wait",Rs.ZoomIn="zoom-in",Rs.ZoomOut="zoom-out";const Es={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 U({color:w(255,255,255,0)}),Is=new Ji({thickness:1,fillStyle:ks}),Fs=60,Ds=60,Ps="1.0",Ls="osm/osm-sprite-transparent.png",Vs=e.OnScreenMenuButtonShape.Circle,_s="#363636";var Bs;e.OSMPosition=void 0,(Bs=e.OSMPosition||(e.OSMPosition={}))[Bs.TopRight=0]="TopRight",Bs[Bs.TopLeft=1]="TopLeft",Bs[Bs.BottomLeft=2]="BottomLeft",Bs[Bs.BottomRight=3]="BottomRight";class zs extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this._s="Band",this.Me=0,this._e=0,this.we=this.Ki.bandFillStyle,this.Ce=this.Ki.bandStrokeStyle,this.ke=!0,this.Te=this.Is.Pe(this.At).Ie(this.we).Fe(this.Ce).us(this.getHighlight()),this.ds(this.Te)}setValueStart(t){return this.Me=t,this.R.emit("valueChange",this,this.Me,this._e),this.Is.xs(),this}getValueStart(){return this.Me}setValueEnd(t){return this._e=t,this.R.emit("valueChange",this,this.Me,this._e),this.Is.xs(),this}getValueEnd(){return this._e}setFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;return this.Te.Ie(e),this.Is.xs(),this}getFillStyle(){return this.we}setStrokeStyle(t){this.Ce="function"==typeof t?t(this.Ce):t;const e=this.Ce;return this.Te.Fe(e),this.Is.xs(),this}getStrokeStyle(){return this.Ce}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}De(){return this.Te.Be(this.Ps.toVec2(this.Me,this.Ps.getHeight(this.At).getInnerStart())).it(this.Ps.toVec2(this._e-this.Me,this.Ps.getHeight(this.At).getInnerInterval())),this}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.Ce})}Le(t,e){t.us(e),this.Is.xs()}setDefaultMouseInteractions(t){return this.ke=t,this}Ds(){let t,i;const s=(e,s)=>{if(!this.ke)return;const r=ct(this.Is.ls.Re(s.x,s.y),this.Is.ls.At,this.At),n=this.Ps.getWidth(r),o=this.axis.At.ft(this.Me),h=this.axis.At.ft(this._e),a=(this.axis.At.ft(n)-o)/(h-o);t=!(a<.1||a>.9),!1===t&&(i=a<.5)},r=(e,s,r,n,o)=>{if(!this.ke)return;const h=this.Ps.getWidth(n);t?(this.Me=this.axis.At.pi(this.Me,h),this._e=this.axis.At.pi(this._e,h)):i?this.Me=this.axis.At.pi(this.Me,h):this._e=this.axis.At.pi(this._e,h),Qt(o),this.R.emit("valueChange",this,this.Me,this._e),this.Is.xs()};this.onMouseMove(((i,r)=>{if(!this.ke)return;s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.Ps.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Ee=this.chart.engine.setMouseStyle(n,this.Ee)})),this.onMouseLeave((()=>{this.ke&&(this.chart.engine.restoreMouseStyle(this.Ee),this.Ee=void 0)})),this.onMouseDrag(((t,e,i,s,n)=>{this.ke&&0===i&&r(0,0,0,n,e)}));const n=ji(new $i(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Ns extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this._s="Constant Line",this.M=0,this.Ce=this.Ki.constantLineStrokeStyle,this.ze=!0,this.ke=!0,this.Ve=this.Is.Ne(this.At).Oe(this.Ce).us(this.getHighlight()),this.ds(this.Ve)}setValue(t){return this.M=t,this.R.emit("valueChange",this,this.M),this.Is.xs(),this}getValue(){return this.M}setStrokeStyle(t){this.Ce="function"==typeof t?t(this.Ce):t;const e=this.Ce;return this.Ve.Oe(e),this.Is.xs(),this}getStrokeStyle(){return this.Ce}setInteractionMoveByDragging(t){return this.ze=t,this}getInteractionMoveByDragging(){return this.ze}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}De(){return this.Ve.We(this.Ps.toVec2(this.M,this.Ps.getHeight(this.At).getInnerStart())).Ge(this.Ps.toVec2(this.M,this.Ps.getHeight(this.At).getInnerEnd())),this}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.Ce})}Le(t,e){t.us(e),this.Is.xs()}setDefaultMouseInteractions(t){return this.ke=t,this}Ds(){const t=(t,e)=>{this.ke&&this.ze&&(this.M=this.axis.At.pi(this.M,this.Ps.getWidth(e)),this.R.emit("valueChange",this,this.M),this.Is.xs(),Qt(t))};this.onMouseMove((()=>{if(this.ke&&this.ze){const t=this.Ps.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Ee=this.chart.engine.setMouseStyle(t,this.Ee)}})),this.onMouseLeave((()=>{this.ke&&this.ze&&(this.chart.engine.restoreMouseStyle(this.Ee),this.Ee=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this.ke&&this.ze&&0===s&&t(i,n)}));const i=ji(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 Os={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?Os.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Os.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?Os.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Ue,Gs=t=>void 0!==t.Ye,Xs=(t,e)=>[t,e],Zs=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{It(t,0)&&(t=0),It(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)}},Ks=(...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))}},$s=s.Record({type:"empty-ticks",cursorFormatter:void 0});class Qs extends $s{He(t){return{$e:[],Xe:[],je:this.cursorFormatter?this.cursorFormatter:Di.Numeric,Ze:void 0,Qe:void 0}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}}const qs=t=>!(!t||"object"!=typeof t||!("type"in t)||"empty-ticks"!==t.type),Js=(t,e)=>{if(e.has(t))return e.get(t);const i=Je(t.Ke.Je());if(Ae(i))return i;const s=t.qe.pi(i.min,{x:-5,y:-5}),r=t.qe.pi(i.min,{x:5,y:5}),n=t.qe.pi(i.max,{x:-5,y:-5}),o=t.qe.pi(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},tr=t=>{const e=new Map;if(!qs(t)){for(const i of t.$e)e.set(i,new Map);for(const i of t.Xe)e.set(i,new Map)}return e},er=(new Qs).He({type:"linear"});class ir{constructor(t,e,i,s,n,o,h){this.R=new r.Eventer,this.th=er,this.ih=Us.Empty,this.sh=new Map,this.eh=new Map,this.hh=Os.fitting,this.rh=!0,this.oh=K((()=>this.chart.ls.xs()))(300,W.linear),this.ah=!0,this.Xi=!0,this.lh=!1,this.uh=ze,this.dh=!1,this.fh=!1,this.Ah=ze,this.gh=ze,this.ph=ze,this.yh=!1,this.mh="",this.Sh={},this.xh=()=>{this.bh.setMouseInteractions(!0).setMouseMoveEventHandler(((t,e)=>this.R.emit("mouseMoveTitle",this,e))).setMouseEnterEventHandler(((t,e)=>this.R.emit("mouseEnterTitle",this,e))).setMouseLeaveEventHandler(((t,e)=>this.R.emit("mouseLeaveTitle",this,e))).setMouseDownEventHandler(((t,e)=>this.R.emit("mouseDownTitle",this,e))).setMouseUpEventHandler(((t,e)=>this.R.emit("mouseUpTitle",this,e))).setMouseClickEventHandler(((t,e)=>this.R.emit("mouseClickTitle",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.R.emit("mouseDoubleClickTitle",this,e))).setMouseWheelEventHandler(((t,e)=>this.R.emit("mouseWheelTitle",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.R.emit("mouseDragStartTitle",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.R.emit("mouseDragTitle",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.R.emit("mouseDragStopTitle",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.R.emit("touchStartTitle",this,e))).setTouchMoveEventHandler(((t,e)=>this.R.emit("touchMoveTitle",this,e))).setTouchEndEventHandler(((t,e)=>this.R.emit("touchEndTitle",this,e))),this.xh=void 0},this.Mh=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.sh.get(e),l=(t?t.get(a):void 0)||this._h(a,e);l.wh=!1;const u=this.Ch(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.kh=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.Fh!==i||!!t.find((t=>t===e)))).map((t=>Ye(e,Js(t,a))?t:void 0)),y=p.some((t=>void 0!==t))}else y=!1;if(y){let t=!0;const e=p.filter((t=>void 0!==t));if(t&&e.every((t=>Ys(t.Fh)))&&(t=!1),t&&i.Ih&&i.Ih.Ph&&!1===i.Ih.Ph(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.th.je(t,this.At),this.Dh=!0,this.Bh=!0,this.chart=t,this.Lh=e,this.Ki=s,this.Rh=o,this.At=i,this.Eh=h,"logarithmic"===h.type&&this.setAnimationZoom(W.logarithmic(Ri(h.base))),this.zh=o.numeric,this.Vh("Numeric"),this.Oh=i.getInnerStart(),this.Nh=i.getInnerEnd(),this.setAnimationsEnabled(n)}setUnits(t,e={}){return this.Gh=t,this.Wh=e,this.Uh(),this}getUnits(){return this.Gh}setDefaultInterval(t,e){return this.Yh=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.yh=!0,this.chart.ls.xs()),this}getDefaultInterval(){return this.Yh}getTitle(){return this.mh}setTitle(t){return this.mh=t,this.Uh(),this}getTitleFillStyle(){return this.bh.Hh()}setIntervalRestrictions(t){return this.$h=t,this.chart.ls.xs(),this}getIntervalRestrictions(){return this.$h}setTitleFillStyle(t){return this.bh.Ie(t),this.chart.ls.xs(),this}getTitleFont(){return this.bh.Xh()}setTitleFont(t){return this.bh.jh(t),this.chart.ls.xs(),this}setTitleRotation(t){return this.bh.Zh(t),this.chart.ls.xs(),this}getTitleRotation(){return this.bh.Qh()}setTitleEffect(t){return this.Jh.Ss(t),this.chart.ls.xs(),this}getTitleEffect(){return this.Jh.bs()}Vh(t,e){if(this.sh.size>0&&this.Kh(),"Empty"===t){const i=e||(t=>t);this.zh=i(new Qs),this.th=this.zh.He(this.Eh),this.ih=t}else if("Numeric"===t){"Numeric"!==this.ih&&(this.zh=this.Rh.numeric);const i=e||(t=>t);this.zh=i(this.zh),this.th=this.zh.He(this.Eh),this.ih=t}else if("DateTime"===t){"DateTime"!==this.ih&&(this.zh=this.Rh.datetime);const i=e||(t=>t);this.zh=i(this.zh),this.th=this.zh.He(this.Eh),this.ih=t}else if("Time"===t){"Time"!==this.ih&&(this.zh=this.Rh.time);const i=e||(t=>t);this.zh=i(this.zh),this.th=this.zh.He(this.Eh),this.ih=t}return this.eh.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.eh=tr(this.th),this.chart.ls.xs(),this}qh(){return this.th}tr(t){this.th=t,this.eh.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.eh=tr(this.th),this.chart.ls.xs()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.yt(void 0!==e?e:this.Oh,void 0!==i?i:this.Nh,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}yt(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.Nh-this.Oh),void 0!==this.th.Ze&&this.th.Ze>h){const i=(e+t)/2,s=this.th.Ze/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.th.Qe&&this.th.Qee?-1:1);n={start:i-s,end:i+s}}const a=this.At.ut(n.start,n.end,this.Oh,this.Nh,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 we(0,""),this}if(this.ir&&this.ir.finishAll(!1),this.oh&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.ir||this.ir.isOver()?this.oh:this.ir.NextAnimation.bind(this);this.ir=e([[this.Oh,n.start],[this.Nh,n.end]],(([t,e])=>{this.sr(t,e,o)}),t),this.ir.onAnimationEnd((()=>{this.ir=void 0,l&&(this.ph=wt.performance.now())})),this.ir.onAnimationEnd((()=>this.setStopped(s)))}else this.sr(n.start,n.end,o),this.setStopped(s),l&&(this.ph=wt.performance.now());return this}getInterval(){return{start:this.Oh,end:this.Nh}}setStopped(t){return t===this.lh||(t&&(this.ir&&this.ir.finishAll(!1),this.ir=void 0),this.lh=t,this.R.emit("stoppedStateChanged",this,this.lh),this.uh=wt.performance.now(),this.chart.ls.xs()),this}getStopped(){return this.lh}onStoppedStateChanged(t){return this.R.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.R.off(t,"stoppedStateChanged")}fit(t,e){const i=this.er(),s=this.Yh||hr,r="function"==typeof s?s({curStart:this.Oh,curEnd:this.Nh,dataMin:null==i?void 0:i.min,dataMax:null==i?void 0:i.max}):s;return this.yt(void 0!==r.start?r.start:this.Oh,void 0!==r.end?r.end:this.Nh,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.hh=t,this.chart.ls.xs(),this}getScrollStrategy(){return this.hh}setAnimationScroll(t){return this.rh=Boolean(t),this.chart.ls.xs(),this}setAnimationZoom(t,e=300){return this.ir&&(this.ir.finishAll(!1),this.ir=void 0),this.oh=t?K((()=>this.chart.ls.xs()))(e,t):void 0,this}setAnimationsEnabled(t){return this.ah=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(W.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.ah}setVisible(t){const e=this.Xi!==t;return this.Xi=t,this.bh.setVisible(t),this.hr((e=>{e.Ke.setVisible(t)})),e&&this.R.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onIntervalChange(t){return this.R.on("scaleChange",t)}offIntervalChange(t){return this.R.off(t,"scaleChange")}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}rr(t,e){this.xh&&this.xh();const i=new Map;if(qs(this.th)||!this.Xi)return this.Kh(),i;e=e||new Map;const s=this.nr(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.Sh.physicalAxisSize=h;const a=rr(this.th,r,n,this.Oh,this.Nh,h),l=[];if(this.ar(),l.push(...this.lr(this.th,r,n,a,e,t,i)),this.ur(this.th,r,n,a,e,t,l,i),this.cr(),a)for(const[t,e]of this.eh){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.Sh.min=r,this.Sh.max=n,this.Sh.scaleInterval=o,this.Sh.physicalAxisSize=h,i}dr(t){const e=t.Fh.Ar;t.Ke.gr(e(t.M,this.At)).Ls()}pr(t,e){const i=e.yr;t.Ke.Ie(i.getLabelFillStyle()).jh(i.getLabelFont()).Zh(i.getLabelRotation())}_h(t,e){const i=this.eh.get(e);let s=i.get(t);s?(i.delete(t),s.Fh=e,s.ps(!0)):s=this.mr(t,e);const r=this.sh.get(e)||new Map;return r.set(t,s),this.sh.set(e,r),this.pr(s,e),s}Ch(t,e){const i=this.vr(t,e);return this.dr(t),i}lr(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.sh.get(a),l=(t?t.get(s):void 0)||this._h(s,a),u=this.Ch(l,n),c=Js(l,r);h.find((t=>Ye(c,Js(t,r))))&&l.Ke.setVisible(!1),l.wh=!1,o.set(l,u),h.push(l)}}return h}ur(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.Ih){p=!1;break}const t=u.Ih.Sr;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const m=this.kh(y.filter((t=>a.some((e=>It(t.M,e))))),g,u,d,n,h,e,i,r,o,l);!0!==m?t=t.concat(m):(d+=1,f=-1,t=[])}m=t,y.forEach((e=>{t.find((t=>t===e))||this.br(e)}))}if(l=m,!p)break}}br(t){const e=this.sh.get(t.Fh);null==e||e.delete(t.M);const i=this.eh.get(t.Fh);i&&i.has(t.M)?t.dispose():i&&(t.ps(!1),i.set(t.M,t))}hr(t){for(const e of this.sh.values())for(const i of e.values())t(i)}Mr(t,e){for(const i of this.sh.values())for(const s of i.values())e=t(e,s);return e}Kh(){this.sh.forEach(((t,e)=>{t.forEach((t=>this.br(t)))})),this.sh.clear()}ar(){for(const t of this.sh.values())for(const e of t.values())e.wh=!0}cr(){for(const t of this.sh.values())for(const[e,i]of t.entries())i.wh&&(i.dispose(),t.delete(e))}nr(){const t=this.At.getInnerStart()this.At.getInnerStart()?this.At.getInnerEnd():this.At.getInnerStart();return y(t,e)}Th(t,e){return!(t.wh||0===t.Ke._r().length||Ys(e)&&!0!==e.wr)}Cr(t,e){return qs(this.th)||(this.th.$e.forEach((i=>{e=t(e,i.yr)})),this.th.Xe.forEach((i=>{(t=>void 0!==t.Ar)(i)&&(e=t(e,i.yr))}))),e}er(){let t=this.Lh.kr();const e=this.Lh.Tr();let i;if(void 0!==t&&Tt(t)&&void 0!==e&&Tt(e)&&("logarithmic"===this.Eh.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=y(t,e)),i&&Tt(i.min)&&Tt(i.max))return It(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}Fr(){if(!this.Dh)return 0;let t=0;const e=this.Lh.Ir();return e&&(t=Math.max(t,e)),t}setAutoRegionsEnabled(t){return this.Dh=t,this.chart.ls.xs(),this}Pr(){var t;const e=this.dh;let i=!1;if(this.yh&&this.Yh){const t=this.er(),e="function"==typeof this.Yh?this.Yh({curStart:this.Oh,curEnd:this.Nh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.Yh;this.setInterval(e),this.yh=!1}if(this.hh&&!this.lh){const e=this.er();if(e){const s=this.Oh,r=this.Nh;let n=this.hh.start(s,r,e.min,e.max),o=this.hh.end(s,r,e.min,e.max);const h=null===(t=this.hh.allowIntervalLengthChange)||void 0===t||t,a=or(this.$h,e,{start:n,end:o},{start:s,end:r},h);n=a.start,o=a.end;const l=!1===It(s,n),u=!1===It(r,o);if(n=l?n:s,o=u?o:r,l||u){let t=!1;if(this.rh&&!this.Bh)if(this.rh){t=!0;const e=l?this.Dr(s,n):s,a=u?this.Dr(r,o):r;if(!0===this.sr(e,a,h)&&(l&&!1===It(e,n)||u&&!1===It(a,o))){this.chart.ls.xs(!0),i=!0;let t=Math.abs(o-n)/Math.abs(e-a);t<1&&(t=1/t),this.fh=t>=1.4}}else t=!1;t||this.sr(n,o,h),this.Bh=!1}}}return i?(this.dh!==i&&(this.dh=i,this.Ah=wt.performance.now()),this.Br&&(clearTimeout(this.Br),this.Br=void 0)):!0===e&&void 0===this.Br&&(this.fh=!1,this.Br=setTimeout((()=>{!1!==this.dh&&(this.dh=!1,this.Ah=wt.performance.now()),this.Br=void 0,this.chart.ls.xs()}),200)),this}sr(t,e,i){let s={start:t,end:e},r=!0;if(this.$h){const t=this.er();s=or(this.$h,t,s,{start:this.Oh,end:this.Nh},i)}const n=Math.abs(e-t),o=Math.abs(this.Nh-this.Oh);if(void 0!==this.th.Ze&&this.th.Ze>n){const n=(e+t)/2,h=(i?this.th.Ze/2:o/2)*(t>e?-1:1);s={start:n-h,end:n+h},r=!1}if(void 0!==this.th.Qe&&this.th.Qee?-1:1);s={start:n-h,end:n+h},r=!1}let h=this.At.ut(s.start,s.end,this.Oh,this.Nh,i);if(!1===h)return!1;!0!==h&&(s=h);const a=this.Fr(),l=this.Lr(Math.min(s.start,s.end),Math.max(s.start,s.end),a);return h=this.At.ut(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min,this.Oh,this.Nh,!1),!!h&&(!0===h?this.At.q(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min):this.At.q(s.start,s.end),this.Oh=s.start,this.Nh=s.end,this.R.emit("scaleChange",this,s.start,s.end),this.gh=wt.performance.now(),this.chart.ls.xs(),r)}Rr(){return this.dh}Er(){return void 0!==this.ir}Uh(){var t;const e=!1!==(null===(t=this.Wh)||void 0===t?void 0:t.displayOnAxis);this.bh.gr(this.Gh&&e&&this.mh?`${this.mh} (${this.Gh})`:this.mh),this.chart.ls.xs()}onTitleMouseEnter(t){return this.R.on("mouseEnterTitle",t)}offTitleMouseEnter(t){return this.R.off(t,"mouseEnterTitle")}onTitleMouseMove(t){return this.R.on("mouseMoveTitle",t)}offTitleMouseMove(t){return this.R.off(t,"mouseMoveTitle")}onTitleMouseLeave(t){return this.R.on("mouseLeaveTitle",t)}offTitleMouseLeave(t){return this.R.off(t,"mouseLeaveTitle")}onTitleMouseDown(t){return this.R.on("mouseDownTitle",t)}offTitleMouseDown(t){return this.R.off(t,"mouseDownTitle")}onTitleMouseUp(t){return this.R.on("mouseUpTitle",t)}offTitleMouseUp(t){return this.R.off(t,"mouseUpTitle")}onTitleMouseClick(t){return this.R.on("mouseClickTitle",t)}offTitleMouseClick(t){return this.R.off(t,"mouseClickTitle")}onTitleMouseDoubleClick(t){return this.R.on("mouseDoubleClickTitle",t)}offTitleMouseDoubleClick(t){return this.R.off(t,"mouseDoubleClickTitle")}onTitleMouseDragStart(t){return this.R.on("mouseDragStartTitle",t)}offTitleMouseDragStart(t){return this.R.off(t,"mouseDragStartTitle")}onTitleMouseDrag(t){return this.R.on("mouseDragTitle",t)}offTitleMouseDrag(t){return this.R.off(t,"mouseDragTitle")}onTitleMouseDragStop(t){return this.R.on("mouseDragStopTitle",t)}offTitleMouseDragStop(t){return this.R.off(t,"mouseDragStopTitle")}onTitleMouseWheel(t){return this.R.on("mouseWheelTitle",t)}offTitleMouseWheel(t){return this.R.off(t,"mouseWheelTitle")}onTitleTouchStart(t){return this.R.on("touchStartTitle",t)}offTitleMouseTouchStart(t){return this.R.off(t,"touchStartTitle")}onTitleTouchMove(t){return this.R.on("touchMoveTitle",t)}offTitleTouchMove(t){return this.R.off(t,"touchMoveTitle")}onTitleTouchEnd(t){return this.R.on("touchEndTitle",t)}offTitleTouchEnd(t){return this.R.off(t,"touchEndTitle")}}class sr{constructor(t,e,i,s,r=i.Or(s).Vr(Ie).zr(Ie).setMouseInteractions(!1)){this.wh=!1,this.$i=!1,this.qi=[],this.Fh=t,this.M=e,this.Nr=i,this.qe=s,this.Ke=r,this.qi.push(r)}ps(t){this.qi.forEach((e=>e.setVisible(t)))}dispose(){return this.$i||(this.$i=!0,this.qi.forEach((t=>t.dispose()))),this}}const rr=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.$e){let t=n.Gr(e,i,s,r);t=nr(t),o.set(n,t)}let h;for(const s of t.Xe){let t;if(void 0===h)t=s.Gr(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.Wr&&s.Wr>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),or=(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||It(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||It(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||It(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||It(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),o},hr=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}},ar=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class lr extends ar{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 ur=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),cr=new lr,dr=new class{getFillStyle(){return B}},fr=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new U,wireframeStyle:nt});class gr extends fr{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 yr=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),mr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new U});class pr extends mr{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 xr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),Ar={Triangulated:gr,Pixelated:pr};class Sr{constructor(t){this.Ur=new Map,this.ls=t}ns(t,e,i){const s=i.animationEnabled;this.Ur.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.Ur.delete(t),t.offDispose(r)}))}Yr(t,e){let i=e.animationEnabled;const s=[],r=t.onDispose((()=>{s.forEach((t=>{this.Ur.delete(t)})),t.offDispose(r)}));return{Hr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Ur.set(t,r)},$r:()=>{s.forEach((t=>{this.Ur.delete(t)})),s.length=0},Xr:t=>{i=t,s.forEach((t=>{this.Cs(t,i)}))},jr:()=>i}}ws(t,e){const i=this.Ur.get(t);i&&(i.curUnanimatedHighlightValue=be(e),this.ls.xs())}As(t,e=!1){const i=this.Ur.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}Cs(t,e){const i=this.Ur.get(t);i&&(i.animationEnabled=e)}ks(t){const e=this.Ur.get(t);return!!e&&e.animationEnabled}Ls(t){let e=!1;this.Ur.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.ls.xs(!0)}}const vr=new Map,br=(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=vr.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),vr.set(a,l)),l};var Mr,wr;!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"}(Mr||(Mr={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(wr||(wr={}));const Cr=t=>({container:t.Zr,setMouseStyle:(e,i)=>t.Qr(e,i),restoreMouseStyle:e=>t.Jr(e),captureFrame:(e,i,s)=>t.Kr(e,i,s),renderFrame:(e,i,s=!1)=>t.qr(e,i,s),layout:()=>{t.tn(),t.sn(),t.hn.en(),t.xs()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.rn(e,i),onRenderFrame:e=>t.nn(e),offRenderFrame:e=>t.an(e)}),Tr=[];let Rr;const Er=()=>{if(void 0!==Rr){const t=wt.getComputedStyle(wt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));Rr.style.height=wt.innerHeight-e+"px",(()=>{for(let t=0;tthis.xs()),60),this.cn=u(0,0),this.dn=!1,this.fn=kt,this.An=()=>{},this.gn=[],this.pn=-1,this.yn=[],this.mn=!0,this.$i=!1,this.vn=!1,this.sn=()=>{const{bottom:t,left:e}=this.Zr.getBoundingClientRect();return this.cn=u(Math.floor(e),Math.floor(t)),this},this.Sn=t=>{if(this.xn){const e=this.xn.entity.bn;e&&e(this.xn.entity,t,this.xn.button,this.xn.startLocation,this.xn.collectionMember,this.xn.info),this.xn=void 0}},this.tn=()=>{this.Mn&&this.Mn()},this.Qr=(t,e)=>{if(!e){this.Zr.style.cursor=t;const e=this.pn;return this.pn+=1,this.yn.push([e,t]),e}return this.Jr(e),this.Qr(t)},this.Jr=t=>{const e=t?this.yn.findIndex((e=>e[0]===t)):-1;e>=0?(this.yn.splice(e,1),this.yn.length>0?this.Zr.style.cursor=this.yn[this.yn.length-1][1]:this.Zr.style.cursor="default"):(this.yn.push([0,"default"]),this.Zr.style.cursor="default")},this._n=t=>(this.wn._(t),this),this.Cn=()=>this.wn.C(),this.kn=()=>{this.fn&&this.fn(1e3/60),this.Tn(),this.Fn(),this.An&&this.An()},this.In=t=>(this.ln.set(t.Pn(),t),this.ln=new Map([...this.ln.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.Dn=t=>(this.ln.delete(t),this),this.J=()=>(this.wn.u=!1,this),this.K=()=>(this.wn.u=!0,this),this.Bn=t=>{if(!this.mn)return;const e=this.Ln,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.vs({x:t.clientX,y:t.clientY});if(this.Rn&&((null==s?void 0:s.entity)!==this.Rn.entity||s.collectionMember!==this.Rn.collectionMember)&&!this.xn){this.Rn.entity.Ts=!1;const e=this.Rn.entity.En;e&&e(this.Rn.entity,t,this.Rn.collectionMember)}if(s&&s.entity.getMouseInteractions()&&!this.xn)if(s.entity.Ts){if(!i){const e=s.entity.zn;e&&e(s.entity,t,s.collectionMember,s.info)}}else{s.entity.Ts=!0;const e=s.entity.Vn;e&&e(s.entity,t,s.collectionMember,s.info)}if(this.xn){const i=this.xn.entity.On,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.xn.entity,t,this.xn.button,this.xn.startLocation,s,this.xn.collectionMember,this.xn.info)}this.Nn=t,this.Ln=t,this.Rn=s?{...s,event:t}:void 0},this.Gn=t=>{if(this.mn=!1,this.Nn=t,this.Rn&&!this.Wn&&!this.xn){this.Rn.entity.Ts=!1;const e=this.Rn.entity.En;e&&e(this.Rn.entity,t,this.Rn.collectionMember),this.Rn=void 0}},this.Un=t=>{if(this.mn=!0,this.Nn=t,this.xn&&t.buttons<=0){const e=this.xn.entity.bn;e&&e(this.xn.entity,t,this.xn.button,this.xn.startLocation,this.xn.collectionMember,this.xn.info),this.xn=void 0}if(this.Wn&&t.buttons<=0){const e=this.Wn.entity.Yn;e&&e(this.Wn.entity,t,this.Wn.collectionMember,this.Wn.info),this.Wn=void 0}},this.Hn=()=>this.Nn&&this.$n?this.Nn.timeStamp>this.$n.timeStamp?this.Nn:this.$n:this.Nn||this.$n,this.hn=t,this.Ki=e.theme,this.Xn=i.Xn,this.jn=i.jn,this.Zn=i.Zn,this.Qn={Jn:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,Zs:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:`${wt.location.origin}/resources`,Kn:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,qn:(()=>{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})(),io:void 0===(null==e?void 0:e.interactable)||e.interactable,so:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=wt.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.Zr=t}else this.Zr=s;wt.addEventListener("resize",this.tn),this.gn.push((()=>{wt.removeEventListener("resize",this.tn)}))}else{if(void 0===Rr){const t=wt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",wt.document.body.appendChild(t),Rr=t,wt.addEventListener("resize",Er)}let t=1;for(;null!==wt.document.getElementById(`chart-${t}`);)t+=1;this.Zr=wt.document.createElement("div"),this.Zr.id=`chart-${t}`,this.Zr.style.flex="1",this.Zr.style.height="100%",Rr.appendChild(this.Zr),Er(),Tr.push(this.tn),this.gn.push((()=>{Rr&&Rr.removeChild(this.Zr),Tr.includes(this.tn)&&Tr.splice(Tr.indexOf(this.tn),1),0===Tr.length&&Rr&&(wt.document.body.removeChild(Rr),Rr=void 0,wt.removeEventListener("resize",Er))}))}if(wt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Zr&&this.tn()};this.eo=new wt.ResizeObserver(t.bind(this)),this.eo.observe(this.Zr)}""===this.Zr.style.position&&(this.Zr.style.position="relative"),this.Zr.style.boxSizing="content-box",this.Zr.addEventListener("fullscreenchange",this.tn),this.Zr.addEventListener("webkitfullscreenchange",this.tn);const n=e?e.maxFps:void 0;this.ho=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.Zr.onwheel=this.ro(Mr.wheel),this.Zr.oncontextmenu=this.ro(Mr.contextmenu),this.Zr.onclick=this.ro(Mr.click),this.Zr.ondblclick=this.ro(Mr.dbclick),this.Zr.onlostpointercapture=()=>{h=!1},this.Zr.ontouchmove=t=>{h&&t.preventDefault()},this.Zr.onpointerover=a(),this.Zr.onpointerenter=a(this.Un),this.Zr.onpointerdown=a(this.ro(Mr.mouseDown),this.no(wr.touchStart)),this.Zr.onpointermove=a(this.Bn,this.no(wr.touchMove)),this.Zr.onpointerup=a(this.ro(Mr.mouseUp),this.no(wr.touchEnd)),this.Zr.onpointercancel=a(),this.Zr.onpointerout=a(),this.Zr.onpointerleave=a(this.Gn,this.no(wr.touchEnd)),wt.addEventListener("dragstart",this.Sn),wt.addEventListener("scroll",this.sn,{passive:!0}),this.wn=p(new b({r:0,g:0,b:0,a:0})),this.os=new Sr(this)}oo(t,e){var i,s,r,n;(null===(i=this.Rn)||void 0===i?void 0:i.entity)===t.entity&&this.Rn.collectionMember===t.collectionMember&&(this.Rn={...e,info:this.Rn.info,event:this.Rn.event}),(null===(s=this.ao)||void 0===s?void 0:s.entity)===t.entity&&this.ao.collectionMember===t.collectionMember&&(this.ao={...e,info:this.ao.info}),(null===(r=this.Wn)||void 0===r?void 0:r.entity)===t.entity&&this.Wn.collectionMember===t.collectionMember&&(this.Wn={...e,info:this.Wn.info,event:this.Wn.event}),(null===(n=this.xn)||void 0===n?void 0:n.entity)===t.entity&&this.xn.collectionMember===t.collectionMember&&(this.xn={...e,info:this.xn.info,button:this.xn.button,startLocation:this.xn.startLocation})}lo(){this.vn=!0,this.fn=void 0,this.An=void 0}nn(t){return this.R.on("render",t)}an(t){return this.R.off(t)}uo(){return this.co}do(){return this.fo}setBackgroundFillStyle(t){return this.Ao.Ie(t),this}getBackgroundFillStyle(){return this.Ao.Hh()}setBackgroundStrokeStyle(t){return this.Ao.Fe(t),this}getBackgroundStrokeStyle(){return this.Ao.po()}yo(t){return this.An=t,this}mo(t){return this.fn=t,this}vo(t){return this.ln.get(t)}So(){return Array.from(this.ln.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}ro(t){return e=>this.xo(t,e)}xo(t,e){if(!this.mn)return;t===Mr.contextmenu&&Qt(e);const i=this.vs({x:e.clientX,y:e.clientY});if(t===Mr.mouseUp){if(this.xn){const t=this.xn.entity.bn;if(t&&t(this.xn.entity,e,this.xn.button,this.xn.startLocation,this.xn.collectionMember,this.xn.info),(null==i?void 0:i.entity)!==this.xn.entity||i.collectionMember!==this.xn.collectionMember){this.xn.entity.Ts=!1;const t=this.xn.entity.En;t&&t(this.xn.entity,e,this.xn.collectionMember)}this.xn=void 0}if(this.Wn){const t=this.Wn.entity.getMouseInteractions()&&this.Wn.entity.Yn;t&&t(this.Wn.entity,e,this.Wn.collectionMember,this.Wn.info),this.Wn=void 0}}else if(i&&i.entity.getMouseInteractions()){const s=t===Mr.click?i.entity.bo:t===Mr.dbclick?i.entity.Mo:t===Mr.mouseDown?i.entity._o:t===Mr.wheel?i.entity.wo:t===Mr.contextmenu?i.entity.Co:void 0;if(s&&s(i.entity,e,i.collectionMember,i.info),t===Mr.mouseDown){this.Wn={entity:i.entity,collectionMember:i.collectionMember,event:e,info:i.info};const t=this.Wn.event.button,s=i.entity.ko;s&&s(i.entity,e,t,i.collectionMember,i.info),this.xn={entity:i.entity,collectionMember:i.collectionMember,button:t,startLocation:u(e.clientX,e.clientY),info:i.info}}}this.Nn=e,this.Rn=i?{...i,event:e}:void 0}no(t){return e=>this.To(t,e)}To(t,e){const i=e.interactions.length;if(this.$n=e,this.ao){const s=t===wr.touchMove?this.ao.entity.Fo:t===wr.touchEnd?this.ao.entity.Io:t===wr.touchStart?this.ao.entity.Po:void 0;s&&s(this.ao.entity,e,this.ao.collectionMember,this.ao.info),t===wr.touchEnd&&0===i&&(this.ao.entity.Ts=!1,this.ao=void 0)}else if(t===wr.touchStart){for(let t=0;t{t()})),this.gn.length=0}}Re(t,e){return u(t-this.cn.x,this.cn.y-e)}zo(t,e){return u(t+this.cn.x,this.cn.y-e)}Vo(t){const e=this.Re(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Oo(t){const e=this.zo(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const Dr=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=li(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=li(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=li(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=li(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 u=t.length;if(0===u)return;const c=s?1:0,d=u-(r?2:1);if(i===zr.Nearest)return Or(t,e,n,o,c,d);if(i===zr.NearestX||i===zr.NearestY){if("boolean"==typeof l&&("x"===a&&i===zr.NearestX||"y"===a&&i===zr.NearestY))return Gr(t,ct(e,o,n),a,l,c,d);if(i===zr.NearestX)return Ur(t,ct(e,o,n),h,c,d);if(i===zr.NearestY)return Yr(t,ct(e,o,n),h,c,d)}},Or=(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=ct(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,y=Math.floor((r+n)/2),m=n,p=-1;for(;;){const e=h-(o?t[y].x:t[y].y);if(e*(s?-1:1)>0)g=Math.min(y+1,m),p=Math.floor((g+m)/2);else{if(0===Math.abs(e))return y;m=Math.max(y-1,g),p=Math.floor((g+m)/2)}if(p===y){const i=y>r?Math.abs(h-(o?t[y-1].x:t[y-1].y)):Be,s=y{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,y=Math.floor((r+n)/2),m=n,p=-1;for(;;){const i=h-(o?t[y].x:t[y].y);if(i*(s?-1:1)>0)g=Math.min(y+1,m),p=Math.floor((g+m)/2);else{if(0===Math.abs(i))return{a:y,b:y,lerpAmount:0};m=Math.max(y-1,g),p=Math.floor((g+m)/2)}if(p===y){if(i*(s?-1:1)<0&&y>r){const i=t[y-1],s=t[y];return{a:y-1,b:y,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(ythis.R.on("dispose",t),this.offDispose=t=>this.R.off(t,"dispose"),this.ls=t,this.Ho=e,this.$o=i,this.Xo=Zr,Zr+=1,this.jo=t.Ki.highlightColorOffset}Zo(){let t;return this.Qo("DataPattern",(e=>(t=e.pattern,!0))),"ProgressiveX"===t||"RegressiveX"===t?zr.NearestX:"ProgressiveY"===t||"RegressiveY"===t?zr.NearestY:zr.Nearest}Jo(t){return void 0!==this.$o.find((e=>e.type===t))}Qo(t,e){var i;return!!this.Jo(t)&&!0===e(null===(i=this.$o.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.$i||(this.Ts&&this.En&&this.En(this,void 0,void 0),this.$i=!0,this.Ho(this),this.R.emit("dispose",this)),this}isDisposed(){return this.$i}setVisible(t){const e=this.Xi;return this.Xi=t,!t&&e&&(this.Ts&&this.En&&this.En(this,void 0,void 0),this.Ts=!1),this}getVisible(){return this.Xi}setMouseInteractions(t){const e=this.No.C();return this.No._(t),t||(e&&this.Ts&&this.En&&this.En(this,void 0,void 0),this.Ts=!1),this}getMouseInteractions(){return this.No.C()}getIsUnderMouse(){return this.Ts}getIsGrabbed(){return this.Wo}setMouseMoveEventHandler(t){return this.zn=t,this}setMouseEnterEventHandler(t){return this.Vn=t,this}setMouseLeaveEventHandler(t){return this.En=t,this}setMouseClickEventHandler(t){return this.bo=t,this}setMouseDoubleClickEventHandler(t){return this.Mo=t,this}setMouseDownEventHandler(t){return this._o=t,this}setMouseUpEventHandler(t){return this.Yn=t,this}setMouseWheelEventHandler(t){return this.wo=t,this}setMouseContextMenuEventHandler(t){return this.Co=t,this}setMouseDragEventHandler(t){return this.On=t,this}setMouseDragStartEventHandler(t){return this.ko=t,this}setMouseDragStopEventHandler(t){return this.bn=t,this}setTouchStartEventHandler(t){return this.Po=t,this}setTouchMoveEventHandler(t){return this.Fo=t,this}setTouchEndEventHandler(t){return this.Io=t,this}Ko(t){return this.Uo=t,this}qo(){return this.Uo?this.Uo:Wr}us(t){return this.Yo=t,this}ta(){return this.Yo}ia(t){return this.jo=t,this}sa(){return this.jo}}const Wr=y(u(0,0),u(0,0));class jr extends Hr{constructor(t,e,i,s){super(t,i,s),this.ea=0,this.Is=e,this.Is.ha=!0}ra(t){return this.ea===t||(this.ea=t,this.Is.ha=!0),this}na(){return this.ea}}class Kr extends jr{constructor(t,e,i,s,r){super(t,e,s,r),this.oa=!0,this.At=i}}const $r=(t,e,i)=>{if(i instanceof Bi){const s=i.Wi(),r=di(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return y(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return y(i.pi(u(t.min.x,t.min.y),li(e,-1)),i.pi(u(t.max.x,t.max.y),e))},Qr=(t,e)=>"function"==typeof e?e(t):e,qr=(t,e)=>!t||t!==e,Jr=t=>t!==B;class tn extends Kr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.we=Ir.fillStyle,this.ls=t}Ie(t){return this.we=Qr(this.we,t),this}Hh(){return this.we}aa(){return qr(this.la,this.we)}ua(){return((t,e)=>t===B&&e!==B)(this.la,this.we)}ca(){return Jr(this.we)}da(t){this.la=t}}class en extends tn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ce=Ir.lineStyle,this.ls=t}Fe(t){return this.Ce="function"==typeof t?t(this.Ce):t,this}po(){return this.Ce}fa(){return!this.Aa||this.Aa!==this.Ce}ga(t){return!this.Aa||this.Aa.getThickness()!==t}ca(){return this.Ce!==nt||super.ca()}ua(){return(this.Ce!==nt||this.we!==B)&&this.Aa===nt&&this.la===B}pa(t){this.Aa=t}}class sn extends tn{constructor(t,e,i,s,r,n=p(5)){super(t,e,i,s,r),this.size=p(5),this.size=n}it(t){return this.size._(t),this}}class rn extends tn{constructor(t,e,i,s,r,n=p(Ir.font)){super(t,e,i,s,r),this.ya=p(""),this.ma=p(u(0,0)),this.va=p(0),this.Sa=p(0),this.xa=p(u(0,0)),this.ba=p(0),this.Ma=p(cr),this._a=u(0,0),this.Xt=p(x(1,1,1,1)),this.wa=p(A(4,4,4,4)),this.font=p(Ir.font),this.Ca=!1,this.font=n}ca(){return Jr(this.we)&&this.ya.C().length>0}ua(){return!1===this.Ca&&this.ca()}gr(t){return this.ya._(t),this}_r(){return this.ya.C()}jh(t){return ur(t)?this.Ma._(t):this.Ma._(t(this.Ma.C())),this}Xh(){return this.Ma.C()}ka(t){return this.Ma._(this.Ma.C().setFamily(t)),this}Ta(){return this.Ma.C().getFamily()}Fa(t){return this.Ma._(this.Ma.C().setSize(t)),this}Ia(){return this.Ma.C().getSize()}Pa(t){return this.Ma._(this.Ma.C().setWeight(t)),this}Da(){return this.Ma.C().getWeight()}Ba(t){return this.Ma._(this.Ma.C().setStyle(t)),this}La(){return this.Ma.C().getStyle()}Ra(t){return this.Ma._(this.Ma.C().setVariant(t)),this}Ea(){return this.Ma.C().getVariant()}Be(t){return this.ma._(t),this}za(){return this.ma.C()}Zh(t){return this.ba._(t),this}Qh(){return this.ba.C()}Va(t,e){return this.xa._(u(t,e)),this}Oa(){return this.xa.C()}Na(t){return this.Sa._(t),this}Ga(){return this.Sa.C()}Wa(t){return this.va._(t),this}Ua(){return this.va.C()}Ya(t){return this.Sa._(t.x),this.va._(t.y),this}zr(t){return this.Xt._(t),this}Ha(){return this.Xt.C()}Vr(t){return this.wa._(t),this}$a(){return this.wa.C()}}class nn extends sn{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,p(o)),this.Xa=[],this.ja=p(e.PointShape.Square),this.ba=p(0),this.Za=p(!1),this.Qa=p(!1),this.Ja=p(!1),this.Ka=Ne,this.qa=0,this.tl=[],this.il=0,this.sl=Ne,this.el=!1,this.hl=void 0}rl(){return this.tl}nl(){return this.Xa}ol(t){return this.ja._(t),this}al(){return this.ja.C()}Zh(t){return this.ba._(t),this}Qh(){return this.ba.C()}ll(t){return this.Za._(t),this}ul(t){return this.Qa._(t),this}cl(t){return this.Ja._(t),this}dl(t,e){return Array.isArray(t)||(t=[t]),this.il+=t.length,this.tl=he(this.tl,t,{canReturnB:!0}),this.sl&&(this.sl=e?ei(this.sl,e):void 0),this.hl=void 0,this}Ot(){return this.el=!0,this.Xa.length=0,this.qa=0,this.Ka=Ne,this.tl=[],this.il=0,this.hl=void 0,this}fl(){return this.qa}Al(){return this.il}}class on extends en{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ma=p(u(0,0)),this.Z=p(u(100,100)),this.ba=p(0),this._a=p(u(0,0)),this.pl=!1}Ls(){return this.yl(),this}Be(t){const e=this.ma.C();return t.x===e.x&&t.y===e.y||(this.ma._(t),this.yl()),this}za(){return this.ma.C()}ml(t){const e=this.ma.C();return t!==e.x&&(this.ma._(u(t,e.y)),this.yl()),this}vl(t){const e=this.ma.C();return t!==e.y&&(this.ma._(u(e.x,t)),this.yl()),this}it(t){const e=this.Z.C();return t.x===e.x&&t.y===e.y||(this.Z._(u(t.x,t.y)),this.yl()),this}oi(){return this.Z.C()}Sl(t){const e=this.Z.C();return t!==e.x&&(this.Z._(u(t,e.y)),this.yl()),this}xl(t){const e=this.Z.C();return t!==e.x&&(this.Z._(u(e.x,t)),this.yl()),this}Zh(t){return this.ba._(t),this}Qh(){return this.ba.C()}bl(t){const e=this._a.C();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.pl=!1,this.yl()):(this.pl=!0,this._a._(t))),this}yl(){if(!this.pl){const t=this.ma.C(),e=this.Z.C(),i=u(t.x+e.x/2,t.y+e.y/2),s=this._a.C();i.x===s.x&&i.y===s.y||this._a._(i)}}}class hn extends en{constructor(){super(...arguments),this.Xa=[],this.ma=p(u(0,0)),this.Ka=Ne,this.Ml=!1}_l(t){return t=ie(t),this.Xa=t,this.Ml=!0,this}wl(){return this.Xa}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return 0}kl(){return 0}}class an extends hn{}class ln extends tn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Tl=new Array,this.Fl=new Array,this.Il=p({type:"disabled",packager:(t,e,i)=>t.slice()}),this.Ka=Ne,this.Pl=0,this.Dl=!1,this.tl=[Array(),Array()],this.Bl=!1,this.Ll=(new U).setColor(w(42,171,240)),this.el=!1,this.Rl=!1,this.El=!1}dl(t,e){const i=this.Pl-1,s=i>0&&!this.Bl;let[r,n]=s?[[this.Tl[i]],[this.Fl[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=he(r,e,{canReturnB:!0}),n=he(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Bl?(this.tl[0]=he(this.tl[0],r,{canReturnB:!0}),this.tl[1]=he(this.tl[1],n,{canReturnB:!0})):(this.tl=[r,n],this.Bl=!0),this.Ka=ei(this.Ka,e||ei(Je(r),Je(n))),this}Ot(){return this.el=!0,this.Tl.length=0,this.Fl.length=0,this.Pl=0,this.Ka=Ne,this}nl(){return[this.Tl,this.Fl]}rl(){return[this.tl[0],this.tl[1]]}zl(t){return this.Il._(t),this}Vl(){return this.Il.C()}Ol(t){return this.Ll="function"==typeof t?t(this.Ll):t,this}Nl(){return this.Ll}fl(){return this.Pl-(Number(this.Rl)+Number(this.El))}Al(){return this.tl.length}Gl(t){return this.Rl=t,this}Wl(){return this.Rl}Ul(t){return this.El=t,this}Yl(){return this.El}ua(){return this.la===B&&this.Hl===B&&(this.we!==B||this.Ll!==B)}$l(t){this.Hl=t}ca(){return this.Ll!==B||super.ca()}aa(){return super.aa()||!this.Hl||this.Hl!==this.Ll}}class un extends en{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ma=p(u(0,0)),this.Xl=p(0),this.Fi=p(360),this.jl=p(100),this.Zl=p(100),this.Ql=p(0),this.Jl=p(void 0),this.Kl=u(0,0),this.ql=u(0,0),this.tu=u(0,0)}iu(){return this.jl.C()}su(){return this.Zl.C()}za(){return this.ma.C()}eu(){return this.Xl.C()}Ti(){return this.Fi.C()}hu(){return this.Ql.C()}ru(){return this.Jl.C()}nu(){return this.Kl}ou(){return this.ql}au(){return this.tu}Be(t){return this.ma._(t),this}lu(t){return this.Xl._(t),this}Ge(t){return this.Fi._(t),this}uu(t){return this.Zl._(t),this.jl._(t),this}cu(t){return this.jl._(t),this}du(t){return this.Zl._(t),this}fu(t){return this.Ql._(t<0?0:t),this}Au(t){return this.Jl._(void 0!==t&&t<=0?void 0:t),this}}var cn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(cn||(cn={}));class dn extends Kr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.gu=Ir.lineStyle,this.engine=t}Oe(t){return this.gu=((t,e)=>"function"==typeof e?e(t):e)(this.gu,t),this}pu(){return this.gu}fa(){return((t,e)=>!t||t!==e)(this.yu,this.gu)}mu(t){return((t,e)=>!t||t.getThickness()!==e)(this.yu,t)}ua(){return((t,e)=>t===nt&&e!==nt)(this.yu,this.gu)}ca(){return(t=>t!==nt&&t.getFillStyle()!==B)(this.gu)}vu(t){this.yu=t}}class fn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Pi=u(0,0),this.Fi=u(0,0),this.Su=!1}_({min:t,max:e}){return t.x===this.Pi.x&&t.y===this.Pi.y&&e.x===this.Fi.x&&e.y===this.Fi.y||(this.Su=!0,this.Pi=t,this.Fi=e),this}Ii(){return this.Pi}Ti(){return this.Fi}We(t){return t.x===this.Pi.x&&t.y===this.Pi.y||(this.Su=!0,this.Pi=t),this}Ge(t){return t.x===this.Fi.x&&t.y===this.Fi.y||(this.Su=!0,this.Fi=t),this}}class gn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.xu=void 0}}class yn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.bu=[],this.Ka=Ne,this.tl=new Array,this.qa=0,this.el=!1,this.Mu=p(void 0),this.Rl=!1,this.El=!1}_u(t){return this.Mu._(t),this}wu(){return this.Mu.C()}rl(){return this.tl}nl(){return this.bu}Ot(){return this.el=!0,this.bu.length=0,this.qa=0,this.tl=[],this.Ka=Ne,this}fl(){return this.qa-(Number(this.Rl)+Number(this.El))}Al(){return this.tl.length}Gl(t){return this.Rl=t,this}Wl(){return this.Rl}Ul(t){return this.El=t,this}Yl(){return this.El}}const mn=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 pn{constructor(){this.Xi=!0,this.R=new r.Eventer,this.Cu=0,this._t=(t,e,i)=>{0===this.Cu&&this.R.emit("mouseEnter",this,e),this.Cu+=1},this.wt=(t,e,i)=>{this.Cu-=1,this.Cu<1&&(this.R.emit("mouseLeave",this,e),this.Cu=0)},this.Ct=(t,e,i)=>{this.R.emit("mouseClick",this,e)},this.kt=(t,e,i)=>{this.R.emit("mouseDoubleClick",this,e)},this.Tt=(t,e,i)=>{this.R.emit("mouseDown",this,e)},this.Ft=(t,e,i)=>{this.R.emit("mouseUp",this,e)},this.It=(t,e,i)=>{this.R.emit("mouseMove",this,e)},this.Dt=(t,e,i,s)=>{this.R.emit("mouseDragStart",this,e,i)},this.Pt=(t,e,i,s,r,n)=>{this.R.emit("mouseDrag",this,e,i,s,r)},this.Bt=(t,e,i,s,r)=>{this.R.emit("mouseDragStop",this,e,i,s)},this.Lt=(t,e,i)=>{this.R.emit("mouseWheel",this,e)},this.Rt=(t,e)=>{this.Cu+=1,this.R.emit("touchStart",this,e)},this.Et=(t,e)=>{this.R.emit("touchMove",this,e)},this.zt=(t,e)=>{this.Cu-=1,this.R.emit("touchEnd",this,e)},this.ku=t=>(t instanceof Kr?t.setMouseEnterEventHandler(this._t).setMouseLeaveEventHandler(this.wt).setMouseClickEventHandler(this.Ct).setMouseDoubleClickEventHandler(this.kt).setMouseDownEventHandler(this.Tt).setMouseUpEventHandler(this.Ft).setMouseMoveEventHandler(this.It).setMouseDragEventHandler(this.Pt).setMouseDragStartEventHandler(this.Dt).setMouseDragStopEventHandler(this.Bt).setMouseWheelEventHandler(this.Lt).setTouchStartEventHandler(this.Rt).setTouchMoveEventHandler(this.Et).setTouchEndEventHandler(this.zt):(t.onMouseEnter(((t,e)=>this._t(t,e))),t.onMouseLeave(((t,e)=>this.wt(t,e))),t.onMouseClick(((t,e)=>this.Ct(t,e))),t.onMouseDoubleClick(((t,e)=>this.kt(t,e))),t.onMouseDown(((t,e)=>this.Tt(t,e))),t.onMouseUp(((t,e)=>this.Ft(t,e))),t.onMouseMove(((t,e)=>this.It(t,e))),t.onMouseDrag(((t,e,i,s,r)=>this.Pt(t,e,i,s,r))),t.onMouseDragStart(((t,e,i)=>this.Dt(t,e,i))),t.onMouseDragStop(((t,e,i,s)=>this.Bt(t,e,i,s))),t.onMouseWheel(((t,e)=>this.Lt(t,e))),t.onTouchStart(((t,e)=>this.Rt(t,e))),t.onTouchMove(((t,e)=>this.Et(t,e))),t.onTouchEnd(((t,e)=>this.zt(t,e)))),t)}onMouseEnter(t){return this.R.on("mouseEnter",t)}onMouseLeave(t){return this.R.on("mouseLeave",t)}onMouseClick(t){return this.R.on("mouseClick",t)}onMouseDoubleClick(t){return this.R.on("mouseDoubleClick",t)}onMouseDown(t){return this.R.on("mouseDown",t)}onMouseUp(t){return this.R.on("mouseUp",t)}onMouseMove(t){return this.R.on("mouseMove",t)}onMouseDragStart(t){return this.R.on("mouseDragStart",t)}onMouseDrag(t){return this.R.on("mouseDrag",t)}onMouseDragStop(t){return this.R.on("mouseDragStop",t)}onMouseWheel(t){return this.R.on("mouseWheel",t)}onTouchStart(t){return this.R.on("touchStart",t)}onTouchMove(t){return this.R.on("touchMove",t)}onTouchEnd(t){return this.R.on("touchEnd",t)}offMouseEnter(t){return this.R.off(t,"mouseEnter")}offMouseLeave(t){return this.R.off(t,"mouseLeave")}offMouseClick(t){return this.R.off(t,"mouseClick")}offMouseDoubleClick(t){return this.R.off(t,"mouseDoubleClick")}offMouseDown(t){return this.R.off(t,"mouseDown")}offMouseUp(t){return this.R.off(t,"mouseUp")}offMouseMove(t){return this.R.off(t,"mouseMove")}offMouseDragStart(t){return this.R.off(t,"mouseDragStart")}offMouseDrag(t){return this.R.off(t,"mouseDrag")}offMouseDragStop(t){return this.R.off(t,"mouseDragStop")}offMouseWheel(t){return this.R.off(t,"mouseWheel")}offTouchStart(t){return this.R.off(t,"touchStart")}offTouchMove(t){return this.R.off(t,"touchMove")}offTouchEnd(t){return this.R.off(t,"touchEnd")}getIsUnderMouse(){return this.Cu>0}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&this.R.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}}const xn=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.pi(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.pi({x:o.x.getInnerStart(),y:o.y.getInnerStart()},di({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.pi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},di({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),Qt(s)}},An=(t,e,i,s,r)=>{xn(t,r,e)},Sn=(t,e,i,s,r)=>{xn(t,s,r)};class vn extends pn{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.$i=!1,this.Tu=void 0,this.Fu=void 0,this.Iu=mn,this.Pu=void 0,this.No=!0,this.Du=()=>{const t="function"==typeof this.Iu?this.Iu(this):this.Iu;t&&(this.Fu=this.Is.ls.Qr(t))},this.Bu=()=>{this.Is.ls.Jr(this.Fu)},this.Xt=x(0,0,0,0),this.Is=t,this.renderingScale=e,this.scale=i,this.Ho=s,this.Ki=r,this.Is.xs(),this.onMouseEnter(this.Du),this.onMouseLeave(this.Bu),this.onMouseDrag(An);const n=ji(new $i(kt,Sn,kt));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.Ki=r}setMouseInteractions(t){return this.Lu().forEach((e=>e.setMouseInteractions(t))),this.No=t,this}getMouseInteractions(){return this.No}setEffect(t){return this.ss=this.ss||this.Is.ls.ss.es(this,{Ru:{shapes:this.Lu()}}),this.ss.Ru.Ss(t),this}getEffect(){return!!this.ss&&this.ss.Ru.bs()}setAutoDispose(t){return this.Pu=t,this.Is.xs(),this}getAutoDispose(){return this.Pu}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this.Xt.left+this.Xt.right),this.size.y+(this.Xt.bottom+this.Xt.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this.Xt="object"==typeof t?S(this.Xt,t):{left:t,top:t,right:t,bottom:t},this.Is.xs(),this}getMargin(){return this.Xt}De(){if(this.Pu){const t=this.size,e=this.renderingScale.oi(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.Pu.type&&i.x>=this.Pu.maxWidth||"max-height"===this.Pu.type&&i.y>=this.Pu.maxHeight)&&this.dispose()}return this}Ls(){return this}dispose(){return this.$i||(this.Is.xs(),this.$i=!0,this.Ho(this),this.R.emit("dispose",this),this.Lu().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.Lu().forEach((e=>e.setVisible(t))),this.Is.xs(),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setPosition(t){return this.position=t,this.Is.xs(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.pi(this.position,di({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.pi(r,di({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.pi(r,{x:this.Xt.left,y:this.Xt.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.pi(n,di({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Is.xs(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Tu=t,this.Is.xs(),this}getDraggingMode(){return void 0!==this.Tu?this.Tu:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Iu=t,this}getMouseStyle(){return this.Iu}}class bn extends vn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.wa=x(),this.Eu=0,this.Is=t,this.zu=s,this.backgroundElement=new this.zu(this.Is,this.renderingScale,this.scale,kt,n),this.ku(this.backgroundElement)}Lu(){return this.backgroundElement.Lu()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}De(){return super.De(),this.$i||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).De(),this}Ls(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.Vu(t).Ls(),super.Ls()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.wa="object"==typeof t?S(this.wa,t):{left:t,top:t,right:t,bottom:t},this.Is.xs(),this}getPadding(){return this.wa}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.wa.left+this.wa.right,i.y+this.wa.bottom+this.wa.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Ou()+this.backgroundElement.Nu(),i.y+this.backgroundElement.Gu()+this.backgroundElement.Wu())),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.pi(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.pi(n,di({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.pi(n,{x:this.backgroundElement.Ou(),y:this.backgroundElement.Gu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.pi(o,di({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.pi(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.pi(a,di({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.Eu}setHighlight(t){return this.Eu=be(t),this.backgroundElement.setHighlight(t),this.R.emit("highlight",this,t),this}}const Mn=t=>"setBackground"in t;class wn extends pn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.M=0,this.Uu=1,this.Yu=!0,this.Hu=new lr,this.$u=!0,this.$i=!1,this.axisScale=s,this.renderingScale=r,this.Xu=o,this.ju=h,this.Zu=a,this.Ho=l,this.Qu=e,this.Ju=i,this.Ku=this.ku(this.Qu.Ne(this.renderingScale)),this.Ki=u,this.qu=this.ku(this.Zu.setDirection(this.ju).tc(this.Ju,this.renderingScale,n,kt,this.Ki,!1).setOrigin(Kt(this.ju))),this.axis=t,this.setMouseInteractions(!1),"major"===this.qu.ic?this.Ku.Oe(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.qu.ic?this.Ku.Oe(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.qu.ic&&this.Ku.Oe(u.cursorGridStrokeStyleX)}setValue(t){return this.M=t,this.Ju.xs(),this.R.emit("valueChange",this,this.M),this}getValue(){return this.M}setTextFormatter(t){return this.sc=t,this.Ju.xs(),this}setTickLength(t){return this.qu.setPointerLength(t),this.Qu.xs(),this}getTickLength(){return this.qu.getPointerLength()}setTickLabelPadding(t){return this.qu.setTickLabelPadding(t),this.Qu.xs(),this}setTickLabelRotation(t){return this.qu.setTextRotation(t),this.Qu.xs(),this}getTickLabelRotation(){return this.qu.getTextRotation()}getTickLabelPadding(){return this.qu.getTickLabelPadding()}setGridStrokeLength(t){return this.Uu=t,this.Qu.xs(),this}getGridStrokeLength(){return this.Uu}setGridStrokeStyle(t){return this.Ku.Oe(t),this.Qu.xs(),this}getGridStrokeStyle(){return this.Ku.pu()}dispose(){return this.$i||(this.$i=!0,this.Ku.dispose(),this.qu.dispose(),this.Ho(this),this.Qu.ls.xs(),this.R.emit("dispose",this)),this}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setMarkerVisible(t){return this.Yu=t,this.Ju.xs(),this}getMarkerVisible(){return this.Yu}setMarker(t){return t(this.qu),this.Ju.xs(),this}getMarker(){return this.qu}setMouseInteractions(t){return this.qu.setMouseInteractions(t),this.Ku.setMouseInteractions(t),this}getMouseInteractions(){return this.Ku.getMouseInteractions()}setAllocatesAxisSpace(t){return this.$u=t,this.Ju.xs(),this}getAllocatesAxisSpace(){return this.$u}isInScale(){return je(this.M,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}}class Cn extends wn{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.hc=!1,this.Ho=a,this.Qu=e,this.Ju=i}dispose(){return this.hc=!1,super.dispose()}update(){return this}plot(t,e,i,s,r){if(this.isInScale()&&this.getVisible()&&t){this.hc=!1;const t=ut(this.M,this.axisScale,this.Xu.getWidth(this.renderingScale));this.Ku.setVisible(!0).We(this.Xu.toPoint(t,e)).Ge(this.Xu.toPoint(t,e-(s+i*this.Uu))),this.Yu?(this.sc&&this.qu.setText(this.sc(this.M,this)),this.qu.setVisible(!0).setPosition(this.Xu.toPoint(t,r))):this.qu.setVisible(!1)}else this.Ku.setVisible(!1),this.qu.setVisible(!1);return this.qu.Ls().De(),this}rc(){const t=this.qu.Ls().getSize();return this.Xu.getHeight(t)}}const Tn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),Rn=(t,e)=>(ce(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),En=(t,e,i)=>{i&&Mn(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},kn={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}},In={background:void 0,setBackground(t){return{...this,background:t}}},Fn={tc(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}},Dn={tc(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 Pn extends vn{constructor(){super(...arguments),this.nc=!0}De(){return super.De(),this}setMouseInteractions(t){return this.nc=t,this}getMouseInteractions(){return this.nc}Lu(){return[]}}class Ln extends Pn{onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}Vu(t){return this.size=t,this}Ou(){return 0}Nu(){return 0}Wu(){return 0}Gu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return B}setStrokeStyle(){return this}getStrokeStyle(){return nt}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Vn extends vn{constructor(){super(...arguments),this.R=new r.Eventer,this.Eu=0}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}getHighlight(){return this.Eu}setHighlight(t){return this.Eu=t,this.Lu().forEach((e=>e.us(t))),this.R.emit("highlight",this,t),this.Is.xs(),this}}class _n extends Vn{}class Bn extends _n{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Is=t,this.ja=this.Is.oc(this.renderingScale,cn.Simple).setVisible(!1).Ie(B).Fe(nt),this.ku(this.ja)}ac(){const t=this.lc();if(t.length>2){const e=Je(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=ui(t,li(e.min,-1));return this.scale.pi(this.position,ui(s,di(li(ui(this.origin,u(1,1)),-.5),i)))})).map((t=>ct(t,this.scale,this.renderingScale)));this.ja._l(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.ja&&this.ja.setVisible(!1),this.setContentSize(u(0,0))}De(){return super.De(),this.$i||this.ac(),this}Ls(){return this.ac(),super.Ls()}setVisible(t){return super.setVisible(t),this.ja.setVisible(t),this}}const zn=(t,e,i)=>t*(1-i)+e*i,Nn=(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=zn(i.value,r.value,n),c=zn(e.value,s.value,h);return zn(c,u,l)},On={warm:t=>e=>T(60/(t-1)*e,.8,.8),cold:t=>e=>T(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>T(360/t*e,.8,.8),reverseSpectrum:t=>e=>T(360/t*(t-e),.8,.8),flatUI:t=>e=>T(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return T(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return T(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return T(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return T(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return T(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>T(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return T(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return T(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),T(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return T(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=>T(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>Un([{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=>Un([{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=>Un([{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=>Un([{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=>Un([{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=>Un([{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)},Un=(t,e,i)=>{const s=Gn(e,i),[r,n]=Xn(s,t),o=Yn(t[r]),h=Yn(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:zn(o.h,h.h,a),s:zn(o.s,h.s,a),v:zn(o.v,h.v,a)};return T(l.h,l.s,l.v)},Yn=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},Xn=(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),to={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},eo=s.Record({type:"linestyle",lineType:"dashed",pattern:to.DashedEqual,fillStyle:new U({color:w(255,255,255)}),thickness:1,patternScale:3});class io extends eo{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")}N(){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 so=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),ro=s.Record({type:"icon",width:void 0,height:void 0,uc:void 0,cc:kt,dc:kt});class no extends ro{constructor(t,e,i,s){super({...s,uc:t,cc:e,dc:i})}dispose(){return this.dc(this),this}setWidth(t){const e=this.set("width",t);return this.cc(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this.cc(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this.cc(i),i}oi(){if(!this.uc)return{x:0,y:0};const t=this.uc.width,e=this.uc.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 oo=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),ho=s.Record({type:"glow",color:w(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class ao extends ho{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 lo{constructor(t){this.fc=0,this.Ac=0,this.gc=0,this.yc=!1,this.mc=!0,this.vc=!1,this.Sc={warningDisplayed:!1,expandEvents:[]},this.R=new r.Eventer,this.mc=!t||void 0===t.autoSortingEnabled||t.autoSortingEnabled,void 0!==(null==t?void 0:t.dataPattern)&&(this.xc={userSpecified:null===t.dataPattern?void 0:t.dataPattern}),this.bc=void 0!==(null==t?void 0:t.lookupValues)&&t.lookupValues,this.Mc=void 0!==(null==t?void 0:t.colors)&&t.colors,this._c=void 0!==(null==t?void 0:t.ids)&&t.ids,this.wc=void 0!==(null==t?void 0:t.sizes)&&t.sizes,this.Cc=void 0!==(null==t?void 0:t.rotations)&&t.rotations,this.kc=(null==t?void 0:t.dataStorage)?t.dataStorage:Float64Array,this.Tc=!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,y,m;if(s){u=new this.kc(i);const e=t[0]&&t[0][s]instanceof Date;if(t[0]&&"string"==typeof t[0][s])for(let e=0;ea-1&&(this.fc=0,this.yc=!0),this.Ac=Math.min(this.Ac+1,a),this.gc+=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,y=void 0!==t.offsetSizes?t.offsetSizes:a,m=void 0!==t.offsetRotations?t.offsetRotations:a,p=this.zc(!0),[x,A]=this.Vc(l,t.xValues,"x","ProgressiveX"===p||"RegressiveX"===p||void 0===p?o:void 0,"ProgressiveX"===p||"RegressiveX"===p||void 0===p?h:void 0,a),[S,v]=this.Vc(l,t.yValues,"y","ProgressiveY"===p||"RegressiveY"===p?o:void 0,"ProgressiveY"===p||"RegressiveY"===p?h:void 0,a),b=this.Rc(i),{samplesCacheX:M,samplesCacheY:w,samplesCacheLookup:C,samplesCacheColors:T,samplesCacheIDs:R,samplesCacheSize:E,samplesCacheRotation:k,maxSampleCount:I,dataPattern:F,incomingDataReplacedCache:D}=this.Fc({appendCount:l,...0===A&&0===v&&0===a&&0===d&&0===f&&0===g&&0===y&&0===m?{incomingDataX:x,incomingDataY:S,incomingDataLookup:e,incomingDataIDs:s,incomingDataColors:b,incomingDataSize:r,incomingDataRotation:n}:{}});if(!D&&F&&this.mc&&this.Pc&&this.Dc){const t=x[A],i=S[v];if(!this.Bc(F,t,i)&&!this.vc)return this.Lc(this.Pc,this.Dc,mo(x,A,A+l),mo(S,v,v+l),mo(e,d,d+l),mo(b,f,f+l),mo(s,g,g+l),mo(r,y,y+l),mo(n,m,m+l),F),this}const P=I-this.fc,L=Math.min(l,P);if(L>0&&(D||(go(M,x,A,L,this.fc),go(w,S,v,L,this.fc),e&&C&&go(C,e,d,L,this.fc),s&&R&&go(R,s,g,L,this.fc),b&&T&&go(T,b,f,L,this.fc),r&&E&&go(E,r,y,L,this.fc),n&&k&&go(k,n,m,L,this.fc)),this.Ec(this.fc,this.fc+L-1),this.fc+=L,this.fc>I-1&&(this.fc=0,this.yc=!0)),this.Ac=Math.min(this.Ac+L,I),this.gc+=L,this.zc(),l-L>0){const t={xValues:x?mo(x,A+L,void 0):void 0,yValues:S?mo(S,v+L,void 0):void 0,lookupValues:e?mo(e,d+L,void 0):void 0,ids:s?mo(s,g+L,void 0):void 0,colors:b?mo(b,f+L,void 0):void 0,sizes:r?mo(r,y+L,void 0):void 0,rotations:n?mo(n,m+L,void 0):void 0};this.appendSamples(t)}return this}setSamples(t){return this.clear().appendSamples(t)}fill(t){const e=this.Pc||this.Dc;if(!e)return this;const i=e.length;if(void 0!==t.x&&(this.Pc=this.Pc||new this.kc(i),this.Pc.fill(t.x)),void 0!==t.y&&(this.Dc=this.Dc||new this.kc(i),this.Dc.fill(t.y)),void 0!==t.lookupValue&&(this.Oc=this.Oc||new Float32Array(i),this.Oc.fill(t.lookupValue)),void 0!==t.color){const e=this.Rc([t.color]);e&&(this.Nc=this.Nc||new Uint32Array(i),this.Nc.fill(e[0]))}return void 0!==t.size&&(this.Gc=this.Gc||new Float32Array(i),this.Gc.fill(t.size)),void 0!==t.rotation&&(this.Wc=this.Wc||new Float32Array(i),this.Wc.fill(t.rotation)),this.R.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,d=c?c.length:void 0!==e.x||void 0!==e.y?1:0;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,y=void 0!==e.offsetIds?e.offsetIds:l,m=void 0!==e.offsetSizes?e.offsetSizes:l,p=void 0!==e.offsetRotations?e.offsetRotations:l,x=this.Rc(n),A=this.gc-1,S=void 0!==this.Uc?Math.max(this.gc-this.Uc,0):0,v=t+u-1,b=Math.max(t,S),M=Math.min(v,A),w=M-b+1;if(this.gc>0&&w>0){const{samplesCacheX:n,samplesCacheY:u,samplesCacheColors:c,samplesCacheIDs:d,samplesCacheLookup:A,samplesCacheSize:v,samplesCacheRotation:C}=this.Fc({appendCount:0}),T=n.length;if(void 0!==this.Uc&&this.yc&&this.gc%this.Uc!=0){const S=this.gc-this.gc%this.Uc,w=this.gc-1,R=this.gc-this.Ac,E=S-1,k=Math.max(b,R),I=Math.min(M,E)-k+1;if(I>0){const S=k-t,b=uo(k,this.gc,T,this.fc);if(void 0!==e.x)for(let t=b;t0){const S=F-t,b=uo(F,this.gc,T,this.fc);if(void 0!==e.x)for(let t=b;t0){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:y+e,offsetSizes:m+e,offsetRotations:p+e,count:C})}return this}alterSamplesByID(t,e){if(!this._c)throw new Error("LightningChart JS attempted to use alterSamplesByID on DataSetXY that doesn't have IDs enabled.");const i=t.length,s=this.Yc;if(i<=0||!s)return this;const r=(("object"==typeof e.color?this.Rc([e.color]):"number"==typeof e.color?[e.color]:[])||[])[0],n=Array.isArray(e.xValues)?new this.kc(e.xValues):e.xValues,o=Array.isArray(e.yValues)?new this.kc(e.yValues):e.yValues,h=Array.isArray(e.yValues)?new Float32Array(e.yValues):e.yValues,a=this.Rc(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.Ac,f=this.gc-1,g=Math.max(f-d+1,0);for(let d=0;ds[uo(t,this.gc,c,this.fc)])),m=uo(y,this.gc,c,this.fc);s[m]===i&&(void 0!==e.x&&this.Pc&&(this.Pc[m]=e.x),void 0!==e.y&&this.Dc&&(this.Dc[m]=e.y),void 0!==e.lookupValue&&this.Oc&&(this.Oc[m]=e.lookupValue),void 0!==e.size&&this.Gc&&(this.Gc[m]=e.size),void 0!==e.rotation&&this.Wc&&(this.Wc[m]=e.rotation),void 0!==r&&this.Nc&&(this.Nc[m]=r),n&&this.Pc&&(this.Pc[m]=n[d]),o&&this.Dc&&(this.Dc[m]=o[d]),h&&this.Oc&&(this.Oc[m]=h[d]),a&&this.Nc&&(this.Nc[m]=a[d]),l&&this.Gc&&(this.Gc[m]=l[d]),u&&this.Wc&&(this.Wc[m]=u[d]))}return this.R.emit("cleared"),this}clear(){return this.fc=0,this.Ac=0,this.gc=0,this.yc=!1,this.R.emit("cleared"),this}getSampleCount(){return this.Ac}getNextSampleIndex(){return this.gc}setMaxSampleCount(t){if("object"==typeof t){this.Hc&&this.offMaxSampleCountExceeded(this.Hc);const e=t.max,i=t.initial,s=()=>{const t=this.Uc||0;if(void 0!==e&&t>=e)return;let i=2*t;void 0!==e&&(i=Math.min(i,e)),this.setMaxSampleCount(i)};this.Hc=this.onMaxSampleCountExceeded(((t,e,i,r)=>{s()})),void 0===this.Uc&&(void 0!==i?this.setMaxSampleCount(i):this.setMaxSampleCount(Math.min(2*this.Ac,void 0!==e?e:Number.MAX_SAFE_INTEGER)))}else if("number"==typeof t){const e=t;if(void 0!==this.Uc&&this.Uc>e)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to shrink data set. This is currently not supported.");if(!this.Pc||!this.Dc)return this.Uc=e,this;if(e===this.Uc)return this;if(this.yc&&0!==this.fc)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.Uc=e,this.Act+e.count),0),n=new this.kc(r),o=new this.kc(r),h=this.Mc?new Uint32Array(r):void 0,a=this.bc?new Float32Array(r):void 0,l=this._c?new Uint32Array(r):void 0,u=this.wc?new Float32Array(r):void 0,c=this.Cc?new Float32Array(r):void 0;let d=0;for(const t of s)n.set(this.Pc.subarray(t.offset,t.offset+t.count),d),o.set(this.Dc.subarray(t.offset,t.offset+t.count),d),this.Mc&&h&&this.Nc&&h.set(this.Nc.subarray(t.offset,t.offset+t.count),d),this.bc&&a&&this.Oc&&a.set(this.Oc.subarray(t.offset,t.offset+t.count),d),this._c&&l&&this.Yc&&l.set(this.Yc.subarray(t.offset,t.offset+t.count),d),this.wc&&u&&this.Gc&&u.set(this.Gc.subarray(t.offset,t.offset+t.count),d),this.Cc&&c&&this.Wc&&c.set(this.Wc.subarray(t.offset,t.offset+t.count),d),d+=t.count;return{xValues:n,yValues:o,iSampleFirst:i,lookupValues:a,colors:h,ids:l,sizes:u,rotations:c}}onMaxSampleCountExceeded(t){return this.R.on("maxSampleCountExceeded",t)}offMaxSampleCountExceeded(t){return this.R.off(t)}Vc(t,e,i,s,r,n){if(void 0===e){const e=this.Ic();r=void 0!==r?r:1,s=void 0!==s?s:e?e[i]+r:0;const n=new this.kc(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.vc=!0,this.appendSamples(l),this.vc=!1}else{const l=t.length,u=this.Ac,f=this.gc-1,g=Math.max(f-u+1,0),y=fo(d,g,f,(e=>t[uo(e,this.gc,l,this.fc)])),m=y-1,p=y+1,x=t[uo(y,this.gc,l,this.fc)],A=p<=this.gc-1?t[uo(p,this.gc,l,this.fc)]:void 0,S=void 0!==A&&A0&&!t){const t=void 0!==this.Uc&&this.yc?this.fc:0,i=this.Ac-1,s=void 0!==this.Uc&&this.yc?0:void 0,r=void 0!==this.Uc&&this.yc?this.fc-1:void 0,[n,o]=void 0!==s&&void 0!==r&&Math.abs(r-s)>Math.abs(i-t)?[s,r]:[t,i];if(1+o-n>=2){let t,i,s=this.Pc[n],r=this.Dc[n];for(let e=n+1;e<=o;e+=1){if(!1!==t){const i=this.Pc[e],r=Math.sign(i-s);0!==r&&t&&t.direction!==r?t=!1:0===r||t||(t={direction:r}),s=i}if(!1!==i){const t=this.Dc[e],s=Math.sign(t-r);0!==s&&i&&i.direction!==s?i=!1:0===s||i||(i={direction:s}),r=t}}e=t&&t.direction>0?Br.ProgressiveX:t&&t.direction<0?Br.RegressiveX:i&&i.direction>0?Br.ProgressiveY:i&&i.direction<0?Br.RegressiveY:void 0,this.xc={autoDetectResult:e},e&&wt.console.warn(`LightningChart JS DataSetXY warning | Data pattern was detected automatically (DataPatterns.${e}).\nAutomatic detection is only intended for kick-starting application development, not for production use.\nAdd { dataPattern: '${e}'} } to your application when creating series or DataSetXY to get clear this warning.`)}}if(e&&"ProgressiveX"!==e)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 e}Bc(t,e,i){const s=this.Ic();return!s||("ProgressiveX"===t?e>s.x:"RegressiveX"===t?es.y:"RegressiveY"!==t||ii-t.timestamp<5e3)),e>1e3&&this.Sc.expandEvents.push({timestamp:i}),this.Sc.expandEvents.length>5)return wt.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.Sc.warningDisplayed=!0,this.setMaxSampleCount({mode:"auto"}),this.Fc(t)}const i=new this.kc(e);i.set(this.Pc),this.Pc=i;const s=new this.kc(e);if(s.set(this.Dc),this.Dc=s,this.bc){const t=new Float32Array(e);this.Oc&&t.set(this.Oc),this.Oc=t}if(this._c){const t=new Uint32Array(e);this.Yc&&t.set(this.Yc),this.Yc=t}if(this.Mc){const t=new Uint32Array(e);this.Nc&&t.set(this.Nc),this.Nc=t}if(this.wc){const t=new Float32Array(e);this.Gc&&t.set(this.Gc),this.Gc=t}if(this.Cc){const t=new Float32Array(e);this.Wc&&t.set(this.Wc),this.Wc=t}return this.fc=this.Ac,{dataPattern:this.zc(),samplesCacheX:this.Pc,samplesCacheY:this.Dc,samplesCacheLookup:this.Oc,samplesCacheIDs:this.Yc,samplesCacheColors:this.Nc,samplesCacheSize:this.Gc,samplesCacheRotation:this.Wc,maxSampleCount:e}}if(i>4*e){const t=new this.kc(e);t.set(this.Pc.subarray(0,this.Ac)),this.Pc=t;const i=new this.kc(e);if(i.set(this.Dc.subarray(0,this.Ac)),this.Dc=i,this.bc){const t=new Float32Array(e);this.Oc&&t.set(this.Oc.subarray(0,this.Ac)),this.Oc=t}if(this._c){const t=new Uint32Array(e);this.Yc&&t.set(this.Yc.subarray(0,this.Ac)),this.Yc=t}if(this.Mc){const t=new Uint32Array(e);this.Nc&&t.set(this.Nc.subarray(0,this.Ac)),this.Nc=t}if(this.wc){const t=new Float32Array(e);this.Gc&&t.set(this.Gc.subarray(0,this.Ac)),this.Gc=t}if(this.Cc){const t=new Float32Array(e);this.Wc&&t.set(this.Wc.subarray(0,this.Ac)),this.Wc=t}return{dataPattern:this.zc(),samplesCacheX:this.Pc,samplesCacheY:this.Dc,samplesCacheLookup:this.Oc,samplesCacheIDs:this.Yc,samplesCacheColors:this.Nc,samplesCacheSize:this.Gc,samplesCacheRotation:this.Wc,maxSampleCount:e}}return{dataPattern:this.zc(),samplesCacheX:this.Pc,samplesCacheY:this.Dc,samplesCacheLookup:this.Oc,samplesCacheIDs:this.Yc,samplesCacheColors:this.Nc,samplesCacheSize:this.Gc,samplesCacheRotation:this.Wc,maxSampleCount:i}}return t.appendCount+this.Ac>this.Uc&&this.R.emit("maxSampleCountExceeded",this,this.Ac,this.Uc,this.Ac+t.appendCount),this.Pc=this.Pc||new this.kc(this.Uc),this.Dc=this.Dc||new this.kc(this.Uc),this.Oc=this.Oc||(this.bc?new Float32Array(this.Uc):void 0),this.Yc=this.Yc||(this._c?new Uint32Array(this.Uc):void 0),this.Nc=this.Nc||(this.Mc?new Uint32Array(this.Uc):void 0),this.Gc=this.Gc||(this.wc?new Float32Array(this.Uc):void 0),this.Wc=this.Wc||(this.Cc?new Float32Array(this.Uc):void 0),{dataPattern:this.zc(),samplesCacheX:this.Pc,samplesCacheY:this.Dc,samplesCacheLookup:this.Oc,samplesCacheIDs:this.Yc,samplesCacheColors:this.Nc,samplesCacheSize:this.Gc,samplesCacheRotation:this.Wc,maxSampleCount:this.Uc}}Zc(){if(!this.Pc||!this.Dc||0===this.Ac)return;if(void 0===this.Uc)return this.gc>0?{x:this.Pc[0],y:this.Dc[0]}:void 0;if(!this.yc)return{x:this.Pc[0],y:this.Dc[0]};let t=this.fc-this.Ac;return t<0&&(t+=this.Uc),{x:this.Pc[t],y:this.Dc[t]}}Ic(){if(!this.Pc||!this.Dc||0===this.Ac)return;if(void 0===this.Uc){const t=this.Ac-1;return t>=0?{x:this.Pc[t],y:this.Dc[t]}:void 0}let t=this.fc-1;return t<0&&(t+=this.Uc),{x:this.Pc[t],y:this.Dc[t]}}Qc(t){if(!this.Pc||!this.Dc)return;const e=this.Pc.length,i=this.Ac,s=this.gc-1,r=Math.max(s-i+1,0)+t,n=uo(r,this.gc,e,this.fc);return{x:this.Pc[n],y:this.Dc[n],lookupValue:this.bc&&this.Oc?this.Oc[n]:void 0,id:this._c&&this.Yc?this.Yc[n]:void 0,color:this.Mc&&this.Nc?this.Nc[n]:void 0,size:this.wc&&this.Gc?this.Gc[n]:void 0,rotation:this.Cc&&this.Wc?this.Wc[n]:void 0,iSample:r}}Jc(t,e,i,s){const r=this.zc(),n=this.Pc,o=this.Dc;if(!n||!o)return;const h=(t,e)=>({x:n[t],y:o[t],lookupValue:this.bc&&this.Oc?this.Oc[t]:void 0,id:this._c&&this.Yc?this.Yc[t]:void 0,color:this.Mc&&this.Nc?this.Nc[t]:void 0,size:this.wc&&this.Gc?this.Gc[t]:void 0,rotation:this.Cc&&this.Wc?this.Wc[t]:void 0,iSample:e}),a=n.length,l=this.Ac,u=this.gc-1,c=Math.max(u-l+1,0);if(r){const i=this.Zc(),s=this.Ic();if(!(i&&s&&this.Pc&&this.Dc))return;const n="ProgressiveX"===r||"RegressiveX"===r?"x":"y",o="x"===n?"y":"x",l="x"===n?this.Pc:this.Dc,d="x"===o?this.Pc:this.Dc,f=t[n],g=Math.min(i[n],s[n]),y=Math.max(i[n],s[n]);if(fy)return;const m=fo(f,c,u,(t=>l[uo(t,this.gc,a,this.fc)])),p=uo(m,this.gc,a,this.fc);if(!e)return h(p,m);const x=m-1,A=m+1,S=f>=l[p]&&("ProgressiveX"===r||"ProgressiveY"===r)?A<=u?A:void 0:x>=c?x:void 0;if(void 0===S)return;const v=uo(S,this.gc,a,this.fc),b=l[p],M=d[p],w=l[v],C=d[v],T=Math.min(b,w),R=T===b?M:C,E=Math.max(b,w),k=T===b?m:S,I=(f-T)/(E-T),F=zn(R,E===b?M:C,I);return"ProgressiveX"===r||"RegressiveX"===r?{x:f,y:F,iSample:k+I}:{x:F,y:f,iSample:k+I}}let d,f=Number.MAX_VALUE;const g=ct(t,i,s),y=this.Ac-1;for(let t=0;t<=y;t+=1){const e=n[t],r=o[t];if(!Number.isNaN(e)&&!Number.isNaN(r)){const n=ut(e,i.x,s.x),o=ut(r,i.y,s.y),h=(n-g.x)**2+(o-g.y)**2;ht%i,co=(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=fo(t,u,l,(t=>i[uo(t,s,a)])),d=fo(e,u,l,(t=>i[uo(t,s,a)])),f=Math.max(c-h,u),g=Math.min(d+h,l),y=uo(f,s,a),m=uo(g,s,a);return y>m?{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:y,iLastSampleDataArray:m,dataRanges:[{offset:y,count:a-y},{offset:0,count:m+1}]}:{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:y,iLastSampleDataArray:m,dataRanges:[{offset:y,count:m-y+1}]}},fo=(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),mo=(t,e,i)=>{if(void 0!==t)return Array.isArray(t)?t.slice(e,i):t.subarray(e,i)};class po extends Vn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ya="label",this.ja=this.Is.Or(this.renderingScale).gr(this.ya).Ie(B).zr(Ie).Vr(Ie),this.setMargin(5),this.ku(this.ja)}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}De(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=ct(t,this.scale,this.renderingScale);return this.ja.Be(i),this}Ls(){this.ja.Ls();const t=0===this.ya.length?u(0,0):this.ja.td();return this.setContentSize(t),super.Ls()}setText(t){return this.ya=t,this.ja.gr(this.ya),this.Is.xs(),this}getText(){return this.ya}setFont(t){return this.ja.jh(t),this.Is.xs(),this}getFont(){return this.ja.Xh()}setTextRotation(t){return this.ja.Zh(t),this.Is.xs(),this}getTextRotation(){return this.ja.Qh()}}const xo={...kn,...Fn,uiElement:po};class Ao extends _n{constructor(t,e,i,s,r){super(t,e,i,s,r),this.sd=!1,this.fitTo=this.Vu.bind(this),this.setSize=this.fitTo,this.ja=this.Is.oc(e).Ie(B).Fe(nt),this.ku(this.ja)}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}setStrokeStyle(t){return this.ja.Fe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.po()}De(){const t=Je([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>ct(t,this.scale,this.renderingScale))));return this.sd?this.ja._l([{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.ja._l([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Vu(t){return this.setContentSize(t),this.Is.xs(),this}Ou(){return 0}Nu(){return 0}Wu(){return 0}Gu(){return 0}}class So extends _n{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ed=u(0,0),this.ja=t.hd(e).lu(0).Ge(360).Ie(B).Fe(nt),this.ku(this.ja)}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}setStrokeStyle(t){return this.ja.Fe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.po()}De(){const t=this.getSize(e.UISpace.Content).x/2;return this.ja.cu(t*this.renderingScale.Wi().x).du(t*this.renderingScale.Wi().y).Be(ct(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).Au(255).Ls(),this}Vu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.ed=t,this.Is.xs(),this}Ou(){return(this.getSize(e.UISpace.Content).x-this.ed.x)/2}Nu(){return(this.getSize(e.UISpace.Content).x-this.ed.x)/2}Wu(){return(this.getSize(e.UISpace.Content).y-this.ed.y)/2}Gu(){return(this.getSize(e.UISpace.Content).y-this.ed.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.ed=t,this}}class vo extends Bn{constructor(t,e,i,s,r){super(t,e,i,cn.Simple,s,r),this.rd=p(u(0,0)),this.nd=!1,this.Is=t,this.ac()}lc(){const t=this.rd.C();if(this.nd){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.rd.C().x*this.rd.C().x/4+this.rd.C().y*this.rd.C().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=ui(r,ui(i,s)),o=ui(n,ui(s,li(i,-1)));return[r,n,o,ci(o,ui(i,s))]}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}setStrokeStyle(t){return this.ja.Fe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.po()}Vu(t){return this.rd._(t),this.nd=!1,this.Is.xs(),this}Ou(){return this.nd?0:(this.getSize(e.UISpace.Content).x-this.rd.C().x)/2}Nu(){return this.nd?0:(this.getSize(e.UISpace.Content).x-this.rd.C().x)/2}Wu(){return this.nd?0:(this.getSize(e.UISpace.Content).y-this.rd.C().y)/2}Gu(){return this.nd?0:(this.getSize(e.UISpace.Content).y-this.rd.C().y)/2}fitTo(t){return this.rd._(t),this.nd=!0,this.Is.xs(),this}}class bo extends Bn{constructor(t,i,s,r,n){super(t,i,s,cn.Simple,r,n),this.od=p(u(0,0)),this.ad=p(10),this.ld=p(void 0),this.ju=p(e.UIDirections.Right),this.ac()}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}setStrokeStyle(t){return this.ja.Fe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.po()}setDirection(t){return this.ju._(t),this.Is.xs(),this}getDirection(){return this.ju.C()}setPointerLength(t){return this.ad._(t),this.Is.xs(),this}getPointerLength(){return this.ad.C()}setPointerAngle(t){return this.ld._(t),this.Is.xs(),this}getPointerAngle(){let t=this.ld.C();if(void 0===t){const e=this.ud();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)}Vu(t){return this.od._(t),this.Is.xs(),this}dd(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}fd(){return $t(this.ju.C())?this.od.C().x:this.od.C().y}ud(){return $t(this.ju.C())?this.od.C().y:this.od.C().x}Ou(){switch(this.ju.C()){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.dd()-this.ud());default:return 0}}Nu(){switch(this.ju.C()){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.dd()-this.ud());default:return 0}}Wu(){switch(this.ju.C()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.dd()-this.ud());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}Gu(){switch(this.ju.C()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.dd()-this.ud());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}lc(){const t=Kt(this.ju.C()),e=hi(u(0,0),t),i=this.getPointerLength(),s=this.dd(),r=this.fd(),n=this.ud();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=ui(ui(o,li(t,-i)),li(e,s/2)),a=ui(h,li(e,(n-s)/2)),l=ui(a,li(t,-r)),c=ui(ui(o,li(t,-i)),li(e,-s/2)),d=ui(c,li(e,-(n-s)/2)),f=ui(d,li(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:It(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class Mo extends Vn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.Vu.bind(this),this.setSize=this.fitTo,this.Ad=new lo,this.ja=this.Is.md(e).Oe(nt).yd(B).pd(B).gd(this.Ad),this.ku(this.ja)}Lu(){return[this.ja]}setShape(t){return this.ja.vd(t),this}getShape(){return this.ja.Sd()}setRotation(t){return this.ja.xd(t),this}getRotation(){return this.ja.bd()}setFillStyle(t){return this.ja.pd(t),this.Is.xs(),this}getFillStyle(){return this.ja.Md()}De(){const t=ct(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.ja.Sd(),s=this.ja.Md(),r=oo(e)&&e,n=Jn(s)&&s;if(r){const t=i/r.oi().y;this.ja._d(t)}else if(n){const t=n.source;if(t instanceof Image){const e=i/t.height;this.ja._d(e)}}else this.ja._d(i);this.Ad.appendSample(t)}return this}Vu(t){return this.setContentSize(t),this.Is.xs(),this}Ou(){return 0}Nu(){return 0}Wu(){return 0}Gu(){return 0}}const wo={...kn,...Fn,uiElement:Mo};class Co extends Pn{setSize(t){return this.setContentSize(t),this.Is.xs(),this}}class To extends bn{constructor(){super(...arguments),this.wd=[],this.Cd=0,this.kd=t=>{const e=this.wd.indexOf(t);e>=0&&this.wd.splice(e,1)}}getMembers(){return this.wd}getMemberCount(){return this.wd.length}setMinimumSize(t){return this.Td=t,this.Is.xs(),this}getMinimumSize(){return this.Td}addElement(t,e=-1){const i=t.tc(this.Is,this.renderingScale,this.scale,this.kd,this.Ki,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.wd.splice(e,0,i):this.wd.push(i),i.setVisible(this.getVisible()),this.ku(i),this.$i&&(pe(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.wd.slice().forEach(Et),this}setVisible(t){return super.setVisible(t),this.wd.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof Co)),0),s=i>0?(this.size.x-this.Cd)/i:0;return this.wd.reduce(((e,i)=>i instanceof Co?this.scale.pi({x:e,y:t.y},{x:s+i.getSize().x,y:0}).x:i.setOrigin(u(-1,1)).setPosition(u(e,t.y)).De().getPosition(u(1,0)).x),t.x),this}Ls(){for(let t=0;tt+ +(e instanceof Co)),0),s=i>0?(this.size.y-this.Cd)/i:0;return this.wd.reduce(((e,i)=>i instanceof Co?this.scale.pi({x:t.x,y:e},{x:0,y:-(s+i.getSize().y)}).y:i.setOrigin(u(-1,1)).setPosition(u(t.x,e)).De().getPosition(u(0,-1)).y),t.y),this}Ls(){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},_o=Vo("Text",[]),Bo={button:void 0,isLocked:!1,setOn(t){const e=this.button.getOn()!==t;return this.button.setOn(t),e&&this.R.emit("switch",t),this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.R.on("switch",(e=>t(this,e)))},offSwitch(t){return this.R.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()}},zo={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},No={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()}},Oo={...kn,...In,background:Ao,tc(t,e,i,s,r,n){const o=new Ro(t,e,i,this.background,s,r),h=o.addElement(xo,void 0),a=Object.assign(o,Lo,{setTextLabel:h},_o,{stylableTexts:[h]});return En(a,r,n),this.applyStylers(a,r)}}.addStyler(Tn),Uo={...kn,...In,background:bo,direction:e.UIDirections.Up,setDirection(t){return this.direction=t,this},tc(t,i,s,r,n,o){const h=this.direction,a=new Ro(t,i,s,this.background,r,n),l=a.addElement(xo,void 0),u=a.getBackground().setDirection(h),c=Object.assign(a,Lo,{setTextLabel:l},_o,{stylableTexts:[l]},No,{pointable:u},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?(this.setPadding({top:t}),l.setMargin({top:0})):this.getDirection()===e.UIDirections.Down?(this.setPadding({bottom:t}),l.setMargin({bottom:0})):this.getDirection()===e.UIDirections.Right?(this.setPadding({right:t}),l.setMargin({right:0})):this.getDirection()===e.UIDirections.Left&&(this.setPadding({left:t}),l.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 c.ic="other",c.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(c,n,o),this.applyStylers(c,n)}};class Yo extends vn{constructor(t,e,i,s,n,o){super(t,e,i,n,o),this.Rs=!1,this.R=new r.Eventer,this.Id=B,this.Pd=B,this.getOn=()=>this.Rs,this.Pd=o.uiButtonFillStyleHidden||o.uiButtonFillStyle,this.Dd=this.ku(new Mo(this.Is,this.renderingScale,this.scale,kt,o).setShape(s)).setFillStyle(this.Pd)}Lu(){return[...this.Dd.Lu()]}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setOn(t){return this.Rs=t,this.Dd.setFillStyle(t?this.Id:this.Pd),this.Is.xs(),this}setOffFillStyle(t){return this.Pd="function"==typeof t?t(this.Pd):t,this.Rs||this.Dd.setFillStyle(this.Pd),this}getOffFillStyle(){return this.Pd}setSize(t){return this.Dd.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.Dd.getSize()}setOnFillStyle(t){return this.Id="function"==typeof t?t(this.Id):t,this.Rs&&this.Dd.setFillStyle(this.Id),this}getOnFillStyle(){return this.Id}setButtonShape(t){return this.Dd.setShape(t),this.Is.xs(),this}getButtonShape(){return this.Dd.getShape()}De(){return super.De(),this.Dd.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).De(),this}Ls(){const t=this.Dd.Ls().getSize();return this.setContentSize(t),super.Ls()}dispose(){return super.dispose(),this.Dd.dispose(),this}setMouseInteractions(t){return this.Dd.setMouseInteractions(t),this}getMouseInteractions(){return this.Dd.getMouseInteractions()}setHighlight(t){const e=be(t);return this.Dd.setHighlight(e),this.R.emit("highlight",this,t),this.Is.xs(),this}getHighlight(){return this.Dd.getHighlight()}}const Go={...kn,uiElement:Yo,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},tc(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}},Xo={...kn,...In,background:Ao,buttonBuilder:Go,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},tc(t,i,s,r,n,o){const h=new Ro(t,i,s,this.background,r,n),a=h.addElement(Do);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Do);u.addGap();const c=u.addElement(xo);u.addGap(),h.addGap();const d=Object.assign(h,Lo,{setTextLabel:c},_o,{stylableTexts:[c]},Bo,{button:l},zo);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(Tn).addStyler(Rn);class Zo extends vn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Bd=[],this.Ld=2,this.Rd="",this.Ed=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:Fi(t.value,e.min,e.max),this.zd=0,this.Vd=0,this.Od=!1,this.Is=t,this.Nd=n,this.Gd=this.ku(t.Pe(e).Fe(nt)),this.Wd=this.ku(t.Or(e).Ie(r.uiTextFillStyle).jh(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.Ud=140,this.Yd=25):(this.Ud=160,this.Yd=15)}Lu(){return[this.Gd,this.Wd]}Hd(t){this.$d=t;const e=jo(t,"vertical"===this.Nd?0:90,this.Od);return this.Gd.Ie(e),this.Is.xs(),this}Xd(){return this.$d}jd(t){return this.Ud=t,this.Is.xs(),this}Zd(){return this.Ud}Qd(t){return this.Yd=t,this.Is.xs(),this}Jd(){return this.Yd}Kd(t){return this.Rd=t,this.Is.xs(),this}qd(){return this.Rd}tf(t){return this.Ed=t,this.Is.xs(),this}setLUTDisplayProportionalSteps(t){if(this.Od=t,this.$d){const t=jo(this.$d,"vertical"===this.Nd?0:90,this.Od);this.Gd.Ie(t)}return this.Is.xs(),this}getLUTDisplayProportionalSteps(){return this.Od}setFillStyle(t){return this.Wd.Ie(t),this.Is.xs(),this}getFillStyle(){return this.Wd.Hh()}setFont(t){return this.Wd.jh(t),this.Is.xs(),this}getFont(){return this.Wd.Xh()}setTextRotation(t){return this.Vd=t,this.Wd.Zh(t),this.Is.xs(),this}getTextRotation(){return this.Wd.Qh()}De(){var t,i,s,r;if(super.De(),this.$i||!this.getVisible())return this;const n=this.$d;if(n){const o=this.renderingScale.Wi(),h=n.min,a=n.max;if("vertical"===this.Nd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=ui(s,{x:this.Gd.oi().x+this.Ld*o.x,y:0}),l={x:r.x,y:r.y+(this.Rd.length>0?this.zd*o.y+this.Wd.oi().y:0)+.5*((null===(t=this.Bd[0])||void 0===t?void 0:t.oi().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Bd[this.Bd.length-1])||void 0===i?void 0:i.oi().y)||0)};this.Gd.Be({x:s.x,y:l.y}),this.Wd.Ya({x:-1,y:-1}).Be(r),n.getSteps().forEach(((t,e)=>{const i=Qe(l,u,this.Od?!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.Bd[e].Ya({x:-1,y:0}).Be(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.Bd.reduce(((t,e)=>Math.max(t,e.oi().y)),0),u=ui(t,{x:.5*((null===(s=this.Bd[0])||void 0===s?void 0:s.oi().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Bd[this.Bd.length-1])||void 0===r?void 0:r.oi().x)||0)+(this.Rd.length>0?this.zd*o.x+this.Wd.oi().x:0)),y:u.y},f={x:u.x,y:u.y+this.Ld*o.y};this.Gd.Be(f),this.Wd.Ya({x:1,y:1}).Be(c),n.getSteps().forEach(((t,e)=>{const i=Qe(u,d,this.Od?!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.Bd[e].Ya({x:0,y:1}).Be(i)}))}}return this}Ls(){if(this.$d&&this.getVisible()){const t=this.$d.getSteps();for(let e=this.Bd.length;eMath.max(t,e.Ls().td().x)),0),this.Wd.Ls().td().x),s=(this.Rd.length>0?this.zd+this.Wd.Ls().td().y:0)+e+.5*this.Bd[0].Ls().td().y+.5*this.Bd[this.Bd.length-1].Ls().td().y;this.setContentSize({x:i,y:s})}else{const t=this.Ud,e=this.Yd;this.Gd.it({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Rd.length>0?this.zd+this.Wd.Ls().td().x:0,.5*this.Bd[this.Bd.length-1].Ls().td().x),s=t+.5*this.Bd[0].Ls().td().x+i,r=e+this.Ld+this.Bd.reduce(((t,e)=>Math.max(t,e.Ls().td().y)),0);this.setContentSize({x:s,y:r})}}else this.Bd.forEach((t=>t.dispose())),this.Bd.length=0,this.Wd.setVisible(!1),this.Gd.setVisible(!1),this.setContentSize({x:0,y:0});return super.Ls()}dispose(){return super.dispose(),this.Gd.dispose(),this.Bd.forEach(Et),this.Wd.dispose(),this}setMouseInteractions(t){return this.Gd.setMouseInteractions(t),this}getMouseInteractions(){return this.Gd.getMouseInteractions()}}const Ho={lutElement:{},setLUT(t){return this.lutElement.Hd(t),this},getLUT(){return this.lutElement.Xd()},setLUTLength(t){return this.lutElement.jd(t),this},getLUTLength(){return this.lutElement.Zd()},setLUTThickness(t){return this.lutElement.Qd(t),this},getLUTThickness(){return this.lutElement.Jd()},setLookUpUnit(t){return this.lutElement.Kd(t),this},getLookUpUnit(){return this.lutElement.qd()},setLUTStepValueFormatter(t){return this.lutElement.tf(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},Wo={...kn,...In,background:Ao,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},tc(t,e,i,s,r,n){const o=new Eo(t,e,i,this.background,s,r),h=o.addElement({tc:()=>new Zo(t,e,i,kt,r,this.alignment)}),a=Object.assign(o,_o,{stylableTexts:[h]},Ho,{lutElement:h});return En(a,r,n),this.applyStylers(a,r)}}.addStyler(Tn),jo=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new it({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 Zo(t,i,s,kt,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,Lo,{setTextLabel:c},_o,{stylableTexts:[c,d]},Vo("LUTText",[d]),Bo,{button:l},Ho,{lutElement:d},zo);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(Tn).addStyler(Rn),$o={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 na?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.Xd&&t.Xd(),n=t.Fs&&t.Fs(),o=void 0!==s&&s;let h=i;if(!h){let t=r?Ko.setAlignment(this.alignment):Xo;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.if().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof na)).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}},Qo={alignment:"vertical",layoutBuilder:Do,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Po:Do}},getAlignment(){return this.alignment},titleBuilder:Oo,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},qo={...kn,...In,...Qo,background:Ao,tc(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).tc(t,e,i,s,r,!1);let h=Object.assign(o,$o,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.$i});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Do:Po),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 Jo extends vn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.sf=10,this.ef=e.UIDirections.Up,this.hf=0,this.ic="major",this.ya=this.ku(t.Or(this.renderingScale).zr(Ie).Vr(Ie)),this.Ve=this.ku(t.Ne(this.renderingScale))}Lu(){return[this.ya]}De(){if(super.De(),this.$i)return this;const t=ct(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.pi(t,{x:this.ef===e.UIDirections.Right?-this.sf:this.ef===e.UIDirections.Left?this.sf:0,y:this.ef===e.UIDirections.Up?-this.sf:this.ef===e.UIDirections.Down?this.sf:0}),s=this.renderingScale.pi(i,{x:this.ef===e.UIDirections.Right?-this.hf:this.ef===e.UIDirections.Left?this.hf:0,y:this.ef===e.UIDirections.Up?-this.hf:this.ef===e.UIDirections.Down?this.hf:0});return this.Ve.We(t).Ge(i),this.ya.Be(s).Ya(this.ef===e.UIDirections.Up?{x:0,y:1}:this.ef===e.UIDirections.Down?{x:0,y:-1}:this.ef===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Ls(){const t=this.Ve.pu().getThickness();return this.size=this.ef===e.UIDirections.Left||this.ef===e.UIDirections.Right?{x:this.sf+this.hf+this.ya.Ls().td().x,y:t}:{y:this.sf+this.hf+this.ya.Ls().td().y,x:t},super.Ls()}dispose(){return super.dispose(),this.ya.dispose(),this.Ve.dispose(),this}setVisible(t){return super.setVisible(t),this.ya.setVisible(t),this.Ve.setVisible(t),this}setMouseInteractions(t){return this.ya.setMouseInteractions(t),this.Ve.setMouseInteractions(t),this}getMouseInteractions(){return this.ya.getMouseInteractions()}getText(){return this.ya._r()}setTextFillStyle(t){return this.ya.Ie(t),this.Is.xs(),this}getTextFillStyle(){return this.ya.Hh()}setTextFont(t){return this.ya.jh(t),this}setTextRotation(t){return this.ya.Zh(t),this}getTextRotation(){return this.ya.Qh()}getTextFont(){return this.ya.Xh()}setText(t){return this.ya.gr(t),this.Is.xs(),this}setDirection(t){return this.ef=t,this.Is.xs(),this}getDirection(){return this.ef}setPointerLength(t){return this.sf=t,this.Is.xs(),this}getPointerLength(){return this.sf}setTickLabelPadding(t){return this.hf=t,this.Is.xs(),this}getTickLabelPadding(){return this.hf}setTickStyle(t){return this.Ve.Oe(t),this.Is.xs(),this}getTickStyle(){return this.Ve.pu()}}const th={...kn,direction:e.UIDirections.Up,setDirection(t){return this.direction=t,this},tc(t,e,i,s,r,n){const o=this.direction,h=new Jo(t,e,i,s,r);return En(h,r,n),h.setDirection(o),this.applyStylers(h,r)}}.addStyler(Tn),eh=th.addStyler(((t,e)=>(t.ic="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)))),ih=th.addStyler(((t,e)=>(t.ic="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)))),sh=Xo.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),rh=qo.setAlignment("horizontal"),nh=qo.setAlignment("vertical"),oh={TextBox:Oo,CheckBox:Xo,ButtonBox:sh,PointableTextBox:Uo,AxisTickMajor:eh,AxisTickMinor:ih,LUTRange:Wo},hh={HorizontalLegendBox:rh,VerticalLegendBox:nh},ah=(t,e)=>{var i;return e?"string"==typeof e?`${t} ${e}`:!1!==(null===(i=e.Wh)||void 0===i?void 0:i.displayInCursor)&&e.getUnits()?`${t} ${e.getUnits()}`:t:t},lh=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}},uh=(t,e,i,s=1)=>Ft(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),ch=(t,e,i,s=1)=>{const r=i.ft(t),n=i.ft(e);return Ft(i.dt(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)},dh={rf:0,nf:1,af:2,lf:3,uf:4,cf:5,df:6,ff:7,Af:8,gf:9,pf:10,yf:11,mf:12,vf:13,Sf:14,xf:15,bf:16,Mf:17,_f:18,wf:19,Cf:20,kf:21,Tf:22,Ff:23};class fh extends sr{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.If=r}}class gh extends ir{constructor(t,i,s,n,o,h,a,l,c,d,f,g,y,m,p,x){var A,S,v;super(d,c,a,m,p,{numeric:c.getWidth({x:m.xAxisNumericTicks,y:m.yAxisNumericTicks}),datetime:c.getWidth({x:m.xAxisDateTimeTicks,y:m.yAxisDateTimeTicks}),time:c.getWidth({x:m.xAxisTimeTicks,y:m.yAxisTimeTicks})},x),this.Pf=new Map,this.Df=void 0,this.Bf=0,this.Lf=[],this.Rf=[],this.hh=Os.fitting,this.Ef=!0,this.zf=8,this.Vf=void 0,this.Of=void 0,this.Nf=20,this.Gf=1,this.Wf=!0,this.Uf=!0,this.Yf=!0,this.Hf=!0,this.$f=!0,this.Xf=!0,this.jf=!0,this.Zf=!0,this.Qf=!0,this.Jf=!0,this.Kf=this.Lh.defaultDragMouseStyle,this.qf=this.Lh.defaultDragMouseStyle,this.tA=this.Lh.defaultDragMouseStyle,this.iA=this.Lh.defaultDragMouseStyle,this.sA=this.Lh.defaultDragMouseStyle,this.R=new r.Eventer,this.eA=[],this.hA=t=>{const e=this.Rf.indexOf(t);e>=0&&this.Rf.splice(e,1)},this.rA=t=>(this.Rf.indexOf(t)<0&&this.Rf.push(t),this.hA),this.nA="center",this.Rt=(t,e)=>this.R.emit("axisAreaTouch",this,e),this.oA=ee(this.eA),this.onAxisInteractionAreaMouseClick=t=>this.R.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.R.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.R.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.R.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.R.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.R.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.R.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.R.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.R.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.R.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.R.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.R.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.R.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.R.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.R.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.R.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.R.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.R.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.R.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.R.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.R.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.R.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.R.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.R.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.R.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.R.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.R.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.R.off(t,"axisAreaTouchEnd"),this.Ud={relative:1},this.aA=0,this.lA=0,this.uA=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().rc()):t,this.cA=t=>{const e=this.Lf.indexOf(t);-1!==e&&this.Lf.splice(e,1)},this.dA=(t,e)=>{this.R.emit("axisAreaDoubleClick",this,e),this.Hf&&(this.setStopped(!1),Qt(e))},this.fA=t=>{this.R.emit("axisAreaMouseEnter",this),(this.Uf||this.Wf||this.Yf||this.Hf)&&this.AA(t)},this.gA=t=>{this.pA(t),this.R.emit("axisAreaMouseLeave",this)},this.yA=(t,e,i)=>{var s,r;this.R.emit("axisAreaMouseDragStart",this,e,i);const n=Pt(null===(s=this.chart.mA.Jn)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Pt(null===(r=this.chart.mA.Jn)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Uf?(this.vA(t),Qt(e)):i===n&&this.Wf&&(this.SA(t,h),Qt(e))},this.xA=(t,e,i,s,r)=>{var n,o;this.R.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Pt(null===(n=this.chart.mA.Jn)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Pt(null===(o=this.chart.mA.Jn)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Uf?(this.bA(t,r),Qt(e)):i===h&&this.Wf&&(this.MA(t,s,l,r),Qt(e))},this._A=(t,e,i,s)=>{var r,n;this.R.emit("axisAreaMouseDragStop",this,e,i,s);const o=Pt(null===(r=this.chart.mA.Jn)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Pt(null===(n=this.chart.mA.Jn)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Uf?(this.wA(t),Qt(e)):i===o&&this.Wf&&(this.CA(t,s,a),Qt(e)),t.getIsUnderMouse()&&(this.Uf||this.Wf||this.Yf||this.Hf)&&this.AA(t)},this.kA=(t,e)=>{if(this.R.emit("axisAreaMouseWheel",this,e),this.Yf){this.setStopped(!0);const t=this.Lh.getWidth(this.TA.ls.Re(e.clientX,e.clientY)),i=this.At.dt(t);this.zoom(i,me(e)),Qt(e)}},this.FA=(t,e)=>this.R.emit("axisAreaMouseClick",this,e),this.IA=(t,e)=>this.R.emit("axisAreaMouseDown",this,e),this.PA=(t,e)=>this.R.emit("axisAreaMouseUp",this,e),this.DA=(t,e)=>this.R.emit("axisAreaMouseMove",this,e),this.BA=(t,e,i)=>{this.R.emit("axisAreaTouchStart",this,i),this.Wf&&(this.AA(t),this.SA(t,e),Qt(i))},this.LA=(t,e,i,s,r)=>{this.R.emit("axisAreaTouch",this,r),this.Wf&&(this.MA(t,e,i,s),Qt(r))},this.RA=(t,e,i,s)=>{this.R.emit("axisAreaTouchEnd",this,s),this.Wf&&(this.CA(t,e,i),this.pA(t),Qt(s))},this.EA=(t,e,i,s)=>{(this.Uf||this.Yf)&&(this.AA(t),this.vA(t),Qt(s))},this.zA=(t,e,i,s,r,n)=>{if(this.Uf){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.bA(t,e),Qt(n)}if(this.Yf){const t=this.TA.ls.Re(e.x,e.y),o=this.TA.ls.Re(i.x,i.y),h=Math.abs(this.Lh.getWidth(ci(t,s))-this.Lh.getWidth(ci(o,r)))-Math.abs(this.Lh.getWidth(t)-this.Lh.getWidth(o)),a=this.At.pi(this.Oh,-h),l=this.At.pi(this.Nh,h);this.sr(a,l,!0),Qt(n)}},this.VA=(t,e,i,s)=>{(this.Uf||this.Yf)&&(this.wA(t),this.pA(t),Qt(s))},this.OA=(t,e)=>{(this.$f||this.Xf)&&this.NA(t)},this.GA=(t,e)=>{this.WA(t)},this.UA=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.$f&&this.YA(t,s)},this.HA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.$f&&this.$A(t,n,s,r)},this.XA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.$f&&this.jA(t,n,s,r)},this.ZA=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.$f||this.Xf)&&this.QA(t,r,s),(this.$f||this.Xf)&&this.NA(t)},this.JA=(t,e)=>{this.Xf&&(this.setStopped(!0),this.zoom(this.Oh,me(e)),Qt(e))},this.KA=(t,e)=>{this.Xf&&(this.setStopped(!0),this.zoom(this.Nh,me(e)),Qt(e))},this.qA=(t,e,i)=>{this.$f&&(this.NA(t),this.YA(t,e),Qt(i))},this.tg=(t,e,i,s,r)=>{this.$f&&(this.$A(t,e,i,s),Qt(r))},this.ig=(t,e,i,s,r)=>{this.$f&&(this.jA(t,e,i,s),Qt(r))},this.sg=(t,e,i,s)=>{this.$f&&(this.QA(t,e,i),this.WA(t),Qt(s))},this.eg=t,this.TA=i,this.hg=n,this.rg=o,this.chart=d,this.ng=g,this.og=s,this.ts=h,"logarithmic"===x.type&&this.chart.ls.Xn(dh.wf),y(this,this.rA),a.ag=this,this.lg=f,this.ug=this.lg>50?1:-1,this.cg=(v=this.Lh.toPoint(0,-this.ug),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.dg=l,this.Ag=this.At instanceof Li?(new Bi).Ri(this.Lh.toVec2(this.At,this.dg)):(new zi).Ri(this.Lh.toVec2(this.At,this.dg)),this.gg=this.chart.pg,this.yg=(new Bi).Ri(this.Lh.toVec2(this.Lh.getWidth(this.gg),this.dg)),this.mg=this.TA.Ne(this.Ag).setMouseInteractions(!1),this.vg=this.TA.Ne(this.Ag).setMouseInteractions(!1),this.Sg=this.TA.Ne(this.Ag).setMouseInteractions(!1),this.xg=this.og.Pe(this.gg).Ie(c.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).Fe(nt).ia(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.bg=this.og.Pe(this.gg).Ie(c.getWidth({x:m.xAxisZoomingBandFillStyle,y:m.yAxisZoomingBandFillStyle})).Fe(c.getWidth({x:m.xAxisZoomingBandStrokeStyle,y:m.yAxisZoomingBandStrokeStyle})),this.Mg=this.og.Pe(this.gg).Ie(c.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).Fe(nt).ia(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this._g=this.og.Pe(this.gg).Ie(c.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).Fe(nt).ia(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.bh=this.og.Or(this.Ag).setMouseInteractions(!1).Zh(this.Lh.getTitleTextRotation(this.ug)).Vr(Ie).zr(Ie),this.chart.ls.os.ns(this.xg,(t=>this.xg.us(t)),{animationEnabled:this.ah}),this.chart.ls.os.ns(this.Mg,(t=>this.Mg.us(t)),{animationEnabled:this.ah}),this.chart.ls.os.ns(this._g,(t=>this._g.us(t)),{animationEnabled:this.ah});const b=ji(new $i(this.BA,this.LA,this.RA,1),new Qi(this.EA,this.zA,this.VA),new Ki(this.dA)),M=ji(new $i(this.qA,this.tg,this.sg)),w=ji(new $i(this.qA,this.ig,this.sg));this.xg.setMouseEnterEventHandler(this.fA).setMouseLeaveEventHandler(this.gA).setMouseDragStartEventHandler(this.yA).setMouseDragEventHandler(this.xA).setMouseDragStopEventHandler(this._A).setMouseWheelEventHandler(this.kA).setMouseDoubleClickEventHandler(this.dA).setMouseClickEventHandler(this.FA).setMouseDownEventHandler(this.IA).setMouseUpEventHandler(this.PA).setMouseMoveEventHandler(this.DA).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.Mg.setMouseEnterEventHandler(this.OA).setMouseLeaveEventHandler(this.GA).setMouseDragStartEventHandler(this.UA).setMouseDragEventHandler(this.HA).setMouseDragStopEventHandler(this.ZA).setMouseWheelEventHandler(this.JA).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this._g.setMouseEnterEventHandler(this.OA).setMouseLeaveEventHandler(this.GA).setMouseDragStartEventHandler(this.UA).setMouseDragEventHandler(this.XA).setMouseDragStopEventHandler(this.ZA).setMouseWheelEventHandler(this.KA).setTouchStartEventHandler(w.onTouchStart).setTouchMoveEventHandler(w.onTouchMove).setTouchEndEventHandler(w.onTouchEnd),this.mg.Oe(c.getWidth({x:m.xAxisStrokeStyle,y:m.yAxisStrokeStyle})),this.vg.Oe(c.getWidth({x:m.xAxisNibStyle,y:m.yAxisNibStyle})),this.Sg.Oe(c.getWidth({x:m.xAxisNibStyle,y:m.yAxisNibStyle})),this.bh.Ie(c.getWidth({x:m.xAxisTitleFillStyle,y:m.yAxisTitleFillStyle})).jh(c.getWidth({x:m.xAxisTitleFont,y:m.yAxisTitleFont})),this.ss=h.es(this,{}),this.Jh=this.ss.wg([this.bh]).Ss(m.effectsText),this.Cg=null!==(A=c.getWidth({x:m.xAxisMarginAfterTicks,y:m.yAxisMarginAfterTicks}))&&void 0!==A?A:7,this.kg=null!==(S=c.getWidth({x:m.xAxisMarginAfterTitle,y:m.yAxisMarginAfterTitle}))&&void 0!==S?S:7}Rr(){return this.dh}Er(){return void 0!==this.ir}setTickStrategy(t,e){return super.Vh(t,e)}getTickStrategy(){return this.ih}addBand(t=!0){const e=t?this.rg:this.hg,i=new zs(e,this.chart,this.oA,this,this.Ag,this.Lh,this.Ki,this.ts);return this.eA.push(i),i}addConstantLine(t=!0){const e=t?this.rg:this.hg,i=new Ns(e,this.chart,this.oA,this,this.Ag,this.Lh,this.Ki,this.ts);return this.eA.push(i),i}Tg(t){this.eA.forEach(t)}Fg(t){return this.eA.map(t)}getHighlighters(){return this.eA}setThickness(t){return"number"==typeof t?(this.Ig=t,this.Pg=t):"object"==typeof t&&(this.Ig=t.min,this.Pg=t.max),this.chart.ls.xs(),this}getThickness(){return{min:this.Ig,max:this.Pg}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}Dg(){return this.Rf}mr(t,e){return new fh(e,t,this.TA,this.Ag,this.Ag)}Kh(){if(this.Pf){for(const t of this.Pf)t[1].grid.dispose(),t[1].tick.dispose();this.Pf.clear()}super.Kh()}vr(t,e){const{tickStart:i}=e,s=t.Fh.yr,r=i+s.getTickLength()*this.ug+s.getTickPadding()*this.ug;t.Ke.Be(this.Lh.toPoint(t.M,r)).Ya(this.Lh.toPoint(s.getLabelAlignment(),-this.ug)).Zh(s.labelRotation).setVisible(this.getVisible())}Bg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.Fh.yr,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.ug;return{gridStroke:{start:this.Lh.toPoint(t.M,r),end:this.Lh.toPoint(t.M,h)},tickStroke:{start:this.Lh.toPoint(t.M,n),end:this.Lh.toPoint(t.M,a)}}}Dr(t,e){return"linear"===this.Eh.type?uh(t,e,this.At):ch(t,e,this.At)}Lg(t,e){return e instanceof Li?uh:ch}Lr(t,e,i){if("logarithmic"!==this.Eh.type){const s=this.At.Li(e-t);return{min:t-i*s,max:e+i*s}}const s=this.At;return{min:s.pi(t,-i),max:s.pi(e,i)}}Ls(){if(!this.Xi)return{Rg:0,Eg:0,Yd:0};const t=!(this.sh.size>0),e=this.bh&&this.bh._r().length>0&&this.getTitleFillStyle()!==B,i=this.Lh.getHeight(e?this.chart.ls.Vg.zg(this.bh._r(),this.getTitleFont(),this.getTitleRotation()):{x:0,y:0})+(e?this.kg:0),s=qs(this.th)?new Map:rr(this.th,Math.min(this.Oh,this.Nh),Math.max(this.Oh,this.Nh),this.Oh,this.Nh,0),r=this.At;let n=0;s.forEach(((e,i)=>{if((t=>void 0!==t.yr&&void 0!==t.Ar)(i)){const s=Math.max(...e.map((e=>{if(!je(e,this.Oh,this.Nh))return 0;const s=this.chart.ls.Vg.zg(i.Ar(e,r),i.yr.labelFont,i.yr.labelRotation);return t||!s.isEstimate?this.Lh.getHeight(s):0})))+i.yr.tickLength+i.yr.tickPadding;n=Math.max(n,s)}}));const o=this.Lf.reduce(this.uA,0);n=Math.max(n,o),n+=this.Cg;const h=Ft(i+n,void 0!==this.Ig?this.Ig:0,void 0!==this.Pg?this.Pg:Be);return this.Bf=h,{Rg:n,Eg:i,Yd:h}}De(t){const e=this.getVisible()&&t.Og>0;this.Ng=t;const i=this.mg.pu(),s=this.At.getInnerStart()this.At.getInnerStart()?this.At.getInnerEnd():this.At.getInnerStart(),n=i.getThickness()*this.ug/2,o=this.dg.getInnerInterval(),h=this.lg/100*o,a=h+t.Gg,l=o*this.ug,u=a+n;if(e||this.Kh(),!qs(this.th)&&e){const t=this.At.ri();this.rr({physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});for(const[e,i]of this.sh){let s=this.Pf.get(e);if(!s)if(e.Ue)s={grid:this.eg[0].Wg(this.Ag).setMouseInteractions(!1),tick:this.eg[0].Wg(this.Ag).setMouseInteractions(!1)};else if("Ug"in e){const t=Array.from(this.sh.keys()).filter((t=>"Ug"in t)).reverse().indexOf(e),i=this.eg[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.Wg(this.Ag).setMouseInteractions(!1),tick:i.Wg(this.Ag).setMouseInteractions(!1)}}if(s){s.grid.Ot(),s.tick.Ot();for(const[e,r]of i){const e=this.Bg(r,{physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});s.grid.Hr().Yg(e.gridStroke.start,e.gridStroke.end),s.tick.Hr().Yg(e.tickStroke.start,e.tickStroke.end)}s.grid.Oe(e.yr.getGridStrokeStyle()),s.tick.Oe(e.yr.getTickStyle()),this.Pf.set(e,s)}}}const c=u,d=c+this.ug*t.Hg,f=this.$f||this.Xf?Math.min(this.Nf,.25*t.Og):0,g={start:this.Lh.toVec2(this.At.pi(this.At.getInnerStart(),f),c),end:this.Lh.toVec2(this.At.pi(this.At.getInnerEnd(),-f),d)},y=ct(this.Lh.toVec2(this.At.getInnerStart(),d),this.Ag,this.gg),m=ct(g.start,this.Ag,this.gg),p=ct(g.end,this.Ag,this.gg),x=ct(this.Lh.toVec2(this.At.getInnerEnd(),c),this.Ag,this.gg);this.mg.We(this.Lh.toPoint(s,a)).Ge(this.Lh.toPoint(r,a)).setVisible(e),this.vg.We(this.Lh.toPoint(this.At.pi(this.At.getInnerStart(),this.zf),a)).Ge(this.Lh.toPoint(this.At.getInnerStart(),a)).setVisible(e),this.Sg.We(this.Lh.toPoint(this.At.pi(this.At.getInnerEnd(),-this.zf),a)).Ge(this.Lh.toPoint(this.At.getInnerEnd(),a)).setVisible(e);const A=a+t.Rg*this.ug;if(this.bh.Be(this.Lh.toPoint(this.Lh.getWidth(ct("center"===this.nA?li(ui(y,x),.5):"start"===this.nA?y:x,this.gg,this.Ag)),A)).Ya(this.Lh.toPoint("center"===this.nA?0:"start"===this.nA?-1:1,-1*this.ug)).setVisible(e).setMouseInteractions(void 0!==["mouseEnterTitle","mouseMoveTitle","mouseLeaveTitle","mouseDownTitle","mouseUpTitle","mouseClickTitle","mouseDoubleClickTitle","mouseDragStartTitle","mouseDragTitle","mouseDragStopTitle","mouseWheelTitle","touchStartTitle","touchMoveTitle","touchEndTitle"].find((t=>this.R.listeners(t).size>0))),this.Df){const e=this.lg/100*o+t.Gg,i=-this.ug*o-t.Gg,s={start:this.Lh.toVec2(this.Df.min,u+this.ug*this.Bf),end:this.Lh.toVec2(this.Df.max,e+i)},r=ct(s.start,this.Ag,this.gg),n=ct(s.end,this.Ag,this.gg);this.bg.Be(r).it(ci(n,r)).setVisible(!0)}else this.bg.setVisible(!1);this.xg.Be(m).it(ci(p,m)).setVisible(e),this.Mg.Be(y).it(ci(m,y)).setVisible(e),this._g.Be(p).it(ci(x,p)).setVisible(e);for(const i of this.Lf)i.update().plot(e,a,l,t.Gg,u);for(const t of this.eA)t.De()}setLength(t){return this.Ud=t,this.chart.ls.xs(),this}getLength(){return this.Ud}setMargins(t,e){return this.aA=t,this.lA=e,this.chart.ls.xs(),this}getMargins(){return{start:this.aA,end:this.lA}}getStackIndex(){var t,e;return null!==(e=null===(t=[...this.chart.$g,...this.chart.Xg,...this.chart.jg,...this.chart.Zg].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.$g,...this.chart.Xg,...this.chart.jg,...this.chart.Zg].find((t=>t.axis===this)))||void 0===t?void 0:t.iParallel)&&void 0!==e?e:0}Qg(){const t=this.Ng;if(!t)return;const e=this.getVisible()&&t.Og>0,i=this.mg.pu().getThickness()*this.ug/2,s=this.dg.getInnerInterval(),r=this.lg/100*s+t.Gg,n=s*this.ug,o=r+i;for(const i of this.Lf)i.update().plot(e,r,n,t.Gg,o);for(const t of this.eA)t.De()}Jg(){return this.Bf}Kg(t,e){e=e||oh.AxisTickMajor;const i=new Cn(this,t?this.eg[0]:this.og,this.og,this.At,this.yg,this.yg,this.Lh,this.cg,this.cA,this.Ki,e).setTextFormatter(this.formatValue);return this.Lf.push(i),i}AA(t){this.chart.ls.os.ws(t,1),this.Vf=t.ls.Qr(this.Kf,this.Vf)}pA(t){this.chart.ls.os.ws(t,0),t.ls.Jr(this.Vf)}vA(t){this.setStopped(!0),t.ls.Jr(this.Vf)}bA(t,e){const i=-this.Lh.getWidth(e);this.pan(i),this.Vf=t.ls.Qr(this.qf,this.Vf)}pan(t){const e=this.Oh,i=this.Nh,s=this.At.pi(e,t),r=this.At.pi(i,t);this.sr(s,r,!1)}zoom(t,e){const i=this.At.ft(this.Oh),s=this.At.ft(this.Nh),r=this.At.ft(t),n=Ft((r-i)/(s-i),0,1),o=.2*this.At.ri(),h=n*this.Gf*o*-e,a=(1-n)*this.Gf*o*e,l=this.At.pi(this.Oh,h),u=this.At.pi(this.Nh,a);this.sr(l,u,!0)}wA(t){this.Df=void 0,t.ls.Jr(this.Vf)}SA(t,e){this.setStopped(!0),t.ls.Jr(this.Vf),this.chart.ls.os.ws(this.xg,0)}MA(t,e,i,s){const r=ct(this.TA.ls.Re(i.x,i.y),this.TA.ls.At,this.Ag),n=Ft(this.Lh.getWidth(r),this.Oh,this.Nh),o=this.Lh.getWidth(ct(this.TA.ls.Re(e.x,e.y),this.TA.ls.At,this.Ag));Math.abs(this.At.ft(n)-this.At.ft(o))>10?(this.Df=y(Math.min(n,o),Math.max(n,o)),this.Vf=t.ls.Qr(this.tA,this.Vf)):(this.Df=void 0,this.Vf=t.ls.Qr(this.Kf,this.Vf)),this.TA.xs()}CA(t,e,i){if(this.Df){const t=this.Df.min,e=this.Df.max,i=this.Nh{e.ps(t)}));for(const e of this.Pf.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.chart.ls.xs(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.ah),this}}var yh;e.AxisXYTitlePositionOptions=void 0,(yh=e.AxisXYTitlePositionOptions||(e.AxisXYTitlePositionOptions={})).Start="start",yh.Center="center",yh.End="end";const mh={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},ph={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},xh=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof gh&&"y"in t&&t.y instanceof gh),Ah=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new Ji,tickLength:7,tickStyle:new Ji,tickPadding:0,labelFont:new lr,labelFillStyle:new U,labelAlignment:0,labelRotation:0});class Sh extends Ah{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")}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 vh=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),bh=new Sh({labelFillStyle:B,gridStrokeStyle:nt,tickStyle:nt}),Mh=t=>vh(t)&&z(t.labelFillStyle)&&ot(t.gridStrokeStyle)&&ot(t.tickStyle),wh=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new Sh,minorTickStyle:new Sh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Ch=(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"},Th={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}${ge(s,2)}:${ge(r,2)}:${ge(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}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(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}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(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}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(o,3)}${h}`}},Rh={MajorHours12:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Hs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,4)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,36e5,1e6),fitKeyValues:js({},2,3,4,6)},defaultValueFormatter:Th.hhmmss},MajorHours:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Hs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,6,12)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,3e5,1e6),fitKeyValues:js({},2,4,6)},defaultValueFormatter:Th.hhmmss},MajorMinutes15:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Hs(t,e,9e5,void 0,1e6)),fitKeyValues:js({ignore:"first"},2)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,6e4,1e6),fitKeyValues:js({},3,5)},defaultValueFormatter:Th.hhmmss},MajorMinutes:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Hs(t,e,6e4,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,5e3,1e6),fitKeyValues:js({},2,3,4,6)},defaultValueFormatter:Th.hhmmss},MajorSeconds15:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Hs(t,e,15e3,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,4)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,1e3,1e6),fitKeyValues:js({},3,5)},defaultValueFormatter:Th.hhmmss},MajorSeconds:{major:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Hs(t,e,1e3,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>Zs(t,e,100,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmm},MajorMilliseconds100:{major:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Hs(t,e,100,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>Zs(t,e,10,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmm},MajorMilliseconds10:{major:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Hs(t,e,10,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>Zs(t,e,1,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmm},MajorMilliseconds:{major:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Hs(t,e,1,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Zs(t,e,.1,1e6),fitKeyValues:js({},2)},defaultValueFormatter:Th.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Hs(t,e,.1,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Zs(t,e,.01,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Hs(t,e,.01,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Zs(t,e,.001,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Th.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Hs(t,e,.001,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Zs(t,e,100*1e-6,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Th.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Hs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Zs(t,e,10*1e-6,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.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 Eh extends wh{He(t){const e=this.timeOrigin||0,i=[{Ke:"Major ticks",Ug:0,yr:this.majorTickStyle,Ar:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Ch(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Rh[r].major.format)(t+e,i,s)},Gr:(t,e,i,s)=>{const r=Ch(i,s);return(0,Rh[r].major.getKeyValues)(t,e,i,s)},Ih:{Sr:(t,e,i,s,r,n)=>{const o=Ch(r,n),h=Rh[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Wr:void 0}];return vh(this.minorTickStyle)&&i.push({Ke:"Minor ticks",Ug:1,yr:this.minorTickStyle,Ar:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Ch(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Rh[r].minor.format)(t+e,i,s)},Gr:(t,e,i,s)=>{const r=Ch(i,s);return(0,Rh[r].minor.getKeyValues)(t,e,i,s)},Ih:{Sr:(t,e,i,s,r,n)=>{const o=Ch(r,n),h=Rh[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Wr:void 0}),{$e:[],Xe:i,je:this.cursorFormatter||((t,i,s)=>{const r=Ch(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Rh[r].defaultValueFormatter(t+e,i,s)}),Ze:1e-4,Qe: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 kh=(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},Ih=(t,e,i,...s)=>kh(-1,t,e,i,s),Fh=(t,e,i,...s)=>kh(-1,t,e,i,s),Dh=(t,e,i,...s)=>kh(0,t,e,i,s),Ph=(t,e,...i)=>kh(1,t,e,void 0,i),Lh=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},Vh=[{label:"MilliSecond1",unit:1,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:js({offset:0},2,5)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"MilliSecond10",unit:10,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("millis",10,(t=>t.millis%10==0),"millis")},majorTicks:{fitFunction:js({offset:0},2,5)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("millis",100,(t=>t.millis%100==0),"millis")},majorTicks:{fitFunction:js({offset:0},2,5)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Ks(5,10,15,30)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Ks(5,10,15,30)},minorTicks:{amount:12,fitFunction:js(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Ks(3,6,12)},minorTicks:{amount:8,fitFunction:js(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("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:Lh(-1),getNextKeyValueIncludingRef:Lh(0),getNextKeyValue:Lh(1),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:Fh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Dh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:Ph("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:Fh("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:Dh("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:Ph("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:Fh("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:Dh("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:Ph("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:Fh("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:Dh("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:Ph("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:Fh("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:Dh("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:Ph("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],_h=(t,e,i,s,r)=>{const n=e-t;let o;for(let t=r?0:Vh.length-1;r?t=0;r?t+=1:t-=1){const e=n/Vh[t].unit;if((void 0===i||e>=i)&&(void 0===s||e<=s)){o=Vh[t];break}}return o},Bh=(t,e,i)=>{let s=_h(e,i,void 0,1,!0);if(void 0!==s&&0===Vh.indexOf(s)&&(s=Vh[1]),void 0===s)return;if("great"===t)return s;const r="major"===t?1:2,n=Vh[Vh.indexOf(s)-r];return void 0===n?Vh[0]:n},zh=(t,e,i)=>(s,r,n,o)=>{const h=Bh("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(Vh.indexOf(h)<=Vh.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=Hs(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||je(d,l,u)?[a]:[d]:void 0!==d&&je(d,l,u)?[d]:[u]},Nh=(t,e,i)=>(s,r,n,o)=>{const h=Bh(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=Hs(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 Vh[Vh.indexOf(t)+1]})(h);if(void 0===t)return[];a=Zs(s,r,t.unit/h.minorTicks.amount,1)}}return a},Oh=t=>(e,i,s,r,n,o)=>{const h=Bh(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},Uh=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new Sh,majorTickStyle:new Sh,minorTickStyle:new Sh,formatOptionsMajorCentury:{year:"numeric",hour12:!1},formatOptionsMinorDecade:{year:"numeric",hour12:!1},formatOptionsMajorDecade:{year:"numeric",hour12:!1},formatOptionsMinorYear:{year:"numeric",hour12:!1},formatOptionsMajorYear:{year:"numeric",hour12:!1},formatOptionsMinorMonth:{month:"short",hour12:!1},formatOptionsGreatYear:{year:"numeric",hour12:!1},formatOptionsMajorMonth:{month:"long",hour12:!1},formatOptionsMinorWeek:{day:"numeric",hour12:!1},formatOptionsGreatMonth:{year:"numeric",month:"long",hour12:!1},formatOptionsMajorWeek:{day:"numeric",weekday:"short",hour12:!1},formatOptionsMinorDay:{day:"numeric",weekday:"short",hour12:!1},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",hour12:!1}).format(s)} Week ${r}`},formatOptionsMajorDay:{weekday:"long",day:"numeric",hour12:!1},formatOptionsMinorHour:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsGreatDay:{year:"numeric",month:"long",day:"numeric",hour12:!1},formatOptionsMajorHour:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsMinorMinute:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsGreatHour:{year:"numeric",month:"long",day:"numeric",hour12:!1},formatOptionsMajorMinute:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsMinorSecond:{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},formatOptionsGreatMinute:{year:"numeric",month:"long",day:"numeric",hour12:!1},formatOptionsMajorSecond:{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},formatOptionsMinorMillisecond:t=>{const e=new Date(t);return e.setHours(0,0,0,0),Th.hhmmssmmm(t-e.getTime())},formatMillisecondRange:t=>{const e=new Date(t);return e.setHours(0,0,0,0),Th.hhmmssmmm(t-e.getTime())},formatOptionsGreatSecond:{},formatOptionsMajorMilliSecond:{}});class Yh extends Uh{He(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>Vh.map((e=>{const i=((t,e,i)=>{switch(i.label){case"MilliSecond1":case"MilliSecond10":case"MilliSecond100":return"Great"===e?t.formatOptionsGreatMinute:t.formatMillisecondRange;case"Second":return"Great"===e?t.formatOptionsGreatMinute:"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]},`;wt.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=Bh(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){const t=It(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[Vh.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{Ke:"Great ticks (directive)",Ug:0,Ye:!0,Gr:Nh("great",e,this.utc),Wr:void 0},{Ke:"Major ticks",Ug:1,yr:this.majorTickStyle,Ar:n("major"),Gr:Nh("major",e,this.utc),Ih:{Sr:Oh("major")},Wr:void 0}];Mh(this.greatTickStyle)||(o.push({Ke:"Great ticks (left)",yr:this.greatTickStyle.setLabelAlignment(-1),Ar:n("great","left"),Gr:zh(e,this.utc,"left"),Ue:!0,wr:!1}),o.push({Ke:"Great ticks (right)",yr:this.greatTickStyle.setLabelAlignment(1),Ar:n("great","right"),Gr:zh(e,this.utc,"right"),Ue:!0,wr:!1})),Mh(this.minorTickStyle)||h.push({Ke:"Minor ticks",Ug:2,yr:this.minorTickStyle,Ar:n("minor"),Gr:Nh("minor",e,this.utc),Ih:{Sr:Oh("minor"),Ph:(t,e,i,s,r,n)=>{const o=Bh("minor",r,n);return!o||"Week"!==o.label}},Wr:void 0});const a=this.cursorFormatter;return{$e:o,Xe:h,je:a?(t,i,s)=>a(e+t,i,s):(t,i,s)=>{const r=_h(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()),void 0,1,!0),n=r&&r.unit<=6e4,o=new Date(e+t),h=new Date(e+t);h.setHours(0,0,0,0);const a=n?Th.hhmmssmmm:Th.hhmmss;return`${new Intl.DateTimeFormat(s,{year:"numeric",month:"numeric",day:"numeric"}).format(o)} ${a(o.getTime()-h.getTime())}`},Ze:1,Qe: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("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("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 Gh=(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 Hs(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,Zs(i,s,o,h)},Xh=(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,Zh=(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,Hh=js(void 0,2,5),Wh=(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,jh=(t,e)=>{const i=Ti(t),s=Ri(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&&sDi.LogarithmicNoExponents(e,i,void 0,t.base):Di.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Di.LogarithmicNoExponents(e,i,void 0,t.base):Di.Numeric),r=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Di.LogarithmicNoExponents(e,i,void 0,t.base):Di.Numeric),n=[],o=[];Mh(this.extremeTickStyle)||n.push({Ke:"Extreme ticks",yr:this.extremeTickStyle,Ar:void 0===e?i:(t,s,r)=>i(e+t,s,r),Gr:Xs,Ue:!0,wr:!0}),o.push({Ke:"Major ticks",Ug:0,yr:this.majorTickStyle,Ar:void 0===e?s:(t,i,r)=>s(e+t,i,r),Gr:"logarithmic"===t.type?jh(t.base,!0):Gh(0,!0),Ih:"logarithmic"===t.type?{Sr:Zh}:{Sr:Xh},Wr:void 0}),Mh(this.minorTickStyle)||o.push({Ke:"Minor ticks",Ug:1,yr:this.minorTickStyle,Ar:void 0===e?r:(t,i,s)=>r(e+t,i,s),Gr:"logarithmic"===t.type?jh(t.base,!1):Gh(1,!1),Ih:"logarithmic"===t.type?{Sr:Wh}:{Sr:Hh},Wr:50});const h=this.cursorFormatter?this.cursorFormatter:Di.Numeric;return{$e:n,Xe:o,je:void 0===e?h:(t,i,s)=>h(e+t,i,s),Ze:1e-9,Qe: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!==bh?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 Qh=(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(wt.navigator.msSaveBlob)wt.navigator.msSaveBlob(r,e);else{const t=wt.document.createElement("a");wt.document.body.appendChild(t);const i=wt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{wt.URL.revokeObjectURL(i),wt.document.body.removeChild(t)}),0)}},qh=(t,i,s,r,n,o)=>{const h=t.tc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},Jh=(t,e)=>{if("relative"===t)return e;if(t instanceof _i)return t;const i=t.x instanceof ir?t.x.At:t.x.x,s=t.y instanceof ir?t.y.At:t.y.y;return Ni(i,s)},ta=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=xh(o)?o:Yi(o)?s:void 0;if(h&&Oi(i)){const t=ct(n,h,r.At);return r.Oo({engineX:t.x,engineY:t.y})}if(h&&Yi(i))return ct(n,h,s);if(h&&xh(i))return ct(n,h,i)}else{const i=t;if(Yi(e)){const t=r.Vo(i);return ct({x:t.engineX,y:t.engineY},r.At,s)}if(xh(e)){const t=e,s=r.Vo(i);return ct({x:s.engineX,y:s.engineY},r.At,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class ea{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.qg=[],this.tp=[],this.R=new r.Eventer,this.ip=void 0,this.sp=void 0,this.ep=void 0,this.Xt=x(0,0,0,0),this.hp=!1,this.$i=!1,this.rp=()=>{this.np=!0,this.op.xs()},this.ap=t=>e=>{const i=this.qg.indexOf(e);-1!==i&&this.qg.splice(i,1),this.ls.xs(),t.Y()},this.lp=t=>{const e=this.tp.indexOf(t);-1!==e&&this.tp.splice(e,1),this.ls.xs()},this.np=!0,this.onInViewChange=t=>this.R.on("inViewChange",t),this.offInViewChange=t=>this.R.off(t,"inViewChange"),this.mA=t,this.up=i,this.op=s,this.removePanel=n,this.Ki=e.ls.Ki;const l=e.ls.oi();if(this.uiScale=i.d2({scaleXYConstructor:Bi}).Vi(0,100).Oi(0,100).it(l),this.pg=i.d2({scaleXYConstructor:Bi}).Vi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).it(l),this.engine=e.ls.cp,this.ls=e.ls.dp,this.ss=this.ls.ss.es(this,{}),this.fp=()=>e.Ap("unidentified ui"),this.gp=e.pp(),this.yp=this.op.Pe(this.uiScale).Be(u(0,0)).it(u(100,100)).Ie(o).Fe(h).setMouseMoveEventHandler(((t,e)=>this.R.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.R.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.R.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.R.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.R.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.R.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.R.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.R.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.R.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.R.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.R.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.R.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.R.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.R.emit("touchEndPanelBackground",this,e))),a){const t=a.on(this.rp);this.mp=()=>a.off(t)}else{const t=e.ls.Do(this.rp);this.vp=e.ls.Bo.bind(e.ls,t)}const c=e.ls.Ro((t=>{this.hp=t,this.R.emit("inViewChange",this,t)}));this.Sp=e.ls.Eo.bind(e.ls,c),this.ip=n}getTheme(){return this.Ki}getSizePixels(){return this.pg.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.yp.Ie(t),this.op.xs(),this}getBackgroundFillStyle(){return this.yp.Hh()}setBackgroundStrokeStyle(t){return this.yp.Fe(t),this.op.xs(),this}getBackgroundStrokeStyle(){return this.yp.po()}translateCoordinate(t,e,i){return ta(t,e,i,this.pg,this.ls)}xp(t){return this.qg.push(t),this.ls.xs(),t}bp(t){return this.tp.push(t),this.ls.xs(),t}addUIElement(t=Oo,e=this.uiScale){e=Jh(e,this.pg);const i=this.fp();return this.xp(qh(t,i,this.uiScale,e,this.ap(i),this.Ki))}addLegendBox(t=qo,i=this.uiScale){i=Jh(i,this.pg);const s=this.bp(qh(t,this.gp,this.uiScale,i,this.lp,this.Ki));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Es.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Es.CenterBottom).setPosition(this.uiScale.pi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.tp}dispose(){return this.$i||(this.$i=!0,this.vp&&this.vp(),this.mp&&this.mp(),ia(this.uiScale),ia(this.pg),this.Sp&&this.Sp(),this.sp&&this.sp(),this.op.Y(),this.gp.Y(),this.qg.slice().forEach((t=>{t.dispose()})),this.tp.slice().forEach((t=>{t.dispose()})),this.ls.xs(),this.ip&&this.ip(this),this.R.emit("dispose",this)),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}saveToFile(t,e,i){return Qh(this.engine,t,e,i),this}zr(t){this.Xt=t,this.rp()}J(){return this.pg.J(),this.uiScale.J(),this}K(){return this.pg.K(),this.uiScale.K(),this}De(t){if(this.np){const t=this.op.ls.oi(),e=t.x,i=t.y;this.uiScale.it(e,i),this.pg.it(e,i);const s=[this.Xt.left,this.Xt.right],r=[this.Xt.bottom,this.Xt.top];this.uiScale.Ei(s),this.uiScale.zi(r);const n=this.uiScale.getInnerIntervalPixels();this.pg.Vi(0,n.x).Ei(s).Oi(0,n.y).zi(r),this.R.emit("resize",this,n.x,n.y,e,i)}this.np=!1}Mp(){for(let t=0;t{t.ii&&t.ii()};class sa extends ea{constructor(t,e,i,s,r,n){super(t,e,i,e.wp("uipanel bg",0),s,e.ls.Ki.uiPanelBackgroundFillStyle,e.ls.Ki.uiPanelBackgroundStrokeStyle,n),this._p(r,this.pg)}setMinimumSize(t){return this.Td=t,this.ls.xs(),this}getMinimumSize(){return this.Td}De(t){super.De(t),super.Mp()}}const ra=x(10,10,10,10);class na extends ea{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.Cp={},this.wa=ra,this.ah=!0,this.kp=e.Tp("chart internal ui",0),this.mh=this.kp.Or(this.uiScale).gr("Chart").Be(u(50,100)).Ya(u(0,1)).jh(h).Ie(a).setMouseInteractions(!1),this.Fp=this.ss.wg([this.mh]).Ss(this.Ki.effectsText)}setAnimationsEnabled(t){return this.ah=t,this}getAnimationsEnabled(){return this.ah}setTitle(t){return this.mh.gr(t),this.ls.xs(),this}getTitle(){return this.mh._r()}getTitleSize(){return this.mh.Ls().td()}setTitleFillStyle(t){return this.mh.Ie(t),this.rp(),this}getTitleFillStyle(){return this.mh.Hh()}setTitleFont(t){return this.mh.jh(t),this.rp(),this}getTitleFont(){return this.mh.Xh()}setTitleRotation(t){return this.mh.Zh(t),this.ls.xs(),this}getTitleRotation(){return this.mh.Qh()}setTitleEffect(t){return this.Fp.Ss(t),this.ls.xs(),this}getTitleEffect(){return this.Fp.bs()}setTitleMargin(t){var e,i;return this.Cp="object"==typeof t?this.Cp?(e=this.Cp,{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.rp(),this}getTitleMargin(){return this.Cp}setPadding(t){return this.wa="object"==typeof t?S(this.wa,t):{left:t,top:t,right:t,bottom:t},this.rp(),this}getPadding(){return this.wa}Ip(t){const e=t.Pp(),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.kp.Y(),this}}const oa={Dp:(t,e)=>t.Hh()!==B&&0!==t._r().length&&t.getVisible()?t.Ls().td().y:0,Bp(t,e){t.Be(u(50,100)).zr({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}},ha=t=>"show-all-interpolated"===t||"show-nearest-interpolated"===t||"show-pointed-interpolated"===t,aa=(t,e)=>{const i="series"in t?t.series:void 0;if(!i||!("getCursorFormattingOverride"in i))return e;const s=i.getCursorFormattingOverride();return s?s(t,e):e},la=(t,e,i,s,n,o,h)=>{let a,l,u=n,c=o,d=null,f=!0;const g=new r.Eventer;if(s){f=!1;const e=()=>{f=!0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},i=()=>{t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},r=()=>{f=!1,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},n=()=>{f=!0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},o=()=>{t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},h=()=>{f=!1,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())};s.onSeriesBackgroundMouseEnter(e),s.onSeriesBackgroundMouseMove(i),s.onSeriesBackgroundMouseLeave(r),s.onSeriesBackgroundTouchStart(n),s.onSeriesBackgroundTouchMove(o),s.onSeriesBackgroundTouchEnd(h),s.Lp(((e,i)=>{i.onMouseEnter(((e,s,r)=>{i.getCursorEnabled()?(a=r||void 0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())):l||t.ls.xs()})),i.onMouseMove(((e,s,r)=>{i.getCursorEnabled()?(a=r||void 0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())):l||t.ls.xs()})),i.onMouseLeave((()=>{i.getCursorEnabled()?(a=void 0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())):l||t.ls.xs()}))}))}let y;const m={setCursor:e=>(e(i),t),getCursor:()=>i,setCursorMode:e=>(u=e,t.ls.xs(),t),getCursorMode:()=>u,setCustomCursor:t=>{l=t},onCursorTargetChanged:t=>g.on("cursorTargetChanged",t),offCursorTargetChanged:t=>{g.off(t)},setCursorFormatting:e=>(c=e,t.ls.xs(),t),getCursorFormatting:()=>c,Y:()=>{i.dispose(),e.Y()},De:(e,s,r,n)=>{y=[e,s,r,n];const o=t.ls.Hn();let m=[];if((null==n?void 0:n.explicitTarget)&&u)m=[n.explicitTarget];else if(!e&&u){const t=s.find((t=>t.getIsUnderMouse())),e=o&&t&&t.getCursorEnabled&&t.getCursorEnabled()&&t.ys?t.ys(o):void 0;if(a=e||a,a&&"show-all"!==u&&"show-all-interpolated"!==u)m=[a];else if("show-all"===u||"show-all-interpolated"===u||"show-nearest"===u||"show-nearest-interpolated"===u){if((f||void 0!==t)&&o&&r){for(const t of s){if(t.getCursorEnabled&&!t.getCursorEnabled()||!t.getVisible())continue;const e=r(t,o,u);e&&m.push(e)}"show-nearest"!==u&&"show-nearest-interpolated"!==u||(m.sort(((t,e)=>h(t,o)-h(e,o))),m.length=1)}}else if(("show-pointed"===u||"show-pointed-interpolated"===u)&&o&&t&&t.getCursorEnabled&&t.getCursorEnabled()&&r){const e=r(t,o,u);e&&(m=[e])}}m=ve(m.map((t=>Le(t))));const p=(null==n?void 0:n.overrideCursorPositions)||((t,e)=>e),x=m[0],A=m.length>0?m:void 0;if(x!==d&&o&&(l&&l(x,A,o),g.emit("cursorTargetChanged",x,A,o),d=x),l)i.getVisible()&&(i.setVisible(!1),i.Ls().De());else{if(m&&m.length>0){const e=c(t,m[0],m);i.setVisible(!0).setPosition(...p(m,m.map((t=>t.cursorPosition)))).setResultTable((t=>t.setContent(e)))}else i.setVisible(!1);(null==n?void 0:n.afterCursorPointedAt)&&n.afterCursorPointedAt(m),i.Ls().De()}},solveNearest:(e,i,s,r)=>{const n=e||t.ls.Hn();if(!n)return[];let o=[];if("show-all"===i||"show-all-interpolated"===i||"show-nearest"===i||"show-nearest-interpolated"===i){for(const t of s){if(!t.getCursorEnabled()||!t.getVisible())continue;const e=r(t,n,i);e&&o.push(e)}"show-nearest"!==i&&"show-nearest-interpolated"!==i||(o.sort(((t,e)=>h(t,n)-h(e,n))),o.length=1)}return o=ve(o.map((t=>Le(t)))),o},Rp:i};return m};class ua{constructor(t,e){this.Ep=t,this.zp=e}alter(t){this.Vp=void 0!==this.Vp?this.Vp:this.zp(),this.Op=t,this.Ep(t)}resetValue(){void 0!==this.Op&&(void 0!==this.Vp&&this.isAltered()&&this.Ep(this.Vp),this.Vp=void 0,this.Op=void 0)}getNormalValue(){return void 0!==this.Vp?this.Vp:this.zp()}isAltered(){return void 0!==this.Op&&this.zp()===this.Op}}class ca{constructor(t,e){this.Np=[],this.Gp=t,this.At=e}update(){return this.Gp.getVisible()?!(this.Wp()&&(!this.Yp()||(this.resetTable(),this.Gp.Ls(),this.Wp()))&&(this.Hp(),this.Gp.Ls(),this.Wp()&&(this.resetTable(),this.Gp.Ls(),1))):(this.Yp()&&this.resetTable(),!0)}Yp(){for(let t=0;t{const s=ct(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ct(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.Gp,this.At)}$p(){return((t,i)=>{const s=ct(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ct(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.Gp,this.At)}Xp(){return((t,i)=>{const s=ct(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ct(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.Gp,this.At)}jp(t){return this.Np.push(t),t}}class da extends ca{constructor(){super(...arguments),this._a=this.jp(new ua((t=>this.Gp.setOrigin(t)),(()=>this.Gp.getOrigin())))}Hp(){const t=this._a.getNormalValue(),e=u(this.$p()?-t.x:t.x,this.Xp()?-t.y:t.y);this._a.alter(e)}}class fa extends ca{constructor(t,e,i,s){super(t,e),this.Zp=this.jp(new ua((t=>this.Gp.setTextFont((e=>e.setSize(t)))),(()=>this.Gp.getTextFont().getSize()))),this.Qp=i,this.Jp=s}Hp(){const t=this.Zp.getNormalValue(),e=this.Qp;if(enew da(t,e),FontSize:(t=5,e=5)=>(i,s)=>new fa(i,s,t,e)},ya={None:Ln,Rectangle:Ao,Circle:So,Diamond:vo,Pointer:bo};class ma extends Io{constructor(){super(...arguments),this.Hu=this.Ki.cursorResultTableTextFont,this.Vd=0,this.Kp=this.Ki.cursorResultTableTextFillStyle}setContent(t){let e;void 0===t?e=[]:Array.isArray(t)?(e=[],t.forEach((t=>{e.push(Array.isArray(t)?t:[t])}))):e=[[t]];for(let t=0;t0||n||o)){s=!0;break}}s||(i.unshift(""),i.push(""))}const i=e.length;let s=this.getMembers().length;for(let t=0;t=i)this.getMembers()[t].dispose(),t-=1,s-=1;else{const i=e[t].length;let s=n.getMembers().length;for(let o=0;o=i)n.getMembers()[o].dispose(),o-=1,s-=1;else if(void 0!==u&&u.length>0||c||d){const t=a?this.Hu.withMutations((t=>{for(const e of Object.keys(a)){const i=a[e];void 0!==i&&t.set(e,i)}return t})):this.Hu,e=l||this.Kp,i=f[o];if(u){let s;i&&i instanceof po?s=i:(i&&i.dispose(),s=n.addElement(xo,o)),s.setFont(t).setFillStyle(e).setText(u).setTextRotation(this.Vd)}else if(c){let s;i&&i instanceof Mo?s=i:(i&&i.dispose(),s=n.addElement(wo,o)),s.setFillStyle(e).setShape(c).setSize({y:t.size,x:t.size}),s.setMargin(5)}else if(d){let t;i&&"setTextFillStyleHidden"in(r=i)&&"setText"in r?t=i:(i&&i.dispose(),t=n.addElement(Xo.setBackground(ya.None),o).setOn(!0));const e=d.Fs();void 0!==e&&t.setButtonShape(e),t.setText(d.getName()),d.styleLegendEntry(t)}}else{const t=f[o];t&&t instanceof Co||(t&&t.dispose(),n.addGap(void 0,o))}}}}var r;return this.Is.xs(),this}setTextFillStyle(t){this.Kp="function"==typeof t?t(this.Kp):t;for(let t=0;tt.setFillStyle(o.cursorResultTableFillStyle).setStrokeStyle(o.cursorResultTableStrokeStyle))).setTextFillStyle(o.cursorResultTableTextFillStyle).setTextFont(o.cursorResultTableTextFont),this.oy=ga.Flip(this.Gp,this.scale)}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t)}setPointMarkerVisible(t){return this.iy=t,this.ty.forEach((e=>e.pointMarker.setVisible(e.targetVisible&&t))),this.Is.xs(),this}getPointMarkerVisible(){return this.iy}setPointMarker(t){return this.ty.forEach((e=>t(e.pointMarker))),this.ey.push(t),this.Is.xs(),this}setResultTableVisible(t){return this.sy=t,this.Is.xs(),this}getResultTableVisible(){return this.sy}setResultTable(t){return t(this.Gp),this.Is.xs(),this}setAutoFitStrategy(t){return this.oy&&this.oy.resetTable(),this.oy=t?t(this.Gp,this.Is.ls.At):void 0,this.Is.xs(),this}getAutoFitStrategy(){return void 0!==this.oy}setVisible(t){return this.Xi=t,this.Is.xs(),this}getVisible(){return this.Xi}dispose(){return this.ty.forEach((t=>t.pointMarker.dispose())),this.Gp.dispose(),this.ey.length=0,this.hy(this),this.R.emit("dispose"),this}De(){return this.oy&&this.oy.update(),this.Gp.setVisible(this.hp&&this.Xi&&this.sy),this.ty.forEach((t=>t.pointMarker.setVisible(t.targetVisible&&this.hp&&this.Xi&&this.iy))),this.ty.forEach((t=>t.pointMarker.De())),this.Gp.De(),this}Ls(){return this.ty.forEach((t=>t.pointMarker.Ls())),this.Gp.Ls(),this}ly(t,e){const i=e===this.scale?t:ct(t,e,this.scale);this.Gp.setPosition(i)}}const xa=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5)));class Aa extends pa{constructor(){super(...arguments),this.ma={x:0,y:0}}setPosition(t){const e=this.renderingScale,i=Jh(t.resultTableScale,e),s=i===this.scale?t.resultTable:ct(t.resultTable,i,this.scale),r=Jh(t.pointMarkerScale,e),n=r===this.scale?t.pointMarker:ct(t.pointMarker,r,this.scale);this.ma=n;let o=this.ty[0];if(!o){const t=new Mo(this.Is,this.renderingScale,this.scale,kt,this.Ki).setMouseInteractions(!1).setFillStyle(this.Ki.cursorPointMarkerFillStyle).setSize(this.Ki.cursorPointMarkerSize).setShape(this.Ki.cursorPointMarkerShape);o={pointMarker:t,targetVisible:!0},this.ty.push(o),this.ey.forEach((e=>e(t)))}return o.pointMarker.setPosition(n),this.Gp.setPosition(s),this.Is.xs(),this}Ls(){return super.Ls(),this.hp=((t,e,i=e)=>{const s=e!==i?ct(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.ma,this.scale),this}}class Sa{constructor(t,e=[]){this.uy=[],this.Ay=(t,e)=>(this.uy.forEach((i=>i(t,e))),t),this.addStyler=t=>new Sa(this.ny,this.uy.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new Sa(t,this.uy.map((t=>t))),this.gy=(t,e,i,s,r)=>this.Ay(new Aa(t,e,i,s,this.ny,r),r),this.ny=t,this.uy=e}}const va=new Sa(Ao,[xa]),ba=new Sa(bo,[xa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof bo&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),Ma=va,wa=va,Ca=va,Ta=ba,Ra=new Sa(Ao,[xa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(Es.LeftBottom)))]);var Ea;e.SliceLabelIndices=void 0,(Ea=e.SliceLabelIndices||(e.SliceLabelIndices={}))[Ea.LabelsInsideSlices=0]="LabelsInsideSlices",Ea[Ea.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},Ia={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class Fa extends Zi{constructor(){super(...arguments),this._s="Slice",this.M=0}}const Da=(t,e)=>{Qt(e),t.setExploded(!t.getExploded())};class Pa extends Fa{}class La extends Pa{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.py=!1,this.yy=B,this.my=B,this.vy=this.M,this.Sy=this.py?1:0,this.xy=this.getVisible(),this.by=K((()=>this.chart.ls.xs())),this.My=K((()=>this.chart.ls.xs())),this._y=()=>{this.wy=void 0},this.Cy=()=>{this.ky=void 0},this.index=t,this.chart=s,this.scale=r,this.Ji=n,this.Ty=e.hd(r).us(this.getHighlight()),this.ds(this.Ty),this.Ke=i.Or(r).us(this.getHighlight()),this.ds(this.Ke,{isText:!0}),this.onMouseClick(Da),this.onTouchEnd(Da)}setValue(t){return this.chart.getAnimationsEnabled()?this.xy&&this.Fy(this.vy,t):this.vy=t,this.M=t,this.chart.ls.xs(),this}getValue(){return this.M}setExploded(t){if(t&&!1===this.chart.getMultipleSliceExplosion()){const t=this.chart.getSlices();for(let e=0;e{this.Sy=t,this.chart.ls.xs()})),this.ky.onEveryAnimationEnd(this.Cy),this.py=!this.py):!1!==this.chart.getMultipleSliceExplosion()||t?(this.Sy=this.py?0:1,this.py=!this.py):(this.Sy=0,this.py=!this.py),this.chart.ls.xs(),this}getExploded(){return this.py}setVisible(t){return this.xy=t,!1===t?this.chart.getAnimationsEnabled()&&this.vy>0?(this.wy&&(this.wy.finish(!1),this.wy=void 0),this.Fy(this.vy,0,(()=>super.setVisible(!1)))):(this.vy=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.wy&&(this.wy.finish(!1),this.wy=void 0),super.setVisible(!0),this.Fy(this.vy,this.M)):(this.vy=this.M,super.setVisible(!0)),this}Fy(t,e,i){this.wy=this.by(300,W.ease)([[t,e]],(([t])=>{this.vy=t,this.chart.ls.xs()})),this.wy.onEveryAnimationEnd(this._y),i&&this.wy.onAnimationEnd(i)}setStyle(t,e,i,s){this.yy=t,this.my=i,this.Ty.Ie(this.yy).Fe(e),this.Ke.Ie(this.my).jh(s);for(let t=0;tui(e,li(Si(.5*(t.eu()+t.Ti())*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.Iy.indexOf(t);e>=0&&(this.Iy.splice(e,1),this.Uy())},this.ls.Xn(dh.Af),this.Yy=e.Hy("pieChart bottom",0),this.$y=e.Hy("pieChart top",1),this.mh.gr("Pie Chart"),this._p(r,this.pg),this.onBackgroundMouseDoubleClick(Ba);const h=ji(new Ki(Ba));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd);const a=e.Xy(),l=Pt(o?o.cursorBuilder:void 0,wa);this.jy=la(this,a,l.gy(a,this.uiScale,this.uiScale,kt,this.Ki),void 0,"show-pointed",Na,(()=>0)),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=wa){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}addSlice(t,e){const i=new La(this.zy,this.Yy,this.$y,this,this.pg,this.Wy,this.Ki,this.ls.ss);this.zy+=1,i.setName(t);const s=this.ah;return this.ah=!1,i.setValue(e),this.ah=s,i.setEffect(this.Ny),this.Zy(i),this.Iy.push(i),this.Uy(),i.setHighlightOnHover(this.Ly),i.onMouseMove((()=>{this.getCursorMode()&&this.ls.xs()})),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.Ss(t))),this.ls.xs(),this}getSliceEffect(){return this.Ny}setSliceSorter(t){return this.Py=t,this.Iy=this.Iy.sort(this.Py),this.ls.xs(),this}getSliceSorter(){return this.Py}setLabelFillStyle(t){this.Ey="function"==typeof t?t(this.Ey):t;for(let t=0;te.ss.hs.Ss(t))),this.ls.xs(),this}getLabelEffect(){return this.Gy}setLabelFormatter(t){return this.Qy=t,this.ls.xs(),this}getLabelFormatter(){return this.Qy}setSliceHighlightOnHover(t){return this.Ly=t,this.Iy.forEach((e=>e.setHighlightOnHover(t))),this}De(t){super.De(t),oa.Bp(this.mh,this.Cp),super.Mp();const e=oa.Dp(this.mh,this.Cp),i=u(this.pg.x.getInnerInterval()-(this.wa.left+this.wa.right),this.pg.y.getInnerInterval()-(this.wa.bottom+this.wa.top+e)),s=u(this.wa.left+i.x/2,this.wa.bottom+i.y/2);if(this.$d){const t=this.$d;this.Iy.forEach((e=>{this.Zy(e,new U({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Iy[t].Ty.setVisible(e),this.Iy[t].Ke.setVisible(e)}this.Iy=this.Iy.sort(this.Py);const r=this.Iy.filter((t=>t.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;t{const s=o[r.indexOf(t)]||0,n=this.ls.Vo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.ls.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.ls.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.Jy(r,o,s,i)}Zy(t,e=this.Dy(t.index,t)){t.setStyle(e,this.By,this.Ey,this.Ry)}Uy(){this.Iy=this.Iy.sort(this.Py),this.ls.xs()}if(){return this.Iy}dispose(){return super.dispose(),this.Iy.slice().forEach((t=>t.dispose())),this.jy.Y(),this.$y.Y(),this.Yy.Y(),this}}const Na=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],Oa={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Ua=(...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 Ya extends za{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Qy=Ia.NamePlusValue,this.Ky=[],this.qy=40,this.tm=5,this.im=10,this.sm=this.Ki.pieChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.sm=t;for(let t=0;tt.Ke.setVisible(!1))),this.Ky.forEach((t=>t.setVisible(!1)))}else{_a(t,e,i,u,this.Ql,a);let s=90;const r=t.map(((t,r)=>{const h=360*e[r],a=s-h,l=Si(xi(.5*(s+a))),c=l.x>=0?-1:1,d=ui(ui(i,li(l,u+n)),{x:c*-o,y:0});s=a;const f={x:c,y:0};t.Ke.Be(d).Ya(f),t.Ke.Ls();const g=Je(t.Ke.Je());return{position:d,alignment:f,shape:t.Ke,boundaries:g,sliceAngleVec:l,slice:t}})),l=[];for(let t=0;t{const s=t.slice.Ty,r=Va(s,i,u+h+a*t.slice.getAnimatedExplosion()),n=pi(t.position.y,r,i),o=t.position;this.hm([r,n,o])}))}}getMinimumSize(){return u(500,300)}hm(t){let e;for(let t=0;t{if(ts(t)){const e=t.getThickness(),i=t.getFillStyle();if(Y(i))return 1===e?dr:new gr({size:e,fillStyle:i,shape:"sphere"})}return dr};class Ha{constructor(t,e,i,s,n,o,h,a,l,u){this.R=new r.Eventer,this.M=0,this.Xi=!0,this.$i=!1,this.xs=t,this.om=e,this.am=i,this.lm=s,this.um=n,this.dm=o,this.Vd=h,this.Kp=a,this.fm=l,this.sc=u}setValue(t){return t===this.M||(this.M=t,this.xs(),this.R.emit("valueChange",this,this.M)),this}getValue(){return this.M}setTickStyle(t){return this.am="function"==typeof t?t(this.am):t,this.xs(),this}getTickStyle(){return this.am}setTickLength(t){return this.lm=t,this.xs(),this}getTickLength(){return this.lm}setGridStrokeStyle(t){return this.um="function"==typeof t?t(this.um):t,this.xs(),this}getGridStrokeStyle(){return this.um}setTextPadding(t){return this.dm=t,this.xs(),this}getTextPadding(){return this.dm}setTextRotation(t){return this.Vd=t,this.xs(),this}getTextRotation(){return this.Vd}setTextFillStyle(t){return this.Kp="function"==typeof t?t(this.Kp):t,this.xs(),this}getTextFillStyle(){return this.Kp}setTextFont(t){return this.fm="function"==typeof t?t(this.fm):t,this.xs(),this}getTextFont(){return this.fm}setTextFormatter(t){return this.sc=t,this.xs(),this}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}dispose(){return this.$i||(this.$i=!0,this.om(),this.xs(),this.R.emit("dispose",this)),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&(this.R.emit("visibleStateChanged",this,this.Xi),this.xs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}}class Wa extends Ha{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,a,l),this.Am=u,this.gm=c,this.wa=d}setBackgroundFillStyle(t){return this.Am="function"==typeof t?t(this.Am):t,this.xs(),this}getBackgroundFillStyle(){return this.Am}setBackgroundStrokeStyle(t){return this.gm="function"==typeof t?t(this.gm):t,this.xs(),this}getBackgroundStrokeStyle(){return this.gm}setPadding(t){return this.wa="number"==typeof t?{left:t,top:t,right:t,bottom:t}:{...this.wa,...t},this.xs(),this}getPadding(){return this.wa}}class ja{constructor(t,e,i,s){this.pm=[],this.ym=new Map,this.vm=t,this.Sm=e,this.xm=i,this.bm=s}Mm(){this.xm&&this.xm();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.pm.slice(),r=[];e.forEach((t=>{let e=s.pop();e||(e=this.vm(),this.pm.push(e));const n=[],o=e._m().slice();t.instances.forEach(((t,e)=>{const i=o.shift();n.push({...t,existingMember:i})}));const h=this.Sm(e,n,t.sharedProperties);i=he(i,h,{canReturnB:!0});for(let i=0;i{null==e||e.kd(t)}))})),s.forEach((t=>{t.dispose();const e=this.pm.indexOf(t);e<0?pe(0,(()=>{})):this.pm.splice(e,1)})),r.forEach((t=>{const e=this.ym.get(t.Xo);e&&t.collection.ls.oo({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.ym.clear(),r.forEach((t=>{this.ym.set(t.Xo,t)})),this.bm&&this.bm(this.pm,i)}}}wm(){this.pm.forEach((t=>{t.dispose()})),this.pm.length=0}}class Ka{constructor(t){this.Cm=[],this.km=t}Mm(){return this.Tm(),{add:()=>this.al(),finishPlot:()=>{this.Fm()}}}al(){let t=this.Cm.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.km()},this.Cm.push(t)),t.isFree=!1,t.shape}Tm(){this.Cm.forEach((t=>{t.isFree=!0}))}Fm(){this.Cm.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.Cm.splice(this.Cm.indexOf(t),1)}))}wm(){this.Cm.forEach((t=>t.shape.dispose())),this.Cm.length=0}}class $a extends ir{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Im({x:t.ls.Ki.xAxis3DNumericTicks,y:t.ls.Ki.yAxis3DNumericTicks,z:t.ls.Ki.zAxis3DNumericTicks}),datetime:e.Im({x:t.ls.Ki.xAxis3DDateTimeTicks,y:t.ls.Ki.yAxis3DDateTimeTicks,z:t.ls.Ki.zAxis3DDateTimeTicks}),time:e.Im({x:t.ls.Ki.xAxis3DTimeTicks,y:t.ls.Ki.yAxis3DTimeTicks,z:t.ls.Ki.zAxis3DTimeTicks})},{type:"linear"}),this.Lf=[],this.Pm=()=>{},this.Dm=()=>{},this.Bm=()=>{},this.Lm=()=>{},this.chart=t,this.Rm=r,this.Em=n,this.zm=o,this.Vm=this.Rm.At;const l=this.Lh.Im({x:this.Ki.xAxis3DStrokeStyle,y:this.Ki.yAxis3DStrokeStyle,z:this.Ki.zAxis3DStrokeStyle});this.Om=this.Rm.rm([Oa.InternalUI]).Oe(l).Nm(Za(l)).setMouseInteractions(!1),this.bh=this.Em.Or(this.zm).setMouseInteractions(!1).Ie(e.Im({x:t.ls.Ki.xAxis3DTitleFillStyle,y:t.ls.Ki.yAxis3DTitleFillStyle,z:t.ls.Ki.zAxis3DTitleFillStyle})).jh(e.Im({x:t.ls.Ki.xAxis3DTitleFont,y:t.ls.Ki.yAxis3DTitleFont,z:t.ls.Ki.zAxis3DTitleFont})).ra(3),this.Gm=new Ka((()=>this.Em.Or(this.zm).ra(2).Vr(Ie).zr(Ie))),this.Wm=new ja((()=>this.Em.Um(this.zm).setMouseInteractions(!1).ra(1)),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((({positions:e,existingMember:i})=>{const s=i||t.Hr();return s._l(e),s}))))),this.Ym=new ja((()=>this.Rm.Wg().setMouseInteractions(!1)),((t,e,i)=>(t.Ot().Oe(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t.dl(e)))))),this.ss=a,this.Jh=this.ss.wg([this.bh]).Ss(s.effectsText),this.Om.setMouseEnterEventHandler(this.Pm).setMouseLeaveEventHandler(this.Dm).setMouseDragEventHandler(this.Bm).setMouseDragStopEventHandler(this.Lm),i.ag=this}setTickStrategy(t,e){return super.Vh(t,e)}getTickStrategy(){return this.ih}addCustomTick(){const t=new Wa((()=>this.chart.ls.xs()),(()=>{const e=this.Lf.indexOf(t);e>=0&&this.Lf.splice(e,1)}),this.Ki.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.Ki.xAxis3DNumericTicks.majorTickStyle.tickLength,this.Ki.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.Ki.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.Ki.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.Ki.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.Ki.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)),B,nt,{left:4,right:4,top:4,bottom:4});return this.Lf.push(t),this.chart.ls.xs(),t}setStrokeStyle(t){return this.Om.Oe(t).Nm(Za(this.Om.pu())),this.chart.ls.xs(),this}getStrokeStyle(){return this.Om.pu()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.Om.setVisible(t),!1===t&&(this.Ym.wm(),this.Gm.wm(),this.Wm.wm()),this.Rm.xs(),this}Dg(){return this.chart.getSeries()}Hm(t){return Math.abs(this.At.st(t)*this.Rm.$m(1))}Lr(t,e,i){const s=Math.abs(this.At.st(e-t)*this.Rm.$m(1));return{min:t-i*s,max:e+i*s}}mr(t,e){const i=new Qa(e,t,this.Em,this.zm,this.Rm);return i.Ke.ra(0),i}vr(t,e){const i=this.Xm(e,t.M,t.Fh.yr.tickLength,t.Fh.yr.tickPadding);return t.Ke.Be(i.labelPosition).Ya(i.labelAlignment),i}Xm(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.At.getInnerStart())/(this.At.getInnerEnd()-this.At.getInnerStart()),c=_e.addVec(qe(n,o,l),_e.multiplyVec(_e.multiply(h,this.Rm.$m(.5*this.Om.pu().getThickness())),r)),d=_e.addVec(c,_e.multiplyVec(_e.multiply(h,this.Rm.$m(i)),r)),f=this.Rm.jm(d)||u(0,0);return{labelPosition:ui(ct(f,this.chart.ls.At,this.zm),li(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}Zm(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.At.getInnerStart())/(this.At.getInnerEnd()-this.At.getInnerStart()),a=_e.addVec(qe(r,n,h),_e.multiplyVec(_e.multiply(o,this.Rm.$m(.5*this.Om.pu().getThickness())),s)),l=_e.addVec(a,_e.multiplyVec(_e.multiply(o,this.Rm.$m(10)),s)),c=this.Rm.jm(a)||u(0,0),d=this.Rm.jm(l)||u(0,0);return this.Em.Ne(this.zm).We(c).Ge(d).Oe(new Ji({fillStyle:new U({color:T(120*i)}),thickness:1}))}Dr(t,e){return qa(t,e,this.At)}De(t){if(!this.Xi)return;const e=Math.min(this.Oh,this.Nh),i=Math.max(this.Oh,this.Nh),s=this.Vm,r=f(s.x.rt(),s.y.rt(),s.z.rt());let n,o;this.Qm()?(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.Lh.Jm(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.Lh.ef,a=this.Rm.jm(n)||u(0,0),l=this.Rm.jm(o)||u(0,0),c=qe(n,o,.5),d=_e.addVec(c,_e.multiplyVec(_e.multiply(h,-1),r)),g=this.Rm.jm(c)||u(0,0),y=this.Rm.jm(d)||u(0,0),m=oi(ci(ct(g,this.chart.ls.At,this.zm),ct(y,this.chart.ls.At,this.zm)));this.Om.Ot().dl([n,o]);const{gridlinePositionA:p,gridlinePositionB:x,gridlinePositionC:A}=this.Lh.Km(t),S=t=>({x:-1===t.x?this.Vm.x.getInnerStart():1===t.x?this.Vm.x.getInnerEnd():0,y:-1===t.y?this.Vm.y.getInnerStart():1===t.y?this.Vm.y.getInnerEnd():0,z:-1===t.z?this.Vm.z.getInnerStart():1===t.z?this.Vm.z.getInnerEnd():0}),v=S(p),b=S(x),M=S(A),w={physicalAxisSize:ai(ci(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:m,gridlinePositionA:v,gridlinePositionB:b,gridlinePositionC:M},C=this.rr(w),T=this.Ym.Mm();for(const[t,e]of this.sh)for(const[,i]of e){const e=C.get(i);if(!e)continue;const s=this.qm(w,e);T.add({Xo:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.yr.tickStyle}),s.gridStroke&&T.add({Xo:0,positions:s.gridStroke},{lineStyle:t.yr.gridStrokeStyle})}const R=this.Gm.Mm(),E=this.Wm.Mm(),k={x:0,y:0};this.Lf.forEach((t=>{if(!t.Xi||t.Mi)return;const s=this.Xm(w,t.M,t.lm,t.dm),r=this.qm(w,s);if(t.Kp!==B){const e=R.add().Be(s.labelPosition).Ya(s.labelAlignment).Ie(t.Kp).jh(t.fm).gr(t.sc(t.M)).Zh(t.Vd),i=e.Ls().oi();if(k.x=Math.max(k.x,i.x),k.y=Math.max(k.y,i.y),t.Am!==B){const i=e.Je(),s=[{x:i[0].x-t.wa.left,y:i[0].y+t.wa.top},{x:i[1].x+t.wa.right,y:i[1].y+t.wa.top},{x:i[2].x+t.wa.right,y:i[2].y-t.wa.bottom},{x:i[3].x-t.wa.left,y:i[3].y-t.wa.bottom}];E.add({Xo:0,positions:s},{fillStyle:t.Am,strokeStyle:t.gm})}}T.add({Xo:0,positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.am}),r.gridStroke&&T.add({Xo:0,positions:r.gridStroke},{lineStyle:t.um})})),R.finishPlot(),E.finishPlot(),T.finishPlot();const I=this.Mr(((t,e)=>{const i=e.Ke.oi();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:k.x,y:k.y}),F=Math.atan((l.y-a.y)/(l.x-a.x));this.bh.Ya({x:0,y:0}).Zh(180*-F/Math.PI);const D=_e.addVec(c,_e.multiplyVec(_e.multiply(h,this.Rm.$m(.5*this.Om.pu().getThickness()+this.Cr(((t,e)=>Math.max(t,e.tickLength)),0))),r)),P=this.Rm.jm(D)||u(0,0),L=ui(ct(P,this.chart.ls.At,this.zm),ui(ui(di(I,m),li(m,this.Cr(((t,e)=>Math.max(t)),0))),di(li(this.bh.Ls().oi(),.5),m)));this.bh.Be(L),this.Om.tv={overrideFollowing:!1,skipMousePicking:!1}}qm(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return It(h,0)||It(h,1)||(a=[this.sv()?{...i,x:n.x}:this.ev()?{...i,y:n.y}:this.Qm()?{...i,z:n.z}:{x:0,y:0,z:0},this.sv()?{...s,x:n.x}:this.ev()?{...s,y:n.y}:this.Qm()?{...s,z:n.z}:{x:0,y:0,z:0},this.sv()?{...r,x:n.x}:this.ev()?{...r,y:n.y}:this.Qm()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}Kh(){super.Kh(),this.Ym.wm(),this.Gm.wm(),this.Wm.wm()}sv(){return this.Lh.sv()}ev(){return this.Lh.ev()}Qm(){return this.Lh.Qm()}}class Qa extends sr{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.hv=r}}const qa=(t,e,i)=>Ft(t+.1*(e-t)+Math.abs(i.rt())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),Ja=(t,e,i,s)=>({kr:()=>{const i=t();let s;for(const t of i){if(!t.rv())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},Tr:()=>{const e=t();let s;for(const t of e){if(!t.rv())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Ir:()=>{const e=t();let i;for(const t of e){if(!t.rv())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),tl=t=>({...Ja(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Ir().y)),Im:t=>t.y,Jm:(t,e)=>({x:e.x,y:t.y,z:e.z}),ef:f(-1,0,0),Km: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)}},sv:()=>!1,ev:()=>!0,Qm:()=>!1}),el=t=>({...Ja(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Ir().z)),Im:t=>t.z,Jm:(t,e)=>({x:e.x,y:e.y,z:t.z}),ef:f(1,0,0),Km: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)}},sv:()=>!1,ev:()=>!1,Qm:()=>!0});class il extends Zi{constructor(t,e,i,s,r){super(t,e,s,r),this.nv=jn,this.ov=!0,this.av=!0,this.lv=!0,this.chart=t,this.Rm=i,this.qi=new Map,this.onMouseWheel(this.chart.uv),this.onMouseDrag(this.chart.cv),this.onMouseDragStop(this.chart.dv),this.onTouchStart(this.chart.fv.onTouchStart),this.onTouchMove(this.chart.fv.onTouchMove),this.onTouchEnd(this.chart.fv.onTouchEnd)}Qi(t,e){const i=null==t?void 0:t.dataPoint;if(i)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart.pg,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ()}}setCursorEnabled(t){return this.ov=t,this}getCursorEnabled(){return this.ov}setCursorFormattingOverride(t){return this.Av=t,this}getCursorFormattingOverride(){return this.Av}setAutoScrollingEnabled(t){return this.av=t,this.chart.ls.xs(),this}getAutoScrollingEnabled(){return this.av}setColorShadingStyle(t){return this.nv=t,this.qi.forEach(((e,i)=>i.gv(t))),this.Rm.xs(),this}getColorShadingStyle(){return this.nv}setDepthTestEnabled(t){return this.lv=t,this.qi.forEach(((e,i)=>i.pv(t))),this.Rm.xs(),this}getDepthTestEnabled(){return this.lv}yv(){}De(){}bm(){}getXMax(){const t=this.ja;return t?t.St():void 0}getXMin(){const t=this.ja;return t?t.vt():void 0}getYMax(){const t=this.ja;return t?t.bt():void 0}getYMin(){const t=this.ja;return t?t.xt():void 0}getZMax(){const t=this.ja;return t?t.mv():void 0}getZMin(){const t=this.ja;return t?t.vv():void 0}Ir(){const t=this.ja;return t?f(t.Cl(),t.kl(),t.Sv()):f(0,0,0)}}class sl extends il{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Box Series 3D",this.xv=.25,this.bv=!1,this.Xd=()=>de(this.we),this.we=ye(this.Ki.boxSeries3DFillStyle,r),this.ja=this.Rm._v().pv(this.lv).Ie(this.we).Mv(this.xv).us(this.getHighlight()),this.ds(this.ja)}invalidateData(t){const e=t.length;if(0===e)return this;this.bv&&this.chart.ls.Xn(dh.Cf);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;ide(this.gu.getFillStyle())}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;return this.ja.Oe(e),this.Rm.xs(),this}getStrokeStyle(){return this.gu}add(t){return this.bv&&this.chart.ls.Xn(dh.Cf),this.bv=!0,(t=Array.isArray(t)?t:[t])?(this.ja.dl(t.slice()),this.Rm.xs(),this):this}clear(){return this.ja.Ot(),this}getPointAmount(){const t=this.ja;return t.fl()+t.Al()}rv(){return this.av&&this.getPointAmount()>0&&this.getVisible()}Le(t,e){t.us(e),this.Rm.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.gu})}}class nl extends rl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Line Series 3D",this.gu=ye(s.lineSeries3DStrokeStyle,r),this.Cv=Ir.pointStyle3D,this.kv(this.gu),this.ja=this.Rm.rm([Oa.UserSeries]).pv(this.lv).Oe(this.gu).Nm(this.Cv).us(this.getHighlight()),this.ds(this.ja)}setStrokeStyle(t){super.setStrokeStyle(t),this.kv(this.gu);const e=this.Cv;return this.ja.Nm(e),this}kv(t){const e=new Ar.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.Cv=e}}class ol extends rl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Point Line Series 3D",this.Xd=()=>de(this.gu.getFillStyle())||de(this.Cv.getFillStyle()),this.Cv=ye(s.pointLineSeries3DPointStyle,r),this.gu=ye(s.lineSeries3DStrokeStyle,r),this.Tv(),this.ja=this.Rm.rm([Oa.UserSeries]).pv(this.lv).Oe(this.gu).Nm(this.Cv).us(this.getHighlight()),this.ds(this.ja)}setPointStyle(t){return this.Cv="function"==typeof t?t(this.Cv):t,this.Tv(),this.ja.Nm(this.Cv),this.Rm.xs(),this}getPointStyle(){return this.Cv}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.gu,i=Math.abs(e.getThickness()),s=this.Cv,r=s.getSize();i>("object"==typeof r?Math.max(r.x,r.y,r.z):r)&&(this.Cv=s.setSize(i)),this.Tv();const n=this.Cv;return this.ja.Nm(n),this.Rm.xs(),this}Tv(){const t=this.Cv,e=t.getSize();this.Cv=t.setSize(e)}Le(t,e){t.us(e),this.Rm.xs()}}class hl extends il{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.bv=!1,((null==n?void 0:n.individualPointSizeAxisEnabled)||(null==n?void 0:n.individualPointSizeEnabled))&&this.chart.ls.Xn(dh.kf)}add(t){return this.bv&&this.chart.ls.Xn(dh.Cf),this.bv=!0,(t=Array.isArray(t)?t:[t])?(this.ja.dl(t.slice()),this.Rm.xs(),this):this}clear(){return this.ja.Ot(),this}getPointAmount(){const t=this.ja;return t.fl()+t.Al()}rv(){return this.av&&this.getPointAmount()>0&&this.getVisible()}Le(t,e){t.us(e),this.Rm.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{point3D:this.Fv})}}class al extends hl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._s="Point Series 3D",this.Xd=()=>de(this.Fv.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.chart.getSeries().length;this.Fv=ye(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.ja=this.Rm.Pv(h).pv(this.lv).Iv(this.Fv).us(this.getHighlight()),this.ds(this.ja)}setPointStyle(t){this.Fv="function"==typeof t?t(this.Fv):t;const e=this.Fv;return this.ja.Iv(e),this.Rm.xs(),this}getPointStyle(){return this.Fv}}class ll extends hl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._s="Point Cloud Series 3D",this.Xd=()=>de(this.Fv.getFillStyle());const o=this.chart.getSeries().length;this.Fv=ye(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.ja=this.Rm.Pv(h).Iv(this.Fv).us(this.getHighlight()),this.ds(this.ja)}setPointStyle(t){this.Fv="function"==typeof t?t(this.Fv):t;const e=this.Fv;return this.ja.Iv(e),this.Rm.xs(),this}getPointStyle(){return this.Fv}}const ul={Triangulated:al,Pixelated:ll};class cl extends na{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Dv=[],this.Bv=0,this.Lv=t=>{const e=this.Dv.indexOf(t);e>=0&&(this.Dv.splice(e,1),this.R.emit("seriesDispose",this,t))},this.onSeriesBackgroundMouseEnter=t=>this.R.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.R.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.R.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.R.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.R.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.R.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.R.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.R.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.R.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.R.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.R.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.R.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.R.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.R.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.R.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.R.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.R.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.R.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.R.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.R.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.R.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.R.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.R.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.R.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.R.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.R.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.R.off(t,"touchEndSeriesBackground"),this.Rv=this.ss.wg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.Dv.forEach((e=>e.setAnimationHighlight(t))),this}Ev(t,e){this.Rv.fs([e]),t.setMouseMoveEventHandler(((t,e)=>{this.R.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.R.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.R.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.R.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.R.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.R.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.R.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.R.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.R.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.R.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.R.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.R.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.R.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.R.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.zv.Ie(t),this.ls.xs(),this}getSeriesBackgroundFillStyle(){return this.zv.Hh()}setSeriesBackgroundStrokeStyle(t){return this.Vv.Fe(t),this.ls.xs(),this}getSeriesBackgroundStrokeStyle(){return this.Vv.po()}setSeriesBackgroundEffect(t){return this.Rv.Ss(t),this.ls.xs(),this}getSeriesBackgroundEffect(){return this.Rv.bs()}Ov(t){this.Dv.push(t),void 0!==this.Nv&&t.setHighlightOnHover(this.Nv),this.R.emit("seriesAdded",this,t)}if(){return this.Dv}setSeriesHighlightOnHover(t){return this.Nv=t,this.Dv.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.Dv.slice().forEach(Et),super.dispose()}Lp(t){return this.R.on("seriesAdded",t)}Gv(t){return this.R.off(t)}Wv(t){return this.R.on("seriesDispose",t)}Uv(t){return this.R.off(t)}}const dl=_e.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class fl{constructor(t,e,i,s){this.Yv=!0,this.Hv=!0,this.$v=2*-Math.PI/2160,this.Xv=2*Math.PI/2160,this.jv=.1,this.Zv=1*Math.PI/180,this.Qv=t,this.Jv=e,this.Kv=i,this.jm=s}getDefaultCameraConfiguration(t){const e={direction:dl,location:_e.multiply(dl,-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.qv(i,t):"wheel-zoom"===t.type?i=this.tS(i,t):"rotate+zoom"===t.type?i=this.iS(i,t):"fixed-rotate"===t.type?i=this.sS(i,t):"move"===t.type&&(i=this.eS(i,t))})),this.Yv?i=this.hS(t.boundingBox,i):this.Hv&&(i=this.rS(t.boundingBox,i)),i}qv(t,e){const{rotation:i}=e,s=t.location,r=_e.multiply(_e.normalize(t.location),-1),{Right:n,Up:o}=this.nS(r);let h=s;const a=this.oS(r),l=i.x*this.$v*a;h=_e.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.Xv,a-this.Zv);return 0!==u&&(h=_e.rotateAroundAxis(h,n,u)),{location:h,direction:_e.multiply(_e.normalize(h),-1)}}tS(t,e){const{deltaY:i}=e;this.Yv&&this.aS(!1);const s=t.location,r=_e.multiply(_e.normalize(s),-1),n=i*this.jv,o=_e.length(s)*-n;return{direction:r,location:_e.addVec(s,_e.multiply(r,o))}}iS(t,e){const{rotation:i,cameraDistance:s}=e;this.Yv&&this.aS(!1);let r=this.qv(t,{type:"rotate",rotation:i});const n=r.location,o=_e.multiply(_e.normalize(n),-1),h=_e.multiply(o,-s);return r={direction:_e.multiply(_e.normalize(h),-1),location:h},r}sS(t,e){this.Yv&&this.aS(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.nS(r),h=i.x*this.$v;let a=_e.normalize(_e.rotateAroundAxis(r,o,h));const l=i.y*this.Xv;return a=_e.normalize(_e.rotateAroundAxis(a,n,l)),{location:s,direction:a}}eS(t,e){this.Yv&&this.aS(!1),this.Hv=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.nS(n);return{location:_e.addVec(r,_e.multiply(n,.01*s),_e.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:_e.multiply(_e.normalize(t.cameraLocation),-1)};return this.Yv?this.hS(t.boundingBox,e):this.rS(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:_e.multiply(_e.normalize(t.cameraLocation),-1)};return this.Yv?this.hS(t.boundingBox,e):this.rS(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:_e.multiply(_e.normalize(t.cameraLocation),-1)};if(this.Yv)return this.hS(t.boundingBox,e)}hS(t,e,i){let s=e;i=void 0!==i?i:0,s=this.lS(t,s,100,20,1,i,5);const r=this.oS(s.direction);return s=this.uS(s,this.cS(t,s,100,1),r),s}lS(t,e,i,s,r,n,o){return gl(n,o,(t=>({direction:e.direction,location:_e.multiply(e.direction,-t)})),(e=>this.dS(t,e)),i,r,"linear",s)}cS(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.nS(e.direction),a=this.fS(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:_e.normalize(_e.lerp(l.direction,h,t))})),(e=>this.AS(t,e)),0,u,!0,i):yl(0,c,(t=>({location:l.location,direction:_e.normalize(_e.lerp(l.direction,o,t))})),(e=>this.AS(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:_e.normalize(_e.lerp(l.direction,n,t))})),(e=>this.gS(t,e)),0,u,!0,i):yl(0,c,(t=>({location:l.location,direction:_e.normalize(_e.lerp(l.direction,r,t))})),(e=>this.gS(t,e)),0,u,!0,i)),l}dS(t,e){const i=this.fS(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}gS(t,e){const i=this.fS(t,!1,e);return Math.abs(i.left-i.right)}AS(t,e){const i=this.fS(t,!1,e);return Math.abs(i.top-i.bottom)}fS(t,e,i){const s=Je(this.pS(t,e,i).map((t=>ct(t,this.Qv,this.Jv))));return{left:s.min.x,right:this.Jv.x.getInnerEnd()-s.max.x,top:this.Jv.y.getInnerEnd()-s.max.y,bottom:s.min.y}}pS(t,e,i){const s=this.Kv,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.jm(t,i))).filter((t=>void 0!==t))}rS(t,e){const i=_e.length(e.location),s=this.yS(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)de(this.we),this.nv=Hn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.chart.getSeries().length;this.we=ye(this.Ki.surfaceGridSeries3DFillStyle,o),this.SS=ye(this.Ki.surfaceGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.Qn=h,this.ja=this.Rm.bS(h).Ie(this.we).xS(this.SS).gv(this.nv).us(this.getHighlight()),this.ds(this.ja),this.setHighlightOnHover(!1)}Qi(t,e){const i=null==t?void 0:t.dataPoint;if(i)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart.pg,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:H(this.we)?this.we.lut:void 0}}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}MS(){const t=this.vS.start||{x:0,z:0};let e;e=this.vS.end?{x:(this.vS.end.x-t.x)/this.Qn.columns,z:(this.vS.end.z-t.z)/this.Qn.rows}:this.vS.step?this.vS.step:{x:1,z:1},this.ja._S(t,e),this.chart.ls.xs()}setStart(t){return this.vS.start=t,this.MS(),this}getStart(){return this.ja.wS().start}setStep(t){return this.vS.step=t,this.MS(),this}getStep(){return this.ja.wS().step}setEnd(t){return this.vS.end=t,this.MS(),this}getEnd(){return this.ja.wS().end}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.ja.Ie(this.we),this.Rm.xs(),this}getFillStyle(){return this.we}setWireframeStyle(t){return this.SS="function"==typeof t?t(this.SS):t,this.ja.xS(this.SS),this.Rm.xs(),this}getWireframeStyle(){return this.ja.CS()}setIntensityInterpolation(t){return t=t||"disabled",this.ja.kS(t),this.Rm.xs(),this}getIntensityInterpolation(){return this.ja.TS()}invalidateIntensityValues(t){if(this.bv&&this.chart.ls.Xn(dh.Cf),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.Qn.dataOrder?t.length:t[0].length,rows:"rows"===this.Qn.dataOrder?t.length:t[0].length},i="columns"===this.Qn.dataOrder?this.Qn.columns:this.Qn.rows,s="columns"===this.Qn.dataOrder?this.Qn.rows:this.Qn.columns;if(e.x>i||e.y>s){if(!0===this.chart.mA.Kn){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Qn.columns}x${this.Qn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.mA.Kn){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Qn.columns}x${this.Qn.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.`;wt.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.chart.mA.Kn){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Qn.columns}x${this.Qn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.mA.Kn){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Qn.columns}x${this.Qn.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.`;wt.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;ede(this.we),this.chart.ls.Xn(dh.Cf),this.nv=Hn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.chart.getSeries().length;this.we=ye(this.Ki.surfaceScrollingGridSeries3DFillStyle,o),this.SS=ye(this.Ki.surfaceScrollingGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.Qn=h,this.ja=this.Rm.BS(h).Ie(this.we).xS(this.SS).gv(this.nv).us(this.getHighlight()),this.ds(this.ja),this.setHighlightOnHover(!1)}Qi(t,e){const i=null==t?void 0:t.dataPoint;if(i)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart.pg,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:H(this.we)?this.we.lut:void 0}}MS(){const t=this.vS.start||{x:0,z:0};let e;e=this.vS.step?this.vS.step:{x:1,z:1},this.ja._S(t,e),this.chart.ls.xs()}setStart(t){return this.vS.start=t,this.MS(),this}getStart(){return this.ja.wS().start}setStep(t){return this.vS.step=t,this.MS(),this}getStep(){return this.ja.wS().step}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.ja.Ie(this.we),this.Rm.xs(),this}getFillStyle(){return this.we}setWireframeStyle(t){return this.SS="function"==typeof t?t(this.SS):t,this.ja.xS(this.SS),this.Rm.xs(),this}getWireframeStyle(){return this.ja.CS()}setIntensityInterpolation(t){return t=t||"disabled",this.ja.kS(t),this.Rm.xs(),this}getIntensityInterpolation(){return this.ja.TS()}clear(){return this.ja.Ot(),this.Rm.xs(),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.Qn.scrollDimension?this.Qn.rows:this.Qn.columns;if(i>s-1){if(!0===this.chart.mA.Kn){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.Qn.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.chart.mA.Kn){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.Qn.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.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.ja.LS({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.Rm.xs(),this}setCullMode(t){return this.ja.PS("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.ja.DS()}yv(){}De(){}bm(){}rv(){return this.av&&this.getVisible()}Le(t,e){t.us(e),this.Rm.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}}const xl=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof wl),Al=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);class Sl extends il{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Mesh Model 3D",this.RS=new Float32Array,this.At={x:1,y:1,z:1},this.ES={x:0,y:0,z:0},this.zS={x:0,y:0,z:0},this.VS={x:0,y:0,z:0},this.OS={x:0,y:0,z:0},this.Ka=Oe,this.Xd=()=>de(this.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.chart.getSeries().length;this.ja=this.Rm.NS().pv(this.lv).Ie(ye(this.Ki.meshModel3DFillStyle||this.Ki.pointSeriesFillStyle,o)).us(this.getHighlight()),this.ds(this.ja)}Qi(t,e){const i=this.getFillStyle();return Pe({series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:H(i)?i.lut:void 0},{cursorPosition:0,index:0,x:0,y:0,z:0,value:0},(()=>{const s=this.ja.GS(t,e);if(s)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart.pg,axisLocation:s.coordAxis},...s.coordAxis,index:s.index,value:s.value,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:H(i)?i.lut:void 0}}))}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let r=ze,n=Be,o=ze,h=Be,a=ze,l=Be;for(let t=0;te(t)))}return r.pointMarker.setPosition(s),this.chart.ls.xs(),this}}class bl{constructor(t,e){this.uy=[],this.Ay=(t,e)=>(this.uy.forEach((i=>i(t,e))),t),this.addStyler=t=>new bl(this.ny,this.uy.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new bl(t,this.uy.map((t=>t))),this.gy=(t,e,i,s,r,n)=>this.Ay(new vl(t,e,i,s,this.ny,r,n),r),this.ny=t,this.uy=e}}const Ml=new bl(Ao,[(t,e)=>{xa(t)}]);class wl extends cl{constructor(t,e,i,s,r,n,o){var h;super(t,e,i,e.wp("chart3D bg",0),s,e.ls.Ki.chart3DBackgroundFillStyle,e.ls.Ki.chart3DBackgroundStrokeStyle,e.ls.Ki.chart3DTitleFont,e.ls.Ki.chart3DTitleFillStyle,n),this.qS=1,this.tx=[],this.ix=2,this.sx=!0,this.hx=!0,this.nx=!0,this.ox=0,this.coordsAxis={id:"axes",chart:this},this.coordsWorld={id:"world",chart:this},this.gn=[],this.Mn=()=>{const t=this.Rm.lx();this.Ax.ux(t),this.gx.ux(t);const e=this.yx.viewportChanged(this.mx());e&&this.vx(e),this.ls.xs()},this.Sx=!1,this.cv=(t,e,i,s,r)=>{if(this.Sx=!0,this.nx){const t=r;this.tx.push({type:"rotate",rotation:t}),this.ls.xs(),Qt(e)}},this.dv=(t,e,i,s,r)=>{this.Sx=!1},this.uv=(t,e)=>{if(this.hx){if(this.sx)Math.sign(this.ox)!==Math.sign(e.deltaY)?this.ox=me(e):this.ox+=me(e);else{const t=me(e);this.tx.push({type:"wheel-zoom",deltaY:t})}this.ls.xs(),Qt(e)}},this.ls.Xn(dh.mf),this.mh.gr("Chart3D"),this.xx=i.d3(),this.xx.x.q(-1,1),this.xx.y.q(-1,1),this.xx.z.q(-1,1),this.Rm=e.bx("chart3D layer3D",0,this.xx),this.Ax=e.Mx("chart3D series bg",0),this.gx=e.Hy("chart3D axis ui",1),this._x={x:new $a(this,(h=()=>this.Dv,{...Ja(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Ir().x)),Im:t=>t.x,Jm:(t,e)=>({x:t.x,y:e.y,z:e.z}),ef:f(0,-1,0),Km: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)}},sv:()=>!0,ev:()=>!1,Qm:()=>!1}),this.xx.x,this.Ki,this.Rm,this.gx,this.pg,!1,this.ss),y:new $a(this,tl((()=>this.Dv)),this.xx.y,this.Ki,this.Rm,this.gx,this.pg,!1,this.ss),z:new $a(this,el((()=>this.Dv)),this.xx.z,this.Ki,this.Rm,this.gx,this.pg,!1,this.ss)},this.wx=this.Rm.rm([Oa.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.Ki.chart3DBoundingBoxStrokeStyle),this.zv=this.Ax.oc(this.ls.At,cn.Simple).Ie(this.Ki.chart3DSeriesBackgroundFillStyle).Fe(nt).setMouseInteractions(!0),this.Vv=this.Ax.oc(this.ls.At,cn.Simple).Ie(B).Fe(this.Ki.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Ev(this.zv,this.Vv),this.Cx({x:1,y:1,z:1},!0),this.yx=new fl(this.ls.At,this.pg,this.xx,((t,e)=>(e&&this.vx(e),this.Rm.jm(t)))),this.kx=this.yx.getDefaultCameraConfiguration(this.Tx(this.Fx)),this.vx(this.kx);const a=Pt(o?o.cursorBuilder:void 0,Ml),l=e.Xy();let c;this.jy=la(this,l,a.gy(l,this.pg,this.pg,kt,this.Ki,this),this,"show-pointed",Cl,(()=>0)),this.fv=ji(new Qi(((t,e,i)=>{c={locationOne:e,locationTwo:i,cameraLocation:this.Rm.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.nx&&!this.hx)return;const o=(c.locationOne.x-c.locationTwo.x)**2+(c.locationOne.y-c.locationTwo.y)**2,h=(e.x-i.x)**2+(e.y-i.y)**2,a=_e.length(c.cameraLocation),l=o/h*a,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.tx.push({type:"rotate+zoom",rotation:this.nx?d:{x:0,y:0},cameraDistance:this.hx?l:a}),this.ls.xs(),Qt(n)}),(t=>{})),new $i((t=>{}),((t,e,i,s,r)=>{if(this.nx){const t=s;this.tx.push({type:"rotate",rotation:t}),this.ls.xs(),Qt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.fv.onTouchStart),this.onBackgroundTouchMove(this.fv.onTouchMove),this.onBackgroundTouchEnd(this.fv.onTouchEnd),this.onSeriesBackgroundTouchStart(this.fv.onTouchStart),this.onSeriesBackgroundTouchMove(this.fv.onTouchMove),this.onSeriesBackgroundTouchEnd(this.fv.onTouchEnd),this.onBackgroundMouseDrag(this.cv),this.onBackgroundMouseDragStop(this.dv),this.onBackgroundMouseWheel(this.uv),this.onBackgroundMouseDown(((t,e)=>{Qt(e)})),this.onSeriesBackgroundMouseDrag(this.cv),this.onSeriesBackgroundMouseDragStop(this.dv),this.onSeriesBackgroundMouseWheel(this.uv),this.onSeriesBackgroundMouseDown(((t,e)=>{Qt(e)})),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.Mn),this.Mn(),this._p(r,this.pg)}setProjection(t){this.Rm.Ix(t);const e=this.yx.viewportChanged(this.mx());return e&&this.vx(e),this.ls.xs(),this}getProjection(){return this.Rm.Px()}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=Ml){const e=this.fp(),i=t.gy(e,this.pg,this.pg,this.ap(e),this.Ki,this);return this.xp(i),i}addPointSeries(t){const e=new(t&&t.type||al)(this,this.Lv,this.Rm,this.Ki,this.ls.ss,t);return this.Ov(e),e}addLineSeries(t){const e=new nl(this,this.Lv,this.Rm,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addPointLineSeries(t){const e=new ol(this,this.Lv,this.Rm,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addSurfaceGridSeries(t){const e=new ml(this,this.Lv,this.Rm,t,this.Ki,this.ls.ss);return this.Ov(e),e}addSurfaceScrollingGridSeries(t){const e=new pl(this,this.Lv,this.Rm,t,this.Ki,this.ls.ss);return this.Ov(e),e}addBoxSeries(t){const e=new sl(this,this.Lv,this.Rm,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addMeshModel(t){const e=new Sl(this,this.Lv,this.Rm,this.Ki,t,this.ls.ss);return this.Ov(e),e}translateCoordinate(t,e,i){if(xl(e)||xl(i)||Al(t)){if(xl(e)&&xl(i)&&Al(t)){if("axes"===e.id&&"world"===i.id)return this.Rm.Dx(t);if("world"===e.id&&"axes"===i.id)return this.Rm.Bx(t);if(e.id===i.id)return t}if(xl(e)&&Oi(i)&&Al(t)){const e=this.Rm.jm(t);return e?this.ls.Oo({engineX:e.x,engineY:e.y}):{clientX:-1,clientY:-1}}if(xl(e)&&Yi(i)&&Al(t)){const e=this.Rm.jm(t);return e?ct(e,this.ls.At,this.pg):{clientX:-1,clientY:-1}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return ta(t,e,i,this.pg,this.ls)}getDefaultAxisX(){return this._x.x}getDefaultAxisY(){return this._x.y}getDefaultAxisZ(){return this._x.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._x.x,this._x.y,this._x.z]}setCameraLocation(t){let e={location:t,direction:_e.normalize(_e.multiply(t,-1))};const i=this.yx.cameraLocationChanged(this.mx(e));return i&&(e=i),this.vx(e),this.ls.xs(),this}getCameraLocation(){return this.Rm.getCameraLocation()}getCameraDirection(){return this.Rm.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.yx.aS(t);const e=this.yx.cameraLocationChanged(this.mx());return e&&this.vx(e),this}getCameraAutomaticFittingEnabled(){return this.yx.mS()}onCameraChange(t){return this.R.on("cameraChange",t)}offCameraChange(t){return this.R.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.wx.Oe(t).Nm(Za(this.wx.pu())),this.Rm.xs(),this}getBoundingBoxStrokeStyle(){return this.wx.pu()}setBoundingBox(t){return this.Cx(t,!1),this}Cx(t,e){this.Fx=t;const i=this.Tx(t);if(this.xx.x.it(i.x),this.xx.y.it(i.y),this.xx.z.it(-i.z),!e){const t=this.yx.boundingBoxChanged(this.mx());t&&this.vx(t)}this.ls.xs()}getBoundingBox(){return this.Fx}De(t){if(oa.Bp(this.mh,this.Cp),0!==this.ox){const e=this.ox*t*.006;this.tx.push({type:"wheel-zoom",deltaY:e}),this.ox=Math.sign(this.ox)*Math.max(Math.abs(this.ox)-.01*t,0),0!==this.ox&&this.ls.xs(!0)}const e=this.getCameraDirection();if(this.tx.length>0){const t=this.yx.applyCameraInteractions(this.mx(),this.tx);t&&this.vx(t),this.tx.length=0}this.Lx&&_e.equals(this.Lx.location,this.kx.location)&&_e.equals(this.Lx.direction,this.kx.direction)||this.R.emit("cameraChange",this,this.getCameraLocation()),this.Lx=this.kx,super.De(t);for(let t=0;tthis.Rm.jm(t))),o=this.Rm.jm(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=oe(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.gn.length=0,this.xx.Y(),this.Rm.Y(),this.gx.Y(),this.Ax.Y(),this.jy.Y(),super.dispose()}J(){return this.xx.x.J(),this.xx.y.J(),this.xx.z.J(),super.J()}K(){return super.K()}vx(t){this.Rm.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(_e.addVec(t.location,_e.multiply(t.direction,-this.ix))),this.kx=t,this.ls.xs()}Tx(t){return _e.divide(t,_e.length(t)/this.qS)}mx(t=this.kx){return{boundingBox:this.Tx(this.Fx),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.hx=t,this}getMouseInteractionZoom(){return this.hx}setMouseInteractionRotate(t){return this.nx=t,this}getMouseInteractionRotate(){return this.nx}forEachAxis(t){return t(this._x.x),t(this._x.y),t(this._x.z),this}getSeries(){return this.Dv}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.sx=!!t,this}getAnimationZoom(){return this.sx}}const Cl=(t,e,i)=>{var s,r;return gt(e)?aa(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:ah(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:ah(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],[t.getDefaultAxisZ().getTitle()||"Z","",{text:ah(e.axisZ.formatValue(e.z),e.axisZ),font:{weight:"bold"}}],void 0!==e.intensity?["Value","",{text:ah(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]:[]]):mt(e)?aa(e,[[e.series],void 0!==e.value?["Value","",{text:ah(e.value.toFixed(2),null===(r=e.lut)||void 0===r?void 0:r.units),font:{weight:"bold"}}]:[]]):aa(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:ah(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:ah(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],[t.getDefaultAxisZ().getTitle()||"Z","",{text:ah(e.axisZ.formatValue(e.z),e.axisZ),font:{weight:"bold"}}]])},Tl={Column:Do,Row:Po};class Rl extends sa{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Rx=new Map,this.Ex=this.addUIElement(Tl.Row).setPosition({x:0,y:100}).setOrigin(Es.LeftTop).setBackground((t=>t.setFillStyle(B).setStrokeStyle(nt)))}add(t,e){return(t instanceof na?[t]:t instanceof vf?t.getCells().filter((t=>t.panel instanceof na)).map((t=>t.panel)):[]).forEach((t=>{const i=this.Ex.addElement(hh.VerticalLegendBox).setBackground((t=>t.setFillStyle(B).setStrokeStyle(nt))).add(t,e).setTitle(t.getTitle());this.Rx.set(t,i)})),this.ls.xs(),this}setLegendBoxes(t){return this.Rx.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.Ex.getSize()}}const El={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},kl=(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(),Il=(t,e)=>{let i=e.geometry;return i=Fl(t,e,i),i=Dl(t,e,i),i},Fl=(t,e,i)=>{if(t===El.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===El.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=Je(Dt(i)),h=[];for(let e=0;ethis.R.on("mouseEnter",t),this.onMouseLeave=t=>this.R.on("mouseLeave",t),this.onMouseClick=t=>this.R.on("mouseClick",t),this.onMouseDoubleClick=t=>this.R.on("mouseDoubleClick",t),this.onMouseDown=t=>this.R.on("mouseDown",t),this.onMouseUp=t=>this.R.on("mouseUp",t),this.onMouseMove=t=>this.R.on("mouseMove",t),this.offMouseEnter=t=>this.R.off(t,"mouseEnter"),this.offMouseLeave=t=>this.R.off(t,"mouseLeave"),this.offMouseClick=t=>this.R.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.R.off(t,"mouseDown"),this.offMouseUp=t=>this.R.off(t,"mouseUp"),this.offMouseMove=t=>this.R.off(t,"mouseMove"),this.offMouseDragStart=t=>this.R.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.R.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.R.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.R.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.R.on("mapDataReady",t);return this.Ux&&wt.setTimeout((()=>t())),e},this.onViewChange=t=>this.R.on("viewChange",t),this.Yx=(t,e,i,s,r)=>{this.At.x.it(s).si([this.Xt.left+this.wa.left,this.Xt.right+this.wa.right]),this.At.y.it(r).si([this.Xt.bottom+this.wa.bottom,this.Xt.top+this.wa.top+oa.Dp(this.mh,this.Cp)]),this.Hx&&this.$x(this.Xx,this.At,this.Hx)},this._t=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;r&&(this.getCursorMode()&&(this.Zx(s),Qt(t)),this.Gx&&this.ls.os.ws(r,!0),this.Qx=r,this.R.emit("mouseEnter",this,t,s))},this.wt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;this.Jx(),r&&(this.Gx&&this.ls.os.ws(r,!1),this.Qx=void 0,this.R.emit("mouseLeave",this,t,s),t&&Qt(t))},this.It=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;r&&(this.getCursorMode()&&(this.Zx(s),Qt(t)),this.Qx=r,this.R.emit("mouseMove",this,t,s))},this.Ct=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseClick",this,t,s)},this.kt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseDoubleClick",this,t,s)},this.Tt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseDown",this,t,s)},this.Ft=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseUp",this,t,s)},this.Dt=(t,e,i)=>{const s=i;if(!s||!this.Ux)return;const r=this.jx(this.Ux,s);this.R.emit("mouseDragStart",this,t,e,r)},this.Pt=(t,e,i,s,r)=>{const n=r;if(!n||!this.Ux)return;const o=this.jx(this.Ux,n);this.R.emit("mouseDrag",this,t,e,i,s,o)},this.Bt=(t,e,i,s)=>{const r=s;if(!r||!this.Ux)return;const n=this.jx(this.Ux,r);this.R.emit("mouseDragStop",this,t,e,i,n)},this.Lt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseWheel",this,t,s)},this.Rt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;r&&(this.Zx(s),this.Gx&&this.ls.os.ws(r,!0),this.Qx=r,this.R.emit("touchStart",this,t,s),Qt(t))},this.Et=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;r&&(this.Zx(s),this.Qx=r,this.R.emit("touchMove",this,t,s),Qt(t))},this.zt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;this.Jx(),r&&(this.Gx&&this.ls.os.ws(r,!1),this.Qx=void 0,this.R.emit("touchEnd",this,t,s),Qt(t))},this.ls.Xn(dh.Sf),this.ah=!1!==(null==n?void 0:n.animationsEnabled),this.Kx=e.Hy("mapChart plotting",0),this.onResize(this.Yx),this.mh.gr("Map Chart");const h=e.Xy(),a=Pt(n?n.cursorBuilder:void 0,Ra);this.jy=la(this,h,a.gy(h,this.uiScale,this.uiScale,kt,this.Ki),void 0,"show-pointed",Bl,(()=>0)),this.qx=this.ss.wg(),this._p(r,this.uiScale),this.tb=this.Kx.Um(this.At).setMouseInteractions(this.Yi).setMouseEnterEventHandler(((t,e,i)=>this._t(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.wt(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.kt(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.It(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Dt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Pt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Bt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Lt(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Rt(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Et(e,i))).setTouchEndEventHandler(((t,e,i)=>this.zt(e,i))).Ie(this.Ki.mapChartFillStyle).Fe(this.Ki.mapChartStrokeStyle),this.ib=this.Kx.Um(this.At).setMouseInteractions(this.Yi).Ie(this.Ki.mapChartOutlierRegionFillStyle).Fe(this.Ki.mapChartOutlierRegionStrokeStyle);const l=Pt(n&&n.type,El.World);this.Xx=l,this.sb(l).then((()=>{this.R.emit("mapDataReady")}))}getRegionUnderMouse(){return this.Qx}setFillStyle(t){return this.tb.Ie(t),this.ls.xs(),this}getFillStyle(){return this.tb.Hh()}setStrokeStyle(t){return this.tb.Fe(t),this.ls.xs(),this}getStrokeStyle(){return this.tb.po()}setEffect(t){return this.qx.Ss(t),this.ls.xs(),this}getEffect(){return this.qx.bs()}setOutlierRegionFillStyle(t){return this.ib.Ie(t),this.ls.xs(),this}getOutlierRegionFillStyle(){return this.ib.Hh()}setOutlierRegionStrokeStyle(t){return this.ib.Fe(t),this.ls.xs(),this}getOutlierRegionStrokeStyle(){return this.ib.po()}setSeparateRegionFillStyle(t){return this.Vx="function"==typeof t?t(this.Vx):t,this.zx.forEach((t=>t.Ie(this.Vx))),this.ls.xs(),this}getSeparateRegionFillStyle(){return this.Vx}setSeparateRegionStrokeStyle(t){return this.Ox="function"==typeof t?t(this.Ox):t,this.zx.forEach((t=>t.Fe(this.Ox))),this.ls.xs(),this}getSeparateRegionStrokeStyle(){return this.Ox}invalidateRegionValues(t){if(!this.Ux||!this.eb)return this.hb=this.hb||[],this.hb.push(t),this;if("function"==typeof t)for(let e=0;e{t.rb(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.rb(e.value)}))}}return this.ls.xs(),this}onMouseDragStart(t){return this.R.on("mouseDragStart",t)}onMouseDrag(t){return this.R.on("mouseDrag",t)}onMouseDragStop(t){return this.R.on("mouseDragStop",t)}onMouseWheel(t){return this.R.on("mouseWheel",t)}onTouchStart(t){return this.R.on("touchStart",t)}onTouchMove(t){return this.R.on("touchMove",t)}onTouchEnd(t){return this.R.on("touchEnd",t)}offTouchStart(t){return this.R.off(t,"touchStart")}offTouchMove(t){return this.R.off(t,"touchMove")}offTouchEnd(t){return this.R.off(t,"touchEnd")}setMouseInteractions(t){return this.Yi=t,this.tb.setMouseInteractions(t),this}getMouseInteractions(){return this.Yi}setHighlight(t){var e;return t=be(t),this.Nx=t,null===(e=this.Ux)||void 0===e||e.regions.forEach((e=>{this.ls.os.ws(e,t)})),this.R.emit("highlight",this,t),this}getHighlight(){return this.Nx}setAnimationHighlight(t){var e;return null===(e=this.Ux)||void 0===e||e.regions.forEach((e=>{this.ls.os.Cs(e,t)})),this}getAnimationHighlight(){var t;return this.ls.os.ks(null===(t=this.Ux)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.Gx=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Gx}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}offMapDataReady(t){return this.R.off(t,"mapDataReady")}offViewChange(t){return this.R.off(t,"viewChange")}async sb(t){const e=await((t,e)=>{let i;if(t===El.World)i="countries_world.json";else if(t===El.NorthAmerica)i="countries_northAmerica.json";else if(t===El.SouthAmerica)i="countries_southAmerica.json";else if(t===El.Africa)i="countries_africa.json";else if(t===El.Europe)i="countries_europe.json";else if(t===El.Asia)i="countries_asia.json";else if(t===El.USA)i="states_usa.json";else if(t===El.Canada)i="territoriesProvinces_canada.json";else{if(t!==El.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw wt.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return wt.fetch(s).then((t=>t.json())).catch((t=>{Re(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.mA.Zs);this.eb=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=Pl[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.ib.Hr()._l(e);if(t===El.USA){const t=25.8,e=29.7;this.zx.push(this.Kx.Pe(this.At).setMouseInteractions(!1).Ie(this.Vx).Fe(this.Ox).Be({x:-126,y:t}).it({x:10,y:e-t}),this.Kx.Pe(this.At).setMouseInteractions(!1).Ie(this.Vx).Fe(this.Ox).Be({x:-113,y:t}).it({x:7,y:e-t}))}const s=this.ls.os.Yr(this.tb,{animationEnabled:this.ah});for(let i=0;i{o.forEach((e=>e.us(t)))}))}if(this.qx.fs([this.tb]),this.Hx=i,this.$x(t,this.At,i),this.Ux=e,this.hb){for(const t of this.hb)this.invalidateRegionValues(t);this.hb=void 0}this.ls.xs()}$x(t,e,i){const s=Ll[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.q(o.min.x,o.max.x),e.y.q(o.min.y,o.max.y);const h=this.At.x.li(),a=this.At.y.li();this.R.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]}})}Zx(t){this.nb=t,this.ls.xs()}Jx(){this.nb=void 0,this.ls.xs()}jx(t,e){const i=Array.from(this.Wx.entries()).findIndex((([t,i])=>i.includes(e))),s=null==t?void 0:t.regions[i],r=this.ls.Hn();if(!r)return;const n=this.ls.Vo(r),o=this.eb&&this.eb[i];let h=ct({x:n.engineX,y:n.engineY},this.ls.At,this.At);h={x:Ft(h.x,this.At.x.getInnerStart(),this.At.x.getInnerEnd()),y:Ft(h.y,this.At.y.getInnerStart(),this.At.y.getInnerEnd())};let a=h.x,l=h.y;const u=s.transform;s.outlier&&u&&(a=(a-u.translate.x-u.vertexBoundaries.min.x)/u.scale.x+u.vertexBoundaries.min.x,l=(l-u.translate.y-u.vertexBoundaries.min.y)/u.scale.y+u.vertexBoundaries.min.y);const c=this.getFillStyle();return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.ls.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.ls.At},region:s,value:o,longitude:l,latitude:a,lut:H(c)?c.lut:void 0}}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=Ra){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}setAnimationsEnabled(t){return this.ah=!t,this}getAnimationsEnabled(){return this.ah}getMinimumSize(){}if(){return[this]}De(t){super.De(t),super.Mp(),oa.Bp(this.mh,this.Cp);const e=m(this.At.x.ei(),this.At.y.ei(),this.At.x.ri(),this.At.y.ri());return this.Kx.ux(e),this.jy.De(!1,[],void 0,{explicitTarget:this.nb}),this}dispose(){return this.Kx.Y(),this.jy.Y(),ia(this.At),super.dispose()}J(){return super.J(),this.At.J(),this}K(){return super.K(),this.At.K(),this}Xd(){return de(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))),this.styleLegendEntry(t,i),this}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.getFillStyle()})}}const _l=(t,e)=>{const i=t>0,s=e>0;return`${[ge(Math.abs(0|t),2),"° ",ge(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[ge(Math.abs(0|e),2),"° ",ge(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`},Bl=(t,e,i)=>{var s;const r=[[e.region.name],[_l(e.longitude,e.latitude)]];return void 0!==e.value&&r.push({text:ah(e.value.toFixed(1),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}),r};class zl extends ir{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.ob(i),s,r,{numeric:e.ab({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.ab({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.ab({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.lb=n,this.ub=o,this.cb=h,this.ss=a,this.fb=i,this.Ab=e.ab({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.bh=h.Or(i).setMouseInteractions(!1).jh(e.ab({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).Ie(e.ab({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Jh=this.ss.wg([this.bh]).Ss(s.effectsText)}setTickStrategy(t,e){return super.Vh(t,e)}setStrokeStyle(t){return this.Ab="function"==typeof t?t(this.Ab):t,this.ub.xs(),this}getStrokeStyle(){return this.Ab}mr(t,e){return new Nl(e,t,this.fb,this.cb,this.gb(this.lb,this.fb),this.cb.Ne(this.fb).setMouseInteractions(!1))}vr(t,e){const i=this.pb(this.fb,t);this.yb&&!1===this.yb(t)?t.Ke.setVisible(!1):t.Ke.setVisible(!0).Be(ui(this.mb(this.fb,t.M),i.padding)).Ya(i.alignment).Zh(i.rotation).Va(i.offset.x,i.offset.y),this.vb(this.fb,t.Sb,t.xb,t)}setMouseInteractions(t){return this}De(){this.rr({physicalAxisSize:0});const t=this.Mr(((t,e)=>{const i=e.Fh.yr,s=.5*this.Ab.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Ke.Ls().td().y);return Math.max(t,s)}),0);return this.bb(this.fb,this.Ab,t),this.Mb(this.fb,this.bh,t),t}}class Nl extends sr{constructor(t,e,i,s,r,n,o){super(t,e,s,i,o),this.Sb=r,this.xb=n,r.setMouseInteractions(!1),this.qi.push(r,n)}}class Ol extends zl{constructor(t,e,i,s,r,n,o,h,a){super(t,Ul((()=>this.Dg())),e,i,s,r,n,o,h),this.Om=this.ub.Ne(this.fb).setMouseInteractions(!1),this._b=a,this.setScrollStrategy(Os.expansion),this.setTickStrategy(Us.Numeric),this.setTitle("Amplitude")}Dg(){return this._b()}Dr(t,e){return uh(t,e,this.fb.y)}Lr(t,e,i){const s=2*(e-t),r=this.fb.x.Li(s);return{min:t-i*r,max:e+i*r}}mb(t,e){return{x:t.wb()?e-t.Cb().start:t.Cb().start-e,y:0}}gb(t,e){return t.hd(e)}vb(t,e,i,s){const r=s.Fh.yr,n=t.wb()?s.M-t.Cb().start:t.Cb().start-s.M;It(s.M,t.Cb().start)||It(s.M,t.Cb().end)?e.setVisible(!1):e.setVisible(!0).lu(0).Ge(360).Au(void 0).fu(0).uu(n).Au(60).Ie(B).Fe(r.gridStrokeStyle);const o=.5*this.Ab.getThickness();i.We({x:n,y:-o*t.Wi().y}).Ge({x:n,y:-(o+r.tickLength)*t.Wi().y}).Oe(r.tickStyle)}pb(t,e){const i=e.Fh.yr;return{alignment:{x:0,y:1},padding:{x:0,y:t.Wi().y*-(.5*this.Ab.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}bb(t,e,i){const s=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end;this.Om.We({x:0,y:0}).Ge({x:s,y:0}).Oe(e)}Mb(t,e,i){const s=t.wb()?(t.Cb().start+t.Cb().end)/2-t.Cb().start:t.Cb().start-(t.Cb().start+t.Cb().end)/2;e.Ya({x:0,y:1}).Be({x:s,y:-i*t.Wi().y})}}const Ul=t=>({...Ja(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),ob:t=>({getInnerStart:()=>t.Cb().start,getInnerEnd:()=>t.Cb().end,q:(e,i)=>t.kb(e,i),ut:(e,i,s,r,n)=>t.y.ut(e,i,s,r,n)}),ab:t=>t.amplitude});class Yl extends zl{constructor(t,e,i,s,r,n,o,h){super(t,Xl,e,i,s,r,n,o,h),this.Tb=90,this.Fb=12,this.Ib=Gl,this.Om=this.ub.hd(this.fb).setMouseInteractions(!1),this.yb=t=>{let e=180*(t.M-this.fb.Pb())/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.hh=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Tb)}setTickStyle(t){return this.Db="function"==typeof t?t(this.Db):t,this.Bb(),this.ub.xs(),this}getTickStyle(){return this.Db}setTickFormattingFunction(t){return this.Ib=t,this.Bb(),this.ub.xs(),this}getTickFormattingFunction(){return this.Ib}setClockwise(t){this.fb.Lb(t);const e=this.Tb*Math.PI/180;return t?this.fb.Rb(e+Math.PI/2):this.fb.Rb(e-Math.PI/2),this.ub.xs(),this}getClockwise(){return!this.fb.Eb()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Tb=t;const e=t*Math.PI/180;return this.getClockwise()?this.fb.Rb(e+Math.PI/2):this.fb.Rb(e-Math.PI/2),this.ub.xs(),this}getNorth(){return 180*this.fb.Pb()/Math.PI}setDivision(t){return this.Fb=t,this.Bb(),this.ub.xs(),this}getDivision(){return this.Fb}Dg(){return[]}Dr(t,e){return e}Lr(t,e,i){return{min:t,max:e}}mb(t,e){const i=t.Eb()?1:-1,s=t.Pb(),r=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}gb(t,e){return t.Ne(e)}vb(t,e,i,s){const r=this.Db,n=t.Eb()?1:-1,o=t.Pb(),h=(s.M-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end,c={x:a*u,y:l*u};e.We({x:0,y:0}).Ge(c);const d={x:c.x+a*r.tickLength*t.Wi().x,y:c.y+l*r.tickLength*t.Wi().y};i.We(c).Ge(d),e.Oe(r.gridStrokeStyle),i.Oe(r.tickStyle)}pb(t,e){const i=this.Db,s=t.Eb()?1:-1,r=t.Pb();let n,o=(e.M-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.Wi().x,l=Math.sin(o)*h*t.Wi().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}bb(t,e,i){const s=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end;this.Om.lu(0).Ge(360).fu(0).uu(s+.5*e.getThickness()*t.Wi().x).Au(360).Ie(B).Fe(e)}Mb(t,e,i){const s=t.Pb(),r=this.pb(t,{M:0+s}),n=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end;e.Ya(r.alignment).Zh(r.rotation).Va(r.offset.x,r.offset.y).Be(ui({x:n,y:0},r.padding))}Bb(){this.tr({$e:[],Xe:[{Ke:"Radial ticks",Ug:0,yr:this.Db,Ar:this.Ib,Gr:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Fb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},Ih:{Sr:()=>{},Ph:()=>!1},Wr:void 0}],je:Gl,Ze:void 0,Qe:void 0})}}const Gl=(t,e,i)=>(180*t/Math.PI).toFixed(0),Xl={kr:()=>{},Tr:()=>{},Ir:()=>{},ob:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,q:(t,e)=>{},ut:(e,i,s,r,n)=>t.x.ut(e,i,s,r,n)}),ab:t=>t.radial},Zl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),Hl=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class Wl extends Zi{constructor(t,e,i,s,r,n){super(e,i,r,n),this._s="Sector",this.zb=0,this.Vb=1*Math.PI/2,this.Ob=void 0,this.Nb=void 0,this.Is=t,this.fb=s,this.Ty=this.Is.hd(this.fb).us(this.getHighlight()),this.ds(this.Ty),this.we=r.polarSectorFillStyle,this.Ce=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.zb=Ft(t,0,360),this.Is.xs(),this}getAngleStart(){return this.zb}setAngleEnd(t){return this.Vb=Ft(t,0,360),this.Is.xs(),this}getAngleEnd(){return this.Vb}setAmplitudeStart(t){return this.Ob=t,this.Is.xs(),this}getAmplitudeStart(){return this.Ob}setAmplitudeEnd(t){return this.Nb=t,this.Is.xs(),this}getAmplitudeEnd(){return this.Nb}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.Is.xs(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.Is.xs(),this}getStrokeStyle(){return this.Ce}De(){const t=this.fb.Cb(),e=180*this.fb.Pb()/Math.PI,i=void 0!==this.Ob?Ft(this.Ob,t.start,t.end):t.start,s=void 0!==this.Nb?Ft(this.Nb,t.start,t.end):t.end,r=this.fb.wb()?i-t.start:t.start-i,n=this.fb.wb()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.fb.Eb()?1:-1,l=Math.abs(this.Vb-this.zb);this.Ty.lu((this.zb-e)*a).Ge((this.Vb-e)*a).fu(100*o/h).uu(h).Ie(this.we).Fe(this.Ce).Au(Math.ceil(l/2))}Le(t,e){t.us(e),this.Is.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.Ce})}}class jl extends Zi{constructor(){super(...arguments),this.av=!0,this.ov=!0}setAutoScrollingEnabled(t){return this.av=t,this.chart.ls.xs(),this}getAutoScrollingEnabled(){return this.av}yv(){}De(){}bm(){}setCursorEnabled(t){return this.ov=t,this}getCursorEnabled(){return this.ov}setCursorFormattingOverride(t){return this.Av=t,this}getCursorFormattingOverride(){return this.Av}}class Kl extends jl{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Is=t,this.chart=e,this.scale=s}getAmplitudeMin(){return this.Gb?this.Gb.min:void 0}getAmplitudeMax(){return this.Gb?this.Gb.max:void 0}}const $l=(t,e)=>{const i=[],s=e.Cb().start,r=e.Cb().end,n=e.wb(),o=e.Eb()?1:-1,h=e.Pb(),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=Ft(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},Ql=t=>{const e={min:Be,max:ze};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},ql=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),Jl=(t,e)=>{let i=Ai(t);for(e.Eb()||(i*=-1),i+=180*e.Pb()/Math.PI;i<0;)i+=360;i%=360;const s=ai(t),r=e.Cb(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:zn(r.start,r.end,s/n)}};class tu extends Kl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this._s="Heatmap Series",this.Wb=!0,this.bv=!1,this.Xd=()=>de(this.we);const h=this.chart.getSeries().length;this.we=ye(this.Ki.polarHeatmapSeriesFillStyle||this.Ki.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.Qn=u,this.Ub=t.Yb(s,[],u).Ie(this.we).us(this.getHighlight()),this.ds(this.Ub);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.Gb={min:c,max:d},this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=ct(s,this.chart.ls.At,this.scale),n=Jl(r,this.scale),o=ha(e)?this.Ub.Hb(n):this.Ub.Jc(n);if(!o)return;const h=$l([o],this.scale)[0];return{cursorPosition:{pointMarker:h,pointMarkerScale:this.scale,resultTable:h,resultTableScale:this.scale},series:this,angle:o.angle,amplitude:o.amplitude,intensity:o.cellValue,annulus:o.iAnnulus,sector:o.iSector,lut:H(this.we)?this.we.lut:void 0}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0,intensity:0,sector:0,annulus:0,lut:H(this.we)?this.we.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}invalidateIntensityValues(t){if(this.bv&&this.chart.ls.Xn(dh.Cf),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.Qn.dataOrder?t[0].length:t.length,annuli:"annuli"===this.Qn.dataOrder?t.length:t[0].length},i="annuli"===this.Qn.dataOrder?this.Qn.annuli:this.Qn.sectors,s="annuli"===this.Qn.dataOrder?this.Qn.sectors:this.Qn.annuli;if(e.x>i||e.y>s){if(!0===this.chart.mA.Kn){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.`;wt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.mA.Kn){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.`;wt.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.Ub.FS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.Is.xs(),this.bv=!0,this}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.Ub.Ie(this.we),this.Is.xs(),this}getFillStyle(){return this.we}clear(){return this.Ub.Ot(),this.Is.xs(),this}setIntensityInterpolation(t){return t=t||"disabled",this.Ub.kS(t),this.Is.xs(),this}getIntensityInterpolation(){return this.Ub.TS()}rv(){return this.av&&this.getVisible()}Le(t,e){t.us(e),this.Is.xs()}De(){}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}}class eu extends Kl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this._s="Line Series",this.$b=[],this.Xb=!1,this.jb=!1,this.gu=ye(this.Ki.polarLineSeriesStrokeStyle,n),this.Zb=t.rm(s,void 0,[Oa.UserSeries]).Oe(this.gu).us(this.getHighlight()),this.ds(this.Zb)}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=this.Zb.Qb(s);if(!r)return;const n=Jl(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,"show-nearest")))}setData(t){return 0!==this.$b.length&&this.chart.ls.Xn(dh.Cf),this.$b=ql(t),this.Xb=!0,this.Gb=Ql(this.$b),this.Is.xs(),this}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;return this.Zb.Oe(e),this.Is.xs(),this}getStrokeStyle(){return this.gu}setConnectDataAutomaticallyEnabled(t){return this.jb=t,this.Is.xs(),this}getConnectDataAutomaticallyEnabled(){return this.jb}rv(){return this.av&&this.$b.length>0&&this.getVisible()}Le(t,e){t.us(e),this.Is.xs()}De(){if(this.Xb||this.scale.Jb()){const t=$l(this.$b,this.scale),e=Je(t);this.jb?(t.push({...t[0]}),this.Zb.Ul(!0)):this.Zb.Ul(!1),this.Zb.Ot().dl(t).Ko(e),this.Xb=!1,this.Zb.Ls()}}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.gu})}}class iu extends Kl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this._s="Point Line Series",this.$b=[],this.Xb=!1,this.jb=!1,this.Kb=3,this.ba=0,this.qb=e.PointShape.Circle,this.we=ye(this.Ki.polarPointLineSeriesFillStyle,o),this.gu=ye(this.Ki.polarPointLineSeriesStrokeStyle,o),this.Zb=t.rm(r,void 0,[Oa.UserSeries]).Oe(this.gu).us(this.getHighlight()),this.ds(this.Zb),this.tM=t.Pv(r).Ie(this.we).ol(this.qb).it(this.Kb).us(this.getHighlight()),this.ds(this.tM)}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=this.Zb.Qb(s);if(!r)return;const n=Jl(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}setData(t){return 0!==this.$b.length&&this.chart.ls.Xn(dh.Cf),this.$b=ql(t),this.Xb=!0,this.Gb=Ql(this.$b),this.Is.xs(),this}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;return this.Zb.Oe(e),this.Is.xs(),this}getStrokeStyle(){return this.gu}setPointFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;return this.tM.Ie(e),this.Is.xs(),this}getPointFillStyle(){return this.we}setPointSize(t){return this.Kb=t,this.tM.it(t),this.Is.xs(),this}getPointSize(){return this.Kb}setPointShape(t){return this.qb=t,this.tM.ol(this.qb),this}getPointShape(){return this.qb}setPointRotation(t){return this.ba=t,this.tM.Zh(t),this.Is.xs(),this}getPointRotation(){return this.ba}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.gu})}setConnectDataAutomaticallyEnabled(t){return this.jb=t,this.Is.xs(),this}getConnectDataAutomaticallyEnabled(){return this.jb}rv(){return this.av&&this.$b.length>0&&this.getVisible()}Le(t,e){t.us(e),this.Is.xs()}De(){if(this.Xb||this.scale.Jb()){const t=$l(this.$b,this.scale),e=Je(t);this.jb?(t.push({...t[0]}),this.Zb.Ul(!0)):this.Zb.Ul(!1),this.Zb.Ot().dl(t).Ko(e),this.tM.Ot().dl(t).Ko(e),this.Xb=!1,this.Zb.Ls(),this.tM.Ls()}}Fs(){return this.Ms||this.qb}}class su extends pn{constructor(t,e,i,s,n,o,h,a,l){super(),this.Xo=Fe(),this.R=new r.Eventer,this.$i=!1,this.iM=s,this.sM=n,this.eM=o,this.hM=h,this.rM=a,this.Is=t,this.scale=e,this.nM=i,this.Ki=l}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}dispose(){return this.nM&&this.nM(this),this.Is.ls.xs(),this.R.emit("dispose",this),this.$i=!0,this}setVisible(t){return super.setVisible(t),this.eM(),this.Is.ls.xs(),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setMouseInteractions(t){return this.hM(this,t),this}getMouseInteractions(){return this.rM(this)}}class ru extends su{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g,m,p){super(t,e,i,s,r,n,o,h,p),this.oM=1,this.aM=1,this.Is=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=m,this.boundaries=y(this.dimensionStrategy.toPoint(l,c),this.dimensionStrategy.toPoint(u,m)),this.lM=this.Ki.boxSeriesBodyFillStyle,this.uM=this.Ki.boxSeriesBodyStrokeStyle,this.gu=this.Ki.boxSeriesStrokeStyle,this.cM=this.Ki.boxSeriesMedianStrokeStyle,this.Ls()}getBoundaries(){return this.boundaries}setBodyWidth(t){return this.oM=t,this.Ls(),this}getBodyWidth(){return this.oM}setBodyFillStyle(t){return this.lM="function"==typeof t?t(this.lM):t,this.sM(),this}getBodyFillStyle(){return this.lM}setBodyStrokeStyle(t){return this.uM="function"==typeof t?t(this.uM):t,this.sM(),this}getBodyStrokeStyle(){return this.uM}setTailWidth(t){return this.aM=t,this.Ls(),this}getTailWidth(){return this.aM}setStrokeStyle(t){return this.gu="function"==typeof t?t(this.gu):t,this.sM(),this}getStrokeStyle(){return this.gu}setMedianStrokeStyle(t){return this.cM="function"==typeof t?t(this.cM):t,this.sM(),this}getMedianStrokeStyle(){return this.cM}Ls(){this.iM()}getDominantStyle(){return this.getBodyFillStyle()}}class nu extends jl{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.dM=!0,this.qi=new Map,this.chart=t,this.Is=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.fM=h,this.scale=Ni(s.At,r.At),this.AM=t.gM,t.gM+=1,this.pM(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.yM),this.onMouseLeave(this.chart.mM),this.onMouseWheel(this.chart.uv),this.onMouseDragStart(this.chart.vM),this.onMouseDrag(this.chart.cv),this.onMouseDragStop(this.chart.dv),this.onTouchStart(this.chart.fv.onTouchStart),this.onTouchMove(this.chart.fv.onTouchMove),this.onTouchEnd(this.chart.fv.onTouchEnd)}get xAxis(){return this.axisX}get yAxis(){return this.axisY}SM(){const t=Array.from(this.qi.keys());for(const e of t)if(e.xM)return e.xM}setClipping(t){return this.dM=t,this.Is.xs(),this}getClipping(){return this.dM}attacheAxis(){this.bM=this.axisXAttachHandler(this),this.MM=this.axisYAttachHandler(this)}ds(t,e){super.ds(t,e),t.ra(this.AM)}getName(){const t=this.cs(),e="ProgressiveY"===t||"RegressiveY"===t?this.axisX.getTitle():this.axisY.getTitle();return this._s||e.length>0&&e||"Series"}setDrawOrder(t){return this.AM=t.seriesDrawOrderIndex,this.qi.forEach(((t,e)=>{e.ra(this.AM)})),this.chart.ls.xs(),this}dispose(){return super.dispose(),this.bM(this),this.MM(this),this}bm(){if(super.bm(),this.dM){const t={x:this.scale.x.ei(),y:this.scale.y.ei(),width:this.scale.x.ri(),height:this.scale.y.ri()};this.qi.forEach(((e,i)=>{i._M=t}))}else this.qi.forEach(((t,e)=>{e._M=void 0}))}getBoundaries(){return y(u(this.getXMin()||0,this.getYMin()||0),u(this.getXMax()||0,this.getYMax()||0))}setCursorEnabled(t){return super.setCursorEnabled(t)}}const ou=(t,e,i,s)=>{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 e=this.wM.findIndex((e=>e===t));e>=0&&this.wM.splice(e,1),this.kM=!0,this.CM=void 0,this.Is.xs()},this.iM=()=>{this.CM=void 0,this.kM=!0,this.chart.ls.xs()},this.sM=()=>{this.kM=!0,this.chart.ls.xs()},this.eM=()=>{this.CM=void 0,this.kM=!0,this.chart.ls.xs()},this.hM=(t,e)=>{this.setMouseInteractions(e)},this.TM=t=>this.getMouseInteractions()}De(){super.De(),this.kM&&(this.FM(this.wM),this.kM=!1)}clear(){return this.wM.slice().forEach(Et),this.wM.length=0,this.kM=!0,this.CM=void 0,this.Is.xs(),this}IM(t,e){void 0!==e?this.wM.splice(e,0,t):this.wM.push(t),this.kM=!0,this.PM&&this.PM(t),t.onMouseEnter(((t,e)=>this._t(t,e,void 0,{}))),t.onMouseLeave(((t,e)=>this.wt(t,e,void 0))),t.onMouseClick(((t,e)=>this.Ct(t,e,void 0,{}))),t.onMouseDoubleClick(((t,e)=>this.kt(t,e,void 0,{}))),t.onMouseDown(((t,e)=>this.Tt(t,e,void 0,{}))),t.onMouseUp(((t,e)=>this.Ft(t,e,void 0,{}))),t.onMouseMove(((t,e)=>this.It(t,e,void 0,{}))),t.onMouseDragStart(((t,e,i)=>this.Dt(t,e,i,void 0,{}))),t.onMouseDrag(((t,e,i,s,r)=>this.Pt(t,e,i,s,r,void 0,{}))),t.onMouseDragStop(((t,e,i,s)=>this.Bt(t,e,i,s,void 0,{}))),t.onMouseWheel(((t,e)=>this.Lt(t,e,void 0,{}))),t.onTouchStart(((t,e)=>this.Rt(t,e,void 0,{}))),t.onTouchMove(((t,e)=>this.Et(t,e,void 0,{}))),t.onTouchEnd(((t,e)=>this.zt(t,e,void 0,{}))),this.Is.xs()}rv(){return this.av&&this.wM.length>0&&this.getVisible()}setDefaultStyle(t){this.PM=t,this.wM.forEach(t),t(this.DM);for(let t=0;t0?this.wM[0].getDominantStyle():this.DM.getDominantStyle()})}}const lu=(t,e=1,i)=>{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i0?e:0,this.Is.xs(),this}add(t){if(0!==this.LM.length&&this.chart.ls.Xn(dh.Cf),Array.isArray(t)?this.zM(t):this.zM([t]),this.bu.length>0){const t=this.bu[this.bu.length-1];this.VM={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.VM?this.VM.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.fl()+e.Al()),this.bu.length)}clear(){this.OM=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.EM.getXMax(this.LM,this.OM)||0}getXMin(){return this.EM.getXMin(this.LM,this.OM)||0}getYMax(){return this.EM.getYMax(this.LM,this.OM)||0}getYMin(){return this.EM.getYMin(this.LM,this.OM)||0}Ir(){const t=u(0,0);for(const e of this.LM)t.x=Math.max(t.x,e.Cl()),t.y=Math.max(t.y,e.kl());return t}NM(t,e,i,s){this.EM.NM(t,e,i,s,this.scale,(t=>{}))}yv(){super.yv(),this.GM&&this.NM(this.LM,this.getPointAmount(),this.GM,this.RM)}De(){super.De();const t=this.getBoundaries();this.bu.length>0&&(this.WM(this.bu),this.bu=[]);for(const e of this.LM)e.Ko(t);return super.De()}bm(){super.bm(),this.OM=void 0,this.bu.length=0}zM(t){0!==t.length&&(this.OM?this.OM=ei(this.OM,Je(t)):this.OM=Je(t),this.R.emit("dataAdd",this,t,this.OM),this.bu=he(this.bu,t,{canReturnB:!1}),this.Is.xs())}UM(){return hu(this.LM)}YM(t){return this.R.on("dataAdd",t)}HM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}XM(t){return this.R.off(t)}}const cu=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;hct(this.Ps.toPoint((t.start+t.end)/2,t.median),this.scale,this.Is.ls.At),this.chart.ls.Xn(dh._f),this.Ps=a,this.DM=new ru(this.Is,this.scale,this.nM,kt,kt,kt,kt,(t=>!1),this.Ps,0,0,0,0,0,0,0,this.Ki).dispose(),this.QM=new ja((()=>{const t=this.Is.Wg(this.scale);return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Oe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i.Yg(e.start,e.end),i}))))),this.JM=new ja((()=>{const t=this.jM.Mt(this.Is.Um(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],start:r[1].start,end:r[1].end,lowerExtreme:r[1].lowerExtreme,lowerQuartile:r[1].lowerQuartile,median:r[1].median,upperQuartile:r[1].upperQuartile,upperExtreme:r[1].upperExtreme,series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,median:0,lowerQuartile:0,upperQuartile:0,lowerExtreme:0,upperExtreme:0,start:0,end:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}pM(t){if(!(t instanceof Bi||t instanceof zi))throw new Error("BoxSeries only supports Linear Axes")}FM(t){const e=this.JM.Mm(),i=this.QM.Mm();t.forEach((t=>{if(!t.getVisible())return;const s=this.Ps.toPoint((t.start+t.end-t.oM*(t.end-t.start))/2,t.lowerQuartile),r=this.Ps.toPoint((t.end-t.start)*t.oM,t.upperQuartile-t.lowerQuartile),n=this.Ps.toPoint((t.start+t.end)/2,t.lowerQuartile),o=this.Ps.toPoint((t.start+t.end)/2,t.lowerExtreme),h=this.Ps.toPoint((t.start+t.end)/2,t.upperQuartile),a=this.Ps.toPoint((t.start+t.end)/2,t.upperExtreme),l=this.Ps.toPoint((t.start+t.end-t.aM*(t.end-t.start))/2,t.lowerExtreme),u=this.Ps.toPoint((t.start+t.end+t.aM*(t.end-t.start))/2,t.lowerExtreme),c=this.Ps.toPoint((t.start+t.end-t.aM*(t.end-t.start))/2,t.upperExtreme),d=this.Ps.toPoint((t.start+t.end+t.aM*(t.end-t.start))/2,t.upperExtreme),f=this.Ps.toPoint((t.start+t.end-t.oM*(t.end-t.start))/2,t.median),g=this.Ps.toPoint((t.start+t.end+t.oM*(t.end-t.start))/2,t.median);e.add({Xo:t.Xo,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.lM,strokeStyle:t.uM}),i.add({Xo:0,start:n,end:o,figure:t},{strokeStyle:t.gu}),i.add({Xo:0,start:h,end:a,figure:t},{strokeStyle:t.gu}),i.add({Xo:0,start:l,end:u,figure:t},{strokeStyle:t.gu}),i.add({Xo:0,start:c,end:d,figure:t},{strokeStyle:t.gu}),i.add({Xo:0,start:f,end:g,figure:t},{strokeStyle:t.cM})})),e.finishPlot(),i.finishPlot()}add(t){const e=new ru(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ps,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.Ki);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class fu extends su{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.Ka=y(u(0,0),u(0,0)),this.Is=t,this.scale=e,this.we=ye(a.ellipseSeriesFillStyle,l),this.Ce=ye(a.ellipseSeriesStrokeStyle,l)}getBoundaries(){return this.Ka}setDimensions(t){return this.dimensions=t,this.Ka=y(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.iM(),this.Is.xs(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.sM(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.sM(),this}getStrokeStyle(){return this.Ce}getDominantStyle(){return this.we}}class gu extends au{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this._s="Ellipse Series",this.jM=ke(),this.ZM=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return ct(i,this.scale,this.Is.ls.At)},this.chart.ls.Xn(dh._f),this.KM=c,this.DM=new fu(this.Is,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.Ki,this.KM).dispose(),this.JM=new ja((()=>{const t=this.jM.Mt(this.Is.Um(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],...r[1].getDimensions(),series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,radiusX:0,radiusY:0,drawSteps:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}pM(t){if(!(t instanceof Bi||t instanceof zi))throw new Error("EllipseSeries only supports Linear Axes")}FM(t){const e=this.JM.Mm();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({Xo:t.Xo,vertices:s,figure:t},{fillStyle:n,strokeStyle:o})})),e.finishPlot()}add(t){const e=new fu(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ki,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class yu extends su{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.qM=[],this.Ka=Ne,this.Is=t,this.scale=e,this.we=ye(a.polygonSeriesFillStyle,l),this.Ce=ye(a.polygonSeriesStrokeStyle,l)}getBoundaries(){return this.Ka}setDimensions(t){return this.qM=t,this.Ka=Je(this.qM),this.iM(),this.Is.xs(),this}getDimensions(){return this.qM}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.sM(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.sM(),this}getStrokeStyle(){return this.Ce}getDominantStyle(){return this.we}}class mu extends au{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this._s="Polygon Series",this.jM=ke(),this.ZM=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return ct(i,this.scale,this.Is.ls.At)},this.chart.ls.Xn(dh._f),this.KM=c,this.DM=new yu(this.Is,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.Ki,this.KM).dispose(),this.JM=new ja((()=>{const t=this.jM.Mt(this.Is.Um(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],coordinates:r[1].getDimensions(),series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,coordinates:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}pM(t){}FM(t){const e=this.JM.Mm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=t.getFillStyle(),r=t.getStrokeStyle();e.add({Xo:t.Xo,vertices:i,figure:t},{fillStyle:s,strokeStyle:r})})),e.finishPlot()}add(t){const e=new yu(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ki,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class pu extends su{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.t_={x:0,y:0,width:0,height:0},this.i_={x1:0,y1:0,x2:0,y2:0},this.Ka=y(u(0,0),u(0,0)),this.we=ye(a.rectangleSeriesFillStyle,l),this.Is=t,this.scale=e,this.Ce=ye(a.rectangleSeriesStrokeStyle,l)}getBoundaries(){return this.Ka}setDimensions(t){return"x"in t?(this.t_=t,this.i_={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.i_=t,this.t_={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.Ka=Je([this.t_,u(this.t_.x+this.t_.width,this.t_.y+this.t_.height)]),this.iM(),this.Is.xs(),this}getDimensionsPositionAndSize(){return this.t_}getDimensionsTwoPoints(){return this.i_}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.sM(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.sM(),this}getStrokeStyle(){return this.Ce}getDominantStyle(){return this.we}}class xu extends au{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this._s="Rectangle Series",this.jM=ke(),this.ZM=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return ct(i,this.scale,this.Is.ls.At)},this.chart.ls.Xn(dh._f),this.KM=c,this.DM=new pu(this.Is,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.Ki,this.KM).dispose(),this.JM=new ja((()=>{const t=this.jM.Mt(this.Is.Um(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],...r[1].getDimensionsPositionAndSize(),...r[1].getDimensionsTwoPoints(),series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,x1:0,y1:0,x2:0,y2:0,width:0,height:0,multiHit:0,figure:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}pM(t){}FM(t){const e=this.JM.Mm();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({Xo:t.Xo,vertices:s,figure:t},{fillStyle:r,strokeStyle:n})})),e.finishPlot()}add(t){const e=new pu(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ki,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class Au extends su{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.Ka=y(u(0,0),u(0,0)),this.Ki=a,this.Is=t,this.scale=e,this.Ce=ye(a.segmentSeriesStrokeStyle,l)}getBoundaries(){return this.Ka}setDimensions(t){return this.dimensions=t,this.Ka=y(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.iM(),this.Is.xs(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.sM(),this}getStrokeStyle(){return this.Ce}getDominantStyle(){const t=this.Ce;return t!==nt?t.getFillStyle():B}}class Su extends au{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this._s="Segment Series",this.s_=ke(),this.ZM=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return ct(i,this.scale,this.Is.ls.At)},this.chart.ls.Xn(dh._f),this.KM=c,this.DM=new Au(this.Is,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.Ki,this.KM).dispose(),this.QM=new ja((()=>{const t=this.s_.Mt(this.Is.Wg(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Oe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i.Yg(e.start,e.end),this.s_.Vt(i,e.figure),i})))),(()=>{this.s_.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],...r[1].getDimensions(),series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,startX:0,startY:0,endX:0,endY:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}pM(t){}FM(t){const e=this.QM.Mm();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({Xo:t.Xo,start:s,end:r,figure:t},{strokeStyle:n})})),e.finishPlot()}add(t){const e=new Au(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ki,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class vu extends nu{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._s="Heatmap Grid Series",this.vS={},this.chart.ls.Xn(dh.Mf),this.e_=a,this.Ki=l;const d=c;this.we=ye(l.heatmapGridSeriesFillStyle,d),this.SS=ye(this.Ki.heatmapGridSeriesWireframeStyle,d);const f={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows};this.Qn=f,this.h_=this.Is.r_(this.scale,[],f).Ie(this.we).xS(this.SS).us(this.getHighlight()),this.ds(this.h_),this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=ct(s,this.Is.ls.At,this.scale),n=ha(e)?this.h_.Hb(r):this.h_.Jc(r);if(n)return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},x:n.x,y:n.y,column:n.column,row:n.row,intensity:n.cellValue,series:this,axisX:this.axisX,axisY:this.axisY,lut:H(this.we)?this.we.lut:void 0}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,intensity:0,column:0,row:0,lut:H(this.we)?this.we.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}MS(){const t=this.vS.start||{x:0,y:0};let e;e=this.vS.end?{x:(this.vS.end.x-t.x)/this.Qn.columns,y:(this.vS.end.y-t.y)/this.Qn.rows}:this.vS.step?this.vS.step:{x:1,y:1},this.h_._S(t,e),this.chart.ls.xs()}setStart(t){return this.vS.start=t,this.MS(),this}getStart(){return this.h_.wS().start}setStep(t){return this.vS.step=t,this.MS(),this}getStep(){return this.h_.wS().step}setEnd(t){return this.vS.end=t,this.MS(),this}getEnd(){return this.h_.wS().end}clear(){return this.h_.Ot(),this.Is.xs(),this.R.emit("dataClear",this),this}setWireframeStyle(t){return this.SS="function"==typeof t?t(this.SS):t,this.h_.xS(this.SS),this.Is.xs(),this.R.emit("styleChange",this),this}getWireframeStyle(){return this.SS}setIntensityInterpolation(t){return t=t||"disabled",this.h_.kS(t),this.Is.xs(),this.R.emit("styleChange",this),this}getIntensityInterpolation(){return this.h_.TS()}rv(){return this.av&&this.getVisible()}Xd(){return de(this.we)}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}n_(t){this.h_.n_().forEach((e=>{t.h_.FS(e)}))}XM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}o_(t){return this.R.on("styleChange",t)}a_(t){return this.R.off(t)}getXMax(){const t=this.h_;return t?t.St():void 0}getXMin(){const t=this.h_;return t?t.vt():void 0}getYMax(){const t=this.h_;return t?t.bt():void 0}getYMin(){const t=this.h_;return t?t.xt():void 0}Ir(){const t=u(0,0);return t.x=Math.max(t.x,this.h_.Cl()),t.y=Math.max(t.y,this.h_.kl()),t}pM(t){if(!(t instanceof Bi))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Bi&&t._i())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}Le(t,e){t.us(e),this.Is.xs()}De(){return super.De(),this.h_.Ko(this.getBoundaries()),this}}class bu extends vu{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.bv=!1}invalidateIntensityValues(t){if(this.bv&&this.chart.ls.Xn(dh.Cf),Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Qn.dataOrder?t.length:t[0].length,rows:"rows"===this.Qn.dataOrder?t.length:t[0].length},i="columns"===this.Qn.dataOrder?this.Qn.columns:this.Qn.rows,s="columns"===this.Qn.dataOrder?this.Qn.rows:this.Qn.columns;if(e.x>i||e.y>s){if(!0===this.chart.mA.Kn){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Qn.columns}x${this.Qn.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.mA.Kn){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Qn.columns}x${this.Qn.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.`;wt.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.h_.FS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.R.emit("invalidateIntensity",this,t),this.Is.xs(),this.bv=!0,this}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.h_.Ie(this.we),this.R.emit("styleChange",this),this.Is.xs(),this}getFillStyle(){return this.we}l_(t){return this.R.on("invalidateIntensity",t)}u_(t){return this.R.off(t)}}class Mu extends nu{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._s="Scrolling Heatmap Grid Series",this.vS={},this.chart.ls.Xn(dh.Mf),this.chart.ls.Xn(dh.Cf);const d=c;this.we=ye(l.heatmapScrollingGridSeriesFillStyle,d),this.SS=ye(this.Ki.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",...a};this.Qn=f,this.c_=this.Is.d_(this.scale,[],f).Ie(this.we).xS(this.SS).us(this.getHighlight()),this.ds(this.c_),this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=ct(s,this.Is.ls.At,this.scale),n=ha(e)?this.c_.Hb(r):this.c_.Jc(r);if(n)return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},x:n.x,y:n.y,column:n.column,row:n.row,intensity:n.cellValue,series:this,axisX:this.axisX,axisY:this.axisY,lut:H(this.we)?this.we.lut:void 0}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,intensity:0,multiHit:0,column:0,row:0,lut:H(this.we)?this.we.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}MS(){const t=this.vS.start||{x:0,y:0};let e;e=this.vS.step?this.vS.step:{x:1,y:1},this.c_._S(t,e),this.chart.ls.xs()}setStart(t){return this.vS.start=t,this.MS(),this}getStart(){return this.c_.wS().start}setStep(t){return this.vS.step=t,this.MS(),this}getStep(){return this.c_.wS().step}clear(){return this.c_.Ot(),this.Is.xs(),this}setWireframeStyle(t){return this.SS="function"==typeof t?t(this.SS):t,this.c_.xS(this.SS),this.Is.xs(),this}getWireframeStyle(){return this.SS}setPixelInterpolationMode(t){return t=t||"disabled",this.c_.kS(t),this.Is.xs(),this}getPixelInterpolationMode(){return this.c_.TS()}setDataCleaning(t){return this.c_._u(t),this.Is.xs(),this}rv(){return this.av&&this.getVisible()}Xd(){return de(this.we)}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}Ie(t){return this.we="function"==typeof t?t(this.we):t,this.c_.Ie(this.we),this.Is.xs(),this}pM(t){if(!(t instanceof Bi))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Bi&&t._i())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.c_.St()||0}getXMin(){return this.c_.vt()||0}getYMax(){return this.c_.bt()||0}getYMin(){return this.c_.xt()||0}Ir(){const t=u(0,0);return t.x=Math.max(t.x,this.c_.Cl()),t.y=Math.max(t.y,this.c_.kl()),t}Le(t,e){t.us(e),this.Is.xs()}}class wu extends Mu{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)}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.Qn.scrollDimension?t.length:t[0].length,"rows"===this.Qn.scrollDimension?t.length:t[0].length,0+i-1),r=this.Qn.resolution-1;if(s>r){if(!0===this.chart.mA.Kn){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.Qn.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const s=[];for(let i=0;i{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.slice()},this.p_=[],this.y_=[],this.m_=!1,this.v_=(t,e)=>{const i=t.Qb(e);if(i)return[ct(i[0],this.scale,this.Is.ls.At),ct(i[1],this.scale,this.Is.ls.At)]},this.S_=(t,e)=>{const i=t.x_(e);if(i)return[ct(i[0],this.scale,this.Is.ls.At),ct(i[1],this.scale,this.Is.ls.At)]},this.Xd=()=>de(this.b_)||de(this.M_),this.__=t=>{const e=t.length;if(this.LM.length>0){const i=this.LM.length-1,s=this.LM[i];if(e>0){const[e,i]=s.nl(),[r,n]=s.rl();if((r?e.length+r.length:e.length)>=this.GM){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=mi(a,o,u(t[0].position,t[0].high)).y,c=mi(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.dl(f,y(u(a,c),u(a,l))).Ul(!0),this.w_([f].concat(t)).Gl(!0)}else s.dl(t)}}else e>0&&this.w_(t)},this.C_=t=>{const e=this.p_,i=t.length;if(this.p_.length>0){if(i>0){const i=e[e.length-1],s=i.nl(),r=i.rl();if(s.length+r.length>=this.GM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=mi(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.dl(a,y(u(o,h),u(o,h))).Ul(!0),e.push(this.k_([a].concat(t),this.OM).Gl(!0))}else i.dl(t)}}else i>0&&e.push(this.k_(t))},this.T_=t=>{const e=this.y_,i=t.length;if(this.y_.length>0){if(i>0){const i=e[e.length-1],s=i.nl(),r=i.rl();if(s.length+r.length>=this.GM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=mi(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.dl(a,y(u(o,h),u(o,h))).Ul(!0),e.push(this.F_([a].concat(t)).Gl(!0))}else i.dl(t)}}else i>0&&e.push(this.F_(t))}}cs(){return"ProgressiveX"}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.RM=void 0!==e&&e>0?e:0,this.Is.xs(),this}clear(){for(let t=0;tt+e.fl()+e.Al()),this.bu.length)}getXMax(){return Yt(this.LM,Vt,Math.max,Nt,this.OM)||0}getXMin(){return Yt(this.LM,Lt,Math.min,zt,this.OM)||0}getYMax(){return Yt(this.LM,Bt,Math.max,Ut,this.OM)||0}getYMin(){return Yt(this.LM,_t,Math.min,Ot,this.OM)||0}Ir(){const t=u(0,0);for(const e of this.LM)t.x=Math.max(t.x,e.Cl()),t.y=Math.max(t.y,e.kl());return t}rv(){return this.av&&this.getPointAmount()>0&&this.getVisible()}pM(t){}zM(t,e,i){this.bu=he(this.bu,t,{canReturnB:!1}),this.A_=he(this.A_,e,{canReturnB:!1}),this.g_=he(this.g_,i,{canReturnB:!1}),this.Is.xs()}I_(t,e,i,s){this.P_(e,i,s),this.zM(Array.isArray(t)?t:[t],e,i)}P_(t,e,i){const s=ei(Je(t),Je(e));this.OM?this.OM=ei(this.OM,s):this.OM=s,i&&(this.OM=ei(this.OM,i))}D_(){const t=this.LM.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.LM[this.LM.length-1]:void 0,i=e?e.nl()[0].length+(e.rl()[0]?e.rl()[0].length:0):void 0;ou(t,i,this.GM,this.__)}L_(t){const e=this.p_.length>0?this.p_[this.p_.length-1].nl().length+this.p_[this.p_.length-1].rl().length:void 0;ou(t,e,this.GM,this.C_)}R_(t,e){const i=this.p_.length>0?this.p_[this.p_.length-1].nl().length+this.p_[this.p_.length-1].rl().length:void 0;ou(t,i,this.GM,this.C_),ou(e,i,this.GM,this.T_)}w_(t,e){const i=this.Is.E_(this.scale).dl(t,e).Ie(this.b_).Ol(this.M_).zl(this.Il).us(this.getHighlight());return this.LM.push(i),this.ds(i),i}z_(t,e,i){const s=this.Is.rm(this.scale,void 0,[Oa.UserSeries]).dl(t,i).setMouseInteractions(!1).Oe(e).us(this.getHighlight());return this.ds(s),s}k_(t,e){return this.z_(t,this.V_,e)}F_(t,e){return this.z_(t,this.O_,e)}N_(t){this.b_="function"==typeof t?t(this.b_):t;const e=this.b_;for(let t=0;t0){const t=this.D_();this.NM(this.LM,this.GM,this.RM,t),this.p_.length>0&&this.NM(this.p_,this.GM,this.RM,t),this.y_.length>0&&this.NM(this.y_,this.GM,this.RM,t),this.m_=!0}}De(){if(super.De(),this.bu.length>0&&(this.B_(this.bu),this.Z_(this.A_,this.g_),this.m_=!0),this.m_){const t=this.getBoundaries();for(const e of this.LM)e.Ko(t);for(const e of this.p_)e.Ko(t);for(const e of this.y_)e.Ko(t)}}bm(){this.OM=void 0,this.bu.length=0,this.A_.length=0,this.g_.length=0}}class Ru extends Tu{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.chart.ls.Xn(dh.bf),this.Q_=a}add(t){0!==this.LM.length&&this.chart.ls.Xn(dh.Cf);const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.J_(e),[i,s]=this.K_(t);this.I_(t,i,s,y(u(Be,this.Q_),u(ze,this.Q_)));const r=this.bu[this.bu.length-1];this.VM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.R.emit("dataAdd",this,e,this.OM)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.VM?this.VM.position+e:0),this.add(lu(t,e,s)),this}YM(t){return this.R.on("dataAdd",t)}HM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}XM(t){return this.R.off(t)}}class Eu extends Ru{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.b_=ye(this.Ki.areaSeriesBipolarHighFillStyle,c),this.V_=ye(this.Ki.areaSeriesBipolarHighStrokeStyle,c),this.M_=ye(this.Ki.areaSeriesBipolarLowFillStyle,c),this.O_=ye(this.Ki.areaSeriesBipolarLowStrokeStyle,c)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=Cu(s,this.LM,ha(e)?this.S_:this.v_);if(void 0!==r&&void 0!==r[0]){const t=ct(r[0][0],this.Is.ls.At,this.scale),e=ct(r[0][1],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY,multiHit:[t,e]}}}J_(t){return this.q_(t)}Z_(t,e){return this.R_(t,e)}q_(t){let e=0;const i=[],s=t.length,r=this.Q_;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.iw(t[0],i,e):this.sw(t,i)),i}iw(t,e,i=0){return e[i]=d(t.x,t.y,this.Q_),i+1}sw(t,e){let i=0,s=0;const r=t.length-1,n=this.Q_;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:zn(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}K_(t){const e=t.length,i=Array(e),s=Array(e),r=this.Q_;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.N_(t),this}setNegativeFillStyle(t){return this.G_(t),this}setPositiveStrokeStyle(t){return this.U_(t),this}setNegativeStrokeStyle(t){return this.Y_(t),this}getPositiveFillStyle(){return this.W_()}getNegativeFillStyle(){return this.Nl()}getPositiveStrokeStyle(){return this.H_()}getNegativeStrokeStyle(){return this.X_()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.b_,fill2:this.M_,behavior:{colorStep:!0}})}}class ku extends Ru{constructor(){super(...arguments),this.O_=nt}Z_(t){return this.L_(t)}K_(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}sw(t,e,i=0){let s=0;const r=t.length-1,n=this.Q_;for(;sn){const t=vi(u(ze,n),u(Be,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&&Gt(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=vi(u(ze,n),u(Be,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}UM(){return hu(this.LM,(t=>t[1]))}setFillStyle(t){return this.G_(t),this}getFillStyle(){return this.Nl()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.M_,stroke:this.V_})}}class Fu extends ku{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.b_=ye(this.Ki.areaSeriesPositiveFillStyle,d),this.M_=B,this.V_=ye(this.Ki.areaSeriesPositiveStrokeStyle,d)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=Cu(s,this.LM,ha(e)?this.S_:this.v_);if(void 0!==r&&void 0!==r[0]){const t=ct(r[0][0],this.Is.ls.At,this.scale),e=ct(r[0][1],this.Is.ls.At,this.scale),i=t.y=n){const t=d(r.x,r.y,n);if(0!==i&&Gt(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=vi(u(ze,n),u(Be,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}UM(){return hu(this.LM,(t=>t[0]||[]))}setFillStyle(t){return this.N_(t),this}getFillStyle(){return this.W_()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.b_,stroke:this.V_})}}const Du={Positive:Fu,Negative:Iu,Bipolar:Eu};class Pu extends Tu{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.chart.ls.Xn(dh.bf);const c=u;this.b_=ye(this.Ki.areaRangeSeriesFillStyle,c),this.V_=ye(this.Ki.areaRangeSeriesStrokeStyle,c),this.M_=ye(this.Ki.areaRangeSeriesFillStyleInverted,c),this.O_=ye(this.Ki.areaRangeSeriesStrokeStyleInverted,c)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=Cu(s,this.LM,ha(e)?this.S_:this.v_);if(void 0!==r&&void 0!==r[0]){const t=ct(r[0][0],this.Is.ls.At,this.scale),e=ct(r[0][1],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY,multiHit:[t,e]}}}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.I_(t,i,s);const r=this.bu[this.bu.length-1];return this.VM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.R.emit("dataAdd",this,e,this.OM),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.VM?this.VM.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)},Bu=(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=oi(ci(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]=ui(li(r,l),f[1]),f[2]=ci(f[2],li(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{const i=t.Jc(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.aw=(t,e)=>{const i=t.x_(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.lw=t=>{if(this.LM.length>0){const e=this.LM[this.LM.length-1];if(t.length>0){const i=e.nl(),s=e.rl(),r=i.length+s.length-+e.Wl();if(r>=this.GM){const n=s.length>0?s[s.length-1]:i[e.Wl()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.dl(o,y(u(o.x,o.y),u(o.x,o.y))).Ul(!0),this.uw([o].concat(t)).Gl(!0)}else e.dl(t,this.OM)}}else t.length>0&&this.uw(t)},this.cw=t=>{if(this.nw.length>0){const e=this.nw[this.nw.length-1];t.length>0&&((e.nl().length+e.rl().length)*this.rw>=this.GM?this.dw(t):e.dl(t))}else t.length>0&&this.dw(t)},this.Qn=m,this.qb=l,this.fw=f,this.Aw=ye(c.pointLineSeriesFillStyle,g),this.gu=ye(this.Ki.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}UM(){return hu(this.nw)}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;for(let t=0;te.setVisible(t))),this}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.LM.length)return;const r=this.LM[0].Zo()||zr.NearestX,n=ha(e)?cu(s,this.LM,this.aw,r===zr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===zr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):cu(s,this.nw,this.ow,r===zr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===zr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==n){const t=ct(n[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY}}}Xd(){return de(this.Aw)||de(this.gu.getFillStyle())}Fs(){return this.Ms||this.qb}pM(t){}Le(t,e){t.us(e),this.Is.xs()}WM(t){const e=this.LM.length>0?this.LM[this.LM.length-1].nl().length+this.LM[this.LM.length-1].rl().length-+this.LM[this.LM.length-1].Wl():void 0;ou(t,e,this.GM,this.lw),ou(t,e,this.GM,this.cw)}dw(t,e){const i=this.Is.Pv(this.scale).dl(t,e).setMouseInteractions(this.Yi).Ie(this.Aw).ol(this.qb).it(this.Kb).Zh(this.ba).ll(this.Za).ul(this.Qa).cl(this.Ja).us(this.getHighlight());return this.ds(i),this.nw.push(i),i}uw(t,e){const i=this.Is.rm(this.scale,void 0,[Oa.UserSeries,...this.fw]).dl(t,e).setMouseInteractions(this.Yi).Oe(this.gu).us(this.getHighlight());return this.ds(i),this.LM.push(i),i}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.gu,fill:this.Aw})}getPointAmount(){return this.nw.reduce(((t,e)=>t+e.fl()+e.Al()),this.bu.length)}clear(){super.clear();for(let t=0;t{}))}}const Nu=(t,e)=>t.rl().length>=e?t.rl().slice(-e):Array.prototype.concat(t.nl(),t.rl()).slice(-e),Ou=(t,e,i)=>{const s=Array.prototype.concat(t.nl(),t.rl()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Ot().dl(s).Ls()};class Uu extends zu{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.rw=32,this.GM=8e3,this.gw=t=>{if(0===t.length)return;const e=this.nw.length;if(e>0){const i=e>1,s=this.nw[e-1];if(i){const i=Array.prototype.concat(s.nl(),s.rl()),r=i.length;if(32*r>=this.GM){const i=Nu(s,3),r=Array.prototype.concat(i,t),n=Bu(r,32);Ou(this.LM[e-1],n,32),this.uw(n.slice(66))}else if(r<5){const s=this.nw[e-2],r=Nu(s,3),n=Array.prototype.concat(r,i,t),o=Bu(n,32),h=this.LM[e-1],a=o.slice(66);h.Ot().dl(a).Ls()}else{const i=this.LM[e-1],r=Array.prototype.concat(i.nl(),i.rl()),n=Nu(s,4),o=Array.prototype.concat(n,t),h=Bu(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Ot().dl(a).Ls()}}else{const i=Array.prototype.concat(s.nl(),s.rl()),r=i.length,n=this.LM[e-1];if(32*r>=this.GM){const e=Nu(s,3),i=Array.prototype.concat(e,t),r=Bu(i,32);Ou(this.LM[0],r,32),this.uw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=Bu(e,32);n.Ot().dl(s).Ls()}else n.dl(t)}}else{const e=t.length>0?Bu(t,32):t,i=Je(e);this.uw(e,i)}this.cw(t)}}WM(t){const e=this.nw.length,i=this.nw.length>0?this.nw[e-1].nl().length+this.nw[e-1].rl().length:void 0;ou(t,i,Math.ceil(this.GM/this.rw),this.gw)}}class Yu{constructor(){this.Gi="FreeformPattern",this.Il={type:"disabled",packager:(t,e,i)=>t.slice()}}NM(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}},Xu=s.Record({Il:{type:"disabled",packager:(t,e,i)=>t.slice()}});class Zu extends Xu{NM(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.D_(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.xt();return t?Math.min(i,t):i},Wu=(t,e)=>{const i=e.bt();return t?Math.max(i,t):i};class ju extends Zu{pw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(Wu,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(Hu,e?e.min.y:void 0)}}const Ku=(t,e)=>{const i=e.vt();return t?Math.min(i,t):i},$u=(t,e)=>{const i=e.St();return t?Math.max(i,t):i};class Qu extends Zu{pw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce($u,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(Ku,e?e.min.x:void 0)}}const qu={horizontalProgressive:new class extends ju{constructor(){super({Il:Dr()}),this.Gi="HorizontalProgressivePattern"}D_(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].St():void 0}getXMin(t=[],e){return t.length>0&&t[0].fl()>0?t[0].vt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",Dr(Gu(t)))}},horizontalRegressive:new class extends ju{constructor(){super({Il:Pr()}),this.Gi="HorizontalRegressivePattern"}D_(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;n0&&t[0].fl()>0?t[0].St():e?e.max.x:void 0}getXMin(t=[],e){return void 0!==e?e?e.min.x:void 0:t.length>0?t[t.length-1].vt():void 0}setPrecision(t){return this.set("_columnPackaging",Pr(Gu(t)))}},verticalProgressive:new class extends Qu{constructor(){super({Il:Lr()}),this.Gi="VerticalProgressivePattern"}D_(t,e){const i=t.length,s=Math.min(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1].bt():void 0}getYMin(t=[],e){return t.length>0&&t[0].fl()>0?t[0].xt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",Lr(Gu(t)))}},verticalRegressive:new class extends Qu{constructor(){super({Il:Vr()}),this.Gi="VerticalRegressivePattern"}D_(t,e){const i=t.length,s=Math.max(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0&&t[0].fl()>0?t[0].bt():e?e.max.y:void 0}getYMin(t=[],e){return void 0!==e?e?e.min.y:void 0:t.length>0?t[t.length-1].xt():void 0}setPrecision(t){return this.set("_columnPackaging",Vr(Gu(t)))}},freeform:new Yu};class Ju extends zu{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g,m){super(t,e,i,s,r,n,o,h,qu.horizontalProgressive,a,c,d,f,g,m),this.lw=t=>{const e=this.LM.length>0?this.LM[this.LM.length-1].nl().length+this.LM[this.LM.length-1].rl().length:void 0;ou(t,e,this.GM,this.yw)},this.yw=t=>{const e=t.length;if(this.LM.length>0){const i=this.LM[this.LM.length-1];if(e>0){const e=i.nl(),s=i.rl(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Vu([r].concat(t),this.mw);n.shift();const o=u((r.x+n[0].x)/2,(r.y+n[0].y)/2),h=Array.prototype.concat(o,n);(s.length>0?e.length+s.length:e.length)>=this.GM?(i.dl(o,y(u(o.x,o.y),u(o.x,o.y))).Ul(!0),this.uw(h).Gl(!0),this.dw(t)):i.dl(h)}}else e>0&&this.uw(Vu(t,this.mw));this.cw(t)},this.mw=l,void 0===this.fw.find((t=>"DataPattern"===t.type))&&this.fw.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class tc extends nu{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Sw=t=>t[4]>=t[1],this.CM=y(c(Be,Be),c(ze,ze)),this.xw=[],this.bw=!1,this.Mw=-1,this._w=[],this.ww=!0,this.Cw=!1,this.kw=4,this.Tw=[1e-7,1e-6,1e-5,1e-4,.001,.01,.1,1,5,10,30,60,300,600,1800,3600,7200,14400,28800,36e3,43200,50400,57600,64800,72e3,86400,172800,259200,345600,432e3,604800,1209600,2592e3,7776e3,10368e3,15552e3,31536e3,15768e4,31536e4,63072e4,7884e5,15768e5,31536e5,3942e6,47304e5,63072e5,7884e6,15768e6,31536e6,3942e7,47304e6,63072e6,7884e7,15768e7,31536e7,63072e7,7884e8,15768e8,31536e8,47304e8,63072e8],this.chart.ls.Xn(dh.df)}UM(){return this._w}YM(t){return this.R.on("dataAdd",t)}HM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}XM(t){return this.R.off(t)}rv(){return this.av&&this._w.length>0&&this.getVisible()}Fw(t){if(!(this._w.length<1))return[this._w[t][0],this._w[t][1],this._w[t][2],this._w[t][3],this._w[t][4]]}solveNearest(t,e){if(0===this._w.length)return;const i=this.chart.translateCoordinate(t,{x:this.axisX,y:this.axisY}).x,s=void 0!==this.getPackDataState();let r,n,o,h,a;if(s){const t=this.Iw;if(!t)return;const e=Ee(i,t.length-1,(e=>t[e][0])),s=void 0!==e&&t[e];if(!s)return;h=s[3],o=s[2],n=s[1],a=s[4],r=s[0]}else{const t=Ee(i,this._w.length-1,(t=>this._w[t][0])),e=void 0!==t&&this._w[t];if(!e)return;r=e[0],n=e[1],o=e[2],h=e[3],a=e[4]}return{cursorPosition:{resultTable:u(r,a),resultTableScale:this.scale,pointMarker:u(r,a),pointMarkerScale:{x:this.axisX,y:this.axisY}},x:r,y:a,open:n,high:o,low:h,close:a,position:r,isPacked:s,series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,open:0,high:0,low:0,close:0,position:0,isPacked:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}pM(t){if(!(t.x instanceof Li))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.Pw=t.x}Ir(){return u(5,5)}m_(t){const e=t.length-1;if(e<0)return this;for(let i=0;i<=e;i+=1)t[i][3]0&&this.chart.ls.Xn(dh.Cf);const e=Array.isArray(t[0])?t:[t[0]];if(e.length>0){this.bw=!0;const t=this._w.length,i=this.xw.length,s=e.length;this._w.length=t+s,this.xw.length=i+s;for(let r=0;rthis.Tw[t]));return void 0===i?i=e=1){for(let e=0;e=1&&(t!==this.Mw||this.bw||this.Cw)){this.Cw=!1,this.Mw=t,this.bw=!1,this.Bw(),this.Iw=[];const e=this._w.length;let i=this._w[0][0]-this._w[0][0]%(t/2)+t,s=0;for(;s({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...Ja(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Ir().x))}),nc=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...Ja(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Ir().y))});class oc extends pa{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,h),this.iC=!1,this.sC=!1,this.eC=!1,this.hC=!1,this.rC=new Map,this.nC=new Map,this.oC=[],this.aC=[],this.lC=!0,this.uC=!0,this.cC=new Set,this.dC=!1,this.ny=r,this.fC=n,this.AC=o,this.gC=h.cursorGridStrokeStyleX,this.pC=h.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.rC.forEach((t=>t.forEach((t=>t.dispose())))),this.nC.forEach((t=>t.forEach((t=>t.dispose())))),this.oC.length=0,this.aC.length=0,this.ey.length=0,this}De(){return this.oC.forEach((t=>t.setVisible(this.Xi&&this.hp).setMarkerVisible(this.Xi&&this.hp&&this.lC))),this.aC.forEach((t=>t.setVisible(this.Xi&&this.hp).setMarkerVisible(this.Xi&&this.hp&&this.uC))),super.De()}setPosition(...t){if(this.oC.forEach((t=>t.setVisible(!1))),this.aC.forEach((t=>t.setVisible(!1))),this.oC.length=0,this.aC.length=0,0===t.length)return this;const e=this.renderingScale,i=t[0].resultTable,s=Jh(t[0].resultTableScale,e),r=s===this.scale?i:ct(i,s,this.scale);this.Gp.setPosition(r),this.hp=!1,this.ty.forEach((t=>{t.targetVisible=!1}));const n=new Map;return t.forEach(((t,i)=>{const s=t.pointMarkerScale.x,r=t.pointMarkerScale.y,o=n.get(s)||[],h=n.get(r)||[],a=!o.includes(t.pointMarker.x),l=!h.includes(t.pointMarker.y);o.push(t.pointMarker.x),h.push(t.pointMarker.y),n.set(s,o),n.set(r,h);const c=t.pointMarker,d=lc(u(c.x,c.y),s,r);if(a){const t=this._h(s,!0);t.setValue(c.x),t.setGridStrokeLength(this.iC?d.x:1).setAllocatesAxisSpace(this.dC),this.oC.push(t)}if(l){const t=this._h(r,!1);t.setValue(c.y),t.setGridStrokeLength(this.sC?d.y:1).setAllocatesAxisSpace(this.dC),this.aC.push(t)}let f=this.ty[i];if(!f){const t=new Mo(this.Is,this.renderingScale,this.scale,kt,this.Ki).setMouseInteractions(!1).setFillStyle(this.Ki.cursorPointMarkerFillStyle).setSize(this.Ki.cursorPointMarkerSize).setShape(this.Ki.cursorPointMarkerShape);f={pointMarker:t,targetVisible:!0},this.ty.push(f),this.ey.forEach((e=>e(t)))}const g=Jh(t.pointMarkerScale,e),y=g===this.scale?t.pointMarker:ct(t.pointMarker,g,this.scale);f.pointMarker.setPosition(y),f.targetVisible=!0;const m=s.getInterval(),p=r.getInterval(),x=Math.min(m.start,m.end),A=Math.max(m.start,m.end),S=Math.min(p.start,p.end),v=Math.max(p.start,p.end);c.x>=x&&c.x<=A&&c.y>=S&&c.y<=v&&(this.hp=!0)})),this}setTickMarkersAllocateAxisSpace(t){return this.dC=t,this.Is.xs(),this}getTickMarkersAllocateAxisSpace(){return this.dC}_h(t,e){this.cC.has(t)||(t.onDispose((()=>{var e;null===(e=i.get(t))||void 0===e||e.forEach((t=>t.dispose())),i.delete(t)})),this.cC.add(t));const i=e?this.rC:this.nC,s=e?this.oC:this.aC,r=i.get(t)||[];i.set(t,r);let n=r.find((t=>!s.includes(t)));return n||(n=e?t.Kg(!1,this.fC):t.Kg(!1,this.AC),r.push(n),this.pr(n,e),n.setMouseInteractions(!1)),n}pr(t,e){const i=e?this.gC:this.pC;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.lC:this.uC)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.iC=t,this.Is.xs(),this}getGridStrokeXCut(){return this.iC}setGridStrokeYCut(t){return this.sC=t,this.Is.xs(),this}getGridStrokeYCut(){return this.sC}setGridStrokeXStyle(t){return this.gC=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.rC.forEach((t=>t.forEach((t=>t.setGridStrokeStyle(this.gC))))),this}getGridStrokeXStyle(){return this.gC}setGridStrokeYStyle(t){return this.pC=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.nC.forEach((t=>t.forEach((t=>t.setGridStrokeStyle(this.pC))))),this}getGridStrokeYStyle(){return this.pC}setTickMarkerXVisible(t){return this.lC=t,this.Is.xs(),this}getTickMarkerXVisible(){return this.lC}setTickMarkerYVisible(t){return this.uC=t,this.Is.xs(),this}getTickMarkerYVisible(){return this.uC}setTickMarkerX(t){return this.rC.forEach((e=>e.forEach((e=>e.setMarker(t))))),this.fC=this.fC.addStyler(t),this.Is.xs(),this}setTickMarkerY(t){return this.nC.forEach((e=>e.forEach((e=>e.setMarker(t))))),this.AC=this.AC.addStyler(t),this.Is.xs(),this}}class hc{constructor(t,e,i,s){this.uy=[],this.Ay=(t,e)=>(this.uy.forEach((i=>i(t,e))),t),this.addStyler=t=>new hc(this.ny,this.fC,this.AC,this.uy.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new hc(t,this.fC,this.AC,this.uy.map((t=>t))),this.gy=(t,e,i,s,r)=>this.Ay(new oc(t,e,i,s,this.ny,this.fC,this.AC,r),r),this.ny=t,this.uy=s,this.fC=e,this.AC=i}}const ac=new hc(Ao,oh.PointableTextBox,oh.PointableTextBox,[(t,e)=>{xa(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),Mn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Mn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),lc=(t,e,i)=>{const s=e.At,r=i.At;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.ug&&(n=1-n),1===e.ug&&(o=1-o),u(o,n)};class uc extends uu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f){super(t,e,i,s,r,n,o,h,a,l,u),this.LM=[],this.Wb=!0,this.GM=void 0,this.Mu=void 0,this.yC=(t,e)=>{const i=t.Qb(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.aw=(t,e)=>{const i=t.x_(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.Xd=()=>de(this.gu.getFillStyle()),this.fw=c,this.Qn=f,this.gu=ye(this.Ki.lineSeriesStrokeStyle,d),this.mC={individualLookupValuesEnabled:void 0!==(null==f?void 0:f.individualLookupValuesEnabled)&&f.individualLookupValuesEnabled}}cs(){var t,e;return null===(e=null===(t=this.Qn)||void 0===t?void 0:t.dataPattern)||void 0===e?void 0:e.pattern}add(t){return super.add(t),this}setMouseInteractions(t){return super.setMouseInteractions(t)}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;for(let t=0;tt._u(this.Mu))),this.Is.xs(),this}setCursorInterpolationEnabled(t){return this.Wb=t,this.Is.ls.xs(),this}getCursorInterpolationEnabled(){return this.Wb}pM(t){}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.LM.length)return;const r=this.LM[0].Zo()||zr.NearestX,n=cu(s,this.LM,ha(e)?this.aw:this.yC,r===zr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===zr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==n){const t=ct(n[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY}}}WM(t){let e=this.LM[0];e||(e=this.uw(),this.LM.push(e),this.ds(e)),e.dl(t,this.OM)}uw(){return this.Is.rm(this.scale,this.mC,[Oa.UserSeries,...this.fw]).Oe(this.gu)._u(this.Mu).us(this.getHighlight())}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.gu})}Le(t,e){t.us(e),this.Is.xs()}NM(t,e,i,s){}}class cc extends uu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,new Yu,l,u),this.LM=[],this.Kb=5,this.ba=0,this.Za=!1,this.Qa=!1,this.Ja=!1,this.GM=void 0,this.ow=(t,e)=>{const i=t.Jc(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.Qn=d,this.qb=a,this.we=ye(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=cu(s,this.LM,this.ow,Ke);if(void 0!==r){const t=ct(r[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY}}}Xd(){return de(this.we)}Fs(){return this.Ms||this.qb}pM(t){}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}Le(t,e){t.us(e),this.Is.xs()}setPointFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;for(let t=0;t{const t=i.engine.container.getBoundingClientRect();this.xC.style.left=`${t.left}px`,this.xC.style.top=`${t.top}px`,this.xC.style.width=`${t.width}px`,this.xC.style.height=`${t.height}px`};n(),i.onResize(n),this.bC(this.xC),this.MC(),this._C(),this.wC(),this.CC(e),this.chart.kC().push(this)}bC(t){this.TC=wt.document.createElement("div"),this.TC.style.pointerEvents="all",t.append(this.TC),this.FC=wt.document.createElement("div"),this.IC=new Ts(this.Zs,this.se,this.chart,this.FC),this.PC=wt.document.createElement("table"),this.PC.style.borderSpacing="0",this.TC.appendChild(this.IC.ce()),this.TC.appendChild(this.FC),this.FC.appendChild(this.PC)}_C(){let t=0,e=0,i=0,s=0,r=!1;this.vC=!1,this.TC.onmousedown=n=>{n=n||wt.event,i=n.clientX,s=n.clientY,r=!0,wt.document.onmouseup=t=>{this.vC?this.TC.addEventListener("click",Qt,!0):this.TC.removeEventListener("click",Qt,!0),r=!1,this.vC=!1,wt.document.onmouseup=null,wt.document.onmousemove=null},wt.document.onmousemove=n=>{n=n||wt.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.vC=!0,this.TC.style.top=this.TC.offsetTop-e+"px",this.TC.style.left=this.TC.offsetLeft-t+"px",this.TC.style.removeProperty("right"),this.TC.style.removeProperty("bottom"))}}}wC(){let t=0,e=0,i=0,s=0,r=!1;this.TC.ontouchstart=n=>{n=n||wt.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.TC.ontouchend=()=>{r=!1,wt.document.ontouchend=null,wt.document.ontouchmove=null},this.TC.ontouchmove=n=>{r&&(Qt(n),n=n||wt.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.TC.style.top=this.TC.offsetTop-e+"px",this.TC.style.left=this.TC.offsetLeft-t+"px",this.TC.style.removeProperty("right"),this.TC.style.removeProperty("bottom"))}}}MC(){this.TC.style.setProperty("top","10px"),this.TC.style.setProperty("left","10px"),this.TC.style.position="absolute",this.TC.style.display="flex",this.TC.style.alignItems="flex-start",this.FC.style.setProperty("display","none")}removePositionProperty(){this.TC.style.removeProperty("top"),this.TC.style.removeProperty("left"),this.TC.style.removeProperty("bottom"),this.TC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.TC.style.setProperty("bottom","10px"),this.TC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.TC.style.setProperty("top","10px"),this.TC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.TC.style.setProperty("bottom","10px"),this.TC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.TC.style.setProperty("top","10px"),this.TC.style.setProperty("right","10px")}}CC(t){for(let e=0;e[t.Kc((()=>{this.LC+=1,this.LC>1&&this.chart.ls.Xn(dh.Cf),this.chart.ls.xs()})),t.qc((()=>this.chart.ls.xs()))])),this.ja.gd(t),this.chart.ls.xs()),this}getDataSet(){return this.zC()}setStrokeStyle(t){return this.ja.Oe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.pu()}setAreaFillStyle(t){return this.ja.yd(t),this.Is.xs(),this}getAreaFillStyle(){return this.ja.VC()}setPointFillStyle(t){return this.ja.pd(t),this.Is.xs(),this}getPointFillStyle(){return this.ja.Md()}setPointSize(t){return this.ja._d(t),this.Is.xs(),this}getPointSize(){return this.ja.OC()}setPointShape(t){return this.ja.vd(t),this.Is.xs(),this}getPointShape(){return this.ja.Sd()}setPointRotation(t){return this.ja.xd(t),this.Is.xs(),this}getPointRotation(){return this.ja.bd()}setPointAlignment(t){return this.ja.NC(t),this.chart.ls.xs(),this}getPointAlignment(){return this.ja.GC()}setCurvePreprocessing(t){return this.ja.RC(t),this.Is.xs(),this}getCurvePreprocessing(){return this.ja.WC()}add(t){return this.zC().add(t),this.Is.xs(),this}addArraysXY(t,e){return this.zC().addArraysXY(t,e),this.Is.xs(),this}appendJSON(t,e){return this.zC().appendJSON(t,e),this.Is.xs(),this}appendSample(t){return this.zC().appendSample(t),this.Is.xs(),this}appendSamples(t){return this.zC().appendSamples(t),this.Is.xs(),this}fill(t){return this.zC().fill(t),this.Is.xs(),this}setSamples(t){return this.zC().setSamples(t),this.Is.xs(),this}alterSamples(t,e){return this.zC().alterSamples(t,e),this.Is.xs(),this}alterSamplesByID(t,e){return this.zC().alterSamplesByID(t,e),this.Is.xs(),this}getSampleCount(){return this.zC().getSampleCount()}getNextSampleIndex(){return this.zC().getNextSampleIndex()}clear(){return this.zC().clear(),this.Is.xs(),this}setMaxSampleCount(t){return this.zC().setMaxSampleCount(t),this.Is.xs(),this}getMaxSampleCount(){return this.zC().getMaxSampleCount()}readBack(t){return this.zC().readBack(t)}onMaxSampleCountExceeded(t){return this.zC().onMaxSampleCountExceeded(t)}offMaxSampleCountExceeded(t){return this.zC().offMaxSampleCountExceeded(t)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){let i=ha(e);void 0!==this.getCurvePreprocessing()&&(i=!1);const s=this.UC(),r=this.chart.translateCoordinate(t,{x:this.axisX,y:this.axisY}),n=s.Jc(r,i,this.scale,this.chart.pg);if(void 0!==n)return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){const i=this.getDataSet(),s=null==t?void 0:t.dataPoint;return void 0===i.$c()||s?s?{cursorPosition:{resultTable:s,resultTableScale:this.scale,pointMarker:s,pointMarkerScale:{x:this.axisX,y:this.axisY}},...s,series:this,axisX:this.axisX,axisY:this.axisY}:void 0:Pe({series:this,axisX:this.axisX,axisY:this.axisY},{x:0,y:0,cursorPosition:0,id:0,rotation:0,size:0,color:0,lookupValue:0,multiHit:0,iSample:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}UC(){return this.zC()}Xd(){return de(this.getPointFillStyle())||de(this.getStrokeStyle().getFillStyle())||de(this.getAreaFillStyle())}rv(){var t;const e=null===(t=this.Ad)||void 0===t?void 0:t.Gt;return this.getAutoScrollingEnabled()&&void 0!==e&&e.gc>0}pM(t){}getXMax(){return this.ja.St()}getXMin(){return this.ja.vt()}getYMax(){return this.ja.bt()}getYMin(){return this.ja.xt()}Ir(){return{x:this.ja.Cl(),y:this.ja.kl()}}zC(){if(!this.Ad){const t=new lo(this.Qn);t.Mc&&this.chart.ls.Xn(dh.Tf),t.wc&&this.chart.ls.Xn(dh.kf),this.Ad=De(t,this.Ad,(()=>[t.Kc((()=>{this.LC+=1,this.LC>1&&this.chart.ls.Xn(dh.Cf),this.chart.ls.xs()})),t.qc((()=>{this.chart.ls.xs()}))])),this.ja.gd(t)}return this.Ad.Gt}styleLegendEntry(t,e=!1){const i=this.getPointFillStyle(),s=this.getAreaFillStyle();ce(t,this.Ki,e,{stroke:this.getStrokeStyle(),fill:i!==B?i:s,behavior:{priority:"stroke"}})}Fs(){return this.Ms||this.getPointShape()}Le(t,e){t.us(e),this.Is.xs()}}const gc=(...t)=>(e,i)=>t.forEach((t=>t.forEach((t=>{t.axis.At.it(e),t.axis.dg.it(i)})))),yc=u(10,10);var mc;e.AxisPosition=void 0,(mc=e.AxisPosition||(e.AxisPosition={}))[mc.Top=0]="Top",mc[mc.Bottom=1]="Bottom",mc[mc.Left=2]="Left",mc[mc.Right=3]="Right";const pc=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),xc=t=>t.setStopped(!0),Ac=t=>t.getChartInteractionFitByDrag()?t.fit(!0):void 0,Sc=(t,e)=>{const i="linear-highPrecision"===t.Eh.type||"linear-highPrecision"===e.Eh.type,s="logarithmic"===t.Eh.type||"logarithmic"===e.Eh.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.Eh.type}, y: ${e.Eh.type})`;throw new Error(i)}};var vc,bc,Mc;!function(t){t[t.seriesBackground=0]="seriesBackground",t[t.gridLine0=1]="gridLine0",t[t.gridLine1=2]="gridLine1",t[t.gridLine2=3]="gridLine2",t[t.highlightersBelow=4]="highlightersBelow"}(vc||(vc={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(bc||(bc={}));class wc extends cl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.wp("chartXY bg",0),r,i.ls.Ki.chartXYBackgroundFillStyle,i.ls.Ki.chartXYBackgroundStrokeStyle,i.ls.Ki.chartXYTitleFont,i.ls.Ki.chartXYTitleFillStyle,h),this.YC=this.up.d2({scaleXYConstructor:Bi}),this.$g=[],this.Xg=[],this.Zg=[],this.jg=[],this.HC=new Map,this.$C=!0,this.XC=!0,this.jC=!0,this.Gf=2,this.ZC=!0,this.QC=!0,this.JC=[],this.KC=this.kp.Pe(this.YC).Ie(B).Fe(nt).setMouseInteractions(!1),this.qC=this.kp.Ne(this.YC).Oe(nt).setMouseInteractions(!1),this.tk=this.kp.Ne(this.YC).Oe(nt).setMouseInteractions(!1),this.ik=this.Ki.chartXYZoomingRectangleFillStyle,this.sk=this.Ki.chartXYZoomingRectangleStrokeStyle,this.ek=this.Ki.chartXYFittingRectangleFillStyle,this.hk=this.Ki.chartXYFittingRectangleStrokeStyle,this.rk=e.MouseStyles.Default,this.nk=e.MouseStyles.Move,this.ak=e.MouseStyles.ZoomIn,this.lk=e.MouseStyles.Default,this.uk=void 0,this.nA=Cc,this.gM=0,this.ck=(t,e,i)=>{const s=t.solveNearest(e,i);return s&&je(s.cursorPosition.pointMarker.x,s.axisX.getInterval().start,s.axisX.getInterval().end)&&je(s.cursorPosition.pointMarker.y,s.axisY.getInterval().start,s.axisY.getInterval().end)?s:void 0},this.dk=gc(this.Xg,this.$g),this.fk=gc(this.Zg,this.jg),this.Ak=(t,e,i,s,r)=>{this.dk(s,r),this.fk(r,s),this.YC.it(s,r),this.ls.xs()},this.gk=(t,e)=>{this.HC.set(t,e)},this.ng=t=>{const e=this.Xg.findIndex((e=>e.axis===t)),i=this.$g.findIndex((e=>e.axis===t)),s=this.Zg.findIndex((e=>e.axis===t)),r=this.jg.findIndex((e=>e.axis===t));e>=0&&this.Xg.splice(e,1),i>=0&&this.$g.splice(i,1),s>=0&&this.Zg.splice(s,1),r>=0&&this.jg.splice(r,1),this.HC.delete(t),this.ls.xs()},this.addAreaSeries=t=>{const e=(null==t?void 0:t.axisX)||(null==t?void 0:t.xAxis)||this.getDefaultAxisX(),i=(null==t?void 0:t.axisY)||(null==t?void 0:t.yAxis)||this.getDefaultAxisY();Sc(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Du.Positive)(this,this.Lv,this.Kx,e,i,this.pk(e),this.pk(i),this.fp,s,this.Ki,this.ls.ss,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length);return this.Ov(r),r},this.addAreaRangeSeries=t=>{const e=(null==t?void 0:t.axisX)||(null==t?void 0:t.xAxis)||this.getDefaultAxisX(),i=(null==t?void 0:t.axisY)||(null==t?void 0:t.yAxis)||this.getDefaultAxisY();Sc(e,i);const s=new Pu(this,this.Lv,this.Kx,e,i,this.pk(e),this.pk(i),this.fp,this.Ki,this.ls.ss,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length);return this.Ov(s),s},this.yk=!1,this.mk=!1,this.yM=()=>{(this.$C||this.XC)&&(this.uk=this.engine.setMouseStyle(this.rk))},this.mM=()=>{this.yk=!1,this.engine.restoreMouseStyle(this.uk)},this.vM=(t,e,i)=>{var s,r;const n=Pt(null===(s=this.mA.Jn)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Pt(null===(r=this.mA.Jn)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.uk);const h=this.kp.ls.Re(e.clientX,e.clientY);i===n&&(this.$C||this.XC)?(this.vk(t,h),Qt(e)):i===o&&this.ZC&&(this.uk=this.engine.setMouseStyle(this.nk),this.mk=!0,Qt(e))},this.cv=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=Pt(null===(n=this.mA.Jn)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=Pt(null===(o=this.mA.Jn)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.$C||this.XC)?(this.Sk(t,s,h),Qt(e)):i===l&&this.ZC&&(this.xk(li(r,-1)),Qt(e)),this.ls.xs()},this.dv=(t,e,i,s)=>{var r,n;const o=Pt(null===(r=this.mA.Jn)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=Pt(null===(n=this.mA.Jn)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.$C||this.XC)){const i=u(e.clientX,e.clientY);this.bk(t,s,i),Qt(e)}else i===h&&this.ZC&&Qt(e);this.engine.restoreMouseStyle(this.uk),this.zv.getIsUnderMouse()&&(this.uk=this.engine.setMouseStyle(this.rk)),this.yk=!1,this.mk=!1},this.uv=(t,e)=>{if(this.jC){const t=this.kp.ls.Re(e.clientX,e.clientY);this.Mk(t,u(me(e),me(e))),Qt(e)}},this._k=(t,e,i,s)=>{},this.wk=(t,e,i,s,r,n)=>{if(this.ZC){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.xk(t),Qt(n),this.mk=!0}if(this.jC){const t=this.ls.Vo({clientX:e.x,clientY:e.y}),o=this.ls.Vo({clientX:i.x,clientY:i.y}),h=ci(u(Math.abs(t.engineX-s.x-(o.engineX-r.x)),Math.abs(t.engineY-s.y-(o.engineY-r.y))),u(Math.abs(t.engineX-o.engineX),Math.abs(t.engineY-o.engineY)));this.forEachAxisX((t=>{t.getChartInteractionZoomByWheel()&&t.yt(t.At.pi(t.getInterval().start,-h.x),t.At.pi(t.getInterval().end,h.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.yt(t.At.pi(t.getInterval().start,-h.y),t.At.pi(t.getInterval().end,h.y),!1,!0,"interactionZoom")})),Qt(n),this.yk=!0}},this.Ck=(t,e,i,s)=>{this.mk=!1,this.yk=!1},this.kk=(t,e,i)=>{(this.XC||this.$C)&&(this.vk(t,e),Qt(i))},this.Tk=(t,e,i,s,r)=>{(this.XC||this.$C)&&(this.Sk(t,e,i),Qt(r))},this.Fk=(t,e,i,s)=>{(this.XC||this.$C)&&(this.bk(t,e,i),Qt(s))},this.ls.Xn(dh.xf),this.setPadding({right:24}),this.Ik=i.Mx("chartXY series bg",vc.seriesBackground),this.Pk=[vc.gridLine0,vc.gridLine1,vc.gridLine2].map((t=>i.Dk(`chartXY gridline #${t}`,t))),this.hg=i.Dk("chartXY highlighters below",vc.highlightersBelow),this.Kx=i.Hy("chartXY plotting",bc.plotting),this.rg=i.Hy("chartXY highlighters above",bc.highlightersAbove),this.TA=i.Hy("chartXY fg",bc.fg),this.YC.x.q(0,this.uiScale.x.getCellSize()-(this.Xt.left+this.Xt.right+this.wa.left+this.wa.right)),this.YC.y.q(0,this.uiScale.y.getCellSize()-(this.Xt.bottom+this.Xt.top+this.wa.bottom+this.wa.top)),this.YC.it(this.uiScale.oi().x,this.uiScale.oi().y),this.zv=this.Ik.Pe(this.YC).Ie(this.Ki.chartXYSeriesBackgroundFillStyle).Fe(nt),this.Vv=this.TA.Pe(this.YC).Ie(B).Fe(this.Ki.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Ev(this.zv,this.Vv),this.setSeriesBackgroundEffect(!1);const a=Pt(o?o.cursorBuilder:void 0,ac),l=i.Xy();this.jy=la(this,l,a.gy(l,this.YC,this.YC,kt,this.Ki),this,"show-all",kc,((t,e)=>{const i=this.translateCoordinate(t,{x:t.axisX,y:t.axisY},this.coordsClient);return Math.sqrt((i.clientX-e.clientX)**2+(i.clientY-e.clientY)**2)})),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.Ak),this.mh.gr("ChartXY"),this.fv=ji(new $i(this.kk,this.Tk,this.Fk,1),new Qi(this._k,this.wk,this.Ck)),this.onSeriesBackgroundMouseEnter(this.yM),this.onSeriesBackgroundMouseLeave(this.mM),this.onSeriesBackgroundMouseWheel(this.uv),this.onSeriesBackgroundMouseDragStart(this.vM),this.onSeriesBackgroundMouseDrag(this.cv),this.onSeriesBackgroundMouseDragStop(this.dv),this.onSeriesBackgroundTouchStart(this.fv.onTouchStart),this.onSeriesBackgroundTouchMove(this.fv.onTouchMove),this.onSeriesBackgroundTouchEnd(this.fv.onTouchEnd),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this._p(n,this.YC)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.Dv}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}solveNearest(t,e=this.getCursorMode()||"show-nearest"){return this.jy.solveNearest(t,e,this.Dv,this.ck)}addCursor(t=ac){const e=this.fp(),i=t.gy(e,this.YC,this.YC,this.ap(e),this.Ki);return this.xp(i),i}getMinimumSize(){const t={x:0,y:0};t.x+=this.Xt.left+this.Xt.right+this.wa.left+this.wa.right,t.y+=this.Xt.top+this.Xt.bottom+this.wa.top+this.wa.bottom;const e=this.mh.Ls().td(),i=S(Tc(this.nA||Cc),this.Cp);return t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom,this.Bk&&(t.x+=this.Bk.left,t.x+=this.Bk.right,t.y+=this.Bk.top,t.y+=this.Bk.bottom),t.x+=yc.x,t.y+=yc.y,t}addAxisX(t){var e,i;const{opposite:s,type:r}=lh(t);let n;n="linear"===r.type?this.up.d1({dimension:"x",scale1DConstructor:Li}):"linear-highPrecision"===r.type?this.up.d1({dimension:"x",scale1DConstructor:Li}).Mi():this.up.d1({dimension:"x",scale1DConstructor:Ci}).Ai(r.base),n.it(this.YC.x.oi());const o=s?this.$g:this.Xg,h=new gh(this.Pk,this.TA,this.kp,this.hg,this.rg,this.ls.ss,n,this.YC.y,(a=()=>h.Dg(),{...mh,...rc(a)}),this,s?100:0,this.ng,this.gk,this.Ki,this.ah,r);var a;let l,u;return void 0===(null==t?void 0:t.iParallel)&&void 0===(null==t?void 0:t.iStack)?(l=o.reduce(((t,e)=>Math.max(t,e.iParallel+1)),0),u=0):(l=null!==(e=t.iParallel)&&void 0!==e?e:0,u=null!==(i=t.iStack)&&void 0!==i?i:0),o.push({axis:h,iStack:u,iParallel:l}),this.ls.xs(),h}addAxisY(t){var e,i;const{opposite:s,type:r}=lh(t);let n;n="linear"===r.type?this.up.d1({dimension:"y",scale1DConstructor:Li}):"linear-highPrecision"===r.type?this.up.d1({dimension:"y",scale1DConstructor:Li}).Mi():this.up.d1({dimension:"y",scale1DConstructor:Ci}).Ai(r.base),n.it(this.YC.y.oi());const o=s?this.jg:this.Zg,h=new gh(this.Pk,this.TA,this.kp,this.hg,this.rg,this.ls.ss,n,this.YC.x,(a=()=>h.Dg(),{...ph,...nc(a)}),this,s?100:0,this.ng,this.gk,this.Ki,this.ah,r);var a;let l,u;return void 0===(null==t?void 0:t.iParallel)&&void 0===(null==t?void 0:t.iStack)?(l=o.reduce(((t,e)=>Math.max(t,e.iParallel+1)),0),u=0):(l=null!==(e=t.iParallel)&&void 0!==e?e:0,u=null!==(i=t.iStack)&&void 0!==i?i:0),o.push({axis:h,iParallel:l,iStack:u}),this.ls.xs(),h}swapAxes(t,e){const i=[this.Xg,this.Zg,this.jg,this.$g],s=i.find((e=>void 0!==e.find((e=>e.axis===t)))),r=i.find((t=>void 0!==t.find((t=>t.axis===e))));if(!s||!r)return this;if(s!==r)throw new Error("LightningChart JS ChartXY.swapAxes does not support swapping Axes that are on different sides.");const n=s.find((e=>e.axis===t)),o=s.find((t=>t.axis===e));if(!n||!o)return this;const h=n.iParallel,a=n.iStack;return n.iParallel=o.iParallel,n.iStack=o.iStack,o.iParallel=h,o.iStack=a,this.ls.xs(),this}dispose(){return this.jy.Y(),this.Ik.Y(),this.Kx.Y(),this.TA.Y(),this.Pk.forEach((t=>t.Y())),this.rg.Y(),this.hg.Y(),this.kC().forEach((t=>t.dispose())),ia(this.YC),this.Xg.slice().forEach((t=>t.axis.dispose())),this.Zg.slice().forEach((t=>t.axis.dispose())),this.jg.slice().forEach((t=>t.axis.dispose())),this.$g.slice().forEach((t=>t.axis.dispose())),this.Dv.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){var t;return null===(t=[...this.Xg,...this.$g].find((t=>t.axis.getVisible())))||void 0===t?void 0:t.axis}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}getDefaultAxisY(){var t;return null===(t=[...this.Zg,...this.jg].find((t=>t.axis.getVisible())))||void 0===t?void 0:t.axis}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):pc;return Dt(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.$g.map((t=>t.axis));case e.AxisPosition.Bottom:return this.Xg.map((t=>t.axis));case e.AxisPosition.Left:return this.Zg.map((t=>t.axis));case e.AxisPosition.Right:return this.jg.map((t=>t.axis))}})))}Lk(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.Xg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.$g.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}forEachAxisY(t){this.Zg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.jg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}setTitlePosition(t){return this.nA=t,this.ls.xs(),this}getTitlePosition(){return this.nA}Rk(t,e,i,s){const r=this.nA||Cc;let n,o=S(Tc(r),this.Cp);this.getTitleFillStyle()===B||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.mh.Ls().td();const h=Math.abs(s)+this.wa.bottom+this.Xt.bottom,a=Math.abs(i)+this.wa.top+this.Xt.top,l={left:Math.abs(t)+this.wa.left+this.Xt.left,right:Math.abs(e)+this.wa.right+this.Xt.right,top:a,bottom:h},u=this.uiScale.Wi(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=Rc(r,u,l,n,o,this.wa);return this.mh.Be(f).Na(c).Wa(d),g}De(t){super.De(t);for(const t of this.Dv)t.yv();for(const t of this.Dv)t.De();const e=ve(this.Dv.map((t=>t.SM()))),i=new Set(e.map((t=>t.Ek)));if(1===i.size){const t=Array.from(i)[0],s="x"===t?[this.Xg,this.$g]:[this.Zg,this.jg],r="y"===t?[this.Xg,this.$g]:[this.Zg,this.jg];s.forEach((t=>t.forEach((t=>t.axis.Pr())))),e.forEach((t=>t.zk())),r.forEach((t=>t.forEach((t=>t.axis.Pr()))))}else this.Zg.forEach((t=>t.axis.Pr())),this.Xg.forEach((t=>t.axis.Pr())),this.$g.forEach((t=>t.axis.Pr())),this.jg.forEach((t=>t.axis.Pr()));const s=this.Zg.map((t=>t.axis.Ls())),r=this.Xg.map((t=>t.axis.Ls())),n=this.$g.map((t=>t.axis.Ls())),o=this.jg.map((t=>t.axis.Ls()));let h=!1;this.forEachAxis((t=>{(t.Rr()||t.Er())&&(h=!0)}));const a=this.yk||this.mk||!this.QC&&h,l=new Set(this.getAxes().map((t=>t.getStackIndex()))).size>1;this.jy.De(a,l?this.Dv.sort(((t,e)=>e.axisY.getStackIndex()-t.axisY.getStackIndex())):this.Dv,this.ck,{afterCursorPointedAt:t=>{const e=this.ls.Hn();if(t.length>1&&e){const t=this.ls.Vo(e);this.jy.Rp.ly({x:t.engineX,y:t.engineY},this.ls.At)}},overrideCursorPositions:(t,e)=>t.map((t=>t.multiHit?t.multiHit.map((e=>({...t.cursorPosition,pointMarker:e}))):[t.cursorPosition])).flat()});const c=Ec(this.Zg,s),d=Ec(this.Xg,r),f=Ec(this.$g,n),g=Ec(this.jg,o),y=this.Rk(c.thicknessTotal,g.thicknessTotal,f.thicknessTotal,d.thicknessTotal),p=this.YC.x.getCellSize()-(y.left+y.right),x=this.YC.y.getCellSize()-(y.bottom+y.top),A=[y.left,y.right],S=[y.bottom,y.top];this.YC.x.q(0,p),this.YC.y.q(0,x),this.YC.x.si(A),this.YC.y.si(S);const v=(t,e,i,s)=>{let r=0;t.groups.forEach((t=>{let n=0;const o=t.stacks.reduce(((t,e)=>Math.max(t,e.Rg)),0),h=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()?e.axis.aA+e.axis.lA:0)),0),a=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"pixels"in e.axis.Ud?e.axis.Ud.pixels:0)),0),l=e-h-a;t.stacks.forEach((s=>{const h=s.axis,a=h.getVisible(),u=Math.max(e-n,0),c=Math.min(a?"pixels"in h.Ud?h.Ud.pixels:h.Ud.relative/t.sumRelativeSize*l:0,u),d=a?i[0]+n+h.aA:0,f=a?i[1]+(e-n)-c-h.aA:0;h.At.si([d,f]),h.De({Rg:o,Eg:s.Eg,Og:c,Vk:n,Hg:o+s.Eg,Gg:r}),a&&(n+=c+h.aA+h.lA)})),r+=s*t.thicknessMax}))};v(c,x,S,-1),v(g,x,S,1),v(d,p,A,-1),v(f,p,A,1),this.Bk={left:c.thicknessTotal,top:f.thicknessTotal,right:g.thicknessTotal,bottom:d.thicknessTotal},this.zv.Be(u(0,0)).it(u(p,x)),this.Vv.Be(u(0,0)).it(u(p,x));const b=m(this.YC.x.ei(),this.YC.y.ei(),this.YC.x.ri(),this.YC.y.ri());this.Kx.ux(b),this.hg.ux(b),this.rg.ux(b),this.ep&&this.ep(),super.Mp(),this.Xg.forEach((t=>t.axis.Qg())),this.$g.forEach((t=>t.axis.Qg())),this.Zg.forEach((t=>t.axis.Qg())),this.jg.forEach((t=>t.axis.Qg()));for(const t of this.Dv)t.bm()}J(){for(let t=0;t=10;h&&c&&l.x===r.x&&this.XC?(this.yk=!0,this.KC.Ie(this.ek).Fe(this.hk),this.qC.Oe(this.hk).We(r).Ge(o),this.tk.Oe(this.hk).We(u(r.x,o.y)).Ge(u(o.x,r.y)),this.uk=this.engine.setMouseStyle(this.lk,this.uk)):h&&c&&(this.$C||this.XC)?(this.yk=!0,this.KC.Ie(this.ik).Fe(this.sk),this.qC.Oe(nt),this.tk.Oe(nt),this.uk=this.engine.setMouseStyle(this.ak,this.uk)):(this.yk=!1,this.KC.Fe(nt).Ie(B),this.qC.Oe(nt),this.tk.Oe(nt),this.engine.restoreMouseStyle(this.uk)),this.ls.xs()}bk(t,e,i){if(this.yk){const t=this.ls.Vo({clientX:i.x,clientY:i.y}),s=ct({x:t.engineX,y:t.engineY},this.kp.ls.At,this.YC),r=je(s.x,this.YC.x.getInnerStart(),this.YC.x.getInnerEnd())&&je(s.y,this.YC.y.getInnerStart(),this.YC.y.getInnerEnd()),n=i.x>=e.x||!this.XC?"zoom":"fit",o=this.KC.za(),h=ui(o,this.KC.oi()),a=Math.min(this.KC.oi().x,this.KC.oi().y)>=10;r&&a&&"zoom"===n&&this.$C?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=ct(o,this.YC,t.Ag).x,i=ct(h,this.YC,t.Ag).x;t.yt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=ct(o,this.YC,t.Ag).y,i=ct(h,this.YC,t.Ag).y;t.yt(e,i,!0,!0,"interactionSetInterval")}}))):r&&a&&"fit"===n&&this.XC&&this.forEachAxis(Ac)}this.KC.Fe(nt).Ie(B),this.qC.Oe(nt),this.tk.Oe(nt),this.ls.xs()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}xk(t){this.forEachAxisX((e=>{e.getChartInteractionPanByDrag()&&e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.getChartInteractionPanByDrag()&&e.setStopped(!0).pan(t.y)}))}zoom(t,e){this.forEachAxis(xc),this.forEachAxisX((i=>{i.zoom(i.At.dt(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.At.dt(t.y),e.y)}))}Mk(t,e){this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&(xc(i),i.zoom(i.At.dt(t.x),e.x))})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&(xc(i),i.zoom(i.At.dt(t.y),e.y))}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}if(){const t=[];return this.forEachAxis((e=>e.Tg((e=>t.push(e))))),super.if().concat(t)}kC(){return this.JC}Se(){return this.Ip(this.Kx)}setCursorEnabledDuringAxisAnimation(t){return this.QC=t,this}getCursorEnabledDuringAxisAnimation(){return this.QC}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,r=e,n=xh(r)?r:Yi(r)?this.pg:void 0;if(n&&Oi(i)){const t=ct(s,n,this.ls.At);return this.ls.Oo({engineX:t.x,engineY:t.y})}if(n&&Yi(i))return ct(s,n,this.pg);if(n&&xh(i))return ct(s,n,i)}else{const i=t;if(Yi(e)){const t=this.ls.Vo(i);return ct({x:t.engineX,y:t.engineY},this.ls.At,this.pg)}if(xh(e)){const t=e,s=this.ls.Vo(i);return ct({x:s.engineX,y:s.engineY},this.ls.At,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}}e.ChartXYTitlePositionOptions=void 0,(Mc=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",Mc.RightTop="right-top",Mc.LeftTop="left-top",Mc.CenterBottom="center-bottom",Mc.RightBottom="right-bottom",Mc.LeftBottom="left-bottom",Mc.SeriesCenterTop="series-center-top",Mc.SeriesRightTop="series-right-top",Mc.SeriesLeftTop="series-left-top",Mc.SeriesCenterBottom="series-center-bottom",Mc.SeriesRightBottom="series-right-bottom",Mc.SeriesLeftBottom="series-left-bottom";const Cc=e.ChartXYTitlePositionOptions.CenterTop,Tc=t=>{switch(t){case"center-top":case"series-center-bottom":return{left:0,right:0,top:0,bottom:5};case"left-top":return{left:20,right:0,top:0,bottom:5};case"right-top":return{left:0,right:20,top:0,bottom:5};case"center-bottom":return{left:0,right:0,top:0,bottom:0};case"left-bottom":return{left:20,right:0,top:0,bottom:0};case"right-bottom":return{left:0,right:20,top:0,bottom:0};case"series-center-top":return{left:0,right:0,top:5,bottom:0};case"series-left-top":return{left:5,right:0,top:5,bottom:0};case"series-right-top":return{left:0,right:5,top:5,bottom:0};case"series-left-bottom":return{left:5,right:0,top:0,bottom:5};case"series-right-bottom":return{left:0,right:5,top:0,bottom:5}}return we(0,`Unexpected ChartXY title position selection ${t}`)},Rc=(t,e,i,s,r,n)=>{s.x,r.left,r.right;const o=s.y+r.bottom+r.top,h=(r.left-r.right)*e.x,a=(r.bottom-r.top)*e.y;switch(t){case"center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+h,y:100-(n.top+r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:h,y:100-(n.top-r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100+h,y:100-(n.top-r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50+h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100+h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"series-center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:i.left*e.x+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100-i.right*e.x+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50,y:i.bottom*e.y+a},marginsWithTitle:i};case"series-left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:i.left*e.x+h,y:i.bottom*e.y+a},marginsWithTitle:i};case"series-right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100-i.right*e.x+h,y:i.bottom*e.y+a},marginsWithTitle:i}}return we(0,`Unexpected ChartXY title position selection ${t}`)},Ec=(t,e)=>{const i=[];t.forEach(((t,s)=>{const r=e[s],n=i.find((e=>e.iParallel===t.iParallel));n?(n.stacks.push({...t,...r}),n.stacks.sort(((t,e)=>t.iStack-e.iStack))):i.push({iParallel:t.iParallel,stacks:[{...t,...r}]})}));const s=i.map((t=>{const e=t.stacks.reduce(((t,e)=>Math.max(t,e.Rg)),0),i=t.stacks.reduce(((t,e)=>Math.max(t,e.Eg)),0),s=t.stacks.reduce(((t,e)=>Math.max(t,e.Yd)),0),r=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"relative"in e.axis.Ud?e.axis.Ud.relative:0)),0);return{...t,ticksSizeMax:e,titleSizeMax:i,sumRelativeSize:r,thicknessMax:s}}));return s.sort(((t,e)=>t.iParallel-e.iParallel)),{groups:s,thicknessTotal:s.reduce(((t,e)=>t+e.thicknessMax),0)}},kc=(t,e,i)=>{var s;const r=Array.from(new Set(i.map((t=>t.series.cs())))),n=1===r.length&&void 0!==r[0]?r[0]:void 0,o="ProgressiveY"===n||"RegressiveY"===n?{progressiveDimension:"Y",progressiveAxis:e.axisY,valueDimension:"X",hitValueAxis:t=>t.axisX,value:t=>t.x,position:t=>t.y}:{progressiveDimension:"X",progressiveAxis:e.axisX,valueDimension:"Y",hitValueAxis:t=>t.axisY,value:t=>t.y,position:t=>t.x},h=o.progressiveAxis.getTickStrategy();return ft(e)?aa(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:ah(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:ah(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],void 0!==e.intensity?["Value","",{text:ah(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]:[]]):1===i.length?"Time"===h||"DateTime"===h?e.multiHit?[[ah(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis)],...aa(e,[[e.series,""],[`${o.valueDimension}1`,"",{text:ah(o.hitValueAxis(e).formatValue(o.value(e.multiHit[0])),o.hitValueAxis(e)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:ah(o.hitValueAxis(e).formatValue(o.value(e.multiHit[1])),o.hitValueAxis(e)),font:{weight:"bold"}}]])]:[[ah(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis)],...aa(e,[[e.series,"",{text:ah(o.hitValueAxis(e).formatValue(o.value(e)),o.hitValueAxis(e)),font:{weight:"bold"}}]])]:e.multiHit?aa(e,[[e.series],[o.progressiveDimension,"",{text:ah(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),font:{weight:"bold"}}],[`${o.valueDimension}1`,"",{text:ah(o.hitValueAxis(e).formatValue(o.value(e.multiHit[0])),o.hitValueAxis(e)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:ah(o.hitValueAxis(e).formatValue(o.value(e.multiHit[1])),o.hitValueAxis(e)),font:{weight:"bold"}}]]):aa(e,[[e.series],[o.progressiveDimension,"",{text:ah(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),font:{weight:"bold"}}],[o.valueDimension,"",{text:ah(o.hitValueAxis(e).formatValue(o.value(e)),o.hitValueAxis(e)),font:{weight:"bold"}}]]):n?[ah(o.progressiveAxis.formatValue(o.position(e)),o.progressiveAxis),...i.map((t=>t.multiHit?aa(t,[[t.series,""],[`${o.valueDimension}1`,"",{text:ah(o.hitValueAxis(t).formatValue(o.value(t.multiHit[0])),o.hitValueAxis(t)),font:{weight:"bold"}}],[`${o.valueDimension}2`,"",{text:ah(o.hitValueAxis(t).formatValue(o.value(t.multiHit[1])),o.hitValueAxis(t)),font:{weight:"bold"}}]]):aa(t,[[t.series,"",{text:ah(o.hitValueAxis(t).formatValue(o.value(t)),o.hitValueAxis(t)),font:{weight:"bold"}}]]))).flat()]:i.map((t=>aa(t,[[t.series],[o.progressiveDimension,"",{text:ah(o.progressiveAxis.formatValue(o.position(t)),o.progressiveAxis),font:{weight:"bold"}}],[o.valueDimension,"",{text:ah(o.hitValueAxis(t).formatValue(o.value(t)),o.hitValueAxis(t)),font:{weight:"bold"}}]]))).flat()};class Ic{constructor(t,e,i,s,n,o,h){this.coordsRelative="relative",this.coordsClient="client",this.R=new r.Eventer,this.Ok=[],this.Nk=new Map,this.Dv=new Map,this.Gk=(t,e,i)=>{0!==this.Dv.size&&void 0!==[...this.Dv.values()].find((({series:t})=>!0===t.getVisible()))||this.Wk.yt(e,i,!1,!1,"zoomBandChart"),this.Uk.ls.xs()},e.ls.Xn(dh.vf),this.mA=t,this.Yk=(null==o?void 0:o.orientation)||"x",this.Hk=void 0!==(null==o?void 0:o.useSharedValueAxis)&&o.useSharedValueAxis,this.$k=s,this.Xu="x"===this.Yk?mh:ph;const a={...o,defaultAxisX:this.Xu.getWidth({x:null==o?void 0:o.defaultAxis,y:void 0}),defaultAxisY:this.Xu.getHeight({x:null==o?void 0:o.defaultAxis,y:void 0})};this.Uk=new wc(t,e,i,kt,n,a,h).setTitle("Zoom Band Chart").setMouseInteractions(!1).setCursorMode(void 0),this.engine=this.Uk.engine;const l=this.Uk.getDefaultAxisX().setMouseInteractions(!1),u=this.Uk.getDefaultAxisY().setMouseInteractions(!1);this.Wk=this.Xu.getWidth({x:l,y:u}).setScrollStrategy(Os.fitting).setAnimationScroll(!1).setStrokeStyle(nt).setTickStrategy(Us.Empty),(null==o?void 0:o.useSharedValueAxis)?this.Xk=this.Xu.getHeight({x:l,y:u}):this.Xu.getHeight({x:l,y:u}).dispose();const c=this.getTheme().zoomBandChartDefocusOverlayFillStyle||new U({color:this.getTheme().isDark?w(0,0,0,180):w(255,255,255,180)});this.jk=[this.Uk.TA.Pe(this.Wk.Ag).Ie(c).Fe(nt),this.Uk.TA.Pe(this.Wk.Ag).Ie(c).Fe(nt)];const d=this.Uk.TA.Wg(this.Wk.Ag).Oe(this.getTheme().zoomBandChartSplitterStrokeStyle||this.getTheme().chartXYSeriesBackgroundStrokeStyle);this.Zk={collection:d,members:new Array(5).fill(0).map((t=>d.Hr()))};const f=this.getTheme(),g="function"==typeof f.zoomBandChartKnobFillStyle?f.zoomBandChartKnobFillStyle(this.mA.Zs):f.zoomBandChartKnobFillStyle||B;this.Qk=[this.Uk.TA.Pe(this.Uk.pg).Ie(g).Fe(nt),this.Uk.TA.Pe(this.Uk.pg).Ie(g).Fe(nt)],this.Jk=this.getTheme().zoomBandChartKnobSize||{x:0,y:0},this.Kk()}add(t){var e,i,s,r,n;const o=this.Ok.map((t=>t.axis)),h="x"===this.Yk?t.axisX:t.axisY;if(!o.includes(h)){const t=h.onIntervalChange(this.Gk);this.Ok.push({axis:h,deattach:()=>{h.offIntervalChange(t)}}),this.Wk.tr(h.qh()),this.qk&&this.qk.remove(),this.qk=dt(...this.Ok.map((t=>t.axis)))}const a=this.Xu.getHeight({x:t.axisX,y:t.axisY});let l;if(this.Hk)l=this.Xk;else{const t=this.Nk.get(a);t?l=t:(l=this.Xu.getHeight({x:this.Uk.addAxisX.bind(this.Uk),y:this.Uk.addAxisY.bind(this.Uk)})(),this.tT(l)),this.Nk.set(a,l)}const u=this.Xu.getWidth({x:this.Wk,y:l}),c=this.Xu.getHeight({x:this.Wk,y:l});let d;const f=[],g=(t,e)=>{const i=t=>{if(0!==t.length)if("x"in t[0]){const i=t;e.add(i)}else{const i=t,s=[];for(let t=0;ti(e)));f.push((()=>t.HM(r)));const n=t.$M((()=>e.clear()));f.push((()=>{t.XM(n)}))};if(t instanceof fc)d=this.Uk.addPointLineAreaSeries({...t.Qn,xAxis:u,yAxis:c}).setStrokeStyle(t.getStrokeStyle()).setAreaFillStyle(t.getAreaFillStyle()).setPointFillStyle(t.getPointFillStyle()).setPointAlignment(t.getPointAlignment()).setPointRotation(t.getPointRotation()).setPointShape(t.getPointShape()).setPointSize(t.getPointSize()).setCurvePreprocessing(t.getCurvePreprocessing()),d.setDataSet(t.UC());else if(t instanceof uc||t instanceof tc){const i=this.Uk.addLineSeries({xAxis:u,yAxis:c,dataPattern:t instanceof uc?null===(e=t.Qn)||void 0===e?void 0:e.dataPattern:void 0});if(t instanceof uc)i.setStrokeStyle(t.getStrokeStyle());else{const e=Fc(t);e&&i.setStrokeStyle(e)}g(t,i),d=i}else if(t instanceof ku){const e=this.Uk.addAreaSeries({xAxis:u,yAxis:c,baseline:t.Q_}).setFillStyle(t.getFillStyle()).setStrokeStyle(t.getStrokeStyle());g(t,e),d=e}else if(t instanceof cc){const e=this.Uk.addPointSeries({xAxis:u,yAxis:c,pointShape:null===(i=t.Qn)||void 0===i?void 0:i.pointShape}).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof Ju){const e=this.Uk.addStepSeries({xAxis:u,yAxis:c,pointShape:null===(s=t.Qn)||void 0===s?void 0:s.pointShape,mode:t.mw}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof Uu){const e=this.Uk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(r=t.Qn)||void 0===r?void 0:r.pointShape}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof zu){const e=this.Uk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(n=t.Qn)||void 0===n?void 0:n.pointShape}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof Pu){const e=this.Uk.addAreaRangeSeries({xAxis:u,yAxis:c}).setLowFillStyle(t.getLowFillStyle()).setHighFillStyle(t.getHighFillStyle()).setLowStrokeStyle(t.getLowStrokeStyle()).setHighStrokeStyle(t.getHighStrokeStyle()).add(t.UM()),i=t.YM(((t,i)=>e.add(i)));f.push((()=>t.HM(i))),d=e;const s=t.$M((()=>e.clear()));f.push((()=>{t.XM(s)}))}else{if(!(t instanceof vu))throw new Error("LightningChart JS Zoom Band Chart unsupported series type");{const e=this.Uk.addHeatmapGridSeries({xAxis:u,yAxis:c,...t.e_}),i=()=>{e.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};i(),d=e,t.n_(d);const s=t.l_(((t,i)=>e.invalidateIntensityValues(i))),r=t.o_(i);f.push((()=>{t.u_(s),t.a_(r)}));const n=t.$M((()=>e.clear()));f.push((()=>{t.XM(n)}))}}d.setMouseInteractions(!1);const y=t.onVisibleStateChanged(((t,e)=>{d.setVisible(e)}));f.push((()=>{t.offVisibleStateChanged(y)}));const m=t.onHighlight(((t,e)=>d.setHighlight(e)));f.push((()=>{t.offHighlight(m)}));const p=t.onDispose((()=>{this.disposeSeries(t)}));return f.push((()=>{t.offDispose(p)})),this.Dv.set(t,{series:d,clearReferences:()=>f.forEach((t=>t()))}),d}disposeSeries(t){const e=this.Dv.get(t);if(e){const{clearReferences:i}=e;i(),this.Dv.delete(t),e.series.dispose();const s=this.Xu.getHeight({x:t.axisX,y:t.axisY}),r=this.Nk.get(s);r&&0===r.Dg().length&&(this.Nk.delete(s),r.dispose())}const i="x"===this.Yk?t.axisX:t.axisY;if(!Array.from(this.Dv.keys()).find((t=>i===("x"===this.Yk?t.axisX:t.axisY)))){const t=this.Ok.findIndex((t=>t.axis===i));this.Ok[t].deattach(),this.Ok.splice(t,1)}return this}setDefocusOverlayFillStyle(t){return this.jk.forEach((e=>e.Ie(t))),this.Uk.ls.xs(),this}getDefocusOverlayFillStyle(){return this.jk[0].Hh()}setSplitterStrokeStyle(t){return this.Zk.collection.Oe(t),this.Uk.ls.xs(),this}getSplitterStrokeStyle(){return this.Zk.collection.pu()}setKnobFillStyle(t){return this.Qk.forEach((e=>e.Ie(t))),this.Uk.ls.xs(),this}getKnobFillStyle(){return this.Qk[0].Hh()}setKnobStrokeStyle(t){return this.Qk.forEach((e=>e.Fe(t))),this.Uk.ls.xs(),this}getKnobStrokeStyle(){return this.Qk[0].po()}setKnobSize(t){return this.Jk=t,this.Uk.ls.xs(),this}getKnobSize(){return this.Jk}getDefaultAxisX(){return this.Uk.getDefaultAxisX()}getDefaultAxisY(){return this.Uk.getDefaultAxisY()}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}tT(t){t.setTickStrategy(Us.Empty).setMouseInteractions(!1).setNibStyle(nt).setStrokeStyle(nt)}Kk(){let t;const i=(t,e,i)=>{var s,r;const n="x"===this.Yk?null===(s=Array.from(this.Dv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Dv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Wk.getInterval();Math.abs(this.Wk.At.ft(t)-this.Wk.At.ft(e))<10||Math.sign(e-t)!==Math.sign(o.end-o.start)||Math.min(t,e)Math.max(h.start,h.end)&&Math.max(o.start,o.end){s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(this.Xu.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical}),t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const n=t=>{var e,s;const n="x"===this.Yk?null===(e=Array.from(this.Dv.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.Dv.keys())[0])||void 0===s?void 0:s.axisY;if(!n)return;const o=this.Xu.getWidth(this.Uk.translateCoordinate(t,this.Uk.coordsAxis)),h=n.getInterval(),a=0===r?o:h.start,l=1===r?o:h.end;i(a,l,!1),Qt(t)};s.setMouseDragEventHandler(((t,e,i,s,r)=>n(e)));const o=ji(new $i(void 0,((t,e,i,s,r)=>n(r))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)})),this.Uk.onSeriesBackgroundMouseEnter((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Move,t)})),this.Uk.onSeriesBackgroundMouseLeave((()=>{this.engine.restoreMouseStyle(t)}));const s=(t,e)=>{var s,r;const n="x"===this.Yk?null===(s=Array.from(this.Dv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Dv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Wk.At.pi(o.start,this.Xu.getWidth(t)),a=this.Wk.At.pi(o.end,this.Xu.getWidth(t));i(h,a,!1),Qt(e)};this.Uk.onSeriesBackgroundMouseDrag(((t,e,i,r,n)=>s(n,e)));const r=ji(new $i(void 0,((t,e,i,r,n)=>s(r,n))));this.Uk.onSeriesBackgroundMouseWheel(((t,e)=>{var s,r;const n="x"===this.Yk?null===(s=Array.from(this.Dv.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.Dv.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Wk.getInterval(),a=this.Xu.getWidth(this.Uk.translateCoordinate(e,this.Uk.coordsAxis)),l=this.Wk.At.ft(o.start),u=this.Wk.At.ft(o.end),c=this.Wk.At.ft(a),d=Ft((c-l)/(u-l),0,1),f=.2*Math.abs(u-l)*n.Gf,g=d*f*-Math.sign(e.deltaY),y=(1-d)*f*Math.sign(e.deltaY),m=Ft(this.Wk.At.pi(o.start,g),h.start,h.end),p=Ft(this.Wk.At.pi(o.end,y),h.start,h.end);i(m,p,!1),Qt(e)})),this.Uk.onSeriesBackgroundTouchStart(r.onTouchStart),this.Uk.onSeriesBackgroundTouchMove(r.onTouchMove),this.Uk.onSeriesBackgroundTouchEnd(r.onTouchEnd),this.jk.forEach(((s,r)=>{s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Point,t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const n=t=>{var e,s;const r="x"===this.Yk?null===(e=Array.from(this.Dv.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.Dv.keys())[0])||void 0===s?void 0:s.axisY;if(!r)return;const n=this.Xu.getWidth(this.Uk.translateCoordinate(t,this.Uk.coordsAxis)),o=r.getInterval(),h=this.Wk.getInterval(),a=Ft(n-(o.end-o.start)/2,Math.min(h.start,h.end),Math.max(h.start,h.end)-Math.abs(o.end-o.start)),l=a+(o.end-o.start);i(a,l,!0),Qt(t)};s.setMouseClickEventHandler(((t,e)=>n(e)));const o=ji(new class{constructor(t,e=300){this.Rs=!1,this.Es=[],this.zs=300,this.Vs=t,this.zs=e}Bs(t,e){const i=wt.performance.now();let s=!1;for(let t=0;t=this.zs?(this.Es.splice(t,1),t-=1):this.Es[t].state&&(s=!0);return this.Rs?0===e.interactions.length&&(this.Es.push({state:!1,time:i}),this.Rs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Es.push({state:!0,time:i}),s=!0,this.Rs=!0),s}Ls(t,e,i){if(i&&!this.Rs){const i=this.Es.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=1&&i.off>=1&&(this.Vs(t,e),this.Es.length=0)}}}(((t,e)=>n(e))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)}))}getSizePixels(){return this.Uk.getSizePixels()}onResize(t){return this.Uk.onResize(((e,i,s,r,n)=>t(this,i,s,r,n)))}offResize(t){return this.Uk.offResize(t)}zr(t){this.Uk.zr(t)}getMinimumSize(){return this.Uk.getMinimumSize()}J(){return this.Uk.J()}K(){return this.Uk.K()}De(t){var e,i,s,r;const n=Se(Array.from(this.Dv.keys()).map((t=>t.chart))),o="x"===this.Yk?null===(e=Array.from(this.Dv.keys())[0])||void 0===e?void 0:e.axisX:null===(i=Array.from(this.Dv.keys())[0])||void 0===i?void 0:i.axisY;if("x"===this.Yk){const t=n.reduce(((t,e)=>{const i=[];e.forEachAxisY((t=>{if(0!==t.lg)return;let e=i.find((e=>e.iParallel===t.getParallelIndex()));e||(e={iParallel:t.getParallelIndex(),maxHeight:0},i.push(e)),e.maxHeight=Math.max(e.maxHeight,t.Jg())}));const s=i.reduce(((t,e)=>t+e.maxHeight),0);return Math.max(t,s)}),0),e=n.reduce(((t,e)=>{const i=[];e.forEachAxisY((t=>{if(100!==t.lg)return;let e=i.find((e=>e.iParallel===t.getParallelIndex()));e||(e={iParallel:t.getParallelIndex(),maxHeight:0},i.push(e)),e.maxHeight=Math.max(e.maxHeight,t.Jg())}));const s=i.reduce(((t,e)=>t+e.maxHeight),0);return Math.max(t,s)}),0),i=n.reduce(((t,e)=>Math.max(t,e.getPadding().left)),0),r=n.reduce(((t,e)=>Math.max(t,e.getPadding().right)),0);this.Uk.forEachAxisY((t=>t.setThickness(0))),null===(s=this.getDefaultAxisY())||void 0===s||s.setThickness(t),this.Uk.setPadding({left:i+(0===n.length?10:0),right:r+e+(0===n.length?10:0)})}else{const t=n.reduce(((t,e)=>{const i=[];e.forEachAxisX((t=>{if(0!==t.lg)return;let e=i.find((e=>e.iParallel===t.getParallelIndex()));e||(e={iParallel:t.getParallelIndex(),maxHeight:0},i.push(e)),e.maxHeight=Math.max(e.maxHeight,t.Jg())}));const s=i.reduce(((t,e)=>t+e.maxHeight),0);return Math.max(t,s)}),0),e=n.reduce(((t,e)=>{const i=[];e.forEachAxisX((t=>{if(100!==t.lg)return;let e=i.find((e=>e.iParallel===t.getParallelIndex()));e||(e={iParallel:t.getParallelIndex(),maxHeight:0},i.push(e)),e.maxHeight=Math.max(e.maxHeight,t.Jg())}));const s=i.reduce(((t,e)=>t+e.maxHeight),0);return Math.max(t,s)}),0),i=n.reduce(((t,e)=>Math.max(t,e.getPadding().bottom)),0),s=n.reduce(((t,e)=>Math.max(t,e.getPadding().top)),0);this.Uk.forEachAxisX((t=>t.setThickness(0))),null===(r=this.getDefaultAxisX())||void 0===r||r.setThickness(t),this.Uk.setPadding({bottom:i+(0===n.length?10:0),top:s+e+(0===n.length?10:0)})}this.Uk.De(t);const h=this.Wk.getInterval().start,a=this.Wk.getInterval().end,l=Ft(o?o.getInterval().start:h,h,a),u=Ft(o?o.getInterval().end:a,h,a),c=this.Xu.getHeight(this.Uk.YC.getInnerIntervalPixels());this.jk[0].Be(this.Xu.toPoint(h,0)).it(this.Xu.toPoint(l-h,c)),this.jk[1].Be(this.Xu.toPoint(u,0)).it(this.Xu.toPoint(a-u,c)),this.Zk.members[0].Yg(this.Xu.toPoint(h,c),this.Xu.toPoint(l,c)),this.Zk.members[1].Yg(this.Xu.toPoint(l,c),this.Xu.toPoint(l,0)),this.Zk.members[2].Yg(this.Xu.toPoint(l,0),this.Xu.toPoint(u,0)),this.Zk.members[3].Yg(this.Xu.toPoint(u,0),this.Xu.toPoint(u,c)),this.Zk.members[4].Yg(this.Xu.toPoint(u,c),this.Xu.toPoint(a,c));const d=ct(this.Xu.toPoint(l,c/2),this.Wk.Ag,this.Uk.pg),f=ct(this.Xu.toPoint(u,c/2),this.Wk.Ag,this.Uk.pg),g=this.Jk;this.Qk[0].Be({x:d.x-g.x/2,y:d.y-g.y/2}).it({x:g.x,y:g.y}).Zh(this.Xu.getWidth({x:0,y:90})),this.Qk[1].Be({x:f.x-g.x/2,y:f.y-g.y/2}).it({x:g.x,y:g.y}).Zh(this.Xu.getWidth({x:0,y:90}))}setSeriesBackgroundFillStyle(t){return this.Uk.setSeriesBackgroundFillStyle(t),this.Uk.ls.xs(),this}getSeriesBackgroundFillStyle(){return this.Uk.getSeriesBackgroundFillStyle()}setSeriesBackgroundStrokeStyle(t){return this.Uk.setSeriesBackgroundStrokeStyle(t),this.Uk.ls.xs(),this}getSeriesBackgroundStrokeStyle(){return this.Uk.getSeriesBackgroundStrokeStyle()}setSeriesBackgroundEffect(t){return this.Uk.setSeriesBackgroundEffect(t),this.Uk.ls.xs(),this}getSeriesBackgroundEffect(){return this.Uk.getSeriesBackgroundEffect()}getTheme(){return this.Uk.getTheme()}setTitle(t){return this.Uk.setTitle(t),this}getTitle(){return this.Uk.getTitle()}setTitleFillStyle(t){return this.Uk.setTitleFillStyle(t),this}getTitleFillStyle(){return this.Uk.getTitleFillStyle()}setTitleFont(t){return this.Uk.setTitleFont(t),this}getTitleFont(){return this.Uk.getTitleFont()}setTitleMargin(t){return this.Uk.setTitleMargin(t),this}getTitleMargin(){return this.Uk.getTitleMargin()}setPadding(t){return this.Uk.setPadding(t),this}getPadding(){return this.Uk.getPadding()}setBackgroundFillStyle(t){return this.Uk.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.Uk.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.Uk.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.Uk.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return ta(t,e,i,this.Uk.pg,this.Uk.ls)}addUIElement(t,e){return this.Uk.addUIElement(t,e)}addLegendBox(t,e){return this.Uk.addLegendBox(t,e)}getLegendBoxes(){return this.Uk.getLegendBoxes()}saveToFile(t,e,i){return this.Uk.saveToFile(t,e,i),this}dispose(){return this.Uk.dispose(),this.Nk.clear(),this.Dv.clear(),this.$k(this),this}isDisposed(){return this.Uk.isDisposed()}onDispose(t){return this.Uk.onDispose((()=>t(this)))}offDispose(t){return this.Uk.offDispose(t)}}const Fc=t=>{if("getStrokeStyle"in t)return t.getStrokeStyle();const e=(t=>t instanceof uc||t instanceof ku?t.getStrokeStyle().getFillStyle():t instanceof cc||t instanceof zu?t.getPointFillStyle():void 0)(t);return e?new Ji({thickness:2,fillStyle:e}):void 0};class Dc extends Kl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this._s="Point Series",this.$b=[],this.Xb=!1,this.Kb=3,this.ba=0,this.we=ye(this.Ki.polarPointSeriesFillStyle,o),this.Ad=new lo({dataPattern:null}),this.ja=t.md(r).Oe(nt).yd(B).pd(this.we).vd(e.PointShape.Circle)._d(this.Kb).us(this.getHighlight()).gd(this.Ad),this.ds(this.ja)}solveNearest(t,e="show-nearest"){const i=this.chart.translateCoordinate(t,this.chart.coordsAxis),s=$l([i],this.scale)[0],r=this.Ad.Jc(s,ha(e),this.scale,this.chart.pg);if(!r)return;const n=Jl(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}setData(t){return 0!==this.$b.length&&this.chart.ls.Xn(dh.Cf),this.$b=ql(t),this.Xb=!0,this.Gb=Ql(this.$b),this.Is.xs(),this}setPointAlignment(t){return this.ja.NC(t),this.chart.ls.xs(),this}getPointAlignment(){return this.ja.GC()}setPointFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;return this.ja.pd(e),this.Is.xs(),this}getPointFillStyle(){return this.we}setPointSize(t){return this.Kb=t,this.ja._d(t),this.Is.xs(),this}getPointSize(){return this.Kb}setPointShape(t){return this.ja.vd(t),this.chart.ls.xs(),this}getPointShape(){return this.ja.Sd()}setPointRotation(t){return this.ba=t,this.ja.xd(t),this.Is.xs(),this}getPointRotation(){return this.ba}rv(){return this.av&&this.$b.length>0&&this.getVisible()}Le(t,e){t.us(e),this.Is.xs()}De(){if(this.Xb||this.scale.Jb()){const t=$l(this.$b,this.scale),e=Je(t);this.Ad.clear().add(t),this.ja.Ko(e),this.Xb=!1,this.ja.Ls()}}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}Fs(){return this.Ms||this.getPointShape()}}class Pc{constructor(t,e,i,s){this.R=new r.Eventer,this.iT=!1,this.ee=t,this.sT=e,this.Dv=i,this.ja=s}setGeometry(t){return this.eT=t,this.iT=!0,this.ee.ls.xs(),this}getGeometry(){return this.eT}setMouseInteractions(t){return this.ja.setMouseInteractions(t),this}dispose(){return this.ja.dispose(),this.sT(this),this.R.emit("dispose",this),this}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setVisible(t){const e=this.ja.getVisible()!==t;return this.ja.setVisible(t),e&&this.R.emit("visibleStateChanged",this,t),this.ee.ls.xs(),this}getVisible(){return this.ja.getVisible()}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}}class Lc extends Kl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this._s="Polygon Series",this.hT=[],this.rT=[],this.nT=t=>{const e=this.rT.indexOf(t);e>=0&&this.rT.splice(e,1);const i=this.hT.findIndex((e=>e===t.ja));i>=0&&this.hT.splice(i,1),this.Is.xs()},this.we=ye(this.Ki.polarPolygonSeriesFillStyle,n),this.Ce=ye(this.Ki.polarPolygonSeriesStrokeStyle,n)}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=cu(s,this.hT,((t,e)=>{const i=t.Jc(e);if(i)return ct(i,this.scale,t.ls.At)}),Ke);if(!r)return;const n=ct(r[0],r[1].ls.At,this.scale);if(!this.oT(r[1]))return;const o=Jl(n,this.scale);return{cursorPosition:{pointMarker:n,pointMarkerScale:this.scale,resultTable:n,resultTableScale:this.scale},series:this,...o}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}addPolygon(){const t=new Pc(this.chart,this.nT,this,this.aT());return this.rT.push(t),t}setFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;for(const t of this.hT)t.Ie(e);return this.Is.xs(),this}getFillStyle(){return this.we}setStrokeStyle(t){this.Ce="function"==typeof t?t(this.Ce):t;const e=this.Ce;for(const t of this.hT)t.Fe(e);return this.Is.xs(),this}getStrokeStyle(){return this.Ce}rv(){return this.av&&void 0!==this.rT.find((t=>void 0!==t.lT))&&this.getVisible()}De(){this.rT.forEach((t=>{(t.iT||this.scale.Jb())&&t.uT&&(t.ja._l($l(t.uT,this.scale)),t.iT=!1,t.ja.Ls())}))}yv(){super.yv();const t=y(Be,ze);this.rT.forEach((e=>{if(!e.eT)return;const i=!e.iT&&e.uT?e.uT:ql(e.eT);e.uT=i;const s=!e.iT&&e.lT?e.lT:Ql(i);e.lT=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.Gb=t}Le(t,e){t.us(e),this.Is.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.Ce})}aT(){const t=this.Is.oc(this.scale,cn.Simple).Ie(this.we).Fe(this.Ce).us(this.getHighlight());return this.hT.push(t),this.ds(t),t}oT(t){return this.rT.find((e=>e.ja===t))}}class Vc extends Kl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this._s="Area Series",this.$b=[],this.Xb=!1,this.jb=!1,this.cT=!1,this.we=ye(this.Ki.polarAreaSeriesFillStyle,n),this.Ce=ye(this.Ki.polarAreaSeriesStrokeStyle,n)}setData(t){0!==this.$b.length&&this.chart.ls.Xn(dh.Cf);const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.Ce})}}class _c extends Vc{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.dT=this.Is.oc(this.scale,cn.Simple).us(this.getHighlight()),this.ds(this.dT)}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=this.dT.Jc(s);if(!r)return;const n=Jl(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}De(){if(this.Xb||this.scale.Jb()){const t=this.$b,e=!0===this.jb?$l(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(It(e.angle,i.angle))return t;const s=1*Math.sign(i.angle-e.angle);let r=0;const n=[];for(let t=i.angle+s;!It(t%360,e.angle%360);t+=s)if(n.push({angle:t,amplitude:0}),r+=1,r>360)return[];for(let t=0;t=this.fT.start}Lb(t){this.AT=t,this.vT=!0}Eb(){return!1===this.AT}Rb(t){this.gT=t,this.vT=!0}Pb(){return this.gT}yi(){return this.Si}_i(){return!1}ct(t,e,i,s){return this.x=new Li(t.x,e.x,i.x,s?s.x:void 0),this.y=new Li(t.y,e.y,i.y,s?s.y:void 0),this}mi(){return this.di}Jb(){return this.mT}bT(){return this.vT}Wi(){return this.ST}J(){return this.u=!1,this.Si=!1,this.mT=!1,this.vT=!1,this}K(){return this.u=!0,this.Si=!0,this.mT=!0,this.vT=!0,this}it(t,e){return"object"==typeof t?(this.Z.x=t.x,this.Z.y=t.y):(this.Z.x=t,this.Z.y=e),this.xT(),this}Ei(t){return this.pT=t,this.xT(),this}zi(t){return this.yT=t,this.xT(),this}ni(){return u(this.pT[0]+this.pT[1],this.yT[0]+this.yT[1])}oi(){return this.Z}xT(){const t=this.fT,e=u(this.x.ai(this.Z.x),this.y.ai(this.Z.y)),i=this.pT[0]+this.pT[1],s=this.yT[0]+this.yT[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.pT[0]+Math.max((r-2*o)/2,0),this.pT[1]+Math.max((r-2*o)/2,0)],a=[this.yT[0]+Math.max((n-2*o)/2,0),this.yT[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.it(this.Z.x).si(h).q(-l,l),this.y.it(this.Z.y).si(a).q(-l,l),this.ST={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.di={x:this.x.mi(),y:this.y.mi()},this.K()}pi(t,e){const i=this.Wi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Ui(t,e,i,s){const r=this.Wi(),n=hi(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 zc extends cl{constructor(t,e,i,s,r,n,o){super(t,e,i,e.wp("polarChart bg",0),s,e.ls.Ki.polarChartBackgroundFillStyle,e.ls.Ki.polarChartBackgroundStrokeStyle,e.ls.Ki.polarChartTitleFont,e.ls.Ki.polarChartTitleFillStyle,o),this.coordsClient="client",this.eA=[],this.No=!0,this.MT=(t,e,i,s,r)=>{this.fb.it(s,r)},this.oA=ee(this.eA),this._T=t=>{this.eA.push(t)},this.wT=()=>this.Dv,this.ls.Xn(dh.yf),this.Ik=e.Mx("polarChart series bg",0),this.CT=e.Hy("polarChart axis gridlines",0),this.kT=e.Hy("polarChart series",1),this.TT=e.Hy("polarChart axis lines",2),this.FT=e.Hy("polarChart axis ticks",3),this.fb=i.d2({scaleXYConstructor:Bc}),this.onResize(this.MT),this.mh.gr("Polar Chart"),this.zv=this.Ik.hd(this.fb).Ie(this.Ki.polarChartSeriesBackgroundFillStyle).Fe(nt).lu(0).Ge(360).fu(0),this.Vv=this.Ik.hd(this.fb).Ie(B).Fe(this.Ki.polarChartSeriesBackgroundStrokeStyle).lu(0).Ge(360).fu(0),super.Ev(this.zv,this.Vv),this._p(r,this.pg),this.IT=new Ol(this,this.fb,this.Ki,!1!==(null==n?void 0:n.animationsEnabled),this.CT,this.TT,this.FT,this.ss,this.wT),this.PT=new Yl(this,this.fb,this.Ki,!1!==(null==n?void 0:n.animationsEnabled),this.CT,this.TT,this.FT,this.ss),this.coordsAxis={axisAmplitude:this.IT,axisRadial:this.PT};const h=e.Xy(),a=Pt(n?n.cursorBuilder:void 0,Ta);this.jy=la(this,h,a.gy(h,this.uiScale,this.uiScale,kt,this.Ki),this,"show-nearest",Oc,((t,e)=>{const i=this.translateCoordinate(t,this.coordsClient);return Math.sqrt((i.clientX-e.clientX)**2+(i.clientY-e.clientY)**2)})),this.setAnimationsEnabled(!1!==(null==n?void 0:n.animationsEnabled))}getSeries(){return this.Dv}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}solveNearest(t,e=this.getCursorMode()||"show-nearest"){return this.jy.solveNearest(t,e,this.Dv,((t,e,i)=>t.solveNearest(e,i)))}addCursor(t=Ta){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}translateCoordinate(t,e,i){if(i){const e=t,s=this.pg,r=i;if(Oi(r)){const t=ct(e,s,this.ls.At);return this.ls.Oo({engineX:t.x,engineY:t.y})}if(Yi(r))return e;if(Zl(r)){const t=ct(e,s,this.fb);return Jl(t,this.fb)}}else{const i=t,s=e;if(Ui(i)){if(Zl(s)){const t=this.ls.Vo(i),e=ct({x:t.engineX,y:t.engineY},this.ls.At,this.fb);return Jl(e,this.fb)}if(Oi(s))return i;if(Yi(s)){const t=this.ls.Vo(i);return ct({x:t.engineX,y:t.engineY},this.ls.At,this.pg)}}else if(Hl(i)){if(Zl(s))return i;const t=$l([i],this.fb)[0];if(Oi(s)){const e=ct(t,this.fb,this.ls.At),i={engineX:e.x,engineY:e.y};return this.ls.Oo(i)}if(Yi(s))return ct(t,this.fb,this.pg)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new eu(this.kT,this,this.Lv,this.fb,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addPointSeries(t){const e=new Dc(this.kT,this,this.Lv,this.fb,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addPointLineSeries(t){const e=new iu(this.kT,this,this.Lv,this.fb,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addAreaSeries(t){const e=new _c(this.kT,this,this.Lv,this.fb,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addPolygonSeries(t){const e=new Lc(this.kT,this,this.Lv,this.fb,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addHeatmapSeries(t){const e=new tu(this.kT,this,this.Lv,this.fb,this.Ki,this.ls.ss,t);return this.Ov(e),e}addSector(){const t=new Wl(this.kT,this,this.oA,this.fb,this.Ki,this.ls.ss);return this._T(t),t}getAmplitudeAxis(){return this.IT}get amplitudeAxis(){return this.IT}get axisAmplitude(){return this.IT}getRadialAxis(){return this.PT}get radialAxis(){return this.radialAxis}get axisRadial(){return this.radialAxis}De(t){var e,i;super.De(t),oa.Bp(this.mh,this.Cp);for(const t of this.Dv)t.yv();this.IT.Pr(),this.PT.Pr();for(const t of this.Dv)t.De();for(let t=1;t<=2;t+=1){const e=this.IT.De(),i=this.PT.De(),s=oa.Dp(this.mh,this.Cp),r=[this.wa.left+i,this.wa.right+i],n=[this.wa.bottom+i,this.wa.top+i+s];this.fb.Ei(r).zi(n);const o=4;if(!(!this.DT||Math.abs(this.DT.amplitude-e)>=o||Math.abs(this.DT.radial-i)>=o)||1!==t){this.DT={amplitude:e,radial:i};break}}const s=this.fb.Cb().start,r=this.fb.Cb().end,n=this.fb.wb()?((null===(e=this.DT)||void 0===e?void 0:e.radial)||0)*this.fb.x.getPixelSize()+r-s:((null===(i=this.DT)||void 0===i?void 0:i.radial)||0)*this.fb.x.getPixelSize()+s-r;this.zv.uu(n).Au(360),this.Vv.uu(n).Au(360);for(const t of this.eA)t.De();this.jy.De(!1,this.Dv,((t,e,i)=>t.solveNearest(e,i)));for(const t of this.Dv)t.bm();return super.Mp(),this.BT(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.IT.setAnimationsEnabled(t),this.PT.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.No=t,this}getMouseInteractions(){return this.No}getMinimumSize(){return u(Nc,Nc)}BT(){}forEachAxis(t){return t(this.IT),t(this.PT),this}dispose(){return this.eA.slice().forEach((t=>t.dispose())),this.jy.Y(),this.Ik.Y(),this.CT.Y(),this.kT.Y(),this.TT.Y(),this.FT.Y(),super.dispose()}if(){return[...this.Dv,...this.eA]}}const Nc=300,Oc=(t,e,i)=>{var s;return yt(e)?aa(e,[[e.series],["Angle","",{text:e.angle.toFixed(0),font:{weight:"bold"}}],["Amplitude","",{text:ah(t.getAmplitudeAxis().formatValue(e.amplitude),t.amplitudeAxis),font:{weight:"bold"}}],["Intensity","",{text:ah(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]]):aa(e,[[e.series],["Angle","",{text:e.angle.toFixed(0),font:{weight:"bold"}}],["Amplitude","",{text:ah(t.getAmplitudeAxis().formatValue(e.amplitude),t.amplitudeAxis),font:{weight:"bold"}}]])};class Uc extends Fa{}class Yc extends Uc{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this._s="Slice",this.M=0,this.py=!1,this.LT=B,this.my=B,this.vy=this.M,this.by=K((()=>this.chart.ls.xs())),this._y=()=>{this.wy=void 0},this.index=t,this.chart=s,this.scale=r,this.Ji=n,this.dT=e.oc(r,cn.Simple).us(this.getHighlight()),this.ds(this.dT),this.Ke=i.Or(r).us(this.getHighlight()),this.ds(this.Ke,{isText:!0})}setValue(t){return this.chart.getAnimationsEnabled()?this.getVisible()&&this.Fy(this.vy,t):this.vy=t,this.M=t,this.chart.ls.xs(),this}getValue(){return this.M}setVisible(t){return!1===t?this.chart.getAnimationsEnabled()&&this.vy>0?(this.wy&&(this.wy.finish(!1),this.wy=void 0),this.Fy(this.vy,0,(()=>super.setVisible(!1)))):(this.vy=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.wy&&(this.wy.finish(!1),this.wy=void 0),super.setVisible(!0),this.Fy(this.vy,this.M)):(this.vy=this.M,super.setVisible(!0)),this}Fy(t,e,i){this.wy=this.by(300,W.ease)([[t,e]],(([t])=>{this.vy=t,this.chart.ls.xs()})),this.wy.onEveryAnimationEnd(this._y),i&&this.wy.onAnimationEnd(i)}setStyle(t,e,i,s){this.LT=t,this.my=i,this.dT.Ie(this.LT).Fe(e),this.Ke.Ie(this.my).jh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Zc=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=Xc(i,r.x),s=Xc(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},y={x:0,y:n.bottom},m=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:y.x-x*o,y:y.y-o}),S=(i+c/u*(s-i))/2,g={x:a-S,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-A:A}`,10)},y={x:a+S,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-A:A}`,10)},f.x>=d.x&&y.x>g.x&&p.dT._l([g,d,f,y])}};class Hc extends na{constructor(t,i,s,r,n,o,h){super(t,i,s,i.wp("funnelChart bg",0),r,i.ls.Ki.funnelChartBackgroundFillStyle,i.ls.Ki.funnelChartBackgroundStrokeStyle,i.ls.Ki.funnelChartTitleFont,i.ls.Ki.funnelChartTitleFillStyle,o),this.Iy=[],this.Py=ka.None,this.Ly=!0,this.zy=0,this.RT=80,this.ET=20,this.zT=0,this.VT=e.FunnelSliceModes.VariableHeight,this.Ny=!0,this.Wy=t=>{const e=this.Iy.indexOf(t);e>=0&&(this.Iy.splice(e,1),this.Uy())},this.ls.Xn(dh.Af),this.Gy=this.Ki.effectsText,this.Yy=i.Hy("funnelChart bottom",0),this.$y=i.Hy("funnelChart top",1),this.mh.gr("Funnel Chart"),this.Dy=this.Ki.funnelChartSliceFillStylePalette,this.By=this.Ki.funnelChartSliceStrokeStyle,this.Ry=this.Ki.funnelChartSliceLabelFont,this.Ey=this.Ki.funnelChartSliceLabelFillStyle;const a=i.Xy(),l=Pt(h?h.cursorBuilder:void 0,wa);this.jy=la(this,a,l.gy(a,this.uiScale,this.uiScale,kt,this.Ki),void 0,"show-pointed",Wc,(()=>0)),this.setAnimationsEnabled(!1!==(null==h?void 0:h.animationsEnabled)),this._p(n,this.pg)}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=wa){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}addSlice(t,e){const i=new Yc(this.zy,this.Yy,this.$y,this,this.pg,this.Wy,this.Ki,this.ls.ss);return this.zy+=1,i.setName(t),i.setValue(e),i.ss.hs.Ss(this.Gy),i.ss.rs.Ss(this.Ny),this.Iy.push(i),this.ls.xs(),i.setHighlightOnHover(this.Ly),i.onMouseMove((()=>{this.getCursorMode()&&this.ls.xs()})),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.Ss(t))),this.ls.xs(),this}getSliceEffect(){return this.Ny}setSliceSorter(t){return this.Py=t,this.Iy=this.Iy.sort(this.Py),this.ls.xs(),this}getSliceSorter(){return this.Py}setLabelFillStyle(t){return this.Ey="function"==typeof t?t(this.Ey):t,this.ls.xs(),this}getLabelFillStyle(){return this.Ey}setLabelFont(t){return this.Ry="function"==typeof t?t(this.Ry):t,this.ls.xs(),this}getLabelFont(){return this.Ry}setLabelEffect(t){return this.Gy=t,this.Iy.forEach((e=>e.ss.hs.Ss(t))),this.ls.xs(),this}getLabelEffect(){return this.Gy}setLabelFormatter(t){return this.Qy=t,this.ls.xs(),this}getLabelFormatter(){return this.Qy}setSliceHighlightOnHover(t){return this.Ly=t,this.Iy.forEach((e=>e.setHighlightOnHover(t))),this}De(t){super.De(t),oa.Bp(this.mh,this.Cp),super.Mp();const e=oa.Dp(this.mh,this.Cp),i=u(this.pg.x.getInnerInterval()-(this.wa.left+this.wa.right),this.pg.y.getInnerInterval()-(this.wa.bottom+this.wa.top+e)),s=u(this.wa.left+i.x/2,this.wa.bottom+i.y/2);this.Iy=this.Iy.sort(this.Py);for(let t=0,{length:e}=this.Iy;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;t{const s=o[r.indexOf(t)]||0,n=this.ls.Vo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.ls.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.ls.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.Jy(r,o,s,i)}Zy(t,e){t.setStyle(this.$d?new U({color:this.$d.getColors(t.getAnimatedValue())}):this.Dy(e,t),this.By,this.Ey,this.Ry)}Uy(){this.Iy=this.Iy.sort(this.Py),this.ls.xs()}if(){return this.Iy}dispose(){return this.Iy.slice().forEach((t=>t.dispose())),this.jy.Y(),this.Yy.Y(),this.$y.Y(),super.dispose()}}const Wc=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],jc=(t,i,s)=>{const r=t.wl();if(r.length>0){let t;const n=(r[1].y-r[0].y)/2+r[0].y;return t=i===e.FunnelLabelSide.Left?(r[0].x-r[1].x)/2+r[1].x-s:(r[2].x-(4===r.length?r[3].x:r[1].x))/2+(4===r.length?r[3].x:r[1].x)+s,{x:t,y:n}}},Kc=t=>{const e=t.wl();if(e.length>0)return{x:(e[2].x-e[1].x)/2+e[1].x,y:(e[1].y-e[0].y)/2+e[0].y}};class $c extends Hc{constructor(){super(...arguments),this.Qy=Ia.NamePlusValue,this.OT=10,this.NT=e.FunnelLabelSide.Left,this.GT=e.SliceLabelIndices.LabelsOnSides,this.Ky=[],this.sm=this.Ki.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.sm=t;for(let t=0;tt.Ke.setVisible(!1))),void this.Ky.forEach((t=>t.setVisible(!1)));this.WT(t,this.NT===e.FunnelLabelSide.Left?-1:1,-1,s,r);for(let t=0;tthis.chart.ls.xs())),this._y=()=>{this.wy=void 0},this.index=t,this.chart=s,this.scale=r,this.Ji=n,this.dT=e.oc(r,cn.Simple).us(this.getHighlight()),this.ds(this.dT),this.Ke=i.Or(r).us(this.getHighlight()),this.ds(this.Ke,{isText:!0})}setValue(t){return this.chart.getAnimationsEnabled()?this.getVisible()&&this.Fy(this.vy,t):this.vy=t,this.M=t,this.chart.ls.xs(),this}getValue(){return this.M}setVisible(t){return!1===t?this.chart.getAnimationsEnabled()&&this.vy>0?(this.wy&&(this.wy.finish(!1),this.wy=void 0),this.Fy(this.vy,0,(()=>super.setVisible(!1)))):(this.vy=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.wy&&(this.wy.finish(!1),this.wy=void 0),super.setVisible(!0),this.Fy(this.vy,this.M)):(this.vy=this.M,super.setVisible(!0)),this}Fy(t,e,i){this.wy=this.by(300,W.ease)([[t,e]],(([t])=>{this.vy=t,this.chart.ls.xs()})),this.wy.onEveryAnimationEnd(this._y),i&&this.wy.onAnimationEnd(i)}setStyle(t,e,i,s){this.LT=t,this.my=i,this.dT.Ie(this.LT).Fe(e),this.Ke.Ie(this.my).jh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},rd=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=sd(i,r.x),s=sd(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},y={x:0,y:n.bottom},m=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:y.x-x*o,y:y.y-o}),S=(i+c/u*(s-i))/2,g={x:a-S,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-A:A}`,10)},y={x:a+S,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-A:A}`,10)},f.x>=d.x&&y.x>=g.x&&p.dT._l([g,d,f,y])}};class nd extends na{constructor(t,i,s,r,n,o,h){super(t,i,s,i.wp("pyramidChart bg",0),r,i.ls.Ki.pyramidChartBackgroundFillStyle,i.ls.Ki.pyramidChartBackgroundStrokeStyle,i.ls.Ki.pyramidChartTitleFont,i.ls.Ki.pyramidChartTitleFillStyle,o),this.Iy=[],this.Py=ka.None,this.Dy=this.Ki.pyramidChartSliceFillStylePalette,this.By=this.Ki.pyramidChartSliceStrokeStyle,this.Ly=!0,this.Ry=this.Ki.pyramidChartSliceLabelFont,this.Ey=this.Ki.pyramidChartSliceLabelFillStyle,this.zy=0,this.RT=0,this.ET=80,this.zT=0,this.VT=e.PyramidSliceModes.VariableHeight,this.Ny=!0,this.Wy=t=>{const e=this.Iy.indexOf(t);e>=0&&(this.Iy.splice(e,1),this.Uy())},this.ls.Xn(dh.Af),this.Gy=this.Ki.effectsText,this.Yy=i.Hy("pyramidChart bottom",0),this.$y=i.Hy("pyramidChart top",1),this.mh.gr("Pyramid Chart");const a=i.Xy(),l=Pt(h?h.cursorBuilder:void 0,wa);this.jy=la(this,a,l.gy(a,this.uiScale,this.uiScale,kt,this.Ki),void 0,"show-pointed",od,(()=>0)),this._p(n,this.pg),this.setAnimationsEnabled(!1!==(null==h?void 0:h.animationsEnabled))}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=wa){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}addSlice(t,e){const i=new id(this.zy,this.Yy,this.$y,this,this.pg,this.Wy,this.Ki,this.ls.ss);return this.zy+=1,i.setName(t),i.setValue(e),i.ss.hs.Ss(this.Gy),i.ss.rs.Ss(this.Ny),this.Iy.push(i),this.ls.xs(),i.onMouseMove((()=>{this.getCursorMode()&&this.ls.xs()})),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.Ss(t))),this.ls.xs(),this}getSliceEffect(){return this.Ny}setSliceSorter(t){return this.Py=t,this.Iy=this.Iy.sort(this.Py),this.ls.xs(),this}getSliceSorter(){return this.Py}setLabelFillStyle(t){return this.Ey="function"==typeof t?t(this.Ey):t,this.ls.xs(),this}getLabelFillStyle(){return this.Ey}setLabelFont(t){return this.Ry="function"==typeof t?t(this.Ry):t,this.ls.xs(),this}getLabelFont(){return this.Ry}setLabelEffect(t){return this.Gy=t,this.Iy.forEach((e=>e.ss.hs.Ss(t))),this.ls.xs(),this}getLabelEffect(){return this.Gy}setLabelFormatter(t){return this.Qy=t,this.ls.xs(),this}getLabelFormatter(){return this.Qy}setSliceHighlightOnHover(t){return this.Ly=t,this.Iy.forEach((e=>e.setHighlightOnHover(t))),this}De(t){super.De(t),oa.Bp(this.mh,this.Cp),super.Mp();const e=oa.Dp(this.mh,this.Cp),i=u(this.pg.x.getInnerInterval()-(this.wa.left+this.wa.right),this.pg.y.getInnerInterval()-(this.wa.bottom+this.wa.top+e)),s=u(this.wa.left+i.x/2,this.wa.bottom+i.y/2);this.Iy=this.Iy.sort(this.Py);for(let t=0,{length:e}=this.Iy;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;t{const s=o[r.indexOf(t)]||0,n=this.ls.Vo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.ls.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.ls.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.Jy(r,o,s,i)}Zy(t,e){t.setStyle(this.$d?new U({color:this.$d.getColors(t.getAnimatedValue())}):this.Dy(e,t),this.By,this.Ey,this.Ry)}Uy(){this.Iy=this.Iy.sort(this.Py),this.ls.xs()}if(){return this.Iy}dispose(){return this.Iy.slice().forEach((t=>t.dispose())),this.jy.Y(),this.Yy.Y(),this.$y.Y(),super.dispose()}}const od=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],hd=(t,i,s)=>{const r=t.wl();if(r.length>0){let t;const n=(r[1].y-r[0].y)/2+r[0].y;return t=i===e.PyramidLabelSide.Left?(r[0].x-r[1].x)/2+r[1].x-s:(r[2].x-(4===r.length?r[3].x:r[1].x))/2+(4===r.length?r[3].x:r[1].x)+s,{x:t,y:n}}},ad=t=>{const e=t.wl();if(e.length>0)return{x:(e[2].x-e[1].x)/2+e[1].x,y:(e[1].y-e[0].y)/2+e[0].y}};class ld extends nd{constructor(){super(...arguments),this.Qy=Ia.NamePlusValue,this.OT=10,this.NT=e.PyramidLabelSide.Left,this.GT=e.SliceLabelIndices.LabelsOnSides,this.Ky=[],this.sm=this.Ki.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.sm=t;for(let t=0;tt.Ke.setVisible(!1))),void this.Ky.forEach((t=>t.setVisible(!1)));this.WT(t,this.NT===e.PyramidLabelSide.Left?-1:1,-1,s,r);for(let t=0;t(t.alignmentX=(r+Math.PI/2)%(2*Math.PI)<=Math.PI?-1:1,t.alignmentY=r%(2*Math.PI)<=Math.PI?-1:1,t.paddingX=Math.cos(r)*n,t.paddingY=Math.sin(r)*n,t),gd=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var yd;e.SpiderWebMode=void 0,(yd=e.SpiderWebMode||(e.SpiderWebMode={}))[yd.Normal=0]="Normal",yd[yd.Circle=1]="Circle";class md{constructor(t,e,i,s,n,o,h,a){this.R=new r.Eventer,this.YT=t,this.Nr=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.HT=h,this.$T=a,this.XT=this.YT.Ne(this.scale).setMouseInteractions(!1),this.jT=this.Nr.Or(this.scale).gr(this.tag).setMouseInteractions(!1),this.ZT=this.HT(this,this.YT.rm(this.scale,void 0,[Oa.InternalUI])).Oe(this.chart.getNibStyle()),this.$T.fs([this.jT])}Jy(t,i,s,r,n,o,h){const a=i.length,l=i[s>0?s-1:a-1],c=i[s],d=i[s{const n=s/i,o=[];for(let h=-s/2;h<=s/2;h+=r){const r=n*(h/s)+e,a=u(t.x+Math.cos(r)*i,t.y+Math.sin(r)*i);o.push(a)}return o})(t,r,n,f)),h?this.jT.setVisible(!0).Be(ui(c,u(h.paddingX,h.paddingY))).Na(h.alignmentX).Wa(h.alignmentY):this.jT.setVisible(!1)}getLabelSize(){return this.jT.jh(this.chart.getAxisLabelFont()).Ie(this.chart.getAxisLabelStyle()).Ls().oi()}dispose(){this.XT&&this.XT.dispose(),this.jT&&this.jT.dispose(),this.ZT&&this.ZT.dispose()}}class pd extends jl{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this._s="Spider Series",this.bu=new Map,this.Hi=e.HighlightModes.onHover,this.Kb=8,this.ba=0,this.QT=(()=>{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)||W.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)}})(),this.JT={},this.KT={},this.xy=this.getVisible(),this.qT=1,this.tF=((t,e)=>{const i=K((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||W.ease,u=(null==a?void 0:a.durationMs)||1e3;s&&(s.finish(!1),s=void 0),!1===o?h&&n?(s=i(u,l)([[n,0]],(([e])=>{n=e,t(n)})),s.onAnimationEnd((()=>{s=void 0,e(!1)}))):(n=0,e(!1)):h?(e(!0),s=i(u,l)([[n,1]],(([e])=>{n=e,t(n)})),s.onAnimationEnd((()=>{s=void 0}))):(n=1,e(!0))}})((t=>{this.qT=t,this.Is.ls.xs()}),(t=>{super.setVisible(t)})),this.chart=t,this.Is=i,this.qb=r,this.iF=n,this._x=o,this.sF=h,this.eF=a,this.scale=s,this.hF=ye(u.spiderSeriesFillStyle,c),this.rF=ye(u.spiderSeriesStrokeStyle,c),this.nF=ye(u.spiderSeriesPointFillStyle,c)}Qi(t,e){const i=this.eF(e);if(void 0!==i&&this.bu.has(i.tag)){const t=this.bu.get(i.tag),e=this.sF(i.tag,t);return{cursorPosition:{pointMarker:e,pointMarkerScale:this.scale,resultTable:e,resultTableScale:this.scale},series:this,axis:i.tag,value:t}}}rv(){return this.av&&this.bu.size>0&&this.getVisible()}addPoints(...t){this.bu.size>0&&this.chart.ls.Xn(dh.Cf),t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.QT(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.bu.set(s,r+t*(e-r)),this.Is.ls.xs()}))}),{easing:this.JT.easing,durationMs:this.JT.durationMs,onStart:()=>{i=new Map(this.bu)}})}else for(let e=0;e=3&&(this.dT||(this.dT=this.Is.oc(this.scale,cn.Simple).Fe(this.rF).Ie(this.hF).us(this.getHighlight()),this.ds(this.dT)),this.dT._l(t),this.tM||(this.tM=this.Is.Pv(this.scale).it(this.Kb).ol(this.qb).Zh(this.ba).Ie(this.nF).us(this.getHighlight()),this.ds(this.tM)),this.tM.Ot().dl(t))}}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.hF,stroke:this.rF})}Fs(){return this.Ms||this.qb}oF(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},Ad=t=>Je(t.jT.Je()),Sd=t=>Je(t.Je()),vd=(t,i,s,r)=>t.fu(0).Be(s).lu(90).Ge(-270).Au(i===e.SpiderWebMode.Circle?void 0:r.length),bd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Md={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},wd=()=>{Md.alignmentX=0,Md.alignmentY=0,Md.paddingX=0,Md.paddingY=0};class Cd extends cl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.wp("spiderChart bg",0),r,i.ls.Ki.spiderChartBackgroundFillStyle,i.ls.Ki.spiderChartBackgroundStrokeStyle,i.ls.Ki.spiderChartTitleFont,i.ls.Ki.spiderChartTitleFillStyle,h),this.wa=x(20,20,20,20),this.axisScale=lt.d1({scale1DConstructor:Li,dimension:"x"}).q(0,1),this._x=[],this.aF=[],this.lF=[],this.uF=Os.expansion,this.cF=!0,this.dF=gd,this.fF=fd,this.No=!0,this.AF=e.SpiderWebMode.Normal,this.gF=4,this.pF=this.Ki.spiderChartWebStyle,this.yF=this.Ki.spiderChartScaleLabelFillStyle,this.mF=this.Ki.spiderChartScaleLabelFont,this.vF=5,this.SF=this.Ki.spiderChartAxisLabelFillStyle,this.xF=this.Ki.spiderChartAxisLabelFont,this.bF=5,this.MF=this.Ki.spiderChartAxisStrokeStyle,this._F=this.Ki.spiderChartAxisNibStrokeStyle,this.zf=10,this.wF=x(),this.hasAxis=t=>this._x.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.Di(t,Di.Numeric),this.CF=()=>{const t=this._x.map(Ad).concat(this.lF.map(Sd));return Ze(t)},this.kF=()=>this.TF.hd(this.pg).setMouseInteractions(!1),this.FF=t=>t.dispose(),this.IF=()=>this.TA.Or(this.pg).setMouseInteractions(!1),this.PF=t=>t.dispose(),this.DF=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.BF=(t,e)=>{let i,s;const r=()=>{void 0!==this.LF&&this.LF.finish(),i=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.uF,this.uF=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this._x.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=xd(a,this._x.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=ai(ci(t.XT.Ii(),t.XT.Ti())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.q(i.min,l),Qt(o),this.ls.xs()}},o=()=>{if(i=void 0,void 0!==s)if(this.ah){const t=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.RF(),i=s;if(void 0!==e){const s=i.start(t.min,t.max,e.min,e.max),r=i.end(t.min,t.max,e.min,e.max);this.LF=this.op.ls.un(300,W.ease)([[0,1]],(([e])=>{this.axisScale.q(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.LF.onAnimationEnd((()=>{this.LF=void 0,this.uF=i}))}else this.uF=s}else this.uF=s;s=void 0};e.setMouseEnterEventHandler(this.EF).setMouseLeaveEventHandler(this.zF).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=ji(new $i(((t,e,i)=>{this.EF(t),r(),Qt(i)}),n,((t,e,i,s)=>{this.zF(t),o(),Qt(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.VF=t=>{this.cF&&!this.hasAxis(t)&&this.addAxis(t)},this.sF=(t,e)=>{for(const i of this._x)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return Qe(i.XT.Ii(),i.XT.Ti(),t)}},this.eF=t=>{if(0===this._x.length)return;const e=ci(this.translateCoordinate(t,this.coordsRelative),this._x[0].XT.Ii()),i=Math.atan2(e.y,e.x);let s,r=Be;for(const t of this._x){const e=ci(t.XT.Ti(),t.XT.Ii()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.No&&(t.Oe(this._F),this.ls.xs())},this.zF=t=>{t.Oe(this._F),this.ls.xs()},this.ls.Xn(dh.pf),this.Ik=i.Mx("spiderChart series bg",0),this.TF=i.Hy("spiderChart web shapes",0),this.OF=i.Hy("spiderChart axis bg",1),this.Kx=i.Hy("spiderChart plotting",2),this.TA=i.Hy("spiderChart fg",3),this.$T=this.ss.wg().Ss(this.Ki.effectsText),this.mh.gr("Spider Chart"),this.zv=this.Ik.hd(this.pg).Ie(this.Ki.spiderChartSeriesBackgroundFillStyle).Fe(nt).lu(90).Ge(-270).fu(0),this.Vv=this.Ik.hd(this.pg).Ie(B).Fe(this.Ki.spiderChartSeriesBackgroundStrokeStyle).lu(90).Ge(-270).fu(0),super.Ev(this.zv,this.Vv);const a=i.Xy(),l=Pt(o?o.cursorBuilder:void 0,ba);this.jy=la(this,a,l.gy(a,this.uiScale,this.uiScale,kt,this.Ki),this,"show-pointed",Td,(()=>0)),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this._p(n,this.pg)}getSeries(){return this.Dv}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=ba){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new md(this.OF,this.TA,this.pg,this,t,this.axisScale,this.BF,this.$T);this._x.push(e)}}else t&&this._x.push(t);return this.$T.fs(this._x.map((t=>t.jT))),this.ls.xs(),this}addSeries(t){const i=void 0!==(null==t?void 0:t.pointShape)?t.pointShape:e.PointShape.Circle,s=void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,r=new pd(this,this.Kx,this.pg,i,this.VF,this._x,this.sF,this.eF,this.Lv,this.Ki,s,this.ls.ss);return this.Ov(r),r}getSeriesCount(){return this.Dv.length}setWebMode(t){return this.AF=t,this.ls.xs(),this}getWebMode(){return this.AF}setWebCount(t){return this.gF=t,this.ls.xs(),this}getWebCount(){return this.gF}setWebStyle(t){return this.pF="function"==typeof t?t(this.pF):t,this.ls.xs(),this}getWebStyle(){return this.pF}setScaleLabelStyle(t){return this.yF="function"==typeof t?t(this.yF):t,this.ls.xs(),this}getScaleLabelStyle(){return this.yF}setScaleLabelFont(t){return this.mF="function"==typeof t?t(this.mF):t,this.ls.xs(),this}getScaleLabelFont(){return this.mF}setScaleLabelPadding(t){return this.vF=t,this.ls.xs(),this}getScaleLabelPadding(){return this.vF}setScaleLabelStrategy(t){return this.dF=t,this.ls.xs(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.ls.xs(),this}setAxisLabelStyle(t){return this.SF="function"==typeof t?t(this.SF):t,this.ls.xs(),this}getAxisLabelStyle(){return this.SF}setAxisLabelFont(t){return this.xF="function"==typeof t?t(this.xF):t,this.ls.xs(),this}getAxisLabelFont(){return this.xF}setAxisLabelEffect(t){return this.$T.Ss(t),this.ls.xs(),this}getAxisLabelEffect(){return this.$T.bs()}setAxisLabelPadding(t){return this.bF=t,this.ls.xs(),this}getAxisLabelPadding(){return this.bF}setAxisLabelStrategy(t){return this.fF=t,this.ls.xs(),this}setAxisStyle(t){return this.MF="function"==typeof t?t(this.MF):t,this.ls.xs(),this}getAxisStyle(){return this.MF}setNibStyle(t){return this._F="function"==typeof t?t(this._F):t,this.ls.xs(),this}getNibStyle(){return this._F}setNibLength(t){return this.zf=t,this.ls.xs(),this}getNibLength(){return this.zf}setAutoAxis(t){return this.cF=t,this}getAutoAxis(){return this.cF}setMouseInteractions(t){return this.No=t,this}getMouseInteractions(){return this.No}setAxisScrollStrategy(t){return this.uF=t,this.ls.xs(),this}getAxisScrollStrategy(){return this.uF}setAxisInterval(t,e=0){return this.axisScale.q(e,t),this.ls.xs(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}De(t){super.De(t),oa.Bp(this.mh,this.Cp);const e=this._x.length,i=oa.Dp(this.mh,this.Cp),s=u(this.pg.x.getInnerInterval()-(this.wa.left+this.wa.right),this.pg.y.getInnerInterval()-(this.wa.bottom+this.wa.top+i)),r=((t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}))(0,0,0,0);if(void 0!==this.fF){const t=Math.min(s.x,s.y)/2;for(let i=0;i0?r.right=Math.max(r.right,l.x+.5*(1-a.alignmentX)*h.x-t):r.left=Math.max(r.left,-l.x+.5*(a.alignmentX+1)*h.x-t),o>0?r.top=Math.max(r.top,l.y+.5*(1-a.alignmentY)*h.y-t):r.bottom=Math.max(r.bottom,-l.y+.5*(a.alignmentY+1)*h.y-t)}}if(this.uF){const t=this.RF();if(void 0!==t){const e=this.uF.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.uF.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.q(e,i)}}const n=u(this.pg.x.getInnerStart()+(r.left+this.pg.x.getInnerInterval()-r.right)/2,this.pg.y.getInnerStart()+(r.bottom+this.pg.y.getInnerInterval()-r.top)/2),o=Math.min(s.x/2-(r.left+r.right)/2,s.y/2-(r.bottom+r.top)/2);this.wF=x(this.Xt.left+this.wa.left+r.left,this.Xt.top+this.wa.top+i+r.top,this.Xt.right+this.wa.right+r.right,this.Xt.bottom+this.wa.bottom+r.bottom),this.Jy(n,o);for(const t of this.Dv)t.yv();for(const t of this.Dv)t.De();super.Mp(),this.jy.De(!1,this.Dv,void 0);for(const t of this.Dv)t.bm()}dispose(){return this.Ik.Y(),this.TF.Y(),this.OF.Y(),this.Kx.Y(),this.TA.Y(),this.jy.Y(),super.dispose()}getMinimumSize(){return u(this.wF.left+this.wF.right+100,this.wF.bottom+this.wF.top+100)}Jy(t,e){const i=this._x.length,s=[];for(let r=0;r{const a=t.length,l=n.length,u=e>0&&l>1;for(let l=0;l=a&&t.push(o());const h=t[l];vd(h,i,s,n);const u=r*((l+1)/e);h.uu(u)}else l{const c=r.length,d=t.length;let f=0;if(void 0!==e)for(let a=0;a=d&&t.push(h());const e=t[f];f+=1;const s=(i-r)/i,c=Qe(n,o[a],s);e.Be(ui(c,u(m.paddingX,m.paddingY))).Na(m.alignmentX).Wa(m.alignmentY).gr(l(s))}}}for(let e=f;e1;for(const s of this._x)for(const r of this.Dv){const n=r.getValue(s.tag,i);void 0!==n&&(t=void 0===t?n:Math.min(t,n),e=void 0===e?n:Math.max(e,n))}if(void 0!==t&&void 0!==e)return y(t,e)}}const Td=(t,e,i)=>aa(e,[[e.series],[e.axis],[{text:t.formatValue(e.value),font:{weight:"bold"}}]]),Rd=(t,e)=>{const i=Math.floor(99999/e),s=Math.floor(99999/e),r=Math.floor(99998/e),n=Math.floor(99998/e),o=Math.floor(99999/(e+1)),h=Math.floor(89999/(e+1)),a=510001+e*h;let l=0;return{NF:()=>{const e=t.GF("dashboard ui",a+l);return l+=1,e},WF:()=>t.GF("dashboard legend",51e4),UF:e=>{const a=1+e*i,l=100001+e*s,u=200002+e*r,c=300002+e*n,d=400001+e*o,f=510001+e*h;let g=0;return{ls:t,wp:(e,i)=>{const s=a+i;return t.GF(e,s)},Mx:(e,i)=>{const s=l+i;return t.GF(e,s)},Dk:(e,i)=>{const s=u+i;return t.GF(e,s)},Hy:(e,i)=>{const s=c+i;return t.GF(e,s)},bx:(e,i,s)=>{const r=c+i;return t.YF(e,r,s)},Tp:(e,i)=>{const s=d+i;return t.GF(e,s)},Ap:e=>{const i=f+g,s=t.GF(e,i);return g+=1,s},pp:()=>t.GF("panel legend",500002+e),Xy:()=>t.GF("panel cursor",600001+e)}}}};class Ed{constructor(t){this.R=new r.Eventer,this.M=t}_(t){return this.M=t,this.R.emit("set",t),this}C(){return this.M}G(t){return this.R.on("set",t)}U(t){return this.R.off(t,"set")}}const kd={lh:!1,uh:0,dh:!1,Ah:0,fh:!1,gh:0,ph:0,hh:Os.fitting},Id=t=>{if(!t||"object"!=typeof t||null===t)return!1;const e=t.type;return!(!e||!["spark-line","spark-bar","spark-win-loss","spark-area","spark-pie"].includes(e))},Fd=(t,e,i,s,r,n,o,h)=>{const{type:a,data:l}=t;if(0===l.length)return;const u=[s,r];"spark-line"===a&&Od(t,e,u,n,o,h),"spark-bar"===a&&Ud({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&Ud({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&Yd(t,e,u,n,o,h),"spark-pie"===a&&Gd(t,e,u,n,o,h)},Dd=(t,e,i,s)=>({x:Ld(t.x,e.x,i.x,s),y:Vd(t.y,e.y,i.y,s)}),Pd=(t,e,i,s)=>({position:Ld(t.position,e.x,i.x,s),high:Vd(t.high,e.y,i.y,s),low:Vd(t.low,e.y,i.y,s)}),Ld=(t,e,i,s)=>{const r=Ft(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},Vd=(t,e,i,s)=>{const r=Ft(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},_d=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&Bd(a,e,i,r,n,o,h),"axis-band"===a.type&&zd(a,i,r,n,o,h),"constant-line"===a.type&&Nd(a,i,s,r,n,o,h)},Bd=(t,i,s,r,n,o,h)=>{const{value:a,fillStyle:l,shape:u,size:c,rotation:d}=t;let f={x:NaN,y:NaN};if("start"===a&&(f=i[0]),"end"===a&&(f=i[i.length-1]),"min"===a){f=i[0];for(const t of i)f=f.yt.y?f:t}("object"!=typeof a||(f=Dd(a,s,r,n),((t,e)=>{const i=e[0],s=e[1],r=t.x,n=t.y;return i.x<=r&&r<=i.x+s.x&&i.y<=n&&n<=i.y+s.y})(f,n)))&&o.pointSet.add().Ot().ol(void 0!==u?u:e.PointShape.Circle).Zh(d||0).it(c||5).Ie(l||h.sparkPointChartFillStyle).dl(f)},zd=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(ze,Be),f=u(ze,Be);"x"===o&&(d=Dd({x:h,y:ze},e,i,s),f=Dd({x:a,y:Be},e,i,s)),"y"===o&&(d=Dd({x:ze,y:h},e,i,s),f=Dd({x:Be,y:a},e,i,s));const g=s[0],y=s[1],m=Ft(d.x,g.x,g.x+y.x),p=Ft(d.y,g.y,g.y+y.y),x=Ft(f.x,g.x,g.x+y.x),A=Ft(f.y,g.y,g.y+y.y);r.rect.add().ml(m).vl(p).it(u(x-m,A-p)).Ie(l||n.sparkChartBandFillStyle).Fe(c||n.sparkChartBandStrokeStyle).Fe(nt)},Nd=(t,e,i,s,r,n,o)=>{const{axis:h,value:a,strokeStyle:l}=t,c=a||0,d=e.y,f=i.y,g=e.x,y=i.x,m=[];if("y"===h&&d<=c&&c<=f){const t=Dd(u(g,c),{x:g,y:d},s,r),e=Dd(u(y,c),{x:g,y:d},s,r);m.push([t,e])}if("x"===h&&g<=c&&c<=y){const t=Dd(u(c,d),{x:g,y:d},s,r),e=Dd(u(c,f),{x:g,y:d},s,r);m.push([t,e])}m.length>0&&n.line.add().Oe(l||o.sparkChartConstantLineStrokeStyle).We(m[0][0]).Ge(m[0][1])},Od=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.Kn&&wt.console.warn("LightningChart JS warning: SparkLineChart has over 10000 data points. This feature is not designed for large data sets which might show as performance drop. If you want to request improvements to this, contact https://lightningchart.com/js-charts/docs/contact. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let u=Be,c=ze,d=Be,f=ze;for(let t=0;tDd(t,{x:u,y:d},g,i)));e.lineSet.add().us(n).Oe(o||s.sparkLineChartStrokeStyle).Ot().dl(y),a&&_d(a,y,{x:u,y:d},{x:c,y:f},g,i,e,s)},Ud=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,threshold:l,winFillStyle:u,lossFillStyle:c}=t,d=t.barSize||1,f=t.gap||1,g=t.winLoss,y=l||0,m=f/d*1;let p=Be,x=ze;if(g)p=-1,x=1;else for(const t of o)p=Math.min(p,t),x=Math.max(x,t);const A={x:0,y:g?-1:Math.min(0,p)},S={x:1*o.length+(o.length-1)*m,y:g?2:Math.max(x,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*m,y:g?t>=y?1:0:t},r=Dd({x:1*e+e*m,y:g?t>=y?0:-1:0},A,S,i),n=Dd(s,A,S,i);return{value:t,position:r,width:n.x-r.x,height:n.y-r.y}})).forEach((t=>{var i;e.rect.add().us(n).Be(t.position).xl(t.height).Sl(t.width).Ie((i=t.value,g?(i>=y?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).Fe(a||s.sparkBarChartStrokeStyle)}))},Yd=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.Kn&&wt.console.warn("LightningChart JS warning: SparkAreaChart has over 10000 data points. This feature is not designed for large data sets which might show as performance drop. If you want to request improvements to this, contact https://lightningchart.com/js-charts/docs/contact. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let c=Be,f=ze,g=Be,y=ze;for(let t=0;t{const{data:o,strokeStyle:h}=t,a=o.map((t=>"number"==typeof t?t:t.value)),l=o.map((t=>"object"==typeof t?t.fillStyle:void 0)),c=a.reduce(((t,e)=>t+e),0),d=Dd(u(50,50),{x:0,y:0},{x:100,y:100},i),f=i[1],g=f.x<=f.y?f.x/2:f.y/2;let y=90;a.forEach(((t,i)=>{const r=t/c*360;e.arc.add().us(n).Be(d).uu(g).fu(0).lu(y).Ge(y+r).Ie(l[i]||ye(s.sparkPieChartFillStyle,i)).Fe(h||s.sparkPieChartStrokeStyle),y+=r}))};var Xd,Zd,Hd;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(Xd||(Xd={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(Zd||(Zd={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(Hd||(Hd={}));class Wd extends pn{constructor(t,e,i,s,r){super(),this.Rs=!1,this.t_={x:0,y:0,height:20,width:20},this.HF={x:10,y:10},this.Is=t,this.$F=r,this.XF=new Ao(t,e,i,kt,s).setMouseInteractions(!0),this.jF=t.oc(e,cn.Simple).Ie(s.dataGridScrollBarButtonArrowFillStyle).Fe(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.ku(this),this.XF.onMouseEnter((t=>t.setHighlight(1))),this.XF.onMouseLeave((t=>t.setHighlight(0)))}ZF(){switch(this.$F){case Hd.Up:this.jF._l([{x:this.t_.x,y:this.t_.y+this.HF.y/2},{x:this.t_.x+this.HF.x/2,y:this.t_.y-this.HF.y/2},{x:this.t_.x-this.HF.x/2,y:this.t_.y-this.HF.y/2}]);break;case Hd.Down:this.jF._l([{x:this.t_.x-this.HF.x/2,y:this.t_.y+this.HF.y/2},{x:this.t_.x+this.HF.x/2,y:this.t_.y+this.HF.y/2},{x:this.t_.x,y:this.t_.y-this.HF.y/2}]);break;case Hd.Left:this.jF._l([{x:this.t_.x-this.HF.x/2,y:this.t_.y},{x:this.t_.x+this.HF.x/2,y:this.t_.y+this.HF.y/2},{x:this.t_.x+this.HF.x/2,y:this.t_.y-this.HF.y/2}]);break;case Hd.Right:this.jF._l([{x:this.t_.x-this.HF.x/2,y:this.t_.y+this.HF.y/2},{x:this.t_.x+this.HF.x/2,y:this.t_.y},{x:this.t_.x-this.HF.x/2,y:this.t_.y-this.HF.y/2}])}}Be(t){return this.t_.x=t.x,this.t_.y=t.y,this}za(){return u(this.t_.x,this.t_.y)}it(t){return this.t_.height=t.x,this.t_.width=t.y,this}oi(){return{x:this.t_.height,y:this.t_.width}}onMouseDown(t){return this.XF.onMouseDown(t)}onMouseUp(t){return this.XF.onMouseUp(t)}setFillStyle(t){return this.XF.setFillStyle(t),this}getFillStyle(){return this.XF.getFillStyle()}setStrokeStyle(t){return this.XF.setStrokeStyle(t),this}getStrokeStyle(){return this.XF.getStrokeStyle()}De(){return this.XF.De(),this.ZF(),this}Ls(){return this.XF.setSize(u(this.t_.height,this.t_.width)).setPosition(u(this.t_.x,this.t_.y)),this}setVisible(t){return this.XF.setVisible(t),this.jF.setVisible(t),this}dispose(){return this.XF.dispose(),this.jF.dispose(),this}setMouseInteractions(t){return this.XF.setMouseInteractions(t),this}getMouseInteractions(){return this.XF.getMouseInteractions()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}getHighlight(){return this.XF.getHighlight()}setHighlight(t){return this.XF.setHighlight(be(t)),this.R.emit("highlight",this,Boolean(t)),this.Is.xs(),this}}const jd=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class Kd{constructor(t,i,s,n,o,h,a){this.rd={x:0,y:0},this.t_={x:0,y:0,height:0,width:0},this.R=new r.Eventer,this.QF={min:u(0,0),max:u(0,0)},this.JF=!1,this.KF=!1,this.qF={x:0,y:0},this.Fu=void 0,this.tI=u(0,0),this.iI={x:0,y:0},this.sI=0,this.eI=15,this.hI=(t,i)=>{this.JF=!0,this.TA.xs();const s=this.rI.getDraggingMode();this.Fu=this.TA.ls.Qr(s===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:s===e.UIDraggingModes.draggable?e.MouseStyles.Move:s===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical),this.nI&&clearInterval(this.nI)},this.oI=()=>{this.JF=!1,this.TA.xs(),this.TA.ls.Jr(this.Fu)},this.aI=t=>(this.KF=!0,this.qF=ct(this.TA.ls.Re(t.x,t.y),this.TA.ls.At,this.scale),!0),this.lI=(t,e)=>(this.uI(e),this.nI=setInterval((()=>this.uI(e)),300),!0),this.cI=()=>(clearInterval(this.nI),!0),this.dI=(t,i)=>{const s=this.rI.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=ct(this.TA.ls.Re(t.x,t.y),this.TA.ls.At,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?jd(n.x,this.scale.x):this.t_.x,r!==e.UIDraggingModes.onlyHorizontal?jd(n.y,this.scale.y):this.t_.y),h=u(o.x-this.qF.x,o.y-this.qF.y),a=u(this.rI.getPosition().x+h.x,this.rI.getPosition().y+h.y),l=this.fI(a),c={x:Math.abs(this.tI.x-l.x),y:Math.abs(this.tI.y-l.y)};return this.AI(c),this.iI.y>h.y&&(this.qF=n),this.De(),!0}return!1},this.gI=(t,e)=>{this.KF=!1,Qt(e),this.TA.xs()},this.TA=t,this.op=i,this.scale=n,this.contentScale=o,this.pI=a,this.yI=new Wd(t,s,n,h,a===Xd.UpToDown?Hd.Up:Hd.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.mI=new Wd(t,s,n,h,a===Xd.UpToDown?Hd.Down:Hd.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.rI=new Ao(t,s,n,kt,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===Xd.UpToDown?e.UIDraggingModes.onlyVertical:a===Xd.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.vI=new Ao(i,s,n,kt,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.rI.onMouseEnter(this.hI),this.rI.onMouseLeave(this.oI),this.rI.onMouseDragStart(((t,e)=>this.aI(u(e.clientX,e.clientY))&&Qt(e))),this.rI.onMouseDrag(((t,e)=>this.dI(u(e.clientX,e.clientY))&&Qt(e))),this.rI.onMouseDragStop(this.gI),this.rI.onTouchStart(((t,e)=>this.aI(u(e.clientX,e.clientY))&&Qt(e))),this.rI.onTouchMove(((t,e)=>this.dI(u(e.clientX,e.clientY))&&Qt(e))),this.rI.onTouchEnd(this.gI),this.yI.onMouseDown(((t,e)=>this.lI(t,e)&&Qt(e))),this.mI.onMouseDown(((t,e)=>this.lI(t,e)&&Qt(e))),this.yI.onMouseUp(((t,e)=>this.cI()&&Qt(e))),this.mI.onMouseUp(((t,e)=>this.cI()&&Qt(e))),this.vI.onMouseWheel(((t,e)=>this.SI(e))),this.rI.onMouseWheel(((t,e)=>this.SI(e))),this.vI.onMouseDown(((t,e)=>this.lI(t,e)&&Qt(e))),this.vI.onMouseUp(((t,e)=>this.cI()&&Qt(e)))}xI(t){return this.t_=t,this}Sl(t){return this.t_.width=t,this}bI(){return this.t_.width}MI(t){return this.tI=t,this}_I(t){return this.rd=t,this}wI(){return this.rd}CI(t){return this.eI=t,this}kI(){return this.pI}TI(t){let e;switch(this.pI){case Xd.UpToDown:return e=t>0?Math.min(this.tI.y-this.QF.max.y,this.iI.y+t):Math.max(0,this.iI.y+t),e!==this.iI.y&&(this.AI({x:0,y:e}),this.De(),!0);case Xd.LeftToRight:return e=Math.min(this.QF.max.x-this.tI.x,this.iI.x+t),e!==this.iI.x&&(this.AI({y:0,x:e}),this.De(),!0);default:return!1}}FI(t){let e;switch(this.pI){case Xd.UpToDown:return e=Math.max(0,this.iI.y-t),e!==this.iI.y&&(this.AI({x:0,y:e}),this.De(),!0);case Xd.LeftToRight:return e=t>0?Math.max(0,this.iI.x-t):Math.min(this.QF.max.x-this.tI.x,this.iI.x-t),e!==this.iI.x&&(this.AI({x:e,y:0}),this.De(),!0);default:return!0}}II(t){switch(this.pI){case Xd.UpToDown:return this.R.on("scrollY",t);case Xd.LeftToRight:return this.R.on("scrollX",t)}return this.R.on("scrollY",t)}fI(t){switch(this.pI){case Xd.UpToDown:if(t.y>this.QF.min.y)return u(t.x,this.QF.min.y);if(t.ythis.QF.max.x)return u(this.QF.max.x,t.y)}return t}SI(t){t.deltaY>0&&this.DI()&&Qt(t),t.deltaY<0&&this.BI()&&Qt(t)}uI(t){const e=ct(this.TA.ls.Re(t.clientX,t.clientY),this.TA.ls.At,this.scale);let i;const s=this.rI.getPosition(),r=this.rI.getSize();this.LI(e,s,r)?clearInterval(this.nI):(i=this.pI===Xd.UpToDown?u(0,e.y-s.y>0?this.eI:-this.eI):u(s.x-e.x>0?this.eI:-this.eI,0),(i.x>0||i.y>0)&&this.RI(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.EI(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}LI(t,e,i){return this.pI===Xd.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.t_.height?Math.min(this.tI.y-this.QF.max.y,this.iI.y+t):0,e!==this.iI.y&&(this.AI({x:0,y:e}),this.De(),!0)}case Xd.LeftToRight:{const e=Math.min(this.QF.max.x-this.tI.x,this.iI.x+t);return e!==this.iI.x&&(this.AI({y:0,x:e}),this.De(),!0)}default:return!1}}BI(){return this.RI(this.eI)}DI(){return this.EI(this.eI)}AI(t){if(t.x===this.iI.x&&t.y===this.iI.y)return;let e;switch(this.iI=t,this.pI){case Xd.UpToDown:e=this.iI.y*this.sI*this.contentScale.Wi().y,this.R.emit("scrollY",Zd.Vertical,e),this.TA.ls.xs();break;case Xd.LeftToRight:e=this.iI.x*this.sI*this.contentScale.Wi().x,this.R.emit("scrollX",Zd.Horizontal,e)}}setVisible(t){return this.yI.setVisible(t),this.mI.setVisible(t),this.vI.setVisible(t),this.rI.setVisible(t),this}dispose(){return this.yI.dispose(),this.mI.dispose(),this.vI.dispose(),this.rI.dispose(),this.nI&&clearInterval(this.nI),this}Ls(){switch(this.VI(),this.OI(),this.pI){case Xd.UpToDown:this.yI.Be({x:this.t_.x,y:this.t_.y+this.t_.height-this.yI.oi().x/2}).it(u(this.t_.width,this.t_.width)).Ls(),this.mI.Be({x:this.t_.x,y:this.t_.y+10}).it(u(this.t_.width,this.t_.width)).Ls(),this.vI.setSize({x:this.t_.width,y:this.t_.height-2*this.yI.oi().x}).setPosition({x:this.t_.x,y:this.t_.y+this.mI.oi().y+this.vI.getSize().y/2}),this.rI.setSize(u(this.t_.width,this.NI())),this.tI={x:this.t_.x,y:this.yI.za().y-this.yI.oi().y/2-this.rI.getSize().y/2},this.zI({min:{x:this.t_.x,y:this.yI.za().y-this.yI.oi().y/2-this.rI.getSize().y/2},max:{x:this.t_.x,y:this.mI.za().y+this.mI.oi().x/2+this.rI.getSize().y/2}});break;case Xd.LeftToRight:this.yI.Be({x:this.t_.x,y:this.t_.y}).it(u(this.t_.height,this.t_.height)).Ls(),this.mI.Be({x:this.t_.x+this.t_.width-this.mI.oi().x,y:this.t_.y}).it(u(this.t_.height,this.t_.height)).Ls(),this.vI.setSize({y:this.t_.height,x:this.t_.width-2*this.yI.oi().y}).setPosition({x:this.t_.x+this.yI.oi().x/2+this.vI.getSize().x/2,y:this.t_.y}),this.rI.setSize(u(this.NI(),this.t_.height)),this.tI={x:this.yI.za().x+this.yI.oi().x/2+this.rI.getSize().x/2,y:this.t_.y},this.zI({min:{x:this.yI.za().x+this.yI.oi().x/2+this.rI.getSize().x/2,y:this.t_.y},max:{x:this.mI.za().x-this.mI.oi().x/2-this.rI.getSize().x/2,y:this.t_.y}})}return this.GI(),this}VI(){switch(this.pI){case Xd.UpToDown:this.WI()||this.setVisible(!1),this.WI()&&this.setVisible(!0);break;case Xd.LeftToRight:this.UI()||this.setVisible(!1),this.UI()&&this.setVisible(!0)}}OI(){switch(this.pI){case Xd.UpToDown:this.WI()||this.AI({x:0,y:0});break;case Xd.LeftToRight:this.UI()||this.AI({x:0,y:0})}}WI(){return this.rd.x>this.t_.height}UI(){return this.rd.y>this.t_.width}NI(){switch(this.pI){case Xd.UpToDown:return this.t_.height*(this.t_.height-2*this.yI.oi().x)/this.rd.x;case Xd.LeftToRight:return this.t_.width*(this.t_.width-2*this.yI.oi().y)/this.rd.y;default:return 0}}GI(){switch(this.pI){case Xd.UpToDown:this.sI=(this.rd.x-this.t_.height)/(this.QF.min.y-this.QF.max.y);break;case Xd.LeftToRight:this.sI=(this.rd.y-this.t_.width)/(this.QF.max.x-this.QF.min.x)}}De(){switch(this.yI.De(),this.mI.De(),this.vI.De(),this.pI){case Xd.UpToDown:this.rI.setPosition({x:this.t_.x,y:this.yI.za().y-this.yI.oi().y/2-this.rI.getSize().y/2-this.iI.y}).De();break;case Xd.LeftToRight:this.rI.setPosition({y:this.t_.y,x:this.yI.za().x+this.yI.oi().x/2+this.rI.getSize().x/2+this.iI.x}).De()}return this}}class $d{constructor(t,e,i,s,r,n,o){switch(this.TA=t,this.op=e,this.scale=s,this.contentScale=r,o){case Zd.Vertical:this.YI=this.HI(i,n,Xd.UpToDown);break;case Zd.Horizontal:this.$I=this.HI(i,n,Xd.LeftToRight);break;case Zd.Both:this.YI=this.HI(i,n,Xd.UpToDown),this.$I=this.HI(i,n,Xd.LeftToRight)}this.XI=ji(new $i(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.$I)||void 0===n?void 0:n.FI(s.x))&&Qt(r),0!==s.y&&(null===(o=this.YI)||void 0===o?void 0:o.TI(s.y))&&Qt(r)})))}HI(t,e,i){return new Kd(this.TA,this.op,t,this.scale,this.contentScale,e,i)}bI(){return 20}_I(t){var e,i;return null===(e=this.YI)||void 0===e||e._I(t),null===(i=this.$I)||void 0===i||i._I(t),this}jI(t){var e;return null===(e=this.$I)||void 0===e||e.CI(t),this}ZI(t){var e;return null===(e=this.YI)||void 0===e||e.CI(t),this}QI(t){const e=this.YI;return e&&e.SI(t),this}JI(t){return this.XI.onTouchStart(this,t),this}KI(t){return this.XI.onTouchMove(this,t),this}qI(t){return this.XI.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.$I)||void 0===e||e.II(t),null===(i=this.YI)||void 0===i||i.II(t),this}dispose(){var t,e;return null===(t=this.YI)||void 0===t||t.dispose(),null===(e=this.$I)||void 0===e||e.dispose(),this}De(){var t,e;return null===(t=this.YI)||void 0===t||t.De(),null===(e=this.$I)||void 0===e||e.De(),this}Ls(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.YI)||void 0===t||t.xI({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.$I)||void 0===e||e.xI({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.YI)||void 0===i||i.Ls(),null===(s=this.$I)||void 0===s||s.Ls(),this}}class Qd extends na{constructor(t,e,i,s,r,n){super(t,e,i,e.wp("dataGrid bg",0),s,e.ls.Ki.dataGridBackgroundFillStyle,e.ls.Ki.dataGridBackgroundStrokeStyle,e.ls.Ki.dataGridTitleFont,e.ls.Ki.dataGridTitleFillStyle,n),this.tP=[],this.iP=[],this.sP=[],this.eP=new Map,this.hP=!0,this.rP=!0,this.nP=!0,this.oP=!0,this.aP=!0,this.lP=!0,this.uP=!0,this.cP=!0,this.dP=!0,this.fP=!0,this.AP=!0,this.gP=!0,this.pP=!0,this.yP=!0,this.mP=!0,this.vP=!0,this.SP=new Set,this.xP=new Set,this.bP=!0,this.MP=!0,this._P=(t,e)=>{t.borders=void 0===e?sf:{...t.borders,...e},this.wP(t),this.gP=!0,this.ls.xs()},this.wP=t=>{t.borders&&(!1===t.borders.top&&this.CP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.kP,bottom:!1}})),!1===t.borders.bottom&&this.CP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.kP,top:!1}})),!1===t.borders.left&&this.CP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.kP,right:!1}})),!1===t.borders.right&&this.CP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.kP,left:!1}})),!0===t.borders.top&&this.CP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.kP,bottom:!0}})),!0===t.borders.bottom&&this.CP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.kP,top:!0}})),!0===t.borders.left&&this.CP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.kP,right:!0}})),!0===t.borders.right&&this.CP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.kP,left:!0}})))},this.TP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseEnter,i,e)},this.FP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseLeave,i,e)},this.IP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseClick,i,e)},this.PP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseDoubleClick,i,e)},this.DP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseDown,i,e)},this.BP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseUp,i,e)},this.LP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseMove,i,e)},this.RP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseDrag,i,e)},this.EP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseDragStart,i,e)},this.zP=(t,e)=>{const i=this.eP.get(t);i&&this.R.emit(qd.cellMouseDragStop,i,e)},this.VP=(t,e)=>{const i=this.eP.get(t);i&&(this.R.emit(qd.cellMouseWheel,i,e),!e.defaultPrevented&&this.bP&&this.OP.QI(e))},this.NP=(t,e)=>{const i=this.eP.get(t);i&&(this.R.emit(qd.cellTouchStart,i,e),!e.defaultPrevented&&this.MP&&this.OP.JI(e))},this.GP=(t,e)=>{const i=this.eP.get(t);i&&(this.R.emit(qd.cellTouchMove,i,e),!e.defaultPrevented&&this.MP&&this.OP.KI(e))},this.WP=(t,e)=>{const i=this.eP.get(t);i&&(this.R.emit(qd.cellTouchEnd,i,e),!e.defaultPrevented&&this.MP&&this.OP.qI(e))},this.ls.Xn(dh.af),this.mh.gr("Data Grid"),this.UP=i.d2({scaleXYConstructor:Bi}),this.UP.x.ag=kd,this.YP=i.d2({scaleXYConstructor:Bi}),this.HP={x:0,y:0},this.$P=this.Ki.dataGridTextFont,this.XP=this.Ki.dataGridTextFillStyle,this.kP={top:!0,bottom:!0,left:!0,right:!0},this.jP=this.Ki.dataGridCellBackgroundFillStyle,this.ZP=this.Ki.dataGridBorderStrokeStyle,this.QP="left-center",this.JP={left:5,right:5,bottom:5,top:5},this.KP=e.Mx("dataGrid grid bg",0),this.qP=e.Mx("dataGrid cell bg",1),this.tD=e.Hy("dataGrid cell content",0),this.iD=e.Hy("dataGrid scrollbar bg",1),this.sD=e.Hy("dataGrid scrollbar fg",2),this.OP=this.eD(),this.onBackgroundMouseWheel(((t,e)=>{this.bP&&this.OP.QI(e)})),this.onBackgroundTouchStart(((t,e)=>{this.MP&&this.OP.JI(e)})),this.onBackgroundTouchMove(((t,e)=>{this.MP&&this.OP.KI(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.MP&&this.OP.qI(e)})),this.hD=this.KP.Pe(this.UP).Ie(this.Ki.dataGridBackgroundFillStyle).Fe(nt).setMouseInteractions(!1),this.rD=this.tD.Wg(this.UP).setMouseInteractions(!1),this.nD=new Ka((()=>this.qP.Pe(this.UP).setMouseInteractions(!0).setMouseEnterEventHandler(this.TP).setMouseLeaveEventHandler(this.FP).setMouseClickEventHandler(this.IP).setMouseDoubleClickEventHandler(this.PP).setMouseDownEventHandler(this.DP).setMouseUpEventHandler(this.BP).setMouseMoveEventHandler(this.LP).setMouseDragEventHandler(this.RP).setMouseDragStartEventHandler(this.EP).setMouseDragStopEventHandler(this.zP).setMouseWheelEventHandler(this.VP).setTouchStartEventHandler(this.NP).setTouchMoveEventHandler(this.GP).setTouchEndEventHandler(this.WP))),this.oD=new Ka((()=>this.tD.Pe(this.UP).setMouseInteractions(!1))),this.aD=new Ka((()=>this.tD.Or(this.UP).setMouseInteractions(!1))),this.lD=new Ka((()=>this.tD.rm(this.UP,{},[Oa.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.uD=new Ka((()=>this.tD.Ne(this.UP).setMouseInteractions(!1))),this.cD=new Ka((()=>this.tD.Pv(this.UP).setMouseInteractions(!1))),this.dD=new Ka((()=>this.tD.Pe(this.UP).setMouseInteractions(!1))),this.fD=new Ka((()=>this.tD.E_(this.UP).setMouseInteractions(!1))),this.AD=new Ka((()=>this.tD.hd(this.UP).setMouseInteractions(!1))),this._p(r,this.uiScale),this.onResize((()=>{this.hP=!0,this.ls.xs(),this.UP.it(this.pg.oi()),this.YP.it(this.pg.oi())})),this.gD=this.ss.wg([this.hD])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}if(){return[]}dispose(){return super.dispose(),this.KP.Y(),this.qP.Y(),this.tD.Y(),this.iD.Y(),this.sD.Y(),ia(this.UP),ia(this.YP),this.OP.dispose(),this.aD.wm(),this.nD.wm(),this.oD.wm(),this.lD.wm(),this.uD.wm(),this.cD.wm(),this.dD.wm(),this.fD.wm(),this.AD.wm(),this}J(){return super.J(),this.UP.J(),this.YP.J(),this}K(){return super.K(),this.UP.K(),this.YP.K(),this}setBackgroundEffect(t){return this.gD.Ss(t),this.ls.xs(),this}getBackgroundEffect(){return this.gD.bs()}setInteractionScrollOnWheel(t){return this.bP=t,this}getInteractionScrollOnWheel(){return this.bP}setInteractionPanOnTouch(t){return this.MP=t,this}getInteractionPanOnTouch(){return this.MP}onCellMouseEnter(t){return this.R.on(qd.cellMouseEnter,t)}offCellMouseEnter(t){return this.R.off(t)}onCellMouseLeave(t){return this.R.on(qd.cellMouseLeave,t)}offCellMouseLeave(t){return this.R.off(t)}onCellMouseClick(t){return this.R.on(qd.cellMouseClick,t)}offCellMouseClick(t){return this.R.off(t)}onCellMouseDoubleClick(t){return this.R.on(qd.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.R.off(t)}onCellMouseDown(t){return this.R.on(qd.cellMouseDown,t)}offCellMouseDown(t){return this.R.off(t)}onCellMouseUp(t){return this.R.on(qd.cellMouseUp,t)}offCellMouseUp(t){return this.R.off(t)}onCellMouseMove(t){return this.R.on(qd.cellMouseMove,t)}offCellMouseMove(t){return this.R.off(t)}onCellMouseDrag(t){return this.R.on(qd.cellMouseDrag,t)}offCellMouseDrag(t){return this.R.off(t)}onCellMouseDragStart(t){return this.R.on(qd.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.R.off(t)}onCellMouseDragStop(t){return this.R.on(qd.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.R.off(t)}onCellMouseWheel(t){return this.R.on(qd.cellMouseWheel,t)}offCellMouseWheel(t){return this.R.off(t)}onCellTouchStart(t){return this.R.on(qd.cellTouchStart,t)}offCellTouchStart(t){return this.R.off(t)}onCellTouchMove(t){return this.R.on(qd.cellTouchMove,t)}offCellTouchMove(t){return this.R.off(t)}onCellTouchEnd(t){return this.R.on(qd.cellTouchEnd,t)}offCellTouchEnd(t){return this.R.off(t)}setGridBackgroundFillStyle(t){return this.hD.Ie(t),this.ls.xs(),this}getGridBackgroundFillStyle(){return this.hD.Hh()}setCellContent(t,e,i,s,r){if("number"==typeof i&&void 0!==s&&void 0!==r){const n=i,o=s,h=r;let a=[];for(let i=t;ie.column===t));return i||(i={column:t,min:void 0,max:void 0},this.iP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.iP.splice(this.iP.indexOf(i),1):(i.min=e,i.max=e),this.lP=!0,this.ls.xs(),this}setRowHeight(t,e){let i=this.sP.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.sP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.sP.splice(this.sP.indexOf(i),1):(i.min=e,i.max=e),this.lP=!0,this.ls.xs(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=A(e,e,e,e)),this.yD(t,(t=>this.mD(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=A(e,e,e,e)),this.vD(t,(t=>this.mD(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=A(i,i,i,i)),this.CP(t,e,(t=>this.mD(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=A(t,t,t,t)),this.JP={...this.JP,...t},this.SD((t=>this.mD(t,this.JP))),this}setCellBorders(t,e,i){return this.CP(t,e,(t=>this._P(t,i))),this}setRowBorders(t,e){return this.vD(t,(t=>this._P(t,e))),this}setColumnBorders(t,e){return this.yD(t,(t=>this._P(t,e))),this}setCellsBorders(t){return this.kP=void 0===t?sf:t,this.SD((t=>this._P(t,this.kP))),this}setCellsBorderStrokeStyle(t){return this.ZP="function"==typeof t?t(this.ZP):t,this.yP=!0,this.ls.xs(),this}setColumnTextFillStyle(t,e){return this.yD(t,(t=>this.xD(t,e))),this}setRowTextFillStyle(t,e){return this.vD(t,(t=>this.xD(t,e))),this}setCellTextFillStyle(t,e,i){return this.CP(t,e,(t=>this.xD(t,i))),this}setCellsTextFillStyle(t){return this.XP="function"==typeof t?t(this.XP):t,this.SD((t=>this.xD(t,this.XP))),this}setColumnTextFont(t,e){return this.yD(t,(t=>this.bD(t,e))),this}setRowTextFont(t,e){return this.vD(t,(t=>this.bD(t,e))),this}setCellTextFont(t,e,i){return this.CP(t,e,(t=>this.bD(t,i))),this}setCellsTextFont(t){return this.$P="function"==typeof t?t(this.$P):t,this.SD((t=>this.bD(t,this.$P))),this}setColumnContentAlignment(t,e){return this.yD(t,(t=>this.MD(t,e))),this}setRowContentAlignment(t,e){return this.vD(t,(t=>this.MD(t,e))),this}setCellContentAlignment(t,e,i){return this.CP(t,e,(t=>this.MD(t,i))),this}setCellsContentAlignment(t){return this.QP=t,this.SD((t=>this.MD(t,this.QP))),this}setCellBackgroundFillStyle(t,e,i){return this.CP(t,e,(t=>this._D(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.yD(t,(t=>this._D(t,e))),this}setRowBackgroundFillStyle(t,e){return this.vD(t,(t=>this._D(t,e))),this}setCellsBackgroundFillStyle(t){return this.jP="function"==typeof t?t(this.jP):t,this.SD((t=>this._D(t,this.jP))),this}setCellHighlight(t,e,i){return this.CP(t,e,(t=>{t.highlight=be(i)})),this.pP=!0,this.ls.xs(),this}setColumnHighlight(t,e){const i=be(e);return this.yD(t,(t=>{t.highlight=i})),this.pP=!0,this.ls.xs(),this}setRowHighlight(t,e){const i=be(e);return this.vD(t,(t=>{t.highlight=i})),this.pP=!0,this.ls.xs(),this}removeCell(t,e){return this.CP(t,e,(t=>this.tP.splice(this.tP.indexOf(t),1))),this.aP=!0,this.ls.xs(),this}removeRow(t){return this.vD(t,(t=>this.tP.splice(this.tP.indexOf(t),1))),this.tP.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.aP=!0,this.ls.xs(),this}removeColumn(t){return this.yD(t,(t=>this.tP.splice(this.tP.indexOf(t),1))),this.tP.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.aP=!0,this.ls.xs(),this}removeCells(){return this.tP.splice(0),this.aP=!0,this.ls.xs(),this}getColumnMax(){return 0===this.tP.length?0:this.tP.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.tP.length?0:this.tP.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}De(t){super.De(t),oa.Bp(this.mh,this.Cp),super.Mp();const e=Math.round(this.ZP.N()),i=e/2;let s=this.rP||this.nP||this.oP||this.aP||this.lP||this.uP||this.AP||this.gP||this.yP||this.vP;if(s){this.tP.forEach((t=>{this.xP.add(t.column)})),this.tP.forEach((t=>{this.SP.add(t.row)}));const t=this.aD.Mm(),r=this.wD(i,t);t.finishPlot();const n=this.CD(this.xP.size,r),o=this.kD(this.SP.size,r),h=n.reduce(He,0)+e,a=o.reduce(He,0)+e,l=new Array(n.length+1).fill(0).map(((t,e)=>n.reduce(((t,i,s)=>t+(so.reduce(((t,i,s)=>t+(st===n[e])),e=this.TD.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.TD={columnWidths:n,rowHeights:o,dataGridWidth:h,dataGridHeight:a,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:r}}const r=s||this.nP||this.oP||this.aP||this.cP||this.dP||this.fP||this.gP||this.pP||this.yP||this.hP||this.vP;if((r||this.mP)&&this.TD){const t=this.pg.getInnerIntervalPixels(),s=oa.Dp(this.mh,this.Cp),n=[this.wa.left+i,this.wa.right+i],o=[this.wa.bottom+i,this.wa.top+s+i],h={x:t.x-n[0]-n[1],y:t.y-o[0]-o[1]},a=[this.wa.left,this.wa.right],l=[this.wa.bottom,this.wa.top+s],u={x:Math.round(t.x-a[0]-a[1]),y:Math.round(t.y-l[0]-l[1])},c={x:Math.ceil(i),y:Math.floor(u.y-i)};this.YP.Ei(n).zi(o).Vi(0,h.x).Oi(0,h.y),this.OP._I({x:this.TD.dataGridHeight,y:this.TD.dataGridWidth}).Ls().De();const d={x:Math.round(this.HP.x),y:Math.round(Math.min(0,this.HP.y))};this.UP.Ei(a).zi(l).Vi(d.x,u.x+d.x).Oi(d.y,u.y+d.y),this.hD.Be({x:c.x,y:c.y});const f={x:this.UP.x.ei(),y:this.UP.y.ei()+this.OP.bI(),width:this.UP.x.ri()+e-this.OP.bI(),height:this.UP.y.ri()+e};this.tD.ux(f),this.qP.ux(f),this.KP.ux(f);const g=this.TD,y=[{x:this.UP.x.getInnerStart(),y:this.UP.y.getInnerStart()},{x:this.UP.x.getInnerEnd(),y:this.UP.y.getInnerStart()},{x:this.UP.x.getInnerEnd(),y:this.UP.y.getInnerEnd()},{x:this.UP.x.getInnerStart(),y:this.UP.y.getInnerEnd()}];g.cellsContentSizes.forEach((t=>{var e;const i={x:c.x+g.columnWidthsCumulative[t.cell.column],y:c.y-g.rowHeightsCumulative[t.cell.row+t.cell.rowSpan]},s={x:i.x+g.columnWidths[t.cell.column],y:i.y+g.rowHeights[t.cell.row]},r=Ge([i,{x:s.x,y:i.y},s,{x:i.x,y:s.y}],y);null===(e=t.text)||void 0===e||e.setVisible(r)})),r&&this.FD(c,this.TD,e)}this.hP=!1,this.rP=!1,this.nP=!1,this.oP=!1,this.aP=!1,this.lP=!1,this.uP=!1,this.cP=!1,this.dP=!1,this.fP=!1,this.AP=!1,this.gP=!1,this.pP=!1,this.yP=!1,this.mP=!1,this.vP=!1}wD(t,e){const i=[],s={left:Math.ceil(t),right:Math.ceil(t),top:Math.ceil(t),bottom:Math.ceil(t)};for(const t of this.tP){const{content:r}=t,n={...this.JP,...t.padding};let o,h,a,l={x:0,y:0};if("string"==typeof r||"number"==typeof r){const i=String(r);o=e.add(),l=o.gr(i).jh(t.textFont||this.$P).Ls().td()}if(Id(r)&&(h=r,l={x:200,y:50}),oo(r)){const t=this.ls.ID(r);t.PD()?(a=r,l=a.oi()):t.DD((()=>{this.vP=!0,this.ls.xs()}))}if(o||h||a){n.top=Math.round(n.top),n.left=Math.round(n.left),n.right=Math.round(n.right),n.bottom=Math.round(n.bottom);const e={x:Math.round(l.x+n.left+n.right+s.left+s.right),y:Math.round(l.y+n.top+n.bottom+s.top+s.bottom)};i.push({cell:t,contentSize:e,text:o,sparkChart:h,icon:a,cellPadding:n,cellMargin:s})}}return i}FD(t,i,s){const{dataGridWidth:r,dataGridHeight:n,cellsContentSizes:o,columnWidths:h,columnWidthsCumulative:a,rowHeights:l,rowHeightsCumulative:u}=i,c={x:r-s,y:-n+s};this.hD.it(c),this.rD.Oe(this.ZP),this.eP.clear();const d={cellBackground:this.nD.Mm(),cellIconRect:this.oD.Mm(),lineSet:this.lD.Mm(),line:this.uD.Mm(),pointSet:this.cD.Mm(),rect:this.dD.Mm(),junction:this.fD.Mm(),arc:this.AD.Mm()},f=[];for(const i of o){const{cell:r,text:n,sparkChart:o,icon:c,cellPadding:g,cellMargin:y}=i,m={column:r.column,row:r.row},p={x:t.x+a[r.column],y:t.y-u[r.row+r.rowSpan]},x={x:p.x+y.left,y:p.y+y.bottom},A={x:x.x+g.left,y:x.y+g.bottom},S={x:new Array(r.columnSpan).fill(0).reduce(((t,e,i)=>t+h[r.column+i]),0),y:new Array(r.rowSpan).fill(0).reduce(((t,e,i)=>t+l[r.row+i]),0)},v={x:S.x-y.left-y.right,y:S.y-y.top-y.bottom},b={x:v.x-g.left-g.right,y:v.y-g.top-g.bottom};if(n){const t=ef(A,b,r.contentAlignment||this.QP);n.Be(t[0]).Ya({x:t[1],y:t[2]}).Ie(this.BD(r.textFillStyle||this.XP,r.content,this.XP)).us(r.highlight)}const M=this.BD(r.backgroundFillStyle||this.jP,r.content);if(M!==B){const t=d.cellBackground.add();t.Be(p).it(S).Ie(M).Fe(nt).us(r.highlight),this.eP.set(t,m)}const w=r.borders||this.kP;if(w&&tf(p,S,w,s,f),o){const t=A,e=b;Fd(o,d,this.UP,t,e,this.Ki,this.mA,r.highlight)}if(c){const t=c.oi(),i=ef(A,b,r.contentAlignment||this.QP);d.cellIconRect.add().Be({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).it(t).Ie(new qn({source:c.uc,fitMode:e.ImageFitMode.Stretch})).Fe(nt).us(r.highlight)}}this.rD.Ot();for(const t of f)this.rD.Hr().Yg(t[0],t[1]);d.cellBackground.finishPlot(),d.cellIconRect.finishPlot(),d.lineSet.finishPlot(),d.line.finishPlot(),d.pointSet.finishPlot(),d.rect.finishPlot(),d.junction.finishPlot(),d.arc.finishPlot()}CD(t,e){const i=new Array(t).fill(0);for(const t of this.xP.values()){const s=e.filter((e=>t>=e.cell.column&&t+1<=e.cell.column+e.cell.columnSpan)).reduce(((t,e)=>{const i=e.contentSize.x/e.cell.columnSpan;return Math.max(t,i)}),0),r=this.iP.find((e=>e.column===t)),n=r?Ft(s,void 0!==r.min?r.min:ze,void 0!==r.max?r.max:Be):s;i[t]=n}return i}kD(t,e){const i=new Array(t).fill(0);for(const t of this.SP.values()){const s=e.filter((e=>t>=e.cell.row&&t+1<=e.cell.row+e.cell.rowSpan)).reduce(((t,e)=>{const i=e.contentSize.y/e.cell.rowSpan;return Math.max(t,i)}),0),r=this.sP.find((e=>e.row===t)),n=r?Ft(s,void 0!==r.min?r.min:ze,void 0!==r.max?r.max:Be):s;i[t]=n}return i}BD(t,e,i){if(H(t)){try{const i=Number(e);return new U({color:t.getPalette().getColors(i)})}catch(t){}return i||B}return t}xD(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.XP):e,this.fP=!0,this.ls.xs()}bD(t,e){t.textFont="function"==typeof e?e(t.textFont||this.$P):e,this.AP=!0,this.ls.xs()}_D(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.jP):e,this.dP=!0,this.ls.xs()}MD(t,e){t.contentAlignment=e,this.cP=!0,this.ls.xs()}mD(t,e){t.padding={...t.padding,...e},this.uP=!0,this.ls.xs()}pD(t,e,i){let s=this.CP(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.tP.push(s),this.oP=!0),"string"==typeof s.content||"number"==typeof s.content?this.rP=!0:this.nP=!0,this.ls.xs()}SD(t){this.tP.forEach((e=>t(e)))}CP(t,e,i){const s=this.tP.find((i=>t>=i.column&&t+1<=i.column+i.columnSpan&&e>=i.row&&e+1<=i.row+i.rowSpan));return s&&i&&i(s),s}yD(t,e){const i=this.tP.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}vD(t,e){const i=this.tP.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}eD(){return new $d(this.sD,this.iD,this.YP,this.YP,this.UP,this.Ki,Zd.Both).onScroll(((t,e)=>{this.TD&&(t===Zd.Vertical&&(this.HP.y=-e),t===Zd.Horizontal&&(this.HP.x=e),this.mP=!0,this.ls.xs())})).jI(50).ZI(12)}}const qd={cellMouseEnter:"cellMouseEnter",cellMouseLeave:"cellMouseLeave",cellMouseClick:"cellMouseClick",cellMouseDoubleClick:"cellMouseDoubleClick",cellMouseDown:"cellMouseDown",cellMouseUp:"cellMouseUp",cellMouseMove:"cellMouseMove",cellMouseDrag:"cellMouseDrag",cellMouseDragStart:"cellMouseDragStart",cellMouseDragStop:"cellMouseDragStop",cellMouseWheel:"cellMouseWheel",cellTouchStart:"cellTouchStart",cellTouchMove:"cellTouchMove",cellTouchEnd:"cellTouchEnd"};var Jd;e.DataGridCellContentAlignmentOptions=void 0,(Jd=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",Jd.RightCenter="right-center",Jd.LeftCenter="left-center",Jd.RightTop="right-top",Jd.LeftTop="left-top",Jd.RightBottom="right-bottom",Jd.LeftBottom="left-bottom",Jd.CenterTop="center-top",Jd.CenterBottom="center-bottom";const tf=(t,e,i,s,r)=>{const n={x:t.x,y:t.y},o={x:t.x,y:t.y+e.y},h={x:t.x+e.x,y:t.y},a={x:t.x+e.x,y:t.y+e.y};i.top&&r.push([o,a]),i.bottom&&r.push([n,h]),i.left&&r.push([n,o]),i.right&&r.push([h,a])},ef=(t,e,i)=>{const s=t.x,r=t.x+e.x,n=t.x+e.x/2,o=t.y+e.y,h=t.y,a=t.y+e.y/2;switch(i){case"left-center":return[u(s,a),-1,0];case"right-center":return[u(r,a),1,0];case"center":return[u(n,a),0,0];case"left-bottom":return[u(s,h),-1,-1];case"right-bottom":return[u(r,h),1,-1];case"center-bottom":return[u(n,h),0,-1];case"left-top":return[u(s,o),-1,1];case"right-top":return[u(r,o),1,1];case"center-top":return[u(n,o),0,1]}return we(0,`Unidentified DataGrid cell content alignment option: ${i}`)},sf={top:!1,bottom:!1,left:!1,right:!1};class rf extends ir{constructor(t,e,i,s,r,n){super(t,{Tr(){},kr(){},Ir(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.ss=n,this.Is=r,this.bh=r.Or(t.LD).jh(this.Ki.barChartCategoryAxisTitleFont||this.Ki.xAxisTitleFont).Ie(this.Ki.barChartCategoryAxisTitleFillStyle||this.Ki.xAxisTitleFillStyle),this.setTitleRotation(this.chart.Ps.getWidth({x:0,y:-90})),this.Jh=this.ss.wg([this.bh]).Ss(e.effectsText),this.RD=r.Ne(t.LD).Oe(e.barChartCategoryAxisStrokeStyle||e.xAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Ig=t,this.Pg=t):"object"==typeof t&&(this.Ig=t.min,this.Pg=t.max),this.chart.ls.xs(),this}getThickness(){return{min:this.Ig,max:this.Pg}}setStrokeStyle(t){return this.RD.Oe(t),this.chart.ls.xs(),this}getStrokeStyle(){return this.RD.pu()}Ls(){if(!this.Xi)return{Rg:0,Eg:0,Yd:Ft(0,void 0!==this.Ig?this.Ig:0,void 0!==this.Pg?this.Pg:Be)};const t=this.RD.pu().N()/2,e=this.chart.Ps.getHeight(this.bh.Ls().td());return{Rg:t,Eg:e,Yd:t+e}}De(t,e,i,s){const r=this.getInterval(),n=this.chart.valueAxis.getInterval();this.RD.We(this.chart.Ps.toPoint(r.start,n.start)).Ge(this.chart.Ps.toPoint(r.end,n.start)).setVisible(this.Xi),this.bh.Be(this.chart.Ps.toPoint(.5*(r.start+r.end),this.chart.valueAxis.At.pi(n.start,-(t.Rg+s.labelMarginBeforeCategoryAxisPixels)))).Ya(this.chart.Ps.toPoint(0,1)).setVisible(this.Xi)}setMouseInteractions(t){return this}mr(t,e){return new sr(e,t,this.Is,this.chart.LD)}vr(t,e){return{}}Dr(t,e){return e}Lr(t,e,i){return{min:t,max:e}}}class nf extends ir{constructor(t,e,i,s,r,n,o){super(t,{Tr:()=>{var e;if(t.ED){if("positive"===t.zD||"bipolar"===t.zD){if("after-bar"===(null===(e=t.VD)||void 0===e?void 0:e.position)){const e=this.At.ri();return this.At.pi(t.ED.max,Math.min(this.chart.Ps.getHeight(this.chart.OD())+t.VD.labelMargin,.3*e))}return t.ED.max}return t.ND?Ft(-1,-1e-6,t.ED.max):0}},kr:()=>{var e;if(t.ED){if("negative"===t.zD||"bipolar"===t.zD){if("after-bar"===(null===(e=t.VD)||void 0===e?void 0:e.position)){const e=this.At.ri();return this.At.pi(t.ED.min,-Math.min(this.chart.Ps.getHeight(this.chart.OD())+t.VD.labelMargin,.3*e))}return t.ED.min}return t.ND?Ft(1,1e-6,t.ED.min):0}},Ir:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.ss=n,this.Is=r,this.bh=r.Or(t.LD).jh(this.Ki.barChartValueAxisTitleFont||this.Ki.yAxisTitleFont).Ie(this.Ki.barChartValueAxisTitleFillStyle||this.Ki.yAxisTitleFillStyle),this.setTitleRotation(this.chart.Ps.getHeight({x:0,y:-90})),this.Jh=this.ss.wg([this.bh]).Ss(e.effectsText),this.RD=r.Ne(t.LD).Oe(e.barChartValueAxisStrokeStyle||this.Ki.yAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Ig=t,this.Pg=t):"object"==typeof t&&(this.Ig=t.min,this.Pg=t.max),this.chart.ls.xs(),this}getThickness(){return{min:this.Ig,max:this.Pg}}setStrokeStyle(t){return this.RD.Oe(t),this.chart.ls.xs(),this}getStrokeStyle(){return this.RD.pu()}setTickStrategy(t,e){return super.Vh(t,e)}Ls(t){if(!this.Xi)return this.Kh(),{Rg:0,Eg:0,Yd:Ft(0,void 0!==this.Ig?this.Ig:0,void 0!==this.Pg?this.Pg:Be)};const e=this.chart.Ps.getWidth(this.chart.LD).ri(),i=this.At.ri();this.rr({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.sh.values())for(const e of t.values()){const t=e.Fh.yr,i=this.chart.Ps.getWidth(e.Ke.td()),r=t.getTickLength()+t.getTickPadding()+i;s=Math.max(s,r)}const r=s+this.RD.pu().N()/2,n=this.chart.Ps.getWidth(this.bh.Ls().td());return{Rg:r,Eg:n,Yd:Ft(r+n,void 0!==this.Ig?this.Ig:0,void 0!==this.Pg?this.Pg:Be)}}De(t){const e=this.getInterval();this.RD.We(this.chart.Ps.toPoint(-.5,this.Oh)).Ge(this.chart.Ps.toPoint(-.5,this.Nh)).setVisible(this.Xi);const i="logarithmic"===this.Eh.type?Math.sqrt(e.start+e.end):.5*(e.start+e.end),s=this.chart.Ps.toPoint(this.chart.categoryAxis.At.pi(-.5,t.Rg*this.chart.Ps.GD),i),r=this.chart.Ps.toPoint(this.chart.Ps.WD,0);this.bh.Be(s).Ya(r).setVisible(this.Xi)}setMouseInteractions(t){return this}mr(t,e){return new sr(e,t,this.Is,this.chart.LD)}vr(t,e){const i=t.Fh.yr,s=this.chart.Ps.toPoint(-.5,t.M),r=this.chart.LD.pi(s,this.chart.Ps.toPoint(i.getTickLength()*this.chart.Ps.GD,0)),n=this.chart.LD.pi(s,this.chart.Ps.toPoint(i.gridStrokeLength*e.oppositeAxisSize*-this.chart.Ps.GD,0)),o=this.chart.LD.pi(r,this.chart.Ps.toPoint(i.getTickPadding()*this.chart.Ps.GD,0));t.Ke.Be(o).Ya(this.chart.Ps.toPoint(this.chart.Ps.WD,i.getLabelAlignment())).Zh(i.getLabelRotation()),i.tickStyle!==nt&&0!==i.tickLength&&e.plotLines.add({positions:[s,r]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==nt&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,n]},{lineStyle:i.gridStrokeStyle})}Dr(t,e){return"linear"===this.Eh.type?uh(t,e,this.At):ch(t,e,this.At)}Lr(t,e,i){return{min:t,max:e}}}class of extends jl{constructor(t,e,i,s,r,n,o){super(t,e,i,s),this.Xo=Fe(),this.M=0,this.UD=!1,this.chart=t,this.chart=t,this.category=r,this.subCategory=n,this._s=r,this.we=ye(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,o),this.Ce=ye(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,o),this.onVisibleStateChanged((()=>{this.chart.YD()})),this.onDispose((()=>{this.chart.YD(),this.chart.HD.delete(this.category),this.chart.$D.delete(this)}))}Qi(t,e){const i=this.chart.ls.Vo(e);return{cursorPosition:{pointMarker:{x:i.engineX,y:i.engineY},pointMarkerScale:this.chart.ls.At,resultTable:{x:i.engineX,y:i.engineY},resultTableScale:this.chart.ls.At},category:this.category,subCategory:this.subCategory,bar:this,value:this.getValue()}}setValue(t){return this.UD=!0,this.M=t,this.chart.YD(),this.chart.ls.xs(),this.chart.HD.delete(this.category),this.chart.$D.delete(this),this}getValue(){return this.M}get value(){return this.M}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.chart.YD(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.chart.YD(),this}getStrokeStyle(){return this.Ce}rv(){return this.av}setEffect(t){return this.chart.setBarsEffect(t),this}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}}const hf=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),af=(t,e,i)=>{const s=t.Bd.filter((t=>void 0!==t)),r=s.map((t=>i(t.sizePixels))).reduce(((t,e)=>Math.max(t,e)),1),n=Math.ceil(r/(e/s.length));return n<=1?s:s.filter(((t,e)=>e%n==0))};class lf extends cl{constructor(t,e,i,s,r,n,o){var h;let a;super(t,e,i,e.wp("barChart bg",0),s,e.ls.Ki.barChartBackgroundFillStyle||e.ls.Ki.chartXYBackgroundFillStyle,e.ls.Ki.barChartBackgroundStrokeStyle||e.ls.Ki.chartXYBackgroundStrokeStyle,e.ls.Ki.barChartTitleFont||e.ls.Ki.chartXYTitleFont,e.ls.Ki.barChartTitleFillStyle||e.ls.Ki.chartXYTitleFillStyle,n),this.coordsBars="barChart",this.XD=uf.Descending,this.jD=this.Ki.barChartCategoryLabels,this.VD=this.Ki.barChartValueLabelsAfterBars,this.ZD=!1,this.jM=ke(),this.HD=new Map,this.$D=new Map,this.zD="positive",this.QD="columns",this.JD=!0,this.KD=new Map,this.qD={speed:1},this.wy={speed:1},this.tB=.08,this.Mn=(t,e,i,s,r)=>{this.LD.it(s,r)},this.ls.Xn(dh.ff),this.Ps="horizontal"===(null==o?void 0:o.type)?df:cf,this.mh.gr("Bar Chart"),this.iB=e.Hy("barChart plotting 1",0),this.sB=e.Hy("barChart plotting 2",1),this.ND="logarithmic"===(null===(h=null==o?void 0:o.valueAxis)||void 0===h?void 0:h.type),this.ND?"horizontal"===this.Ps.eB?(a=i.d1({scale1DConstructor:Li,dimension:"y"}),this.LD=(new zi).Ri(i.d1({scale1DConstructor:Ci,dimension:"x"}),a)):(a=i.d1({scale1DConstructor:Li,dimension:"x"}),this.LD=(new zi).Ri(a,i.d1({scale1DConstructor:Ci,dimension:"y"}))):(this.LD=i.d2({scaleXYConstructor:Bi}),a=this.Ps.getWidth(this.LD)),this.hB=this.ss.wg(),this.JM=new ja((()=>this.jM.Mt(this.iB.Um(this.LD).ra(0))),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.bar),e.bar.gs([i]),i})))),(()=>{this.jM.Ot()}),(t=>{this.hB.fs(t)})),this.zv=this.op.Pe(this.LD).Ie(this.Ki.barChartSeriesBackgroundFillStyle||B).Fe(nt),this.Vv=this.op.Pe(this.LD).Ie(B).Fe(this.Ki.barChartSeriesBackgroundStrokeStyle||nt).setMouseInteractions(!1),super.Ev(this.zv,this.Vv),this.categoryAxis=new rf(this,this.Ki,!1!==(null==o?void 0:o.animationsEnabled),a,this.sB,this.ss);const l=lh(null==o?void 0:o.valueAxis);this.valueAxis=new nf(this,this.Ki,!1!==(null==o?void 0:o.animationsEnabled),this.Ps.getHeight(this.LD),this.sB,this.ss,l.type),this.rB=new Ka((()=>this.sB.Or(this.LD).Vr(Ie).zr(Ie).ra(1))),this.nB=new ja((()=>this.op.Wg(this.LD).setMouseInteractions(!1)),((t,e,i)=>(t.Oe(i.lineStyle),e.map((({positions:e,existingMember:i})=>(i||t.Hr()).Yg(e[0],e[1]))))));const u=e.Xy(),c=Pt(o?o.cursorBuilder:void 0,Ma);this.jy=la(this,u,c.gy(u,this.uiScale,this.uiScale,kt,this.Ki),this,"show-pointed",ff,(()=>0)),this.onResize(this.Mn),this._p(r,this.LD),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}getSeries(){return this.Dv}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=Ma){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}setBarsMargin(t){return this.tB=Ft(t,0,.49),this.ZD=!0,this.ls.xs(),this}getBarsMargin(){return this.tB}setBarsEffect(t){return this.hB.Ss(t),this.ls.xs(),this}getBarsEffect(){return this.hB.bs()}setData(t){let e;if(Array.isArray(t))e=[],t.forEach(((t,i)=>{"string"==typeof t?e.push({category:t}):"number"==typeof t?e.push({category:`Category ${i+1}`,value:t}):"object"==typeof t&&e.push(t)}));else{e=[];const i=Object.keys(t);for(const s of i){const i=t[s];e.push({category:s,value:"number"==typeof i?i:void 0})}}return this.oB("columns",e),this}setDataStacked(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:r}=e;r.forEach(((e,r)=>{const n=t[r];i.push({category:n,subCategory:s,value:e})}))})),this.oB("stacks",i),this}setDataGrouped(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:r}=e;r.forEach(((e,r)=>{const n=t[r];i.push({category:n,subCategory:s,value:e})}))})),this.oB("groups",i),this}oB(t,e){this.Dv.length>0&&this.ls.Xn(dh.Cf),this.QD=t,this.aB(e);const i=Se(e.map((t=>t.category))),s=i.length,r=Se(e.map((t=>t.subCategory))).filter((t=>void 0!==t));if(e.forEach((t=>{let e=this.Dv.find((e=>e.category===t.category&&e.subCategory===t.subCategory));if(!e){const s=i.indexOf(t.category),n=r.includes(t.subCategory)?r.indexOf(t.subCategory):void 0;e=new of(this,this.Lv,this.Ki,this.ls.ss,t.category,t.subCategory,Pt(n,s)),this.Ov(e),this.KD.set(e,{category:s,valueStart:this.ND?1e-6:0,valueEnd:void 0!==t.value?t.value:0})}void 0!==t.value&&e.setValue(t.value)})),this.Dv.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category&&e.subCategory===t.subCategory))&&(t.dispose(),this.KD.delete(t))})),this.categoryAxis.setInterval(this.Ps.getWidth({x:{start:-.5,end:s-.5},y:{start:s-.5,end:-.5}})),this.ED=0===this.Dv.length?void 0:"stacks"!==t?this.Dv.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:Be,max:ze}):{min:0,max:i.reduce(((t,i)=>Math.max(t,e.reduce(((t,e)=>e.category!==i?t:void 0!==e.value?t+e.value:t),0))),0)},this.ED&&(this.zD=this.ED.min>=0?"positive":this.ED.max<=0?"negative":"bipolar",("bipolar"===this.zD||"negative"===this.zD)&&this.ND))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");this.aB(this.Dv),this.HD.clear(),this.$D.clear(),this.ZD=!0,this.ls.xs()}setCategoryLabels(t){const e="function"==typeof t?this.jD?t(this.jD):this.jD:t;return this.jD=e?{...this.Ki.barChartCategoryLabels,...e}:void 0,this.HD.clear(),this.ls.xs(),this}getCategoryLabels(){return this.jD}setValueLabels(t){var e;const i="function"==typeof t?this.VD?t(this.VD):this.VD:t,s=(null==i?void 0:i.position)||(null===(e=this.VD)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.VD={...this.Ki.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.VD={...this.Ki.barChartValueLabelsInsideBars,...i}):this.VD=void 0,this.$D.clear(),this.ls.xs(),this}getValueLabels(){return this.VD}setLabelFittingEnabled(t){return this.JD=t,this.ls.xs(),this}getLabelFittingEnabled(){return this.JD}getBar(t,e){if(("groups"===this.QD||"stacks"===this.QD)&&void 0===e)throw new Error("LightningChart JS BarChart.getBar() | `subCategory` parameter is required for grouped and stacked bar charts!");const i=this.Dv.find((i=>i.category===t&&(void 0===e||e===i.subCategory)));if(!i)throw new Error(`BarChart.getBar() no such bar: "${t}" ${e?`"${e}"`:""}`);return i}getBars(){return this.Dv}setSorting(t){return this.XD=t,this.aB(this.Dv),this.ls.xs(),this}getSorting(){return this.XD}setAnimationCategoryPosition(t,e=1){return this.qD=t?{speed:e}:void 0,this.ls.xs(),this}setAnimationValues(t,e=1){return this.wy=t?{speed:e}:void 0,this.ls.xs(),this}translateCoordinate(t,e,i){if(i&&Gi(t)&&Yi(e))return super.translateCoordinate(t,e,i);const s=e;let r;if(Ui(t))r=this.ls.Vo(t);else if(Gi(t)){const e=ct(t,this.pg,this.ls.At);r={engineX:e.x,engineY:e.y}}else{if(!hf(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=ct(this.Ps.toPoint(t.iCategory,t.value),this.LD,this.ls.At);r={engineX:e.x,engineY:e.y}}}if(Oi(s))return this.ls.Oo(r);if("barChart"===s){const t=ct({x:r.engineX,y:r.engineY},this.ls.At,this.LD);return{iCategory:this.Ps.getWidth(t),value:this.Ps.getHeight(t)}}if(Yi(s))return ct({x:r.engineX,y:r.engineY},this.ls.At,this.pg);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}if(){if("columns"===this.QD)return this.Dv;const t=Se(ve(this.Dv.map((t=>t.subCategory))));return ve(t.map((t=>{const e=this.Dv.filter((e=>e.subCategory===t)),i=e[0];if(i)return(t=>{let e=!1;t.forEach((i=>i.onHighlight(((s,r)=>{e||(e=!0,t.forEach((t=>i!==t?t.setHighlight(r):void 0)),e=!1)})))),t.forEach((e=>e.onDispose((()=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)}))))})(e),{attach(s,r){return Me(s,e,{toggleVisibilityOnClick:!0,label:t,style:i.getFillStyle()}),this}}})))}De(t){var e,i;super.De(t);const s=this.rB.Mm(),r=this.nB.Mm(),n=this.Dv.filter((t=>t.getVisible()&&t.UD)),o=Se(n.map((t=>t.category))),h=Se(ve(n.map((t=>t.subCategory)))),a=5e-4*t*((null===(e=this.qD)||void 0===e?void 0:e.speed)||0),l=.003*t*((null===(i=this.qD)||void 0===i?void 0:i.speed)||0),u=this.valueAxis.At,c=u instanceof Li?(t,e)=>{var i;return uh(t,e,u,(null===(i=this.wy)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return ch(t,e,u,(null===(i=this.wy)||void 0===i?void 0:i.speed)||0)};let d;"columns"===this.QD?d=n.map((t=>({bar:t,position:{category:o.indexOf(t.category),valueStart:this.ND?1e-6:0,valueEnd:t.value}}))):"groups"===this.QD?d=n.map((t=>{const e=o.indexOf(t.category),i=h.indexOf(t.subCategory),s=1/(h.length+2*(h.length+1)*this.tB),r=this.tB*s;return{bar:t,position:{category:e+(i-(h.length-1)/2)*(s+r),valueStart:this.ND?1e-6:0,valueEnd:t.value}}})):(d=[],o.forEach(((t,e)=>{const i=n.filter((e=>e.category===t));let s=this.ND?1e-6:0;i.forEach(((e,i)=>{d.push({bar:e,position:{category:o.indexOf(t),valueStart:s,valueEnd:s+e.value}}),s+=e.value}))}))),d.forEach((t=>{const{bar:e,position:i}=t;let s,r,n=this.KD.get(e);void 0===n&&(n=i);const o=i.valueStart;if(this.qD&&n.category!==i.category){const t=Math.sign(i.category-n.category);s=n.category+a*t+l*(i.category-n.category),t!==Math.sign(i.category-s)&&(s=i.category)}else s=i.category;if(this.wy&&n.valueEnd!==i.valueEnd){const t=Math.sign(i.valueEnd-n.valueEnd);r=c(n.valueEnd,i.valueEnd),t!==Math.sign(i.valueEnd-r)&&(r=i.valueEnd)}else r=i.valueEnd;this.KD.set(e,{category:s,valueStart:o,valueEnd:r}),s===i.category&&r===i.valueEnd||this.ls.xs(!0),s===n.category&&r===n.valueEnd||(this.ZD=!0)})),oa.Bp(this.mh,this.Cp);const f=n.length>0;this.categoryAxis.Pr(),this.valueAxis.Pr();const g=this.categoryAxis.setVisible(f).Ls(),y=this.valueAxis.setVisible(f).Ls(r),{labelMarginBeforeCategoryAxisPixels:m}=f?this.lB(o,n,s,r):{labelMarginBeforeCategoryAxisPixels:0};this.categoryAxis.De(g,s,r,{labelMarginBeforeCategoryAxisPixels:m}),this.valueAxis.De(y);const p=this.categoryAxis.getThickness(),x=Ft(g.Yd+m,void 0!==p.min?p.min:0,void 0!==p.max?p.max:Be),A={x:Math.min(this.LD.x.getInnerStart(),this.LD.x.getInnerEnd()),y:Math.min(this.LD.y.getInnerStart(),this.LD.y.getInnerEnd())},S=Math.max(this.LD.x.getInnerStart(),this.LD.x.getInnerEnd()),v=Math.max(this.LD.y.getInnerStart(),this.LD.y.getInnerEnd()),b={x:S-A.x,y:v-A.y};this.zv.Be(A),this.zv.it(b),this.Vv.Be(A),this.Vv.it(b),super.Mp(),this.jy.De(!1,this.Dv,void 0);const M=oa.Dp(this.mh,this.Cp);if(this.LD.zi([this.Xt.bottom+this.wa.bottom+("vertical"===this.Ps.eB?x:0),this.Xt.top+this.wa.top+M+("horizontal"===this.Ps.eB?y.Yd:0)]),this.LD.Ei([this.Xt.left+this.wa.left+this.Ps.getHeight({x,y:y.Yd}),this.Xt.right+this.wa.right]),this.iB.ux({x:this.LD.x.ei(),y:this.LD.y.ei(),width:this.LD.x.ri(),height:this.LD.y.ri()}),this.ep&&this.ep(),this.ZD){const t=this.JM.Mm(),e="groups"===this.QD?1/(h.length+2*(h.length+1)*this.tB):1-2*this.tB;n.forEach((i=>{const s=this.KD.get(i);if(void 0===s)return;const r=s.category-.5*e,n=s.category+.5*e,o=[this.Ps.toPoint(r,s.valueStart),this.Ps.toPoint(r,s.valueEnd),this.Ps.toPoint(n,s.valueEnd),this.Ps.toPoint(n,s.valueStart)];t.add({Xo:i.Xo,vertices:o,bar:i},{fillStyle:i.we,strokeStyle:i.Ce})})),t.finishPlot()}s.finishPlot(),r.finishPlot(),this.ZD=!1}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationCategoryPosition(t),this.setAnimationValues(t),this.valueAxis.setAnimationsEnabled(t),this.categoryAxis.setAnimationsEnabled(t),this}dispose(){return this.sB.Y(),this.iB.Y(),this.jy.Y(),super.dispose()}aB(t){const e=this.XD;e&&t.sort(((i,s)=>e({category:i.category,value:t.reduce(((t,e)=>t+(e.category===i.category&&e.value||0)),0)},{category:s.category,value:t.reduce(((t,e)=>t+(e.category===s.category&&e.value||0)),0)})))}lB(t,e,i,s){let r=0;const n=this.jD,o=this.VD,h=this.valueAxis.getInterval(),a=this.Ps.getWidth({x:this.LD.x.ri(),y:this.LD.y.ri()});if(n&&n.labelFillStyle!==B){const o=n.tickLength+n.labelMargin,l=this.Ps.toPoint(0,1),u={Bd:t.map(((t,i)=>{const s=e.reduce(((e,i)=>i.category!==t?e:e+i.value),0),r=n.formatter(t,s);if(!r)return;const a=i;return void 0!==a?{text:r,position:this.Ps.toPoint(a,this.valueAxis.At.pi(h.start,-o)),alignment:l,rotation:n.labelRotation,sizePixels:this.uB(t,s)}:void 0})),Hu:n.labelFont,At:this.LD},c=u?this.JD?af(u,a,this.Ps.getWidth):u.Bd:[];c.forEach((t=>{t&&i.add().gr(t.text).Be(t.position).Ya(t.alignment).Zh(t.rotation).Ie(n.labelFillStyle).jh(n.labelFont)})),n.tickStyle!==nt&&0!==n.tickLength&&c.forEach((t=>{if(!t)return;const e=this.Ps.getWidth(t.position);s.add({positions:[this.Ps.toPoint(e,this.valueAxis.At.getInnerStart()),this.Ps.toPoint(e,this.valueAxis.At.pi(h.start,-n.tickLength))]},{lineStyle:n.tickStyle})})),r=c.reduce(((t,e)=>e?Math.max(t,this.Ps.getHeight(e.sizePixels)):t),0)+n.tickLength+n.labelMargin}if(o&&o.labelFillStyle!==B){let t;"after-bar"===o.position?t={Bd:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.KD.get(t);return void 0!==s?{text:i,position:this.Ps.toPoint(s.category,this.valueAxis.At.pi(s.valueEnd,o.labelMargin*Math.sign(s.valueEnd))),alignment:this.Ps.toPoint(0,-1*Math.sign(s.valueEnd)),rotation:o.labelRotation,sizePixels:this.cB(t)}:void 0})),Hu:o.labelFont,At:this.LD}:"inside-bar"!==o.position&&"inside-bar-start"!==o.position&&"inside-bar-centered"!==o.position&&"inside-bar-end"!==o.position||(t={Bd:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.KD.get(t);if(void 0===s)return;const r="bipolar"===this.zD?Math.sign(s.valueEnd):"negative"===this.zD?-1:1,n=this.Ps.toPoint(0,"inside-bar"===o.position||"inside-bar-end"===o.position?1*r:"inside-bar-centered"===o.position?0:-1*r);return{text:i,position:this.Ps.toPoint(s.category,"inside-bar"===o.position||"inside-bar-end"===o.position?this.valueAxis.At.pi(s.valueEnd,-o.labelMargin*r):"inside-bar-centered"===o.position?(s.valueStart+s.valueEnd)/2:this.valueAxis.At.pi(s.valueStart,o.labelMargin*r)),alignment:n,rotation:o.labelRotation,sizePixels:this.cB(t)}})),Hu:o.labelFont,At:this.LD}),t&&(t?this.JD?af(t,a,this.Ps.getWidth):t.Bd:[]).forEach((t=>{t&&i.add().gr(t.text).Be(t.position).Ya(t.alignment).Zh(t.rotation).Ie(o.labelFillStyle).jh(o.labelFont).setMouseInteractions(!1)}))}return{labelMarginBeforeCategoryAxisPixels:r}}uB(t,e){if(!this.jD||this.jD.labelFillStyle===B)return{x:0,y:0};const i=this.HD.get(t);if(i)return i;const s=this.jD.formatter(t,e),r=this.ls.Vg.zg(s,this.jD.labelFont,this.jD.labelRotation);return r.isEstimate?this.ls.xs(!0):this.HD.set(t,r),r}cB(t){if(!this.VD||this.VD.labelFillStyle===B)return{x:0,y:0};const e=this.$D.get(t);if(e)return e;const i=this.ls.Vg.zg(this.VD.formatter(t,t.category,t.value),this.VD.labelFont,this.VD.labelRotation);return i.isEstimate?this.ls.xs(!0):this.$D.set(t,i),i}OD(){return this.Dv.reduce(((t,e)=>{const i=this.cB(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}YD(){this.ZD=!0,this.ls.xs()}getMinimumSize(){return{x:200,y:200}}}const uf={Disabled:void 0,None:void 0,Ascending:(t,e)=>t.value-e.value,Descending:(t,e)=>e.value-t.value,Alphabetical:(t,e)=>t.category.localeCompare(e.category)},cf={...mh,eB:"vertical",GD:-1,WD:1},df={...ph,eB:"horizontal",GD:1,WD:-1},ff=(t,e,i)=>{const s=[[e.bar]],r=t.valueAxis.getTitle();return r&&s.push([r]),e.subCategory?s.push([e.subCategory,"",{text:ah(t.valueAxis.formatValue(e.bar.getValue()),t.valueAxis),font:{weight:"bold"}}]):s.push({text:ah(t.valueAxis.formatValue(e.bar.getValue()),t.valueAxis),font:{weight:"bold"}}),s};class gf extends na{constructor(t,e,i,s,r,n,o){super(t,e,i,e.wp("gaugeChart bg",0),s,e.ls.Ki.gaugeChartBackgroundFillStyle,e.ls.Ki.gaugeChartBackgroundStrokeStyle,e.ls.Ki.gaugeChartTitleFont,e.ls.Ki.gaugeChartTitleFillStyle,n),this.ql=this.Ki.gaugeChartStartAngle,this.tu=this.Ki.gaugeChartEndAngle,this.dB={start:0,end:100},this.M=0,this.fB=[],this.AB=this.Ki.gaugeChartBarThickness,this.gB=this.Ki.gaugeChartValueIndicatorThickness,this.pB=this.Ki.gaugeChartNeedleLength,this.yB=this.Ki.gaugeChartNeedleThickness,this.mB=this.Ki.gaugeChartNeedleFillStyle,this.vB=this.Ki.gaugeChartNeedleStrokeStyle,this.SB=this.Ki.gaugeChartRoundedEdges,this.xB=!0,this.bB=!0,this.MB=!0,this._B=[],this.wB=[],this.CB=!0,this.kB=!0,this.vy=this.M,this.TB=t=>Number.isInteger(t)?t.toString():t.toFixed(2),this.FB=this.Ki.gaugeChartBarGradient,this.IB=t=>Number.isInteger(t)?t.toString():t.toFixed(2),this.PB=this.Ki.gaugeChartTickFont,this.DB=this.Ki.gaugeChartValueLabelFont,this.BB=this.Ki.gaugeChartValueLabelFillStyle,this.LB=this.Ki.gaugeChartUnitLabelFont,this.RB=this.Ki.gaugeChartUnitLabelFillStyle,this.EB=this.Ki.gaugeChartTickFillStyle,this.zB=this.Ki.gaugeChartBarColor,this.VB=this.Ki.gaugeChartGlowColor,this.OB=this.Ki.gaugeChartGlowColor.getA(),this.NB=1,this.GB=1,this.WB=this.Ki.gaugeChartNeedleAlignment,this.UB=!1,this.YB=this.Ki.gaugeChartGapBetweenBarAndValueIndicators,this.HB=this.Ki.gaugeChartBarStrokeStyle,this.$B=!1,this.ls.Xn(dh.gf),this.mh.gr("Gauge Chart"),this._p(r,this.pg),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.XB=this.zB,this.jB=this.VB,this.ZB=w(0,0,0,0),this.QB=this.ss.wg(),this.JB=this.ss.wg().Ss(this.Ki.effectsText),this.KB=this.op.oc(this.pg).Fe(this.HB).setMouseInteractions(!1),this.qB=this.op.hd(this.pg).lu(0).Ge(360).fu(0).Fe(nt).setMouseInteractions(!1),this.tL=this.kp.Ne(this.pg).Oe(this.Ki.gaugeChartNeedleStrokeStyle).setMouseInteractions(!1),this.iL=this.kp.Ne(this.pg).Oe(new Ji({thickness:this.yB,fillStyle:this.mB})).setMouseInteractions(!1),this.sL=this.kp.Or(this.pg).jh(this.DB).Ie(this.BB).setMouseInteractions(!1),this.Wd=this.kp.Or(this.pg).jh(this.LB).Ie(this.RB).gr("").setMouseInteractions(!1),this.eL=this.op.Or(this.pg).jh(this.PB).Ie(this.EB).setMouseInteractions(!1),this.hL=this.op.Or(this.pg).jh(this.PB).Ie(this.EB).setMouseInteractions(!1),this.QB.fs([this.KB]),this.JB.fs([this.sL,this.Wd,this.eL,this.hL]),this.rL(),this.onResize((()=>{this.UB=!0}))}rL(){this.iL.Oe((t=>t.setThickness(this.yB))),this.tL.Oe((t=>t.setThickness(2*this.vB.getThickness()+this.yB)))}setAnimationsEnabled(t){return this.ah=t,this.kB=t,this.CB=t,this}setInterval(t,e){return this.dB={start:t,end:e},this.UB=!0,this.ls.xs(),this}getInterval(){return this.dB}setTickFillStyle(t){return this.EB="function"==typeof t?t(this.EB):t,this.wB.forEach((e=>{e.start.Ie(t),e.end.Ie(t)})),this.eL.Ie(t),this.hL.Ie(t),this.UB=!0,this.ls.xs(),this}getTickFillStyle(){return this.EB}setTickFont(t){return this.PB="function"==typeof t?t(this.PB):t,this.wB.forEach((e=>{e.start.jh(t),e.end.jh(t)})),this.eL.jh(t),this.hL.jh(t),this.UB=!0,this.ls.xs(),this}getTickFont(){return this.PB}setTickFormatter(t){return this.TB=t,this.UB=!0,this.ls.xs(),this}getTickFormatter(){return this.TB}setValueLabelFillStyle(t){return this.BB="function"==typeof t?t(this.BB):t,this.sL.Ie(t),this.UB=!0,this.ls.xs(),this}getValueLabelFillStyle(){return this.sL.Hh()}setValueLabelFont(t){return this.DB="function"==typeof t?t(this.DB):t,this.sL.jh(t),this.UB=!0,this.ls.xs(),this}getValueLabelFont(){return this.sL.Xh()}setValueFormatter(t){return this.IB="string"==typeof t?e=>t:t,this.UB=!0,this.ls.xs(),this}getValueLabel(){return this.sL._r()||this.IB}setUnitLabelFillStyle(t){return this.RB="function"==typeof t?t(this.RB):t,this.Wd.Ie(t),this.UB=!0,this.ls.xs(),this}getUnitLabelFillStyle(){return this.Wd.Hh()}setUnitLabelFont(t){return this.LB="function"==typeof t?t(this.LB):t,this.Wd.jh(t),this.UB=!0,this.ls.xs(),this}getUnitLabelFont(){return this.Wd.Xh()}setUnitLabel(t){return this.Wd.gr(t),this.UB=!0,this.ls.xs(),this}getUnitLabel(){return this.Wd._r()}setNeedleFillStyle(t){return this.mB="function"==typeof t?t(this.mB):t,this.iL.Oe((e=>e.setFillStyle(t))),this.UB=!0,this.ls.xs(),this}getNeedleFillStyle(){return this.iL.pu().getFillStyle()}setNeedleThickness(t){return this.yB=t,this.rL(),this.UB=!0,this.ls.xs(),this}getNeedleThickness(){return this.yB}setNeedleStrokeStyle(t){return this.vB="function"==typeof t?t(this.vB):t,this.tL.Oe(t),this.rL(),this.UB=!0,this.ls.xs(),this}getNeedleStrokeStyle(){return this.tL.pu()}setNeedleLength(t){return this.pB=t,this.UB=!0,this.ls.xs(),this}getNeedleLength(){return this.pB}setBarColor(t){return this.zB=t,this.UB=!0,this.ls.xs(),this}getBarColor(){return this.XB}setBarGradient(t){return this.FB=t,this.UB=!0,this.ls.xs(),this}getBarGradient(){return this.FB}setBarStrokeStyle(t){return this.HB="function"==typeof t?t(this.HB):t,this.KB.Fe(t),this.UB=!0,this.ls.xs(),this}getBarStrokeStyle(){return this.KB.po()}setBarThickness(t){return this.AB=t,this.UB=!0,this.ls.xs(),this}getBarThickness(){return this.AB}setAngleInterval(t,e){return Math.abs(t-e)>360&&(e=t{t.dispose()})),this._B.length=0,this.wB.forEach((t=>{t.start.dispose(),t.end.dispose()})),this.wB.length=0,this.fB.forEach((t=>{const e=this.op.oc(this.pg).Fe(nt).Ie(new U({color:t.color})).setMouseInteractions(!1);this._B.push(e);const i=this.op.Or(this.pg).jh(this.PB).Ie(this.EB).setMouseInteractions(!1),s=this.op.Or(this.pg).jh(this.PB).Ie(this.EB).setMouseInteractions(!1);this.wB.push({start:i,end:s})})),this.QB.fs([this.KB,...this._B]),this.JB.fs([this.sL,this.Wd,this.eL,this.hL,...this.wB.map((t=>[t.start,t.end])).flat()]),this.UB=!0,this.ls.xs(),this}getValueIndicators(){return this.fB}setValueIndicatorThickness(t){return this.gB=t,this.UB=!0,this.ls.xs(),this}getValueIndicatorThickness(){return this.gB}setAutomaticBarColoring(t){return this.MB=!!t,this.UB=!0,this.ls.xs(),this}getAutomaticBarColoring(){return this.MB}setGlowColor(t){return void 0===t?(this.xB=!1,this.jB=void 0):"object"==typeof t&&"auto"in t?(this.bB=t.auto,t.auto&&(this.jB=void 0),void 0!==t.alpha&&(this.OB=t.alpha),this.xB=!0):(this.jB=t,this.OB=t.getA(),this.bB=!1,this.xB=!0),this.UB=!0,this.ls.xs(),this}getAutomaticGlowColoring(){return this.bB}setNeedleAlignment(t){return this.WB=t,this.UB=!0,this.ls.xs(),this}getNeedleAlignment(){return this.WB}setGapBetweenBarAndValueIndicators(t){return this.YB=t,this.UB=!0,this.ls.xs(),this}getGapBetweenBarAndValueIndicators(){return this.YB}setBarEffect(t){return this.QB.Ss(t),this.ls.xs(),this}getBarEffect(){return this.QB.bs()}setLabelEffect(t){return this.JB.Ss(t),this.ls.xs(),this}getLabelEffect(){return this.JB.bs()}De(t){var i;if(super.De(t),oa.Bp(this.mh,this.Cp),super.Mp(),this.vy!==this.M){if(this.CB){const e=5e-4*t,i=.003*t,s=Math.sign(this.M-this.vy);this.vy=this.vy+e*s+i*this.NB*(this.M-this.vy),s!==Math.sign(this.M-this.vy)?this.vy=this.M:this.ls.xs(!0)}else this.vy=this.M;this.UB=!0}const s=this.fB.find((t=>this.vy>=t.start&&this.vy<=t.end));if(this.XB=this.MB&&s?s.color:this.zB,this.kB){if(this.ZB!==this.XB){const e=this.ZB.getR(),i=this.ZB.getG(),s=this.ZB.getB(),r=this.XB.getR(),n=this.XB.getG(),o=this.XB.getB(),h=Math.sign(r-e),a=Math.sign(n-i),l=Math.sign(o-s),u=.005*t,c=.003*t;this.ZB=w(e+u*h+c*this.GB*(r-e),i+u*a+c*this.GB*(n-i),s+u*l+c*this.GB*(o-s));const d=Math.abs(r-this.ZB.getR()),f=Math.abs(n-this.ZB.getG()),g=Math.abs(o-this.ZB.getB());d<1&&f<1&&g<1?this.ZB=this.XB:this.ls.xs(!0),this.UB=!0}}else this.ZB=this.XB;if(this.UB){let t=Be,r=ze,n=Be,o=ze;if(new Array(100).fill(0).forEach(((e,i,s)=>{const h=this.ql+i/s.length*(this.tu-this.ql),a=Math.sin(h*Math.PI/180),l=Math.cos(h*Math.PI/180);ar&&(r=a),lo&&(o=l)})),this.FB?this.KB.Ie(new J({stops:[{offset:0,color:C("#000000")},{offset:1,color:this.ZB}],position:{x:.5,y:.5}})):this.KB.Ie(new U({color:this.ZB})),this.xB){const t=this.bB&&s?this.ZB:null!==(i=this.jB)&&void 0!==i?i:this.VB;this.qB.Ie(new J({stops:[{offset:0,color:t.setA(this.OB)},{offset:1,color:t.setA(0)}],position:{x:.5,y:.5},extent:e.GradientExtent.farthestSide}))}else this.qB.Ie(B);const h=this.TB(this.dB.start),a=this.TB(this.dB.end);let l=0,u=0;const c=this.ls.Vg.zg(h,this.eL.Xh(),this.eL.Qh()),d=this.ls.Vg.zg(a,this.hL.Xh(),this.hL.Qh());c.x>l&&(l=c.x),c.y>u&&(u=c.y),d.x>l&&(l=d.x),d.y>u&&(u=d.y),this.wB.forEach(((t,e)=>{if(e>=this.fB.length)return;const i=this.fB[e],s=this.TB(i.start),r=this.TB(i.end),n=this.ls.Vg.zg(s,t.start.Xh(),t.start.Qh()),o=this.ls.Vg.zg(r,t.end.Xh(),t.end.Qh());n.x>l&&(l=n.x),n.y>u&&(u=n.y),o.x>l&&(l=o.x),o.y>u&&(u=o.y)}));const f=this.fB.length>0?this.gB:0,g=this.pg.getInnerIntervalPixels(),y=oa.Dp(this.mh,this.Cp),m={x:g.x,y:g.y-y},p={x:.5*m.x,y:.5*m.y},x=f+2*this.YB+this.AB/2,A=l+x,S=u+x,v=S+y,b=g.y-(v+S),M=g.x-(A+A),w=.5*Math.max(this.AB/2,b{var i,s;const r=t.start>=G&&t.end<=X;this._B[e].setVisible(r),this.wB[e].start.setVisible(r),this.wB[e].end.setVisible(r);const n=pf(this.dB,this.ql,this.tu,t.start,k,H),o=pf(this.dB,this.ql,this.tu,t.end,k,H),h=yf(k,Z,n.angle,o.angle,this.gB,this.SB);this._B[e]._l(h);const a=this.dB.start===t.start||this.dB.end===t.start,l=this.dB.start===t.end||this.dB.end===t.end||this.fB.some((e=>e.start===t.end&&e!==t));this.wB[e].start.Be({x:n.x,y:n.y}).Ya({x:Math.min(1,Math.max(-1,2*(n.x-O)/(Y-O)-1)),y:Math.min(1,Math.max(-1,2*(n.y-z)/(N-z)-1))}).gr(null!==(i=t.startLabel)&&void 0!==i?i:a?"":this.TB(t.start)),this.wB[e].end.Be({x:o.x,y:o.y}).Ya({x:Math.min(1,Math.max(-1,2*(o.x-O)/(Y-O)-1)),y:Math.min(1,Math.max(-1,2*(o.y-z)/(N-z)-1))}).gr(null!==(s=t.endLabel)&&void 0!==s?s:l?"":this.TB(t.end))}));const W=this.fB.some((t=>t.start=t.start&&this.dB.start<=t.end:this.dB.start<=t.start&&this.dB.start>=t.end)),j=pf(this.dB,this.ql,this.tu,this.dB.start,k,W?H:Z-this.YB);this.eL.Be({x:j.x,y:j.y}).Ya({x:Math.min(1,Math.max(-1,2*(j.x-O)/(Y-O)-1)),y:Math.min(1,Math.max(-1,2*(j.y-z)/(N-z)-1))}).gr(h);const K=this.fB.some((t=>t.start=t.start&&this.dB.end<=t.end:this.dB.end<=t.start&&this.dB.end>=t.end)),$=pf(this.dB,this.ql,this.tu,this.dB.end,k,K?H:Z-this.YB);this.hL.Be({x:$.x,y:$.y}).Ya({x:Math.min(1,Math.max(-1,2*($.x-O)/(Y-O)-1)),y:Math.min(1,Math.max(-1,2*($.y-z)/(N-z)-1))}).gr(a),this.UB=!1}}getMinimumSize(){return{x:150,y:150}}if(){return[this]}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),t.setMouseInteractions(!1),ce(t,this.Ki,i,{fill:new U({color:this.getBarColor()})}),this}}const yf=(t,e,i,s,r,n=!0)=>{const o=[],h=.5*r,a=i>s,l=Math.sign(i-s),u=-1*l;if(n){const t=h/(2*Math.PI*e)*360+.1;i+=t*u,s+=t*l}else i+=.1*u,s+=.1*l;const c=mf(t,e+h,i,s,a);if(o.push(...c),n){const r={x:t.x+e*Math.cos(s*(Math.PI/180)),y:t.y+e*Math.sin(s*(Math.PI/180))};let n;n=i>s?mf(r,h,s+180,s+360,a):mf(r,h,s-180,s-360,a),o.push(...n)}const d=mf(t,e-h,s,i,!a);if(o.push(...d),n){const r={x:t.x+e*Math.cos(i*(Math.PI/180)),y:t.y+e*Math.sin(i*(Math.PI/180))};let n;n=i>s?mf(r,h,i-180,i-360,a):mf(r,h,i+180,i+360,a),o.push(...n)}return o},mf=(t,e,i,s,r)=>{it>s:t=>t{const[o,h]=t.starte?t.x:t.y,Af=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),Sf=(t,e,i,s,r,n)=>{const o=e.length,h=Math.sign(s),a=[],l=e.reduce(((t,e)=>t+e));for(let t=1;t<=o-1;t+=1)a.push(xf(r,n)*e.slice(0,t).reduce(((t,e)=>t+e),0)/l);const u=a.map((t=>0));let c=a[i-1]+s;for(let e=i;e>0&&eAf(t,h,n,e))).reduce(((t,e)=>Math.max(t,xf(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>xf(r,n)-s||-1===h&&c<0+s){u.fill(0);break}if(e!==i&&(1===h?o>c:oa[e]+t)),f=d.map(((t,e)=>(t-(e>0?d[e-1]:0))/xf(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class vf{constructor(t,e,i,s,n){this.coordsRelative="relative",this.coordsClient="client",this.$i=!1,this.tP=new Array,this.R=new r.Eventer,this.nL=[],this.tp=[],this.oL=void 0,this.aL=!0,this.lL=!0,this.uL=!0,this.hp=!1,this.cL=!0,this.dL=()=>{this.cL=!0,this.ls.xs()},this.fL=[],this.onInViewChange=t=>this.R.on("inViewChange",t),this.offInViewChange=t=>this.R.off(t,"inViewChange"),this.AL=t=>{for(let e=0;e{const e=this.nL.indexOf(t);e>=0&&this.nL.splice(e,1)},this.lp=t=>{const e=this.tp.indexOf(t);e>=0&&this.tp.splice(e,1)},this.pL=(t,e,i,s,r)=>{if(this.yL(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.tP.push(n),this.mL(n),this.aL=!0,t}throw new pt("Out of dashboard range.")},this.vL=e.numberOfRows,this.SL=e.numberOfColumns,this.mA=t,this.xL=e,this.bL=s;const o=this.SL*this.vL;this.ML={x:new Ed(new Array(this.SL).fill(1)),y:new Ed(new Array(this.vL).fill(1))},this.Ki=i.Ki,this._L=this.Ki.dashboardSplitterStyle,this.ah=!1!==(null==e?void 0:e.animationsEnabled),this.wL=Rd(i,o),this.CL=i.GF("dashboard splitters",500001),this.fM=()=>this.wL.NF(),this.gp=this.wL.WF(),this.ss=i.ss.es(this,{kL:{}}),this.ss.kL.Ss(this.Ki.effectsDashboardSplitters);const h=i.oi();this.uiScale=lt.d2({scaleXYConstructor:Bi}).Vi(0,100).Oi(0,100).it(h),this.pg=lt.d2({scaleXYConstructor:Bi}).Vi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).it(h),this.TL=i.FL.bind(i),this.IL=i.PL.bind(i),this.DL=i.BL.bind(i),this.LL=i.RL.bind(i),this.uo=i.uo.bind(i),this.do=i.do.bind(i),this.engine=i.cp,this.ls=i.dp,i.Do((()=>this.dL())),i.xs();const a=i.Ro((t=>{this.hp=t,this.R.emit("inViewChange",this,t)}));this.Sp=i.Eo.bind(i,a),this.EL(),this.setAnimationsEnabled(this.ah);const l=(t=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.R);this.createChartXY=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new wc(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new Cd(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new zc(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=bf(t,this.xL,this.ah),i=e&&e.type?e.type:Ya;return this.pL(new i(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new gf(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=bf(t,this.xL,this.ah),i=e&&e.type?e.type:$c;return this.pL(new i(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=bf(t,this.xL,this.ah),i=t&&t.type?t.type:ld;return this.pL(new i(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new sa(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new Rl(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new Ic(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=bf(t,this.xL,this.ah);return this.pL(new Vl(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=bf(t,this.xL,this.ah),i=new wl(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l,e);return this.pL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=bf(t,this.xL,this.ah),i=new Qd(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l);return this.pL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=bf(t,this.xL,this.ah),i=new lf(this.mA,this.wL.UF(this.zL(t.columnIndex,t.rowIndex)),this.VL(e,this.ML),this.AL,n,l,e);return this.pL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}zL(t,e){return t+e*this.SL}VL(t,e){return{d1:i=>new i.scale1DConstructor("x"===i.dimension?t.columnIndex:t.rowIndex,"x"===i.dimension?t.columnSpan:t.rowSpan,"x"===i.dimension?this.SL:this.vL,"x"===i.dimension?e.x:e.y),d2:i=>(new i.scaleXYConstructor).ct({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.SL,y:this.vL},e),d3:()=>new ht({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.SL,y:this.vL},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.TL(t[0]),this.IL(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.DL(t[0]),this.LL(t[1]),this}getWidth(){return this.uo()}getHeight(){return this.do()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.CL.xs(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.CL.xs(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.Ki}setSplitterStyle(t){const e=this._L;return this._L="function"==typeof t?t(this._L):t,this.OL(e),this}getSplitterStyle(){return this._L}setSplitterEffect(t){return this.ss.kL.Ss(t),this.ls.xs(),this}getSplitterEffect(){return this.ss.kL.bs()}setAnimationHighlight(t){return this.uL=t,this.fL.forEach((e=>this.ls.os.Cs(e.line,t))),this}getAnimationHighlight(){return this.uL}OL(t){for(const t of this.fL)t.line.Oe(this._L);this.EL()}setColumnWidth(t,e){const i=this.ML.x.C();return t>=0&&t=e.length)throw new pt("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.ML.y.C();return t>=0&&t=e.length)throw new pt("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this.pg.getInnerIntervalPixels()}onResize(t){return this.R.on("resize",t)}offResize(t){return this.R.off(t,"resize")}NL(t,e,i){if(i&&Math.abs(t.x)>0)this.GL(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.WL(e,t.y)}for(const t of this.tP)t.panel.K();this.dL()}WL(t,e){const i=Sf(this.tP,this.ML.y.C(),t,e,this.pg.oi(),!1);this.ML.y._(i),this.dL()}GL(t,e){const i=Sf(this.tP,this.ML.x.C(),t,e,this.pg.oi(),!0);this.ML.x._(i),this.dL()}UL(){this.fL.forEach((t=>t.line.dispose())),this.fL.length=0;for(let t=1;t<=this.SL-1;t+=1)for(let e=0;e<=this.vL-1;e+=1)if(void 0!==this.tP.find((i=>je(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=ji(new $i((()=>{this.YL(t)}),((e,i,s,r,n)=>{this.NL(r,t,!0),Qt(n)}),(()=>{this.HL(t)}))),s=this.CL.Ne(this.pg).Oe(this._L).setMouseEnterEventHandler((()=>{this.YL(t)})).setMouseLeaveEventHandler((()=>{this.HL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.NL(n,t,!0),Qt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.ls.os.ns(s,(t=>s.us(t)),{animationEnabled:this.uL}),this.fL.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.vL-1;t+=1)for(let e=0;e<=this.SL-1;e+=1)if(void 0!==this.tP.find((i=>je(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=ji(new $i((()=>{this.$L(t)}),((e,i,s,r,n)=>{this.NL(r,t,!1),Qt(n)}),(()=>{this.XL(t)}))),s=this.CL.Ne(this.pg).Oe(this._L).setMouseEnterEventHandler((()=>{this.$L(t)})).setMouseLeaveEventHandler((()=>{this.XL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.NL(n,t,!1),Qt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.ls.os.ns(s,(t=>s.us(t)),{animationEnabled:this.uL}),this.fL.push({row:t,column:e,line:s,alignment:"horizontal"})}this.ss.kL.fs(this.fL.map((t=>t.line)))}jL(){const t=this.pg.oi(),e=this.ML.x.C(),i=e.reduce(((t,e)=>t+e)),s=this.ML.y.C(),r=s.reduce(((t,e)=>t+e));this.fL.forEach((n=>{if("vertical"===n.alignment){const o=u(t.x*e.slice(0,n.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,n.row).reduce(((t,e)=>t+e),0)/r),h=u(o.x,t.y*s.slice(0,n.row+1).reduce(((t,e)=>t+e),0)/r);n.line.We(o).Ge(h)}else{const o=u(t.x*e.slice(0,n.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,n.row).reduce(((t,e)=>t+e),0)/r),h=u(t.x*e.slice(0,n.column+1).reduce(((t,e)=>t+e),0)/i,o.y);n.line.We(o).Ge(h)}}))}YL(t){this.fL.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.ls.os.ws(e.line,1),this.CL.ZL(e.line))})),this.oL=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.ls.xs()}$L(t){this.fL.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.ls.os.ws(e.line,1),this.CL.ZL(e.line))})),this.oL=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.ls.xs()}HL(t){this.fL.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.ls.os.ws(e.line,0)})),this.engine.restoreMouseStyle(this.oL),this.ls.xs()}XL(t){this.fL.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.ls.os.ws(e.line,0)})),this.engine.restoreMouseStyle(this.oL),this.ls.xs()}setAnimationsEnabled(t){return this.ah=t,this.getCells().filter((t=>t.panel instanceof na)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.ah),this}getAnimationsEnabled(){return this.ah}getCells(){return this.tP.slice()}dispose(){return this.$i||(this.Sp&&this.Sp(),this.tP.slice().forEach((t=>t.panel.dispose())),this.nL.slice().forEach((t=>t.dispose())),this.tp.slice().forEach((t=>t.dispose())),this.$i=!0,this.bL(),this.R.emit("dispose",this)),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}getIsInView(){return this.hp}saveToFile(t,e,i){return Qh(this.engine,t,e,i),this}QL(t){if(this.cL){const t=this.ls.At.oi(),e=t.x,i=t.y;this.uiScale.it(e,i),this.pg.it(e,i);const s=this.uiScale.getInnerIntervalPixels();this.pg.Vi(0,s.x).Oi(0,s.y),this.R.emit("resize",this,s.x,s.y,e,i),this.lL=!0}this.aL&&(this.UL(),this.aL=!1,this.lL=!0),this.lL&&(this.jL(),this.lL=!1);for(const e of this.tP)e.panel.De(t);return this.nL.forEach((t=>t.Ls())),this.nL.forEach((t=>t.De())),this.tp.forEach((t=>t.Ls())),this.tp.forEach((t=>t.De())),this.cL=!1,this}J(){for(const t of this.tP)t.panel.J();return this.pg.x.J(),this.pg.y.J(),this.uiScale.x.J(),this.uiScale.y.J(),this}K(){for(const t of this.tP)t.panel.K();return this.pg.x.K(),this.pg.y.K(),this.uiScale.x.K(),this.uiScale.y.K(),this}translateCoordinate(t,e,i){return ta(t,e,i,this.pg,this.ls)}addUIElement(t=Oo,e=this.uiScale){e=Jh(e,this.pg);const i=qh(t,this.fM(),this.uiScale,e,this.gL,this.Ki);return this.nL.push(i),i}addLegendBox(t=qo,i=this.uiScale){i=Jh(i,this.pg);const s=qh(t,this.gp,this.uiScale,i,this.lp,this.Ki);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.tp.push(s),s}getLegendBoxes(){return this.tp}yL(t,e,i,s){return e>=0&&t>=0&&e+s<=this.vL&&t+i<=this.SL}mL(t){const e=this._L,i=e===nt?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.zr(s)}EL(){this.uiScale.x.si([0,0]),this.uiScale.y.si([0,0]),this.pg.x.si([0,0]),this.pg.y.si([0,0]);for(const t of this.tP)this.mL(t);this.ls.xs()}}const bf=(t,e,i)=>{const s={...t,columnSpan:t.columnSpan||1,rowSpan:t.rowSpan||1,animationsEnabled:void 0!==t.animationsEnabled?t.animationsEnabled:i};var r,n;return s.rowIndex=(r=s.rowIndex,n=s.rowSpan,e.numberOfRows-(r+n)),s},Mf={XY:ac,Spider:ba,BarChart:Ma,Map:Ra,Polar:Ta,D3:Ml},wf={Angola:{name:"Angola",ISO_A3:"AGO"},Burundi:{name:"Burundi",ISO_A3:"BDI"},Benin:{name:"Benin",ISO_A3:"BEN"},"Burkina Faso":{name:"Burkina Faso",ISO_A3:"BFA"},Botswana:{name:"Botswana",ISO_A3:"BWA"},"Central African Republic":{name:"Central African Republic",ISO_A3:"CAF"},"Ivory Coast":{name:"Ivory Coast",ISO_A3:"CIV"},Cameroon:{name:"Cameroon",ISO_A3:"CMR"},"Democratic Republic of the Congo":{name:"Democratic Republic of the Congo",ISO_A3:"COD"},"Republic of Congo":{name:"Republic of Congo",ISO_A3:"COG"},Comoros:{name:"Comoros",ISO_A3:"COM"},"Cape Verde":{name:"Cape Verde",ISO_A3:"CPV"},Djibouti:{name:"Djibouti",ISO_A3:"DJI"},Algeria:{name:"Algeria",ISO_A3:"DZA"},Egypt:{name:"Egypt",ISO_A3:"EGY"},Eritrea:{name:"Eritrea",ISO_A3:"ERI"},Ethiopia:{name:"Ethiopia",ISO_A3:"ETH"},Gabon:{name:"Gabon",ISO_A3:"GAB"},Ghana:{name:"Ghana",ISO_A3:"GHA"},Guinea:{name:"Guinea",ISO_A3:"GIN"},Gambia:{name:"Gambia",ISO_A3:"GMB"},"Guinea Bissau":{name:"Guinea Bissau",ISO_A3:"GNB"},"Equatorial Guinea":{name:"Equatorial Guinea",ISO_A3:"GNQ"},Israel:{name:"Israel",ISO_A3:"ISR"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Kenya:{name:"Kenya",ISO_A3:"KEN"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},Liberia:{name:"Liberia",ISO_A3:"LBR"},Libya:{name:"Libya",ISO_A3:"LBY"},Lesotho:{name:"Lesotho",ISO_A3:"LSO"},Morocco:{name:"Morocco",ISO_A3:"MAR"},Madagascar:{name:"Madagascar",ISO_A3:"MDG"},Mali:{name:"Mali",ISO_A3:"MLI"},Malta:{name:"Malta",ISO_A3:"MLT"},Mozambique:{name:"Mozambique",ISO_A3:"MOZ"},Mauritania:{name:"Mauritania",ISO_A3:"MRT"},Mauritius:{name:"Mauritius",ISO_A3:"MUS"},Malawi:{name:"Malawi",ISO_A3:"MWI"},Namibia:{name:"Namibia",ISO_A3:"NAM"},Niger:{name:"Niger",ISO_A3:"NER"},Nigeria:{name:"Nigeria",ISO_A3:"NGA"},Oman:{name:"Oman",ISO_A3:"OMN"},Rwanda:{name:"Rwanda",ISO_A3:"RWA"},"Western Sahara":{name:"Western Sahara",ISO_A3:"ESH"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Sudan:{name:"Sudan",ISO_A3:"SDN"},"South Sudan":{name:"South Sudan",ISO_A3:"SSD"},Senegal:{name:"Senegal",ISO_A3:"SEN"},"Saint Helena":{name:"Saint Helena",ISO_A3:"SHN"},"Sierra Leone":{name:"Sierra Leone",ISO_A3:"SLE"},Somalia:{name:"Somalia",ISO_A3:"SOM"},Swaziland:{name:"Swaziland",ISO_A3:"SWZ"},Seychelles:{name:"Seychelles",ISO_A3:"SYC"},Syria:{name:"Syria",ISO_A3:"SYR"},Chad:{name:"Chad",ISO_A3:"TCD"},Togo:{name:"Togo",ISO_A3:"TGO"},Tunisia:{name:"Tunisia",ISO_A3:"TUN"},"United Republic of Tanzania":{name:"United Republic of Tanzania",ISO_A3:"TZA"},Uganda:{name:"Uganda",ISO_A3:"UGA"},Yemen:{name:"Yemen",ISO_A3:"YEM"},"South Africa":{name:"South Africa",ISO_A3:"ZAF"},Zambia:{name:"Zambia",ISO_A3:"ZMB"},Zimbabwe:{name:"Zimbabwe",ISO_A3:"ZWE"}},Cf={Afghanistan:{name:"Afghanistan",ISO_A3:"AFG"},"United Arab Emirates":{name:"United Arab Emirates",ISO_A3:"ARE"},Armenia:{name:"Armenia",ISO_A3:"ARM"},Australia:{name:"Australia",ISO_A3:"AUS"},Azerbaijan:{name:"Azerbaijan",ISO_A3:"AZE"},Bangladesh:{name:"Bangladesh",ISO_A3:"BGD"},Bahrain:{name:"Bahrain",ISO_A3:"BHR"},Brunei:{name:"Brunei",ISO_A3:"BRN"},Bhutan:{name:"Bhutan",ISO_A3:"BTN"},China:{name:"China",ISO_A3:"CHN"},Georgia:{name:"Georgia",ISO_A3:"GEO"},Indonesia:{name:"Indonesia",ISO_A3:"IDN"},India:{name:"India",ISO_A3:"IND"},Iran:{name:"Iran",ISO_A3:"IRN"},Iraq:{name:"Iraq",ISO_A3:"IRQ"},Israel:{name:"Israel",ISO_A3:"ISR"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Japan:{name:"Japan",ISO_A3:"JPN"},Kazakhstan:{name:"Kazakhstan",ISO_A3:"KAZ"},Kyrgyzstan:{name:"Kyrgyzstan",ISO_A3:"KGZ"},Cambodia:{name:"Cambodia",ISO_A3:"KHM"},"South Korea":{name:"South Korea",ISO_A3:"KOR"},Kuwait:{name:"Kuwait",ISO_A3:"KWT"},Laos:{name:"Laos",ISO_A3:"LAO"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},"Sri Lanka":{name:"Sri Lanka",ISO_A3:"LKA"},Maldives:{name:"Maldives",ISO_A3:"MDV"},Myanmar:{name:"Myanmar",ISO_A3:"MMR"},Mongolia:{name:"Mongolia",ISO_A3:"MNG"},Malaysia:{name:"Malaysia",ISO_A3:"MYS"},Nepal:{name:"Nepal",ISO_A3:"NPL"},Oman:{name:"Oman",ISO_A3:"OMN"},Pakistan:{name:"Pakistan",ISO_A3:"PAK"},Philippines:{name:"Philippines",ISO_A3:"PHL"},"Papua New Guinea":{name:"Papua New Guinea",ISO_A3:"PNG"},"North Korea":{name:"North Korea",ISO_A3:"PRK"},Palestine:{name:"Palestine",ISO_A3:"PSE"},Qatar:{name:"Qatar",ISO_A3:"QAT"},Russia:{name:"Russia",ISO_A3:"RUS"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Singapore:{name:"Singapore",ISO_A3:"SGP"},Syria:{name:"Syria",ISO_A3:"SYR"},Thailand:{name:"Thailand",ISO_A3:"THA"},Tajikistan:{name:"Tajikistan",ISO_A3:"TJK"},Turkmenistan:{name:"Turkmenistan",ISO_A3:"TKM"},Turkey:{name:"Turkey",ISO_A3:"TUR"},Taiwan:{name:"Taiwan",ISO_A3:"TWN"},Uzbekistan:{name:"Uzbekistan",ISO_A3:"UZB"},Vietnam:{name:"Vietnam",ISO_A3:"VNM"},Yemen:{name:"Yemen",ISO_A3:"YEM"}},Tf={"New South Wales":{name:"New South Wales"},Victoria:{name:"Victoria"},Queensland:{name:"Queensland"},"South Australia":{name:"South Australia"},"Western Australia":{name:"Western Australia"},Tasmania:{name:"Tasmania"},"Northern Territory":{name:"Northern Territory"},"Australian Capital Territory":{name:"Australian Capital Territory"},"Other Territories":{name:"Other Territories"}},Rf={"British Columbia":{name:"British Columbia"},Quebec:{name:"Quebec"},Nunavut:{name:"Nunavut"},"Prince Edward Island":{name:"Prince Edward Island"},Saskatchewan:{name:"Saskatchewan"},Yukon:{name:"Yukon"},Manitoba:{name:"Manitoba"},Ontario:{name:"Ontario"},"New Brunswick":{name:"New Brunswick"},"Northwest Territories":{name:"Northwest Territories"},Alberta:{name:"Alberta"},"Newfoundland and Labrador":{name:"Newfoundland and Labrador"},"Nova Scotia":{name:"Nova Scotia"}},Ef={Albania:{name:"Albania",ISO_A3:"ALB"},Austria:{name:"Austria",ISO_A3:"AUT"},Belarus:{name:"Belarus",ISO_A3:"BLR"},Belgium:{name:"Belgium",ISO_A3:"BEL"},Bulgaria:{name:"Bulgaria",ISO_A3:"BGR"},"Bosnia and Herzegovina":{name:"Bosnia and Herzegovina",ISO_A3:"BIH"},Switzerland:{name:"Switzerland",ISO_A3:"CHE"},Cyprus:{name:"Cyprus",ISO_A3:"CYP"},"Czech Republic":{name:"Czech Republic",ISO_A3:"CZE"},Germany:{name:"Germany",ISO_A3:"DEU"},Denmark:{name:"Denmark",ISO_A3:"DNK"},Spain:{name:"Spain",ISO_A3:"ESP"},Estonia:{name:"Estonia",ISO_A3:"EST"},Finland:{name:"Finland",ISO_A3:"FIN"},France:{name:"France",ISO_A3:"FRA"},"United Kingdom":{name:"United Kingdom",ISO_A3:"GBR"},Greece:{name:"Greece",ISO_A3:"GRC"},Croatia:{name:"Croatia",ISO_A3:"HRV"},Hungary:{name:"Hungary",ISO_A3:"HUN"},Ireland:{name:"Ireland",ISO_A3:"IRL"},Iceland:{name:"Iceland",ISO_A3:"ISL"},Italy:{name:"Italy",ISO_A3:"ITA"},Kosovo:{name:"Kosovo",ISO_A3:"-99"},Lithuania:{name:"Lithuania",ISO_A3:"LTU"},Luxembourg:{name:"Luxembourg",ISO_A3:"LUX"},Latvia:{name:"Latvia",ISO_A3:"LVA"},Macedonia:{name:"Macedonia",ISO_A3:"MKD"},Malta:{name:"Malta",ISO_A3:"MLT"},Montenegro:{name:"Montenegro",ISO_A3:"MNE"},Netherlands:{name:"Netherlands",ISO_A3:"NLD"},Norway:{name:"Norway",ISO_A3:"NOR"},Poland:{name:"Poland",ISO_A3:"POL"},Portugal:{name:"Portugal",ISO_A3:"PRT"},Romania:{name:"Romania",ISO_A3:"ROU"},"Republic of Serbia":{name:"Republic of Serbia",ISO_A3:"SRB"},Slovakia:{name:"Slovakia",ISO_A3:"SVK"},Slovenia:{name:"Slovenia",ISO_A3:"SVN"},Sweden:{name:"Sweden",ISO_A3:"SWE"},Ukraine:{name:"Ukraine",ISO_A3:"UKR"},Moldova:{name:"Moldova",ISO_A3:"MDA"},Russia:{name:"Russia",ISO_A3:"RUS"},Turkey:{name:"Turkey",ISO_A3:"TUR"}},kf={Aruba:{name:"Aruba",ISO_A3:"ABW"},Afghanistan:{name:"Afghanistan",ISO_A3:"AFG"},Angola:{name:"Angola",ISO_A3:"AGO"},Anguilla:{name:"Anguilla",ISO_A3:"AIA"},Albania:{name:"Albania",ISO_A3:"ALB"},Aland:{name:"Aland",ISO_A3:"ALA"},Andorra:{name:"Andorra",ISO_A3:"AND"},"United Arab Emirates":{name:"United Arab Emirates",ISO_A3:"ARE"},Argentina:{name:"Argentina",ISO_A3:"ARG"},Armenia:{name:"Armenia",ISO_A3:"ARM"},"American Samoa":{name:"American Samoa",ISO_A3:"ASM"},Antarctica:{name:"Antarctica",ISO_A3:"ATA"},"French Southern and Antarctic Lands":{name:"French Southern and Antarctic Lands",ISO_A3:"ATF"},"Antigua and Barbuda":{name:"Antigua and Barbuda",ISO_A3:"ATG"},Australia:{name:"Australia",ISO_A3:"AUS"},Austria:{name:"Austria",ISO_A3:"AUT"},Azerbaijan:{name:"Azerbaijan",ISO_A3:"AZE"},Burundi:{name:"Burundi",ISO_A3:"BDI"},Belgium:{name:"Belgium",ISO_A3:"BEL"},Benin:{name:"Benin",ISO_A3:"BEN"},"Burkina Faso":{name:"Burkina Faso",ISO_A3:"BFA"},Bangladesh:{name:"Bangladesh",ISO_A3:"BGD"},Bulgaria:{name:"Bulgaria",ISO_A3:"BGR"},Bahrain:{name:"Bahrain",ISO_A3:"BHR"},"The Bahamas":{name:"The Bahamas",ISO_A3:"BHS"},"Bosnia and Herzegovina":{name:"Bosnia and Herzegovina",ISO_A3:"BIH"},Belarus:{name:"Belarus",ISO_A3:"BLR"},Belize:{name:"Belize",ISO_A3:"BLZ"},Bermuda:{name:"Bermuda",ISO_A3:"BMU"},Bolivia:{name:"Bolivia",ISO_A3:"BOL"},Brazil:{name:"Brazil",ISO_A3:"BRA"},Barbados:{name:"Barbados",ISO_A3:"BRB"},Brunei:{name:"Brunei",ISO_A3:"BRN"},Bhutan:{name:"Bhutan",ISO_A3:"BTN"},Botswana:{name:"Botswana",ISO_A3:"BWA"},"Central African Republic":{name:"Central African Republic",ISO_A3:"CAF"},Canada:{name:"Canada",ISO_A3:"CAN"},Switzerland:{name:"Switzerland",ISO_A3:"CHE"},Chile:{name:"Chile",ISO_A3:"CHL"},China:{name:"China",ISO_A3:"CHN"},"Ivory Coast":{name:"Ivory Coast",ISO_A3:"CIV"},Cameroon:{name:"Cameroon",ISO_A3:"CMR"},"Cyprus No Mans Area":{name:"Cyprus No Mans Area",ISO_A3:"-99"},"Democratic Republic of the Congo":{name:"Democratic Republic of the Congo",ISO_A3:"COD"},"Republic of Congo":{name:"Republic of Congo",ISO_A3:"COG"},"Cook Islands":{name:"Cook Islands",ISO_A3:"COK"},Colombia:{name:"Colombia",ISO_A3:"COL"},Comoros:{name:"Comoros",ISO_A3:"COM"},"Cape Verde":{name:"Cape Verde",ISO_A3:"CPV"},"Costa Rica":{name:"Costa Rica",ISO_A3:"CRI"},Cuba:{name:"Cuba",ISO_A3:"CUB"},Curaçao:{name:"Curaçao",ISO_A3:"CUW"},"Cayman Islands":{name:"Cayman Islands",ISO_A3:"CYM"},"Northern Cyprus":{name:"Northern Cyprus",ISO_A3:"-99"},Cyprus:{name:"Cyprus",ISO_A3:"CYP"},"Czech Republic":{name:"Czech Republic",ISO_A3:"CZE"},Germany:{name:"Germany",ISO_A3:"DEU"},Djibouti:{name:"Djibouti",ISO_A3:"DJI"},Dominica:{name:"Dominica",ISO_A3:"DMA"},Denmark:{name:"Denmark",ISO_A3:"DNK"},"Dominican Republic":{name:"Dominican Republic",ISO_A3:"DOM"},Algeria:{name:"Algeria",ISO_A3:"DZA"},Ecuador:{name:"Ecuador",ISO_A3:"ECU"},Egypt:{name:"Egypt",ISO_A3:"EGY"},Eritrea:{name:"Eritrea",ISO_A3:"ERI"},"Dhekelia Sovereign Base Area":{name:"Dhekelia Sovereign Base Area",ISO_A3:"-99"},Spain:{name:"Spain",ISO_A3:"ESP"},Estonia:{name:"Estonia",ISO_A3:"EST"},Ethiopia:{name:"Ethiopia",ISO_A3:"ETH"},Finland:{name:"Finland",ISO_A3:"FIN"},Fiji:{name:"Fiji",ISO_A3:"FJI"},"Falkland Islands":{name:"Falkland Islands",ISO_A3:"FLK"},France:{name:"France",ISO_A3:"FRA"},"Faroe Islands":{name:"Faroe Islands",ISO_A3:"FRO"},"Federated States of Micronesia":{name:"Federated States of Micronesia",ISO_A3:"FSM"},Gabon:{name:"Gabon",ISO_A3:"GAB"},"United Kingdom":{name:"United Kingdom",ISO_A3:"GBR"},Georgia:{name:"Georgia",ISO_A3:"GEO"},Guernsey:{name:"Guernsey",ISO_A3:"GGY"},Ghana:{name:"Ghana",ISO_A3:"GHA"},Guinea:{name:"Guinea",ISO_A3:"GIN"},Gambia:{name:"Gambia",ISO_A3:"GMB"},"Guinea Bissau":{name:"Guinea Bissau",ISO_A3:"GNB"},"Equatorial Guinea":{name:"Equatorial Guinea",ISO_A3:"GNQ"},Greece:{name:"Greece",ISO_A3:"GRC"},Grenada:{name:"Grenada",ISO_A3:"GRD"},Greenland:{name:"Greenland",ISO_A3:"GRL"},Guatemala:{name:"Guatemala",ISO_A3:"GTM"},Guam:{name:"Guam",ISO_A3:"GUM"},Guyana:{name:"Guyana",ISO_A3:"GUY"},"Hong Kong S.A.R.":{name:"Hong Kong S.A.R.",ISO_A3:"HKG"},"Heard Island and McDonald Islands":{name:"Heard Island and McDonald Islands",ISO_A3:"HMD"},Honduras:{name:"Honduras",ISO_A3:"HND"},Croatia:{name:"Croatia",ISO_A3:"HRV"},Haiti:{name:"Haiti",ISO_A3:"HTI"},Hungary:{name:"Hungary",ISO_A3:"HUN"},Indonesia:{name:"Indonesia",ISO_A3:"IDN"},"Isle of Man":{name:"Isle of Man",ISO_A3:"IMN"},India:{name:"India",ISO_A3:"IND"},"Indian Ocean Territories":{name:"Indian Ocean Territories",ISO_A3:"-99"},"British Indian Ocean Territory":{name:"British Indian Ocean Territory",ISO_A3:"IOT"},Ireland:{name:"Ireland",ISO_A3:"IRL"},Iran:{name:"Iran",ISO_A3:"IRN"},Iraq:{name:"Iraq",ISO_A3:"IRQ"},Iceland:{name:"Iceland",ISO_A3:"ISL"},Israel:{name:"Israel",ISO_A3:"ISR"},Italy:{name:"Italy",ISO_A3:"ITA"},Jamaica:{name:"Jamaica",ISO_A3:"JAM"},Jersey:{name:"Jersey",ISO_A3:"JEY"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Japan:{name:"Japan",ISO_A3:"JPN"},"Baykonur Cosmodrome":{name:"Baykonur Cosmodrome",ISO_A3:"-99"},"Siachen Glacier":{name:"Siachen Glacier",ISO_A3:"-99"},Kazakhstan:{name:"Kazakhstan",ISO_A3:"KAZ"},Kenya:{name:"Kenya",ISO_A3:"KEN"},Kyrgyzstan:{name:"Kyrgyzstan",ISO_A3:"KGZ"},Cambodia:{name:"Cambodia",ISO_A3:"KHM"},Kiribati:{name:"Kiribati",ISO_A3:"KIR"},"Saint Kitts and Nevis":{name:"Saint Kitts and Nevis",ISO_A3:"KNA"},"South Korea":{name:"South Korea",ISO_A3:"KOR"},Kosovo:{name:"Kosovo",ISO_A3:"-99"},Kuwait:{name:"Kuwait",ISO_A3:"KWT"},Laos:{name:"Laos",ISO_A3:"LAO"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},Liberia:{name:"Liberia",ISO_A3:"LBR"},Libya:{name:"Libya",ISO_A3:"LBY"},"Saint Lucia":{name:"Saint Lucia",ISO_A3:"LCA"},Liechtenstein:{name:"Liechtenstein",ISO_A3:"LIE"},"Sri Lanka":{name:"Sri Lanka",ISO_A3:"LKA"},Lesotho:{name:"Lesotho",ISO_A3:"LSO"},Lithuania:{name:"Lithuania",ISO_A3:"LTU"},Luxembourg:{name:"Luxembourg",ISO_A3:"LUX"},Latvia:{name:"Latvia",ISO_A3:"LVA"},"Macao S.A.R":{name:"Macao S.A.R",ISO_A3:"MAC"},"Saint Martin":{name:"Saint Martin",ISO_A3:"MAF"},Morocco:{name:"Morocco",ISO_A3:"MAR"},Moldova:{name:"Moldova",ISO_A3:"MDA"},Madagascar:{name:"Madagascar",ISO_A3:"MDG"},Maldives:{name:"Maldives",ISO_A3:"MDV"},Mexico:{name:"Mexico",ISO_A3:"MEX"},"Marshall Islands":{name:"Marshall Islands",ISO_A3:"MHL"},Macedonia:{name:"Macedonia",ISO_A3:"MKD"},Mali:{name:"Mali",ISO_A3:"MLI"},Malta:{name:"Malta",ISO_A3:"MLT"},Myanmar:{name:"Myanmar",ISO_A3:"MMR"},Montenegro:{name:"Montenegro",ISO_A3:"MNE"},Mongolia:{name:"Mongolia",ISO_A3:"MNG"},"Northern Mariana Islands":{name:"Northern Mariana Islands",ISO_A3:"MNP"},Mozambique:{name:"Mozambique",ISO_A3:"MOZ"},Mauritania:{name:"Mauritania",ISO_A3:"MRT"},Montserrat:{name:"Montserrat",ISO_A3:"MSR"},Mauritius:{name:"Mauritius",ISO_A3:"MUS"},Malawi:{name:"Malawi",ISO_A3:"MWI"},Malaysia:{name:"Malaysia",ISO_A3:"MYS"},Namibia:{name:"Namibia",ISO_A3:"NAM"},"New Caledonia":{name:"New Caledonia",ISO_A3:"NCL"},Niger:{name:"Niger",ISO_A3:"NER"},Nigeria:{name:"Nigeria",ISO_A3:"NGA"},Nicaragua:{name:"Nicaragua",ISO_A3:"NIC"},Niue:{name:"Niue",ISO_A3:"NIU"},Netherlands:{name:"Netherlands",ISO_A3:"NLD"},Norway:{name:"Norway",ISO_A3:"NOR"},Nepal:{name:"Nepal",ISO_A3:"NPL"},"New Zealand":{name:"New Zealand",ISO_A3:"NZL"},Oman:{name:"Oman",ISO_A3:"OMN"},Pakistan:{name:"Pakistan",ISO_A3:"PAK"},Panama:{name:"Panama",ISO_A3:"PAN"},"Pitcairn Islands":{name:"Pitcairn Islands",ISO_A3:"PCN"},Peru:{name:"Peru",ISO_A3:"PER"},"Spratly Islands":{name:"Spratly Islands",ISO_A3:"-99"},Philippines:{name:"Philippines",ISO_A3:"PHL"},Palau:{name:"Palau",ISO_A3:"PLW"},"Papua New Guinea":{name:"Papua New Guinea",ISO_A3:"PNG"},Poland:{name:"Poland",ISO_A3:"POL"},"Puerto Rico":{name:"Puerto Rico",ISO_A3:"PRI"},"North Korea":{name:"North Korea",ISO_A3:"PRK"},Portugal:{name:"Portugal",ISO_A3:"PRT"},Paraguay:{name:"Paraguay",ISO_A3:"PRY"},Palestine:{name:"Palestine",ISO_A3:"PSE"},"French Polynesia":{name:"French Polynesia",ISO_A3:"PYF"},Qatar:{name:"Qatar",ISO_A3:"QAT"},Romania:{name:"Romania",ISO_A3:"ROU"},Russia:{name:"Russia",ISO_A3:"RUS"},Rwanda:{name:"Rwanda",ISO_A3:"RWA"},"Western Sahara":{name:"Western Sahara",ISO_A3:"ESH"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Sudan:{name:"Sudan",ISO_A3:"SDN"},"South Sudan":{name:"South Sudan",ISO_A3:"SSD"},Senegal:{name:"Senegal",ISO_A3:"SEN"},Singapore:{name:"Singapore",ISO_A3:"SGP"},"South Georgia and South Sandwich Islands":{name:"South Georgia and South Sandwich Islands",ISO_A3:"SGS"},"Saint Helena":{name:"Saint Helena",ISO_A3:"SHN"},"Solomon Islands":{name:"Solomon Islands",ISO_A3:"SLB"},"Sierra Leone":{name:"Sierra Leone",ISO_A3:"SLE"},"El Salvador":{name:"El Salvador",ISO_A3:"SLV"},Somalia:{name:"Somalia",ISO_A3:"SOM"},"Saint Pierre and Miquelon":{name:"Saint Pierre and Miquelon",ISO_A3:"SPM"},"Republic of Serbia":{name:"Republic of Serbia",ISO_A3:"SRB"},"Sao Tome and Principe":{name:"Sao Tome and Principe",ISO_A3:"STP"},Suriname:{name:"Suriname",ISO_A3:"SUR"},Slovakia:{name:"Slovakia",ISO_A3:"SVK"},Slovenia:{name:"Slovenia",ISO_A3:"SVN"},Sweden:{name:"Sweden",ISO_A3:"SWE"},Swaziland:{name:"Swaziland",ISO_A3:"SWZ"},Seychelles:{name:"Seychelles",ISO_A3:"SYC"},Syria:{name:"Syria",ISO_A3:"SYR"},"Turks and Caicos Islands":{name:"Turks and Caicos Islands",ISO_A3:"TCA"},Chad:{name:"Chad",ISO_A3:"TCD"},Togo:{name:"Togo",ISO_A3:"TGO"},Thailand:{name:"Thailand",ISO_A3:"THA"},Tajikistan:{name:"Tajikistan",ISO_A3:"TJK"},Turkmenistan:{name:"Turkmenistan",ISO_A3:"TKM"},"East Timor":{name:"East Timor",ISO_A3:"TLS"},Tonga:{name:"Tonga",ISO_A3:"TON"},"Trinidad and Tobago":{name:"Trinidad and Tobago",ISO_A3:"TTO"},Tunisia:{name:"Tunisia",ISO_A3:"TUN"},Turkey:{name:"Turkey",ISO_A3:"TUR"},Tuvalu:{name:"Tuvalu",ISO_A3:"TUV"},Taiwan:{name:"Taiwan",ISO_A3:"TWN"},"United Republic of Tanzania":{name:"United Republic of Tanzania",ISO_A3:"TZA"},Uganda:{name:"Uganda",ISO_A3:"UGA"},Ukraine:{name:"Ukraine",ISO_A3:"UKR"},"United States Minor Outlying Islands":{name:"United States Minor Outlying Islands",ISO_A3:"UMI"},Uruguay:{name:"Uruguay",ISO_A3:"URY"},"United States of America":{name:"United States of America",ISO_A3:"USA"},"US Naval Base Guantanamo Bay":{name:"US Naval Base Guantanamo Bay",ISO_A3:"-99"},Uzbekistan:{name:"Uzbekistan",ISO_A3:"UZB"},"Saint Vincent and the Grenadines":{name:"Saint Vincent and the Grenadines",ISO_A3:"VCT"},Venezuela:{name:"Venezuela",ISO_A3:"VEN"},"British Virgin Islands":{name:"British Virgin Islands",ISO_A3:"VGB"},"United States Virgin Islands":{name:"United States Virgin Islands",ISO_A3:"VIR"},Vietnam:{name:"Vietnam",ISO_A3:"VNM"},Vanuatu:{name:"Vanuatu",ISO_A3:"VUT"},"Wallis and Futuna":{name:"Wallis and Futuna",ISO_A3:"WLF"},"Akrotiri Sovereign Base Area":{name:"Akrotiri Sovereign Base Area",ISO_A3:"-99"},Samoa:{name:"Samoa",ISO_A3:"WSM"},Yemen:{name:"Yemen",ISO_A3:"YEM"},"South Africa":{name:"South Africa",ISO_A3:"ZAF"},Zambia:{name:"Zambia",ISO_A3:"ZMB"},Zimbabwe:{name:"Zimbabwe",ISO_A3:"ZWE"},"French Guyana":{name:"French Guyana",ISO_A3:"GUF"}},If={Alabama:{name:"Alabama"},Alaska:{name:"Alaska"},Arizona:{name:"Arizona"},Arkansas:{name:"Arkansas"},California:{name:"California"},Colorado:{name:"Colorado"},Connecticut:{name:"Connecticut"},Delaware:{name:"Delaware"},"District of Columbia":{name:"District of Columbia"},Florida:{name:"Florida"},Georgia:{name:"Georgia"},Hawaii:{name:"Hawaii"},Idaho:{name:"Idaho"},Illinois:{name:"Illinois"},Indiana:{name:"Indiana"},Iowa:{name:"Iowa"},Kansas:{name:"Kansas"},Kentucky:{name:"Kentucky"},Louisiana:{name:"Louisiana"},Maine:{name:"Maine"},Maryland:{name:"Maryland"},Massachusetts:{name:"Massachusetts"},Michigan:{name:"Michigan"},Minnesota:{name:"Minnesota"},Mississippi:{name:"Mississippi"},Missouri:{name:"Missouri"},Montana:{name:"Montana"},Nebraska:{name:"Nebraska"},Nevada:{name:"Nevada"},"New Hampshire":{name:"New Hampshire"},"New Jersey":{name:"New Jersey"},"New Mexico":{name:"New Mexico"},"New York":{name:"New York"},"North Carolina":{name:"North Carolina"},"North Dakota":{name:"North Dakota"},Ohio:{name:"Ohio"},Oklahoma:{name:"Oklahoma"},Oregon:{name:"Oregon"},Pennsylvania:{name:"Pennsylvania"},"Rhode Island":{name:"Rhode Island"},"South Carolina":{name:"South Carolina"},"South Dakota":{name:"South Dakota"},Tennessee:{name:"Tennessee"},Texas:{name:"Texas"},Utah:{name:"Utah"},Vermont:{name:"Vermont"},Virginia:{name:"Virginia"},Washington:{name:"Washington"},"West Virginia":{name:"West Virginia"},Wisconsin:{name:"Wisconsin"},Wyoming:{name:"Wyoming"}},Ff={Anguilla:{name:"Anguilla",ISO_A3:"AIA"},"Antigua and Barbuda":{name:"Antigua and Barbuda",ISO_A3:"ATG"},"The Bahamas":{name:"The Bahamas",ISO_A3:"BHS"},Bermuda:{name:"Bermuda",ISO_A3:"BMU"},Barbados:{name:"Barbados",ISO_A3:"BRB"},Canada:{name:"Canada",ISO_A3:"CAN"},Cuba:{name:"Cuba",ISO_A3:"CUB"},"Cayman Islands":{name:"Cayman Islands",ISO_A3:"CYM"},Dominica:{name:"Dominica",ISO_A3:"DMA"},"Dominican Republic":{name:"Dominican Republic",ISO_A3:"DOM"},Grenada:{name:"Grenada",ISO_A3:"GRD"},Greenland:{name:"Greenland",ISO_A3:"GRL"},Haiti:{name:"Haiti",ISO_A3:"HTI"},Jamaica:{name:"Jamaica",ISO_A3:"JAM"},"Saint Kitts and Nevis":{name:"Saint Kitts and Nevis",ISO_A3:"KNA"},"Saint Lucia":{name:"Saint Lucia",ISO_A3:"LCA"},"Saint Martin":{name:"Saint Martin",ISO_A3:"MAF"},Mexico:{name:"Mexico",ISO_A3:"MEX"},Montserrat:{name:"Montserrat",ISO_A3:"MSR"},"Puerto Rico":{name:"Puerto Rico",ISO_A3:"PRI"},"Saint Pierre and Miquelon":{name:"Saint Pierre and Miquelon",ISO_A3:"SPM"},"Turks and Caicos Islands":{name:"Turks and Caicos Islands",ISO_A3:"TCA"},"Trinidad and Tobago":{name:"Trinidad and Tobago",ISO_A3:"TTO"},"United States of America":{name:"United States of America",ISO_A3:"USA"},"Saint Vincent and the Grenadines":{name:"Saint Vincent and the Grenadines",ISO_A3:"VCT"},"British Virgin Islands":{name:"British Virgin Islands",ISO_A3:"VGB"},"United States Virgin Islands":{name:"United States Virgin Islands",ISO_A3:"VIR"}},Df={Argentina:{name:"Argentina",ISO_A3:"ARG"},Bolivia:{name:"Bolivia",ISO_A3:"BOL"},Brazil:{name:"Brazil",ISO_A3:"BRA"},Chile:{name:"Chile",ISO_A3:"CHL"},Colombia:{name:"Colombia",ISO_A3:"COL"},"Costa Rica":{name:"Costa Rica",ISO_A3:"CRI"},Ecuador:{name:"Ecuador",ISO_A3:"ECU"},"Falkland Islands":{name:"Falkland Islands",ISO_A3:"FLK"},Guyana:{name:"Guyana",ISO_A3:"GUY"},Nicaragua:{name:"Nicaragua",ISO_A3:"NIC"},Panama:{name:"Panama",ISO_A3:"PAN"},Peru:{name:"Peru",ISO_A3:"PER"},Paraguay:{name:"Paraguay",ISO_A3:"PRY"},Suriname:{name:"Suriname",ISO_A3:"SUR"},Uruguay:{name:"Uruguay",ISO_A3:"URY"},Venezuela:{name:"Venezuela",ISO_A3:"VEN"},"French Guyana":{name:"French Guyana",ISO_A3:"GUF"},Guatemala:{name:"Guatemala",ISO_A3:"GTM"},"El Salvador":{name:"El Salvador",ISO_A3:"SLV"},Honduras:{name:"Honduras",ISO_A3:"HND"}},Pf={World:kf,USA:If,NorthAmerica:Ff,SouthAmerica:Df,Canada:Rf,Europe:Ef,Asia:Cf,Africa:wf,Australia:Tf},Lf=(t,e)=>Math.abs(t)+Math.abs(e);function Vf(t,e){const i=t.reduce(Lf,0),s=(r=t,Math.max(...r.map((t=>t))));var r;const n=(t=>Math.min(...t.map((t=>t))))(t);return Math.max(e**2*s/i**2,i**2/(e**2*n))}const _f=({height:t,width:e})=>t>e?{value:e,vertical:!1}:{value:t,vertical:!0},Bf=({data:t,dimensions:e})=>{const{x:i,y:s,width:r,height:n}=e,o=t.map((t=>t.value)).reduce(Lf,0),h=t.map((t=>t.animatedValue)).reduce(Lf,0),a=t.map((t=>t.animatedValue*n*r/h)),l=a.reduce(((t,e)=>t+e),0),u=a.map((t=>t/l*100)),c=a.filter(((t,e)=>u[e])),d={children:[],id:0,parentID:-1,name:"Main Rectangle",value:o,animatedValue:h,x:i,y:s,width:r,height:n,nodeIndex:-1,userNode:{name:"Main Rectangle",value:o}};if(1===t.length){const i={...t[0],x:e.x,y:e.y,width:e.width,height:e.height,userNode:{...t[0].userNode,value:t[0].value}};d.children.push(i)}else Nf(c,_f(d).value,t,d);return d.children},zf=(t,e,i,s,r)=>{const n=t.reduce(Lf,0)/e;t.forEach(((t,e)=>{const o=Math.abs(t)/n,{x:h,y:a,children:l}=r,u=s[l.length],c={...u,x:h,y:a,width:i?n:o,height:i?o:n,userNode:{...u.userNode,value:u.value}};i?r.y-=o:r.x+=o,l.push(c)})),i?(r.x+=n,r.y+=e,r.width-=n):(r.x-=e,r.y-=n,r.height-=n)},Nf=(t,e,i,s)=>{const r=[{children:t,width:e,row:[]}];for(;r.length>0;){const t=r.pop();if(!t)continue;const{children:e,width:n,row:o}=t;let h=0;const a=[...o];for(;hl)){zf(a,n,_f(s).vertical,i,s),r.push({children:e.slice(h),width:_f(s).value,row:[]});break}a.push(e[h]),h+=1}h===e.length&&zf(a,n,_f(s).vertical,i,s)}};class Of extends na{constructor(t,i,s,r,n,o,h){if(super(t,i,s,i.wp("treeMapChart bg",0),r,i.ls.Ki.treeMapChartBackgroundFillStyle||i.ls.Ki.chartXYSeriesBackgroundFillStyle,i.ls.Ki.treeMapChartBackgroundStrokeStyle||i.ls.Ki.chartXYBackgroundStrokeStyle,i.ls.Ki.treeMapChartTitleFont||i.ls.Ki.chartXYTitleFont,i.ls.Ki.treeMapChartTitleFillStyle||i.ls.Ki.chartXYTitleFillStyle,h),this.JL=new Map,this.KL=[],this.qL={},this.tR=p([]),this.wy={speed:1},this.iR=Be,this.sR=!0,this.eR="Go Back",this.hR=[],this.rR=this.Ki.treeMapChartPathLabelFillStyle||this.Ki.uiTextFillStyle,this.nR=this.Ki.treeMapChartPathLabelFont||this.Ki.uiTextFont,this.oR=this.Ki.treeMapChartLabelHeaderFillStyle||this.Ki.uiTextFillStyle,this.aR=this.Ki.treeMapChartLabelHeaderFont||this.Ki.uiTextFont,this.lR=this.Ki.treeMapChartLabelFillStyle||this.Ki.uiTextFillStyle,this.uR=this.Ki.treeMapChartLabelFont||this.Ki.uiTextFont,this.Yi=!0,this.Gx=!0,this.cR=!1,this.dR=this.Ki.treeMapChartParentColor||k,this.fR=this.Ki.treeMapChartNodeStrokeStyle||this.Ki.uiBackgroundStrokeStyle,this.onNodeMouseEnter=t=>this.R.on("mouseEnter",t),this.onNodeMouseLeave=t=>this.R.on("mouseLeave",t),this.onNodeMouseClick=t=>this.R.on("mouseClick",t),this.onNodeMouseDoubleClick=t=>this.R.on("mouseDoubleClick",t),this.onNodeMouseDown=t=>this.R.on("mouseDown",t),this.onNodeMouseUp=t=>this.R.on("mouseUp",t),this.onNodeMouseMove=t=>this.R.on("mouseMove",t),this.offNodeMouseEnter=t=>this.R.off(t,"mouseEnter"),this.offNodeMouseLeave=t=>this.R.off(t,"mouseLeave"),this.offNodeMouseClick=t=>this.R.off(t,"mouseClick"),this.offNodeMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClick"),this.offNodeMouseDown=t=>this.R.off(t,"mouseDown"),this.offNodeMouseUp=t=>this.R.off(t,"mouseUp"),this.offNodeMouseMove=t=>this.R.off(t,"mouseMove"),this.offNodeMouseDragStart=t=>this.R.off(t,"mouseDragStart"),this.offNodeMouseDrag=t=>this.R.off(t,"mouseDrag"),this.offNodeMouseDragStop=t=>this.R.off(t,"mouseDragStop"),this.offNodeMouseWheel=t=>this.R.off(t,"mouseWheel"),this.Yx=(t,e,i,s,r)=>{this.ls.xs(),this.cR=!0},this._t=(t,i)=>{const s=this.AR(i);s&&(this.nb=this.gR(s,t),this.Gx&&this.ls.os.ws(i,!0),this.sR&&this.engine.setMouseStyle(e.MouseStyles.Point),this.R.emit("mouseEnter",this,t,this.nb),this.ls.xs())},this.wt=(t,i)=>{this.AR(i)&&(this.nb=void 0,this.Gx&&this.ls.os.ws(i,!1),this.engine.setMouseStyle(e.MouseStyles.Default),this.R.emit("mouseLeave",this,t,this.nb),this.ls.xs())},this.It=(t,i)=>{const s=this.AR(i);s&&(this.nb=this.gR(s,t),this.Gx&&this.ls.os.ws(i,!0),this.sR&&this.engine.setMouseStyle(e.MouseStyles.Point),this.R.emit("mouseEnter",this,t,this.nb),this.ls.xs())},this.Ct=(t,e)=>{const i=this.AR(e);if(i){if(this.sR){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.qL[i.parentID]:void 0;e&&(this.tR._([e]),this.nb=void 0,this.R.emit("viewChange",this.tR.C()),this.cR=!0),t&&Qt(t)}this.R.emit("mouseClick",this,t,this.gR(i,t)),this.ls.xs()}},this.kt=(t,e)=>{const i=this.AR(e);i&&this.R.emit("mouseDoubleClick",this,t,this.gR(i,t))},this.Tt=(t,e)=>{const i=this.AR(e);i&&this.R.emit("mouseDown",this,t,this.gR(i,t))},this.Ft=(t,e)=>{const i=this.AR(e);i&&this.R.emit("mouseUp",this,t,this.gR(i,t))},this.Dt=(t,e,i)=>{const s=this.AR(i);s&&this.R.emit("mouseDragStart",this,t,e,this.gR(s,t))},this.Pt=(t,e,i,s,r)=>{const n=this.AR(r);n&&this.R.emit("mouseDrag",this,t,e,i,s,this.gR(n,t))},this.Bt=(t,e,i,s)=>{const r=this.AR(s);r&&this.R.emit("mouseDragStop",this,t,e,i,this.gR(r,t))},this.Lt=(t,e)=>{const i=this.AR(e);i&&this.R.emit("mouseWheel",this,t,this.gR(i,t))},this.Rt=(t,e)=>{const i=this.AR(e);i&&(this.nb=this.gR(i,t),this.Gx&&this.ls.os.ws(e,!0),this.R.emit("touchStart",this,t,this.nb),this.ls.xs(),Qt(t))},this.Et=(t,e)=>{const i=this.AR(e);i&&(this.nb=this.gR(i,t),this.Gx&&this.ls.os.ws(e,!0),this.R.emit("touchMove",this,t,this.nb),this.ls.xs(),Qt(t))},this.zt=(t,e)=>{const i=this.AR(e);if(i){if(this.nb=void 0,this.sR){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.qL[i.parentID]:void 0;e&&(this.tR._([e]),this.R.emit("viewChange",this.tR.C()),this.cR=!0),t&&Qt(t)}this.Gx&&this.ls.os.ws(e,!1),this.R.emit("touchEnd",this,t,this.nb),this.ls.xs(),Qt(t)}},this.pR=t=>{const e=this.qL[this.hR[t].id]?[this.qL[this.hR[t].id]]:this.KL;this.tR._(e),this.R.emit("viewChange",e),this.cR=!0,this.ls.xs()},this.Ki.treeMapChartNodeColors)this.yR=this.Ki.treeMapChartNodeColors;else{const t=this.Ki.pointSeriesFillStyle,e=t=>Y(t)?t.getColor():k;this.yR="function"==typeof t?new Array(5).fill(0).map(((i,s)=>e(t(s)))):[e(t)]}this.ls.Xn(dh.Ff),this.Yy=i.Mx("TreeMapChart plotting",0),this.$y=i.Mx("TreeMap UI plotting",1),this.onResize(this.Yx),this.mh.gr("TreeMap Chart");const a=i.Xy(),l=Pt(o?o.cursorBuilder:void 0,Ca);this.jy=la(this,a,l.gy(a,this.uiScale,this.uiScale,kt,this.Ki),void 0,"show-pointed",Uf,(()=>0)),this.mR=this.ss.wg(),this._p(n,this.uiScale),this.tb=this.Yy.Um(this.pg).Ie(new G).Fe(this.fR),this.vR=this.ls.os.Yr(this,{animationEnabled:!1!==(null==o?void 0:o.animationsEnabled)}),this.SR=new Ka((()=>this.$y.Or(this.pg).setMouseInteractions(!1))),this.xR=new Ka((()=>this.$y.Or(this.uiScale))),this.tb.setMouseInteractions(this.Yi).setMouseEnterEventHandler(((t,e,i)=>this._t(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.wt(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.kt(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.It(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Dt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Pt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Bt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Lt(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Rt(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Et(e,i))).setTouchEndEventHandler(((t,e,i)=>this.zt(e,i))),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}setData(t){t=Array.isArray(t)?t.slice():[t];const{bR:e}=(()=>{let t=0;return{bR:e=>{var i;const s=e.map(((t,e)=>({node:t,parent:null}))),r=[];for(;s.length>0;){const e=s.pop();if(!e)continue;const{node:n,parent:o}=e;t+=1;const h={id:t,parentID:null==o?void 0:o.id,name:n.name,value:Number(n.value)||0,animatedValue:Number(n.value)||0,children:[],nodeIndex:o?o.nodeIndex:-1,userNode:n};o?o.children.push(h):r.push(h),null===(i=n.children)||void 0===i||i.forEach((t=>{s.push({node:t,parent:h})}))}const n=t=>{t.children.forEach(n),t.children.length>0&&(t.value+=t.children.reduce(((t,e)=>t+e.value),0),t.animatedValue+=t.children.reduce(((t,e)=>t+e.animatedValue),0),t.children.sort(((t,e)=>e.animatedValue-t.animatedValue)))};r.forEach(n);const o=1===e.length?r[0].children:r;return o.sort(((t,e)=>e.animatedValue-t.animatedValue)),o.forEach(((t,e)=>{t.nodeIndex=e;const i=e=>{e.children.forEach((e=>{e.nodeIndex=t.nodeIndex,i(e)}))};i(t)})),r}}})(),i=e(t);return i.forEach((t=>{const e=this.qL[t.id];e&&this.MR(t,e)})),this.nb=void 0,this.tR._(i),this.KL=i,this.qL=this._R(i),this.cR=!0,this.ls.xs(),this}setAnimationValues(t,e=1){return this.wy=t?{speed:e}:void 0,this.ls.xs(),this}setInitPathButtonText(t){return this.eR=t,this.cR=!0,this.ls.xs(),this}setDisplayedLevelsCount(t){return this.iR=t,this.cR=!0,this.ls.xs(),this}setDrillDownEnabled(t){return this.sR=t,this.cR=!0,this.ls.xs(),this}setDrillDownNode(t){var e,i;if(this.nb=void 0,void 0===t)this.tR._(this.KL);else{const s=[...this.KL];for(;s.length>0;){const r=s.pop();if(r){if(void 0!==r.value&&r.userNode===t||r.parentID&&Array.isArray(t)&&(null===(i=null===(e=this.qL[r.parentID])||void 0===e?void 0:e.userNode)||void 0===i?void 0:i.children)===t){const t=r.children.length?r:r.parentID?this.qL[r.parentID]:this.KL[0];this.tR._([t]);break}if(r.children)for(let t=r.children.length-1;t>=0;t-=1)s.push(r.children[t])}}}return this.R.emit("viewChange",this.tR.C()),this.cR=!0,this.ls.xs(),this}setNodeColoring(t){return t instanceof Array?(this.tb.Ie(new G),this.yR=t):this.tb.Ie(t),this.cR=!0,this.ls.xs(),this}setParentNodeColor(t){return this.dR=t,this.cR=!0,this.ls.xs(),this}setPathLabelFillStyle(t){return this.rR="function"==typeof t?t(this.rR):t,this.cR=!0,this.ls.xs(),this}getPathLabelFillStyle(){return this.rR}setPathLabelFont(t){return ur(t)?this.nR=t:this.nR=t(this.nR),this.cR=!0,this.ls.xs(),this}getPathLabelFont(){return this.nR}setHeaderFont(t){return ur(t)?this.aR=t:this.aR=t(this.aR),this.cR=!0,this.ls.xs(),this}getHeaderFont(){return this.aR}setHeaderFillStyle(t){return this.oR="function"==typeof t?t(this.oR):t,this.cR=!0,this.ls.xs(),this}getHeaderFillStyle(){return this.oR}setLabelFont(t){return ur(t)?this.uR=t:this.uR=t(this.uR),this.cR=!0,this.ls.xs(),this}getLabelFont(){return this.uR}setLabelFillStyle(t){return this.lR="function"==typeof t?t(this.lR):t,this.cR=!0,this.ls.xs(),this}getLabelFillStyle(){return this.lR}setNodeBorderStyle(t){return this.tb.Fe(t),this.cR=!0,this.ls.xs(),this}getNodeBorderStyle(){return this.tb.po()}setNodeEffect(t){return this.mR.Ss(t),this.ls.xs(),this}getNodeEffect(){return this.mR.bs()}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=Ca){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}onNodeMouseDragStart(t){return this.R.on("mouseDragStart",t)}onNodeMouseDrag(t){return this.R.on("mouseDrag",t)}onNodeMouseDragStop(t){return this.R.on("mouseDragStop",t)}onNodeMouseWheel(t){return this.R.on("mouseWheel",t)}onNodeTouchStart(t){return this.R.on("touchStart",t)}onNodeTouchMove(t){return this.R.on("touchMove",t)}onNodeTouchEnd(t){return this.R.on("touchEnd",t)}onViewChange(t){return this.R.on("viewChange",t)}offNodeTouchStart(t){return this.R.off(t,"touchStart")}offNodeTouchMove(t){return this.R.off(t,"touchMove")}offNodeTouchEnd(t){return this.R.off(t,"touchEnd")}offViewChange(t){return this.R.off(t,"viewChange")}setMouseInteractions(t){return this.Yi=t,this.tb.setMouseInteractions(t),this}getMouseInteractions(){return this.Yi}setAnimationHighlight(t){return this.vR.Xr(t),this}getAnimationHighlight(){return this.vR.jr()}setHighlightOnHover(t){return this.Gx=t,this}getHighlightOnHover(){return this.Gx}gR(t,e){const i=this.ls.Vo(e);return{cursorPosition:{pointMarker:{x:i.engineX,y:i.engineY},pointMarkerScale:this.ls.At,resultTable:{x:i.engineX,y:i.engineY},resultTableScale:this.ls.At},name:t.name,value:t.value,node:t.userNode}}getMinimumSize(){}if(){return[this]}De(t){super.De(t),super.Mp(),oa.Bp(this.mh,this.Cp);const i=oa.Dp(this.mh,this.Cp);if(this.cR&&this.tR.C().length){this.tb.Ot(),this.JL.clear(),this.vR.$r(),this.ah&&this.wR(t);const s=Bf({data:this.tR.C(),dimensions:{x:0+this.wa.left,y:this.pg.y.getInnerEnd()-i-this.wa.top,width:this.pg.x.getInnerEnd()-this.wa.right-this.wa.left,height:this.pg.y.getInnerEnd()-i-this.wa.top-this.wa.bottom}}),r=this.SR.Mm();this.CR(s,r),r.finishPlot(),this.kR(),this.KL!==this.tR.C()&&this.KL.length>1&&this.hR.unshift({name:this.eR,id:0});let n=0;const o=this.xR.Mm(),h=this.nR;this.hR.forEach(((t,i)=>{const s=o.add(),r=this.ls.Vg.zg(t.name,h,0);s.gr(`← ${t.name}`).jh(h).Be({x:0,y:100}).Ya({x:-1,y:1}).zr({left:this.wa.left+n,top:this.wa.top,right:0,bottom:0}).Ie(this.rR).setMouseClickEventHandler((t=>this.pR(i))).setMouseEnterEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Point))).setMouseLeaveEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Default))),n+=r.x+25})),o.finishPlot(),this.tR.C().every((t=>t.value===t.animatedValue))?this.cR=!1:this.ls.xs(!0)}return this.jy.De(!1,[],void 0,{explicitTarget:this.nb}),this}dispose(){return this.$y.Y(),this.Yy.Y(),this.jy.Y(),this.tb.dispose(),this.JL.clear(),this.SR.wm(),this.xR.wm(),super.dispose()}J(){return super.J(),this}K(){return super.K(),this}Xd(){return de(this.tb.Hh())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),ce(t,this.Ki,i,{}),this}CR(t,e,i=!1,s=0){const r=t.map(((t,e)=>({node:t,isChild:i,visibleDepth:s})));for(;r.length>0;){const t=r.pop();if(!t)continue;const{node:i,visibleDepth:s,opacity:n}=t,{x:o,y:h,height:a,width:l,children:u,animatedValue:c,name:d,nodeIndex:f}=i,g=this.yR,y=0===s&&1===this.tR.C().length?this.dR:g[f%g.length],m=[{x:o,y:h},{x:o,y:h-a},{x:l+o,y:h-a},{x:l+o,y:h}],p=this.tb.Hr()._l(m).TR(y.setA(n||250)).rb(c);this.JL.set(p,i),this.vR.Hr(p,(t=>p.us(t)));const x=o+5,A=h+25+5,S=Math.max(a-25-5,0),v=Math.max(l-5-5,0);if(u&&u.length&&s15&&S>15){const t=Bf({data:u,dimensions:{x:v>0?x:o,y:S>0?h-25:A,width:v,height:S}});for(let e=0;e7?50:150))/(u.length-1),h=1===i.id&&1===this.KL.length||this.KL===this.tR.C()?250:n?n/(s+1):250-e*o;r.push({node:t[e],isChild:!0,visibleDepth:s+1,opacity:h})}}const b=0===s&&1===this.tR.C().length?this.oR:this.lR,M=0===s?this.aR:this.uR,w=this.FR(d,l-25,M),C=this.ls.Vg.zg(w,M,0),T=e.add();l-25>C.x&&a>25?T.gr(w).Be({x:o+5,y:h-2.5}).Ya({x:-1,y:1}).Ie(b).jh(M):T.gr("")}}_R(t){const e={},i=[...t];for(;i.length>0;){const t=i.pop();t&&(e[t.id]=t,t.children&&i.push(...t.children))}return e}AR(t){if(!this.cR&&t)return this.JL.get(t)}kR(){this.hR=[];const t=this.tR.C()[0].id;let e=this.qL[t].parentID;for(;e;)this.hR.push({name:this.qL[e].name,id:e}),e=this.qL[e].parentID;return this.hR.reverse()}FR(t,e,i){let s=this.ls.Vg.zg(t,i,0).x;if(s<=e)return t;const r=t.split(" ");let n=t;for(;r.length>1&&s>e;)r.pop(),n=`${r.join(" ")}...`,s=this.ls.Vg.zg(n,i,0).x;if(s>e)for(n=`${r[0]}...`,s=this.ls.Vg.zg(n,i,0).x;n.length>3&&s>e;)n=`${n.substring(0,n.length-4)}...`,s=this.ls.Vg.zg(n,i,0).x;return n.length<=3&&s>e?"":n}wR(t){var e;const i=[...this.KL];for(;i.length>0;){const s=i.pop();if(!s)continue;const r=s.value-s.animatedValue;if(Math.abs(r)<.0015*s.value||void 0===this.wy)s.animatedValue=s.value;else{const i=r/250*((null===(e=this.wy)||void 0===e?void 0:e.speed)||1)*t;s.animatedValue+=i,(r>0&&s.animatedValue>s.value||r<0&&s.animatedValue0&&i.push(...s.children)}}MR(t,e){const i=[{current:t,previous:e}];for(;i.length>0;){const t=i.pop();if(!t)continue;const{current:e,previous:s}=t;e.animatedValue=this.ah?s.animatedValue:e.value,s.nodeIndex<0?e.nodeIndex=0:e.nodeIndex=s.nodeIndex;const r=new Map(s.children.map((t=>[t.id,t])));e.children.forEach(((t,e)=>{const n=r.get(t.id);i.push({current:t,previous:n||s})}))}}}const Uf=(t,e,i)=>[[e.name],[{text:e.value.toString(),font:{weight:"bold"}}]],Yf=(t,i)=>{const s=(t=>{const i=new U({color:t.uiStrokeColorContrastHigh}),s=new U({color:t.uiStrokeColorContrastMedium}),r=new U({color:t.uiStrokeColorContrastLow}),n=new lr({family:t.fontFamily,weight:"normal",style:"normal"}),o=n.setSize(18*t.fontScaler),h=n.setSize(16*t.fontScaler),a=n.setSize(14*t.fontScaler),l=n.setSize(10*t.fontScaler),u=n.withMutations((e=>e.set("size",14*t.fontScaler).set("weight","bold"))),c=n.setSize(13*t.fontScaler),d=new Ji({thickness:2,fillStyle:r}),f=new U({color:t.dataHighlightOverlayColor}),g=new Ji({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),y=t.dataColorPalette.map((t=>new U({color:t.stroke}))),m=t=>y[t%y.length],p=y.map((t=>new Ji({thickness:2,fillStyle:t}))),x=t=>p[t%p.length],A=t.dataColorPalette.map((t=>new U({color:t.border}))).map((t=>new Ji({thickness:2,fillStyle:t}))),S=t=>A[t%A.length],v=t.dataColorPalette.map((t=>{const e=t.area;return new it({angle:0,stops:[{offset:0,color:e.setA(0)},{offset:.8,color:e}]})})),b=t=>v[t%v.length],M=t.dataColorPaletteInverted.map((t=>{const e=t.area;return new it({angle:180,stops:[{offset:0,color:e.setA(0)},{offset:.8,color:e}]})})),T=t=>M[t%M.length],R=t.dataColorPalette.map((t=>{const e=t.area;return new it({angle:180,stops:[{color:ae(e,w(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ae(e,w(0,0,0,e.getA()),.3),offset:1}]})})),E=t=>R[t%R.length],k=t.dataColorPaletteInverted.map((t=>new U({color:t.border}))).map((t=>new Ji({thickness:2,fillStyle:t}))),I=t=>k[t%k.length],F=new U({color:t.dataColorPositive}),D=new U({color:t.dataColorNegative}),P=new Ji({thickness:1,fillStyle:new U({color:t.dataStrokeColorContrastHigh.setA(50)})}),L=new Ji({thickness:2,fillStyle:t.axisLineFillStyle}),V=nt,_=new U({color:w(0,0,0,1)}),z=new Ji({thickness:1,fillStyle:t.axisGridMajorFillStyle}),N=nt,O=a,Y=t.axisLabelMajorFillStyle,G=new Ji({thickness:1,fillStyle:t.axisGridMajorFillStyle}),X=new Ji({thickness:1,fillStyle:t.axisTickMajorFillStyle}),Z=a,H=t.axisLabelMajorFillStyle,W=new Ji({thickness:1,fillStyle:t.axisGridMinorFillStyle}),j=new Ji({thickness:1,fillStyle:t.axisTickMinorFillStyle}),K=l,$=t.axisLabelMinorFillStyle,Q=bh,q=new Sh({gridStrokeStyle:z,tickStyle:N,tickLength:50,tickPadding:-14,labelFont:O,labelFillStyle:Y}),J=new Sh({gridStrokeStyle:G,tickStyle:X,tickLength:7,tickPadding:5,labelFont:Z,labelFillStyle:H}),tt=new Sh({gridStrokeStyle:W,tickStyle:j,tickLength:4,tickPadding:10,labelFont:K,labelFillStyle:$}),et=new $h({extremeTickStyle:Q,majorTickStyle:J,minorTickStyle:tt}),st=new Yh({greatTickStyle:q,majorTickStyle:J,minorTickStyle:tt}),rt=new Eh({majorTickStyle:J,minorTickStyle:tt}),ot=new U({color:t.dataHighlightOverlayColor}),ht=new Ji({thickness:1,fillStyle:s}),at=new Ji({thickness:2,fillStyle:s}),lt=t=>new Ar.Triangulated({shape:"sphere",size:10,fillStyle:y[t%y.length]}),ut=y[0],ct=t.uiTextFillStyle,dt=t.legendBackgroundFillStyle,ft=new Ji({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),gt=ue(t.legendButtonDefaultColor),yt=ue(t.isDark?w(70,70,70,255):w(170,170,170,255)),mt=new U({color:t.isDark?w(70,70,70,255):w(170,170,170,255)}),pt=new Ji({thickness:1,fillStyle:i}),xt=new io({thickness:1,fillStyle:t.cursorGridFillStyle,pattern:to.DashedEqual,patternScale:3}),At=new Ji({thickness:1,fillStyle:t.cursorGridFillStyle}),St=t.zoomBandChartDefocusOverlayFillStyle,vt=new Ji({thickness:2,fillStyle:new U({color:t.zoomBandChartSplitterColor})}),bt=new U({color:t.uiBackgroundColor});let Mt={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:nt,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new Ji({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:nt,chartXYTitleFont:o,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:d,chartXYZoomingRectangleFillStyle:f,chartXYZoomingRectangleStrokeStyle:g,chartXYFittingRectangleFillStyle:f,chartXYFittingRectangleStrokeStyle:g,lineSeriesStrokeStyle:x,pointLineSeriesStrokeStyle:x,pointLineSeriesFillStyle:m,pointSeriesFillStyle:m,ellipseSeriesFillStyle:m,ellipseSeriesStrokeStyle:x,polygonSeriesFillStyle:m,polygonSeriesStrokeStyle:x,rectangleSeriesFillStyle:m,rectangleSeriesStrokeStyle:nt,segmentSeriesStrokeStyle:x,boxSeriesBodyFillStyle:m(0),boxSeriesBodyStrokeStyle:nt,boxSeriesStrokeStyle:new Ji({thickness:1,fillStyle:y[0]}),boxSeriesMedianStrokeStyle:new Ji({thickness:1,fillStyle:new U({color:w(0,0,0)})}),ohlcCandleThicknessPixels:5,ohlcCandleBodyFillStylePositive:F,ohlcCandleBodyFillStyleNegative:D,ohlcCandleTailStrokeStylePositive:new Ji({thickness:1,fillStyle:new U({color:t.uiStrokeColorContrastHigh})}),ohlcCandleTailStrokeStyleNegative:new Ji({thickness:1,fillStyle:new U({color:t.uiStrokeColorContrastHigh})}),ohlcBarThicknessPixels:10,ohlcBarStrokeStylePositive:new Ji({thickness:2,fillStyle:F}),ohlcBarStrokeStyleNegative:new Ji({thickness:2,fillStyle:D}),heatmapGridSeriesFillStyle:m,heatmapGridSeriesWireframeStyle:P,heatmapScrollingGridSeriesFillStyle:m,heatmapScrollingGridSeriesWireframeStyle:P,areaRangeSeriesFillStyle:b,areaRangeSeriesStrokeStyle:S,areaRangeSeriesFillStyleInverted:T,areaRangeSeriesStrokeStyleInverted:I,areaSeriesBipolarHighFillStyle:b,areaSeriesBipolarHighStrokeStyle:S,areaSeriesBipolarLowFillStyle:T,areaSeriesBipolarLowStrokeStyle:I,areaSeriesPositiveFillStyle:b,areaSeriesPositiveStrokeStyle:S,areaSeriesNegativeFillStyle:T,areaSeriesNegativeStrokeStyle:I,xAxisTitleFont:h,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:L,xAxisNibStyle:V,xAxisOverlayStyle:_,xAxisZoomingBandFillStyle:f,xAxisZoomingBandStrokeStyle:nt,xAxisNumericTicks:et,xAxisDateTimeTicks:st,xAxisTimeTicks:rt,yAxisTitleFont:h,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:L,yAxisNibStyle:V,yAxisOverlayStyle:_,yAxisZoomingBandFillStyle:f,yAxisZoomingBandStrokeStyle:nt,yAxisNumericTicks:et,yAxisDateTimeTicks:st,yAxisTimeTicks:rt,bandFillStyle:ot,bandStrokeStyle:ht,constantLineStrokeStyle:at,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:nt,barChartTitleFont:o,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:B,barChartSeriesBackgroundStrokeStyle:nt,barChartBarFillStyle:m,barChartBarStrokeStyle:new Ji({thickness:1,fillStyle:r}),barChartValueAxisTitleFont:h,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:L,barChartValueAxisTicks:et.setMajorTickStyle((t=>t.setGridStrokeStyle(nt))).setMinorTickStyle((t=>t.setGridStrokeStyle(nt))),barChartCategoryAxisTitleFont:h,barChartCategoryAxisTitleFillStyle:t.axisTitleFillStyle,barChartCategoryAxisStrokeStyle:L,barChartCategoryLabels:{formatter:(t,e)=>t,labelFillStyle:et.majorTickStyle.labelFillStyle,labelFont:et.majorTickStyle.labelFont,labelMargin:8,labelRotation:0,tickStyle:et.majorTickStyle.tickStyle,tickLength:0},barChartValueLabelsAfterBars:{position:"after-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:et.majorTickStyle.labelFillStyle,labelFont:et.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},barChartValueLabelsInsideBars:{position:"inside-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:et.majorTickStyle.labelFillStyle,labelFont:et.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:nt,chart3DTitleFont:o,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:d,chart3DBoundingBoxStrokeStyle:nt,xAxis3DTitleFont:h,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:L,xAxis3DNumericTicks:et,xAxis3DDateTimeTicks:st,xAxis3DTimeTicks:rt,yAxis3DTitleFont:h,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:L,yAxis3DNumericTicks:et,yAxis3DDateTimeTicks:st,yAxis3DTimeTicks:rt,zAxis3DTitleFont:h,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:L,zAxis3DNumericTicks:et,zAxis3DDateTimeTicks:st,zAxis3DTimeTicks:rt,lineSeries3DStrokeStyle:x,pointLineSeries3DStrokeStyle:x,pointLineSeries3DPointStyle:lt,pointSeries3DPointStyle:lt,pointCloudSeries3DPointStyle:t=>new Ar.Pixelated({size:5,fillStyle:y[t%y.length]}),surfaceGridSeries3DFillStyle:m,surfaceGridSeries3DWireframeStyle:P,surfaceScrollingGridSeries3DFillStyle:m,surfaceScrollingGridSeries3DWireframeStyle:P,boxSeries3DFillStyle:m,meshModel3DFillStyle:m(0),polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:nt,polarChartTitleFont:o,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:d,polarSectorFillStyle:ot,polarSectorStrokeStyle:ht,polarAmplitudeAxisTitleFont:h,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:L,polarAmplitudeAxisNumericTicks:et,polarAmplitudeAxisDateTimeTicks:st,polarAmplitudeAxisTimeTicks:rt,polarRadialAxisTitleFont:h,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:L,polarRadialAxisTickStyle:J,polarLineSeriesStrokeStyle:x,polarPointLineSeriesFillStyle:m,polarPointLineSeriesStrokeStyle:x,polarPointSeriesFillStyle:m,polarPolygonSeriesFillStyle:E,polarPolygonSeriesStrokeStyle:S,polarAreaSeriesFillStyle:E,polarAreaSeriesStrokeStyle:S,polarHeatmapSeriesFillStyle:m,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:nt,mapChartTitleFont:o,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:ut,mapChartStrokeStyle:new Ji({thickness:1,fillStyle:new U({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:B,mapChartOutlierRegionStrokeStyle:new Ji({thickness:1,fillStyle:r}),mapChartSeparateRegionFillStyle:dt,mapChartSeparateRegionStrokeStyle:ft,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:nt,dataGridTitleFont:o,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:a,dataGridTextFillStyle:ut,dataGridCellBackgroundFillStyle:new U({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new Ji({thickness:.4,fillStyle:new U({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:nt,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ft,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ft,dataGridScrollBarButtonArrowFillStyle:gt,dataGridScrollBarButtonArrowStrokeStyle:ft,sparkLineChartStrokeStyle:x(0),sparkPointChartFillStyle:m(0),sparkBarChartFillStyle:m(0),sparkBarChartStrokeStyle:S(0),sparkAreaChartFillStyle:b(0),sparkAreaChartStrokeStyle:S(0),sparkPieChartFillStyle:m,sparkPieChartStrokeStyle:ft,sparkChartBandFillStyle:ot,sparkChartBandStrokeStyle:ht,sparkChartConstantLineStrokeStyle:at,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:nt,spiderChartTitleFont:o,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:d,spiderChartWebStyle:new Ji({thickness:2,fillStyle:r}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:a,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:h,spiderChartAxisStrokeStyle:new Ji({thickness:2,fillStyle:s}),spiderChartAxisNibStrokeStyle:new Ji({thickness:2,fillStyle:i}),spiderSeriesFillStyle:E,spiderSeriesStrokeStyle:S,spiderSeriesPointFillStyle:m,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:nt,pieChartTitleFont:o,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:m,pieChartSliceStrokeStyle:ft,pieChartSliceLabelFont:c,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:pt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:nt,funnelChartTitleFont:o,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:m,funnelChartSliceStrokeStyle:ft,funnelChartSliceLabelFont:c,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:pt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:nt,pyramidChartTitleFont:o,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:m,pyramidChartSliceStrokeStyle:ft,pyramidChartSliceLabelFont:c,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:pt,gaugeChartValueLabelFont:c.setSize(60),gaugeChartUnitLabelFont:c.setSize(40),gaugeChartTickFont:c.setSize(30),gaugeChartBarThickness:40,gaugeChartValueIndicatorThickness:10,gaugeChartRoundedEdges:!0,gaugeChartNeedleLength:40,gaugeChartStartAngle:225,gaugeChartEndAngle:-45,gaugeChartNeedleAlignment:0,gaugeChartGapBetweenBarAndValueIndicators:10,gaugeChartTickFillStyle:t.uiTextFillStyle,gaugeChartBarGradient:!0,gaugeChartBarStrokeStyle:nt,gaugeChartUnitLabelFillStyle:t.uiTextFillStyle,gaugeChartValueLabelFillStyle:t.uiTextFillStyle,gaugeChartBarColor:w(255,255,255),gaugeChartGlowColor:w(255,255,64),gaugeChartNeedleFillStyle:new U({color:w(255,255,255)}),gaugeChartNeedleThickness:10,gaugeChartNeedleStrokeStyle:new Ji({thickness:2,fillStyle:new U({color:w(0,0,0)})}),gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:nt,gaugeChartTitleFont:o,gaugeChartTitleFillStyle:t.titleFillStyle,treeMapChartBackgroundFillStyle:t.panelBackgroundFillStyle,treeMapChartBackgroundStrokeStyle:nt,treeMapChartParentColor:t.treeMapChartParentColor,treeMapChartNodeColors:t.treeMapChartNodeColors,treeMapChartNodeStrokeStyle:new Ji({thickness:1,fillStyle:new U({color:C("000")})}),treeMapChartTitleFillStyle:t.titleFillStyle,treeMapChartTitleFont:o,treeMapChartPathLabelFillStyle:ct,treeMapChartPathLabelFont:c,treeMapChartLabelHeaderFillStyle:t.treeMapChartLabelHeaderFillStyle,treeMapChartLabelHeaderFont:o,treeMapChartLabelFillStyle:t.treeMapChartLabelFillStyle,treeMapChartLabelFont:c,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:nt,zoomBandChartDefocusOverlayFillStyle:St,zoomBandChartSplitterStrokeStyle:vt,zoomBandChartKnobFillStyle:t.zoomBandChartKnobFillStyle,zoomBandChartKnobSize:t.zoomBandChartKnobSize,onScreenMenuBackgroundColor:w(254,204,0,.7),uiButtonFillStyle:gt,uiButtonFillStyleHidden:yt,uiButtonStrokeStyle:ft,uiButtonSize:10,uiBackgroundFillStyle:dt,uiBackgroundStrokeStyle:ft,uiTextFillStyle:ct,uiTextFillStyleHidden:mt,uiTextFont:c,legendTitleFillStyle:ct,legendTitleFont:u,cursorTickMarkerXBackgroundFillStyle:dt,cursorTickMarkerXBackgroundStrokeStyle:ft,cursorTickMarkerXTextFillStyle:ct,cursorTickMarkerXTextFont:c,cursorTickMarkerYBackgroundFillStyle:dt,cursorTickMarkerYBackgroundStrokeStyle:ft,cursorTickMarkerYTextFillStyle:ct,cursorTickMarkerYTextFont:c,cursorPointMarkerFillStyle:xt.getFillStyle(),cursorPointMarkerSize:{x:9,y:9},cursorPointMarkerShape:e.PointShape.Cross,cursorResultTableFillStyle:dt,cursorResultTableStrokeStyle:ft,cursorResultTableTextFillStyle:ct,cursorResultTableTextFont:c,cursorGridStrokeStyleX:xt,cursorGridStrokeStyleY:xt,cursor3DGridStrokeStyleX:At,cursor3DGridStrokeStyleY:At,cursor3DGridStrokeStyleZ:At,cursor3DTickStrokeStyleX:J.tickStyle,cursor3DTickStrokeStyleY:J.tickStyle,cursor3DTickStrokeStyleZ:J.tickStyle,cursor3DTickLabelFillStyleX:ct,cursor3DTickLabelFillStyleY:ct,cursor3DTickLabelFillStyleZ:ct,cursor3DTickLabelFontX:c,cursor3DTickLabelFontY:c,cursor3DTickLabelFontZ:c,cursor3DTickLabelBackgroundFillStyleX:bt,cursor3DTickLabelBackgroundFillStyleY:bt,cursor3DTickLabelBackgroundFillStyleZ:bt,cursor3DTickLabelBackgroundStrokeStyleX:ft,cursor3DTickLabelBackgroundStrokeStyleY:ft,cursor3DTickLabelBackgroundStrokeStyleZ:ft,cursor3DTickLabelPaddingX:{left:4,right:4,top:4,bottom:4},cursor3DTickLabelPaddingY:{left:4,right:4,top:4,bottom:4},cursor3DTickLabelPaddingZ:{left:4,right:4,top:4,bottom:4}};return t.overrideThemeProperties&&(Mt={...Mt,...t.overrideThemeProperties}),Mt})(t),r={...i,header1Font:s.xAxisTitleFont,header2Font:s.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:s.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...s,examples:r}},Gf=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/${e}`;return i.addEventListener("error",(e=>{Re(t,s,"Theme resource",{shouldCrash:!1})})),i.src=s,i},Xf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,w(255,255,255),.5);return new J({stops:[{color:ae(r,w(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:ae(r,w(30,30,30),.5*i).setA(100),offset:1}]})},Zf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,w(255,255,255),.2);return new J({stops:[{color:ae(r,w(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:ae(r,w(0,0,0),.2*i),offset:1}]})},Hf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,w(255,255,255),.2);return new it({angle:90,stops:[{color:ae(r,w(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:ae(r,w(30,30,30),.5*i),offset:1}]})},Wf=(t,e,i)=>(()=>{const i=new Map;return s=>{const r=i.get(s);if(r)return r;const n=(i=>{const s=!0===t?e[i%e.length].stroke:ae(e[i%e.length].stroke,w(255,255,255),.3);return new it({angle:90,stops:[{color:ae(s,w(255,255,255),.5),offset:0},{color:s,offset:.35},{color:ae(s,w(30,30,30),.5),offset:1}]})})(s);return i.set(s,n),n}})(),jf=Ce((()=>{const t=w(255,255,255),i=new U({color:t}),s=!0,r=new ao({spread:1,blur:9,offset:{x:0,y:0},color:w(0,0,0,150)}),n=new J({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:w(50,51,52)},{offset:.5,color:w(14,15,16)},{offset:1,color:w(0,0,0)}]}),o=new U({color:w(45,45,45)}),h=new J({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(120,120,120,100)},{offset:1,color:w(0,0,0,50)}]}),a=new J({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(30,30,30,200)},{offset:1,color:w(0,0,0,255)}]}),l=new U({color:w(255,255,220)}),u=new U({color:w(255,255,166)}),c=new U({color:w(255,255,220)}),d=new U({color:w(255,255,220,130)}),f=new U({color:w(255,255,200)}),g=f,y=g,m=new it({angle:45,stops:[{offset:0,color:w(230,230,230)},{offset:1,color:w(150,150,150)}]}),p=new U({color:w(220,220,220)}),x=new U({color:w(200,200,200,50)}),A=new U({color:w(200,200,200,150)}),S=new U({color:w(200,200,200,20)}),v=new U({color:w(220,220,220)}),b=new it({angle:0,stops:[{offset:0,color:w(10,10,10,220)},{offset:1,color:w(30,30,30,220)}]}),M=i,T=w(255,255,200),R=b,E=M,k=w(20,20,20),I=w(0,0,0),F=t,D=w(150,150,150),P=w(50,50,50),L=w(50,50,50),V=w(100,100,100),_=w(200,200,200),B=[w(255,255,91,255),w(255,205,91,255),w(255,155,91,255),w(255,196,188,255),w(255,148,184,255),w(219,148,198,255),w(235,196,224,255),w(169,148,198,255),w(148,226,198,255),w(148,255,176,255),w(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),z=t.setA(20),N=w(176,255,157,255),O=w(255,112,76,255),Y={mapChartFillStyle:new it({angle:135,stops:[{color:w(255,255,91,255),offset:0},{color:w(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,B,.5),pieChartSliceFillStylePalette:Zf(s,B,1),funnelChartSliceFillStylePalette:Hf(s,B,1),pyramidChartSliceFillStylePalette:Hf(s,B,1),rectangleSeriesFillStyle:Wf(s,B),gaugeChartBarColor:w(255,255,91,255),gaugeChartGlowColor:w(255,255,91,64)},G=new U({color:w(176,255,157,255)}),X=new U({color:w(255,146,146,255)}),Z=new U({color:w(176,255,157,255)}),H=new U({color:w(230,63,63,255)}),W=new U({color:w(176,255,157,120)}),j=new U({color:w(229,63,63,180)}),K=new U({color:w(27,37,36,255)}),$=new U({color:w(62,27,27,255)}),Q=[w(255,0,0),w(255,255,0),w(0,255,0)],q=[w(10,10,255),w(10,190,255),w(251,255,0),w(255,38,0)],tt=[w(255,255,0),w(255,204,0),w(255,128,0),w(255,0,0)],et=[w(0,0,0),w(167,4,69,255),w(255,0,0),w(252,252,168,255)],st=new J({stops:[{color:w(61,61,80,100),offset:0},{color:w(44,44,55,30),offset:1}]}),rt=new U({color:w(148,148,198,255)}),nt=W.getColor().setA(255),ot=w(100,100,100),ht=[w(255,241,149,200),w(255,230,65,200),w(238,211,32,200),w(238,176,32,200),w(255,159,13,200),w(254,120,37,200),w(253,91,56,200),w(253,75,84,200),w(254,95,124,200),w(227,56,160,200),w(226,53,134,200),w(216,90,166,200),w(254,151,206,200),w(237,151,254,200),w(243,177,255,200),w(233,133,252,200),w(210,101,230,200),w(178,61,200,200),w(193,81,156,200),w(217,95,145,200)];return Yf({isDark:s,highlightColorOffset:w(60,60,60,60),highlightColorOffsetAxisOverlay:w(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:n,dashboardSplitterFillStyle:o,panelBackgroundFillStyle:h,seriesBackgroundFillStyle:a,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:l,axisTitleFillStyle:u,axisLabelMajorFillStyle:c,axisLabelMinorFillStyle:d,uiTitleFillStyle:f,uiTextFillStyle:g,cursorTextFillStyle:y,axisLineFillStyle:m,axisTickMajorFillStyle:p,axisGridMajorFillStyle:x,axisTickMinorFillStyle:A,axisGridMinorFillStyle:S,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:T,resultTableBackgroundFillStyle:R,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:k,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:F,uiStrokeColorContrastMedium:D,uiStrokeColorContrastLow:P,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:V,dataStrokeColorContrastLow:_,dataColorPalette:B,dataColorPaletteInverted:[{area:w(190,50,50,100),border:w(210,80,80)}],dataHighlightOverlayColor:z,dataColorPositive:N,dataColorNegative:O,zoomBandChartDefocusOverlayFillStyle:new U({color:w(0,0,0,180)}),zoomBandChartSplitterColor:C("#FBFB5A"),zoomBandChartKnobFillStyle:t=>new qn({source:Gf(t,"zoomBandChart/darkgold-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:Y,treeMapChartParentColor:C("#181E21"),treeMapChartNodeColors:ht,treeMapChartLabelFillStyle:new U({color:w(33,33,33)}),treeMapChartLabelHeaderFillStyle:new U({color:w(250,250,250)})},{positiveTextFillStyle:G,negativeTextFillStyle:X,positiveFillStyle:Z,negativeFillStyle:H,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:K,negativeBackgroundFillStyle:$,badGoodColorPalette:Q,coldHotColorPalette:q,intensityColorPalette:tt,spectrogramColorPalette:et,bollingerFillStyle:st,bollingerBorderFillStyle:rt,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:ot})})),Kf=Ce((()=>{const t=w(255,255,255),i=new U({color:t}),s=!0,r=new ao({spread:0,blur:9,offset:{x:0,y:0},color:w(105,255,236,40)}),n=new U({color:w(2,21,30)}),o=new J({stops:[{color:w(19,40,66,150),offset:0},{color:w(0,0,0,150),offset:1}]}),h=new U({color:w(0,5,8,150)}),a=i,l=i,u=i,c=new U({color:w(255,255,220,130)}),d=i,f=i,g=f,y=new U({color:w(20,224,250,255)}),m=i,p=new U({color:w(61,94,110,100)}),x=new U({color:w(61,94,110,255)}),A=new U({color:w(61,94,110,40)}),S=i,v=new U({color:w(0,18,23,255)}),b=i,M=t,T=new U({color:w(0,17,22,240)}),R=i,E=w(0,38,48,220),k=w(0,0,0),I=t,F=w(150,150,150),D=w(19,78,93),P=w(50,50,50),L=w(0,36,48),V=w(200,200,200),_=[w(45,253,253,255),w(44,172,247,255),w(46,100,248,255),w(96,84,199,255),w(184,104,245,255),w(98,160,218,255),w(43,238,245,255),w(38,140,206,255),w(112,96,224,255),w(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),B=t.setA(50),z=w(3,217,194,255),N=w(230,63,63,255),O={mapChartFillStyle:new it({angle:135,stops:[{color:w(118,248,231,255),offset:0},{color:w(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,_,1),pieChartSliceFillStylePalette:Zf(s,_,1),funnelChartSliceFillStylePalette:Hf(s,_,1),pyramidChartSliceFillStylePalette:Hf(s,_,1),rectangleSeriesFillStyle:Wf(s,_),gaugeChartBarColor:w(3,217,194,255),gaugeChartGlowColor:w(3,217,194,120)},Y=new U({color:w(45,253,253,255)}),G=new U({color:w(255,146,146,255)}),X=new U({color:w(45,253,253,255)}),Z=new U({color:w(230,63,63,255)}),H=new U({color:w(1,190,164,120)}),W=new U({color:w(229,63,63,180)}),j=new U({color:w(1,53,57,255)}),K=new U({color:w(62,27,27,255)}),$=[w(1,104,119,255),w(0,165,144,255),w(0,246,214,255)],Q=[w(0,87,95,255),w(0,125,124,255),w(1,209,182,255),w(0,255,221,255),w(218,112,112,255),w(172,47,47,255)],q=[w(126,255,253,255),w(50,233,230,255),w(0,196,193,255),w(62,138,178,255),w(139,88,191,255),w(162,55,143,255)],tt=[w(13,31,52,255),w(101,50,118,255),w(1,142,172,255),w(2,196,170,255),w(0,255,221,255)],et=new J({stops:[{color:w(122,103,254,70),offset:0},{color:w(178,168,255,10),offset:1}]}),st=new U({color:w(122,103,254,255)}),rt=H.getColor().setA(255),nt=w(15,83,83),ot=[w(139,252,252,150),w(60,239,239,150),w(2,201,201,150),w(26,159,159,150),w(15,146,187,150),w(65,168,200,150),w(67,146,207,150),w(64,108,209,150),w(189,64,233,150),w(219,84,238,150),w(192,55,212,150),w(212,98,229,150),w(248,110,211,150),w(251,154,225,150),w(251,154,184,150),w(233,105,144,150),w(255,133,170,150),w(249,110,135,150),w(245,72,101,150),w(210,57,84,150)];return Yf({isDark:s,highlightColorOffset:w(60,60,60,60),highlightColorOffsetAxisOverlay:w(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new qn({source:Gf(t,"themes/turquoiseHexagon.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:n,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:y,axisTickMajorFillStyle:m,axisGridMajorFillStyle:p,axisTickMinorFillStyle:x,axisGridMinorFillStyle:A,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:T,resultTableBackgroundBorderFillStyle:R,uiBackgroundColor:E,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:V,dataColorPalette:_,dataColorPaletteInverted:[{area:w(170,60,210,100),border:w(210,100,250)}],dataHighlightOverlayColor:B,dataColorPositive:z,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new U({color:w(0,0,0,180)}),zoomBandChartSplitterColor:C("#2BF4F4"),zoomBandChartKnobFillStyle:t=>new qn({source:Gf(t,"zoomBandChart/turquoise-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:C("#002329"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new U({color:w(33,33,33)}),treeMapChartLabelHeaderFillStyle:new U({color:w(250,250,250)})},{positiveTextFillStyle:Y,negativeTextFillStyle:G,positiveFillStyle:X,negativeFillStyle:Z,positiveAreaFillStyle:H,negativeAreaFillStyle:W,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:K,badGoodColorPalette:$,coldHotColorPalette:Q,intensityColorPalette:q,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),$f=Ce((()=>{const t=!1,i=new ao({spread:0,blur:6,offset:{x:2,y:-2},color:w(0,0,0,30)}),s=new J({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:w(255,255,255)},{offset:1,color:w(255,255,255)}]}),r=new U({color:w(219,227,233,255)}),n=new J({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(255,255,255,200)},{offset:1,color:w(240,244,246,200)}]}),o=new J({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(255,255,255,255)},{offset:1,color:w(255,255,255,255)}]}),h=new U({color:w(33,43,49)}),a=new U({color:w(33,43,49)}),l=new U({color:w(33,43,49)}),u=new U({color:w(33,43,49,150)}),c=new U({color:w(33,43,49)}),d=c,f=d,g=new it({angle:45,stops:[{offset:0,color:w(225,225,225)},{offset:1,color:w(225,225,225)}]}),y=new U({color:w(150,150,150,255)}),m=new U({color:w(150,150,150,170)}),p=new U({color:w(150,150,150,150)}),x=new U({color:w(150,150,150,100)}),A=new U({color:w(60,70,80)}),S=new it({angle:0,stops:[{offset:0,color:w(255,255,255,240)},{offset:1,color:w(255,255,255,240)}]}),v=new U({color:w(168,186,199)}),b=w(255,255,200),M=new U({color:w(255,255,255,240)}),T=new U({color:w(128,146,159,255)}),R=w(255,255,255,255),E=w(168,168,199,255),k=w(168,186,199,255),I=w(168,186,199,255),F=w(168,186,199,255),D=w(168,186,199,255),P=w(100,100,100),L=w(200,200,200),V=[w(28,181,140,255),w(255,132,0,255),w(240,39,39,255),w(86,121,251,255),w(2,181,213,255),w(13,212,158,255),w(22,167,3,255),w(234,103,232,255),w(62,183,179,255),w(140,93,3,255),w(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),_=w(150,150,150,80),B=w(46,182,120,255),z=w(255,66,66,255),N=new Ji({thickness:2,fillStyle:new U({color:w(168,186,199,255)})}),O={mapChartFillStyle:new it({angle:-45,stops:[{color:w(2,181,213,255),offset:0},{color:w(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(t,V,.8),pieChartSliceFillStylePalette:Zf(t,V,.8),funnelChartSliceFillStylePalette:Hf(t,V,.5),pyramidChartSliceFillStylePalette:Hf(t,V,.5),rectangleSeriesFillStyle:Wf(t,V),gaugeChartBarColor:w(46,182,120,255),gaugeChartGlowColor:w(46,182,120,120),chartXYSeriesBackgroundStrokeStyle:N,chart3DSeriesBackgroundStrokeStyle:N,polarChartSeriesBackgroundStrokeStyle:N,spiderChartSeriesBackgroundStrokeStyle:N,dataGridTextFillStyle:new U({color:w(0,88,64,255)})},Y=new U({color:w(4,146,108,255)}),G=new U({color:w(240,39,39,255)}),X=new U({color:w(28,181,140,255)}),Z=new U({color:w(230,88,88,255)}),H=new U({color:w(28,181,140,180)}),W=new U({color:w(230,88,88,180)}),j=new U({color:w(229,243,228)}),K=new U({color:w(232,225,216)}),$=[w(193,48,48,255),w(240,234,60,255),w(45,191,55,255)],Q=[w(10,19,255,255),w(15,191,250,255),w(249,255,2,255),w(253,133,0,255),w(255,24,0,255)],q=[w(50,99,213),w(8,179,77),w(255,246,0),w(255,126,0),w(189,36,30)],tt=[w(16,64,176),w(8,179,77),w(255,246,0),w(255,126,0),w(168,6,0)],et=new U({color:w(185,198,207,255)}),st=new J({stops:[{color:w(151,190,220,10),offset:0},{color:w(151,190,220,50),offset:1}]}),rt=H.getColor().setA(255),nt=w(150,150,150),ot=[w(255,243,136,125),w(254,237,99,125),w(255,216,109,125),w(255,172,100,125),w(255,133,101,125),w(255,113,142,125),w(230,103,129,125),w(242,126,219,125),w(255,155,235,125),w(255,181,240,125),w(203,143,255,125),w(208,154,255,125),w(171,188,255,125),w(197,209,255,125),w(171,187,255,125),w(84,167,239,125),w(38,196,214,125),w(38,214,196,125),w(69,225,141,125),w(36,191,88,125)];return Yf({isDark:t,highlightColorOffset:w(-60,-60,-60,60),highlightColorOffsetAxisOverlay:w(0,0,0,40),effect:i,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:s,dashboardSplitterFillStyle:r,panelBackgroundFillStyle:n,seriesBackgroundFillStyle:o,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:h,axisTitleFillStyle:a,axisLabelMajorFillStyle:l,axisLabelMinorFillStyle:u,uiTitleFillStyle:c,uiTextFillStyle:d,cursorTextFillStyle:f,axisLineFillStyle:g,axisTickMajorFillStyle:y,axisGridMajorFillStyle:m,axisTickMinorFillStyle:p,axisGridMinorFillStyle:x,cursorGridFillStyle:A,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:T,uiBackgroundColor:R,uiBackgroundBorderColor:E,uiStrokeColorContrastHigh:k,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:D,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:L,dataColorPalette:V,dataColorPaletteInverted:[{area:w(190,50,50,100),border:w(210,80,80)}],dataHighlightOverlayColor:_,dataColorPositive:B,dataColorNegative:z,zoomBandChartDefocusOverlayFillStyle:new U({color:w(255,255,255,180)}),zoomBandChartSplitterColor:C("#505D65"),zoomBandChartKnobFillStyle:t=>new qn({source:Gf(t,"zoomBandChart/light-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:C("#D9D9D9"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new U({color:w(0,0,0)}),treeMapChartLabelHeaderFillStyle:new U({color:w(33,33,33)})},{positiveTextFillStyle:Y,negativeTextFillStyle:G,positiveFillStyle:X,negativeFillStyle:Z,positiveAreaFillStyle:H,negativeAreaFillStyle:W,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:K,badGoodColorPalette:$,coldHotColorPalette:Q,intensityColorPalette:q,spectrogramColorPalette:tt,bollingerFillStyle:st,bollingerBorderFillStyle:et,highlightPointColor:w(0,0,0),highlightDataGridColor:rt,unfocusedDataColor:nt})})),Qf=Ce((()=>{const t=!1,i=new J({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:w(255,255,255)},{offset:1,color:w(255,255,255)}]}),s=new U({color:w(214,236,216,255)}),r=new J({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(233,244,231,70)},{offset:1,color:w(233,244,231,200)}]}),n=new J({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(255,255,255,255)},{offset:1,color:w(255,255,255,255)}]}),o=new U({color:w(1,61,53)}),h=new U({color:w(1,61,53)}),a=new U({color:w(1,61,53)}),l=new U({color:w(1,61,53,150)}),u=new U({color:w(1,61,53)}),c=u,d=c,f=new it({angle:45,stops:[{offset:0,color:w(225,225,225)},{offset:1,color:w(225,225,225)}]}),g=new U({color:w(188,211,186,255)}),y=new U({color:w(188,211,186,150)}),m=new U({color:w(188,211,186,50)}),p=new U({color:w(188,211,186,50)}),x=new U({color:w(104,148,111,255)}),A=new it({angle:0,stops:[{offset:0,color:w(255,255,255,240)},{offset:1,color:w(255,255,255,240)}]}),S=new U({color:w(104,148,111)}),v=w(255,255,200),b=new U({color:w(255,255,255,240)}),M=new U({color:w(104,148,111,255)}),T=w(255,255,255,255),R=w(179,201,183,255),E=w(188,211,186,255),k=w(188,211,186,255),I=w(188,211,186,255),F=w(188,211,186,255),D=w(100,100,100),P=w(200,200,200),L=[w(138,195,142,255),w(193,161,114,255),w(178,99,99,255),w(142,156,210,255),w(154,209,219,255),w(164,212,199,255),w(104,156,97,255),w(196,147,195,255),w(92,190,187,255),w(126,100,51,255),w(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),V=w(150,150,150,80),_=w(46,182,84,255),B=w(232,96,96,255),z=new Ji({thickness:2,fillStyle:new U({color:w(188,211,186,255)})}),N={mapChartFillStyle:new it({angle:-45,stops:[{color:w(118,160,121,255),offset:0},{color:w(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:Xf(t,L,.8),pieChartSliceFillStylePalette:Zf(t,L,.8),pyramidChartSliceFillStylePalette:Hf(t,L,.5),funnelChartSliceFillStylePalette:Hf(t,L,.5),rectangleSeriesFillStyle:Wf(t,L),gaugeChartBarColor:w(46,182,84,255),gaugeChartGlowColor:w(46,182,84,120),chartXYSeriesBackgroundStrokeStyle:z,chart3DSeriesBackgroundStrokeStyle:z,polarChartSeriesBackgroundStrokeStyle:z,spiderChartSeriesBackgroundStrokeStyle:z,dataGridTextFillStyle:new U({color:w(77,66,21,255)})},O=new U({color:w(93,151,97,255)}),Y=new U({color:w(178,99,99,255)}),G=new U({color:w(138,195,142,255)}),X=new U({color:w(178,99,99,255)}),Z=new U({color:w(138,195,142,180)}),H=new U({color:w(178,99,99,180)}),W=new U({color:w(224,240,237)}),j=new U({color:w(251,227,227)}),K=[w(178,99,99,255),w(215,224,111,255),w(80,186,88,255)],$=[w(62,64,142,255),w(66,131,77,255),w(250,250,135,255),w(202,161,78,255),w(179,53,53,255)],Q=[w(64,86,138),w(123,192,205),w(255,252,149),w(220,155,92),w(184,78,74)],q=[w(64,86,138),w(123,192,205),w(255,252,149),w(220,155,92),w(132,60,57)],tt=new U({color:w(185,198,207,255)}),et=new J({stops:[{color:w(151,190,220,10),offset:0},{color:w(151,190,220,50),offset:1}]}),st=Z.getColor().setA(255),rt=w(150,150,150),nt=[w(242,239,210,150),w(243,238,183,150),w(210,222,136,150),w(204,217,148,150),w(157,190,124,150),w(143,178,72,150),w(198,147,88,150),w(216,148,71,150),w(229,142,103,150),w(225,174,152,150),w(219,149,203,150),w(216,188,209,150),w(109,198,189,150),w(172,206,202,150),w(164,223,217,150),w(174,215,233,150),w(203,225,235,150),w(220,227,243,150),w(207,213,227,150),w(171,182,209,150)];return Yf({isDark:t,highlightColorOffset:w(-60,-60,-60,60),highlightColorOffsetAxisOverlay:w(0,0,0,40),effect:void 0,effectsText:!1,effectsDashboardSplitters:!1,lcjsBackgroundFillStyle:i,dashboardSplitterFillStyle:s,panelBackgroundFillStyle:r,seriesBackgroundFillStyle:n,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:o,axisTitleFillStyle:h,axisLabelMajorFillStyle:a,axisLabelMinorFillStyle:l,uiTitleFillStyle:u,uiTextFillStyle:c,cursorTextFillStyle:d,axisLineFillStyle:f,axisTickMajorFillStyle:g,axisGridMajorFillStyle:y,axisTickMinorFillStyle:m,axisGridMinorFillStyle:p,cursorGridFillStyle:x,legendBackgroundFillStyle:A,legendBackgroundBorderFillStyle:S,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:b,resultTableBackgroundBorderFillStyle:M,uiBackgroundColor:T,uiBackgroundBorderColor:R,uiStrokeColorContrastHigh:E,uiStrokeColorContrastMedium:k,uiStrokeColorContrastLow:I,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:D,dataStrokeColorContrastLow:P,dataColorPalette:L,dataColorPaletteInverted:[{area:w(210,70,70,100),border:w(200,110,110)}],dataHighlightOverlayColor:V,dataColorPositive:_,dataColorNegative:B,zoomBandChartDefocusOverlayFillStyle:new U({color:w(255,255,255,180)}),zoomBandChartSplitterColor:C("#446A40"),zoomBandChartKnobFillStyle:t=>new qn({source:Gf(t,"zoomBandChart/lightnature-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N,treeMapChartParentColor:C("#EFF7EE"),treeMapChartNodeColors:nt,treeMapChartLabelFillStyle:new U({color:w(0,0,0)}),treeMapChartLabelHeaderFillStyle:new U({color:w(33,33,33)})},{positiveTextFillStyle:O,negativeTextFillStyle:Y,positiveFillStyle:G,negativeFillStyle:X,positiveAreaFillStyle:Z,negativeAreaFillStyle:H,positiveBackgroundFillStyle:W,negativeBackgroundFillStyle:j,badGoodColorPalette:K,coldHotColorPalette:$,intensityColorPalette:Q,spectrogramColorPalette:q,bollingerFillStyle:et,bollingerBorderFillStyle:tt,highlightPointColor:w(0,0,0),highlightDataGridColor:st,unfocusedDataColor:rt})})),qf=Ce((()=>{const t=w(255,255,255),i=new U({color:t}),s=!0,r=new ao({spread:1,blur:9,offset:{x:0,y:0},color:w(255,255,255,30)}),n=new U({color:w(6,15,36)}),o=new J({stops:[{color:w(46,13,87,50),offset:0},{color:w(0,0,0,150),offset:1}]}),h=new U({color:w(0,5,8,150)}),a=i,l=i,u=i,c=new U({color:w(255,255,220,130)}),d=i,f=i,g=f,y=new it({angle:45,stops:[{offset:0,color:w(241,133,255,255)},{offset:1,color:w(115,207,238,255)}]}),m=i,p=new U({color:w(61,94,110,100)}),x=new U({color:w(61,94,110,255)}),A=new U({color:w(61,94,110,40)}),S=i,v=new U({color:w(0,18,23,255)}),b=i,M=w(115,207,238,255),T=new U({color:w(0,17,22,240)}),R=i,E=w(0,38,48,255),k=w(0,0,0),I=t,F=w(150,150,150),D=w(19,57,93),P=w(50,50,50),L=w(0,17,48),V=w(200,200,200),_=[w(20,211,237,255),w(98,147,252,255),w(164,73,250,255),w(129,117,253,255),w(95,134,252,255),w(22,133,212,255),w(35,200,242,255),w(104,121,233,255),w(137,69,232,255),w(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(180)}))),B=t.setA(50),z=w(3,217,194,255),N=w(243,21,110,255),O={mapChartFillStyle:new it({angle:135,stops:[{color:w(118,248,231,255),offset:0},{color:w(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,_,.5),pieChartSliceFillStylePalette:Zf(s,_,2),funnelChartSliceFillStylePalette:Hf(s,_,1),pyramidChartSliceFillStylePalette:Hf(s,_,1),rectangleSeriesFillStyle:Wf(s,_),gaugeChartBarColor:w(3,217,194,255),gaugeChartGlowColor:w(3,217,194,150)},Y=new U({color:w(20,211,237,255)}),G=new U({color:w(253,145,178,255)}),X=new U({color:w(20,211,237,255)}),Z=new U({color:w(239,68,121,255)}),H=new U({color:w(20,211,237,120)}),W=new U({color:w(239,68,121,180)}),j=new U({color:w(1,53,57,255)}),K=new U({color:w(94,19,42,255)}),$=[w(174,51,132,255),w(204,107,218,255),w(189,215,253,255)],Q=[w(0,63,95,255),w(0,149,255,255),w(0,225,255,255),w(255,154,254,255),w(204,98,170,255),w(139,39,84,255)],q=[w(197,241,255,255),w(70,210,255,255),w(0,164,217,255),w(90,99,222,255),w(138,75,192,255),w(151,27,162,255)],tt=[w(13,31,52,255),w(129,54,130,255),w(131,108,176,255),w(7,162,213,255),w(26,247,255,255)],et=new J({stops:[{color:w(219,42,235,60),offset:0},{color:w(237,73,252,10),offset:1}]}),st=new U({color:w(237,73,252,255)}),rt=H.getColor().setA(255),nt=w(8,70,100),ot=[w(149,230,255,150),w(93,213,243,150),w(20,189,223,150),w(5,151,181,150),w(2,138,198,150),w(2,113,198,150),w(97,148,236,150),w(93,111,230,150),w(151,120,223,150),w(128,87,227,150),w(153,52,230,150),w(179,92,245,150),w(248,110,211,150),w(255,155,228,150),w(251,88,207,150),w(255,0,162,150),w(214,73,177,150),w(209,71,159,150),w(238,101,169,150),w(210,57,134,150)];return Yf({isDark:s,highlightColorOffset:w(60,60,60,60),highlightColorOffsetAxisOverlay:w(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new qn({source:Gf(t,"themes/cyberSpace.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:n,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:y,axisTickMajorFillStyle:m,axisGridMajorFillStyle:p,axisTickMinorFillStyle:x,axisGridMinorFillStyle:A,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:T,resultTableBackgroundBorderFillStyle:R,uiBackgroundColor:E,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:V,dataColorPalette:_,dataColorPaletteInverted:[{area:w(41,130,255,100),border:w(45,110,240)}],dataHighlightOverlayColor:B,dataColorPositive:z,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new U({color:w(0,0,0,180)}),zoomBandChartSplitterColor:C("#DB77FF"),zoomBandChartKnobFillStyle:t=>new qn({source:Gf(t,"zoomBandChart/cyberspace-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:C("#1E1E3B"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new U({color:w(33,33,33)}),treeMapChartLabelHeaderFillStyle:new U({color:w(250,250,250)})},{positiveTextFillStyle:Y,negativeTextFillStyle:G,positiveFillStyle:X,negativeFillStyle:Z,positiveAreaFillStyle:H,negativeAreaFillStyle:W,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:K,badGoodColorPalette:$,coldHotColorPalette:Q,intensityColorPalette:q,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),Jf={};Object.defineProperty(Jf,"darkGold",{get:jf,enumerable:!0}),Object.defineProperty(Jf,"turquoiseHexagon",{get:Kf,enumerable:!0}),Object.defineProperty(Jf,"light",{get:$f,enumerable:!0}),Object.defineProperty(Jf,"lightNature",{get:Qf,enumerable:!0}),Object.defineProperty(Jf,"cyberSpace",{get:qf,enumerable:!0});const tg=Jf,eg=tg.darkGold,ig=(t,i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAgCAYAAADwkoGKAAAsa2NhQlgAACxranVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAALEVqdW1iAAAAR2p1bWRjMm1hABEAEIAAAKoAOJtxA3Vybjp1dWlkOjlmZDBkZjkzLTVmMDMtNDczYi1hZThhLTFhNDM4NmMzNmJhYQAAAAGzanVtYgAAAClqdW1kYzJhcwARABCAAACqADibcQNjMnBhLmFzc2VydGlvbnMAAAAA12p1bWIAAAAmanVtZGNib3IAEQAQgAAAqgA4m3EDYzJwYS5hY3Rpb25zAAAAAKljYm9yoWdhY3Rpb25zgaNmYWN0aW9ua2MycGEuZWRpdGVkbXNvZnR3YXJlQWdlbnRtQWRvYmUgRmlyZWZseXFkaWdpdGFsU291cmNlVHlwZXhTaHR0cDovL2N2LmlwdGMub3JnL25ld3Njb2Rlcy9kaWdpdGFsc291cmNldHlwZS9jb21wb3NpdGVXaXRoVHJhaW5lZEFsZ29yaXRobWljTWVkaWEAAACranVtYgAAAChqdW1kY2JvcgARABCAAACqADibcQNjMnBhLmhhc2guZGF0YQAAAAB7Y2JvcqVqZXhjbHVzaW9uc4GiZXN0YXJ0GCFmbGVuZ3RoGSx3ZG5hbWVuanVtYmYgbWFuaWZlc3RjYWxnZnNoYTI1NmRoYXNoWCBvErgv+J0u7bVCYViyMUgw5yMb8idAv1erA3/DALx9NWNwYWRIAAAAAAAAAAAAAAIDanVtYgAAACRqdW1kYzJjbAARABCAAACqADibcQNjMnBhLmNsYWltAAAAAddjYm9yqGhkYzp0aXRsZW9HZW5lcmF0ZWQgaW1hZ2VpZGM6Zm9ybWF0aWltYWdlL3BuZ2ppbnN0YW5jZUlEeCh4bXAuaWlkOjI3NEMxQjdDN0E0MDExRUVBQkZFQUNFQjJDOTA0NzVCb2NsYWltX2dlbmVyYXRvcng2QWRvYmVfUGhvdG9zaG9wLzI1LjIuMCBhZG9iZV9jMnBhLzAuNy42IGMycGEtcnMvMC4yNS4ydGNsYWltX2dlbmVyYXRvcl9pbmZvgb9kbmFtZW9BZG9iZSBQaG90b3Nob3BndmVyc2lvbmYyNS4yLjD/aXNpZ25hdHVyZXgZc2VsZiNqdW1iZj1jMnBhLnNpZ25hdHVyZWphc3NlcnRpb25zgqJjdXJseCdzZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmFjdGlvbnNkaGFzaFggSmnBvf+o3kEweL4k7cz4MTrB0WSVNFZxoA1rBrM31K+iY3VybHgpc2VsZiNqdW1iZj1jMnBhLmFzc2VydGlvbnMvYzJwYS5oYXNoLmRhdGFkaGFzaFggL2g6Dghd536quyA5vPlS/9NGA5WvLRkkKJmqn0VxCoFjYWxnZnNoYTI1NgAAKEBqdW1iAAAAKGp1bWRjMmNzABEAEIAAAKoAOJtxA2MycGEuc2lnbmF0dXJlAAAAKBBjYm9y0oREoQE4JKNmc2lnVHN0oWl0c3RUb2tlbnOBoWN2YWxZDjYwgg4yMAMCAQAwgg4pBgkqhkiG9w0BBwKggg4aMIIOFgIBAzEPMA0GCWCGSAFlAwQCAQUAMIGCBgsqhkiG9w0BCRABBKBzBHEwbwIBAQYJYIZIAYb9bAcBMDEwDQYJYIZIAWUDBAIBBQAEIHj4VpJDPzaO0x4hOPnj/w1GTHuwXU0IpBf4VVocIQzoAhB3SsxvHza2JR1fKj3Mjr0yGA8yMDIzMTEwMzExNTcyNloCCQCyOL6wAOGCbaCCC70wggUHMIIC76ADAgECAhAFHp6R1x6RCrvkPVzt0N3ZMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwgSW5jLjE7MDkGA1UEAxMyRGlnaUNlcnQgVHJ1c3RlZCBHNCBSU0E0MDk2IFNIQTI1NiBUaW1lU3RhbXBpbmcgQ0EwHhcNMjMwOTA4MDAwMDAwWhcNMzQxMjA3MjM1OTU5WjBYMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xMDAuBgNVBAMTJ0RpZ2lDZXJ0IEFkb2JlIEFBVEwgVGltZXN0YW1wIFJlc3BvbmRlcjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABE0srlH5A/+15/MFl1asNh8Q8TubOsEVfu0qlJrF0smjtwL1IeHZ/AB7J59u1Trpho1BDN85lfTY30rNBsfT+myjggGLMIIBhzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADAWBgNVHSUBAf8EDDAKBggrBgEFBQcDCDAgBgNVHSAEGTAXMAgGBmeBDAEEAjALBglghkgBhv1sBwEwHwYDVR0jBBgwFoAUuhbZbU2FL3MpdpovdYxqII+eyG8wHQYDVR0OBBYEFLA1qlbDIamLztO4vIsWJVed7zThMFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNFJTQTQwOTZTSEEyNTZUaW1lU3RhbXBpbmdDQS5jcmwwgZAGCCsGAQUFBwEBBIGDMIGAMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wWAYIKwYBBQUHMAKGTGh0dHA6Ly9jYWNlcnRzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNFJTQTQwOTZTSEEyNTZUaW1lU3RhbXBpbmdDQS5jcnQwDQYJKoZIhvcNAQELBQADggIBAHgrjELHhBCEWJSCyRX7lsL0C9LJgbX1ryVYySNRxHkMR2LqC7PQZRJgDNR+kJop8P5v2Bzp/jMrzw4U4pY6rYv3I8HpFlJa4uBwUTIUgHWpi8Xxd1JEEX94POODi7HySekX60A055BozFb7GGVaxb0LreQTRXnkr6ggPNUPX9Gh+2ScOxlTdQQLgZbkdYvxo3Ap6cy9riZijRxOZqiOyWSxMUhgKxeKzwrFW6Xbe0awNhOUXZzIxc4ixpKzWSItpPJ30ZiBQn49U3ADYTnshbN9ZkTA1pHf/Nov2ZUvvddkZ8UYvwo9vBvLTDvnmABnRMBKaXYAs3ZCvw9CkDPOWTeUJMFRAtmUx52ohaA3nD8bCJ6UfpQ2pFfOdShwpb6GKv0g+BgcdIG2LHPJ0Ufmr+XmpgZgq/HIge0hjcCADpjDgq2z4B0L4xtAA1M8MrUx02hxb7104nFKqMuv5zJTQl3sgwqXUyP+9zHQP9y/Z5Fx/AQWrOXCW56dV7P4cFBJl8zHqinlhkOStZ1m22+9Hlq+eC0hJ2lkF1LuzRdJJb/51LXoPKRnopFDng6XpoD7eG6w4YpAx9+P00JuUoBsYSrdsuFiyWyQQGBAnjI69ggbSLcW+hJytuinaxawVlItJkS2eV5Z4XsxPg7f82uRkdtN0hTHeI93CN3OWeRebnK7MIIGrjCCBJagAwIBAgIQBzY3tyRUfNhHrP0oZipeWzANBgkqhkiG9w0BAQsFADBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwHhcNMjIwMzIzMDAwMDAwWhcNMzcwMzIyMjM1OTU5WjBjMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xOzA5BgNVBAMTMkRpZ2lDZXJ0IFRydXN0ZWQgRzQgUlNBNDA5NiBTSEEyNTYgVGltZVN0YW1waW5nIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxoY1BkmzwT1ySVFVxyUDxPKRN6mXUaHW0oPRnkyibaCwzIP5WvYRoUQVQl+kiPNo+n3znIkLf50fng8zH1ATCyZzlm34V6gCff1DtITaEfFzsbPuK4CEiiIY3+vaPcQXf6sZKz5C3GeO6lE98NZW1OcoLevTsbV15x8GZY2UKdPZ7Gnf2ZCHRgB720RBidx8ald68Dd5n12sy+iEZLRS8nZH92GDGd1ftFQLIWhuNyG7QKxfst5Kfc71ORJn7w6lY2zkpsUdzTYNXNXmG6jBZHRAp8ByxbpOH7G1WE15/tePc5OsLDnipUjW8LAxE6lXKZYnLvWHpo9OdhVVJnCYJn+gGkcgQ+NDY4B7dW4nJZCYOjgRs/b2nuY7W+yB3iIU2YIqx5K/oN7jPqJz+ucfWmyU8lKVEStYdEAoq3NDzt9KoRxrOMUp88qqlnNCaJ+2RrOdOqPVA+C/8KI8ykLcGEh/FDTP0kyr75s9/g64ZCr6dSgkQe1CvwWcZklSUPRR8zZJTYsg0ixXNXkrqPNFYLwjjVj33GHek/45wPmyMKVM1+mYSlg+0wOI/rOP015LdhJRk8mMDDtbiiKowSYI+RQQEgN9XyO7ZONj4KbhPvbCdLI/Hgl27KtdRnXiYKNYCQEoAA6EVO7O6V3IXjASvUaetdN2udIOa5kM0jO0zbECAwEAAaOCAV0wggFZMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFLoW2W1NhS9zKXaaL3WMaiCPnshvMB8GA1UdIwQYMBaAFOzX44LScV1kTN8uZz/nupiuHA9PMA4GA1UdDwEB/wQEAwIBhjATBgNVHSUEDDAKBggrBgEFBQcDCDB3BggrBgEFBQcBAQRrMGkwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBBBggrBgEFBQcwAoY1aHR0cDovL2NhY2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZFJvb3RHNC5jcnQwQwYDVR0fBDwwOjA4oDagNIYyaHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZFJvb3RHNC5jcmwwIAYDVR0gBBkwFzAIBgZngQwBBAIwCwYJYIZIAYb9bAcBMA0GCSqGSIb3DQEBCwUAA4ICAQB9WY7Ak7ZvmKlEIgF+ZtbYIULhsBguEE0TzzBTzr8Y+8dQXeJLKftwig2qKWn8acHPHQfpPmDI2AvlXFvXbYf6hCAlNDFnzbYSlm/EUExiHQwIgqgWvalWzxVzjQEiJc6VaT9Hd/tydBTX/6tPiix6q4XNQ1/tYLaqT5Fmniye4Iqs5f2MvGQmh2ySvZ180HAKfO+ovHVPulr3qRCyXen/KFSJ8NWKcXZl2szwcqMj+sAngkSumScbqyQeJsG33irr9p6xeZmBo1aGqwpFyd/EjaDnmPv7pp1yr8THwcFqcdnGE4AJxLafzYeHJLtPo0m5d2aR8XKc6UsCUqc3fpNTrDsdCEkPlM05et3/JWOZJyw9P2un8WbDQc1PtkCbISFA0LcTJM3cHXg65J6t5TRxktcma+Q4c6umAU+9Pzt4rUyt+8SVe+0KXzM5h0F4ejjpnOHdI/0dKNPH+ejxmF/7K9h+8kaddSweJywm228Vex4Ziza4k9Tm8heZWcpw8De/mADfIBZPJ/tgZxahZrrdVcA6KYawmKAr7ZVBtzrVFZgxtGIJDwq9gdkT/r+k0fNX2bwE+oLeMt8EifAAzV3C+dAjfwAL5HYCJtnwZXZCpimHCUcr5n8apIUP/JiW9lVUKx+A+sDyDivl1vupL0QVSucTDh3bNzgaoSv27dZ8/DGCAbgwggG0AgEBMHcwYzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJbmMuMTswOQYDVQQDEzJEaWdpQ2VydCBUcnVzdGVkIEc0IFJTQTQwOTYgU0hBMjU2IFRpbWVTdGFtcGluZyBDQQIQBR6ekdcekQq75D1c7dDd2TANBglghkgBZQMEAgEFAKCB0TAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZIhvcNAQkFMQ8XDTIzMTEwMzExNTcyNlowKwYLKoZIhvcNAQkQAgwxHDAaMBgwFgQU2Rq5M/4XremCHqYT9aQ6cU4+fn0wLwYJKoZIhvcNAQkEMSIEIGmY+GsCefCDmP0PFcYjdxBUfi0EgKYuEZb9pUMyLNuVMDcGCyqGSIb3DQEJEAIvMSgwJjAkMCIEIILa8ZSVezaEAkWP1ScAaf5ixxRW+p4Lhqv4J+hTICfZMAoGCCqGSM49BAMCBEcwRQIgcxxuf7QHV9Fkpj1VhPrFqhNFh8dZzl8qUU/2N3Sr4eoCIQDKu0KGYL++CSsDAXjJciMDbr5ImTy3jw0yQU5GYYeLimd4NWNoYWluglkGMzCCBi8wggQXoAMCAQICEBtbCzvasORd8vMNnlTR2tIwDQYJKoZIhvcNAQELBQAwdTELMAkGA1UEBhMCVVMxIzAhBgNVBAoTGkFkb2JlIFN5c3RlbXMgSW5jb3Jwb3JhdGVkMR0wGwYDVQQLExRBZG9iZSBUcnVzdCBTZXJ2aWNlczEiMCAGA1UEAxMZQWRvYmUgUHJvZHVjdCBTZXJ2aWNlcyBHMzAeFw0yMzAyMDEwMDAwMDBaFw0yNDAyMDEyMzU5NTlaMIGhMREwDwYDVQQDDAhjYWktcHJvZDEcMBoGA1UECwwTQ29udGVudCBDcmVkZW50aWFsczETMBEGA1UECgwKQWRvYmUgSW5jLjERMA8GA1UEBwwIU2FuIEpvc2UxEzARBgNVBAgMCkNhbGlmb3JuaWExCzAJBgNVBAYTAlVTMSQwIgYJKoZIhvcNAQkBFhVncnAtY2FpLW9wc0BhZG9iZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDv0wCnfYY9lkHDsykrTG7FYlnYHBcyualuD5u9ULjzv+FsTWOLg8Nhrz9RTxI9EeBbu3Wm7f4vqPsQYfxkEp0wIa6DVmEOZhbAeRfbhybWQ/D4Wvvck4mEZR+QZmTpIn7HX61gbtMFHlJUxkYBctIoAt9TBAFbz9d5Ig2WG0bsH39b6/8USXnIIk4FB6dtBRT1xeEwSDtwOd1YBpXXNBJmRWHXNJZZ85of2tBTesg/kMvTrOJJxYDZ97U416wcvbVomlees+NXUY3/ZB4xH+NsZils7m1bL2v2hSnHiLoqZeUKklbHUmT4ZpjrZCdtuIsWm5j2PPXKr7HKUuCbZSXBAgMBAAWjggGMMIIBiDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAeBgNVHSUEFzAVBgkqhkiG9y8BAQwGCCsGAQUFBwMEMIGOBgNVHSAEgYYwgYMwgYAGCSqGSIb3LwECAzBzMHEGCCsGAQUFBwICMGUMY1lvdSBhcmUgbm90IHBlcm1pdHRlZCB0byB1c2UgdGhpcyBMaWNlbnNlIENlcnRpZmljYXRlIGV4Y2VwdCBhcyBwZXJtaXR0ZWQgYnkgdGhlIGxpY2Vuc2UgYWdyZWVtZW50LjBdBgNVHR8EVjBUMFKgUKBOhkxodHRwOi8vcGtpLWNybC5zeW1hdXRoLmNvbS9jYV83YTVjM2EwYzczMTE3NDA2YWRkMTkzMTJiYzFiYzIzZi9MYXRlc3RDUkwuY3JsMDcGCCsGAQUFBwEBBCswKTAnBggrBgEFBQcwAYYbaHR0cDovL3BraS1vY3NwLnN5bWF1dGguY29tMB8GA1UdIwQYMBaAFFcpejJNzP7kNU7AHyRzznNTq99qMA0GCSqGSIb3DQEBCwUAA4ICAQBXjlGa3yAK/Gijn6n/JNU9FZm72MP6vc5czrWe9y0T+EawuRvhpD5Edi1TnXkrpe8sMkgSjTGdbY+yGhq8zlCWQeXN1/aWo3L9Xr1uNxY/oVpLn0uWWfnfJ7yR9gKl/yoMfhjydT4t1fXHi/MhfhrWSVRHqX2U31UFGz/e298P2kv+vqhzpIUo1bj+jibtoPLMMQcCOTtKiJOTh4o3VSZpwQDERCzo91NkF+LnZjwYl6fE5USIkg/oCoomXxSPpowybDrcRJ9ilbtJcER48/LGgwzv/c7OYdron4PnEXm1FkOaVj+QRf7OwiNTizonhIzLR5Vfp0QHOWv/bPzvCjPQd+Xr0Q4032WlSxQwostNTAPtoVAU4OCwVH3Ech38emJ00/6fkDCdr7MN8/4n2LSNrMUvaBEZdmLqDCBnO02dbFrmpg3pTc0FqRQ4GL/88pjRNSMy5tU9SoQnSCGYqIsjfL8AzgPEGiXXRgABYc1uXecf4/eayb3K2MPs7hnWTbUKpHHJIwxpdN3vTGdZNWpz9Oxfuo3eELQlkTvACHgqkaXi/FAanHe5PChn6fr1/4cNF8goD0buPApgS3zzwqjRhxrH8ISwPfJn8JqzurMaLDMnnc18tHzUiMtX73jf6oXh7voCxX/T4D3nFPlxU3om2cpcLQ1Wd4026x18rlSGR1kGpTCCBqEwggSJoAMCAQICEAyotlR7iebSBol1zYubieIwDQYJKoZIhvcNAQELBQAwbDELMAkGA1UEBhMCVVMxIzAhBgNVBAoTGkFkb2JlIFN5c3RlbXMgSW5jb3Jwb3JhdGVkMR0wGwYDVQQLExRBZG9iZSBUcnVzdCBTZXJ2aWNlczEZMBcGA1UEAxMQQWRvYmUgUm9vdCBDQSBHMjAeFw0xNjExMjkwMDAwMDBaFw00MTExMjgyMzU5NTlaMHUxCzAJBgNVBAYTAlVTMSMwIQYDVQQKExpBZG9iZSBTeXN0ZW1zIEluY29ycG9yYXRlZDEdMBsGA1UECxMUQWRvYmUgVHJ1c3QgU2VydmljZXMxIjAgBgNVBAMTGUFkb2JlIFByb2R1Y3QgU2VydmljZXMgRzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC3Hy69vQmzXEhs/gyDrmwB6lF4JaSAPomnsbKIZNr2iXaB+fkd85X8eJiNmI7P5O4cVT4Nc1p3zrESqBV4ZUyW8gcZ78QdwoHG8QNd2VNcHnMgSR+XT9Iafsnq9Nfww3Jt9KL3l5ANQ5n1+MJqr48EWNLll942bOL/JH4ywDSMoqhZqtJEIUUUGlQVBZ8CAvJc7LE6ddA5C52PE2Ppa7RfQgHXf4gfXVZwpxYRZcziPiOHqEvLb0J3cShUbejFxV6cwX8QyAPa1ePHg1RtM0HX+D34xHo3DkyGnmT+Ddq00TEDGG26AL5PdINKFIQl+zaq6KJFQe1fdGE5wrWzU4mBPmzaz3EbLn+7FWlwAhorYqIMldbfHE3ydc+aTU1JW7+bG19qmvhO9IluGtTtQDeqFBj2fg6faxsfVfVPD7stN6TwoIDlkOCE4RE+Iin8m3z3eqi/VsTmsmRqBxWDRaqOHz02EJoEDxXJG3ei+UbIIp01XZQvdufm90WxOTuqqan2ZqTPX9K5VdjEh/ovr7xFc5q1dZo+Sa5y4sTVM854/tLU3klOgUKzzSXYPYS3GhBcYJHjwr9xNRHnNX99D6F0g7OijScWfvtjxh13aTv/H0ETvymah4yfDpVdh9cK5YSCPqnuOlsujFAyhYwJXOWDvZZU2EkWVLDhoPx9zp7N4QIDAQABo4IBNDCCATAwEgYDVR0TAQH/BAgwBgEB/wIBADA1BgNVHR8ELjAsMCqgKKAmhiRodHRwOi8vY3JsLmFkb2JlLmNvbS9hZG9iZXJvb3RnMi5jcmwwDgYDVR0PAQH/BAQDAgEGMBQGA1UdJQQNMAsGCSqGSIb3LwEBBzBXBgNVHSAEUDBOMEwGCSqGSIb3LwECAzA/MD0GCCsGAQUFBwIBFjFodHRwczovL3d3dy5hZG9iZS5jb20vbWlzYy9wa2kvcHJvZF9zdmNlX2Nwcy5odG1sMCQGA1UdEQQdMBukGTAXMRUwEwYDVQQDEwxTWU1DLTQwOTYtMzMwHQYDVR0OBBYEFFcpejJNzP7kNU7AHyRzznNTq99qMB8GA1UdIwQYMBaAFKYc4W1UJEyoj0hyv26pjNXk7DHUMA0GCSqGSIb3DQEBCwUAA4ICAQBxzuUHjKbcLdzI4DtlXgCSgZXrlSAkr59pOF3JfPG42qVNAGU7JcEYXJ6+WbfcGwY7WYMl+jO7IvJPb7shXFYW9bnJgxX7lLU14KExchmcLNY1ee6IhBJ2Y8PzZMRUKSd5CkURPg0PBLGjz/KR/DofHx+G4rPTCOGORYxeYrd01lci5hVxvKccvIk7MD69ZTewfZPSM+0WnsU3f0Zmd7hgbRpUyWceG0eHFpdUKK/ZFWhHjDVC28odCnN885tHncKXviItK0ZUUo/AIthFKlhEXsnq9VL9fFbgvO83ZvpUQo5y8mY3cuGnEVGXdhjNb53CfC1u4dbpYmWaN99subUzEsUaUb3loLPfVfzDOpg2y9v37kBdy/wuXr20teY7U62xj/fAgs1QSnhUtlMTfCqbefyEycKVmKIrJkJLsvgTSYKVvH4FFIwfd5WjqOC97jX98rcVAzhAI0iSkazsWOMvL6m0L4nLJapx+85GsVX8Y6AHmEP4bmCElwil6KAP+UewJFiw5rmwV2pESHAhYuZJa03B8tl0nd2QJzvJGmbeBqXqpF9ORinFM3HErK8puRokOjFH2+1asLeI2tB31W/ELdNe27Ogduq6Z6qBwCp59YX27qydDhD0WRfN64kCs25K88iGAGNW2CAfTDS+b+WYJBiIL9jXYZ4LF+BiUvfdu2NwYWRZC70AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZZAQBKX2Q2ihN2fLDLReHISpfOF0xIqNpOZXbBwZ0XanWG98erbIBdawl7r9nVma/uZjYH457wp00TVpKYUTJHMnzJMKskvM2Df4K6t5pUKGtJqEvMXLUy3g9kJq53aYDwikcUE+8wv+CYtu/+vii4XYSXQIxT4NN+JKoTDXmrNH1G46Nmpfq6SKk0g9GQ2brbkW3fzGR0xDxY3BXRy71guSBxN9TAbQGqUjMnkIyBcwV9wUQ2oCW9oIMNKASjW0CRkcFEzzmrQ+y+zHYpNvUaG7QehHcyhvOec3plzlyP6DZeQWp3PHA5bmonI8t5j6Qj15X1KnQiXuJ0rW+xoMA89aIVmpx4VgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAOSaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjYyYTdmYWExLWJmZTMtMjE0Ny04MjAwLWMxM2NlMGU4ZTc1NCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyNzRDMUI3RDdBNDAxMUVFQUJGRUFDRUIyQzkwNDc1QiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyNzRDMUI3QzdBNDAxMUVFQUJGRUFDRUIyQzkwNDc1QiIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMiAoMjAyMzEwMjQubS4yMzc0IDRhYjk0MzkpICAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphYjQzZjNjYy1hNTY4LTRkNGQtOTdiZC1iYjk0YjBlZjhjYmQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NjJhN2ZhYTEtYmZlMy0yMTQ3LTgyMDAtYzEzY2UwZThlNzU0Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+HNvo5wAADZFJREFUeNrsXFtPVUkW3gc4yP0qDigKON517FFbHRGn1TamjaOJvvhsjIkvPplgfEKe1AefNDE+GP+AmWTszPTYcbpn2piJzc1GWwlOekRBEBFQ7jeZ9ZVrnVkUtfc5CGp3h5VU9qUuu3bVV9+67DonND4+7omEQiHPJaWlpYlxcXGLKX8epTCdB5aXNnHU6c2bN5POcaREp+O9dHxSX1/f5s3KL1ImYCkasMrKyvIISJspD+AyZSTpOrodDSaIBpQCkwtgSM8oVd2/f39M2quoqAijmcrKyjG/l7L77vde+v6sfCRgbdu2LY3AtJNSgg0qDa5oTOViKQtM9nXTgQMHaqmpPEoLKXUQqJpcYIqPj/cSEhLMUZgUbYyNjZkjRPpu50n+VEUvKtditMEb7Xom5OrVqzvpkOXIukFps5XXTunO4cOHR7heKp1/ye1gEX9BCcdv6H4330cbCyh9iXrRgJUQ1FmarFWUIqDS4ApiCT9AobxMpj24uI/209LSvMLCwiLKz6fyQModAlW73TeAac6cOV5SUpIBlasv9qKRvgBYIyMj3tDQkDmPdaLRPzwrHA6bhGsNWr9xsMfEZnC7XDSg+tzv4lRCCRPfjJtHjhzpu3LlCkDVx4BKZICsx9gy4PT4rmFQQbIpdfM5ynX7gWrS/Phl7NixI0SDWCCD52Is14vqAXIByoluAkl+fr43f/58Lyvr7cIaHh4OJSYmfkug6rXZApOamprqUb6vned3X4CBujj29/cbkEl/7EUj74o+og4S2gh6xkypk6mUPXnyZN25c+fCDKzm8vLyOuQzqCAtJ06cuH/+/PkwAytMLCR57VjQFy5cmKeAiXJZGOeLFy/iPBVt4Nqeb60dogKLBm9O/FvxXIwVxBAaUBpgixYt8np7e7329vYJZUtKSkwSefHihVdTU9N2586dXrtfmNj09HQz0dMRvAsYD0dhLryrvG8s7/w+ZCrPcJSdx8duAb+6l0WgWqeu/8uMZMoDWCTr+BpMVoZ8jLUq18XXgdohEFg0cXF6kF2s5Uf9NqBwxL0FCxaYSXz58qWZSNzr6+vzioqKIm01NTV5ZLgbT9HuExgGAzBdUOmJEeb6EKD5AJKt1KJ9TwAFNrpz6tSpljNnzgiQuuh8DbNSNx9HlF0mx26/cbTHLy6AsSKGcVCyjWepJwnS2trqbdiwwZyDJaDyUBbslZmZGTG6Hz9+7D18+NDdUSqTkpIyY6B6V5b4mYsBAIGm27rXR/f+DFXGKm5Ega6P7a5lqvw6sbMIcFkKlCUAI6esQI0QBCwBjxirNqCkDACSkZFhQKLVCSassbHR27Jli6kvsnDhQnN8/vy5t3Hjxsj95ubmSQ6CVoEA5a8IBO+LsSKgoskPKxaC1DKo1mmDXF1/AwAyCO+rNoX1FrANVqLA6V6sfuGGgwcPphBovrCBIuwCgRp7+vSpAUd2dra5bmtrM6pvdHTUu3fvnrGdNHhEbt265XV1dXn79+9/y8V0XltbGwkDkKpsqqqqqhG2AmgBrFn5+Qo0Uyw21gRm0kwCLwqAAgC2b99u2AQCVYWyACtUGkRUoC2bNm0yYBIBe/l5ncKaWmg1hrj/47TCRu32ebUam4LyAweEymK1QG+PUdk3PmXCrGZicrej9e99CD0znvs4NsPtRh2fmMMNLmBBYHgDmTC4ly1bNslWAbhu375tyh06dGgCw2kB+yDEAIEh39HR4RsjE+/NkgJKf0DwlNJ3jkndi2Yo/QXOZ5RxWElpOaUqSk99QLWPErzUr2OcD+j7T+GPUKqZocldyu2mWWbMv1mt4T3q2OObSVnNz46MD49xMfelE85ArOGGiA2FSR0cHDRggVe3fv16Lzc317cXCBeUlZUZu8sVBLUF7YrnaDMWygsjWpLJx1eOvCS8LKX+GFeYdPS1T356wLOC7NcOK/g4HSbaSmku2zZtlo0D6l8U5R2mIxmO91/F79iP8aY+lmhAR2Us09PXr439hAles2ZNoK2Tl5dnwgorV66clHfz5k1v165dk8CFuJYfWwm4/Twgn4FMZqO0U00OPg/lsgck0k3Ae6JACq8HamsAJgPl9fOAzef8VLpey1HtVGXUQoZ45b7QawzgojqpauJNZIYnpEXUFpWZw8ZxMqsdEdgUixlUqPMt1RlygE8mv4jO5/M7tFHZXs4HI+uJG4YFQvldnF+sAPRGjd8SSjl8fzGVG6I6Dxk76GcKl8uOlbESh4eHDVOBpWCcQ/1F88qQv2fPnknlnjx5YsIJOBYXF/9/NqhtANcV8ZbYlc8zswJYJJ8H5Eem7A3WxEYmjdVcigycyltBeV/RsVANbDKDrJnL5jom+Dsa+A5e0WDOn7g/Kx3PR/06qpPDjBS28gG6e6pfDT6gimeV5LF6iqh4focxHo84Ne8hzv8ng2sJA6tfjUedROkZbPkqRhbie8JauTEBi7y6ePncAQaaO3fulKLaWgDQgYEBoxrh+WlgiW3l9znFNtp5IBN5kv0YS6vJYgYVVlU120mfUPot58sqbeaBxJh8zqs7TIN+i573R2aMfykGQD2w21dcfx2DMI3yXjOosLqH6Fr6U8VqDHGhzVw2ns8T2BaTWNMefrc09a7PA1R1iNuuYibZwfXmUB8Qq/qrZa9tZjs1i65fcRswHf5O1zuYgZ7yeG1jdq3SbM9gauFF8yimOBYABaN66dKlUwKVS0TVQT2+evVqgjcIYAWxXxQ12O/jcWUq0MlqvwtQsIeo8zOUWoQHOcCTNMbqQsqPcTARE5PCk/+a64woB6HPYf/JMzq57KgqW8AAaKa8Jn4fbfOlKe92wGeoMq13GFQqdwD95aDmZ5Q+Z9AJwwwoYL5Wn3vqHH2JCOU9pkMjg7jWMgH8GYtspVx8cIwW6QYDrV271rccgATGAkhgm8GTfPDggbd161YTWIUqdLGVnPt4lQKsQQebJTCVj7CNlO4YmAwFlCUaBAo0XVR/nK6T+RqTNh5g7GuwLrTyMxlMfY760r/eKI4J+hJSffA1rlm9o989DK5SLtOmnpOm+pCr6zNoojpJVK6HnxFbuKGiomI5u5hRQVVdXW0+0UjowGa97u6Jn5ewewExMIAN3mA0lepjX8nLgsYXMy2P8SAmWJM6zGoJhnkrr7BEBRwbJLYHJJ/zQ5gwZhx7IkMMkEFWfZF8BcxOFU9zAes33L9+yzERMKLP66nMM8V4HjNFpgPI0r9kft4AmwLjzE4wD0Z58S0OMCvk/RMDgB1zHGtZtIoIgopKe/TokRNYnZ2dzroAIsAFo93Vrq0OAxgLdPZ7TZBsLOtBAl2vZbvqE1VWT4JWM/YkDfJk4P4+GtxqR5l07otrYjMdk6Ydj24ebxjwO23CZ6A+YGegiJOn+vY3xcC9jncY5TwA7E92+zGEW/r5+CnbUjdijbXYbJXs8E6ck11aWmp2G+B7oC1Qc2AsP+AAVHqT3RR3Vd5nQ9dO93hw6ik95hX9H7jonF/PIQBjj7ARC9f5rhUTQrlWrt/L9e/y/XbOq1ce0ihfy0A85useZop6K2gJ8P8A0FACo/7De7tV5Qd4sgIa8QDp2IBoDTNOvU7Mlo1sQ44rwNSzwS3t19l14WWq/tb4qLW76rn3Yp2gSd8KCVjwWMqC1JP6nmei8Ddu3DBRdgmI4jshDHbkByVpQ5+rY9P3339fk5OT46m9RVMNLGLQf2cxdCGff62M3I8m1EcY73nqVg4nhBYe/FK+EwJH+E4cpAozgxoQlhEQwGNctWqVUW2rV6+OGOx++96jbcm193bJBrx3lBQV3NRu8o+xgCrWvervsoddWD8pKamQ40Py9QEM00htNrzrnvxY3yeW/kUTIRlbO7kYa4OlxyMsZG87loQ8Yhdv9+7dJkIPYGk28mOrFStWGOMeux+wdx0foq9fvx7Z3QDGgmeK9D63y8j74D2QpI+unZHTAZdsgJzKxE33vfQzowEuluC3q57eyx/EWBn2DQQ3MdDa9bd/xrV8+fLIpx8beH4/HigoKHgbKi4u9s6ePeuVl5cbYOkOIxwB0M30Bj+0DRDhy4LE7KSfszJ9SbAMd0+5vxEjG6EB+SWMRq3eepycnGwMdq0mfX7aNWHbsrAhovvXrl2bpCKRB2DDSZjuKpd2AVa0qX9EMSszK3GOmEWCjopLgBMJE4GEyZajVh8OA9zJXBpUOL98+bJ37Ngxr6WlRbPbuIABrILPS+8KAtRD/3t6ekzsTBbLLKg+HLC0GrxLkzCmAaWTDSptm0QDGf92cMKvdy5duuQdPXpU6+sB7TAAWFCzOI8VTCiLOoinIeaGNqbyO8JZmXlg3a2srPyJANQqQHIBTIPLBlYQc8GTxM5SAdHevXvNr3NgSylGe2Z7owAG2AZHcSbshHJgOJQDoCSeNgumj2hjMbAMqHBBE/IAv0imiU6AjSUGvN9Pv1z2lAtc2AiILTg4r6mpMfGP48ePew0NDdJGU21t7SuXaysAt3e26l85z7LSx5cJ4YbTp0/PJVBN2G6wb9++PJrAzdif5fpBhTaK/f70I1qygPeMrqvq6upi0nmuPyWZlY8XJPWNY7mEVJX5GyNK8yiFg34J7fM3RYEgIyCN09H8jVF1dfXs3xj9CoD1PwEGAKorJqR4atjIAAAAAElFTkSuQmCC")=>{let s,r=0,n=0;const o=[],h=t=>{const i=new wt.Image;i.src=t,i.onload=()=>{o.forEach((t=>{var s;const o=new qn({source:i,fitMode:e.ImageFitMode.Stretch});null===(s=t.Gd)||void 0===s||s.Ie(o),r=i.width,n=i.height,u(t)}))}};h(i);const a=t.jn((t=>h(t)));let l;if(new wt.Image instanceof wt.HTMLImageElement){const t=new wt.Image;t.src=i,l=new qn({source:t,fitMode:e.ImageFitMode.Stretch})}else if(wt.lcjs_setup){const t=new wt.Image;t.src=i;const s=wt.lcjs_setup(t.naturalWidth,t.naturalHeight);s.getContext("2d").drawImage(t,0,0),l=new qn({source:s,fitMode:e.ImageFitMode.Stretch})}else l=new U({color:C("#f00")});const u=t=>{if(t.Gd){const e=t.At.pi({x:t.At.x.getInnerEnd(),y:t.At.y.getInnerStart()},{x:-(3+r),y:3}),i=t.At.pi({x:t.At.x.getInnerEnd(),y:t.At.y.getInnerStart()},{x:-3,y:3+n}),s={x:i.x-e.x,y:i.y-e.y};t.Gd.Be(e).it(s)}s&&s.xs()};return s=t.GF("logo",Number.MAX_SAFE_INTEGER),i=>{const r={At:i};return(i=>{i.Gd&&i.Gd.dispose(),s&&(i.Gd=s.Pe(i.At).Ie(l).setMouseInteractions(!0).Fe(nt).setMouseEnterEventHandler((()=>{t.Qr(e.MouseStyles.Point)})).setMouseLeaveEventHandler((()=>{t.Qr(e.MouseStyles.None)})).setMouseClickEventHandler(sg).setTouchEndEventHandler(sg),u(i))})(r),o.push(r),{Ls:()=>u(r),Y:()=>(e=>{e.Gd&&(e.Gd.dispose(),e.Gd=void 0);const i=o.indexOf(e);i>=0&&o.splice(i,1),o.length<=0&&t.Zn(a)})(r)}}},sg=()=>wt.open("https://lightningchart.com/lightningchart-js/");class rg{constructor(){this.IR=this.II.bind(this),wt.addEventListener("scroll",this.IR,{passive:!0})}Y(){this.IR&&wt.removeEventListener("scroll",this.IR),this.IR=void 0}}class ng{constructor(t,e){this._a=t,this.Z=e,this.PR=!0,this.DR=null,this.BR=null}}class og{constructor(t){this.LR=!1,this.RR=1,this.ER=t,this.zR={_a:u(0,0),Z:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),PR:!0,DR:null,BR:null},this.VR=u(64,64),this.OR=new Uint8ClampedArray(this.VR.x*this.VR.y*this.RR)}NR(t,e){if(!t.PR)return null;if(t.DR&&t.BR){const i=this.NR(t.DR,e);return null!==i?i:this.NR(t.BR,e)}const i=c(t.Z.x,t.Z.y);if(t._a.x+t.Z.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.VR.x-t._a.x-1),t._a.y+t.Z.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.VR.y-t._a.y-1),t.Z.x===e.x&&t.Z.y===e.y)return t.PR=!1,t;if(i.xt.Z.y)),h?(s=new ng(ui(t._a,{x:0,y:1}),u(t.Z.x,e.y)),r=new ng(ui(t._a,{x:0,y:e.y+1}),u(t.Z.x,t.Z.y-1-e.y))):(s=new ng(ui(t._a,{x:1,y:0}),u(e.x,t.Z.y)),r=new ng(ui(t._a,{x:e.x+1,y:0}),u(t.Z.x-1-e.x,t.Z.y))),t.DR=s,t.BR=r,this.NR(t.DR,e)}GR(t,e){const i={WR:!1,_a:null};let s=this.NR(this.zR,e);if(null===s)for(;null===s&&this.VR.xthis.ER||t.y>this.ER)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.RR);for(let i=0;i{this.ZR.qR(t)})),this.jR.clear(),this}tE(t,e){const i=this.XR.get(e);if(i)return i.get(t)}iE(t,e,i){let s=this.XR.get(e);if(s||(s=new Map,this.XR.set(e,s)),s.has(t.glyph))return ag.Success;const r=this.QR.GR(i,t.size);if(!r||!r._a)return ag.Fail;r.WR&&this.sE();const n=this.QR.HR(r.$R);if(!n)return ag.Fail;let o=this.jR.get(r.$R);if(!o){const t=this.ZR.gl.createTexture();if(!t)throw new xt("Failed to create texture for font!");o=t,this.jR.set(r.$R,t)}const h=r._a,a=n.VR.x,l=n.VR.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=h.x/a,y=(h.y+t.size.y)/l,m=(h.x+t.size.x)/a,p=h.y/l,x=[g,y,m,y,g,p,g,p,m,y,m,p],A=[u,c,d,c,u,f,u,f,d,c,d,f],S={origin:h,size:t.size,advanceX:t.advance,baseline:t.baseline,vertices:A,texCoords:x,packerId:r.$R,texture:o};s.set(t.glyph,S);const v=this.ZR.gl;return v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),v.bindTexture(v.TEXTURE_2D,o),v.texImage2D(v.TEXTURE_2D,0,v.LUMINANCE,n.VR.x,n.VR.y,0,v.LUMINANCE,v.UNSIGNED_BYTE,this.ZR.eE?n.OR:new Uint8Array(n.OR)),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),v.bindTexture(v.TEXTURE_2D,null),r.WR?ag.Resize:ag.Success}sE(){this.XR.forEach((t=>{t.forEach(((e,i)=>{const s=this.QR.HR(e.packerId);if(!s)return;const r=e.origin,n=s.VR.x,o=s.VR.y,h=r.x/n,a=(r.y+e.size.y)/o,l=(r.x+e.size.x)/n,u=r.y/o,c=[h,a,l,a,h,u,h,u,l,a,l,u];e.texCoords=c,t.set(i,e)}))}))}}const cg=t=>{if(t instanceof Bi||t instanceof Bc)return t._i()?"linear-highPrecision":"linear";if(t instanceof zi){const e={};return t.x instanceof Ci&&(e.x={base:t.x.gi()}),t.y instanceof Ci&&(e.y={base:t.y.gi()}),["logarithmic",e]}return"linear"},dg=t=>{const e=Object.keys(t),i={};return e.forEach((e=>{const s=t[e];let r=!1;i[e]=t=>{if(!t)return r;const e=s();return r=e,e}})),i},fg=(t,e,i)=>"value"===t.getLookUpProperty()?i:"x"===t.getLookUpProperty()?{min:e.vt(),max:e.St()}:"y"===t.getLookUpProperty()?{min:e.xt(),max:e.bt()}:"z"===t.getLookUpProperty()?{min:e.vv(),max:e.mv()}:void 0,gg=t=>!(!t||"value"!==t.lookUpProperty||!t.lut.percentageValues),yg=t=>(e,i)=>i%2?e:e+t;class mg{constructor(t){this.hE=new Map,this.rE=fe("font"),this.nE=new Map,this.oE=new Set,this.ZR=t}KR(t=!1){return(t||0===this.oE.size)&&(this.hE.forEach(((t,e)=>{t.KR(),this.hE.delete(e)})),this.oE.clear()),this}aE(t){this.oE.add(t)}lE(t){this.oE.delete(t)}uE(t,e,i,s){const r=wt.devicePixelRatio,n=`${s?"dark":"light"} - ${br(e,r).id}`,o=this.nE.get(n),h=this.hE.get(o);let a=0,l=0,u=0;const c=t.split(""),d=e.size,f=.45*e.size*r,g=Math.round(1*e.size);let y=!1;for(let t=0;t{if(0===i||360===i||180===i||i%180==0)return{x:t,y:e};if(90===i||-90===i||(i+90)%180==0)return{x:e,y:t};const s=i*Math.PI/180,r=Math.cos(s),n=Math.sin(s);return{x:Math.abs(t*r)+Math.abs(e*n),y:Math.abs(t*n)+Math.abs(e*r)}})(u/r,(l-a+1)/r,i);return{x:m.x,y:m.y,isEstimate:y}}cE(t,e,i){const s=`${i?"dark":"light"} - ${e.id}`;let r=this.nE.get(s);r||(r=this.rE(),this.hE.set(r,new ug(this.ZR)),this.nE.set(s,r));const n=this.hE.get(r);if(!n)throw new xt("Failed to get font texture!");let o=0,h=0,a=0;const l=t.split(""),c=new Map;let d=0;const f=e.properties.size;for(let t=0;t{t.ya.u=!0})),t=-1,d=0,h=0,o=0,c.clear(),this.ZR.ls.xs(!0);continue}if(l===ag.Fail)throw new xt("Failed to create glyph");if(a=n.tE(s,f),!a)throw new xt("Failed to get glyph after creation")}if(""!==s.trim()){let t=c.get(a.texture);t||(t={vertices:[],texCoords:[]},c.set(a.texture,t)),t.vertices.push(...a.vertices.map(yg(r))),t.texCoords.push(...a.texCoords),h=Math.max(h,a.baseline),o=Math.min(o,a.baseline-(a.size.y-1))}d+=a.advanceX}a=d;const g=y(u(0,o),u(a,h)),m=[];return c.forEach(((t,e)=>{m.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[m,g]}}class pg{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>xg(t)));for(const i of e)t=i(t);return`${Se(this.modifiers.filter((t=>Ag(t)))).map((t=>t.fE)).join("\n")}\n${t}`}}const xg=t=>"function"==typeof t,Ag=t=>t&&"object"==typeof t&&"AE"in t,Sg=(...t)=>e=>{t=t.reverse();for(let i of t)"string"==typeof i&&(i=i.includes("{")||i.endsWith(";")?i:`${i};`,i=i.trim(),e=e.replace("void main(void)",`${i}\nvoid main(void)`));return e},vg=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),bg=(...t)=>e=>{const i=t.filter((t=>t));for(let t=0;ti=>{for(let t=0;t{if(!n.includes(e))throw new Error(`ShaderBefore misusage (not found: \n${e}\nmatch: \n${t}\nresult: \n${n}\n)`)})),n},wg=(t,...e)=>i=>{const s=e.filter((t=>"string"==typeof t));for(let t=0;t{if(!l.includes(e))throw new Error(`ShaderAfter misusage (not found: "${e}", match: "${t}", result: "${l}")`)})),l},Cg=(...t)=>e=>{for(let i of t)if("string"==typeof i){i=i.endsWith(";")?i:`${i};`,i=i.trim(),i=i.startsWith("\t")?i:`\t${i}`;const t=e.lastIndexOf("}");e=`${e.substring(0,t-1)}\n${i}\n}`}return e},Tg=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Sg(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Sg(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return Cg(`\t${r} = ${s};`)(i)},Rg=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e},Eg={roundUnsigned:{AE:"roundUnsigned",fE:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{AE:"linearStep",fE:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{AE:"decodeUbyteRGBAEncodedFloat",fE:"\n // Denormalize 8-bit color channels to integers in the range 0 to 255.\n ivec4 floatsToBytes(vec4 inputFloats, bool littleEndian) {\n ivec4 bytes = ivec4(inputFloats * 255.0);\n return (\n littleEndian\n ? bytes.abgr\n : bytes\n );\n }\n \n // Break the four bytes down into an array of 32 bits.\n void bytesToBits(const in ivec4 bytes, out bool bits[32]) {\n for (int channelIndex = 0; channelIndex < 4; ++channelIndex) {\n float acc = float(bytes[channelIndex]);\n for (int indexInByte = 7; indexInByte >= 0; --indexInByte) {\n float powerOfTwo = exp2(float(indexInByte));\n bool bit = acc >= powerOfTwo;\n bits[channelIndex * 8 + (7 - indexInByte)] = bit;\n acc = mod(acc, powerOfTwo);\n }\n }\n }\n \n // Compute the exponent of the 32-bit float.\n float getExponent(bool bits[32]) {\n const int startIndex = 1;\n const int bitStringLength = 8;\n const int endBeforeIndex = startIndex + bitStringLength;\n float acc = 0.0;\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n \n // Compute the mantissa of the 32-bit float.\n float getMantissa(bool bits[32], bool subnormal) {\n const int startIndex = 9;\n const int bitStringLength = 23;\n const int endBeforeIndex = startIndex + bitStringLength;\n // Leading/implicit/hidden bit convention:\n // If the number is not subnormal (with exponent 0), we add a leading 1 digit.\n float acc = float(!subnormal) * exp2(float(bitStringLength));\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n \n // Parse the float from its 32 bits.\n float bitsToFloat(bool bits[32]) {\n float signBit = float(bits[0]) * -2.0 + 1.0;\n float exponent = getExponent(bits);\n bool subnormal = abs(exponent - 0.0) < 0.01;\n float mantissa = getMantissa(bits, subnormal);\n float exponentBias = 127.0;\n return signBit * mantissa * exp2(exponent - exponentBias - 23.0);\n }\n \n // Decode a 32-bit float from the RGBA color channels of a texel.\n float decodeUbyteRGBAEncodedFloat(vec4 rgba, bool littleEndian) {\n ivec4 rgbaBytes = floatsToBytes(rgba, littleEndian);\n bool bits[32];\n bytesToBits(rgbaBytes, bits);\n return bitsToFloat(bits);\n }\n "},texelFetchWithFallback:{webgl2:{AE:"texelFetchWithFallback",fE:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{AE:"texelFetchWithFallback",fE:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (vec2(iTexel) * 2.0 + 1.0) * halfTexel);\n}"}},texelFetchUnsignedWithFallback:{webgl2:{AE:"texelFetchUnsignedWithFallback",fE:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{AE:"texelFetchUnsignedWithFallback",fE:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (vec2(iTexel) * 2.0 + 1.0) * halfTexel);\n}"}},modulus:{AE:"modulus",fE:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{AE:"computeScreenSpaceWireframe",fE:"#extension GL_OES_standard_derivatives : enable\nfloat computeScreenSpaceWireframe (vec3 barycentric, float lineWidth) {\n vec3 dist = fwidth(barycentric);\n vec3 smoothed = smoothstep(dist * ((lineWidth * 0.5) - 0.5), dist * ((lineWidth * 0.5) + 0.5), barycentric);\n return 1.0 - min(min(smoothed.x, smoothed.y), smoothed.z);\n}"}},kg=(t,e)=>{const i=e.steps,s=i.length-1,r=[Sg("uniform vec4 uFallbackColor")],n=[],o=[];for(let t=0;t= uLUTValue${s}) {\n colorLookup = uLUTColor${s};\n }`,...i.slice(0,-1).map(((t,e)=>`if (value >= uLUTValue${e} && value <= uLUTValue${e+1}) {\ncolorLookup = uLUTColor${e} + vec4(uLUTColor${e+1}.r - uLUTColor${e}.r, uLUTColor${e+1}.g - uLUTColor${e}.g, uLUTColor${e+1}.b - uLUTColor${e}.b, uLUTColor${e+1}.a - uLUTColor${e}.a) * (value - uLUTValue${e})/(uLUTValue${e+1} - uLUTValue${e});} `)),"colorFragment = colorLookup")):r.push(wg("colorFragment =","vec4 colorLookup = vec4(uLUTValue0)","float value = "+(e.percentageValues?`clamp((${t} - uMinValue) / (uMaxValue - uMinValue), 0.0, 1.0);`:`${t}`),`if (${t} <= -340282346638528859811704183484516925440.0) {\n colorLookup = uFallbackColor;\n } else if (${t} < uLUTValue0) { colorLookup = uLUTColor0;} ${i.slice().reverse().map((t=>{const e=i.indexOf(t);return`else if (value >= uLUTValue${e}) { colorLookup = uLUTColor${e};} `})).join("")}`,"colorFragment = colorLookup")),r},Ig=[Sg("uniform sampler2D uMaskTexture"),Sg("varying vec2 vMaskTextureCoord"),wg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],Fg=[Sg("uniform sampler2D uMaskTexture"),Sg("varying vec2 vMaskTextureCoord"),wg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.a")],Dg=[Sg("varying vec3 vPosWorld;","varying vec3 vNormal;","uniform vec3 uCameraLoc;","uniform vec3 uLightLoc;","uniform vec4 uLightColor;","uniform vec4 uAmbientColor;","uniform float uShininess;","uniform float uAmbientReflection;","uniform float uDiffuseReflection;","uniform float uSpecularReflection;"),wg("colorFragment =","float ambientReflection = uAmbientReflection","float diffuseReflection = uDiffuseReflection","float specularReflection = uSpecularReflection","vec3 ambientColor = uAmbientColor.rgb","vec3 diffuseColor = colorFragment.rgb","vec3 specularColor = uLightColor.rgb","vec3 vNormalNormalized = normalize(vNormal)","vNormalNormalized = (float(gl_FrontFacing) * 2.0 - 1.0) * vNormalNormalized","vec3 lightDir = normalize( uLightLoc - vPosWorld )","float lambertian = abs(dot(vNormalNormalized, lightDir))","float specular = 0.0","vec3 R = reflect(-lightDir, vNormalNormalized)","vec3 V = normalize(uCameraLoc - vPosWorld)","float specAngle = max(dot(R,V),0.0)","specular = pow(specAngle, uShininess)","colorFragment = vec4(ambientReflection * ambientColor + diffuseReflection * lambertian * diffuseColor + specularReflection * specular * specularColor, colorFragment.a)")];class Pg extends Error{constructor(t,e,i){super(`Dynamic shader generation error\n(id: ${e})\n ${i?`when applying feature: ${i.idVertex?`vert: ${i.idVertex}`:""} ${i.idFragment?`frag: ${i.idFragment}`:""}`:""} | ${t}`)}}const Lg=(...t)=>{let e="";for(const i of t){if("object"!=typeof i){e+=`${String(i)},`;continue}const t=[{prefix:"",obj:i}];for(;t.length>0;){const{prefix:i,obj:s}=t.shift();e+=`${i}:`;const r=Object.keys(s).sort();for(const i of r){const r=s[i];"object"==typeof r&&r.__proto__===Object.prototype||Array.isArray(r)?t.push({prefix:i,obj:r}):e+=`${i}=${String(r)},`}}}return e},Vg=t=>void 0!==t.find((t=>{var e;return null===(e=t.gE)||void 0===e?void 0:e.pE})),_g=t=>void 0!==t.find((t=>{var e;return null===(e=t.gE)||void 0===e?void 0:e.yE})),Bg=(t,e,...i)=>{const s=[],r=e?"vec3":"vec2",{axisWorldTranslation:n,scaling:o,translation:h,offset:a,flipXY:l,flipXZ:u,splitPosAttribute:c,normalSource:d}=t,f=[];if("attribute"===d&&s.push(Sg("attribute vec3 aNormal"),bg("vec3 normal = aNormal")),"linear-highPrecision"!==n?i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&void 0!==t.variableNameAxisCoord&&(!0!==c?s.push(bg(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(bg(`${r} ${t.variableNameAxisCoord} = ${e?`vec3(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y, ${t.attributeNameAxisCoord}Z)`:`vec2(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y)`}`)))})):i.forEach((e=>{!0!==t.splitPosAttribute?s.push(bg(`${r} ${e.variableNameAxisCoord}_highpart = ${e.attributeNameAxisCoord}_highpart`),bg(`${r} ${e.variableNameAxisCoord}_lowpart = ${e.attributeNameAxisCoord}_lowpart`)):s.push(bg(`${r} ${e.variableNameAxisCoord}_highpart = vec2(${e.attributeNameAxisCoord}_highpartX, ${e.attributeNameAxisCoord}_highpartY)`),bg(`${r} ${e.variableNameAxisCoord}_lowpart = vec2(${e.attributeNameAxisCoord}_lowpartX, ${e.attributeNameAxisCoord}_lowpartY)`))})),a&&a.rotation){const t=a.rotation.dataType,e="uniform"===t?"u":"a";if("attribute-deg"===t){s.push(Sg("attribute float aRotDeg"),Sg("uniform float uBaseRotDeg"));const t="cRot",e="aInstanceGeo";s.push(bg(`vec2 ${t} = vec2(sin((aRotDeg + uBaseRotDeg) * 0.01745329252), cos((aRotDeg + uBaseRotDeg) * 0.01745329252))`,`vec2 rotatedGeo = vec2(${e}.x * ${t}.y + ${e}.y * ${t}.x, ${e}.y * ${t}.y - ${e}.x * ${t}.x)`))}else{const i=`${e}Rot`;s.push(Sg(`${t} vec2 ${i}`));const r="aInstanceGeo";s.push(bg(`vec2 rotatedGeo = vec2(${r}.x * ${i}.y + ${r}.y * ${i}.x, ${r}.y * ${i}.y - ${r}.x * ${i}.x)`))}}if(a&&s.push(Sg(`attribute ${r} aInstanceGeo`)),!0===l){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + flipXY");i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${e?`vec3(${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x, ${t.variableNameAxisCoord}.z)`:`vec2(${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x)`}`)}))}if(!0===u){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + flipXZ");i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = vec3(${t.variableNameAxisCoord}.z, ${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x)`)}))}if(o){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + scaling");const t=("attribute"===o.dataType?"a":"u")+"Scaling",r=e?"vec3":"vec2";s.push(Sg(`${o.dataType} ${r} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} * ${t}`)}))}if(h&&"axis"===h.sizeUnit){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + translation (axis)");const t=("attribute"===h.dataType?"a":"u")+"TranslationAxis",r=e?"vec3":"vec2";s.push(Sg(`${h.dataType} ${r} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} + ${t}`)}))}if(a&&"axis"===a.sizeUnit){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + offset (axis)");const t=("attribute"===a.dataType?"a":"u")+"OffsetAxis",o=!0===a.symmetric?"float":r;s.push(Sg(`${a.dataType} ${o} ${t}`));const h=a.halved?" * 0.5":"",l=a.rotation?"rotatedGeo":"aInstanceGeo",u="offsetGeometry";f.push(`${r} ${u} = ${t} * ${l}${h} * sign(uScale)`),e&&"gpu-calculate"===d&&f.push(`${r} normal = ${l}`),i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${t.variableNameAxisCoord} + ${u}`)}))}if(void 0===n||"linear"===n)s.push(Sg(`uniform ${r} uDisp`,`uniform ${r} uScale`)),i.forEach((t=>{f.push(`${r} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord} - uDisp) / uScale`)}));else if("linear-highPrecision"===n)s.push(Sg(`uniform ${r} uDisp`,`uniform ${r} uScale`,`uniform ${r} uScaleStart_highpart`,`uniform ${r} uScaleStart_lowpart`)),i.forEach((t=>{f.push(`${r} ${t.variableNameAxisCoord}_hprecision = (${t.variableNameAxisCoord}_highpart - uScaleStart_highpart) + (${t.variableNameAxisCoord}_lowpart - uScaleStart_lowpart)`,`${r} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord}_hprecision - uDisp) / uScale`,`${r} ${t.variableNameAxisCoord} = ${t.variableNameAxisCoord}_highpart + ${t.variableNameAxisCoord}_lowpart`)}));else if("matrix"===n)s.push(Sg("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("matrix4"===n)s.push(Sg("uniform mat4 uMatrix")),i.forEach((t=>{f.push(`vec4 ${t.variableNameWorldCoord} = uMatrix * ${t.attributeNameAxisCoord}`)}));else if("logarithmic"===n[0]){s.push(Sg(`uniform ${r} uScaleStart`,`uniform ${r} uScaleStartLog`,`uniform ${r} uScaleInterval`,`uniform ${r} uScaleIntervalLog`,`uniform ${r} uViewportStart`,`uniform ${r} uViewportSize`));const t=e?["x","y","z"]:["x","y"],o=[];t.forEach((t=>{const e=n[1][t];if(void 0!==e){const t=e.base;if("e"===t)return;const i=`float cLog${t} = 1.0 / log(${Ri(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(Sg(...o)),i.forEach(((e,i)=>{const s=`${i}`,o=[];t.forEach((t=>{const i=t.toUpperCase(),r=n[1][t];if(void 0===r)f.push(`float posPercent${i}${s} = (${e.variableNameAxisCoord}.${t} - uScaleStart.${t}) / uScaleInterval.${t}`);else{const n=r.base,o="e"===n;f.push(`float posLog${i}${s} = log(${e.variableNameAxisCoord}.${t})${o?"":` * cLog${n}`}`,`float posPercent${i}${s} = (posLog${i}${s} - uScaleStartLog.${t}) / uScaleIntervalLog.${t}`)}o.push(`posPercent${i}${s}`)})),f.push(`${r} ${e.variableNameWorldCoord} = uViewportStart + ${r}(${o.join(", ")}) * uViewportSize`)}))}if(a&&"px"===a.sizeUnit){s.push(Sg("uniform vec2 uRatioPxClip"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Sg("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("attribute"===a.dataType?"a":"u")+"OffsetPixels",n=!0===a.symmetric?"float":r;s.push(Sg(`${a.dataType} ${n} ${e}`));const o=a.halved?" * 0.5":"",h=`(${a.rotation?"rotatedGeo":"aInstanceGeo"} + ${t}) * ${e}${o} * uRatioPxClip`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${h}`)}))}if(a&&"scale"===a.sizeUnit){s.push(Sg("uniform vec2 uRatioPxClip")),s.push(Sg("uniform vec2 uSizePixels"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Sg("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("uniform"===a.dataType?"u":"a")+"OffsetScale";s.push(Sg(`${a.dataType} float ${e}`));const r=`(${a.rotation?"rotatedGeo":"aInstanceGeo"} + ${t}) * ${e} * uSizePixels * uRatioPxClip`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${r}`)}))}if(a&&"wu"===a.sizeUnit){const t=("attribute"===a.dataType?"a":"u")+"OffsetWU",n=!0===a.symmetric?"float":r;s.push(Sg(`${a.dataType} ${n} ${t}`));const o=a.halved?" * 0.5":"",h=a.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${r} ${l} = ${t} * ${h}${o}`),e&&"gpu-calculate"===d&&f.push(`${r} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l}`)}))}if(a&&"nwu"===a.sizeUnit){s.push(Sg("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(Sg(`${a.dataType} ${n} ${t}`));const o=a.halved?" * 0.5":"",h=a.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${r} ${l} = ${t} * ${h}${o}`),e&&"gpu-calculate"===d&&f.push(`${r} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l} * uRatioNwuWu`)}))}return t.snapToNearestPixel&&(s.push(Sg("uniform vec2 uViewportSizePx")),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = 2.0 * floor(((${t.variableNameWorldCoord} + 1.0) * 0.5) * uViewportSizePx + 0.5) / uViewportSizePx - 1.0`)}))),s.push(Mg("gl_Position =",...f)),s},zg=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(wg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(wg(i,`${o} ${s} = ${i} * uScale + uDisp + uScaleStart_highpart + uScaleStart_lowpart`));else{if("matrix"===n)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("matrix4"===n)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("logarithmic"!==n[0])throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");{const t=[`${o} ${i}_percent = (${i} - uViewportStart) / uViewportSize`];(e?["x","y","z"]:["x","y"]).forEach((e=>{const s=e.toUpperCase(),r=n[1][e];if(void 0===r)t.push(`float pos${s}Back = ${i}_percent.${e} * uScaleInterval.${e} + uScaleStart.${e}`);else{const n=r.base,o="e"===n?"1.0":`cLog${n}`;t.push(`float pos${s}Back = pow(2.71828, (${i}_percent.${e} * uScaleIntervalLog.${e} + uScaleStartLog.${e}) / ${o})`)}})),t.push(`${o} ${s} = ${o}(posXBack, posYBack${e?", posZBack":""})`),r.push(wg(i,...t))}}return r},Ng=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.gE)||void 0===e?void 0:e.mE})))(t)?[vg("attribute vec4 aColor"),vg("vColor = aColor"),Sg("attribute vec4 aColorA"),Sg("attribute vec4 aColorB"),Cg("vColor = mix(aColorA, aColorB, aSegmentSide)")]:[],Og=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.gE)||void 0===e?void 0:e.vE})))(t)?[vg("attribute float aLookupValue"),vg("vLookupValue = aLookupValue"),Sg("attribute float aLookupValueA"),Sg("attribute float aLookupValueB"),Cg("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],Ug={"2D":{idFeature:"2D",apply:t=>({idVertex:"2D",idFragment:"2D",defaultVertexShader:"2D",defaultFragmentShader:"FragmentShader"})},"2DCompose":{idFeature:"2DCompose",apply:t=>({idVertex:"2DCompose",idFragment:"2DCompose",defaultVertexShader:"2DMatrix",defaultFragmentShader:"Empty"})},"3D":{idFeature:"3D",gE:{pE:!0},apply:t=>({idVertex:"3D",idFragment:"3D",defaultVertexShader:"3D",defaultFragmentShader:"FragmentShader"})},PointSize:t=>({idFeature:"PointSize",apply:e=>{const i="uniform"===t?"u":"a";return{idVertex:`SizePrimitive:${Lg(t)}`,idFragment:void 0,vertexShaderModifiers:[Sg(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Cg(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTextureText,r=t&&t.maskTexture,n=t&&t.overrideOpacity;return{idFeature:"Color",gE:{yE:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,vE:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0,mE:"attribute"===t.dataType||void 0},apply:(o,h)=>{let a,l=`Color:${Lg(t)}`;const u=[];let c="FragmentShader";const d=[];if("uniform"===i)d.push(Sg("uniform vec4 uColor"),wg("colorFragment =","colorFragment = uColor"),...s?Ig:[],...r?Fg:[]);else if("attribute"===i)a="colorAttribute",u.push(Tg("attribute vec4 aColor","varying vec4 vColor")),d.push(Sg("varying vec4 vColor"),wg("colorFragment =","colorFragment = vColor"),...s?Ig:[],...r?Fg:[]);else if("texture"===i)a="colorTexCoord",u.push(Tg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),d.push(Sg("varying vec2 vTextureCoord"),Sg("uniform sampler2D uColorTexture"),Sg("uniform vec4 uColor"),wg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord)","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.) {\n colorFragment = uColor;\n }"),...s?Ig:[],...r?Fg:[]);else if("texture-coord-calc-gpu"===i)a="colorTexCoord",c="Empty",u.push(Sg("attribute vec2 aTextureCoord"),Sg("varying vec2 vTextureCoord"),Cg("vTextureCoord = gl_Position.xy * 0.5 + 0.5")),d.push(Sg("varying vec2 vTextureCoord"),Sg("uniform sampler2D uColorTexture"),bg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","gl_FragColor = colorFragment;"));else if(Array.isArray(i)&&"image"===i[0])a="colorTexCoord",u.push(Tg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1].fitMode===e.ImageFitMode.Tile?d.push(Sg("uniform sampler2D uColorTexture"),Sg("varying vec2 vTextureCoord"),wg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord);")):d.push(Sg("uniform sampler2D uColorTexture"),Sg("varying vec2 vTextureCoord"),Sg("uniform vec4 uColor"),wg("colorFragment =","colorFragment = texture2D(uColorTexture, vTextureCoord);","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.){\n colorFragment = uColor;\n }"));else if(Array.isArray(i)&&"lookup"===i[0]){const t=i[1];if("value"===t)a="lookup:value",u.push(Tg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;a=`lookup:${t}`,u.push(Tg(e,"varying float vLookupValue"))}d.push(Sg("varying float vLookupValue"),...kg("vLookupValue",i[2]),...s?Ig:[],...r?Fg:[])}else if(Array.isArray(i)&&"gradient"===i[0]){const t=i[1],e=t.getColorStops();tt(t)?(l=`rgradient${e.length},${r},${s}`,d.push(Sg("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Sg(...Dt(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Eg.linearStep,wg("colorFragment =","vec2 uv = vec2((((gl_FragCoord.x)-uBounds.x)/(uBounds.z))*uAspect,((gl_FragCoord.y)-uBounds.y)/(uBounds.w))","float mixVal = distance(uv/uDistance, uCenter/uDistance)","vec4 color = mix(color_0, color_1, linearStep(stop_0, stop_1, mixVal))",...e.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, mixVal));`)),"colorFragment = color"),...s?Ig:[],...r?Fg:[])):st(t)&&(l=`lgradient${e.length},${r},${s}`,d.push(Sg("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Sg(...Dt(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Eg.linearStep,wg("colorFragment =","vec2 uv = gl_FragCoord.xy - uBounds.xy","float magnitude = ((uv.x-uStartPoint.x) * (uEndPoint.x-uStartPoint.x) + (uv.y-uStartPoint.y) * (uEndPoint.y-uStartPoint.y)) / (pow(uEndPoint.x - uStartPoint.x, 2.0) + pow(uEndPoint.y-uStartPoint.y,2.0))","vec4 color = mix(color_0, color_1, linearStep(stop_0, stop_1, magnitude))",...e.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, magnitude))`)),"colorFragment = color"),...s?Ig:[],...r?Fg:[]))}if(s||r){const t="maskTexture";a=a?`${a} ${t}`:`Color:${t}`,u.push(Tg("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return n&&d.push(Sg("uniform float uOpacity"),wg("colorFragment =","colorFragment.a *= uOpacity")),{vertexShaderModifiers:u,fragmentShader:c,fragmentShaderModifiers:d,idVertex:a,idFragment:l}}}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let r;const n=`ColorShaded3D:${Lg(t)}`;return{idFeature:"ColorShaded3D",gE:{yE:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,vE:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const h=[],a=[];if(h.push("phong"===i&&Tg("normal","varying vec3 vNormal"),Tg("posWorld","varying vec3 vPosWorld")),"uniform"===e)a.push(Sg("uniform vec4 uColorDiffuse"),wg("colorFragment =","colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",h.push(Tg("attribute vec4 aColor","varying vec4 vColor")),a.push(Sg("varying vec4 vColor"),wg("colorFragment =","colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",h.push(Tg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,h.push(Tg(e,"varying float vLookupValue"))}a.push(Sg("varying float vLookupValue"),...kg("vLookupValue",e[2]))}if(s){const t="wireframe";r=r?`${r},${t}`:t,h.push(Tg("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),a.push(Sg("varying vec3 vTriangleBary"),Sg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Eg.computeScreenSpaceWireframe,wg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&a.push(...Dg),{idVertex:r,idFragment:n,vertexShaderModifiers:h,fragmentShader:"FragmentShader",fragmentShaderModifiers:a}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=[],s=Vg(e),r=t.coordType?t.coordType:s?"vec3":"vec2";return"linear-highPrecision"!==t.axisWorldTranslation?!0!==t.splitPosAttribute?i.push(Sg(`attribute ${r} aPos`)):i.push(Sg("attribute float aPosX"),Sg("attribute float aPosY"),s&&Sg("attribute float aPosZ")):!0===t.splitPosAttribute?i.push(Sg("attribute float aPos_highpartX"),Sg("attribute float aPos_lowpartX"),Sg("attribute float aPos_highpartY"),Sg("attribute float aPos_lowpartY")):i.push(Sg(`attribute ${r} aPos_highpart`),Sg(`attribute ${r} aPos_lowpart`)),i.push(...Bg(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"vec4"===t.coordType?void 0:"posAxis",variableNameWorldCoord:"posWorld"})),{idVertex:`VertexLocation:${Lg(t)}`,idFragment:void 0,vertexShaderModifiers:i}}}),Model3D:t=>({idFeature:"Model3D",apply:e=>{const i=[];return i.push(Sg("attribute vec3 aGeoPos"),Sg("uniform mat4 uModelRotation"),Sg("uniform mat4 uModelRotationNormals"),Sg("uniform vec3 uLocationAxis"),Sg("uniform vec3 uModelAlignment"),Sg("uniform vec3 uModelScale"),Sg("uniform vec3 uModelSize"),...Bg({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,{attributeNameAxisCoord:"uLocationAxis",variableNameAxisCoord:"locationAxis",variableNameWorldCoord:"locationWorld"}),Mg("gl_Position =","vec3 posWorld = locationWorld + ((uModelRotation * vec4(aGeoPos, 1.0)).xyz - (uModelAlignment + 1.0) * uModelSize/2.0) * uModelScale;"),"attribute"===t.normalSource&&wg("vec3 normal ="," normal = (uModelRotationNormals * vec4(normal, 1.0)).xyz;"),..._g(e)?zg({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,"posWorld","posAxis"):[]),{vertexShaderModifiers:i,idVertex:`Model3D:${Lg(t)}`,idFragment:void 0}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",apply:e=>({idVertex:`LineInstanced2D:${Lg(t)}`,idFragment:void 0,vertexShaderModifiers:[Sg("uniform float uThicknessPixels"),Sg("uniform vec2 uRatioPxClip"),..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Sg("attribute vec2 aLocationA"),Sg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Sg("attribute vec2 aLocationA_highpart"),Sg("attribute vec2 aLocationB_highpart"),Sg("attribute vec2 aLocationA_lowpart"),Sg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Sg("attribute float aLocationAX"),Sg("attribute float aLocationAY"),Sg("attribute float aLocationBX"),Sg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Sg("attribute float aLocationA_highpartX"),Sg("attribute float aLocationA_highpartY"),Sg("attribute float aLocationB_highpartX"),Sg("attribute float aLocationB_highpartY"),Sg("attribute float aLocationA_lowpartX"),Sg("attribute float aLocationA_lowpartY"),Sg("attribute float aLocationB_lowpartX"),Sg("attribute float aLocationB_lowpartY")]:[],Sg("attribute vec2 aSegmentPosition"),Sg("attribute float aSegmentSide"),...Bg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),t.ensureMinimumSegmentLength&&Sg("uniform vec2 uMinSegmentPixelVector"),wg("worldB = ",t.ensureMinimumSegmentLength&&"float segmentLengthPixels = sqrt(pow(worldB.x - worldA.x, 2.0) + pow(worldB.y - worldA.y, 2.0)) / length(uRatioPxClip)",t.ensureMinimumSegmentLength&&"if (segmentLengthPixels == 0.0 || segmentLengthPixels < length(uMinSegmentPixelVector)) {\n worldB = worldA + uMinSegmentPixelVector * uRatioPxClip;\n }","vec2 directionBasis = worldB - worldA","vec2 directionBasisNorm = normalize(directionBasis)","vec2 perpendBasisNorm = vec2(-directionBasisNorm.y, directionBasisNorm.x)","vec2 offset = mix(worldA, worldB, aSegmentSide)","vec2 thicknessDirection = aSegmentPosition.x * directionBasisNorm + aSegmentPosition.y * perpendBasisNorm","vec2 posWorld = offset + thicknessDirection * uThicknessPixels * uRatioPxClip"),...Og(e),...Ng(e),..._g(e)?zg(t,!1,"posWorld","posAxis"):[]]})}),Area2D:t=>({idFeature:"Area2D",apply:e=>({idVertex:`Area2D:${Lg(t)}`,idFragment:void 0,vertexShaderModifiers:[..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Sg("attribute vec2 aLocationA"),Sg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Sg("attribute vec2 aLocationA_highpart"),Sg("attribute vec2 aLocationB_highpart"),Sg("attribute vec2 aLocationA_lowpart"),Sg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Sg("attribute float aLocationAX"),Sg("attribute float aLocationAY"),Sg("attribute float aLocationBX"),Sg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Sg("attribute float aLocationA_highpartX"),Sg("attribute float aLocationA_highpartY"),Sg("attribute float aLocationB_highpartX"),Sg("attribute float aLocationB_highpartY"),Sg("attribute float aLocationA_lowpartX"),Sg("attribute float aLocationA_lowpartY"),Sg("attribute float aLocationB_lowpartX"),Sg("attribute float aLocationB_lowpartY")]:[],Sg("attribute float aCurveOrBaseline"),Sg("attribute float aSegmentSide"),...Bg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),wg("worldB = ","vec2 posCoord = mix(worldA, worldB, aSegmentSide)","float baseline = min(posCoord.y, -1.0)","vec2 posWorld = vec2(posCoord.x, mix(posCoord.y, baseline, aCurveOrBaseline))"),...Og(e),...Ng(e),..._g(e)?zg(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${Lg(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Sg("uniform float uOffsetWU"),Sg("attribute vec3 aLocationA"),Sg("attribute vec3 aLocationB"),Sg("attribute float aSegmentPosition"),Sg("attribute float aPerpendHorizontal"),Sg("attribute float aPerpendVertical"),...Bg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Vg(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),wg("worldB = ","vec3 directionBasis = worldB - worldA","vec3 directionBasisNorm = normalize(directionBasis)","vec3 notParallel = normalize(mix( vec3( 0.0, 1.0, 0.0 ), vec3( 0.2, 0.8, 0.0 ), step( abs(directionBasis.y), 0.9 ) ))","vec3 horizontalBasis = normalize( cross( notParallel, directionBasisNorm ) )","vec3 verticalBasis = normalize( cross( horizontalBasis, directionBasisNorm ) )","vec3 normal = aPerpendHorizontal * horizontalBasis + aPerpendVertical * verticalBasis","vec3 posWorld = worldA + aSegmentPosition * directionBasis + normal * uOffsetWU * 0.5"),..._g(e)?zg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[Sg("attribute vec3 aEdge"),Sg("uniform float uEdgeRoundness"),wg("posWorld =","vec3 boxSizeWorld = abs( aOffsetAxis / uScale )","float boxMinDimensionWorldXZ = min( boxSizeWorld.x, boxSizeWorld.z )","vec3 edgeRoundAmount = uEdgeRoundness * vec3( boxMinDimensionWorldXZ, min( boxMinDimensionWorldXZ, boxSizeWorld.y ), boxMinDimensionWorldXZ )","posWorld = posWorld + aEdge * edgeRoundAmount")]})},ColorGrid2D:t=>{const e=t.flipXY,i=t.intensityTextureType,s=t.littleEndian;return{idFeature:"ColorGrid2D",apply:(r,n)=>({idVertex:void 0,idFragment:`ColorGrid2D:${Lg(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[Sg("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&Eg.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?bg("vec2 cellSizePx = uTileBounds.zw / (uTileDimensions - 1.0)","vec2 cellIndex = (gl_FragCoord.xy - uTileBounds.xy) / cellSizePx","vec2 cellStart = floor(cellIndex)","vec2 cellEnd = ceil(cellIndex)","vec2 cellStartNormalized = cellStart / (uTileDimensions - 1.0)","vec2 cellEndNormalized = cellEnd / (uTileDimensions - 1.0)",`vec4 sample00 = texture2D(uTileIntensityValues, ${e?"cellStartNormalized":"vec2(cellStartNormalized.y, cellStartNormalized.x)"})`,`vec4 sample01 = texture2D(uTileIntensityValues, ${e?"vec2(cellStartNormalized.x, cellEndNormalized.y)":"vec2(cellStartNormalized.y, cellEndNormalized.x)"})`,`vec4 sample10 = texture2D(uTileIntensityValues, ${e?"vec2(cellEndNormalized.x, cellStartNormalized.y)":"vec2(cellEndNormalized.y, cellStartNormalized.x)"})`,`vec4 sample11 = texture2D(uTileIntensityValues, ${e?"cellEndNormalized":"vec2(cellEndNormalized.y, cellEndNormalized.x)"})`,"float intensity00 = "+("float"===i?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${s})`),"float intensity01 = "+("float"===i?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${s})`),"float intensity10 = "+("float"===i?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${s})`),"float intensity11 = "+("float"===i?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${s})`),"vec2 lerpFactors = cellIndex - cellStart",`float intensityR1 = mix(intensity00, intensity10, ${e?"lerpFactors.x":"lerpFactors.y"})`,`float intensityR2 = mix(intensity01, intensity11, ${e?"lerpFactors.x":"lerpFactors.y"})`,`float intensityP = mix(intensityR1, intensityR2, ${e?"lerpFactors.y":"lerpFactors.x"})`):bg("vec2 cellSizePx = uTileBounds.zw / (uTileDimensions)","vec2 cellIndex = (gl_FragCoord.xy - uTileBounds.xy) / cellSizePx","vec2 cellIndexNormalized = cellIndex / uTileDimensions",`vec4 sample0 = texture2D(uTileIntensityValues, ${e?"cellIndexNormalized":"vec2(cellIndexNormalized.y, cellIndexNormalized.x)"})`,"float intensityP = "+("float"===i?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${s})`)),...kg("intensityP",t.lut)]})}},DrawToNormalTexture:t=>{const e=t.flipXZ,i=t.vertexIdSource,s=t.normalTextureType,r=t.heightmapTextureType,n=t.littleEndian;return{idFeature:"DrawToNormalTexture",apply:(o,h)=>{const a=[],l=[];return a.push(Sg("uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB","attribute"===i&&"attribute float aVertexID"),void 0!==i&&Eg.roundUnsigned,Eg.modulus,Eg.texelFetchWithFallback[h],"ubyte"===r&&Eg.decodeUbyteRGBAEncodedFloat,bg(void 0===i?"int iVertex = gl_VertexID":"int iVertex = int(roundUnsigned(aVertexID))","int iSecondary = modulus(iVertex, (uTileDimensions.y - 1))","int iPrimary = iVertex / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 uTileDimensionsMinus1 = vec2(uTileDimensions) - 1.0","vec2 halfTexelWorld = 2.0 / (uTileDimensionsMinus1 * 2.0)","vec2 posWorld = vec2(-1.0 + halfTexelWorld.y + iCell.y * 2.0 * halfTexelWorld.y, -1.0 + halfTexelWorld.x + iCell.x * 2.0 * halfTexelWorld.x)","vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)",`vec3 posAxis0 = vec3(\n uTileStartLocationAxisXZ.x + iCell.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`} ,\n uTileStartLocationAxisXZ.y + iCell.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell1 = iCell + vec2(1.0, 0.0)",`vec3 posAxis1 = vec3(\n uTileStartLocationAxisXZ.x + iCell1.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`},\n uTileStartLocationAxisXZ.y + iCell1.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell2 = iCell + vec2(0.0, 1.0)",`vec3 posAxis2 = vec3(\n uTileStartLocationAxisXZ.x + iCell2.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`},\n uTileStartLocationAxisXZ.y + iCell2.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell3 = iCell + vec2(1.0, 1.0)",`vec3 posAxis3 = vec3(\n uTileStartLocationAxisXZ.x + iCell3.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===r?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${n})`},\n uTileStartLocationAxisXZ.y + iCell3.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec3 normal = normalize(cross(posAxis2 - posAxis0, posAxis1 - posAxis0) + cross(posAxis1 - posAxis3, posAxis2 - posAxis3))","uint"===s?"vNormalRGB = uvec3(((normal / 2.0) + 0.5) * float(-1u))":"vNormalRGB = (normal / 2.0) + 0.5","gl_PointSize = 1.0")),l.push(Sg("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),bg("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${Lg(t)}`,idFragment:`DrawToNormalTexture:${Lg(t)}`,vertexShaderModifiers:a,fragmentShaderModifiers:l,fragmentShader:"Empty",hints:["uint"===s&&{type:"fragOutput",fragOutput:"uvec4"}]}}}},SurfaceGrid:t=>{const e=t.fillColor,i=t.interpolation,s=t.flipXZ,r=t.shadingStyle,n=t.wireframe,o=t.normalTextureType,h=t.heightmapTextureType,a=t.intensityTextureType,l=t.littleEndian;return{idFeature:"SurfaceGrid",gE:{SE:!0},apply:(u,c)=>{const d=[],f=[];return d.push(Sg("attribute vec2 aGeoCellOffset","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture"),Eg.modulus,Eg.texelFetchWithFallback[c],"ubyte"===h&&Eg.decodeUbyteRGBAEncodedFloat,bg("int iSecondary = modulus(iInstance + uBaseInstance, (uTileDimensions.y - 1))","int iPrimary = (iInstance + uBaseInstance) / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 iCellVertex = iCell + aGeoCellOffset","vec2 uTileDimensionsMinus1 = vec2(float(uTileDimensions.x), float(uTileDimensions.y)) - 1.0","vec2 ySampleCoordinate = vec2(iCellVertex.y, iCellVertex.x) / vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x)","float y = "+("float"===h?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${l})`),"vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)","vec2 posAxisXZ = uTileStartLocationAxisXZ + cellSizeAxis * "+(s?"vec2(iCellVertex.y, iCellVertex.x)":"iCellVertex"),"vec3 posAxis = vec3(posAxisXZ.x, y, posAxisXZ.y)")),d.push(...Bg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&d.push(Tg("posWorld","varying vec3 vPosWorld"),..."uint"===o?[Eg.texelFetchUnsignedWithFallback[c],Cg("vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Cg("vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Cg("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),Sg("varying vec3 vNormal",..."uint"===o?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),f.push(Sg("varying vec3 vTriangleBary")),"uniform"===e?f.push(Sg("uniform vec4 uColorDiffuse"),wg("colorFragment =","colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]&&("value"===e[1]?(d.push(Tg("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),f.push(Sg("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===a&&Eg.decodeUbyteRGBAEncodedFloat,"bilinear"===i?bg("vec2 cellSizeAxisXZ = uTileBoundsAxisXZ.zw / (uTileDimensionsXZ - 1.0)","vec2 cellIndex = (vVertexLocationAxisXZ - uTileBoundsAxisXZ.xy) / cellSizeAxisXZ","vec2 cellStart = floor(cellIndex)","vec2 cellEnd = ceil(cellIndex)","vec2 cellStartNormalized = cellStart / (uTileDimensionsXZ - 1.0)","vec2 cellEndNormalized = cellEnd / (uTileDimensionsXZ - 1.0)",`vec4 sample00 = texture2D(uTileIntensityValues, ${s?"cellStartNormalized":"vec2(cellStartNormalized.y, cellStartNormalized.x)"})`,`vec4 sample01 = texture2D(uTileIntensityValues, ${s?"vec2(cellStartNormalized.x, cellEndNormalized.y)":"vec2(cellStartNormalized.y, cellEndNormalized.x)"})`,`vec4 sample10 = texture2D(uTileIntensityValues, ${s?"vec2(cellEndNormalized.x, cellStartNormalized.y)":"vec2(cellEndNormalized.y, cellStartNormalized.x)"})`,`vec4 sample11 = texture2D(uTileIntensityValues, ${s?"cellEndNormalized":"vec2(cellEndNormalized.y, cellEndNormalized.x)"})`,"float intensity00 = "+("float"===a?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${l})`),"float intensity01 = "+("float"===a?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${l})`),"float intensity10 = "+("float"===a?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${l})`),"float intensity11 = "+("float"===a?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${l})`),"vec2 lerpFactors = cellIndex - cellStart",`float intensityR1 = mix(intensity00, intensity10, ${s?"lerpFactors.x":"lerpFactors.y"})`,`float intensityR2 = mix(intensity01, intensity11, ${s?"lerpFactors.x":"lerpFactors.y"})`,`float intensityP = mix(intensityR1, intensityR2, ${s?"lerpFactors.y":"lerpFactors.x"})`):bg("vec2 cellSizeAxisXZ = uTileBoundsAxisXZ.zw / (uTileDimensionsXZ - 1.0)","vec2 cellIndex = floor((vVertexLocationAxisXZ - uTileBoundsAxisXZ.xy) / cellSizeAxisXZ)","vec2 cellIndexNormalized = cellIndex / (uTileDimensionsXZ - 1.0)",`vec4 sample0 = texture2D(uTileIntensityValues, ${s?"cellIndexNormalized":"vec2(cellIndexNormalized.y, cellIndexNormalized.x)"})`,"float intensityP = sample0.x"),...kg("intensityP",e[2]))):(d.push(Tg(`posAxis.${e[1]}`,"varying float vLookupValue")),f.push(Sg("varying float vLookupValue"),...kg("vLookupValue",e[2])))),"phong"===r&&f.push(...Dg),n&&(d.push(Sg("attribute vec3 aTriangleBary"),Tg("aTriangleBary","varying vec3 vTriangleBary")),f.push(Sg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Eg.computeScreenSpaceWireframe,wg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)",e?"if (edge > 0.0) {\n colorFragment = vec4(mix(colorFragment.rgb, uWireframeColor.rgb, edge * uWireframeColor.a), max(colorFragment.a, uWireframeColor.a));\n }":"if (edge > 0.0) {\n colorFragment = uWireframeColor;\n } else {\n discard;\n }"))),{idVertex:`SurfaceGrid:${Lg(t)}`,idFragment:`SurfaceGrid:${Lg(t)}`,vertexShaderModifiers:d,fragmentShader:"FragmentShader",fragmentShaderModifiers:f}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${Lg(t)}`,idFragment:`DebugSurfaceGridNormals:${Lg(t)}`,vertexShaderModifiers:[Sg("attribute float aNormalArrow","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","attribute"===t.instanceIdSource&&"attribute float aInstanceID",..."uint"===t.normalTextureType?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"]),Eg.roundUnsigned,Eg.modulus,Eg.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&Eg.decodeUbyteRGBAEncodedFloat,bg(void 0===t.instanceIdSource?"int iInstance = gl_InstanceID":"int iInstance = int(roundUnsigned(aInstanceID))","iInstance = iInstance + uBaseInstance","int iSecondary = modulus(iInstance, (uTileDimensions.y - 1))","int iPrimary = iInstance / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 uTileDimensionsMinus1 = vec2(float(uTileDimensions.x), float(uTileDimensions.y)) - 1.0","float y00 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y01 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y10 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y11 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y = (y00 + y01 + y10 + y11) / 4.0","vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)",`vec2 posAxisXZ = uTileStartLocationAxisXZ + cellSizeAxis * (0.5 + ${t.flipXZ?"vec2(iCell.y, iCell.x)":"iCell"})`,"vec3 posAxis = vec3(posAxisXZ.x, y, posAxisXZ.y)",..."uint"===t.normalTextureType?["vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)"]:["vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))"],"vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vec3 normalWorld = normalize(normalAxis * uScale)"),..."uint"===t.normalTextureType?[Eg.texelFetchUnsignedWithFallback[i]]:[],...Bg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),wg("posWorld =","vec3 dirArrow = normalWorld","vec3 posArrowStart = posWorld","vec3 posArrowEnd = posWorld + dirArrow * 0.010","vec3 notParallel = normalize(mix( vec3( 0.0, 1.0, 0.0 ), vec3( 0.2, 0.8, 0.0 ), step( abs(dirArrow.y), 0.9 ) ))","vec3 dirArrowLeft = normalize(-dirArrow + 0.50 * normalize(cross(dirArrow, notParallel)))","vec3 dirArrowRight = normalize(-dirArrow + 0.50 * normalize(cross(notParallel, dirArrow)))","vec3 posArrowLeft = posArrowEnd + dirArrowLeft * 0.0025","vec3 posArrowRight = posArrowEnd + dirArrowRight * 0.0025","if (aNormalArrow == 0.0) {\n posWorld = posArrowStart;\n } else if (aNormalArrow == 1.0) {\n posWorld = posArrowEnd;\n } else if (aNormalArrow == 2.0) {\n posWorld = posArrowLeft;\n } else if (aNormalArrow == 3.0) {\n posWorld = posArrowRight;\n }")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Cg("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",apply:t=>({idVertex:"OffsetTowardsCamera",idFragment:void 0,vertexShaderModifiers:[Sg("uniform vec3 uCameraLoc"),wg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[Sg("attribute float aSegmentInside"),Sg("varying float vSegmentInside"),Sg("varying float vSegmentSide"),wg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[Rg("#extension GL_OES_standard_derivatives : enable"),Sg("uniform float uAALimit"),Sg("varying float vSegmentInside"),Sg("varying float vSegmentSide"),wg("antiAliasFactor = ","\n float dist = (uAALimit - vSegmentInside);\n vec2 ddist = vec2(dFdx(dist), dFdy(dist));\n float pixelDist = dist / length(ddist);\n // additional blurring\n pixelDist *= 0.5;\n\n float aa = clamp(0.5 - pixelDist, 0.0, 1.0);\n if((vSegmentSide <= 0.0 || vSegmentSide >= 1.0) && aa <=0.99){\n aa *= 0.5;\n }\n antiAliasFactor = aa;\n ")]})},Glow1D:t=>({idFeature:"Glow1D",apply:()=>{const e=Math.round(t.spreadPx),i=Math.round(t.blurPx),s=e+i,r=t.firstPass,n=[];for(let t=-s;t<=s;t+=1){const e=Math.abs(t);n.push(r?{x:t.toFixed(1),y:"0.0",distPx:e.toFixed(1)}:{x:"0.0",y:t.toFixed(1),distPx:e.toFixed(1)})}return{idVertex:`Glow1D:${Lg(t)}`,idFragment:`Glow1D:${Lg(t)}`,vertexShaderModifiers:[Tg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Sg("uniform sampler2D uTexture"),Sg("varying vec2 vTextureCoord"),Sg("uniform vec2 uTextureSize"),r&&Sg("uniform vec2 uOffsetPx"),!r&&Sg("uniform sampler2D uTextureFirstGlowPass"),!r&&Sg("uniform vec4 uGlowColor"),wg("antiAliasFactor =","vec2 oneTexel = vec2(1.0, 1.0) / uTextureSize",...r?[]:["float inverseIntensity =\n 0.25 * texture2D(uTexture, vTextureCoord).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, 0.0)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, 0.0)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(0.0, -oneTexel.y)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(0.0, oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, -oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, -oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, oneTexel.y)).a","antiAliasFactor *= 1.0 - (inverseIntensity * inverseIntensity)","if (antiAliasFactor <= 0.0) { discard; }"],"float distancePx = 255.0","vec2 sample_tx = vec2(0.0)",...r?["vec2 texCoordOffset = vTextureCoord - uOffsetPx * oneTexel",...n.map(((t,e)=>[`sample_tx = texCoordOffset + oneTexel * vec2(${t.x}, ${t.y})`,`if (distancePx > ${t.distPx} && sample_tx.x <= 1.0 && sample_tx.y <= 1.0 && sample_tx.x >= 0.0 && sample_tx.y >= 0.0 && texture2D(uTexture, sample_tx).a > 0.0) { distancePx = ${t.distPx}; }`])).flat(),"colorFragment = vec4(distancePx / 255.0, 0.0, 0.0, 1.0)"]:["vec4 sample_horizontal = vec4(0.0)","float horizontal_dist = 255.0","float min_horizontal_dist = 255.0",...n.map(((t,e)=>[`sample_tx = vTextureCoord + oneTexel * vec2(${t.x}, ${t.y})`,"if (sample_tx.x <= 1.0 && sample_tx.y <= 1.0 && sample_tx.x >= 0.0 && sample_tx.y >= 0.0) {\n sample_horizontal = texture2D(uTextureFirstGlowPass, sample_tx);\n horizontal_dist = sample_horizontal.r * 255.0;\n }","if (sample_horizontal.a < 0.9) { horizontal_dist = 255.0; }","min_horizontal_dist = min(min_horizontal_dist, horizontal_dist)",`distancePx = min(distancePx, pow(horizontal_dist * horizontal_dist + ${t.y} * ${t.y}, 0.5))`])).flat(),`if (distancePx > ${s.toFixed(1)}) { discard; }`,"vec4 pixelGlowColor = vec4(0.0, 0.0, 0.0, 0.0)",`if (distancePx > ${e.toFixed(1)}) {\n float lerpAmount = (distancePx - ${e.toFixed(1)}) / ${(i+1).toFixed(1)};\n pixelGlowColor = mix(uGlowColor, vec4(uGlowColor.rgb, 0.0), 1.0 - (1.0 - lerpAmount) * (1.0 - lerpAmount));\n } else {\n pixelGlowColor = uGlowColor;\n }`,"colorFragment = pixelGlowColor"])]}}}),MousePicking:t=>{const e=!!(null==t?void 0:t.customMousePickingIdInput),i=!e&&!!(null==t?void 0:t.useVertexId),s=!e&&!!(null==t?void 0:t.useAttribute),r=!e&&!i&&!s;return{idFeature:"MousePicking",gE:{SE:r,xE:i},apply:(n,o)=>{const h="webgl2"===o?"flat":"",a="webgl2"===o?"int":"float";return{idVertex:`MousePicking:${Lg(t)}`,idFragment:`MousePicking:${Lg(t)}`,vertexShaderModifiers:[...r?[Sg(`${h} varying ${a} vPickingIdOffset`),Cg(`vPickingIdOffset = ${a}(iInstance)`)]:[],...i?[Sg(`${h} varying ${a} vPickingIdOffset`),Cg(`vPickingIdOffset = ${a}(iVertex)`)]:[],...s?[Sg("attribute float aPickingIdOffset",`${h} varying ${a} vPickingIdOffset`),Cg(`vPickingIdOffset = ${a}(aPickingIdOffset)`)]:[]],fragmentShaderModifiers:[Sg("uniform int uFirstId"),...e?[]:[Sg(`${h} varying ${a} vPickingIdOffset`),bg("int mousePickingIdOffset = "+("int"===a?"vPickingIdOffset":"int(floor(vPickingIdOffset + 0.5))"))],wg("colorFragment =","int remainder = mousePickingIdOffset + uFirstId","int r = remainder / 16777216","remainder -= r * 16777216","int g = remainder / 65536","remainder -= g * 65536","int b = remainder / 256","remainder -= b * 256","int a = remainder","colorFragment = vec4(float(r) / 255.0, float(g) / 255.0, float(b) / 255.0, float(a) / 255.0)"),t=>t.replace("gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor)","if (antiAliasFactor <= 0.0) { discard; }\ngl_FragColor = fragColorEnd").replace("if (fragColorEnd.a <= 0.0) { discard; }","")]}}}},AttributeHighlight:{idFeature:"AttributeHighlight",apply:t=>({idVertex:"AttributeHighlight",idFragment:"AttributeHighlight",vertexShaderModifiers:[Tg("attribute float aIsHighlighted","varying float vIsHighlighted")],fragmentShaderModifiers:[t=>t.replace("uniform float uIsHighlighted","varying float vIsHighlighted").replace("uIsHighlighted","vIsHighlighted")]})},StippleTexture:{idFeature:"StippleTexture",apply:(t,e)=>({idVertex:"StippleTexture",idFragment:"StippleTexture",vertexShaderModifiers:[Sg("attribute vec2 aLengthSoFar"),Sg("varying float vLengthSoFar"),Sg("uniform vec2 uStippleCount"),Cg("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Sg("uniform sampler2D uStippleTexture"),Sg("uniform float uStippleScale"),Sg("varying float vLengthSoFar"),"webgl1"===e&&Sg("uniform float uStippleTextureWidthLimiter"),wg("antiAliasFactor = ",`\n float stippleSampleY = texture2D(\n uStippleTexture, \n ${"webgl1"===e?"vec2(mod((vLengthSoFar / uStippleScale) , uStippleTextureWidthLimiter), 0)":"vec2((vLengthSoFar / uStippleScale), 0)"}\n ).r;\n float stippleAA = (stippleSampleY - 0.5) * 2.0;\n antiAliasFactor *= stippleAA;\n if (antiAliasFactor <= 0.0) { discard; }`)]})},StippleTextureInstanced:{idFeature:"StippleTextureInstanced",apply:(t,e)=>({idVertex:"StippleTextureInstanced",idFragment:"StippleTextureInstanced",vertexShaderModifiers:[Sg("attribute vec2 aLengthSoFarA"),Sg("attribute vec2 aLengthSoFarB"),Sg("varying float vLengthSoFar"),Sg("uniform vec2 uStippleCount"),Cg("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Sg("uniform sampler2D uStippleTexture"),Sg("uniform float uStippleScale"),Sg("varying float vLengthSoFar"),"webgl1"===e&&Sg("uniform float uStippleTextureWidthLimiter"),wg("antiAliasFactor = ",`\n float stippleSampleY = texture2D(\n uStippleTexture, \n ${"webgl1"===e?"vec2(mod((vLengthSoFar / uStippleScale) , uStippleTextureWidthLimiter), 0)":"vec2((vLengthSoFar / uStippleScale), 0)"}\n ).r;\n float stippleAA = (stippleSampleY - 0.5) * 2.0;\n antiAliasFactor *= stippleAA;\n if (antiAliasFactor <= 0.0) { discard; }`)]})},PolarHeatmap:t=>({idFeature:"PolarHeatmap",apply:(e,i)=>{const s="dataType"in t,r="interpolation"in t?t:void 0,n=r?r.flipXY:void 0,o="bilinear"===(null==r?void 0:r.interpolation),h=null==r?void 0:r.intensityTextureType,a=null==r?void 0:r.littleEndian;return{idVertex:void 0,idFragment:`PolarHeatmap:${Lg(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[Sg("uniform vec2 uViewportSize","uniform vec2 uScale","uniform vec2 uDisp","uniform float uSectors","uniform float uAnnuli","uniform float uAmplitudeStart","uniform float uAmplitudeStep","uniform float uAmplitudeAxisStart","uniform float uAmplitudeAxisEnd","uniform float uAngleOffset","uniform float uAngleDirection",r&&"uniform sampler2D uTileIntensityValues",s&&"uniform vec4 uColor"),Eg.texelFetchWithFallback[i],"ubyte"===h&&Eg.decodeUbyteRGBAEncodedFloat,bg("vec2 posWorld = (2.0 * gl_FragCoord.xy / uViewportSize) - 1.0","vec2 posAxis = posWorld * uScale + uDisp","float amplitudeAxisInterval = uAmplitudeAxisEnd - uAmplitudeAxisStart","float amplitude = uAmplitudeAxisStart + sign(amplitudeAxisInterval) * sqrt(posAxis.x * posAxis.x + posAxis.y * posAxis.y)","float iAnnulus = (amplitude - uAmplitudeStart) / uAmplitudeStep"),r&&wg("iAnnulus","float angRad = atan(posAxis.y, posAxis.x) * uAngleDirection + uAngleOffset","if (angRad < 0.0) { angRad = angRad + 2.0 * 3.1415926538; }","if (angRad > 2.0 * 3.1415926538) { angRad = angRad - 2.0 * 3.1415926538; }","float iSector = uSectors * angRad / (2.0 * 3.1415926538)","vec2 cellIndex = vec2(iSector, iAnnulus)","ivec2 cellStart = ivec2(floor(cellIndex))","ivec2 cellEnd = cellStart + ivec2(1)","if (cellEnd.x >= int(uSectors)) { cellEnd = ivec2(0, cellEnd.y); }",n&&"cellIndex = vec2(cellIndex.y, cellIndex.x)",n&&"cellStart = ivec2(cellStart.y, cellStart.x)",n&&"cellEnd = ivec2(cellEnd.y, cellEnd.x)"),s&&wg("colorFragment =","colorFragment = uColor"),r&&wg("cellEnd","vec2 tileDimensions = "+(n?"vec2(uAnnuli, uSectors)":"vec2(uSectors, uAnnuli)"),o&&"vec4 sample00 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",o&&"vec4 sample01 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellStart.x, cellEnd.y), tileDimensions)",o&&"vec4 sample10 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellEnd.x, cellStart.y), tileDimensions)",o&&"vec4 sample11 = texelFetchWithFallback(uTileIntensityValues, cellEnd, tileDimensions)",o&&"float intensity00 = "+("float"===h?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${a})`),o&&"float intensity01 = "+("float"===h?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${a})`),o&&"float intensity10 = "+("float"===h?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${a})`),o&&"float intensity11 = "+("float"===h?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${a})`),o&&"vec2 lerpFactors = cellIndex - vec2(cellStart)",o&&"float intensityR1 = mix(intensity00, intensity10, lerpFactors.x)",o&&"float intensityR2 = mix(intensity01, intensity11, lerpFactors.x)",o&&"float intensityP = mix(intensityR1, intensityR2, lerpFactors.y)",!o&&"vec4 sample0 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",!o&&"float intensityP = "+("float"===h?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${a})`)),...r?kg("intensityP",r.lut):[]]}}})},Yg={"2D":"\nvoid main(void) {\n gl_Position = vec4(posWorld, 0.0, 1.0 );\n}\n","2DMatrix":"\nvoid main(void) {\n gl_Position = posWorld;\n}\n","3D":"\nuniform mat4 uViewProjectionMatrix;\nvoid main(void) {\n gl_Position = uViewProjectionMatrix * vec4(posWorld, 1.0);\n}\n"},Gg={FragmentShader:"\nuniform float uIsHighlighted;\nuniform vec4 uHighlightColorOffset;\nuniform float uRenderEffectMask;\nvoid main(void) {\n vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0);\n float antiAliasFactor = 1.0;\n vec4 fragColorEnd = colorFragment;\n if (fragColorEnd.a <= 0.0) { discard; }\n fragColorEnd = clamp(fragColorEnd + uIsHighlighted * uHighlightColorOffset, vec4(0.0), vec4(1.0));\n fragColorEnd = mix(fragColorEnd, vec4(1.0), uRenderEffectMask * fragColorEnd.a * 1000.0);\n gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor);\n}\n",Empty:"\nvoid main(void) {\n}\n"};class Xg{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new At(`Could not find ${this.bE()} ${this.ME()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}bE(){return this.id.toString()}ME(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class Zg extends Xg{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class Hg extends Xg{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class Wg{constructor(t,e,i,s){this._E=new Map,this.wE=new Map,this.CE=i,this.kE=i.createProgram(),this.TE=`${t.bE()} vertex`,this.FE=`${e.bE()} fragment`,i.attachShader(this.kE,t.shader),i.attachShader(this.kE,e.shader),i.bindAttribLocation(this.kE,0,"aPos"),i.linkProgram(this.kE),i.deleteShader(t.shader),i.deleteShader(e.shader),this.allAttributeNames=t.info.allAttributeNames,this.allUniformNames=Array.from(new Set(t.info.allUniformNames.concat(e.info.allUniformNames)).values()),this.vertexSharedRemovedVariables=t.info.removedVariableNames,this.fragmentSharedRemovedVariables=e.info.removedVariableNames}get vertexShaderSrc(){return""}get fragmentShaderSrc(){return""}IE(t){return pe(0,(()=>xe()))}PE(t){const e=this.DE(t);if(void 0===e)throw this.IE(`Could not get ${t} uniform from ${this.TE} and ${this.FE} shaders.`);return e}DE(t){const e=this._E.get(t);if(e)return e;const i=this.CE.getUniformLocation(this.kE,t);return i?(this._E.set(t,i),i):void 0}BE(t){const e=this.LE(t);if(void 0===e)throw this.IE(`Could not get ${t} attribute from ${this.TE} and ${this.FE} shaders.`);return e}LE(t){const e=this.wE.get(t);if(e||0===e)return e;const i=this.CE.getAttribLocation(this.kE,t);return i>=0?(this.wE.set(t,i),i):void 0}Y(){this.CE.deleteProgram(this.kE)}}const jg=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/,Kg=t=>{let e;try{e=wt.getComputedStyle(t)}catch(t){return null}return e};function $g(t){const e=Kg(t);return!!e&&("fixed"===e.position||!!("auto"!==e.zIndex&&"static"!==e.position||function(t){const e=Kg(ty(t)),i=e?e.display:"auto";return"flex"===i||"inline-flex"===i}(t))||+e.opacity<1||"transform"in e&&"none"!==e.transform||"webkitTransform"in e&&"none"!==e.webkitTransform||"mixBlendMode"in e&&"normal"!==e.mixBlendMode||"filter"in e&&"none"!==e.filter||"webkitFilter"in e&&"none"!==e.webkitFilter||"isolation"in e&&"isolate"===e.isolation||!!jg.test(e.willChange)||"touch"===e.webkitOverflowScrolling)}function Qg(t){let e=t.length;for(;e--;)if($g(t[e]))return t[e];return null}function qg(t){var e;return t&&Number((null===(e=Kg(t))||void 0===e?void 0:e.zIndex)||0)||0}function Jg(t){const e=[];for(;t;)e.push(t),t=ty(t);return e}function ty(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.host)||t.parentNode}const ey=t=>t&&"resize"in t;class iy extends rg{constructor(t){if(super(),this.RE=new Map,this.EE=new Map,this.zE=new Map,this.VE=!0,this.OE=null,this.NE=null,this.GE=null,this.WE=null,this.UE=0,this.YE=0,this.HE=0,this.$E=!1,this.XE=!0,this.$i=!1,this.jE=fe(`chart-engine-${(new Date).getTime()}${Math.trunc(1e6*Math.random()).toString()}`),this.Z={x:100,y:100},this.ZE=()=>{this.QE&&clearTimeout(this.QE),this.QE=setTimeout((()=>this.en()),12)},this.JE=t=>{const e=t.intersectionRatio>0,i=t.target.getAttribute("data-lcjs-engine-id");if(i){const t=this.RE.get(i);if(t){const s=t.KE();t.qE(e),e?this.EE.set(i,t):this.EE.delete(i),s!==e&&t.xs()}}},this.tz=(t,e,i,s,r)=>{const n=r[0],o=this.gl;if(o.bindFramebuffer(null==o?void 0:o.FRAMEBUFFER,null),o.useProgram(this.NE.kE),o.clear(o.COLOR_BUFFER_BIT),n.Zr.getBoundingClientRect()){const t=n.iz();o.viewport(0,0,t.x,t.y),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.sz),o.uniform1i(this.UE,0),o.uniformMatrix4fv(this.YE,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o.bindBuffer(o.ARRAY_BUFFER,this.GE),o.enableVertexAttribArray(0),o.vertexAttribPointer(this.HE,2,o.FLOAT,!1,0,0),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),n.ez&&(n.ez.clearRect(0,0,n.ez.canvas.width,n.ez.canvas.height),n.ez.drawImage(this.hz,0,this.hz.height-t.y,t.x,t.y,0,0,n.ez.canvas.width,n.ez.canvas.height))}},this.rz=(t,e,i,s,r)=>{const n=this.gl;n.bindFramebuffer(null==n?void 0:n.FRAMEBUFFER,null),n.useProgram(this.NE.kE),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.Zr.getBoundingClientRect();if(r){const i=r.right-r.left,o=r.bottom-r.top,h=r.left,a=s-r.bottom;n.viewport(h*this.nz-t*this.nz,a*this.nz+e*this.nz,i*this.nz,o*this.nz)}n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,i.sz),n.uniform1i(this.UE,0),n.uniformMatrix4fv(this.YE,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),n.bindBuffer(n.ARRAY_BUFFER,this.GE),n.enableVertexAttribArray(0),n.vertexAttribPointer(this.HE,2,n.FLOAT,!1,0,0),n.drawArrays(n.TRIANGLES,0,6)})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.oz=(t,e,i,s,r)=>{const n=r[0],o=this.gl2.ctx;o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),o.clear(o.COLOR_BUFFER_BIT);const h=n.iz();o.bindFramebuffer(o.READ_FRAMEBUFFER,n.az[1]),o.blitFramebuffer(0,0,h.x,h.y,0,this.hz.height-h.y,h.x,this.hz.height,o.COLOR_BUFFER_BIT,o.LINEAR),n.ez&&(n.ez.clearRect(0,0,n.ez.canvas.width,n.ez.canvas.height),n.ez.drawImage(this.hz,0,0)),o.bindFramebuffer(o.FRAMEBUFFER,null)},this.lz=(t,e,i,s,r)=>{const n=this.gl2.ctx;n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.Zr.getBoundingClientRect();if(r){const o=r.right-r.left,h=r.bottom-r.top,a=r.left,l=s-r.bottom,u=i.iz();n.bindFramebuffer(n.READ_FRAMEBUFFER,i.az[1]),n.blitFramebuffer(0,0,u.x,u.y,a*this.nz-t*this.nz,l*this.nz+e*this.nz,(a-t+o)*this.nz,(l+e+h)*this.nz,n.COLOR_BUFFER_BIT,n.LINEAR)}})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.QE=void 0,this.Qn=t,!wt.requestAnimationFrame||!wt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");let e=1;if(t&&t.uz)e=!0===t.uz?wt.devicePixelRatio||1:t.uz||1;else{const t=wt.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(e=wt.devicePixelRatio||1)}this.nz=e,t.Kn=!0===t.Kn,this.XE=!1!==t.cz,this.dz=!1!==t.fz,this.Az=t.Az||!1;let i=!1;if(t.hz)if("string"==typeof t.hz){const e=wt.document.getElementById(t.hz);if(!e)throw new Error(`Canvas "${t.hz}" doesn't exist.`);this.hz=e,i=!0}else this.hz=t.hz,i=!0;else this.hz=wt.document.createElement("canvas");const s={preserveDrawingBuffer:!0,alpha:!0,antialias:!1};if(2!==t.gz&&t.gz){const e=this.hz.getContext("webgl",{...s,antialias:!!t.cz})||this.hz.getContext("experimental-webgl",{...s,antialias:!!t.cz});this.gl=e,this.pz=!1}else{const t=this.hz.getContext("webgl2",s);this.gl2={ctx:t},this.gl=t,this.pz=!0}if(!this.gl)throw new xt("No WebGL context available."+((null==t?void 0:t.gz)?`\nSelected explicit target: WebGL ${t.gz}`:""));const r=[];if(this.yz={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.yz).forEach((t=>{null===this.yz[t]&&r.push(t)})),this.pz)this.mz=!0;else{const t={ANGLE_instanced_arrays:this.gl.getExtension("ANGLE_instanced_arrays"),EXT_blend_minmax:this.gl.getExtension("EXT_blend_minmax"),OES_element_index_uint:this.gl.getExtension("OES_element_index_uint"),OES_standard_derivatives:this.gl.getExtension("OES_standard_derivatives"),OES_vertex_array_object:this.gl.getExtension("OES_vertex_array_object")};t.OES_standard_derivatives||(this.VE=!1),Object.keys(t).forEach((e=>{null===t[e]&&r.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.mz=!!e.OES_texture_float,this.gl1={ctx:this.gl,yz:t,optional:e}}const n=r;if(n.length>0&&!1!==t.Kn){const t=wt.document.createElement("div");t.innerText="LightningChart JS: Some features might not work properly, due to missing WebGL features.",t.style.cssText="position:absolute;top:0;background:red;width:100%;padding:10px;text-align:center;color:white;z-index:1;";const e=wt.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),wt.document.body.appendChild(t),t.appendChild(e),wt.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",n.join(", "))}if(this.vz=this.Az?this.Sz(this.pz?this.oz.bind(this):this.tz.bind(this)).bind(this):this.xz(this.pz?this.lz.bind(this):this.rz.bind(this)).bind(this),wt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.hz&&this.bz()};this.eo=new wt.ResizeObserver(t.bind(this)),this.eo.observe(this.hz)}if(this.Mz=((t,e)=>{const i=t,s=new Map,r=new Map,n=new Map,o={totalMs:0,vertexShaders:0,fragmentShaders:0,programs:0},h=(t,i,s=[])=>{const r=[],n=[],o={allAttributeNames:Array.from(t.matchAll(/attribute\s[^\s]*\s(.*);/g)).map((t=>t[1])),allUniformNames:Array.from(t.matchAll(/uniform\s[^\s]*\s(.*);/g)).map((t=>t[1])),allVaryingNames:Array.from(t.matchAll(/varying\s[^\s]*\s(.*);/g)).map((t=>t[1])),removedVariableNames:[]};if(e){const e=t.match(/#extension.*/g);e&&n.push(...e),t=t.replace(/#extension.*/g,"")}else if(r.push("#version 300 es"),(t=(t=(t=t.replace(/#extension.*/g,"")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).includes("usampler2D")&&r.push("precision highp usampler2D;"),"vertex"===i)t=t.replace(/varying/g,"out");else{t=t.replace(/varying/g,"in");const e=s.find((t=>"fragOutput"===t.type));t=(t=e?`out ${e.fragOutput} fragOutput;\n${t}`:`out vec4 fragOutput;\n${t}`).replace(/gl_FragColor/g,"fragOutput")}return n&&r.push(...n),r.push("precision highp float;"),r.push("precision highp int;"),{source:t=`${r.join("\n")}\n${t}`,info:o}};return(...t)=>{const a=e?"webgl1":"webgl2";let l,u,c,d,f,g,y,m,p;try{const e=wt.performance.now();l=t.filter((t=>!1!==t&&void 0!==t)),u=((t,e)=>{const i=t.map((i=>i.apply(t,e))),s=i.map((t=>t.idVertex)).filter((t=>void 0!==t)).sort().join(" "),r=i.map((t=>t.idFragment)).filter((t=>void 0!==t)).sort().join(" "),n=`vert: ${s} frag: ${r}`;let o,h=!1,a=!1;const l=[];let u;const c=[],d=[];if(i.forEach((t=>{if(t.defaultVertexShader&&(h||(o=t.defaultVertexShader)),t.vertexShader){if(o&&h&&o!==t.vertexShader)throw new Pg(`Conflicting vertex shader templates ${o} vs ${t.vertexShader}`,n,t);o=t.vertexShader,h=!0}if(t.vertexShaderModifiers)for(const e of t.vertexShaderModifiers)void 0!==e&&!1!==e&&l.push(e);if(t.defaultFragmentShader&&(a||(u=t.defaultFragmentShader)),t.fragmentShader){if(u&&a&&u!==t.fragmentShader)throw new Pg(`Conflicting fragment shader templates ${u} vs ${t.fragmentShader}`,n,t);u=t.fragmentShader,a=!0}if(t.fragmentShaderModifiers)for(const e of t.fragmentShaderModifiers)void 0!==e&&!1!==e&&c.push(e);t.hints&&t.hints.forEach((t=>{t&&d.push(t)}))})),!!t.find((t=>{var e;return null===(e=t.gE)||void 0===e?void 0:e.SE}))&&("webgl1"===e?l.push(Sg("attribute float aInstanceID"),bg("int iInstance = int(aInstanceID)")):l.push(bg("int iInstance = gl_InstanceID"))),!!t.find((t=>{var e;return null===(e=t.gE)||void 0===e?void 0:e.xE}))&&("webgl1"===e?l.push(Sg("attribute float aVertexID"),bg("int iVertex = int(aVertexID)")):l.push(bg("int iVertex = gl_VertexID"))),!o)throw new Pg("No vertex shader template defined",n);if(!u)throw new Pg("Fragment shader not defined",n);return{id:n,vertexShader:{id:s,template:o,modifiers:l},fragmentShader:{id:r,template:u,modifiers:c},hints:d}})(l,a);const x=n.get(u.id);if(c="new",x)return c="existing",g=x.vertexShaderSrc,y=x.fragmentShaderSrc,x;const A=u.vertexShader.id;let S=s.get(A);if(S)g=S.src,d="existing";else{d="new";const t=new pg(u.vertexShader.modifiers).build(Yg[u.vertexShader.template]),{source:e,info:r}=h(t,"vertex");g=e,m=r,S=new Zg(A,e,i,r),s.set(A,S),o.vertexShaders+=1}const v=u.fragmentShader;let b;const M=v.id;if(b=r.get(M),b)y=b.src,f="existing";else{f="new";const t=Gg[v.template],e=new pg([...v.modifiers]).build(t),{source:s,info:n}=h(e,"fragment",u.hints);y=s,p=n,b=new Hg(M,s,i,n),r.set(M,b),o.fragmentShaders+=1}const w=new Wg(S,b,i,u);return n.set(u.id,w),o.programs+=1,o.totalMs+=wt.performance.now()-e,w}catch(t){throw pe(0,(()=>{const t="Unexpected LightningChart JS rendering error.\nThis can mean a bug in the library, or that it is simply used in unsupported manner (passing wrong type to method, using disposed component, etc).";return wt.alert(t),new Error(t)}))}}})(this.gl,!this.pz),this.dE=(()=>{const t=wt.document.createElement("canvas"),e=t.getContext("2d",{willReadFrequently:!0});if(!e)throw new xt("Failed to get Text canvas rendering context");return e.fillStyle="#fff",(i,s,r,n)=>{const o=`${s.style} ${s.weight} ${s.size*r}px ${s.family}`;e.font=o,e.textBaseline="alphabetic",e.textAlign="left";const h=e.measureText(i);if(0===h.width)return;const a=void 0!==h.actualBoundingBoxLeft&&void 0!==h.actualBoundingBoxRight?Math.ceil(h.actualBoundingBoxLeft+h.actualBoundingBoxRight):Math.ceil(h.width),l=h.width,c=Math.round(s.size*r),d=void 0!==h.actualBoundingBoxLeft?h.actualBoundingBoxLeft:0;t.width=a>0?a:l,t.height=2*c,e.font=o,e.textBaseline="alphabetic",e.textAlign="left",n?(e.clearRect(0,0,t.width,t.height),e.fillStyle="#fff"):(e.fillStyle="rgba(255,255,255,0)",e.fillRect(0,0,t.width,t.height),e.fillStyle="#000"),e.fillText(i,d,c);const f=e.getImageData(0,0,t.width,t.height);let g=0,y=0;const m=f.width;for(let t=0;t=0;t-=1){for(let e=0;e{for(let e=0;ee/100))})),wt.addEventListener("resize",this.ZE,{passive:!0}),!this.pz){if(this.NE=this.Mz(Ug["2DCompose"],Ug.Color({dataType:"texture-coord-calc-gpu"}),Ug.VertexLocation({axisWorldTranslation:"matrix4",normalSource:void 0,coordType:"vec4"})),!this.NE.kE)throw new xt("Unable to setup composition shader!");const t=this.gl,e=t.getUniformLocation(this.NE.kE,"uColorTexture");if(!e)throw new xt("Unable to setup composition shader! Failed to find uColorTexture");const i=t.getUniformLocation(this.NE.kE,"uMatrix");if(!i)throw new xt("Unable to setup composition shader! Failed to find uMatrix");this.UE=e,this.YE=i,this.HE=t.getAttribLocation(this.NE.kE,"aPos"),this.GE=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.GE),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this.WE=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.WE),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,0,0,1,1,1]),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null)}}Sz(t){return e=>{this.OE=null;const i=this.gl.canvas,s=Array.from(this.EE.values());this.$E=!1,s.forEach((s=>{const r=s.iz();(this.Z.x{this.OE=null,"style"in this.gl.canvas&&!this.Qn.Tz&&(this.gl.canvas.style.transform=`translateX(${window.scrollX}px) translateY(${window.scrollY}px)`);const i=this.gl.canvas,s=this.hz.clientHeight,r=this.hz.clientWidth;let n=0,o=0;if(i instanceof HTMLCanvasElement){i.width===r*this.nz&&i.height===s*this.nz||(i.width=r*this.nz,i.height=s*this.nz);const t=i.getBoundingClientRect();n=t.x,o=t.y}const h=Array.from(this.EE.values());this.$E=!1,h.sort(((t,e)=>t.Fz()-e.Fz())).forEach((t=>{t.dn&&t.kz(e)})),t(n,o,r,s,h),this.$E&&this.bz()}}bz(t){return ey(this.gl)||(!this.$E&&t&&(this.$E=!0),this.OE||this.$i||(this.OE=wt.requestAnimationFrame(this.vz))),this}Iz(t){const e=this.jE();return t.Zr.setAttribute("data-lcjs-engine-id",e),this.RE.set(e,t),t.Pz(this.RE.size-1),t.qE(!0),this.EE.set(e,t),this.Cz&&this.Cz.observe(t.Zr),this.QE&&clearTimeout(this.QE),this.QE=setTimeout((()=>this.en()),0),this}Dz(t){const e=t.Zr.getAttribute("data-lcjs-engine-id");return e?(this.RE.delete(e),this.EE.delete(e),this.Cz&&this.Cz.unobserve(t.Zr),t.Zr.removeAttribute("data-lcjs-engine-id"),this):this}en(){if(this.Cz){const t=this.Cz.takeRecords();for(let e=0;efunction(t,e){if(t===e)return 0;const i={a:Jg(t),b:Jg(e)};let s;for(;i.a[i.a.length-1]===i.b[i.b.length-1];)t=i.a.pop(),e=i.b.pop(),s=t;const r=qg(Qg(i.a)),n=qg(Qg(i.b));if(r===n&&s){const t=s.childNodes,e={a:i.a[i.a.length-1],b:i.b[i.b.length-1]};let r=t.length;for(;r--;){const i=t[r];if(i===e.a)return 1;if(i===e.b)return-1}}return Math.sign(r-n)}(t.Zr,e.Zr))).forEach(((t,e)=>t.Pz(e))),this.bz(!0),this}II(){return this.bz(),this}Bz(){this.$i||this.RE.forEach((t=>t.cp.layout()))}Y(){var t;if(this.$i)return;this.$i=!0,super.Y(),this.OE&&(wt.cancelAnimationFrame(this.OE),this.OE=null),this.$E=!1,this.eo&&(this.eo.disconnect(),this.eo=void 0),this.Cz&&(this.Cz.disconnect(),this.Cz=void 0),wt.removeEventListener("resize",this.ZE),this.ZE=void 0,this.RE.forEach((t=>{t.Y()})),this.RE.clear(),Array.from(this.zE.values()).forEach((t=>{t.KR(!0)})),this.zE.clear();const e=this.gl;e.deleteBuffer(this.GE),e.deleteBuffer(this.WE),this.hz&&!this.Qn.hz?(this.hz.width=1,this.hz.height=1,null===(t=this.hz.parentElement)||void 0===t||t.removeChild(this.hz),this.hz=void 0):this.hz=void 0,this.Mz=void 0,this.dE=void 0,this.vz=()=>{},this.yz.WEBGL_lose_context&&this.yz.WEBGL_lose_context.loseContext()}}const sy=(t,e,i,s)=>r=>{const n={theme:eg,...i,...r},o=t(n),h=e||s?ig(o,s):void 0,a=new vf(o.Qn,r,o,o.Y.bind(o),h);return o.mo((t=>a.QL(t))).yo((()=>a.J())).xs(),a},ry=(t,e)=>{t.mo((t=>{e.De(t)})).yo((()=>e.J())).xs()},ny=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new sa(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h);return ry(o,a),a},oy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new wc(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,r);return ry(o,a),a},hy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new Cd(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,r);return ry(o,a),a},ay=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new zc(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,r);return ry(o,a),a},ly=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new(r&&r.type?r.type:Ya)(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0,r);return ry(o,a),a},uy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new gf(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0,r);return ry(o,a),a},cy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new(r&&r.type?r.type:$c)(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0,r);return ry(o,a),a},dy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new(r&&r.type?r.type:ld)(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0,r);return ry(o,a),a},fy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new Vl(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,r,void 0);return ry(o,a),a},gy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new wl(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0,r);return ry(o,a),a},yy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new Qd(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0);return ry(o,a),a},my=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new lf(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,void 0,r);return ry(o,a),a},py=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new Ic(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,r);return ry(o,a),a},xy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||eg},o=t(n),h=e||s?ig(o,s):void 0,a=new Of(o.Qn,Rd(o,1).UF(0),lt,o.Y.bind(o),h,r);return ry(o,a),a},Ay={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)=>Ay.multiply(t,Ay.translation(e,i,s)),xRotate:(t,e)=>Ay.multiply(t,Ay.xRotation(e)),yRotate:(t,e)=>Ay.multiply(t,Ay.yRotation(e)),zRotate:(t,e)=>Ay.multiply(t,Ay.zRotation(e)),rotateXYZ(t,e){let i=Ay.xRotate(t,e.x);return i=Ay.yRotate(i,e.y),i=Ay.zRotate(i,e.z),i},scale:(t,e,i,s)=>Ay.multiply(t,Ay.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],y=e[13],m=e[14],p=e[15],x=t[0],A=t[1],S=t[2],v=t[3],b=t[4],M=t[5],w=t[6],C=t[7],T=t[8],R=t[9],E=t[10],k=t[11],I=t[12],F=t[13],D=t[14],P=t[15],L=[];return L[0]=i*x+s*b+r*T+n*I,L[1]=i*A+s*M+r*R+n*F,L[2]=i*S+s*w+r*E+n*D,L[3]=i*v+s*C+r*k+n*P,L[4]=o*x+h*b+a*T+l*I,L[5]=o*A+h*M+a*R+l*F,L[6]=o*S+h*w+a*E+l*D,L[7]=o*v+h*C+a*k+l*P,L[8]=u*x+c*b+d*T+f*I,L[9]=u*A+c*M+d*R+f*F,L[10]=u*S+c*w+d*E+f*D,L[11]=u*v+c*C+d*k+f*P,L[12]=g*x+y*b+m*T+p*I,L[13]=g*A+y*M+m*R+p*F,L[14]=g*S+y*w+m*E+p*D,L[15]=g*v+y*C+m*k+p*P,L},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],y=t[13],m=t[14],p=t[15],x=d*p,A=m*f,S=a*p,v=m*l,b=a*f,M=d*l,w=r*p,C=m*n,T=r*f,R=d*n,E=r*l,k=a*n,I=u*y,F=g*c,D=o*y,P=g*h,L=o*c,V=u*h,_=i*y,B=g*s,z=i*c,N=u*s,O=i*h,U=o*s,Y=x*h+v*c+b*y-(A*h+S*c+M*y),G=A*s+w*c+R*y-(x*s+C*c+T*y),X=S*s+C*h+E*y-(v*s+w*h+k*y),Z=M*s+T*h+k*c-(b*s+R*h+E*c),H=1/(i*Y+o*G+u*X+g*Z);return e[0]=H*Y,e[1]=H*G,e[2]=H*X,e[3]=H*Z,e[4]=H*(A*o+S*u+M*g-(x*o+v*u+b*g)),e[5]=H*(x*i+C*u+T*g-(A*i+w*u+R*g)),e[6]=H*(v*i+w*o+k*g-(S*i+C*o+E*g)),e[7]=H*(b*i+R*o+E*u-(M*i+T*o+k*u)),e[8]=H*(I*l+P*f+L*p-(F*l+D*f+V*p)),e[9]=H*(F*n+_*f+N*p-(I*n+B*f+z*p)),e[10]=H*(D*n+B*l+O*p-(P*n+_*l+U*p)),e[11]=H*(V*n+z*l+U*f-(L*n+N*l+O*f)),e[12]=H*(D*d+V*m+F*a-(L*m+I*a+P*d)),e[13]=H*(z*m+I*r+B*d-(_*d+N*m+F*r)),e[14]=H*(_*a+U*m+P*r-(O*m+D*r+B*a)),e[15]=H*(O*d+L*r+N*a-(z*a+U*d+V*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]};function Sy(t,i,s,r,n,o){let h=i.x.ft(t.max.x),a=i.x.ft(t.min.x),l=i.y.ft(t.max.y),u=i.y.ft(t.min.y),c=h-a,d=l-u;if(c<1){const t=(a+h)/2;a=t-.5,h=t+.5,c=1}if(d<1){const t=(u+l)/2;u=t-.5,l=t+.5,d=1}const f=c/d,g=c*s.x,y=d*s.y,m=c-g,p=d-y,x=g>m?[m,g]:[g,m],A=y>p?[p,y]:[y,p];let S,v,b=1,M=1;switch(r){default:case e.GradientExtent.closestSide:if(S=x[0]/c,v=A[0]/d,n===e.GradientShape.circle){const t=Math.min(S*f,v);b=t,M=t}else b=S*f,M=v;break;case e.GradientExtent.farthestSide:if(S=x[1]/c,v=A[1]/d,n===e.GradientShape.circle){const t=Math.max(S*f,v);b=t,M=t}else b=S*f,M=v;break;case e.GradientExtent.closestCorner:if(v=A[0]/d,n===e.GradientShape.circle){S=x[0]/c*f;const t=Math.sqrt(S*S+v*v);b=t,M=t}else{S=x[0]/c;const t=Math.sqrt(S*S+v*v);b=t*f,M=t}break;case e.GradientExtent.farthestCorner:if(v=A[1]/d,n===e.GradientShape.circle){S=x[1]/c*f;const t=Math.sqrt(S*S+v*v);b=t,M=t}else{S=x[1]/c;const t=Math.sqrt(S*S+v*v);b=t*f,M=t}}return{bounds:[a*o,u*o,c*o,d*o],center:[s.x*f,s.y],distance:[Math.max(b,1e-4),Math.max(M,1e-4)],aspectRatio:f}}function vy(t,e,i,s){const r=e.x.ft(t.max.x),n=e.x.ft(t.min.x),o=e.y.ft(t.max.y),h=e.y.ft(t.min.y),a=r-n,l=o-h,c=Math.abs(a*Math.sin(i))+Math.abs(l*Math.cos(i)),d=u(a/2-Math.sin(i)*(c/2),l/2-Math.cos(i)*(c/2)),f=u(a/2+Math.sin(i)*(c/2),l/2+Math.cos(i)*(c/2));return{bounds:[n*s,h*s,a*s,l*s],startPoint:[d.x*s,d.y*s],endPoint:[f.x*s,f.y*s]}}class by{constructor(t){this.ZR=t}}class My{constructor(){this.Lz=new Array,this.Rz=t=>(this.Lz.push(t),t),this.Ez=this.Rz(new Map),this.zz=this.Rz(new Map),this.Vz=this.Rz(new Map),this.Oz=this.Rz(new Map),this.Nz=this.Rz(new Map),this.Gz=this.Rz(new Map),this.Wz=this.Rz(new Map),this.Uz=this.Rz(new Map)}Yz(){this.Lz.forEach((t=>{t.forEach((t=>t.Yz())),t.clear()}))}}const wy=(t,e,i)=>()=>{t.$z=e,i&&i()},Cy=(t,i,s,r,n)=>{const o=Math.min(s/t,r/i),h=t*o,a=i*o,l=s/h,u=r/a,c=h/s,d=a/r;let f=0,g=1,y=0,m=1;switch(n){case e.ImageFitMode.Fill:u{this.Jz=!0,this.sV()})),this.uc.addEventListener("error",(()=>{this.Kz=!0})),this.uc.complete&&(this.Jz=!0,this.sV());else if(this.uc instanceof wt.HTMLVideoElement){const t=this;this.uc.addEventListener("canplay",(function(){t.jz=this.videoHeight,t.Xz=this.videoWidth,t.Jz=!0,t.sV()}),!0),this.uc.addEventListener("play",wy(this,!0,(()=>this.sV()))),this.uc.addEventListener("playing",wy(this,!0,(()=>this.sV()))),this.uc.addEventListener("pause",wy(this,!1)),this.uc.addEventListener("ended",wy(this,!1)),this.uc.readyState>=1&&(this.Xz=this.uc.videoWidth,this.jz=this.uc.videoHeight,this.$z=!this.uc.paused,this.Jz=!0,this.sV())}else this.Jz=!0,this.sV()}aE(t){0===this.tV.size&&this.Jz&&this.sV(),this.tV.add(t)}lE(t){this.tV.delete(t),0===this.tV.size&&this.unbindResources()}eV(t){this.qz.add(t),this.Qz&&(t(),this.hV(t))}hV(t){this.qz.delete(t)}sV(){if(this.Kz||this.Qz||!this.Jz)return;const t=this.CE.gl;if(!this.iV&&this.uc&&t){this.iV=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.iV),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.uc,o=this.Xz>0?this.Xz:n.width,h=this.jz>0?this.jz:n.height;t.texImage2D(t.TEXTURE_2D,e,i,s,r,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.Xz=o,this.jz=h,t.bindTexture(t.TEXTURE_2D,null)}this.Qz=!0,this.qz&&this.qz.forEach((t=>{t(),this.hV(t)}))}Ls(){const t=this.CE.gl;if(!this.Kz&&this.Qz&&this.iV){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.uc;n&&(t.bindTexture(t.TEXTURE_2D,this.iV),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}rV(){return this.iV}unbindResources(){return this.Qz&&(this.iV&&(this.CE.qR(this.iV),this.iV=null),this.Qz=!1),this}}class Ry extends Hr{constructor(t,e,i){super(t.ls,e,i),this.lv=!0,this.tv={},this.nv=p(Hn),this.Is=t,this.At=t.At}nV(){var t;return this.nv.u&&this.nv.C().type!==(null===(t=this.oV)||void 0===t?void 0:t.type)}pv(t){return this.lv=t,this}aV(t){return this.tv=t,this}}class Ey{constructor(t){this.RV=[],this.ZR=t}EV(t,e){((t,e,i,s)=>{const r=t.lV(),n=Math.round(Math.min(i.spread,10)*r),o=Math.round(Math.min(i.blur,10)*r),h={x:Math.round(i.offset.x*r),y:Math.round(i.offset.y*r)},a=t.uV(),l=t.cV(),u=t.dV(),c=t.fV(),d=t.AV();t.gV("disabled"),t.pv(!1),t.pV(!1);const f=e.yV(),g=n+o/2;((t,e,i,s)=>{const r=t.gl,n=t.lV(),o=t.mV();t.vV(r.FRAMEBUFFER,s.frameBuffer),r.bindRenderbuffer(r.RENDERBUFFER,s.depthBuffer),r.bindTexture(r.TEXTURE_2D,s.texture),r.clearDepth(1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT);const h=s.sizeDpr;t.SV(0,0,h.x,h.y),e.forEach((e=>{let s;if(e instanceof jr?s=e._M||e.Is.Pp():e instanceof Ry&&(s=e.Is.lx()),s){const e=s.x+i.left,r=s.y+i.bottom,o=Math.max(s.width-(i.left+i.right),0),h=Math.max(s.height-(i.bottom+i.top),0);t.xV(e*n,r*n,o*n,h*n)}else t.pV(!1);e.QL(2,0)})),t.vV(r.FRAMEBUFFER,o),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindTexture(r.TEXTURE_2D,null),t.pV(!1)})(t,s,{left:g+(h.x<0?-h.x:0),top:g+(h.y>0?h.y:0),right:g+(h.x>0?h.x:0),bottom:g+(h.y<0?-h.y:0)},f);let y=f;const m=n+o+5,p=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;iYe(r,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),r=ei(r,s))}while(s);e.push(r)}return e})(e.map((t=>{const e=t instanceof jr||t instanceof Ry?t.Is.bV(t):Ne;if(Ae(e))return Ne;const r={min:{x:Math.max(e.min.x-i.left,0),y:Math.max(e.min.y-i.bottom,0)},max:{x:Math.min(e.max.x+i.right,s.x),y:Math.min(e.max.y+i.top,s.y)}};return r.max.x<=r.min.x||r.max.y<=r.min.y?Ne:r})).filter((t=>!Ae(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=fi(t.min,s),i=fi(t.max,s),r=e,n=i;o[h+0]=e.x,o[h+1]=e.y,o[h+2]=r.x,o[h+3]=r.y,o[h+4]=i.x,o[h+5]=e.y,o[h+6]=n.x,o[h+7]=r.y,o[h+8]=i.x,o[h+9]=i.y,o[h+10]=n.x,o[h+11]=n.y,o[h+12]=i.x,o[h+13]=i.y,o[h+14]=n.x,o[h+15]=n.y,o[h+16]=e.x,o[h+17]=i.y,o[h+18]=r.x,o[h+19]=n.y,o[h+20]=e.x,o[h+21]=e.y,o[h+22]=r.x,o[h+23]=r.y,h+=24})),{vertexBuffer:t.MV(o),vertexCount:n}})(t,s,{left:m+(h.x<0?-h.x:0),top:m+(h.y>0?h.y:0),right:m+(h.x>0?h.x:0),bottom:m+(h.y<0?-h.y:0)},e._V()),x=e.yV(f,y),A=t.Mz(Ug["2D"],Ug.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),Ug.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r,n)=>{const o=t.gl,h=t.mV();t.vV(o.FRAMEBUFFER,i.frameBuffer),o.bindRenderbuffer(o.RENDERBUFFER,i.depthBuffer),o.bindTexture(o.TEXTURE_2D,i.texture),o.clearDepth(1),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),t.SV(0,0,i.sizeDpr.x,i.sizeDpr.y),t.wV(s,((h,a,l,u)=>(t.aE(s),n&&n(h),t.FV(h("uIsHighlighted"),0).TR(h("uHighlightColorOffset"),E).FV(h("uRenderEffectMask"),0).TV(h("uTexture"),e.texture,0).kV(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).kV(h("uScale"),i.uniforms.IV()).kV(h("uDisp"),i.uniforms.PV()).kV(h("uScaling"),[i.size.x,i.size.y]).kV(h("uTranslationAxis"),[0,0]).CV(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).Jy(o.TRIANGLES,r.vertexCount,0),!0))),t.vV(o.FRAMEBUFFER,h),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,y,x,A,p,((e,i,s,r)=>(t.kV(e("uOffsetPx"),[h.x,h.y]),!0))),y=x,t.pV(l),t.DV(d);const S=t.Mz(Ug["2D"],Ug.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),Ug.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r)=>{const n=t.gl,o={x:t.ls.oi().x,y:t.ls.oi().y};t.SV(0,0,o.x*t.lV(),o.y*t.lV());const h=lt.d2({scaleXYConstructor:Bi}).it(o).Vi(0,o.x).Oi(0,o.y),a=new Fy;a.BV(h),t.wV(i,((h,l,u,c)=>(t.aE(i),r&&r(h),t.FV(h("uIsHighlighted"),0).TR(h("uHighlightColorOffset"),E).FV(h("uRenderEffectMask"),0).TV(h("uTexture"),e.texture,0).kV(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).kV(h("uScale"),a.IV()).kV(h("uDisp"),a.PV()).kV(h("uScaling"),[o.x,o.y]).kV(h("uTranslationAxis"),[0,0]).CV(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).Jy(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,S,p,((e,s,r,n)=>(t.TV(e("uTextureFirstGlowPass"),x.texture,1).TR(e("uGlowColor"),i.color),!0))),t.SV(a.x,a.y,a.width,a.height),t.gV(u),t.pv(c),t.LV(p.vertexBuffer)})(this.ZR,this,e,t)}_V(){const t=this.ZR.ls.oi();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}yV(...t){const e=this.RV,i=this._V(),s={x:Math.ceil(i.x*this.ZR.lV()),y:Math.ceil(i.y*this.ZR.lV())},r=this.ZR.gl,n=e.find((e=>!t.includes(e)));if(n)return n.sizeDpr.x===s.x&&n.sizeDpr.y===s.y||(n.size=i,n.sizeDpr=s,r.bindTexture(r.TEXTURE_2D,n.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,s.x,s.y,0,r.RGBA,r.UNSIGNED_BYTE,null),r.bindRenderbuffer(r.RENDERBUFFER,n.depthBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,s.x,s.y),r.bindTexture(r.TEXTURE_2D,null),r.bindRenderbuffer(r.RENDERBUFFER,null),n.scale.it(i).Vi(0,i.x).Oi(0,i.y),n.uniforms.BV(n.scale)),n;const o=r.createTexture(),h=this.ZR.zV(),a=this.ZR.VV();r.bindTexture(r.TEXTURE_2D,o),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,s.x,s.y,0,r.RGBA,r.UNSIGNED_BYTE,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const l=this.ZR.mV();this.ZR.vV(r.FRAMEBUFFER,h),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,o,0),r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,s.x,s.y),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a),r.bindTexture(r.TEXTURE_2D,null),this.ZR.vV(r.FRAMEBUFFER,l),r.bindRenderbuffer(r.RENDERBUFFER,null);const u=lt.d2({scaleXYConstructor:Bi}).it(i).Vi(0,i.x).Oi(0,i.y),c=new Fy;c.BV(u);const d={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:u,uniforms:c};return e.push(d),d}Y(){[this.RV].forEach((t=>{t.forEach((t=>{this.ZR.OV(t.depthBuffer),this.ZR.NV(t.frameBuffer),this.ZR.qR(t.texture)})),t.length=0}))}}class ky{constructor(t,i,s,r,n=!0){this.GV=new My,this.WV=new Map,this.UV=new Map,this.YV=[],this.uz=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(wt.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.lv=!1,this.kV=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.HV=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.$V=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.XV=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.jV=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.ZV=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.TR=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.FV=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.QV=(t,e)=>(this.gl.uniform1i(t,e),this),this.TV=(t,e,i)=>{if(void 0===t)return this;if(e){const s=this.gl.TEXTURE0+i;return this.gl.activeTexture(s),this.gl.bindTexture(this.gl.TEXTURE_2D,e),this.gl.uniform1i(t,i),this}throw new xt("Could not bind a texture.")},this.JV=t=>(((t,i)=>{i===e.ImageFitMode.Tile?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE))})(this.gl,t),this),this.MV=(t,e=!1,i,s=Float32Array)=>{const r=t.length,n=this.KV(r,i);if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof s?t:new s(t),e?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),n)return n;throw new xt("Could not create vertex buffer")},this.qV=(t,e,i,s=Float32Array)=>{const r=i||this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,r),e&&e.length===t?this.gl.bufferData(this.gl.ARRAY_BUFFER,e instanceof s?e:new s(e),this.gl.STATIC_DRAW):(this.gl.bufferData(this.gl.ARRAY_BUFFER,new s(t),this.gl.STATIC_DRAW),e&&this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,e instanceof s?e:new s(e))),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),r)return r;throw new xt("Could not create vertex buffer")},this.tO=(t,e,i,s=Float32Array)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferSubData(this.gl.ARRAY_BUFFER,e*s.BYTES_PER_ELEMENT,i instanceof s?i:new s(i)),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.iO=(t,e,i=!1)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferData(this.gl.ARRAY_BUFFER,e,i?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.sO=(t,e)=>{const i=t.length,s=this.KV(i,e);if(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,s),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),s)return s;throw new xt("Could not create index buffer")},this.eO=t=>{const e=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof Float32Array?t:new Float32Array(t),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),e)return e;throw new xt("Could not create float buffer")},this.hO=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,2,this.gl.FLOAT,!1,0,0)),this),this.rO=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.vertexAttribPointer(t,3,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(t)),this),this.CV=(t,e,...i)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t);const s=i.length;let r=0;for(let t=0;t-1&&this.gl.enableVertexAttribArray(e)}let n=0;for(let t=0;t-1&&this.gl.vertexAttribPointer(e.location,e.size,this.gl.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),n+=e.size}if(void 0!==e)for(let t=0;t-1&&this.nO(s,e)}return this},this.oO=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.aO=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,4,this.gl.FLOAT,!1,0,0)),this),this.lO=(t,e,i)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(t),void 0!==i&&this.nO(t,i)),this),this.uO=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.cO=null,this.Jy=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.dO=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.fO=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.yz.ANGLE_instanced_arrays)return wt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.yz.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.AO=(t,e,i,s,r=this.gl.UNSIGNED_SHORT)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawElementsInstanced(t,e,r,i,s),this.gl1)){if(!this.gl1.yz.ANGLE_instanced_arrays)return wt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.yz.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.nO=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.yz.ANGLE_instanced_arrays)return wt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.yz.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.gO=(t,e,i,s=0)=>{const r=this.gl.TEXTURE0+s;this.gl.activeTexture(r);const n=this.mV();this.vV(this.gl.FRAMEBUFFER,e),this.gl.bindTexture(this.gl.TEXTURE_2D,i),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,i,0);const o=this.cV();o&&this.pV(!1),t(),o&&this.pV(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.vV(this.gl.FRAMEBUFFER,n)},this.Ot=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this),this.pO=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.aE=t=>(this.gl.useProgram(t.kE),this),this.yO=!1,this.mO=[],this.ls=t,this.mA=i,this.ls=t,this.gl=s.ctx,this.vO=s.antialias,this.SO=!!this.ls.hn.VE&&s.lineAntialias,this.mz=this.ls.hn.mz,this.xO=new Map,this.gl1=this.ls.hn.gl1,this.gl2=this.ls.hn.gl2,n&&(this.DV(!0),this.bO()),this.yz=this.ls.hn.yz,this.JR=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.eE=this.MO(),this.Mz=this.ls.hn.Mz,this._O=new Py(this),this.dE=this.ls.hn.dE,this.wO=new Ey(this),this.zE=this.ls.hn.zE,this.CO=this.MV([0,0,1,0,1,1,0,1]),this.kO=this.MV([0,0,1,0,0,1,0,1,1,0,1,1])}gV(t){return t!==this.TO&&(this.TO=t,"disabled"===t?this.gl.disable(this.gl.CULL_FACE):"cull-back"===t?(this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.BACK)):"cull-front"===t&&(this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.FRONT))),this}dV(){return this.TO||"disabled"}pv(t){return t!==this.lv&&(this.lv=t,t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)),this}fV(){return this.lv}FO(t){return this.uz=t,this}lV(){return this.uz}KV(t,e){let i;if(e){const s=this.xO.get(e);s&&s.size>=t&&s.size-t<1e6?i=e:this.LV(e)}return i||(i=this.gl.createBuffer(),this.xO.set(i,{size:t})),i}IO(t,e=this.gl.RGBA,i=!1,s,r,n=!1,o=this.gl.UNSIGNED_BYTE,h=e){const a=this.gl.createTexture();if(!a)throw new xt("Couldn't reserve Texture.");return this.gl.bindTexture(this.gl.TEXTURE_2D,a),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),t&&null===r?this.gl.texImage2D(this.gl.TEXTURE_2D,0,h,e,o,t):r&&this.gl.texImage2D(this.gl.TEXTURE_2D,0,h,r.x,r.y,0,e,o,t),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,s?this.gl.NEAREST:this.gl.LINEAR),i?(this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR_MIPMAP_LINEAR),this.gl.generateMipmap(this.gl.TEXTURE_2D)):this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,s?this.gl.NEAREST:this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),a}qR(t){this.gl.deleteTexture(t)}zV(){const t=this.gl.createFramebuffer();if(!t)throw new xt("Couldn't reserve Framebuffer.");return t}vV(t,e){this.cO=e,this.gl.bindFramebuffer(t,e)}mV(){return this.cO}NV(t){this.gl.deleteFramebuffer(t)}VV(){const t=this.gl.createRenderbuffer();if(!t)throw new xt("Couldn't reserve Render buffer.");return t}OV(t){this.gl.deleteRenderbuffer(t)}SV(t,e,i,s){return this.gl.viewport(t,e,i,s),this.PO&&t===this.PO.x&&e===this.PO.y&&i===this.PO.width&&s===this.PO.height||(this.PO={x:t,y:e,width:i,height:s}),this}uV(){return this.PO||{x:0,y:0,width:0,height:0}}xV(t,e,i,s){return this.pV(!0),this.gl.scissor(Math.max(t,0),Math.max(e,0),Math.max(i,0),Math.max(s,0)),this}pV(t){return t===this.DO||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.DO=t),this}DV(t){return t!==this.yO&&(this.yO=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}AV(){return this.yO}bO(t,e,i,s){return t?(void 0!==t&&void 0!==e&&(void 0!==i&&void 0!==s?this.gl.blendFuncSeparate(t,e,i,s):this.gl.blendFunc(t,e)),this):(this.gl.blendFuncSeparate(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA),this)}cV(){return void 0!==this.DO&&this.DO}wV(t,e){const i=new Ly(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}LV(t){t&&(this.gl.deleteBuffer(t),this.xO.delete(t))}BO(t,e,i){this.kV(t.uniform("uCenter"),e.center).kV(t.uniform("uDistance"),e.distance).$V(t.uniform("uBounds"),e.bounds).FV(t.uniform("uAspect"),e.aspectRatio);const s=i.getColorStops();if(s.length<2)throw new Error("Minimum two color stops required");for(let e=0;e=t)return this.NO.buffer;this.NO&&(this.LV(this.NO.buffer),this.NO=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.mO.splice(this.mO.indexOf(l),1)}))}$O(t,e,i,s,r,n,o,h){const a=this.gl,l=this.mV();this.vV(a.FRAMEBUFFER,t),a.readPixels(e,i,s,r,n,o,h),this.vV(this.gl.FRAMEBUFFER,l)}XO(t){const e=this.UV.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new xt("Couldn't reserve Texture.");this.gl.bindTexture(this.gl.TEXTURE_2D,e);const s=[];let r=255;for(let e=0;e{t-=1;for(let e=1;e<32;e<<=1)t|=t>>1;return t+1})(s.length);for(let e=s.length;e{})),this;this.FV(s("uMinValue"),i.min),this.FV(s("uMaxValue"),i.max)}return this}KO(t,i,s,r,n,o){const h=s&&s.getSource()||r&&r.uc,a=s?s.getFitMode():e.ImageFitMode.Stretch,l=t=>{t.texCoordsBuffer=this.MV(o(t.texture.Xz,t.texture.jz,a),!1,t.texCoordsBuffer)};if(h){let e=i;if((!i||h!==i.source)&&h){i&&(i.texture.lE(t),this.LV(i.texCoordsBuffer));const r=this.RO(h);r.aE(t);const n=s?s.getSourceMissingColor():ks.color;e={texture:r,source:h,texCoordsBuffer:this.MV([]),sourceMissingTexture:this.IO(new Uint8Array([n.getR(),n.getG(),n.getB(),n.getA()]),this.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{e&&h&&(l(e),this.ls.xs())}},r.eV(e.textureReadyCallback),l(e)}return e&&e.texture.Qz&&e.texture.Zz&&e.texture.$z&&(e.texture.Ls(),this.ls.xs()),n&&e&&e.texture.Qz&&l(e),e}i&&this.qO(t,i)}qO(t,e){e&&(e.texture.lE(t),e.texture.hV(e.textureReadyCallback),this.qR(e.sourceMissingTexture),this.LV(e.texCoordsBuffer))}tN(t,e,i,s){const{uniform:r,uniformOptional:n,attribute:o}=t,h=i.At,a=this.lV();this.FV(r("uIsHighlighted"),1===e||2===e?0:i.Yo).TR(r("uHighlightColorOffset"),1===e||2===e?k:i.jo).FV(r("uRenderEffectMask"),2===e?1:0).kV(n("uRatioPxClip"),[2/this.ls.oi().x,2/this.ls.oi().y]).FV(n("uDevicePixelRatio"),a),h instanceof Bi||h instanceof Bc?this.kV(r("uScale"),s.uniforms.IV()).kV(r("uDisp"),s.uniforms.PV()).kV(n("uScaleStart_highpart"),s.uniforms.iN()).kV(n("uScaleStart_lowpart"),s.uniforms.sN()):h instanceof zi&&this.kV(n("uScaleStart"),s.uniforms.MixedScaleXY.uScaleStart).kV(n("uScaleStartLog"),s.uniforms.MixedScaleXY.uScaleStartLog).kV(n("uScaleInterval"),s.uniforms.MixedScaleXY.uScaleInterval).kV(n("uScaleIntervalLog"),s.uniforms.MixedScaleXY.uScaleIntervalLog).kV(r("uViewportStart"),s.uniforms.MixedScaleXY.uViewportStart).kV(r("uViewportSize"),s.uniforms.MixedScaleXY.uViewportSize);const l=!0===s.coordsHighPrecision;if(s.coordsX)if(l){const t=o("aPos_highpartX"),e=o("aPos_lowpartX");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.coordsX),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(e,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,1*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(e)}else this.lO(o("aPosX"),s.coordsX);if(s.coordsY)if(l){const t=o("aPos_highpartY"),e=o("aPos_lowpartY");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.coordsY),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(e,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,1*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(e)}else this.lO(o("aPosY"),s.coordsY);if(1===e)this.QV(r("uFirstId"),s.idFirst);else{if(s.fillStyleSolid&&this.TR(r("uColor"),s.fillStyleSolid.getColor()),s.fillStylePaletted){if("value"===s.fillStylePaletted.getLookUpProperty()&&null!==s.lookupValueBuffer){if(!s.lookupValueBuffer)return!1;const t=o("aLookupValue");this.lO(t,s.lookupValueBuffer),void 0!==s.lookupValueAttribDivisor&&this.nO(t,s.lookupValueAttribDivisor)}this.JO(t,s.fillStylePaletted.lut,s.lookupValueRange)}if(s.fillStyleLinearGradient){if(!s.linearGradientInfo)return!1;this.LO(t,s.linearGradientInfo,s.fillStyleLinearGradient)}if(s.fillStyleRadialGradient){if(!s.radialGradientInfo)return!1;this.BO(t,s.radialGradientInfo,s.fillStyleRadialGradient)}if(s.fillStyleIndividual&&null!==s.colorBuffer){if(!s.colorBuffer)return!1;const t=o("aColor");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.colorBuffer),this.gl.vertexAttribPointer(t,4,this.gl.UNSIGNED_BYTE,!0,0,0),this.gl.enableVertexAttribArray(t),void 0!==s.colorAttribDivisor&&this.nO(t,s.colorAttribDivisor)}if(s.fillStyleImage){if(!s.texturedFillGLInfo)return!1;const t=s.texturedFillGLInfo&&s.texturedFillGLInfo.texture.rV();this.TR(n("uColor"),s.fillStyleImage.getSurroundingColor()).TV(r("uColorTexture"),t||s.texturedFillGLInfo.sourceMissingTexture,0).CV(s.texturedFillGLInfo.texCoordsBuffer,s.texCoordAttribDivisor,{location:o("aTextureCoord"),size:2}).JV(s.fillStyleImage.fitMode)}if(s.maskTexture){const t=s.maskTexture&&s.maskTexture.texture.rV();this.TV(r("uMaskTexture"),t||s.maskTexture.sourceMissingTexture,0).CV(s.maskTexture.texCoordsBuffer,s.maskTextureCoordsAttribDivisor,{location:o("aMaskTextureCoord"),size:2})}}return void 0!==s.useInstanceID&&this.YO(t,s.useInstanceID),void 0!==s.useVertexID&&this.WO(t,s.useVertexID),!0}eN(t,e,i){if(t)return vy(i||e.qo(),e.At,t.getAngle(!0),this.lV())}hN(t,e,i){if(t)return Sy(i||e.qo(),e.At,t.getPosition(),t.getExtent(),t.getShape(),this.lV())}}const Iy=async(t,e,i,s,r,n,o)=>{const h=t.fenceSync(t.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),((t,e,i)=>{const s=void 0!==i.flags?i.flags:0,r=void 0!==i.retryTimeout?i.retryTimeout:10;return new Promise(((i,n)=>{const o=()=>{const h=t.clientWaitSync(e,s,0);return h===t.WAIT_FAILED?n(new Error(`WebGL Sync WAIT_FAILED ${t.getError()}`)):h!==t.TIMEOUT_EXPIRED?i(void 0):void wt.setTimeout(o,r)};wt.setTimeout(o,0)}))})(t,h,{retryTimeout:10}).then((()=>(t.deleteSync(h),t.bindBuffer(e,i),t.getBufferSubData(e,s,r,n,o),t.bindBuffer(e,null),r))).catch((t=>{throw t}))};class Fy{BV(t){if(t instanceof Bi||t instanceof Bc){const e=t.mi();this.rN=e.x.scaling,this.nN=-e.x.displacement,this.oN=e.y.scaling,this.aN=-e.y.displacement,this.lN=e.x.highPrecisionOffset,this.uN=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.cN=e.y.highPrecisionOffset,this.dN=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof zi&&(this.MixedScaleXY=t.mi());return this}PV(){return[this.nN,this.aN]}IV(){return[this.rN,this.oN]}iN(){return[this.lN,this.cN]}sN(){return[this.uN,this.dN]}}class Dy{constructor(){this.rN=0,this.oN=0,this.fN=0,this.nN=0,this.aN=0,this.AN=0}gN(t){return this.rN=t.rt(),this.nN=t.getInnerStart()+.5*this.rN*t.nt(),this}pN(t){return this.oN=t.rt(),this.aN=t.getInnerStart()+.5*this.oN*t.nt(),this}yN(t){return this.fN=t.rt(),this.AN=t.getInnerStart()+.5*this.fN*t.nt(),this}IV(){return[this.rN,this.oN,this.fN]}PV(){return[this.nN,this.aN,this.AN]}mN(t,e,i,s,r){const n=u(2*(t-i.x)/(i.width-i.x)-1,2*(e-i.y)/(i.height-i.y)-1),o=Ay.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class Py{constructor(t){this.ZR=t}QL(t,e,i,s,r,n=0){const o=this.ZR,h=void 0===s;if(!(s=s||o.zV()))throw new xt("Could not bind a framebuffer.");const a=o.uV(),l=o.AV();o.DV(!1),o.gO((()=>{o.SV(0,0,i.x,i.y),t()}),s,e,n),h&&o.NV(s),this.ZR.pO(r),this.ZR.SV(a.x,a.y,a.width,a.height),o.DV(l)}}class Ly{constructor(t,e){this.vN=[],this.SN=[],this.uniform=t=>{const e=this.shader.PE(t);return this.SN.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.DE(t);return this.SN.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.BE(t);return this.vN.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.vN)this.glUtils.oO(t.location),this.glUtils.nO(t.location,0)}}class Vy extends jr{constructor(t,e,i,s,r){super(t,e,i,s),this.xN=new Map,this.bN=t,this.MN=e,this.ZR=t._N(),this.wN=r,this.MN=e}KR(){return this}QL(t,e){if(!this.wN||0!==t||0===this.xN.size)return{};const i=Array.from(this.xN.values()).map((t=>t.CN.filter((t=>t.kN)).map((t=>t.qi)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===i.length)return{};const s=this.wN;return this.ZR.wO.EV(i,s),{}}TN(t,e,i,s,r){return{}}Ls(){return this}St(){return 0}vt(){return 0}bt(){return 0}xt(){return 0}Cl(){return 0}kl(){return 0}es(t,e){const i={CN:[]},s=(t,e)=>{const s={qi:t||[],kN:void 0===e||e};i.CN.push(s);const r={fs:t=>(s.qi=t,r),Ss:t=>(s.kN=t,r),bs:()=>s.kN};return r},r={};Object.keys(e).forEach((t=>{const i=e[t],n=i.shapes||[],o=void 0===i.themeEffectEnabled||i.themeEffectEnabled,h=s(n,o);r[t]=h}));const n={wg:s,...r};this.xN.set(t,i);const o=t.onDispose((()=>{this.xN.delete(t),t.offDispose(o)}));return n}}function _y(t,e,i,s,r,n=Math.floor(Math.sqrt(s>r?25*s:25*r))){const o=Array(n+2),h=Math.PI;let a=0,l=0;const c=e*h/180,d=(i*h/180-c)/n;for(o[a]=u(t.x,t.y),a+=1;a<=n+1;)o[a]=u(t.x+s*Math.cos(c+l*d),t.y+r*Math.sin(c+l*d)),a+=1,l+=1;return[o,n]}const By=(t,e,i)=>((t,e,i)=>{const s=[];let r=0;const n=li(e,i/2);let o,h,a,l,c=t[t.length-1],d=0;for(let i=0;i0&&(c=t[i-1]),Ct(o,c)&&(c=ui(o,oi(li(ci(h,o),-1)))),Ct(o,h)&&(h=ui(o,oi(li(ci(c,o),-1))));const f=fi(c,e),g=fi(o,e),y=fi(h,e),m=oi(ci(g,f)),p=oi(ci(y,g)),x=ui(m,p),A=u(-x.y,x.x),S=u(-m.y,m.x),v=1/yi(A,S),b=ai(A),M=oi(ci(m,p)),w=Math.sign(yi(A,M))||1,C=di(A,li(n,v)),T=di(A,li(n,-v));if(b<1||v===1/0){let t={x:0,y:0},e={x:0,y:0},i={x:0,y:0},a={x:0,y:0};const l=u(-p.y,p.x),f=Math.sign(yi(m,A))||w,g=di(S,li(n,f)),y=di(l,li(n,f));1===w?(t=g,e=T,i=y,a=T):(t=C,e=g,i=C,a=y);const x=4*Ke(c,o),b=4*Ke(o,h);(v>x||v>b)&&(1===w?(t=g,e=y,i=y,a=g):(t=y,e=g,i=g,a=y));const M=ui(o,t),R=ui(o,e),E=ui(o,i),k=ui(o,a);s[r]=M,r+=1,s[r]=R,r+=1,s[r]=E,r+=1,s[r]=k,r+=1,d=4}else{const t=ui(o,C),e=ui(o,T);s[r]=t,r+=1,s[r]=e,r+=1,d=2}l=a,a=t[i]}return s[r]=s[0],r+=1,s[r]=s[1],r+=1,[s,d,[l,a]]})(t,e,i)[0];class zy extends un{constructor(t,e,i,s,r){super(t,e,i,s,r),this._E=new Fy,this.FN=Ne,this.IN=Ne,this.PN=dg({arcStyleSolid:()=>Y(this.we)&&this.we,arcStyleRadialGradient:()=>tt(this.we)&&this.we,arcStyleLinearGradient:()=>st(this.we)&&this.we}),this.bN=t,this.MN=e,this.ZR=t._N()}DN(t,e){let i=0,s=Array(0),r=0;if(void 0!==e){const r=t.length,n=Array(r+e.length);let o=0,h=0;for(;o0?_y(this.ma.C(),this.Xl.C(),this.Fi.C(),this.jl.C()*l/100,this.Zl.C()*l/100,a)[0]:[this.ma.C()],d=h.length-1;if(2===d){const t=(h[d-1].x+h[1].x)/2,e=(h[d-1].y+h[1].y)/2;this.Kl=u(t,e)}else{const t=Math.floor(d/2);this.Kl=u(h[t].x,h[t].y)}this.ql=h[1];const f=h.length-1;this.tu=h[f],this.Ql.C()&&(h.shift(),c.shift());let g=!1;(this.ma.u||this.Xl.u||this.Fi.u||this.jl.u||this.Zl.u||this.Ql.u||this.Jl.u||s)&&(this.IN=y(u(this.za().x-n,this.za().y-o),u(this.za().x+n,this.za().y+o)),g=!0,this.ma.u=!1,this.Xl.u=!1,this.Fi.u=!1,this.jl.u=!1,this.Zl.u=!1,this.Ql.u=!1,this.Jl.u=!1);const m=this.aa();(g||m)&&this.we!==B&&(this.Ql.C()?(this.RN&&this.ZR.LV(this.RN),[this.EN,this.RN,this.zN,this.VN]=this.DN(h,c)):(this.RN&&this.ZR.LV(this.RN),[this.EN,this.RN,this.zN,this.VN]=this.DN(h,void 0)),tt(this.we)?this.ON=Sy(this.IN,this.At,this.we.getPosition(),this.we.getExtent(),this.we.getShape(),this.ZR.lV()):st(this.we)?this.NN=vy(this.IN,this.At,this.we.getAngle(!0),this.ZR.lV()):(this.ON=void 0,this.NN=void 0));const p=this.PN.arcStyleSolid(m),x=this.PN.arcStyleLinearGradient(m),A=this.PN.arcStyleRadialGradient(m),S=p||x||A;m&&(this.GN=S?this.ZR.Mz(Ug["2D"],Ug.Color({dataType:tt(this.we)||st(this.we)?["gradient",this.we]:"uniform"}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0,this.da(this.we));const v=this.Ce;if(ts(v)&&(g||this.ga(v.getThickness())||s)){this.Ql.C()?360===i?(h.pop(),c.pop(),[this.WN,this.UN]=this.LN(h,void 0,v.getThickness(),r),this.YN&&this.WN?this.ZR.iO(this.YN,this.WN,!0):!this.YN&&this.WN?this.YN=this.ZR.MV(this.WN,!0):this.YN&&!this.WN&&(this.ZR.LV(this.YN),this.YN=void 0),[this.HN,this.$N]=this.LN(c,void 0,v.getThickness(),r),this.XN&&this.HN?this.ZR.iO(this.XN,this.HN,!0):!this.XN&&this.HN?this.XN=this.ZR.MV(this.HN,!0):this.XN&&!this.HN&&(this.ZR.LV(this.XN),this.XN=void 0)):([this.WN,this.UN]=this.LN(h,c,v.getThickness(),r),this.YN&&this.WN?this.ZR.iO(this.YN,this.WN,!0):!this.YN&&this.WN?this.YN=this.ZR.MV(this.WN,!0):this.YN&&!this.WN&&(this.ZR.LV(this.YN),this.YN=void 0),this.HN&&(this.XN&&this.ZR.LV(this.XN),this.XN=void 0,this.$N=0)):(360===i&&(h.shift(),h.pop()),[this.WN,this.UN]=this.LN(h,void 0,v.getThickness(),r),this.YN&&this.WN?this.ZR.iO(this.YN,this.WN,!0):!this.YN&&this.WN?this.YN=this.ZR.MV(this.WN,!0):this.YN&&!this.WN&&(this.ZR.LV(this.YN),this.YN=void 0));const t=v.getFillStyle();tt(t)?this.jN=Sy(this.IN,this.At,t.getPosition(),t.getExtent(),t.getShape(),this.ZR.lV()):st(t)?this.ZN=vy(this.IN,this.At,t.getAngle(!0),this.ZR.lV()):(this.jN=void 0,this.ZN=void 0),this.QN=t===B?void 0:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:tt(t)||st(t)?["gradient",t]:"uniform"}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})),this.pa(v)}if(g){let t=1,e=1;ts(v)&&(t=v.getThickness()*r.x,e=v.getThickness()*r.y),this.FN=y(u(this.IN.min.x-t,this.IN.min.y-e),u(this.IN.max.x+t,this.IN.max.y+e))}this.JN=e&&S?this.JN||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0,this.KN=e&&this.Ce!==nt?this.KN||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0}return this}QL(t,e){if(this.ca()){const i=1===t?this.JN:this.GN,s=this.we,r=this.RN;i&&r&&this.ZR.aE(i).wV(i,((i,n,o,h)=>{if(this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(h("uScaleStart_highpart"),this._E.iN()).kV(h("uScaleStart_lowpart"),this._E.sN()).zO(o,r,this.At._i(),void 0).FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),1===t)this.ZR.QV(i("uFirstId"),e).YO(o,1);else if(Y(s))this.ZR.TR(i("uColor"),s.getColor());else if(tt(s)){if(!this.ON)return!1;this.ZR.BO(o,this.ON,s)}else if(st(s)){if(!this.NN)return!1;this.ZR.LO(o,this.NN,s)}return this.ZR.Jy(this.VN,this.zN),!0}));const n=this.Ce;ts(n)&&(void 0!==this.YN&&this.qN(t,this.YN,this.UN,n,e),void 0!==this.XN&&this.qN(t,this.XN,this.$N,n,e))}return{idCount:1}}TN(t,e,i,s,r){return{}}qN(t,e,i,s,r){const n=1===t?this.KN:this.QN,o=s.getFillStyle();n&&this.ZR.aE(n).wV(n,((n,h,a,l)=>{if(this.ZR.kV(n("uScale"),this._E.IV()).kV(n("uDisp"),this._E.PV()).zO(a,e,this.At._i(),void 0).FV(n("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(n("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(n("uRenderEffectMask"),2===t?1:0),1===t)this.ZR.QV(n("uFirstId"),r).YO(a,1);else if(Y(o))this.ZR.TR(n("uColor"),o.getColor());else if(tt(o)){if(!this.jN)return!1;this.ZR.BO(a,this.jN,o)}else if(st(o)){if(!this.ZN)return!1;this.ZR.LO(a,this.ZN,o)}const u=s.getThickness(),c=-1===u||1===u;return this.ZR.Jy(c?this.ZR.gl.LINE_LOOP:this.ZR.gl.TRIANGLE_STRIP,i),!0}))}KR(){return this.tG&&(this.ZR.LV(this.tG),this.tG=void 0),this.iG&&(this.ZR.LV(this.iG),this.iG=void 0),this.RN&&(this.ZR.LV(this.RN),this.RN=void 0),this.YN&&(this.ZR.LV(this.YN),this.YN=void 0),this.XN&&(this.ZR.LV(this.XN),this.XN=void 0),this.GN=void 0,this.QN=void 0,this.JN=void 0,this.KN=void 0,this}St(){return this.IN.max.x}vt(){return this.IN.min.x}bt(){return this.IN.max.y}xt(){return this.IN.min.y}Cl(){return Te(this.Ce)}kl(){return Te(this.Ce)}}class Ny{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}sG(t){return this.first=t,this.second=t+1,this.third=t+2,this.fourth=t+3,this.fifth=t+4,this.sixth=t+5,t+=6,this}eG(){return this.first=this.second,this.second=this.third,this.third=this.fourth,this.fourth=this.fifth,this.fifth=this.sixth,this.sixth+=1,this}hG(){return this.first=this.third,this.second=this.fourth,this.third=this.fifth,this.fourth=this.sixth,this.fifth=this.fourth+1,this.sixth=this.fifth+1,this}rG(t){const e=t.buffer;let{position:i}=t;return e[i]=this.first,e[i+1]=this.second,e[i+2]=this.third,i+=3,t.position=i,t.next&&this.eG(),this}nG(t){const e=t.buffer;let{position:i}=t;return e[i]=this.first,e[i+1]=this.third,e[i+2]=this.second,e[i+3]=this.third,e[i+4]=this.fourth,e[i+5]=this.second,i+=6,t.position=i,t.next&&this.hG(),this}oG(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new Ny).sG(t))(),Uy=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||Oy.eG(),n.push(t,e),r.push(Oy.first,Oy.second,Oy.third),h=void 0,o=void 0,r.push(Oy.third,Oy.fourth,Oy.second),a=Oy.third,Oy.hG(),l&&n.push(i,s),[o,h,a]),Yy=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||Oy.eG(),o.push(t,e),r.push(Oy.first,Oy.second,Oy.third);const c=vi(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(Oy.third,Oy.fourth,Oy.fifth),l=Oy.fourth),Oy.hG(),u&&o.push(i,s),[h,a,l]},Gy=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||Oy.eG(),r.push(t,e),s.push(Oy.first,Oy.second,Oy.third),n=i,o=void 0,h=Oy.third,l?r.push(i):a=!0,[n,o,h,a]),Xy=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||Oy.eG(),Oy.eG()):a>0&&(Oy.eG(),u>0&&(u-=1)),n.push(t),r.push(Oy.first,Oy.second,Oy.third),a=Oy.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),Zy=(t,e=0)=>{Oy.sG(e);const[i,s]=t,r=i.length,n=[],o=[],h=[];let a,l,u=e,c=0,d=i[c],f=s[c],g=i[c],y=s[c],m=!1,p=u>0?g.y!==y.y?2:1:0;if(r>1)for(;cy.y?d.y>f.y?[a,l,u]=Uy(g,y,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=Yy(g,y,d,f,o,n,h,a,l,u,t):[a,l,u,m]=Gy(g,y,d,o,h,a,l,u,m,t):d.y===f.y?(a=g,m&&(h.push(g),m=!1,Oy.eG()),0===h.length&&u>0&&p>0&&(p-=1)):d.y>f.y?[a,l,u,p]=Xy(g,0,d,f,n,h,a,l,u,t,p):[a,l,u,p]=Xy(g,0,d,f,o,h,a,l,u,t,p)}return[h,new Uint16Array(n),new Uint16Array(o),u,p]};class Hy extends ln{constructor(t,e,i,s,r){super(t,e,i,s,r),this._E=new Fy,this.lG=0,this.Xa=Array(),this.uG=0,this.cG=new Uint16Array(0),this.dG=new Uint16Array(0),this.PN=dg({hightFillSolid:()=>Y(this.we)&&this.we,hightFillRadialGradient:()=>tt(this.we)&&this.we,hightFillLinearGradient:()=>st(this.we)&&this.we,hightFillPaletted:()=>H(this.we)&&this.we,lowFillSolid:()=>Y(this.Ll)&&this.Ll,lowFillRadialGradient:()=>tt(this.Ll)&&this.Ll,lowFillLinearGradient:()=>st(this.Ll)&&this.Ll,lowFillPaletted:()=>H(this.Ll)&&this.Ll}),this.bN=t,this.MN=e,this.ZR=t._N()}Ls(){const t=this.ua(),e=this.No.C(),i=this.el;if(this.ca()){this._E.BV(this.At);const s=this.At instanceof zi==0,r=s?this.At.Wi():void 0,n=this.Vl(),o=this.At.Ni()||t,h=i||this.Il.u||o&&"disabled"!==n.type;if(h){if(this.lG=0,this.cG=new Uint16Array(0),this.dG=new Uint16Array(0),this.Xa.length=0,this.uG=0,this.Pl>1){const[t,e,i,o]=Zy([s?n.packager(this.Tl,r,.5):this.Tl,s?n.packager(this.Fl,r,.5):this.Fl]);this.lG=o,this.cG=e,this.dG=i,this.Xa=t,this.uG=t.length}this.Il.u=!1}if(this.Bl&&this.tl[0].length>1){const[t,e]=this.tl,i=t.length,[o,h,a,l,u]=Zy([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.lG);this.lG=l;const c=o.length;for(let t=u;t0||this.Pl>0?1:u;s{if(this.ZR.zO(h,i,this.At._i(),void 0).uO(n).FV(r("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(r("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(r("uRenderEffectMask"),2===t?1:0),this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(r("uScale"),this._E.IV()).kV(r("uDisp"),this._E.PV()).kV(a("uScaleStart_highpart"),this._E.iN()).kV(a("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(a("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(a("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(a("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(a("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(r("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(r("uViewportSize"),this._E.MixedScaleXY.uViewportSize),1===t)this.ZR.QV(r("uFirstId"),e).YO(h,1);else if(Y(s))this.ZR.TR(r("uColor"),s.getColor());else if(tt(s)){if(!this.gG)return!1;this.ZR.BO(h,this.gG,s)}else if(st(s)){if(!this.pG)return!1;this.ZR.LO(h,this.pG,s)}else if(H(s)){const t=fg(s,this,void 0);if(!t&&s.lut.percentageValues)return!1;this.ZR.JO(h,s.lut,t)}return this.ZR.dO(this.xG),!0}))}const n=1===t?this.JN:this.fG;if(n&&this.yG&&this.mG){const s=this.yG,r=this.mG;this.ZR.aE(n).wV(n,((n,o,h,a)=>{if(this.ZR.zO(h,s,this.At._i(),void 0).uO(r).FV(n("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(n("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(n("uRenderEffectMask"),2===t?1:0),this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(n("uScale"),this._E.IV()).kV(n("uDisp"),this._E.PV()).kV(a("uScaleStart_highpart"),this._E.iN()).kV(a("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(a("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(a("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(a("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(a("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(n("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(n("uViewportSize"),this._E.MixedScaleXY.uViewportSize),1===t)this.ZR.QV(n("uFirstId"),e).YO(h,1);else if(Y(i))this.ZR.TR(n("uColor"),i.getColor());else if(tt(i)){if(!this.ON)return!1;this.ZR.BO(h,this.ON,i)}else if(st(i)){if(!this.NN)return!1;this.ZR.LO(h,this.NN,i)}else if(H(i)){const t=fg(i,this,void 0);if(!t&&i.lut.percentageValues)return!1;this.ZR.JO(h,i.lut,t)}return this.ZR.dO(this.vG),!0}))}return{idCount:1}}TN(t,e,i,s,r){return{}}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return 0}kl(){return 0}Qb(t){this.Al()>0&&this.Ls();const[e,i]=this.nl(),s=e.length>2&&e[1].x0&&this.Ls();const[e,i]=this.nl(),s=e.length;if(0===s)return;const r=this.Rl?1:0,n=s-(this.El?2:1),o=e.length>2&&e[1].x{const i=1===e?.5*Math.PI:1.5*Math.PI;for(let s=0;s<=this.bG;s+=1){const r=i-s*Math.PI/this.bG;t.push(.5*Math.cos(r),.5*Math.sin(r),e,0)}})),t.push(0,0,1,1),t.push(0,0,0,1);const e=t.length/4,i=[];for(let t=0;t((t,e)=>{let i=t.GV.Oz.get(e);return i||(i=new Wy(t,e),t.GV.Oz.set(e,i),i)})(t,i?e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2:1),Ky={TG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),a=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.nO(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.nO(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.nO(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.nO(a,1),h.enableVertexAttribArray(a)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.nO(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.nO(i,1),h.enableVertexAttribArray(i)}},FG:(t,e,i,s,r,n,o)=>{const h=t.gl;h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(s,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.nO(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.nO(r,1),h.enableVertexAttribArray(r)},IG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),a=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.nO(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.nO(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.nO(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.nO(a,1),h.enableVertexAttribArray(a)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.nO(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.nO(i,1),h.enableVertexAttribArray(i)}},PG:(t,e,i,s,r,n,o)=>{const h=t.gl;h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(s,n,h.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.nO(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.nO(r,1),h.enableVertexAttribArray(r)},QL:(t,e,i,s,r,n,o)=>{const h=t._N(),{uniform:a,uniformOptional:l}=i,u=1/t.Qn.qn,c=(r?Math.max(n,u):Math.max(n,0))+1;h.FV(a("uThicknessPixels"),c).FV(l("uAALimit"),1-(c-1)/c).kV(a("uRatioPxClip"),[2/t.oi().x,2/t.oi().y]),e.aE(i,s).Jy(o)}},$y={TG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aPos_highpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t);const e=o("aPos_lowpart");h.vertexAttribPointer(e,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(e)}else{const t=o("aPos");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t)}},FG:(t,e,i,s,r,n)=>{const o=t.gl;o.bindBuffer(o.ARRAY_BUFFER,i),o.vertexAttribPointer(s,r,o.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),o.enableVertexAttribArray(s)},IG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aPos_highpart"),e=o("aPos_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t),h.vertexAttribPointer(e,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(e)}else{const t=o("aPos");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t)}},DG:(t,e)=>{const i=t._N();i.Jy(i.gl.LINE_STRIP,e,0)},BG:(t,e)=>{const i=t._N();i.Jy(i.gl.LINES,2*e,0)}};class Qy extends fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this._E=new Fy,this.Ka=Ne,this.PN=dg({lineStyleSolid:()=>ts(this.gu)&&this.gu,lineStyleDashed:()=>so(this.gu)&&this.gu,strokeFillSolid:()=>{const t=this.gu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.gu.getFillStyle();return st(t)&&t},strokeFillRadialGradient:()=>{const t=this.gu.getFillStyle();return tt(t)&&t},strokeFillPaletted:()=>{const t=this.gu.getFillStyle();return H(t)&&t}}),this.bN=t,this.MN=e,this.ZR=t._N(),this.LG=this.ZR.SO}Ls(){const t=this.fa(),e=this.gu,i=this.PN.lineStyleSolid(t),s=this.PN.lineStyleDashed(t),r=i||s,n=this.PN.strokeFillSolid(t),o=this.PN.strokeFillLinearGradient(t),h=this.PN.strokeFillRadialGradient(t),a=this.PN.strokeFillPaletted(t),l=n||o||h||a&&["x","y"].includes(a.getLookUpProperty())&&a,c=this.Ii(),d=this.Ti(),f=this.No.C(),g=this.No.u,m=e.N();if(s&&this.At instanceof zi)return wt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this._E.BV(this.At),this.Su&&(this.EG=this.ZR.MV(Jt([c,d],this.At._i()),!1,this.EG),this.Ka=y(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.ca()&&r&&l&&m>0,e=o?["gradient",o]:h?["gradient",h]:a?["lookup",a.getLookUpProperty(),a.lut]:"uniform";this.zG=t?{type:"triangulated",shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0}),this.LG?Ug.AliasedEdge:void 0,s&&Ug.StippleTextureInstanced),mousePickingShader:f?this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0}),s&&Ug.StippleTextureInstanced):void 0,geometry:jy(this.ZR,m),thickness:m,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}:void 0}if(h?this.jN=Sy($r(this.Ka,{x:this.Cl(),y:this.kl()},this.At),this.At,h.getPosition(),h.getExtent(),h.getShape(),this.ZR.lV()):o?this.ZN=vy($r(this.Ka,{x:this.Cl(),y:this.kl()},this.At),this.At,o.getAngle(!0),this.ZR.lV()):(this.jN=void 0,this.ZN=void 0),s){if(t||this.Su){const t=[0,0,Math.abs(d.x-c.x),Math.abs(d.y-c.y)];this.VG=this.ZR.MV(t,!1,this.VG)}this.OG=this.ZR.XO(s.getPattern())}else this.VG&&(this.ZR.LV(this.VG),this.VG=void 0),this.OG=void 0;return this.vu(e),this.Su=!1,this.No.u=!1,this}QL(t,e){var i,s;const r=this.EG;if(!r)return{};const n=this.zG;if(!n)return{};const{fillStyleSolid:o,fillStyleLinearGradient:h,fillStyleRadialGradient:a,fillStylePaletted:l,lineStyleDashed:u,thickness:c}=n,d=1===t?null===(i=this.zG)||void 0===i?void 0:i.mousePickingShader:null===(s=this.zG)||void 0===s?void 0:s.shader;return d?(this.ZR.aE(d).wV(d,((i,s,d,f)=>{if(this.ZR.FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(f("uScaleStart_highpart"),this._E.iN()).kV(f("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(f("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(f("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(f("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(f("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(i("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(i("uViewportSize"),this._E.MixedScaleXY.uViewportSize),1===t)this.ZR.QV(i("uFirstId"),e).YO(d,1);else if(o)this.ZR.TR(i("uColor"),o.getColor());else if(a){if(!this.jN)return!1;this.ZR.BO(d,this.jN,a)}else if(h){if(!this.ZN)return!1;this.ZR.LO(d,this.ZN,h)}else if(l){const t=fg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.ZR.JO(d,l.lut,t)}if(u){if(!this.VG||!this.OG)return!1;Ky.FG(this.ZR,d,this.VG,s("aLengthSoFarA"),s("aLengthSoFarB"),2,0),this.ZR.kV(i("uStippleCount"),[this.ls.oi().x/this.OG.QO,this.ls.oi().y/this.OG.QO]).FV(f("uStippleTextureWidthLimiter"),this.OG.ZO/this.OG.QO).FV(i("uStippleScale"),u.getPatternScale()).TV(i("uStippleTexture"),this.OG.jO,1)}return Ky.TG(this.At._i(),this.ZR,r,d,this.At._i()?4:2,0),Ky.QL(this.bN,n.geometry,d,this.LG&&1!==t,1===t,c,1),!0})),{idCount:1}):{}}TN(t,e,i,s,r){return{}}dispose(){return super.dispose(),this.zG=void 0,this.EG&&(this.ZR.LV(this.EG),this.EG=void 0),this.VG&&(this.ZR.LV(this.VG),this.VG=void 0),this.OG=void 0,this}KR(){return this}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return Te(this.gu)}kl(){return Te(this.gu)}}class qy extends gn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.NG=[],this.GG=!1,this.WG=!1,this.UG=!1,this.YG=!1,this._E=new Fy,this.Ka=Ne,this.PN=dg({lineStyleSolid:()=>ts(this.gu)&&this.gu,lineStyleDashed:()=>so(this.gu)&&this.gu,lineFillSolid:()=>{const t=this.gu.getFillStyle();return Y(t)&&t},lineFillRadialGradient:()=>{const t=this.gu.getFillStyle();return tt(t)&&t},lineFillLinearGradient:()=>{const t=this.gu.getFillStyle();return st(t)&&t},lineIndividualPointFill:()=>{const t=this.gu.getFillStyle();return X(t)&&t}}),this.bN=t,this.MN=e,this.ZR=t._N(),this.LG=this.ZR.SO,this.HG=t.Qn.so}Hr(){const t={ps:e=>this.$G(t,e),us:e=>this.XG(t,e),Yg:(e,i)=>this.jG(t,e,i),TR:e=>this.ZG(t,e),Pi:{x:0,y:0},Fi:{x:0,y:0},Yo:0,QG:void 0,JG:this.NG.length};return this.NG.push(t),t}Ot(){var t;return this.NG.length=0,this.GG=!0,this.Ts&&this.En&&(null===(t=this.ls.Rn)||void 0===t?void 0:t.entity)===this&&this.En(this,void 0,this.ls.Rn.collectionMember),this}KG(){return this.NG.length}C(t){const e=this.NG[t];return[e.Pi,e.Fi]}_m(){return this.NG}kd(t){var e;const i=this.NG.indexOf(t);i>=0&&(this.NG.splice(i,1),this.GG=!0,this.Ts&&this.En&&(null===(e=this.ls.Rn)||void 0===e?void 0:e.entity)===this&&this.En(this,void 0,this.ls.Rn.collectionMember))}$G(t,e){if(e&&!this.NG.includes(t))t.JG=this.NG.length,this.NG.push(t);else if(!e){const e=this.NG.indexOf(t);this.NG.splice(e,1)}return this.UG=!0,t}XG(t,e){return t.Yo=e,this.WG=!0,t}jG(t,e,i){return t.Pi=e,t.Fi=i,this.GG=!0,t}ZG(t,e){return t.QG=e,this.YG=!0,t}Ls(){const t=this.No.C(),e=this.No.u,i=this.fa(),s=this.gu,r=this.NG,n=this.WG,o=this.GG,h=this.UG,a=this.YG,l=this.PN.lineStyleSolid(i),u=this.PN.lineStyleDashed(i),c=l||u,d=this.PN.lineFillSolid(i),f=this.PN.lineIndividualPointFill(i),g=this.PN.lineFillRadialGradient(i),y=this.PN.lineFillLinearGradient(i),m=d||f||y||g,p=s.N(),x=u?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(u&&this.At instanceof zi)return wt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this._E.BV(this.At);const A=o||h;if(A){const t=[];for(let e=0;e0&&e;this.zG=i?"triangulated"===x?{type:"triangulated",shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0,snapToNearestPixel:this.HG,ensureMinimumSegmentLength:void 0!==this.xu}),this.LG?Ug.AliasedEdge:void 0,u&&Ug.StippleTextureInstanced,Ug.AttributeHighlight),mousePicking:t?{shader:this.ZR.Mz(Ug["2D"],Ug.MousePicking({useAttribute:!0}),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0,snapToNearestPixel:this.HG,ensureMinimumSegmentLength:void 0!==this.xu}),u&&Ug.StippleTextureInstanced,Ug.AttributeHighlight)}:void 0,geometry:jy(this.ZR,p,!1),thickness:p,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:y,fillStyleRadialGradient:g}:{type:"primitive",shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0,snapToNearestPixel:this.HG}),Ug.AttributeHighlight),mousePicking:t?{shader:this.ZR.Mz(Ug["2D"],Ug.MousePicking({useAttribute:!0}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0,snapToNearestPixel:this.HG}),Ug.AttributeHighlight)}:void 0,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:y,fillStyleRadialGradient:g}:void 0}if(u){if(i||A){const t=new Float32Array(4*r.length);let e=0;for(let i=0;i{t[e]=i.Yo,e+=1})),this.qG=this.ZR.MV(t,!0,this.qG)}else{const t=new Float32Array(2*r.length);let e=0;r.forEach((i=>{for(let s=e;s{const s=i.QG||f.color;t[e]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=s.a,e+=4})),this.tW=this.ZR.MV(t,!1,this.tW)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{const s=i.QG||f.color;for(let i=e;i{t[e+0]=i.JG||0,e+=1})),this.iW=this.ZR.MV(t,!0,this.iW)}else{const t=new Float32Array(2*r.length);let e=0;r.forEach((i=>{for(let s=e;s{if(this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(y("uScaleStart_highpart"),this._E.iN()).kV(y("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(y("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(y("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(y("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(y("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(i("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(i("uViewportSize"),this._E.MixedScaleXY.uViewportSize),this.HG&&this.ZR.kV(y("uViewportSizePx"),[this.ls.oi().x*this.ZR.lV(),this.ls.oi().y*this.ZR.lV()]),void 0!==this.xu&&this.ZR.kV(i("uMinSegmentPixelVector"),[this.xu.x,this.xu.y]),this.ZR.TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),1===t){if(this.ZR.QV(i("uFirstId"),e),!n)return!1;"triangulated"===h?this.ZR.CV(n,1,{location:f("aPickingIdOffset"),size:1}):this.ZR.lO(f("aPickingIdOffset"),n)}else if(a)this.ZR.TR(i("uColor"),a.getColor());else if(l){if(!this.tW)return!1;this.ZR.CV(this.tW,"triangulated"===h?1:void 0,{location:f("aColor"),size:4})}else if(c){if(!this.ON)return!1;this.ZR.BO(g,this.ON,c)}else if(u){if(!this.NN)return!1;this.ZR.LO(g,this.NN,u)}if(d){if(!this.VG||!this.OG)return!1;Ky.PG(this.ZR,g,this.VG,f("aLengthSoFarA"),f("aLengthSoFarB"),2,0),this.ZR.kV(i("uStippleCount"),[this.ls.oi().x/this.OG.QO,this.ls.oi().y/this.OG.QO]).FV(y("uStippleTextureWidthLimiter"),this.OG.ZO/this.OG.QO).FV(i("uStippleScale"),d.getPatternScale()).TV(i("uStippleTexture"),this.OG.jO,0)}if("triangulated"===h){const{geometry:e,thickness:i}=o;Ky.IG(this.At._i(),this.ZR,s,g,this.At._i()?4:2,0),this.ZR.CV(r,1,{location:f("aIsHighlighted"),size:1}),Ky.QL(this.bN,e,g,this.LG&&1!==t,1===t,i,this.NG.length)}else $y.IG(this.At._i(),this.ZR,s,g,this.At._i()?4:2,0),this.ZR.lO(f("aIsHighlighted"),r),$y.BG(this.bN,this.NG.length);return!0})),{idCount:this.NG.length}):{}}dispose(){return super.dispose(),this.zG=void 0,this.EG&&(this.ZR.LV(this.EG),this.EG=void 0),this.VG&&(this.ZR.LV(this.VG),this.VG=void 0),this.qG&&(this.ZR.LV(this.qG),this.qG=void 0),this.iW&&(this.ZR.LV(this.iW),this.iW=void 0),this.tW&&(this.ZR.LV(this.tW),this.tW=void 0),this.OG=void 0,this}TN(t,e,i,s,r){return{collectionMember:this.NG.find((i=>e+i.JG===t))}}KR(){return this}us(t){super.us(t);for(const e of this.NG)e.us(t);return this}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return Te(this.gu)}kl(){return Te(this.gu)}}class Jy{constructor(t,e){this.sW=!1,this.eW=!1,this.hW=!1,this.At=t,this.rW=e,this.rW.Qo("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.sW="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.sW="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.eW=!0),!0===t.regularProgressiveStep&&(this.hW=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.sW?t[0].x:t[0].y,end:"x"===this.sW?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.sW?"x"===this.sW?function(t){const e=t.length;if(e>0){const i=Math.max(t[e-1].x,t[0].x),s=Math.min(t[e-1].x,t[0].x);let r=t[0].y,n=t[0].y;for(let i=0;ir&&(r=e.y),e.y0){const i=Math.max(t[e-1].y,t[0].y),s=Math.min(t[e-1].y,t[0].y);let r=t[0].x,n=t[0].x;for(let i=0;ir&&(r=e.x),e.x{!1===t.allowDataGrouping&&(this.nW=!0)}))}uW(t,e=!1){if(this.nW||!this.sW||"linear"!==this.lW.type)return!1;!1===e&&this.cW&&(clearTimeout(this.cW),this.cW=void 0);const i="x"===this.sW?this.lW.scale.x.ag:this.lW.scale.y.ag;if(!i)throw new Error("CP helper has no information about Axis state.");const s=t.length;if(s<2)return!1;const r=t[0],n=t[s-1],o=this.calculateAvgStepBetweenDataPoints("x"===this.sW?r.x:r.y,"x"===this.sW?n.x:n.y,s),h=this.lW.scale,a=Math.abs("x"===this.sW?h.Wi().x:h.Wi().y),l=a/o,u=Math.floor(l*tm),c=u*o,d=wt.performance.now(),f=!(d-i.ph<500)&&(i.lh?d-i.gh<1e3:d-i.uh<2e3||i.fh),g=s>2*this.oW.totalDataPointsAtTime;if(f&&!g)return this.cW=setTimeout((()=>this.dW(t)),1e3),!1;const y=u>=10,m=this.oW.enabled?this.oW.columnWidthAxis/a<1.5:void 0,p=this.oW.enabled&&u>this.oW.dataPointsPerColumn?u/this.oW.dataPointsPerColumn>=2:void 0;let x;!0===this.oW.enabled?m?p&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):x=y?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:y&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const A=!1===e;return x?(A&&(this.oW=x),!0):(A&&(this.oW={...this.oW,totalDataPointsAtTime:s}),!1)}fW(){this.AW=void 0,this.aW.length=0,this.cW&&(clearTimeout(this.cW),this.cW=void 0)}gW(t){if(0===t.length)return t;if(this.nW||!this.sW||"linear"!==this.lW.type||!this.oW.enabled)return t;let e;e=this.aW.length>0?he(this.aW,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.AW,h=-1,a=-1,l=0,u=0;if("x"!==this.sW||this.eW)if("x"===this.sW&&this.eW){const t=this.oW.columnWidthAxis;let c=this.AW?this.AW.x:e[0].x,d=c-t;for(let f=0;f=d?((!r||i.y>r.y)&&(r=i,h=f),(!n||i.y=d?((!r||i.x>r.x)&&(r=i,h=f),(!n||i.xr.x)&&(r=i,h=f),(!n||i.xr.y)&&(r=i,h=f),(!n||i.y0&&(this.AW=s[c-1]),s}pW(t){if(this.sW&&"linear"===this.lW.type){const e="x"===this.sW?this.lW.scale.x.ag:this.lW.scale.y.ag;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.hh===Os.progressive||e.hh===Os.regressive){const e=Math.abs("x"===this.sW?this.lW.scale.x.getInnerInterval():this.lW.scale.y.getInnerInterval());if(this.oW.enabled)return 2*e/this.oW.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.sW?s.x:s.y,"x"===this.sW?r.x:r.y,i)}}}yW(t,e,i){if(!this.sW)return e;const s=i.length;let r=Gr(i,t.min,this.sW,this.eW,0,s-1);void 0===r&&(r=this.eW?s-1:0);let n=Gr(i,t.max,this.sW,this.eW,0,s-1);return void 0===n&&(n=this.eW?0:s-1),1+Math.abs(n-r)}mW(){this.cW&&(clearTimeout(this.cW),this.cW=void 0)}dW(t){this.uW(t,!0)&&this.xs()}}class im extends Jy{renderVisibleOnly(t,e){const i=this.At.x.getInnerStart(),s=this.At.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.At.y.getInnerStart(),h=this.At.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);t.forEach(((t,i)=>{t.existingCoordinatesCount<=1||t.boundaries.max.xn||t.boundaries.max.yl||e(t)}))}}class sm{constructor(t,e,i){this.vW=e,this.SW=i,this.xW=t,this.bW=[]}MW(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.xW[this.xW.length-1];do{const t=this.xW.length;let r;h||(h=this._W(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.SW&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.xW[t-1].lastDataPoint;e?(n.splice(0,0,e),a=1,o+=1):console.error("SegmentationHelper _connectSegments = true, but segment has no lastDataPoint information!")}if(h)r=Math.min(o,h.allocatedCoordinatesCount-h.existingCoordinatesCount),s(h,n.slice(0,r),r,a);else{const t=Math.ceil(e)+a;r=Math.min(t,o);const s={...i(t,n.slice(0,r),r,a),isDropped:!1};this.xW.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.wW()}kW(t){const e=t,i=this.xW.indexOf(e);i>=0&&this.xW.splice(i,1),e.droppedTimestamp=wt.performance.now(),this.bW.push(e)}TW(){this.xW.slice().forEach((t=>this.kW(t)))}FW(){this.xW.forEach((t=>this.vW(t))),this.bW.forEach((t=>this.vW(t))),this.xW.length=0,this.bW.length=0}_W(t,e){const i=2*t/3,s=4*t/3,r=this.bW.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.bW[r];return this.bW.splice(r,1),this.xW.push(t),t}}wW(){if(this.bW.length>5){const t=wt.performance.now();for(let e=0;e=1e4)&&(this.vW(i),this.bW.splice(e,1),e-=1)}}}}class rm extends Jy{IW(t,e){if(!e||"object"!=typeof e)return 0;const i=this.At.x.getInnerStart(),s=this.At.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.At.y.getInnerStart(),h=this.At.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);if("maxDataPointCount"in e)return this.PW(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.DW(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.BW(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}PW(t,e,i,s,r,n){if(void 0===e||e<=0)return 0;const o=t.reduce(((t,e)=>t+e.existingDataPointsCount),0);if(o<=e)return 0;let h=0,a=o;for(let i=0;ie&&(h+=1,a-=s.existingDataPointsCount)}return h}BW(t,e,i,s,r,n){if(void 0===e||!this.sW)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.sW?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.sW?a.boundaries.max.x2))break;o+=1}return o}DW(t,e,i,s,r,n){if(void 0===e||0===e)return 0;let o=0,h=0;for(let a=t.length-1;a>=0;a-=1){const l=t[a];if(h>e)if(this.sW){if(this.eW?"x"===this.sW?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.sW?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}LW(t,e){const i=t.reduce(((t,e)=>ei(t,e.boundaries)),Ne);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.sW||this.eW?"x"===this.sW&&this.eW?i.max.x=Math.min(i.max.x,t):"y"!==this.sW||this.eW?"y"===this.sW&&this.eW&&(i.max.y=Math.min(i.max.y,t)):i.min.y=Math.max(i.min.y,t):i.min.x=Math.max(i.min.x,t)}return i}}class nm extends yn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this._E=new Fy,this.LM=[],this.RW=new im(this.At,this),this.EW=new em(this.At,this,(()=>this.ls.xs())),this.zW=new sm(this.LM,(t=>{t.coordsBuffer&&this.ZR.LV(t.coordsBuffer),t.VG&&this.ZR.LV(t.VG)}),!0),this.VW=new rm(this.At,this),this.OW=0,this.NW=0,this.GW=!1,this.PN=dg({lineStyleSolid:()=>ts(this.gu)&&this.gu,lineStyleDashed:()=>so(this.gu)&&this.gu,strokeFillSolid:()=>{const t=this.gu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.gu.getFillStyle();return st(t)&&t},strokeFillRadialGradient:()=>{const t=this.gu.getFillStyle();return tt(t)&&t},strokeFillPaletted:()=>{const t=this.gu.getFillStyle();return H(t)&&t}}),this.MN=e,this.Qn=n,this.zG={type:"none"},this.ZR=t._N(),this.bN=t,this.LG=this.ZR.SO;const o=this.At._i(),h=!0===(null==n?void 0:n.individualLookupValuesEnabled);let a,l,u,c=0;o||(a=c,c+=2),o&&(l=c,c+=4),h&&(u=c,c+=1);const d=((t,e)=>e?(e,i)=>((t,e)=>{if(!e){const e=t.length,i=new Float32Array(3*e);for(let s=0,r=0;sJt(e,t,Float32Array))(o,h);this.WW={individualLookupValuesEnabled:h,attributesPerVertex:c,attributeOffsetCoordinateLowPrecision:a,attributeOffsetCoordinateHighPrecision:l,attributeOffsetLookUpValue:u,prepareRenderData:(t,e)=>d(t,this.gu.getFillStyle())}}UW(t,e,i){const s=new Float32Array(2*e);let r=0,n=i||t[0];for(let i=0;i0,o=this.No.C(),h=this.No.u,a=this.PN.lineStyleSolid(i),l=this.PN.lineStyleDashed(i),u=a||l,c=u&&u.getThickness(),d=this.PN.strokeFillSolid(i),f=this.PN.strokeFillLinearGradient(i),g=this.PN.strokeFillRadialGradient(i),y=this.PN.strokeFillPaletted(i),m=d||f||g||y,p=this.WW.individualLookupValuesEnabled;if(l&&this.At instanceof zi)return wt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;n&&(this.bu=he(this.bu,s,{canReturnB:!0}),this.qa+=r);let x=this.Mu.u;const A=this.VW.IW(this.LM,this.Mu.C());if(A>0){let t=0;for(let e=0;e{t.VG&&(this.ZR.LV(t.VG),t.VG=void 0)})),this.GW=!1),v&&(this.EW.fW(),this.LM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=Ne,t.lastDataPoint=void 0})),this.zW.TW(),S=this.bu,this.OW=0,this.NW=0);const b=this.EW.gW(S),M=b.length;if(M>0){let t=this.EW.pW(this.bu)||(this.Qo("ApplicationType",(t=>"InternalUI"===t.type))?this.qa:1e5);M/t>10&&(t=M/10),this.zW.MW(b,t,((t,e,i,s)=>{const r=this.RW.calculateUserDataPointsBoundaries(e),n=this.EW.yW(r,i,this.bu)-s;return this.YW=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:n,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.ZR.qV(t*this.WW.attributesPerVertex,this.WW.prepareRenderData(e,i)),lastDataPoint:e[i-1],VG:this.GW?this.ZR.qV(2*t,this.UW(e,i,this.YW)):void 0}}),((t,e,i,s)=>{const r=ei(t.boundaries,this.RW.calculateUserDataPointsBoundaries(e)),n=this.EW.yW(r,t.existingCoordinatesCount+i,this.bu)-(t.jointPointsCount+s);this.ZR.tO(t.coordsBuffer,t.existingCoordinatesCount*this.WW.attributesPerVertex,this.WW.prepareRenderData(e,i)),this.GW&&t.VG&&this.ZR.tO(t.VG,2*t.existingCoordinatesCount,this.UW(e,i,this.YW)),this.YW=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}if(x&&(this.Ka=this.VW.LW(this.LM,this.Mu.C())),this._E.BV(this.At),g?this.jN=Sy(this.Uo||this.Ka,this.At,g.getPosition(),g.getExtent(),g.getShape(),this.ZR.lV()):f?this.ZN=vy(this.Uo||this.Ka,this.At,f.getAngle(!0),this.ZR.lV()):(this.jN=void 0,this.ZN=void 0),i||h){if(y&&"value"===y.getLookUpProperty()&&!p){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw wt.alert(t),new Error(t)}if(m&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=f?["gradient",f]:g?["gradient",g]:y?["lookup",y.getLookUpProperty(),y.lut]:"uniform";this.zG="primitive"===t?{type:t,shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0}),l&&Ug.StippleTexture),mousePickingShader:o?this.ZR.Mz(Ug["2D"],Ug.MousePicking({useVertexId:!0}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0}),l&&Ug.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:y}:"triangulated"===t?{type:t,shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0}),this.LG?Ug.AliasedEdge:void 0,l&&Ug.StippleTextureInstanced),mousePickingShader:o?this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0}),l&&Ug.StippleTextureInstanced):void 0,geometry:jy(this.ZR,c),thickness:c,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:y}:{type:"none"}}else this.zG={type:"none"}}return this.OG=l?this.ZR.XO(l.getPattern()):void 0,this.vu(e),this.el=!1,this.tl=[],this.No.u=!1,this.Mu.u=!1,this}QL(t,e){const i=this.ZR.gl,s=this.zG;if(!s||"none"===s.type)return{};const r=1===t?s.mousePickingShader:s.shader;if(!r)return{};const{lineStyleDashed:n,fillStyleSolid:o,fillStyleLinearGradient:h,fillStyleRadialGradient:a,fillStylePaletted:l}=s;return this.ZR.aE(r).wV(r,((r,u,c,d)=>{let f=!1;if(this.ZR.FV(r("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(r("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(r("uRenderEffectMask"),2===t?1:0),this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(r("uScale"),this._E.IV()).kV(r("uDisp"),this._E.PV()).kV(d("uScaleStart_highpart"),this._E.iN()).kV(d("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(d("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(d("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(d("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(d("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(r("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(r("uViewportSize"),this._E.MixedScaleXY.uViewportSize),1===t);else if(o)this.ZR.TR(r("uColor"),o.getColor());else if(a){if(!this.jN)return!1;this.ZR.BO(c,this.jN,a)}else if(h){if(!this.ZN)return!1;this.ZR.LO(c,this.ZN,h)}else if(l){const t=fg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.ZR.JO(c,l.lut,t)}const g=Ve(e);return this.RW.renderVisibleOnly(this.LM,(e=>{const{coordsBuffer:o}=e;if(!o)return;if(1===t){const[t,i]=g.Ut(e.existingDataPointsCount);this.ZR.QV(r("uFirstId"),t),"triangulated"===s.type?this.ZR.YO(c,i):this.ZR.WO(c,i)}i.bindBuffer(i.ARRAY_BUFFER,o);const h="triangulated"===s.type?Ky.TG:$y.TG;if(this.At._i()||void 0===this.WW.attributeOffsetCoordinateLowPrecision?this.At._i()&&void 0!==this.WW.attributeOffsetCoordinateHighPrecision&&h(!0,this.ZR,o,c,this.WW.attributesPerVertex,this.WW.attributeOffsetCoordinateHighPrecision):h(!1,this.ZR,o,c,this.WW.attributesPerVertex,this.WW.attributeOffsetCoordinateLowPrecision),n){if(!e.VG||!this.OG)return;"triangulated"===s.type?Ky.FG(this.ZR,c,e.VG,u("aLengthSoFarA"),u("aLengthSoFarB"),2,0):$y.FG(this.ZR,c,e.VG,u("aLengthSoFar"),2,0),this.ZR.kV(r("uStippleCount"),[this.ls.oi().x/this.OG.QO,this.ls.oi().y/this.OG.QO]).FV(d("uStippleTextureWidthLimiter"),this.OG.ZO/this.OG.QO).FV(r("uStippleScale"),n.getPatternScale()).TV(r("uStippleTexture"),this.OG.jO,1)}if(l&&"value"===l.lookUpProperty&&void 0!==this.WW.attributeOffsetLookUpValue&&1!==t)if("triangulated"===s.type){const t=u("aLookupValueA");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.ZR.nO(t,1),i.enableVertexAttribArray(t);const e=u("aLookupValueB");i.vertexAttribPointer(e,1,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.WW.attributeOffsetLookUpValue+this.WW.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.ZR.nO(e,1),i.enableVertexAttribArray(e)}else{const t=u("aLookupValue");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),i.enableVertexAttribArray(t)}if("triangulated"===s.type){const{thickness:i}=s;Ky.QL(this.bN,s.geometry,c,this.LG&&1!==t,1===t,i,e.existingCoordinatesCount-1)}else $y.DG(this.bN,e.existingCoordinatesCount);f=!0})),i.bindBuffer(i.ARRAY_BUFFER,null),f})),{idCount:this.qa}}TN(t,e,i,s,r){return{}}dl(t,e){return Array.isArray(t)||(t=[t]),this.tl=he(this.tl,t,{canReturnB:!0}),this.Ka=ei(this.Ka,e||e||this.RW.calculateUserDataPointsBoundaries(t)),this}Ot(){return super.Ot(),this.OW=0,this.NW=0,this.YW=void 0,this}dispose(){return super.dispose(),this.zW.FW(),this.EW.mW(),this.zG={type:"none"},this.OG=void 0,this}KR(){return this}Qb(t){this.Al()>0&&this.Ls();const e=this.nl(),i=Nr(e,t,this.Zo(),this.Rl,this.El,this.At,this.engine.At,this.Ka,this.RW.sW,this.RW.eW);return void 0!==i?e[i]:void 0}x_(t){this.Al()>0&&this.Ls();const e=this.nl(),i=e.length;if(0===i)return;const s=this.Rl?1:0,r=i-(this.El?2:1),n=this.Zo();if(n===zr.Nearest){let s,r,n=Be;for(let o=0;o1}Jy(t,e,i,s,r){return"object"==typeof s?e?this.ZR.lO(t.attribute("aOffsetScale"),e,1).kV(t.uniform("uSizePixels"),[s.width,s.height]):this.ZR.FV(t.uniform("uOffsetScale"),s.scale).kV(t.uniform("uSizePixels"),[s.width,s.height]):r?e?this.ZR.lO(t.attribute("aOffsetPixels"),e,1):this.ZR.FV(t.uniform("uOffsetPixels"),s):this.ZR.FV(t.uniform("uPointSize"),s),r?this.ZR.CV(this.OR,0,{location:t.attribute("aInstanceGeo"),size:2}).fO(this.kG,0,this.XW,i):this.ZR.Jy(this.ZR.gl.POINTS,i),this}Yz(){this.ZR.LV(this.OR)}}const hm=(t,e=0)=>{const i=[u(-.5,-.5),u(.5,-.5),u(.5,.5),u(-.5,.5)];return new om(t,i,t.gl.TRIANGLE_FAN,e)},am=(t,e=0)=>{const i=.05,s=[u(-.5,-.05),u(.5,-.05),u(.5,i),u(.5,i),u(-.5,i),u(-.5,-.05),u(-.05,-.5),u(i,-.5),u(i,.5),u(i,.5),u(-.05,.5),u(-.05,-.5)];return new om(t,s,t.gl.TRIANGLES,e)},lm=(t,i,s)=>{if(oo(t))return lm(e.PointShape.Square,i,s);let r=i.GV.Ez.get(t);if(t===e.PointShape.Circle||t===e.PointShape.HollowCircle){const n=s<=3?4:s<=5?8:s<=10?16:24;return t===e.PointShape.Circle?(r=i.GV.zz.get(n)||((t,e,i=0)=>{const s=function(t=25){return _y(u(0,0),0,360,.5,.5,t)[0]}(e);return new om(t,s,t.gl.TRIANGLE_FAN,i)})(i,n),i.GV.zz.set(n,r),r):(r=i.GV.Vz.get(n)||((t,e,i=0)=>{const s=[],r=2*Math.PI/e;for(let t=0;t<=e;t+=1){const e=t*r,i=Math.cos(e),n=Math.sin(e);s.push({x:.5*i,y:.5*n}),s.push({x:.3*i,y:.3*n})}return new om(t,s,t.gl.TRIANGLE_STRIP,i)})(i,n),i.GV.Vz.set(n,r),r)}if(!r){switch(t){case e.PointShape.Triangle:r=((t,e=0)=>{const i=function(){const t=[],e=2/1.73205080757;return t.push(u(-e/2,.3333333333333333)),t.push(u(0,-.6666666666666666)),t.push(u(e/2,.3333333333333333)),t}();return new om(t,i,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Square:r=hm(i);break;case e.PointShape.Plus:r=am(i);break;case e.PointShape.Cross:r=am(i,45);break;case e.PointShape.Diamond:r=hm(i,45);break;case e.PointShape.Arrow:r=((t,e=0)=>{const i=.05,s=[u(-.05,-.5),u(i,-.5),u(i,.45),u(i,.45),u(-.05,.45),u(-.05,-.5),u(-.5,0),u(-.4,0),u(0,.4),u(0,.4),u(0,.5),u(-.5,0),u(.5,0),u(.4,0),u(0,.4),u(0,.4),u(0,.5),u(.5,0)];return new om(t,s,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Star:r=((t,e=0)=>new om(t,[{x:0,y:0},{x:0,y:.5},{x:.1,y:.1},{x:.5,y:.1},{x:.2,y:-.1},{x:.3,y:-.5},{x:0,y:-.25},{x:-.3,y:-.5},{x:-.2,y:-.1},{x:-.5,y:.1},{x:-.1,y:.1},{x:0,y:.5}],t.gl.TRIANGLE_FAN,e))(i);break;case e.PointShape.Minus:r=((t,e=0)=>{const i=.05,s=[u(-.5,-.05),u(.5,-.05),u(.5,i),u(.5,i),u(-.5,i),u(-.5,-.05)];return new om(t,s,t.gl.TRIANGLES,e)})(i);break;default:return we(0,"LightningChart JS unidentified point shape")}i.GV.Ez.set(t,r)}return r};class um extends nn{constructor(t,e,i,s,r){super(t,e,i,s,r),this._E=new Fy,this.FN=y(c(ze,ze),c(Be,Be)),this.PN=dg({pointStyleSolid:()=>Y(this.we)&&this.we,pointStyleRadialGradient:()=>tt(this.we)&&this.we,pointStyleLinearGradient:()=>st(this.we)&&this.we,pointStylePaletted:()=>H(this.we)&&this.we,pointStyleIndividual:()=>X(this.we)&&this.we}),this.bN=t,this.MN=e,this.ZR=t._N()}Ls(){var t;const e=this.No.C(),i=this.No.u,s=this.tl,r=s.length,n=r>0,o=this.ja.C(),h=this.we,a=this.size.C(),l=this.ja.u||this.ba.u,u=this.At.Ni(),c=this.size.u||this.ja.u,d=this.el||s&&s.length>0,f=u||c,g=this.aa(),y=this.PN.pointStyleSolid(g),m=this.PN.pointStyleRadialGradient(g),p=this.PN.pointStyleLinearGradient(g),x=this.PN.pointStylePaletted(g),A=this.PN.pointStyleIndividual(g),S=y||m||p||x||A;if(n&&(this.Xa=he(this.Xa,s,{canReturnB:!0}),this.qa+=r),n||this.el){this.Ka=this.sl?ei(this.Ka,this.sl):ei(this.Ka,Je(this.Xa));const t=Jt(this.Xa,this.At._i());this.QW=this.qa,this.JW=this.ZR.MV(t,!1,this.JW)}this._E.BV(this.At),h!==B?f&&(this.KW&&(this.KW=void 0),a>1||this.Za.C()?a<=1&&!this.Za.C()?this.kG=this.ZR.gl.POINTS:(this.KW=lm(o,this.ZR,this.Za.C()?25:a),this.kG=this.KW.kG):this.kG=this.ZR.gl.POINTS):this.KW&&(this.KW=void 0);const v=(null===(t=this.KW)||void 0===t?void 0:t.jW)||0,b=this.ba.C()+v;if(c||g||i||l){const t=this.Za.C()?"attribute":"uniform",i=a<=1&&Ug.PointSize(t),s=Ug.VertexLocation({offset:a>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:(this.Qa.C()||b%360!=0)&&{dataType:this.Qa.C()?"attribute":"uniform"}}:void 0,axisWorldTranslation:cg(this.At),normalSource:void 0});this.kE=S?this.ZR.Mz(Ug["2D"],i,s,y?Ug.Color({dataType:"uniform"}):A?Ug.Color({dataType:"attribute"}):x?Ug.Color({dataType:["lookup",x.getLookUpProperty(),x.lut]}):m?Ug.Color({dataType:["gradient",m]}):p?Ug.Color({dataType:["gradient",p]}):void 0):void 0,this.JN=e&&S?this.ZR.Mz(Ug["2D"],i,s,Ug.MousePicking()):void 0}if(d||g){const t=this.Xa.length;if(X(h)&&this.QW&&this.QW>0){const e=h.getFallbackColor(),i=new Float32Array(4*t);for(let s=0;s0&&a>1){const e=new Float32Array(t);for(let i=0;i0&&a>1){const e=new Float32Array(2*t),i=xi(b),s=Math.sin(i),r=Math.cos(i);for(let i=0;i0){const e=new Float32Array(t);for(let i=0;it&&(t=s.value)}this.hl={min:e,max:t}}return this.la=h,this.ja.u=!1,this.size.u=!1,this.ba.u=!1,this.No.u=!1,this.el=!1,this}QL(t,e){const i=1===t?this.JN:this.kE,s=this.JW,r=this.QW,n=this.qa;return i&&s&&r&&(this.ZR.aE(i),this.ZR.wV(i,((i,o,h,a)=>{var l;if(this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(a("uScaleStart_highpart"),this._E.iN()).kV(a("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(a("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(a("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(a("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(a("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(i("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(i("uViewportSize"),this._E.MixedScaleXY.uViewportSize),this.ZR.zO(h,s,this.At._i(),this.KW?1:void 0).FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).FV(a("uDevicePixelRatio"),this.ZR.lV()),this.KW){const t=o("aInstanceGeo");this.ZR.hO(t,this.KW.OR).nO(t,0)}if(1===t)this.ZR.QV(i("uFirstId"),e).YO(h,n);else if(Y(this.we))this.ZR.TR(i("uColor"),this.we.getColor());else if(X(this.we)&&this.qW){const t=o("aColor");this.ZR.aO(t,this.qW),this.kG!==this.ZR.gl.POINTS&&this.ZR.nO(t,1)}else if(H(this.we)){if("value"===this.we.getLookUpProperty()&&this.sU){const t=o("aLookupValue");this.ZR.lO(t,this.sU),this.kG!==this.ZR.gl.POINTS&&this.ZR.nO(t,1)}const t=fg(this.we,this,this.hl);if(!t&&this.we.lut.percentageValues)return!1;this.ZR.JO(h,this.we.lut,t)}else if(tt(this.we)){if(!this.ON)return!1;this.ZR.BO(h,this.ON,this.we)}else if(st(this.we)){if(!this.NN)return!1;this.ZR.LO(h,this.NN,this.we)}if(this.tU&&this.kG!==this.ZR.gl.POINTS){const t=o("aOffsetPixels");this.ZR.lO(t,this.tU),this.kG!==this.ZR.gl.POINTS&&this.ZR.nO(t,1)}else if(this.kG!==this.ZR.gl.POINTS){const t=i("uOffsetPixels");this.ZR.FV(t,this.size.C())}const u=((null===(l=this.KW)||void 0===l?void 0:l.jW)||0)+this.ba.C();if(this.iU&&this.kG!==this.ZR.gl.POINTS){const t=o("aRot");this.ZR.hO(t,this.iU),this.kG!==this.ZR.gl.POINTS&&this.ZR.nO(t,1)}else if(this.kG!==this.ZR.gl.POINTS&&u%360!=0){const t=xi(u),e=Math.sin(t),s=Math.cos(t);this.ZR.kV(i("uRot"),[e,s])}if(this.kG===this.ZR.gl.POINTS)this.ZR.FV(i("uPointSize"),this.size.C());else{const t={x:2/this.ls.oi().x,y:2/this.ls.oi().y};this.ZR.kV(i("uRatioPxClip"),[t.x,t.y])}let c=!1;return this.kG===this.ZR.gl.POINTS?(this.ZR.Jy(this.kG,r),c=!0):this.KW&&(this.ZR.fO(this.kG,0,this.KW.XW,r),c=!0),c}))),{idCount:n}}TN(t,e,i,s,r){return{}}Jc(t){this.Al()>0&&this.Ls();const e=this.nl(),i=Nr(e,t,this.Zo(),!1,!1,this.At,this.ls.At,this.Ka,void 0,void 0);return void 0!==i?e[i]:void 0}Ie(t){return super.Ie(t)}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return this.Za.C()?25:this.size.C()}kl(){return this.Za.C()?25:this.size.C()}KR(){return this.JW&&(this.ZR.LV(this.JW),this.JW=void 0),this.KW&&(this.KW=void 0),this.qW&&(this.ZR.LV(this.qW),this.qW=void 0),this.iU&&(this.ZR.LV(this.iU),this.iU=void 0),this.sU&&(this.ZR.LV(this.sU),this.sU=void 0),this}}class cm extends en{constructor(t,e,i,s,r){super(t,e,i,s,r),this.zG={fill:void 0,border:void 0},this._E=new Fy,this.Ka=Ne,this.eU=!1,this.hU=!1,this.rU=!1,this.nU=!1,this.oU=!1,this.wd=[],this.PN=dg({polygonStyleSolid:()=>Y(this.we)&&this.we,polygonStyleImage:()=>Jn(this.we)&&this.we,polygonStyleRadialGradient:()=>tt(this.we)&&this.we,polygonStyleLinearGradient:()=>st(this.we)&&this.we,polygonStylePaletted:()=>H(this.we)&&this.we,polygonStyleIndividual:()=>X(this.we)&&this.we,lineStyleSolid:()=>ts(this.Ce)&&this.Ce,lineStyleFilled:()=>{const t=this.Ce&&this.Ce.getFillStyle();return Y(t)&&t}}),this.bN=t,this.MN=e,this.ZR=t._N(),this.LG=this.ZR.SO}Hr(){const t={ps:e=>this.$G(t,e),us:e=>this.XG(t,e),_l:e=>this.aU(t,e),rb:e=>this.lU(t,e),TR:e=>this.ZG(t,e),Xa:[],M:void 0,uU:void 0,Yo:0,cU:!0,dU:this.wd.length};return this.wd.push(t),t}Ot(){var t;return this.wd.length=0,this.eU=!0,this.Ts&&this.En&&(null===(t=this.ls.Rn)||void 0===t?void 0:t.entity)===this&&this.En(this,void 0,this.ls.Rn.collectionMember),this}_m(){return this.wd}kd(t){var e;const i=this.wd.indexOf(t);i>=0&&(this.wd.splice(i,1),this.oU=!0,this.Ts&&this.En&&(null===(e=this.ls.Rn)||void 0===e?void 0:e.entity)===this&&this.ls.Rn.collectionMember===t&&this.En(this,void 0,this.ls.Rn.collectionMember))}$G(t,e){var i;return t.cU=e,this.oU=!0,this.Ts&&this.En&&(null===(i=this.ls.Rn)||void 0===i?void 0:i.entity)===this&&this.ls.Rn.collectionMember===t&&!t.cU&&this.En(this,void 0,this.ls.Rn.collectionMember),t}XG(t,e){return t.Yo=e,this.nU=!0,t}aU(t,e){return t.Xa=e,this.eU=!0,t}lU(t,e){return t.M=e,this.hU=!0,t}ZG(t,e){return t.uU=null==e?void 0:e.toUint32(),this.rU=!0,t}Ls(){const t=this.No.C(),e=this.No.u,i=this.aa(),s=this.nU,r=this.eU,n=this.hU,o=this.rU,a=this.oU,l=this.Ce,u=this.fa(),c=this.wd.filter((t=>t.cU&&t.Xa.length>0));if(this._E.BV(this.At),(r||a)&&(this.Ka=ei(...c.map((t=>Je(t.Xa))))),r||a){const t=c.map((t=>[...t.Xa,t.Xa[0],{x:Number.NaN,y:Number.NaN}])).flat(),e=Jt(t,!1,Float64Array),i=this.At._i()?Jt(t,!0):e;this.EG=this.ZR.MV(i,!1,this.EG);let s=[];c.reduce(((t,i)=>{const r=t,n=2*(i.Xa.length+1),o=new Float64Array(e.buffer,r,n),a=h.default(o,void 0,2),l=t/(2*Float64Array.BYTES_PER_ELEMENT);for(let t=0;tt+e.Xa.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Xa.length+2;for(let r=i;rt+e.Xa.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Xa.length+2;for(let r=i;rt+e.Xa.length+2),0),e=new Float32Array(t);let i=0;const s={min:Be,max:ze};c.forEach((t=>{const r=void 0!==t.M?t.M:-34028234663852886e22,n=t.Xa.length+2;for(let t=i;tt+e.Xa.length+2),0),e=new Uint32Array(t);let i=0;const s=g?g.getFallbackColor().toUint32():E.toUint32();c.forEach((t=>{const r=void 0!==t.uU?t.uU:s,n=t.Xa.length+2;for(let t=i;tthis.bU(t,e,i,c))),this.nU=!1,this.oU=!1,this.eU=!1,this.hU=!1,this.rU=!1,this.No.u=!1,this.da(this.we),this.pa(l),this}QL(t,e){var i,s;const{fill:r,border:n}=this.zG,o=this.EG,h=this.pU,a=this.yU;if(!o||!h)return{};if(r){const{fillStyleSolid:s,fillStyleLinearGradient:n,fillStyleRadialGradient:l,fillStylePaletted:u,fillStyleImage:c,fillStyleIndividual:d}=r,f=this.fU,g=this.AU,y=1===t?null===(i=r.mousePicking)||void 0===i?void 0:i.shader:r.shader;y&&o&&f&&void 0!==g&&this.ZR.aE(y).wV(y,((i,r,y,m)=>{if(this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(m("uScaleStart_highpart"),this._E.iN()).kV(m("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(m("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(m("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(m("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(m("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(i("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(i("uViewportSize"),this._E.MixedScaleXY.uViewportSize),this.ZR.zO(y,o,this.At._i(),void 0).uO(f).lO(r("aIsHighlighted"),h).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),1===t){if(this.ZR.QV(i("uFirstId"),e),!a)return!1;this.ZR.lO(r("aPickingIdOffset"),a)}else if(s)this.ZR.TR(i("uColor"),s.getColor());else if(l){if(!this.ON)return!1;this.ZR.BO(y,this.ON,l)}else if(n){if(!this.NN)return!1;this.ZR.LO(y,this.NN,n)}else if(u){const t=fg(u,this,this.mU);if(!t&&u.lut.percentageValues)return!1;if(this.ZR.JO(y,u.lut,t),"value"===u.getLookUpProperty()){if(!this.vU)return!1;this.ZR.lO(r("aLookupValue"),this.vU)}}else if(c){if(!this.xU)return!1;this.ZR.TR(m("uColor"),c.getSurroundingColor()).TV(i("uColorTexture"),this.xU.texture.rV()||this.xU.sourceMissingTexture,0).CV(this.xU.texCoordsBuffer,void 0,{location:r("aTextureCoord"),size:2}).JV(c.fitMode)}else if(d){if(!this.SU)return!1;const t=r("aColor");this.ZR.gl.bindBuffer(this.ZR.gl.ARRAY_BUFFER,this.SU),this.ZR.gl.vertexAttribPointer(t,4,this.ZR.gl.UNSIGNED_BYTE,!0,0,0),this.ZR.gl.enableVertexAttribArray(t)}return this.ZR.dO(g,void 0,void 0,this.ZR.gl.UNSIGNED_INT),!0}))}if(n){const{geometry:i,fillStyleSolid:r,thickness:l}=n,u=this.gU,c=1===t?null===(s=n.mousePicking)||void 0===s?void 0:s.shader:n.shader;c&&o&&u&&this.ZR.aE(c).wV(c,((s,n,c,d)=>{if(this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(s("uScale"),this._E.IV()).kV(s("uDisp"),this._E.PV()).kV(d("uScaleStart_highpart"),this._E.iN()).kV(d("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(d("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(d("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(d("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(d("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(s("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(s("uViewportSize"),this._E.MixedScaleXY.uViewportSize),this.ZR.CV(h,1,{location:n("aIsHighlighted"),size:1}).TR(s("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(s("uRenderEffectMask"),2===t?1:0),1===t){if(this.ZR.QV(s("uFirstId"),e),!a)return!1;this.ZR.lO(n("aPickingIdOffset"),a,1)}else r&&this.ZR.TR(s("uColor"),r.getColor());return Ky.TG(this.At._i(),this.ZR,o,c,this.At._i()?4:2,0),Ky.QL(this.bN,i,c,this.LG&&1!==t,1===t,l,u),!0}))}return{idCount:this.wd.length}}bU(t,e,i,s){const r=ct({x:this.Ka.min.x,y:this.Ka.min.y},this.At,this.ls.At),n=ct({x:this.Ka.max.x,y:this.Ka.max.y},this.At,this.ls.At),o={x:Math.abs(r.x-n.x),y:Math.abs(r.y-n.y)},h=Cy(t,e,o.x,o.y,i),a=h[1],l=h[4],u=h[6],c=h[7],d=s.reduce(((t,e)=>t+e.Xa.length+2),0),f=new Float32Array(2*d),g=this.Ka.max.x-this.Ka.min.x,y=this.Ka.max.y-this.Ka.min.y,m=l-u,p=c-a;let x=0;for(const t of s){for(const e of t.Xa){const t=u+m*((e.x-this.Ka.min.x)/g),i=a+p*((e.y-this.Ka.min.y)/y);f[x]=t,f[x+1]=i,x+=2}const e=u+m*((t.Xa[0].x-this.Ka.min.x)/g),i=a+p*((t.Xa[0].y-this.Ka.min.y)/y);f[x]=e,f[x+1]=i,x+=2,f[x]=Number.NaN,f[x+1]=Number.NaN,x+=2}return f}TN(t,e,i,s,r){return{collectionMember:this.wd.find((i=>e+i.dU===t))}}KR(){return this.fU&&(this.ZR.LV(this.fU),this.fU=void 0),this.EG&&(this.ZR.LV(this.EG),this.EG=void 0),this.pU&&(this.ZR.LV(this.pU),this.pU=void 0),this.yU&&(this.ZR.LV(this.yU),this.yU=void 0),this.vU&&(this.ZR.LV(this.vU),this.vU=void 0),this.SU&&(this.ZR.LV(this.SU),this.SU=void 0),this.zG={fill:void 0,border:void 0},this.xU=this.ZR.qO(this,this.xU),this}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return Te(this.Ce)}kl(){return Te(this.Ce)}}class dm extends on{constructor(t,e,i,s,r){super(t,e,i,s,r),this._E=new Fy,this.MU=Ne,this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStyleRadialGradient:()=>tt(this.we)&&this.we,fillStyleLinearGradient:()=>st(this.we)&&this.we,fillStyleImage:()=>Jn(this.we)&&this.we,strokeStyleSolid:()=>ts(this.Ce)&&this.Ce,strokeFillSolid:()=>{const t=this.Ce.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.Ce.getFillStyle();return st(t)&&t},strokeFillRadialGradient:()=>{const t=this.Ce.getFillStyle();return tt(t)&&t}}),this.bU=(t,e,i)=>{const s=ct(this.za(),this.At,this.ls.At),r=ci(ct(ui(this.za(),this.oi()),this.At,this.ls.At),s);return Cy(t,e,r.x,r.y,i)},this.bN=t,this.MN=e,this.ZR=t._N(),this.MN=e}Ls(){super.Ls();const t=this.No.C(),e=this.aa(),i=this.ma.u||this.Z.u||this.ba.u||this._a.u,s=this.Ce,r=this.fa(),n=s.getThickness(),o=this.ba.C();this._E.BV(this.At);const h=this.At.Ni();if(i){const t=this.Z.C();this.Xa=function(t,e,i,s,r){const n=((t,e,i)=>[t,u(t.x+e,t.y),u(t.x+e,t.y+i),u(t.x,t.y+i)])(t,e,i);if(0!==s||s%360!=0){const t=s*Math.PI/180;n[0]=ri(n[0],r,t),n[1]=ri(n[1],r,t),n[2]=ri(n[2],r,t),n[3]=ri(n[3],r,t)}return n}(this.ma.C(),t.x,t.y,o,this._a.C());const e=Jt(this.Xa,this.At._i());this.RN=this.ZR.MV(e,!1,this.RN),this.zN=this.Xa.length,this.MU=Je(this.Xa)}const a=this.PN.fillStyleSolid(e),l=this.PN.fillStyleRadialGradient(e),c=this.PN.fillStyleLinearGradient(e),d=this.PN.fillStyleImage(e),f=a||l||c||d;e&&(this.GN=f?this.ZR.Mz(Ug["2D"],a&&Ug.Color({dataType:"uniform"}),c&&Ug.Color({dataType:["gradient",c]}),l&&Ug.Color({dataType:["gradient",l]}),d&&Ug.Color({dataType:["image",d]}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0),l?this.ON=Sy(this.Uo||this.MU,this.At,l.getPosition(),l.getExtent(),l.getShape(),this.ZR.lV()):c?this.NN=vy(this.Uo||this.MU,this.At,c.getAngle(!0),this.ZR.lV()):(this.ON=void 0,this.NN=void 0),this.xU=this.ZR.KO(this,this.xU,d,void 0,h||i,this.bU);const g=this.PN.strokeStyleSolid(r),y=this.PN.strokeFillSolid(r),m=this.PN.strokeFillLinearGradient(r),p=this.PN.strokeFillRadialGradient(r),x=g,A=y||m||p;if(x&&(i||r||h&&1!==n)){if(1===n||-1===n)[this.WN,this._U]=[this.Xa,void 0];else{const t=this.At;[this.WN,this._U]=t instanceof zi?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.Ui(s,r,h,-h),i.Ui(r,s,-h,-h),i.Ui(o,n,-h,-h),i.Ui(n,o,h,-h),i.Ui(s,r,-h,h),i.Ui(r,s,h,h),i.Ui(o,n,h,h),i.Ui(n,o,-h,h)],[0,4,5,0,5,1,1,5,7,1,3,7,3,7,6,3,2,6,2,4,0,2,6,4]]})(this.Xa,n,t):((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=u(e.x*i*.5,e.y*i*.5),a=oi(ni(r,s)),l=oi(ni(o,s)),c=gi(a),d=gi(l);return[[ui(s,ui(li(c,h.x),li(d,h.y))),ui(r,ui(li(a,h.x),li(d,h.y))),ui(o,ui(li(c,h.x),li(l,h.y))),ui(n,ui(li(a,h.x),li(l,h.y))),ui(s,ui(li(a,h.x),li(l,h.y))),ui(r,ui(li(c,h.x),li(l,h.y))),ui(o,ui(li(a,h.x),li(d,h.y))),ui(n,ui(li(c,h.x),li(d,h.y)))],[0,4,5,0,5,1,1,5,7,1,3,7,3,7,6,3,2,6,2,4,0,2,6,4]]})(this.Xa,t.Wi(),n)}this.YN=this.ZR.MV(Jt(this.WN,this.At._i()),!1,this.YN),this._U?(this.wG=this.ZR.sO(new Uint16Array(this._U),this.wG),this.UN=this._U.length):(this.wG&&this.ZR.LV(this.wG),this.wG=void 0,this.UN=this.WN.length)}return r&&(this.QN=x&&A?this.ZR.Mz(Ug["2D"],Ug.Color({dataType:p?["gradient",p]:m?["gradient",m]:"uniform"}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0),p?this.jN=Sy(this.MU,this.At,p.getPosition(),p.getExtent(),p.getShape(),this.ZR.lV()):m?this.ZN=vy(this.MU,this.At,m.getAngle(!0),this.ZR.lV()):(this.jN=void 0,this.ZN=void 0),this.JN=t&&f?this.JN||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0,this.KN=t&&this.Ce!==nt?this.KN||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0,this.da(this.we),this.pa(s),this.ma.u=!1,this.ba.u=!1,this.Z.u=!1,this._a.u=!1,this}QL(t,e){const i=1===t?this.JN:this.GN,s=this.RN,r=this.zN,n=this.PN.fillStyleSolid(!1),o=this.PN.fillStyleRadialGradient(!1),h=this.PN.fillStyleLinearGradient(!1),a=this.PN.fillStyleImage(!1);i&&s&&r&&this.we!==B&&(this.ZR.aE(i),this.ZR.wV(i,((i,l,u,c)=>{if(this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(c("uScaleStart_highpart"),this._E.iN()).kV(c("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(c("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(c("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(c("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(c("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(i("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(i("uViewportSize"),this._E.MixedScaleXY.uViewportSize),1===t)this.ZR.QV(i("uFirstId"),e).YO(u,1);else if(n)this.ZR.TR(i("uColor"),n.getColor());else if(o){if(!this.ON)return!1;this.ZR.BO(u,this.ON,o)}else if(h){if(!this.NN)return!1;this.ZR.LO(u,this.NN,h)}else if(a){if(!this.xU)return!1;const t=this.xU&&this.xU.texture.rV();this.ZR.TR(c("uColor"),a.getSurroundingColor()).TV(i("uColorTexture"),t||this.xU.sourceMissingTexture,0).CV(this.xU.texCoordsBuffer,void 0,{location:l("aTextureCoord"),size:2}).JV(a.fitMode)}return this.ZR.FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).zO(u,s,this.At._i(),void 0).Jy(this.ZR.gl.TRIANGLE_FAN,r),!0})));const l=1===t?this.KN:this.QN,u=this.PN.strokeStyleSolid(!1),c=this.PN.strokeFillSolid(!1),d=this.PN.strokeFillLinearGradient(!1),f=this.PN.strokeFillRadialGradient(!1),g=this.YN;return l&&g&&u&&(this.ZR.aE(l),this.ZR.wV(l,((i,s,r,n)=>{if(this.At instanceof Bi||this.At instanceof Bc?this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(n("uScaleStart_highpart"),this._E.iN()).kV(n("uScaleStart_lowpart"),this._E.sN()):this.At instanceof zi&&this.ZR.kV(n("uScaleStart"),this._E.MixedScaleXY.uScaleStart).kV(n("uScaleStartLog"),this._E.MixedScaleXY.uScaleStartLog).kV(n("uScaleInterval"),this._E.MixedScaleXY.uScaleInterval).kV(n("uScaleIntervalLog"),this._E.MixedScaleXY.uScaleIntervalLog).kV(i("uViewportStart"),this._E.MixedScaleXY.uViewportStart).kV(i("uViewportSize"),this._E.MixedScaleXY.uViewportSize),1===t)this.ZR.QV(i("uFirstId"),e).YO(r,1);else if(c)this.ZR.TR(i("uColor"),c.getColor());else if(f){if(!this.jN)return!1;this.ZR.BO(r,this.jN,f)}else if(d){if(!this.ZN)return!1;this.ZR.LO(r,this.ZN,d)}return this.ZR.FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).zO(r,g,this.At._i(),void 0),this.wG?this.ZR.uO(this.wG).dO(this.UN):this.ZR.Jy(this.ZR.gl.LINE_LOOP,this.UN),!0}))),{idCount:1}}TN(t,e,i,s,r){return{}}KR(){return this.wG&&(this.ZR.LV(this.wG),this.wG=void 0),this.RN&&(this.ZR.LV(this.RN),this.RN=void 0),this.YN&&(this.ZR.LV(this.YN),this.YN=void 0),this.xU=this.ZR.qO(this,this.xU),this.GN=void 0,this.QN=void 0,this.JN=void 0,this.KN=void 0,this}St(){return Math.max(this.ma.C().x,this.ma.C().x+this.Z.C().x)}vt(){return Math.min(this.ma.C().x,this.ma.C().x+this.Z.C().x)}bt(){return Math.max(this.ma.C().y,this.ma.C().y+this.Z.C().y)}xt(){return Math.min(this.ma.C().y,this.ma.C().y+this.Z.C().y)}Cl(){return Te(this.Ce)}kl(){return Te(this.Ce)}}class fm extends an{constructor(t,e,i,s,r){super(t,e,i,s,r),this._E=new Fy,this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStylePaletted:()=>H(this.we)&&this.we,fillStyleRadialGradient:()=>tt(this.we)&&this.we,fillStyleLinearGradient:()=>st(this.we)&&this.we,fillStyleImage:()=>Jn(this.we)&&this.we,strokeLineStyleSolid:()=>ts(this.Ce)&&this.Ce,strokeLineSolidFill:()=>{const t=this.Ce.getFillStyle();return Y(t)&&t},strokeLinearGradientFill:()=>{const t=this.Ce.getFillStyle();return st(t)&&t},strokeRadialGradientFill:()=>{const t=this.Ce.getFillStyle();return tt(t)&&t}}),this.bU=(t,e,i)=>{const s=ct({x:this.Ka.min.x,y:this.Ka.min.y},this.At,this.ls.At),r=ct({x:this.Ka.max.x,y:this.Ka.max.y},this.At,this.ls.At),n={x:Math.abs(s.x-r.x),y:Math.abs(s.y-r.y)},o=Cy(t,e,n.x,n.y,i),h=o[1],a=o[4],l=o[6],u=o[7],c=new Float32Array(2*this.Xa.length),d=this.Ka.max.x-this.Ka.min.x,f=this.Ka.max.y-this.Ka.min.y,g=a-l,y=u-h;let m=0;for(const t of this.Xa){const e=l+g*((t.x-this.Ka.min.x)/d),i=h+y*((t.y-this.Ka.min.y)/f);c[m]=e,c[m+1]=i,m+=2}return c},this.bN=t,this.MN=e,this.ZR=t._N(),this.MN=e}Jc(t){let e,i=Number.MAX_VALUE;for(const s of this.Xa){const r=Ke(ct(s,this.At,this.ls.At),t);r=3,r=this.Ce,n=this.fa(),o=r.getThickness(),a=this.ga(o);this._E.BV(this.At),this.ST=this.At.Wi();const l=this.At.Ni();if(i&&(this.Ka=Je(this.Xa)),i&&s){const t=Jt(this.Xa,this.At._i());this.RN=this.ZR.MV(t,!1,this.RN),this.wU=new Uint16Array(h.default(t)),this.CU=this.ZR.sO(this.wU,this.CU),this.zN=this.wU.length}const u=this.PN.fillStyleSolid(e),c=this.PN.fillStylePaletted(e),d=this.PN.fillStyleRadialGradient(e),f=this.PN.fillStyleLinearGradient(e),g=this.PN.fillStyleImage(e),y=u||c&&"value"!==c.getLookUpProperty()&&c||f||d||g;if(e&&(this.GN=y?this.ZR.Mz(Ug["2D"],u&&Ug.Color({dataType:"uniform"}),f&&Ug.Color({dataType:["gradient",f]}),d&&Ug.Color({dataType:["gradient",d]}),c&&Ug.Color({dataType:["lookup",c.getLookUpProperty(),c.lut]}),g&&Ug.Color({dataType:["image",g]}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0),d?this.ON=Sy(this.Uo||this.Ka,this.At,d.getPosition(),d.getExtent(),d.getShape(),this.ZR.lV()):f?this.NN=vy(this.Uo||this.Ka,this.At,f.getAngle(!0),this.ZR.lV()):(this.ON=void 0,this.NN=void 0),this.xU=this.ZR.KO(this,this.xU,g,void 0,l||i,this.bU),(i||a||l&&1!==o)&&s){const t=1===o||-1===o?this.Xa:By(this.Xa,this.ST,o);this.WN=Jt(t,this.At._i()),this.YN=this.ZR.MV(this.WN,!0,this.YN),this.UN=t.length}const m=this.PN.strokeLineStyleSolid(n),p=this.PN.strokeLineSolidFill(n),x=this.PN.strokeLinearGradientFill(n),A=this.PN.strokeRadialGradientFill(n),S=m,v=p||x||A;return n&&(this.QN=S&&v?this.ZR.Mz(Ug["2D"],Ug.Color({dataType:A?["gradient",A]:x?["gradient",x]:"uniform"}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0),A?this.jN=Sy(this.Uo||this.Ka,this.At,A.getPosition(),A.getExtent(),A.getShape(),this.ZR.lV()):x?this.ZN=vy(this.Uo||this.Ka,this.At,x.getAngle(!0),this.ZR.lV()):(this.jN=void 0,this.ZN=void 0),this.JN=t&&y?this.JN||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0,this.KN=t&&this.Ce!==nt?this.JN||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})):void 0,this.Ml=!1,this.da(this.we),this.pa(r),this}QL(t,e){const i=1===t?this.JN:this.GN,s=this.RN,r=this.zN,n=this.PN.fillStyleSolid(!1),o=this.PN.fillStyleRadialGradient(!1),h=this.PN.fillStyleLinearGradient(!1),a=this.PN.fillStylePaletted(!1),l=this.PN.fillStyleImage(!1);i&&s&&r&&this.ZR.aE(i).wV(i,((i,r,u,c)=>{if(this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).kV(c("uScaleStart_highpart"),this._E.iN()).kV(c("uScaleStart_lowpart"),this._E.sN()).zO(u,s,this.At._i(),void 0).uO(this.CU).FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),1===t)this.ZR.QV(i("uFirstId"),e).YO(u,1);else if(n)this.ZR.TR(i("uColor"),n.getColor());else if(o){if(!this.ON)return!1;this.ZR.BO(u,this.ON,o)}else if(h){if(!this.NN)return!1;this.ZR.LO(u,this.NN,h)}else if(a){const t=fg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.ZR.JO(u,a.lut,t)}else if(l){if(!this.xU)return!1;this.ZR.TR(c("uColor"),l.getSurroundingColor()).TV(i("uColorTexture"),this.xU.texture.rV()||this.xU.sourceMissingTexture,0).CV(this.xU.texCoordsBuffer,void 0,{location:r("aTextureCoord"),size:2}).JV(l.fitMode)}return this.ZR.dO(this.zN),!0}));const u=1===t?this.KN:this.QN,c=this.Ce,d=this.YN,f=this.UN;return u&&d&&f&&this.ZR.aE(u).wV(u,((i,s,r,n)=>{this.ZR.FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).zO(r,d,this.At._i(),void 0);const o=c.getFillStyle();if(1===t)this.ZR.QV(i("uFirstId"),e).YO(r,1);else if(Y(o))this.ZR.TR(i("uColor"),o.getColor());else if(tt(o)){if(!this.jN)return!1;this.ZR.BO(r,this.jN,o)}else if(st(o)){if(!this.ZN)return!1;this.ZR.LO(r,this.ZN,o)}const h=c.getThickness(),a=-1===h||1===h;return this.ZR.Jy(a?this.ZR.gl.LINE_LOOP:this.ZR.gl.TRIANGLE_STRIP,this.UN),!0})),{idCount:1}}TN(t,e,i,s,r){return{}}KR(){return this.CU&&(this.ZR.LV(this.CU),this.CU=void 0),this.RN&&(this.ZR.LV(this.RN),this.RN=void 0),this.YN&&(this.ZR.LV(this.YN),this.YN=void 0),this.GN=void 0,this.QN=void 0,this.JN=void 0,this.KN=void 0,this.xU=this.ZR.qO(this,this.xU),this}}const gm=(t,e)=>{let i=0;const s=[];for(;i0;n-=o?1:0,n-=i+n{let i=0;const s=[];for(;i0;n-=o?1:0,n-=0;const h=Math.min(n,t-r),a=i-(o?1:0),l={start:a,startUnique:r,sizeData:Math.min(e,t-a),sizeUniqueData:h};s.push(l),i+=h}return s},mm=(t,e,i,s)=>{if(i){const t=new Map;return e.gridTiles.forEach((e=>{t.set(e,{type:i,dataInvalidationRanges:[{tileInvalidationOffset:{primary:0,secondary:0},tileInvalidationLength:e.sizeHeatmapDataVectors}]})})),t}const r=new Map;for(let i=0;i{const e=t.iFirstVector,i=s(t),o={x:e.primary+i.primary-1,y:e.secondary+i.secondary-1},h=[{x:e.primary,y:e.secondary},{x:o.x,y:e.secondary},o,{x:e.primary,y:o.y}];if(!Ge(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const c=(d=a,f=h,y(u(Math.max(Math.min(d[0].x,d[2].x),Math.min(f[0].x,f[2].x)),Math.max(Math.min(d[0].y,d[2].y),Math.min(f[0].y,f[2].y))),u(Math.min(Math.max(d[0].x,d[2].x),Math.max(f[0].x,f[2].x)),Math.min(Math.max(d[0].y,d[2].y),Math.max(f[0].y,f[2].y)))));var d,f;const g={primary:c.min.x-e.primary,secondary:c.min.y-e.secondary},m={primary:1+c.max.x-c.min.x,secondary:1+c.max.y-c.min.y};let p=!1;const x=[{x:g.primary,y:g.secondary},{x:g.primary+m.primary,y:g.secondary},{x:g.primary+m.primary,y:g.secondary+m.secondary},{x:g.primary,y:g.secondary+m.secondary}];for(let t=0;t{if(1!==t.length||0!==e.startPrimary||0!==e.startSecondary||e.lengthPrimary!==t[0].sizeHeatmapDataVectors.primary||e.lengthSecondary!==t[0].sizeHeatmapDataVectors.secondary)t.forEach((t=>{const s=i(t),r=Math.max(e.startPrimary,t.iFirstVector.primary),n=Math.min(e.startPrimary+e.lengthPrimary-1,t.iFirstVector.primary+t.sizeHeatmapDataVectors.primary-1),o=Math.max(e.startSecondary,t.iFirstVector.secondary),h=Math.min(e.startSecondary+e.lengthSecondary-1,t.iFirstVector.secondary+t.sizeHeatmapDataVectors.secondary-1);for(let i=r;i<=n;i+=1){const r=i-e.startPrimary,n=e.values[r],a=(i-t.iFirstVector.primary)*t.sizeHeatmapDataVectors.secondary;for(let i=o;i<=h;i+=1){const r=i-e.startSecondary,o=i-t.iFirstVector.secondary,h=n[r];s[a+o]=h}}}));else{const s=t[0],r=i(s);for(let t=0;t{var s,r;const n=null===(s=t.gl2)||void 0===s?void 0:s.ctx;if(n)return t.IO(null,n.RED,!1,!0,{x:e,y:i},!1,n.FLOAT,n.R32F);const o=t.gl;return(null===(r=t.gl1)||void 0===r?void 0:r.optional.OES_texture_float)?t.IO(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.IO(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},Am=(t,e,i,s)=>{e.forEach(((e,r)=>{var n,o;const h=i(r),a=s(r),l=t.gl;l.bindTexture(l.TEXTURE_2D,a),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const u=null===(n=t.gl2)||void 0===n?void 0:n.ctx,c=e.dataInvalidationRanges.length,d=e.dataInvalidationRanges.reduce(((t,e)=>t+e.tileInvalidationLength.primary),0)/r.sizeHeatmapDataVectors.primary;1===c&&d<1||d<.5&&c<10?e.dataInvalidationRanges.forEach((e=>{var i;const s=e.tileInvalidationOffset.primary*r.sizeHeatmapDataVectors.secondary,n=s+e.tileInvalidationLength.primary*r.sizeHeatmapDataVectors.secondary;if(u)u.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,u.RED,u.FLOAT,h.subarray(s,n));else if(null===(i=t.gl1)||void 0===i?void 0:i.optional.OES_texture_float)l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.LUMINANCE,l.FLOAT,h.subarray(s,n));else{const t=new Uint8Array(h.buffer).subarray(4*s,4*n);l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.RGBA,l.UNSIGNED_BYTE,t)}})):u?u.texImage2D(l.TEXTURE_2D,0,u.R32F,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,u.RED,u.FLOAT,h):(null===(o=t.gl1)||void 0===o?void 0:o.optional.OES_texture_float)?l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,l.LUMINANCE,l.FLOAT,h):l.texImage2D(l.TEXTURE_2D,0,l.RGBA,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array(h.buffer)),l.bindTexture(l.TEXTURE_2D,null)}))};class Sm extends tn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.kU=p("bilinear"),this.Pi={x:0,y:0},this.mw={x:1,y:1},this.SS=Ir.lineStyle,this.engine=t;const o="columns"===n.dataOrder?n.columns:n.rows,h="columns"===n.dataOrder?n.rows:n.columns;this.Qn={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}kS(t){return this.kU._(t),this}TS(){return this.kU.C()}_S(t,e){return this.Pi=t,this.mw=e,this}wS(){return{start:this.Pi,step:this.mw,end:{x:this.Pi.x+this.mw.x*this.Qn.columns,y:this.Pi.y+this.mw.y*this.Qn.rows}}}xS(t){return this.SS="function"==typeof t?t(this.SS):t,this}CS(){return this.SS}}class vm extends Sm{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._E=new Fy,this.zG={},this.TU=[],this.FU=!1,this.el=!1,this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStylePaletted:()=>H(this.we)&&this.we,wireframeStyleLine:()=>ts(this.SS)&&this.SS,wireframeStyleFill:()=>{const t=this.SS&&this.SS.getFillStyle();return Y(t)&&t}}),this.IU=gm,this.bN=t,this.MN=e,this.ZR=t._N(),this.MN=e;const o=Math.min(this.ZR.JR,void 0!==n.PU?n.PU:2048),h={x:Math.min(o,this.Qn.primaryDimensionVectorsCount),y:Math.min(o,this.Qn.secondaryDimensionVectorsCount)},a=((t,e,i)=>{const s=[],r=i(t.primaryDimensionVectorsCount,e.x),n=i(t.secondaryDimensionVectorsCount,e.y);let o;return r.forEach((t=>n.forEach((e=>{const i={iFirstVector:{primary:t.start,secondary:e.start},iFirstUniqueVector:{primary:t.startUnique,secondary:e.startUnique},sizeHeatmapDataVectors:{primary:t.sizeData,secondary:e.sizeData},sizeUniqueHeatmapDataVectors:{primary:t.sizeUniqueData,secondary:e.sizeUniqueData}};s.push(i)})))),o=[],s.forEach((t=>{let e=o.find((e=>e.sizeHeatmapData.primary===t.sizeHeatmapDataVectors.primary&&e.sizeHeatmapData.secondary===t.sizeHeatmapDataVectors.secondary));e||(e={sizeHeatmapData:t.sizeHeatmapDataVectors,tiles:[]},o.push(e)),e.tiles.push(t)})),{gridTiles:s,gridTileSizes:o}})(this.Qn,h,this.IU),l=a.gridTiles.map((t=>{const e=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary);return{...t,intensityData:e,hasIntensityData:!1}})),u=a.gridTileSizes.map((t=>({...t,tiles:l.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary))})));this.DU={gridTiles:l,gridTileSizes:u},this._S(this.Pi,this.mw)}Ls(){const t=this.TU,e=this.we,i=this.aa(),s=this.SS,r=s!==this.BU,n=this.PN.fillStylePaletted(i),o=this.PN.fillStyleSolid(i),h=this.kU.u,a=this.kU.C(),l=this.el,u=this.No.C();this.LU=this.LU||this.RU();const c=this.LU,d=mm(t,c,l?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));d.size>0&&(Am(this.ZR,d,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.FU=!0),this._E.BV(this.At);const f=this.zG;if((i||h)&&(f.tile=n?{renderMode:"paletted",fillStylePaletted:n,shader:this.ZR.Mz(Ug["2D"],Ug.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===a&&"bilinear",flipXY:"rows"===this.Qn.dataOrder,intensityTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN,lut:n.lut}),Ug.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:cg(this.At),flipXY:"rows"===this.Qn.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:"uniform"}),Ug.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:cg(this.At),flipXY:"rows"===this.Qn.dataOrder,normalSource:void 0}))}:void 0),r){const t=this.PN.wireframeStyleLine(r),e=this.PN.wireframeStyleFill(r);f.wireframe=t&&e?-1===t.getThickness()?{renderMode:"primitive",shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:"uniform"}),Ug.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Qn.dataOrder,axisWorldTranslation:cg(this.At),normalSource:void 0})),fillStyleSolid:e}:{renderMode:"triangulated",shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:"uniform"}),Ug.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Qn.dataOrder,axisWorldTranslation:cg(this.At),normalSource:void 0})),geometry:jy(this.ZR,1),solidLine:t,fillStyleSolid:e}:void 0,f.wireframe?this.EU=this.EU||this.zU():this.EU&&(this.ZR.LV(this.EU.wireframeCoordinatesBuffer),this.EU=void 0)}if(f.mousePicking=u?this.zG.mousePicking||{shader:this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:cg(this.At),flipXY:"rows"===this.Qn.dataOrder,normalSource:void 0}))}:void 0,this.zG=f,void 0===this.hl&&n&&"value"===n.lookUpProperty&&n.lut.percentageValues){let t=Be,e=ze;this.LU.gridTiles.forEach((i=>{for(let s=0;se&&(e=r)}})),this.hl={min:t,max:e}}return this.el=!1,this.TU.length=0,this.da(e),this.BU=s,this.kU.u=!1,this}RU(){const t=this.DU.gridTiles.map((t=>{const e=xm(this.ZR,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e,tileData:t}})),e=this.DU.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.ZR.MV([0,0,1,0,0,1,1,1]),s=this.ZR.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}zU(){const t=this.Qn.primaryDimensionVectorsCount+1+this.Qn.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{const e="columns"===this.Qn.dataOrder?{x:this.Pi.x+this.mw.x*t.iFirstVector.primary,y:this.Pi.y+this.mw.y*t.iFirstVector.secondary}:{x:this.Pi.x+this.mw.x*t.iFirstVector.secondary,y:this.Pi.y+this.mw.y*t.iFirstVector.primary},i="columns"===this.Qn.dataOrder?{x:this.mw.x*t.sizeHeatmapDataVectors.primary,y:this.mw.y*t.sizeHeatmapDataVectors.secondary}:{x:this.mw.x*t.sizeHeatmapDataVectors.secondary,y:this.mw.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.Qn.dataOrder?{x:this.Pi.x+this.mw.x*t.iFirstUniqueVector.primary,y:this.Pi.y+this.mw.y*t.iFirstUniqueVector.secondary}:{x:this.Pi.x+this.mw.x*t.iFirstUniqueVector.secondary,y:this.Pi.y+this.mw.y*t.iFirstUniqueVector.primary},n="columns"===this.Qn.dataOrder?{x:this.mw.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.mw.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.mw.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.mw.y*t.sizeUniqueHeatmapDataVectors.primary};r.set(t,{startLocationAxis:e,sizeAxis:i,startRenderLocationAxis:s,renderSizeAxis:n})})),this.VU={boundaries:s,tilesInfo:r},this}QL(t,e){var i,s;const r=this.LU,n=this.VU,o=1===t?null===(i=this.zG.mousePicking)||void 0===i?void 0:i.shader:null===(s=this.zG.tile)||void 0===s?void 0:s.shader;if(this.zG.tile&&o&&r&&n){const i=o,s=this.zG.tile,h={x:(n.boundaries.max.x-n.boundaries.min.x)*Math.sign(this.mw.x),y:(n.boundaries.max.y-n.boundaries.min.y)*Math.sign(this.mw.y)},a={x:h.x/this.Qn.columns,y:h.y/this.Qn.rows},l=this.At.Wi(),u={x:a.x/l.x,y:a.y/l.y};if("solid"===s.renderMode||1===t)this.ZR.aE(i).wV(i,((i,n,o)=>{if(1===t)this.ZR.QV(i("uFirstId"),e).YO(o,1);else if("solid"===s.renderMode){const{fillStyleSolid:t}=s;this.ZR.TR(i("uColor"),t.getColor())}return this.ZR.FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).CV(r.rectangleLocationsBuffer,void 0,{location:n("aPos"),size:2}).kV(i("uScaling"),[this.mw.x*this.Qn.columns,this.mw.y*this.Qn.rows]).kV(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).Jy(r.rectangleLocationsDrawMode,r.rectangleLocationsDrawLength),!0}));else if("paletted"===s.renderMode){const{fillStylePaletted:e}=s,o=this.hl;this.ZR.wV(i,((s,h,a)=>{let l=!1;var c,d;return this.ZR.aE(i).kV(s("uScale"),this._E.IV()).kV(s("uDisp"),this._E.PV()).JO(a,e.lut,o).CV(r.rectangleLocationsBuffer,void 0,{location:h("aPos"),size:2}).FV(s("uIsHighlighted"),this.Yo).TR(s("uHighlightColorOffset"),2===t?k:this.jo).FV(s("uRenderEffectMask"),2===t?1:0),c=t=>{this.ZR.kV(s("uTileDimensions"),["columns"===this.Qn.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.Qn.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},d=(t,e)=>{const i=n.tilesInfo.get(t.tileData);if(!i)return;let o;const h=this.ZR.lV();if("bilinear"===this.kU.C()){const t=(this.At.x.ft(i.startLocationAxis.x)+u.x/2)*h,e=(this.At.y.ft(i.startLocationAxis.y)+u.y/2)*h;o=[t,e,(this.At.x.ft(i.startLocationAxis.x+i.sizeAxis.x)-u.x/2)*h-t,(this.At.y.ft(i.startLocationAxis.y+i.sizeAxis.y)-u.y/2)*h-e]}else{const t=this.At.x.ft(i.startLocationAxis.x)*h,e=this.At.y.ft(i.startLocationAxis.y)*h;o=[t,e,this.At.x.ft(i.startLocationAxis.x+i.sizeAxis.x)*h-t,this.At.y.ft(i.startLocationAxis.y+i.sizeAxis.y)*h-e]}this.ZR.$V(s("uTileBounds"),o).kV(s("uScaling"),[i.renderSizeAxis.x,i.renderSizeAxis.y]).kV(s("uTranslationAxis"),[i.startRenderLocationAxis.x,i.startRenderLocationAxis.y]).TV(s("uTileIntensityValues"),t.intensityDataTexture,1).Jy(r.rectangleLocationsDrawMode,r.rectangleLocationsDrawLength),l=!0},r.gridTileSizes.forEach((t=>{c(t),t.tiles.forEach((t=>{d(t)}))})),l}))}}const h=this.EU,a=this.zG.wireframe,l=1===t||null==a?void 0:a.shader;if(h&&a&&l&&"primitive"===a.renderMode){const{fillStyleSolid:e}=a;this.ZR.aE(l).wV(l,((i,s,r)=>((this.At instanceof Bi||this.At instanceof Bc)&&this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()),this.ZR.FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).TR(i("uColor"),e.getColor()).CV(h.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).kV(i("uScaling"),[this.mw.x,this.mw.y]).kV(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).Jy(this.ZR.gl.LINES,2*h.wireframeSegmentsLength),!0)))}else if(h&&a&&l&&"triangulated"===a.renderMode){const{geometry:e,solidLine:i,fillStyleSolid:s}=a;this.ZR.aE(l).wV(l,((r,n,o)=>((this.At instanceof Bi||this.At instanceof Bc)&&this.ZR.kV(r("uScale"),this._E.IV()).kV(r("uDisp"),this._E.PV()),this.ZR.FV(r("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(r("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(r("uRenderEffectMask"),2===t?1:0).TR(r("uColor"),s.getColor()).FV(r("uThicknessPixels"),i.getThickness()).kV(r("uRatioPxClip"),[2/this.ls.oi().x,2/this.ls.oi().y]).CV(h.wireframeCoordinatesBuffer,1,{location:n("aLocationA"),size:2},{location:n("aLocationB"),size:2}).kV(r("uScaling"),[this.mw.x,this.mw.y]).kV(r("uTranslationAxis"),[this.Pi.x,this.Pi.y]),e.aE(o,!1).Jy(h.wireframeSegmentsLength),!0)))}return{idCount:1}}TN(t,e,i,s,r){return{}}FS(t){return this.TU.push(t),pm(this.DU.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this.hl=void 0,this}Ot(){return this.FU&&(this.DU.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.el=!0,this.FU=!1,this.hl=void 0),this}dispose(){super.dispose();const t=this.LU;t&&(t.gridTiles.forEach((t=>{this.ZR.qR(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.ZR.LV(t.rectangleLocationsBuffer)),this.LU=void 0;const e=this.EU;return e&&this.ZR.LV(e.wireframeCoordinatesBuffer),this.EU=void 0,this.zG={},this}KR(){return this.dispose(),this}Jc(t){const e=t,i="columns"===this.Qn.dataOrder?e.x:e.y,s="columns"===this.Qn.dataOrder?e.y:e.x,r="columns"===this.Qn.dataOrder?this.Pi.x:this.Pi.y,n="columns"===this.Qn.dataOrder?this.Pi.y:this.Pi.x;let o=(i-r)/("columns"===this.Qn.dataOrder?this.mw.x:this.mw.y),h=(s-n)/("columns"===this.Qn.dataOrder?this.mw.y:this.mw.x);o=Math.floor(Ft(o,0,this.Qn.primaryDimensionVectorsCount-1)),h=Math.floor(Ft(h,0,this.Qn.secondaryDimensionVectorsCount-1));const a=this.OU(o,h),l="columns"===this.Qn.dataOrder?{x:this.Pi.x+(o+.5)*this.mw.x,y:this.Pi.y+(h+.5)*this.mw.y}:{x:this.Pi.x+(h+.5)*this.mw.x,y:this.Pi.y+(o+.5)*this.mw.y},u="columns"===this.Qn.dataOrder?o:h,c="columns"===this.Qn.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}Hb(t){const e=this.VU;if(!e||t.xe.boundaries.max.x||t.ye.boundaries.max.y)return;const i=t,s="columns"===this.Qn.dataOrder?i.x:i.y,r="columns"===this.Qn.dataOrder?i.y:i.x,n="columns"===this.Qn.dataOrder?this.Pi.x:this.Pi.y,o="columns"===this.Qn.dataOrder?this.Pi.y:this.Pi.x,h="columns"===this.Qn.dataOrder?this.mw.x:this.mw.y,a="columns"===this.Qn.dataOrder?this.mw.y:this.mw.x,l=Ft((s-n)/h-.5,0,this.Qn.primaryDimensionVectorsCount-1),u=Ft((r-o)/a-.5,0,this.Qn.secondaryDimensionVectorsCount-1),c=Ft(Math.ceil(l)-1,0,this.Qn.primaryDimensionVectorsCount-1),d=Ft(Math.ceil(u)-1,0,this.Qn.secondaryDimensionVectorsCount-1),f={point:{x:c,y:d},value:this.OU(c,d)},g={point:{x:c,y:d+1},value:this.OU(c,d+1)},y={point:{x:c+1,y:d},value:this.OU(c+1,d)},m={point:{x:c+1,y:d+1},value:this.OU(c+1,d+1)},p=Nn({x:l,y:u},f,g,y,m);if(void 0===p)return;const x=Ft(Math.floor(l+.5),0,this.Qn.primaryDimensionVectorsCount-1),A=Ft(Math.floor(u+.5),0,this.Qn.secondaryDimensionVectorsCount-1),S="columns"===this.Qn.dataOrder?x:A,v="columns"===this.Qn.dataOrder?A:x,b=t;return{x:b.x,y:b.y,column:S,row:v,cellValue:p}}OU(t,e){for(let i=0;i=s.iFirstVector.primary&&t<=s.iFirstVector.primary+s.sizeHeatmapDataVectors.primary-1&&e>=s.iFirstVector.secondary&&e<=s.iFirstVector.secondary+s.sizeHeatmapDataVectors.secondary-1){const i=t-s.iFirstVector.primary,r=e-s.iFirstVector.secondary,n=i*s.sizeHeatmapDataVectors.secondary+r;return s.intensityData[n]}}return 0}St(){var t;return(null===(t=this.VU)||void 0===t?void 0:t.boundaries.max.x)||0}vt(){var t;return(null===(t=this.VU)||void 0===t?void 0:t.boundaries.min.x)||0}bt(){var t;return(null===(t=this.VU)||void 0===t?void 0:t.boundaries.max.y)||0}xt(){var t;return(null===(t=this.VU)||void 0===t?void 0:t.boundaries.min.y)||0}Cl(){return 0}kl(){return 0}n_(){const t=[];return this.DU.gridTiles.forEach((e=>{if(!e.hasIntensityData)return;const i=new Array(e.sizeUniqueHeatmapDataVectors.primary).fill(0).map((t=>new Array(e.sizeUniqueHeatmapDataVectors.secondary).fill(0)));for(let t=0;t0?"ProgressiveX":"RegressiveX":this.mw.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}),this.VW=new rm(this.At,this));const t=this.VW.IW(this.LM,this.Mu.C());if(t>0){for(let e=0;e0?this.LM[0].boundaries.min.x:Be:this.Ka.min.y=this.LM.length>0?this.LM[0].boundaries.min.y:Be}this.LM.forEach((t=>t.shape.Ls()));const e=this.LM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Pt(null===(i=e.shape.hl)||void 0===i?void 0:i.min,Be)),t.max=Math.max(t.max,Pt(null===(s=e.shape.hl)||void 0===s?void 0:s.max,ze)),t}),{min:Be,max:ze});return this.LM.forEach((t=>{t.shape.hl=e})),this.Mu.u=!1,this}QL(t,e){let i=0;return this.LM.forEach((s=>{const{idCount:r}=s.shape.QL(t,e+i);void 0!==r&&(i+=r)})),{idCount:i}}TN(t,e,i,s,r){return{}}LS(t){if(0===t.length)return this;let e=0;const i=this.GU.dataPerSegment,s=t.length;do{let r=this.LM[this.LM.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this.Qn.scrollDimension?i:this.Qn.resolution,rows:"rows"===this.Qn.scrollDimension?i:this.Qn.resolution,heatmapDataType:this.Qn.heatmapDataType,dataOrder:this.Qn.scrollDimension};let e="columns"===this.Qn.scrollDimension?{x:this.Pi.x+this.mw.x*this.NU,y:this.Pi.y}:{x:this.Pi.x,y:this.Pi.y+this.mw.y*this.NU};this.LM.length>0&&(e="columns"===this.Qn.scrollDimension?{x:e.x-1*this.mw.x,y:e.y}:{x:e.x,y:e.y-1*this.mw.y},o=!0);const s=new vm(this.bN,this.MN,this.At,kt,[],t).kS(this.kU.C()).Ie(this.we).xS(this.SS)._S(e,this.mw);r={shape:s,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.NU,hasJoint:!1,boundaries:{min:{x:s.vt(),y:s.xt()},max:{x:s.St(),y:s.bt()}}},this.LM.push(r),n=i-(o?1:0)}const h=s-e,a=Math.min(n,h),l=t.slice(e,e+a),u={type:"intensity",values:l,startPrimary:r.existingDataPointsCount+(r.hasJoint?1:0),startSecondary:0,lengthPrimary:a,lengthSecondary:this.Qn.resolution};o&&(u.values.unshift(this.WU),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.FS(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),this.WU=l[l.length-1],this.NU+=a,e+=a}while(e{const n=t.dataStartIndex,o=t.dataStartIndex+t.existingDataPointsCount-1;if(so)return;const h=i-n,a=Math.min(s,o),l=a-h+1,u=e.slice(h-i,a-i+1),c={type:"intensity",startSecondary:0,lengthSecondary:r,startPrimary:h,lengthPrimary:l,values:u};t.shape.FS(c)}));const n=this.NU-1;if(s>n){const t=s-n,i=e.slice(-t);if(i.length{t.shape.dispose().KR()})),this.LM.length=0,this.Ka="columns"===this.Qn.scrollDimension?y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.Qn.resolution*this.mw.y}):y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.Qn.resolution*this.mw.x,y:this.Pi.y}),this.NU=0,this.WU=void 0,this}_S(t,e){return super._S(t,e),this.LM.forEach(((i,s)=>{const r={x:t.x+i.dataStartIndex*e.x,y:t.y+i.dataStartIndex*e.y};i.shape._S(r,e),i.boundaries={min:{x:i.shape.vt(),y:i.shape.xt()},max:{x:i.shape.St(),y:i.shape.bt()}}})),this.LM.length>0?this.Ka=ei(...this.LM.map((t=>t.boundaries))):this.Ka="columns"===this.Qn.scrollDimension?y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.Qn.resolution*this.mw.y}):y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.Qn.resolution*this.mw.x,y:this.Pi.y}),this}Ie(t){return super.Ie(t),this.LM.forEach((t=>t.shape.Ie(this.we))),this}xS(t){return super.xS(t),this.LM.forEach((t=>t.shape.xS(this.SS))),this}kS(t){return super.kS(t),this.LM.forEach((e=>e.shape.kS(t))),this}dispose(){return super.dispose(),this.LM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.LM.forEach((e=>e.shape.setVisible(t))),this}KR(){return this.LM.forEach((t=>t.shape.KR())),this}Jc(t){const e=ct(t,this.At,this.engine.At),i=this.LM.reduce(((i,s)=>{const r=s.shape.Jc(t);if(r){const t=$e(ct(r,this.At,this.engine.At),e);if(void 0===i||t=this.NU||"rows"===this.Qn.scrollDimension&&e>=this.NU)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}Hb(t){const e=ct(t,this.At,this.engine.At),i=this.LM.reduce(((i,s)=>{const r=s.shape.Hb(t);if(r){const t=$e(ct(r,this.At,this.engine.At),e);if(void 0===i||t=this.NU||"rows"===this.Qn.scrollDimension&&e>=this.NU)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return 0}kl(){return 0}us(t){return super.us(t),this.LM.forEach((e=>e.shape.us(t))),this}}class wm extends tn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.kU=p("bilinear"),this.SS=Ir.lineStyle,this.Qn=n}kS(t){return this.kU._(t),this}TS(){return this.kU.C()}xS(t){return this.SS="function"==typeof t?t(this.SS):t,this}CS(){return this.SS}}class Cm extends wm{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._E=new Fy,this.zG={},this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStylePaletted:()=>H(this.we)&&this.we}),this.bN=t,this.MN=e,this.ZR=t._N(),this.MN=e,this.h_=new vm(this.bN,t.UU,t.At,kt,[],{columns:n.sectors,rows:n.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===n.dataOrder?"rows":"columns",PU:this.ZR.JR}).xS(nt);const o=2*Math.PI/360,h=new Float32Array(724);let a=0;h[a+0]=0,h[a+1]=0,a+=2;for(let t=0;t<=360;t+=1){const e=t*o,i=Math.cos(e),s=Math.sin(e);h[a+0]=i,h[a+1]=s,a+=2}this.YU={vertexBuffer:this.ZR.MV(h),drawMode:this.ZR.gl.TRIANGLE_FAN,drawLength:362}}Ls(){const t=this.aa(),e=this.we,i=this.PN.fillStyleSolid(t),s=this.PN.fillStylePaletted(t),r=i||s,n=this.kU.C(),o=this.kU.u,h=this.No.C(),a=this.No.u;return this._E.BV(this.At),this.h_.Ls(),this.h_.LU?((t||o)&&(this.zG.fill=r?{shader:this.ZR.Mz(Ug["2D"],Ug.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:cg(this.At),normalSource:void 0}),s&&Ug.PolarHeatmap({interpolation:"bilinear"===n&&"bilinear",intensityTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this.Qn.dataOrder,lut:s.lut}),i&&Ug.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:s,fillStyleSolid:i}:void 0),a&&(this.zG.mousePicking=h?{shader:this.ZR.Mz(Ug["2D"],Ug.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:cg(this.At),normalSource:void 0}),Ug.MousePicking())}:void 0),this.da(e),this.kU.u=!1,this.No.u=!1,this):this}QL(t,e){var i;const{vertexBuffer:s,drawLength:r,drawMode:n}=this.YU,o=this.h_.LU;if(!this.zG.fill||!o)return{};const{fillStylePaletted:h,fillStyleSolid:a}=this.zG.fill,l=1===t?null===(i=this.zG.mousePicking)||void 0===i?void 0:i.shader:this.zG.fill.shader;if(!l)return{};const u=this.At.Cb(),c=Math.min(u.start,u.end),d=Math.max(u.start,u.end),f=Math.min(this.Qn.amplitudeStart,this.Qn.amplitudeStart+(this.Qn.annuli-1)*this.Qn.amplitudeStep),g=Math.max(this.Qn.amplitudeStart,this.Qn.amplitudeStart+(this.Qn.annuli-1)*this.Qn.amplitudeStep);let y;return y=u.end>u.start?Math.min(g,d)-u.start:Math.max(f,c)-u.start,this.ZR.aE(l).wV(l,((i,l,u,c)=>{if(this.ZR.kV(i("uScale"),this._E.IV()).kV(i("uDisp"),this._E.PV()).FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0).kV(c("uViewportSize"),[this.bN.oi().x*this.ZR.lV()/(1===t?this.ls.Qn.qn:1),this.bN.oi().y*this.ZR.lV()/(1===t?this.ls.Qn.qn:1)]).kV(i("uScaling"),[y,y]).kV(i("uTranslationAxis"),[0,0]).CV(s,void 0,{location:l("aPos"),size:2}).FV(c("uAngleOffset"),this.At.Pb()%(2*Math.PI)).FV(c("uAngleDirection"),this.At.Eb()?1:-1).FV(c("uSectors"),this.Qn.sectors).FV(c("uAnnuli"),this.Qn.annuli),1===t)this.ZR.QV(i("uFirstId"),e).YO(u,1);else{if(this.ZR.FV(i("uAmplitudeStart"),this.Qn.amplitudeStart).FV(i("uAmplitudeStep"),this.Qn.amplitudeStep).FV(i("uAmplitudeAxisStart"),this.At.Cb().start).FV(i("uAmplitudeAxisEnd"),this.At.Cb().end),h){const t=this.h_.hl;this.ZR.JO(u,h.lut,t).TV(i("uTileIntensityValues"),o.gridTiles[0].intensityDataTexture,0)}a&&this.ZR.TR(i("uColor"),a.getColor())}return this.ZR.Jy(n,r),!0})),{idCount:1}}TN(t,e,i,s,r){return{}}FS(t){return this.h_.FS(t),this}Ot(){return this.h_.Ot(),this}dispose(){return super.dispose(),this.h_.dispose(),this.zG={},this.ZR.LV(this.YU.vertexBuffer),this}KR(){return this.dispose(),this}Ie(t){return super.Ie(t),this.h_.Ie(this.we),this}Jc(t){const e=this.Qn.amplitudeStart,i=this.Qn.amplitudeStart+(this.Qn.annuli-1)*this.Qn.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituder)return;let n=Math.round((t.angle-0)/360*this.Qn.sectors);n>=this.Qn.sectors&&(n=0);const o=Math.round((t.amplitude-e)/(i-e)*(this.Qn.annuli-1));return{iAnnulus:o,iSector:n,cellValue:this.OU(o,n),angle:n*(360/this.Qn.sectors),amplitude:e+o*(i-e)/(this.Qn.annuli-1)}}Hb(t){const e=this.Qn.amplitudeStart,i=this.Qn.amplitudeStart+(this.Qn.annuli-1)*this.Qn.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituder)return;const n=(t.angle-0)/360*this.Qn.sectors,o=(t.amplitude-e)/(i-e)*(this.Qn.annuli-1),h=Math.floor(n),a=Math.floor(o),l={point:{x:a,y:h},value:this.OU(a,h)},u={point:{x:a,y:h+1},value:this.OU(a,h+1)},c={point:{x:a+1,y:h},value:this.OU(a+1,h)},d={point:{x:a+1,y:h+1},value:this.OU(a+1,h+1)},f=Nn({x:o,y:n},l,u,c,d);return void 0!==f?{iAnnulus:a,iSector:h,cellValue:f,angle:t.angle,amplitude:t.amplitude}:void 0}OU(t,e){const i="annuli"===this.Qn.dataOrder?t:e,s="annuli"===this.Qn.dataOrder?e:t;for(let t=0;t=e.iFirstVector.primary&&i<=e.iFirstVector.primary+e.sizeHeatmapDataVectors.primary-1&&s>=e.iFirstVector.secondary&&s<=e.iFirstVector.secondary+e.sizeHeatmapDataVectors.secondary-1){const t=i-e.iFirstVector.primary,r=s-e.iFirstVector.secondary,n=t*e.sizeHeatmapDataVectors.secondary+r;return e.intensityData[n]}}return 0}St(){return 0}vt(){return 0}bt(){return 0}xt(){return 0}Cl(){return 0}kl(){return 0}}class Tm extends by{constructor(t){super(t);const{vertices:e,drawMode:i,drawSize:s}=this.MG();this._G=t.MV(e),this.CG=s,this.kG=i}aE(t){return this.ZR.CV(this._G,0,{location:t.attribute("aCurveOrBaseline"),size:1},{location:t.attribute("aSegmentSide"),size:1}),this}Jy(t,e,i){return this.ZR.fO(void 0!==e?e:this.kG,i||0,this.CG,t),this}MG(){return{vertices:new Float32Array([1,0,0,0,0,1,0,1,1,1,1,0]),drawMode:this.ZR.gl.TRIANGLES,drawSize:6}}Yz(){this.ZR.LV(this._G)}}const Rm=t=>{let e=t.GV.Nz.get(void 0);return e||(e=new Tm(t),t.GV.Nz.set(void 0,e),e)};class Em extends dn{constructor(t,i,s,r){super(t,i,s,r,[{type:"DataPattern",args:{pattern:"ProgressiveX"}}]),this.HU=Ir.fillStyle,this.$U=Ir.fillStyle,this.XU=p(e.PointShape.Circle),this.jU=p(5),this.ZU=p(0),this.QU=p(void 0),this.EC=!0,this.JU={x:0,y:0}}yd(t){return this.HU=Qr(this.HU,t),this}VC(){return this.HU}KU(){return qr(this.qU,this.HU)}tY(){return qr(this.iY,this.$U)}pd(t){return this.$U=Qr(this.$U,t),Jn(this.$U)&&(this.vd(e.PointShape.Square),this._d(1)),this}Md(){return this.$U}vd(t){return this.XU._(t),oo(this.XU.C())&&this._d(1),this}Sd(){return this.XU.C()}_d(t){return this.jU._(t),this}OC(){return this.jU.C()}xd(t){return this.ZU._(t),this}bd(){return this.ZU.C()}NC(t){return this.JU=t,this}GC(){return this.JU}RC(t){return this.QU._(t),this}WC(){return this.QU.C()}}class km extends Jy{constructor(t,e){super(t,e),this.nW=!1,this.oW={enabled:!1,totalDataPointsAtTime:0},this.lW=t instanceof Bi?{type:"linear",scale:t}:{type:"unknown"},this.rW.Qo("DataPattern",(t=>{!1===t.allowDataGrouping&&(this.nW=!0)}))}sY(t,e){var i,s;const r=null==t?void 0:t.Pc,n=null==t?void 0:t.Dc,o=null==t?void 0:t.Ac,h=null==t?void 0:t.fc;if(!t||this.nW||!this.sW||"linear"!==this.lW.type||!r||!n||void 0===o||void 0===h||!e)return{cpStateChanged:!1,cpActive:!1};const a=null===(i=t.Ic())||void 0===i?void 0:i.x,l=null===(s=t.Zc())||void 0===s?void 0:s.x;if(o<2||void 0===a||void 0===l||l===a)return{cpStateChanged:!1,cpActive:!1};const u=this.calculateAvgStepBetweenDataPoints(l,a,o),c=this.lW.scale,d=Math.abs("x"===this.sW?c.Wi().x:c.Wi().y),f=d/u,g=Math.floor(.8*f),y=g*u,m=g>=4,p=this.oW.enabled?this.oW.columnWidthAxis/d<1.5:void 0,x=this.oW.enabled&&g>this.oW.dataPointsPerColumn?g/this.oW.dataPointsPerColumn>=2:void 0;let A;return!0===this.oW.enabled?p?x&&(A={enabled:!0,columnWidthAxis:y,dataPointsPerColumn:g,totalDataPointsAtTime:o}):A=m?{enabled:!0,columnWidthAxis:y,dataPointsPerColumn:g,totalDataPointsAtTime:o}:{enabled:!1,totalDataPointsAtTime:o}:m&&(A={enabled:!0,columnWidthAxis:y,dataPointsPerColumn:g,totalDataPointsAtTime:o}),this.oW=A||{...this.oW,totalDataPointsAtTime:o},!!A&&this.fW(),{cpStateChanged:!!A,cpActive:this.oW.enabled}}eY(t,e){var i,s,r;const n=t.Pc,o=t.Dc,h=t.gc,a=t.Ac,l=t.fc;if(this.nW||!this.oW.enabled||!n||!o||void 0===e)return;const u=n.length,c=this.oW.columnWidthAxis,d=this.At.x.getInnerStart(),f=this.At.x.getInnerEnd(),g=co(d,f,n,h,a,l,e,1);if(!g)return;const y=n[g.iFirstSampleDataArray];if(this.hY){if(this.hY.iFirstPackedSample0)if(this.hY.packedColumnsCount-=t,this.hY.packedColumnsCount>0){this.hY.packedDataX.splice(0,2*t),this.hY.packedDataY.splice(0,2*t),this.hY.packedDataColors&&this.hY.packedDataColors.splice(0,2*t),this.hY.packedDataLookupValues&&this.hY.packedDataLookupValues.splice(0,2*t),this.hY.origin+=t*c;const e=fo(this.hY.origin,Math.max(h-1-u+1,0),h-1,(t=>n[uo(t,h,u)])),i=uo(e,h,u);this.hY.iFirstPackedSample=n[i]>=this.hY.origin?e:e+1}else this.hY=void 0}if(void 0!==(null===(i=this.hY)||void 0===i?void 0:i.iLastPackedSample)&&this.hY.iLastPackedSample>g.iLastSample){const t=n[g.iLastSampleDataArray],e=Math.min(Math.floor((this.hY.origin+this.hY.packedColumnsCount*c-t)/c),this.hY.packedColumnsCount);if(e>0)if(this.hY.packedColumnsCount-=e,this.hY.packedColumnsCount>0){for(let t=0;t<2*e;t+=1)this.hY.packedDataX.pop(),this.hY.packedDataY.pop(),this.hY.packedDataColors&&this.hY.packedDataColors.pop(),this.hY.packedDataLookupValues&&this.hY.packedDataLookupValues.pop();const t=fo(this.hY.origin+this.hY.packedColumnsCount*c,Math.max(h-1-u+1,0),h-1,(t=>n[uo(t,h,u)])),i=uo(t,h,u);this.hY.iLastPackedSample=n[i]<=this.hY.origin+this.hY.packedColumnsCount*c?t:t-1}else this.hY=void 0}}const m=this.hY||{origin:y,packedColumnsCount:0,packedDataX:[],packedDataY:[],packedDataColors:t.Nc?[]:void 0,packedDataLookupValues:t.Oc?[]:void 0,packedDataSize:t.Gc?[]:void 0,packedDataRotation:t.Wc?[]:void 0,iFirstPackedSample:g.iFirstSample,iLastPackedSample:void 0},p=(t,e,i)=>{let s=Math.min(t,t+e*c),r=Math.max(t,t+e*c),a=i;const l=[];let y=ze,p=ze,x=-1,A=Be,S=Be,v=-1,b=0;for(;a<=g.iLastSample&&a>=g.iFirstSample;){const i=a%u,g=n[i],M=o[i];if(s<=g&&g<=r)b+=1,Number.isNaN(M)||(M>p&&(y=g,p=M,x=a),M0)y=y===ze?Number.NaN:y,p=p===ze?Number.NaN:p,A=A===Be?Number.NaN:A,S=S===Be?Number.NaN:S,x0?(m.packedDataX.push(y),m.packedDataY.push(p),m.packedDataX.push(A),m.packedDataY.push(S)):(m.packedDataX.unshift(A),m.packedDataY.unshift(S),m.packedDataX.unshift(y),m.packedDataY.unshift(p))):(l.push({iFirst:v,iSecond:x}),e>0?(m.packedDataX.push(A),m.packedDataY.push(S),m.packedDataX.push(y),m.packedDataY.push(p)):(m.packedDataX.unshift(y),m.packedDataY.unshift(p),m.packedDataX.unshift(A),m.packedDataY.unshift(S)));else{const t=e>0?m.iLastPackedSample:m.iFirstPackedSample;if(void 0===t)l.push({iFirst:0,iSecond:0}),e>0?(m.packedDataX.push(Number.NaN),m.packedDataY.push(Number.NaN),m.packedDataX.push(Number.NaN),m.packedDataY.push(Number.NaN)):(m.packedDataX.unshift(Number.NaN),m.packedDataY.unshift(Number.NaN),m.packedDataX.unshift(Number.NaN),m.packedDataY.unshift(Number.NaN));else{const i=uo(t,h,u),a=n[i],d=o[i],f=(s+r)/2,y=f-e*c/6,p=d+(y-a)/(g-a)*(M-d),x=f+e*c/6,A=d+(x-a)/(g-a)*(M-d);l.push({iFirst:t,iSecond:t}),e>0?(m.packedDataX.push(y),m.packedDataY.push(p),m.packedDataX.push(x),m.packedDataY.push(A)):(m.packedDataX.unshift(y),m.packedDataY.unshift(p),m.packedDataX.unshift(x),m.packedDataY.unshift(A))}}if(m.packedColumnsCount+=1,e>0?m.iLastPackedSample=a-1:(m.iFirstPackedSample=a+1,m.origin=s),s=Math.min(t+l.length*e*c,t+(l.length+1)*e*c),r=Math.max(t+l.length*e*c,t+(l.length+1)*e*c),b=0,y=ze,p=ze,x=-1,A=Be,S=Be,v=-1,sf)break}}return l},x=p(m.origin+m.packedColumnsCount*c,1,void 0!==(null===(s=this.hY)||void 0===s?void 0:s.iLastPackedSample)?this.hY.iLastPackedSample+1:g.iFirstSample),A=p(m.origin,-1,void 0!==(null===(r=this.hY)||void 0===r?void 0:r.iFirstPackedSample)?this.hY.iFirstPackedSample-1:g.iFirstSample),S=t.Nc&&m.packedDataColors?[t.Nc,m.packedDataColors]:void 0,v=t.Oc&&m.packedDataLookupValues?[t.Oc,m.packedDataLookupValues]:void 0,b=t.Gc&&m.packedDataSize?[t.Gc,m.packedDataSize]:void 0,M=t.Wc&&m.packedDataRotation?[t.Wc,m.packedDataRotation]:void 0;if(S||v||b||M){for(const t of x){const e=uo(t.iFirst,h,u),i=uo(t.iSecond,h,u);S&&S[1].push(S[0][e],S[0][i]),v&&v[1].push(v[0][e],v[0][i]),b&&b[1].push(b[0][e],b[0][i]),M&&M[1].push(M[0][e],M[0][i])}for(const t of A){const e=uo(t.iFirst,h,u),i=uo(t.iSecond,h,u);S&&S[1].unshift(S[0][i],S[0][e]),v&&v[1].unshift(v[0][i],v[0][e]),b&&b[1].unshift(b[0][i],b[0][e]),M&&M[1].unshift(M[0][i],M[0][e])}}return this.hY=m.packedColumnsCount>0?m:void 0,{x:m.packedDataX,y:m.packedDataY,color:m.packedDataColors,lookup:m.packedDataLookupValues,size:m.packedDataSize,rotation:m.packedDataRotation}}fW(){this.hY=void 0}pW(t){if(this.sW&&"linear"===this.lW.type){const e="x"===this.sW?this.lW.scale.x.ag:this.lW.scale.y.ag;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.hh===Os.progressive||e.hh===Os.regressive){const e=Math.abs("x"===this.sW?this.lW.scale.x.getInnerInterval():this.lW.scale.y.getInnerInterval());if(this.oW.enabled)return 2*e/this.oW.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.sW?s.x:s.y,"x"===this.sW?r.x:r.y,i)}}}yW(t,e,i){if(!this.sW)return e;const s=i.length;let r=Gr(i,t.min,this.sW,this.eW,0,s-1);void 0===r&&(r=this.eW?s-1:0);let n=Gr(i,t.max,this.sW,this.eW,0,s-1);return void 0===n&&(n=this.eW?0:s-1),1+Math.abs(n-r)}mW(){}}class Im extends Em{constructor(t,e,i,s){super(t,e,i,s),this._E=new Fy,this.EW=new km(this.At,this),this.PN=dg({lineStyleSolid:()=>ts(this.gu)&&this.gu,lineStyleDashed:()=>so(this.gu)&&this.gu,strokeFillSolid:()=>{const t=this.gu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.gu.getFillStyle();return st(t)&&t},strokeFillRadialGradient:()=>{const t=this.gu.getFillStyle();return tt(t)&&t},strokeFillIndividual:()=>{const t=this.gu.getFillStyle();return X(t)&&t},strokeFillPaletted:()=>{const t=this.gu.getFillStyle();return H(t)&&t},areaFillSolid:()=>Y(this.HU)&&this.HU,areaFillLinearGradient:()=>st(this.HU)&&this.HU,areaFillRadialGradient:()=>tt(this.HU)&&this.HU,areaFillIndividual:()=>X(this.HU)&&this.HU,areaFillPaletted:()=>H(this.HU)&&this.HU,markerFillSolid:()=>Y(this.$U)&&this.$U,markerFillLinearGradient:()=>st(this.$U)&&this.$U,markerFillRadialGradient:()=>tt(this.$U)&&this.$U,markerFillPaletted:()=>H(this.$U)&&this.$U,markerFillIndividual:()=>X(this.$U)&&this.$U,markerFillImage:()=>Jn(this.$U)&&this.$U,markerShapeIcon:()=>{const t=this.XU.C();return oo(t)&&t}}),this.Ad=p(void 0),this.rY=[],this.el=!1,this.nY=[],this.oY=void 0,this.xM={Ek:"x",zk:()=>this.aY()},this.bU=(t,e,i)=>{var s;const r=null===(s=this.lY)||void 0===s?void 0:s.shapeIcon;let n=t,o=e;return r&&(n=r.oi().x,o=r.oi().y),Cy(t,e,n*this.jU.C(),o*this.jU.C(),i)},this.MN=e,this.zG={type:"none"},this.ZR=t._N(),this.bN=t,this.LG=this.ZR.SO}gd(t){return this.Ad._(De(t,this.Ad.C(),(()=>[t.Kc(((e,i)=>{this.rY.push({min:e,max:i}),void 0===t.$c()&&this.uY&&this.nY.push({min:e,max:i})})),t.qc((()=>{this.el=!0,this.uY=void 0,this.oY=void 0,this.EW.fW()}))]))),this.oY=void 0,this}aY(){var t,i,s,r,n,o,h,a,l,c,d,f,g;const y=null===(t=this.Ad.C())||void 0===t?void 0:t.Gt,m=this.Ad.u,p=null==y?void 0:y.Pc,x=null==y?void 0:y.Dc;if(!y||!p||!x)return;const A=y.Oc,S=y.Nc,v=y.Gc,b=y.Wc,M=y.gc,w=y.Ac,C=y.fc,T=m||this.fa()||this.KU()||this.tY(),R=this.PN.lineStyleSolid(T),E=this.PN.lineStyleDashed(T),k=R||E,I=k&&k.getThickness(),F=this.PN.strokeFillSolid(T),D=this.PN.strokeFillLinearGradient(T),P=this.PN.strokeFillRadialGradient(T),L=this.PN.strokeFillIndividual(T),V=this.PN.strokeFillPaletted(T),_=F||D||P||L||V,B=this.PN.areaFillSolid(T),z=this.PN.areaFillLinearGradient(T),N=this.PN.areaFillRadialGradient(T),O=this.PN.areaFillIndividual(T),U=this.PN.areaFillPaletted(T),Y=B||z||N||O||U,G=this.PN.markerFillSolid(T),X=this.PN.markerFillLinearGradient(T),Z=this.PN.markerFillRadialGradient(T),H=this.PN.markerFillPaletted(T),W=this.PN.markerFillIndividual(T),j=this.PN.markerFillImage(T),K=G||X||Z||H||W||j,$=this.XU.C(),Q=this.XU.u,q=this.PN.markerShapeIcon(Q),J=this.jU.C(),tt=this.jU.u,et=this.QU.u,it=this.rY.length>0||et,st=this.el,rt=st?[y.Xc()]:(t=>{const e=[];for(const i of t){let t=!1;for(const s of e)if(i.min>=s.min&&i.min<=s.max||i.max>=s.min&&i.max<=s.max){s.min=Math.min(s.min,i.min),s.max=Math.min(s.max,i.max),t=!0;break}t||e.push(i)}return e})(this.rY),nt=this.At.x.Yt,ot=this.At.x.getInnerStart(),ht=this.At.x.getInnerEnd(),at=y.$c(),lt=!!E,ut=this.No.C(),ct=this.No.u,{cpStateChanged:dt,cpActive:ft}=this.EW.sY(y,this.EC);if(at&&ft&&(dt||st||it||nt||T)){const t=this.EW.eY(y,at);if(t){const e=!dt&&!st&&!T;this.cY=Fm(this.ZR,[t.x,t.y],t.color,t.lookup,t.size,t.rotation,lt,this.cY,e,at,1e3,this.At._i(),(t=>qt(t,this.At._i()))),this.dY={min:Be,max:ze};const i=t.y.length;for(let e=0;ethis.gY.iLastSample||T){let i,s,r,n,h,a;if(1===t.dataRanges.length){const e=t.dataRanges[0];i=p.subarray(e.offset,e.offset+e.count),s=x.subarray(e.offset,e.offset+e.count),r=S?S.subarray(e.offset,e.offset+e.count):void 0,n=A?A.subarray(e.offset,e.offset+e.count):void 0,h=v?v.subarray(e.offset,e.offset+e.count):void 0,a=b?b.subarray(e.offset,e.offset+e.count):void 0}else{const e=t.dataRanges[0],o=t.dataRanges[1],l=e.count+o.count;i=new Float32Array(l),i.set(p.subarray(e.offset),0),i.set(p.subarray(o.offset,o.offset+o.count),e.count),s=new Float32Array(l),s.set(x.subarray(e.offset),0),s.set(x.subarray(o.offset,o.offset+o.count),e.count),S&&(r=new Uint32Array(l),r.set(S.subarray(e.offset),0),r.set(S.subarray(o.offset,o.offset+o.count),e.count)),A&&(n=new Float32Array(l),n.set(A.subarray(e.offset),0),n.set(A.subarray(o.offset,o.offset+o.count),e.count)),v&&(h=new Float32Array(l),h.set(v.subarray(e.offset),0),h.set(v.subarray(o.offset,o.offset+o.count),e.count)),b&&(a=new Float32Array(l),a.set(b.subarray(e.offset),0),a.set(b.subarray(o.offset,o.offset+o.count),e.count))}const l=!dt&&!st&&!T;this.AY=Fm(this.ZR,[i,s],r,n,h,a,lt,this.AY,l,at,1e3,this.At._i(),(t=>qt(t,this.At._i())));let c=i,d=s,f=r,g=n;const y=this.QU.C();if(y){const t="spline"===y.type?((t,e)=>{const{xValues:i,yValues:s,lookupValues:r,colors:n}=t;if(i.length<=2)return{xValues:Array.from(i),yValues:Array.from(s),lookupValues:r?Array.from(r):void 0,colors:n?Array.from(n):void 0};const o=((t,e)=>{const i=1e-5,s=t.length-1,r=Array(s);if(s>1){let n=u(0,0),o=u(0,0),h=u(0,0),a=oi(ci({x:t[1],y:e[1]},{x:t[0],y:e[0]}));const l=3;let c=0,d=0;for(let f=0;fi?Math.abs(e/(l*n.x)):1,d=Math.abs(o.x)>i?Math.abs(e/(l*o.x)):1}g[1]=ui(li(n,c),g[1]),g[2]=ci(g[2],li(o,d)),r[f]=g}}return r.length>0?r:[]})(i,s),h=o.length,a=[],l=[],c=[],d=[];for(let t=0;t{const{xValues:s,yValues:r,lookupValues:n,colors:o}=t,h=[],a=[],l=[],u=[],c=s.length,d=i;if(c>0){let t=0,e=s[0],i=r[0];h[t]=e,a[t]=i,t+=1;for(let n=1;nqt(t,this.At._i()))),this.gY=t}}else this.fY=void 0;if(!at&&(st||it||T)){if(!this.cY||this.cY.bufferSize{var s,r,n,o;const h=p.subarray(i.min,i.max+1),a=x.subarray(i.min,i.max+1);if(this.ZR.tO(t,i.min*(this.At._i()?2:1),qt(h,this.At._i())),this.ZR.tO(e,i.min*(this.At._i()?2:1),qt(a,this.At._i())),S&&(null===(s=this.cY)||void 0===s?void 0:s.bufferColors)){const t=S.subarray(i.min,i.max+1);this.ZR.tO(this.cY.bufferColors,i.min,t,Uint32Array)}if(A&&(null===(r=this.cY)||void 0===r?void 0:r.bufferLookupValues)){const t=A.subarray(i.min,i.max+1);this.ZR.tO(this.cY.bufferLookupValues,i.min,t,Float32Array)}if(b&&(null===(n=this.cY)||void 0===n?void 0:n.bufferRotations)){const t=b.subarray(i.min,i.max+1);this.ZR.tO(this.cY.bufferRotations,i.min,t,Float32Array)}if(v&&(null===(o=this.cY)||void 0===o?void 0:o.bufferSizes)){const t=v.subarray(i.min,i.max+1);this.ZR.tO(this.cY.bufferSizes,i.min,t,Float32Array)}})),this.cY.valueCount=y.Ac}this.AY=this.cY}if(T||tt||Q||ct){if(_&&k&&!1!==I){const t=-1===I?"primitive":"triangulated",e=V?["lookup",V.lookUpProperty,V.lut]:L?"attribute":D?["gradient",D]:P?["gradient",P]:"uniform";this.zG="primitive"===t?{type:t,shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0}),E&&Ug.StippleTexture),lineStyleSolid:R,lineStyleDashed:E,fillStyleSolid:F,fillStyleLinearGradient:D,fillStyleRadialGradient:P,fillStyleIndividual:L,fillStylePaletted:V,mousePickingShader:ut&&this.ZR.Mz(Ug["2D"],Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0}),E&&Ug.StippleTexture,Ug.MousePicking({useVertexId:!0}))}:"triangulated"===t?{type:t,shader:this.ZR.Mz(Ug["2D"],Ug.Color({dataType:e}),Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0}),this.LG?Ug.AliasedEdge:void 0,E&&Ug.StippleTextureInstanced),geometry:jy(this.ZR,I),thickness:I,lineStyleSolid:R,lineStyleDashed:E,fillStyleSolid:F,fillStyleLinearGradient:D,fillStyleRadialGradient:P,fillStyleIndividual:L,fillStylePaletted:V,mousePickingShader:ut&&this.ZR.Mz(Ug["2D"],Ug.LineInstanced2D({axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0}),E&&Ug.StippleTextureInstanced,Ug.MousePicking())}:{type:"none"}}else this.zG={type:"none"};if(this.pY=Y?{shader:this.ZR.Mz(Ug["2D"],U&&Ug.Color({dataType:["lookup",U.lookUpProperty,U.lut]}),O&&Ug.Color({dataType:"attribute"}),B&&Ug.Color({dataType:"uniform"}),z&&Ug.Color({dataType:["gradient",z]}),N&&Ug.Color({dataType:["gradient",N]}),Ug.Area2D({axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0})),geometry:Rm(this.ZR),fillStyleSolid:B,fillStyleLinearGradient:z,fillStyleRadialGradient:N,fillStyleIndividual:O,fillStylePaletted:U,mousePickingShader:ut&&this.ZR.Mz(Ug["2D"],Ug.Area2D({axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0}),Ug.MousePicking())}:void 0,K){const t=!(!j&&!q),e=J>1||t,i=v?"attribute":"uniform",s=!e&&Ug.PointSize("uniform"),r=Ug.VertexLocation({offset:e&&!t?{dataType:i,sizeUnit:"px",symmetric:!0,rotation:{dataType:b?"attribute-deg":"uniform"},useAlignment:!0}:e&&t?{dataType:i,sizeUnit:"scale",rotation:{dataType:b?"attribute-deg":"uniform"},useAlignment:!0}:void 0,axisWorldTranslation:cg(this.At),normalSource:void 0,splitPosAttribute:!0});this.lY={shader:this.ZR.Mz(Ug["2D"],s,r,G&&Ug.Color({dataType:"uniform",overrideOpacity:!0,maskTexture:!!q}),X&&Ug.Color({dataType:["gradient",X],overrideOpacity:!0,maskTexture:!!q}),Z&&Ug.Color({dataType:["gradient",Z],overrideOpacity:!0,maskTexture:!!q}),H&&Ug.Color({dataType:["lookup",H.getLookUpProperty(),H.getPalette()],overrideOpacity:!0,maskTexture:!!q}),W&&Ug.Color({dataType:"attribute",overrideOpacity:!0,maskTexture:!!q}),j&&Ug.Color({dataType:["image",j],overrideOpacity:!0,maskTexture:!!q})),geometry:lm($,this.ZR,"uniform"===i?J:25),fillStyleSolid:G,fillStyleLinearGradient:X,fillStyleRadialGradient:Z,fillStylePaletted:H,fillStyleIndividual:W,fillStyleImage:j,mousePickingShader:ut&&this.ZR.Mz(Ug["2D"],s,r,Ug.MousePicking({useVertexId:!e})),shapeIcon:q,pointSizeAsScale:t,instancedRendering:e}}else this.lY=void 0}if((void 0===this.oY||it)&&A&&(gg(V)||gg(U)||gg(H))){const t=this.oY?rt:[y.Xc()];let e=this.oY?this.oY.max:ze,i=this.oY?this.oY.min:Be;const s=A;t.forEach((t=>{for(let r=t.min;r<=t.max;r+=1){const t=s[r];i=te?t:e}})),this.oY={min:i,max:e}}this.xU=this.ZR.KO(this,this.xU,j,q,tt,this.bU),this.OG=E?this.ZR.XO(E.getPattern()):void 0,this.vu(this.gu),this.qU=this.HU,this.iY=this.$U,this.XU.u=!1,this.jU.u=!1,this.rY.length=0,this.el=!1,this.QU.u=!1,this.Ad.u=!1,this.No.u=!1}Ls(){this.aY();const t=this.PN.strokeFillLinearGradient(!1),e=this.PN.strokeFillRadialGradient(!1),i=this.PN.areaFillLinearGradient(!1),s=this.PN.areaFillRadialGradient(!1),r=this.PN.markerFillLinearGradient(!1),n=this.PN.markerFillRadialGradient(!1);this._E.BV(this.At);const o=$r({min:{x:this.vt(),y:this.At.y.getInnerStart()},max:{x:this.St(),y:this.bt()}},{x:this.Cl(),y:this.kl()},this.At),h=$r({min:{x:this.vt(),y:this.xt()},max:{x:this.St(),y:this.bt()}},{x:this.Cl(),y:this.kl()},this.At);return this.yY=this.ZR.eN(t,this,h),this.mY=this.ZR.hN(e,this,h),this.vY=this.ZR.eN(i,this,o),this.SY=this.ZR.hN(s,this,o),this.xY=this.ZR.eN(r,this,h),this.bY=this.ZR.hN(n,this,h),this}QL(t,e){var i,s,r,n,o,h,a,l,u,c,d,f,g,y,m,p,x,A,S;const v=this.ZR.gl,b=null===(i=this.cY)||void 0===i?void 0:i.bufferX,M=null===(s=this.cY)||void 0===s?void 0:s.bufferY,w=null===(r=this.cY)||void 0===r?void 0:r.bufferColors,C=null===(n=this.cY)||void 0===n?void 0:n.bufferLookupValues,T=null===(o=this.cY)||void 0===o?void 0:o.valueCount,R=null===(h=this.AY)||void 0===h?void 0:h.valueCount,E=null===(a=this.Ad.C())||void 0===a?void 0:a.Gt,k=null==E?void 0:E.$c(),I=Math.max((null===(l=this.cY)||void 0===l?void 0:l.valueCount)||0,(null===(u=this.AY)||void 0===u?void 0:u.valueCount)||0);if(!b||!M||!E)return{};const F=(e,i,s)=>{if(Pm(this.ZR,e,this.At._i(),b,"aLocation","X",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT),Pm(this.ZR,e,this.At._i(),M,"aLocation","Y",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT),i&&1!==t){if(!w)return!1;Pm(this.ZR,e,!1,w,"aColor","",4,!0,v.UNSIGNED_BYTE,1)}if(s&&"value"===s.lookUpProperty&&1!==t){if(!C)return!1;Pm(this.ZR,e,!1,C,"aLookupValue","",1,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT)}return!0},D=1===t?null===(c=this.pY)||void 0===c?void 0:c.mousePickingShader:null===(d=this.pY)||void 0===d?void 0:d.shader;if(this.pY&&D&&void 0!==T&&T>0&&k&&2!==t){const i=this.pY;this.ZR.aE(D).wV(D,((s,r,n,o)=>!!this.ZR.tN(n,t,this,{uniforms:this._E,idFirst:e,useInstanceID:1===t?I:void 0,fillStyleSolid:i.fillStyleSolid,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,fillStylePaletted:i.fillStylePaletted,linearGradientInfo:this.vY,radialGradientInfo:this.SY,lookupValueRange:i.fillStylePaletted?fg(i.fillStylePaletted,this,this.oY):void 0,lookupValueBuffer:null})&&!!F(n,i.fillStyleIndividual,i.fillStylePaletted)&&(null==i||i.geometry.aE(n).Jy(T-1),!0)))}const P="none"===this.zG.type?void 0:1===t?this.zG.mousePickingShader:this.zG.shader;if("none"!==this.zG.type&&P&&void 0!==T&&T>0){const i=this.zG;this.ZR.aE(P).wV(P,((s,r,n,o)=>{var h,a;if(!this.ZR.tN(n,t,this,{uniforms:this._E,idFirst:e,useInstanceID:1===t&&"triangulated"===i.type?I:void 0,useVertexID:1===t&&"primitive"===i.type?I:void 0,fillStyleSolid:i.fillStyleSolid,fillStylePaletted:i.fillStylePaletted,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,fillStyleIndividual:i.fillStyleIndividual,linearGradientInfo:this.yY,radialGradientInfo:this.mY,lookupValueRange:i.fillStylePaletted?fg(i.fillStylePaletted,this,this.oY):void 0,lookupValueBuffer:"primitive"===i.type?C:null,colorBuffer:"primitive"===i.type?w:null,coordsX:"primitive"===i.type?b:void 0,coordsY:"primitive"===i.type?M:void 0,coordsHighPrecision:this.At._i()}))return!1;if(i.lineStyleDashed){if(!this.OG)return!1;this.ZR.kV(s("uStippleCount"),[this.ls.oi().x/this.OG.QO,this.ls.oi().y/this.OG.QO]).FV(o("uStippleTextureWidthLimiter"),this.OG.ZO/this.OG.QO).FV(s("uStippleScale"),i.lineStyleDashed.getPatternScale()).TV(s("uStippleTexture"),this.OG.jO,1)}if("primitive"===i.type){if(i.lineStyleDashed){if(!(null===(h=this.cY)||void 0===h?void 0:h.bufferLengthSoFar))return!1;this.ZR.hO(r("aLengthSoFar"),this.cY.bufferLengthSoFar)}$y.DG(this.bN,T)}else{if(!F(n,i.fillStyleIndividual,i.fillStylePaletted))return!1;if(i.lineStyleDashed){if(!(null===(a=this.cY)||void 0===a?void 0:a.bufferLengthSoFar))return!1;Pm(this.ZR,n,!1,this.cY.bufferLengthSoFar,"aLengthSoFar","",2,!1,v.FLOAT,Float32Array.BYTES_PER_ELEMENT)}Ky.QL(this.bN,i.geometry,n,this.LG&&1!==t,1===t,i.thickness,T-1)}return!0}))}const L=null===(f=this.AY)||void 0===f?void 0:f.bufferX,V=null===(g=this.AY)||void 0===g?void 0:g.bufferY,_=null===(y=this.AY)||void 0===y?void 0:y.bufferColors,B=null===(m=this.AY)||void 0===m?void 0:m.bufferLookupValues,z=null===(p=this.AY)||void 0===p?void 0:p.bufferSizes,N=null===(x=this.AY)||void 0===x?void 0:x.bufferRotations,O=1===t?null===(A=this.lY)||void 0===A?void 0:A.mousePickingShader:null===(S=this.lY)||void 0===S?void 0:S.shader,U=this.lY;let Y=1;if(k&&(D||P)){const t=this.Ad?Math.abs((this.St()-this.vt())/E.getSampleCount()):0,e=this.At.x.getInnerInterval()/t,i=this.jU.C(),s=this.At.x.ri()/i/1,r=2*s;Y=e<=s?1:Math.max(1-(e-s)/(r-s),0)}if(O&&U&&L&&V&&Y>0&&void 0!==R&&R>0){const i=U,s=i.instancedRendering?1:0;this.ZR.aE(O).wV(O,((r,n,o,h)=>{if(!this.ZR.tN(o,t,this,{uniforms:this._E,idFirst:e,useInstanceID:i.instancedRendering&&1===t?I:void 0,useVertexID:i.instancedRendering||1!==t?void 0:I,fillStyleSolid:i.fillStyleSolid,fillStyleLinearGradient:i.fillStyleLinearGradient,fillStyleRadialGradient:i.fillStyleRadialGradient,linearGradientInfo:this.xY,radialGradientInfo:this.bY,fillStylePaletted:i.fillStylePaletted,fillStyleIndividual:i.fillStyleIndividual,lookupValueRange:i.fillStylePaletted?fg(i.fillStylePaletted,this,this.oY):void 0,lookupValueBuffer:B,lookupValueAttribDivisor:s,colorBuffer:_,colorAttribDivisor:s,fillStyleImage:i.fillStyleImage,texturedFillGLInfo:this.xU,texCoordAttribDivisor:0,maskTexture:i.shapeIcon&&this.xU,maskTextureCoordsAttribDivisor:0}))return!1;if(this.At._i()?this.ZR.CV(L,s,{location:n("aPos_highpartX"),size:1},{location:n("aPos_lowpartX"),size:1}).CV(V,s,{location:n("aPos_highpartY"),size:1},{location:n("aPos_lowpartY"),size:1}):this.ZR.lO(n("aPosX"),L,s).lO(n("aPosY"),V,s),1!==t&&this.ZR.FV(r("uOpacity"),Y),i.instancedRendering)if(N)this.ZR.lO(n("aRotDeg"),N,s).FV(r("uBaseRotDeg"),i.geometry.jW);else{const t=xi(this.ZU.C()+i.geometry.jW),e=Math.sin(t),s=Math.cos(t);this.ZR.kV(r("uRot"),[e,s])}return this.ZR.kV(h("uOffsetAlignment"),[-this.JU.x/2,-this.JU.y/2]),i.geometry.Jy(o,z,R,i.pointSizeAsScale&&this.xU?{scale:this.jU.C(),width:i.shapeIcon?i.shapeIcon.oi().x:this.xU.texture.Xz,height:i.shapeIcon?i.shapeIcon.oi().y:this.xU.texture.jz}:this.jU.C(),i.instancedRendering),!0}))}return{idCount:I}}TN(t,e,i,s,r){var n;const o=null===(n=this.Ad.C())||void 0===n?void 0:n.Gt;if(null==o?void 0:o.$c())return{};const h=t-e;return{info:{dataPoint:null==o?void 0:o.Qc(h)}}}dispose(){var t,e,i,s,r,n,o,h,a,l,u,c,d;return super.dispose(),this.ZR.LV(null===(t=this.cY)||void 0===t?void 0:t.bufferX),this.ZR.LV(null===(e=this.cY)||void 0===e?void 0:e.bufferY),this.ZR.LV(null===(i=this.cY)||void 0===i?void 0:i.bufferColors),this.ZR.LV(null===(s=this.cY)||void 0===s?void 0:s.bufferLookupValues),this.ZR.LV(null===(r=this.cY)||void 0===r?void 0:r.bufferRotations),this.ZR.LV(null===(n=this.cY)||void 0===n?void 0:n.bufferSizes),this.ZR.LV(null===(o=this.AY)||void 0===o?void 0:o.bufferX),this.ZR.LV(null===(h=this.AY)||void 0===h?void 0:h.bufferY),this.ZR.LV(null===(a=this.AY)||void 0===a?void 0:a.bufferColors),this.ZR.LV(null===(l=this.AY)||void 0===l?void 0:l.bufferLookupValues),this.ZR.LV(null===(u=this.AY)||void 0===u?void 0:u.bufferRotations),this.ZR.LV(null===(c=this.AY)||void 0===c?void 0:c.bufferSizes),this.zG={type:"none"},this.pY=void 0,this.lY=void 0,this.EW.fW(),null===(d=this.Ad.C())||void 0===d||d.Nt(),this.cY=void 0,this.AY=void 0,this.yY=void 0,this.mY=void 0,this.vY=void 0,this.SY=void 0,this.xY=void 0,this.bY=void 0,this.ZR.qO(this,this.xU),this}KR(){return this.dispose(),this}MY(t){if(!this.uY){const{xValues:e,yValues:i}=t.readBack();this.uY={min:{x:Be,y:Be},max:{x:ze,y:ze}};const s=e.length;for(let t=0;tthis.uY.max.x?s:this.uY.max.x,this.uY.max.y=r>this.uY.max.y?r:this.uY.max.y}return this.nY.length=0,this.uY}const e=t.Pc,i=t.Dc;if(this.nY.length>0&&e&&i){for(const t of this.nY){for(let s=t.min;s<=t.max;s+=1){const t=e[s],r=i[s];this.uY.min.x=tthis.uY.max.x?t:this.uY.max.x,this.uY.max.y=r>this.uY.max.y?r:this.uY.max.y}this.nY.length=0}return this.uY}return this.uY}St(){var t,e,i,s,r;const n=null===(t=this.Ad.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.$c();return"ProgressiveX"===o?(null===(e=n.Ic())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Zc())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.dY)||void 0===s?void 0:s.max)||0:"RegressiveY"===o?(null===(r=this.dY)||void 0===r?void 0:r.max)||0:this.MY(n).max.x}vt(){var t,e,i,s,r;const n=null===(t=this.Ad.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.$c();return"ProgressiveX"===o?(null===(e=n.Zc())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Ic())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.dY)||void 0===s?void 0:s.min)||0:"RegressiveY"===o?(null===(r=this.dY)||void 0===r?void 0:r.min)||0:this.MY(n).min.x}bt(){var t,e,i,s,r;const n=null===(t=this.Ad.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.$c();return"ProgressiveX"===o?Pt(null===(e=this.dY)||void 0===e?void 0:e.max,0):"RegressiveX"===o?Pt(null===(i=this.dY)||void 0===i?void 0:i.max,0):"ProgressiveY"===o?Pt(null===(s=n.Ic())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Pt(null===(r=n.Zc())||void 0===r?void 0:r.y,0):this.MY(n).max.y}xt(){var t,e,i,s,r;const n=null===(t=this.Ad.C())||void 0===t?void 0:t.Gt;if(!n)return 0;const o=n.$c();return"ProgressiveX"===o?Pt(null===(e=this.dY)||void 0===e?void 0:e.min,0):"RegressiveX"===o?Pt(null===(i=this.dY)||void 0===i?void 0:i.min,0):"ProgressiveY"===o?Pt(null===(s=n.Zc())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Pt(null===(r=n.Ic())||void 0===r?void 0:r.y,0):this.MY(n).min.y}Cl(){var t,e;let i=this.jU.C();this.xU&&(i=Math.max(this.xU.texture.Xz,this.xU.texture.jz)*this.jU.C());const s=Math.max(Te(this.gu),(null===(t=this.Ad.C())||void 0===t?void 0:t.Gt.wc)?25:i),r=null===(e=this.Ad.C())||void 0===e?void 0:e.Gt.$c();return!r||"ProgressiveX"!==r&&"RegressiveX"!==r?s:0}kl(){var t,e;let i=this.jU.C();this.xU&&(i=Math.max(this.xU.texture.Xz,this.xU.texture.jz)*this.jU.C());const s=Math.max(Te(this.gu),(null===(t=this.Ad.C())||void 0===t?void 0:t.Gt.wc)?25:i),r=null===(e=this.Ad.C())||void 0===e?void 0:e.Gt.$c();return!r||"ProgressiveY"!==r&&"RegressiveY"!==r?s:0}}const Fm=(t,e,i,s,r,n,o,h,a,l,u,c,d)=>{if("ProgressiveX"!==l)throw new Error("Unimplemented data pattern");const f=e[0],g=e[1],y=f.length,m=f[0],p=f[y-1],x=g[0],A=g[y-1],S=c?2:1;if(h&&a&&h.firstX&&h.lastX&&m>=h.firstX){const e=fo(h.lastX,0,y-1,(t=>f[t]));if(f[e]===h.lastX){const a=h.bufferSize-h.valueCount,l=e+1,u=y-l;if(0===u)return h;if(a>=u){const e=mo(f,l,void 0),a=mo(g,l,void 0);if(t.tO(h.bufferX,h.valueCount*S,d(e)),t.tO(h.bufferY,h.valueCount*S,d(a)),i&&h.bufferColors){const e=i.slice(l);t.tO(h.bufferColors,h.valueCount,e,Uint32Array)}if(s&&h.bufferLookupValues){const e=s.slice(l);t.tO(h.bufferLookupValues,h.valueCount,e,Float32Array)}if(r&&h.bufferSizes){const e=r.slice(l);t.tO(h.bufferSizes,h.valueCount,e,Float32Array)}if(n&&h.bufferRotations){const e=n.slice(l);t.tO(h.bufferRotations,h.valueCount,e,Float32Array)}if(o&&h.bufferLengthSoFar){const[i,s,r]=Dm(e,a,h.lastX||0,h.lastY||0,h.lengthSoFarX,h.lengthSoFarY);t.tO(h.bufferLengthSoFar,2*h.valueCount,i,Float32Array),h.lengthSoFarX=s,h.lengthSoFarY=r}return h.valueCount+=u,h.lastX=p,h.lastY=A,h}}}const v=y+u,b=t.qV(v*S,d(f),null==h?void 0:h.bufferX),M=t.qV(v*S,d(g),null==h?void 0:h.bufferY),w=i?t.qV(v,i,null==h?void 0:h.bufferColors,Uint32Array):void 0,C=s?t.qV(v,s,null==h?void 0:h.bufferLookupValues,Float32Array):void 0,T=r?t.qV(v,r,null==h?void 0:h.bufferSizes,Float32Array):void 0,R=n?t.qV(v,n,null==h?void 0:h.bufferRotations,Float32Array):void 0;let E,k=0,I=0;if(o){const e=Dm(f,g,f[0],g[0],0,0);E=t.qV(2*v,e[0],null==h?void 0:h.bufferLengthSoFar,Float32Array),k=e[1],I=e[2]}return{bufferX:b,bufferY:M,bufferColors:w,bufferLookupValues:C,bufferSizes:T,bufferRotations:R,bufferSize:v,bufferLengthSoFar:E,valueCount:y,firstX:m,lastX:p,firstY:x,lastY:A,lengthSoFarX:k,lengthSoFarY:I}},Dm=(t,e,i,s,r,n)=>{const o=t.length,h=new Float32Array(2*o);if(0===o)return[h,0,0];let a=0,l=i,u=s,c=r,d=n;for(let i=0;i{const u=t.gl;if(i){const i=e.attribute(`${r}A_highpart${n}`),c=e.attribute(`${r}A_lowpart${n}`),d=e.attribute(`${r}B_highpart${n}`),f=e.attribute(`${r}B_lowpart${n}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,a,h,2*o*l,0*l),u.vertexAttribPointer(c,o,a,h,2*o*l,o*l),t.nO(i,1),t.nO(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.vertexAttribPointer(d,o,a,h,2*o*l,2*o*l),u.vertexAttribPointer(f,o,a,h,2*o*l,3*o*l),t.nO(d,1),t.nO(f,1),u.enableVertexAttribArray(d),u.enableVertexAttribArray(f),u.bindBuffer(u.ARRAY_BUFFER,null)}else{const i=e.attribute(`${r}A${n}`),c=e.attribute(`${r}B${n}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,a,h,o*l,0*l),u.vertexAttribPointer(c,o,a,h,o*l,o*l),t.nO(i,1),t.nO(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.bindBuffer(u.ARRAY_BUFFER,null)}},Lm={translation:(t,e)=>[1,0,0,0,1,0,t,e,1],rotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,-i,0,i,e,0,0,0,1]},scaling:(t,e)=>[t,0,0,0,e,0,0,0,1],translate:(t,e,i)=>Lm.multiply(t,Lm.translation(e,i)),rotate:(t,e)=>Lm.multiply(t,Lm.rotation(e)),scale:(t,e,i)=>Lm.multiply(t,Lm.scaling(e,i)),multiply(t,e){const 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=e[0],d=e[1],f=e[2],g=e[3],y=e[4],m=e[5],p=e[6],x=e[7],A=e[8];return[c*i+d*n+f*a,c*s+d*o+f*l,c*r+d*h+f*u,g*i+y*n+m*a,g*s+y*o+m*l,g*r+y*h+m*u,p*i+x*n+A*a,p*s+x*o+A*l,p*r+x*h+A*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class Vm extends rn{constructor(t,e,i,s,r){super(t,e,i,s,r),this._Y=[],this._E=new Fy,this.wY=[u(0,0),u(0,0),u(0,0),u(0,0)],this.CY=y(u(0,0),u(0,0)),this.kY=y(u(0,0),u(0,0)),this.TY=u(0,0),this.FY=u(0,0),this.ST=u(0,0),this.IY=u(0,0),this.PY=0,this.DY=0,this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStyleRadialGradient:()=>tt(this.we)&&this.we,fillStyleLinearGradient:()=>st(this.we)&&this.we}),this.bN=t,this.MN=e,this.ZR=t._N(),this.MN=e,this.HG=t.Qn.so}Ls(){const t=this.ca(),e=this.ua(),i=this.No.C();if(t){const t=this.aa(),s=this.PN.fillStyleSolid(t),r=this.PN.fillStyleRadialGradient(t),n=this.PN.fillStyleLinearGradient(t),o=s||r||n,h=this.ZR,a=this.ZR.lV(),l=a!==this.DY;if(this.DY=a,this._E.BV(this.At),this.Ma.u||l){this.BY&&this.BY.lE(this),this.font._(br(this.Ma.C(),a));const t=this.font.C();this.BY=this.ZR.Xh(t.properties.family),this.BY.aE(this)}const c=this.font.u,d=c||this.ya.u;if(d&&this.BY){const t=this.font.C();[this.LY,this.kY]=this.BY.cE(this.ya.C(),t,this.bN.Ki.isDark),this._Y.forEach((t=>{t.texCoordBuff&&h.LV(t.texCoordBuff),t.vertexBuff&&h.LV(t.vertexBuff)})),this._Y=this.LY.map((t=>({texCoordBuff:h.MV(t.texCoords,!1),texture:t.texture,info:t}))),this.Ma.u=!1,this.font.u=!1,this.ya.u=!1}const f=this.At.Ni()||e,g=this.ma.u||this.Sa.u||this.va.u||this.xa.u||this.wa.u||this.Xt.u||d||f,y=this.wa.C(),m=li(u(this.Sa.C()+1,this.va.C()+1),.5);if(g&&this.LY&&(this.TY=u(-(y.left*a+this.kY.max.x-this.kY.min.x+y.right*a)*m.x-this.kY.min.x+y.right*a,-(y.bottom*a+this.kY.max.y-this.kY.min.y+y.top*a)*m.y-this.kY.min.y+y.top*a)),(g||f||this.ba.u||this.aa())&&this.we!==B){if(this.LY){const t=ui(this.ma.C(),this.xa.C()),e=ct(t,this.At,this.ls.At),i=li(e,a);this.IY=i;const s=xi(this.ba.C());this.PY=s,d&&this._Y.forEach((t=>{const e=t.info;e&&(t.vertexBuffLen=e.vertices.length/2,t.vertexBuff=h.MV(e.vertices,!0,t.vertexBuff))}));const r=this.Xt.C(),n=[ui(ri(u((this.kY.min.x+(-r.left-y.left)*a+this.TY.x)/a,(this.kY.max.y+(r.top+y.top)*a+this.TY.y)/a),this._a,s),e),ui(ri(u((this.kY.max.x+(r.right+y.right)*a+this.TY.x)/a,(this.kY.max.y+(r.top+y.top)*a+this.TY.y)/a),this._a,s),e),ui(ri(u((this.kY.max.x+(r.right+y.right)*a+this.TY.x)/a,(this.kY.min.y+(-r.bottom-y.bottom)*a+this.TY.y)/a),this._a,s),e),ui(ri(u((this.kY.min.x+(-r.left-y.left)*a+this.TY.x)/a,(this.kY.min.y+(-r.bottom-y.bottom)*a+this.TY.y)/a),this._a,s),e)];this.wY=[ct(n[0],this.ls.At,this.At),ct(n[1],this.ls.At,this.At),ct(n[2],this.ls.At,this.At),ct(n[3],this.ls.At,this.At)];const o=Je(n);this.FY=u(-(o.max.x-o.min.x)*a*m.x-o.min.x*a+this.IY.x,-(o.max.y-o.min.y)*a*m.y-o.min.y*a+this.IY.y),this.zg=ci(o.max,o.min);const l=Je(this.wY),c=this.At.pi(l.min,this.FY),f=this.At.pi(l.max,this.FY);this.CY=Je([c,f])}r?this.ON=Sy(this.CY,this.At,r.getPosition(),r.getExtent(),r.getShape(),this.ZR.lV()):n?this.NN=vy(this.CY,this.At,n.getAngle(!0),this.ZR.lV()):(this.ON=void 0,this.NN=void 0)}(this.aa()||c)&&(this.kE=o?this.ZR.Mz(Ug["2D"],Ug.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.HG}),Ug.Color({dataType:r?["gradient",r]:n?["gradient",n]:"uniform",maskTextureText:!0})):void 0),this.RY=i&&o?this.RY||this.ZR.Mz(Ug["2D"],Ug.MousePicking(),Ug.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.HG})):void 0,this.ma.u=!1,this.Sa.u=!1,this.va.u=!1,this.xa.u=!1,this.ba.u=!1,this.da(this.we)}return this.Ca=t,this}QL(t,e){if(this.ca()){const i=1===t?this.RY:this.kE;if(!i||0===this._Y.length)return{};const s=this.PN.fillStyleSolid(!1),r=this.PN.fillStyleRadialGradient(!1),n=this.PN.fillStyleLinearGradient(!1),o=this.ls.iz(),h=o.x,a=o.y;let l=Lm.projection(h,a,-1);const u=Lm.translation(this.TY.x,this.TY.y),c=Lm.translation(this.FY.x,this.FY.y);l=Lm.translate(l,this.IY.x,this.IY.y),l=Lm.multiply(l,c),l=Lm.rotate(l,this.PY),l=Lm.multiply(l,u),1===t&&(l=Lm.scale(l,this.kY.max.x,this.kY.max.y)),this.ZR.aE(i).wV(i,((i,h,a,u)=>{if(this.ZR.jV(i("uMatrix"),l).FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),this.HG&&this.ZR.kV(u("uViewportSizePx"),[o.x*this.ZR.lV(),o.y*this.ZR.lV()]),1===t)this.ZR.QV(i("uFirstId"),e).YO(a,1);else if(s)this.ZR.TR(i("uColor"),s.getColor());else if(r&&this.ON){this.ZR.kV(i("uCenter"),this.ON.center).kV(i("uDistance"),this.ON.distance).$V(i("uBounds"),this.ON.bounds).FV(i("uAspect"),this.ON.aspectRatio);const t=r.getColorStops();for(let e=0;e{this.ZR.hO(h("aPos"),t.vertexBuff).hO(h("aMaskTextureCoord"),t.texCoordBuff).TV(i("uMaskTexture"),t.texture,0).Jy(this.ZR.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return{idCount:1}}TN(t,e,i,s,r){return{}}Je(){return this.ca()?this.wY:[]}td(){return this.ca()&&this.zg?this.zg:u(0,0)}oi(){if(this.ca()&&this.CY){const t=this.CY;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}KR(){return this._Y.forEach((t=>{t.texCoordBuff&&this.ZR.LV(t.texCoordBuff),t.vertexBuff&&this.ZR.LV(t.vertexBuff)})),this._Y=[],this.BY&&this.BY.lE(this),this}St(){return this.CY.max.x}vt(){return this.CY.min.x}bt(){return this.CY.max.y}xt(){return this.CY.min.y}Cl(){return 0}kl(){return 0}}class _m{constructor(t,e,i){this.EY=new Set,this.zY=t=>(this.EY.add(t),t),this.VY=t=>(this.EY.delete(t),t.KR(),this),this.ls=t,this.ea=e,this.OY=i}ZL(t){this.EY.delete(t)&&this.EY.add(t)}Y(){for(const t of this.EY)t.KR().dispose();this.ls.Dn(this.ea)}xs(){return this.ls.xs(),this}Pn(){return this.ea}}class Bm extends _m{constructor(){super(...arguments),this.NY=p(void 0),this.ha=!1}ux(t){return this.NY._(t),this}Pp(){return this.NY.C()}}class zm extends Bm{constructor(t,e,i){super(t,e,i),this.bN=t,this.gl=t._N(),this.GY=this.EY}bV(t){const e=t instanceof Kr&&t;if(!e)return Ne;const i=e.vt(),s=e.St(),r=e.xt(),n=e.bt();if(i===Be||s===ze||r===Be||n===ze)return Ne;const o=e.Cl(),h=e.kl(),a=$r({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.At),l={min:ct(a.min,e.At,t.ls.At),max:ct(a.max,e.At,t.ls.At)},u=this.NY.C();let c;if(u){if(c={min:{x:Math.max(l.min.x,u.x),y:Math.max(l.min.y,u.y)},max:{x:Math.min(l.max.x,u.x+u.width),y:Math.min(l.max.y,u.y+u.height)}},c.max.xt.na()-e.na()));this.EY.clear();for(const e of t)this.EY.add(e)}for(const t of this.EY)t.Ls();return this}QL(t,e,i){var s;const r=this.NY.C();let n;if(r){const t=r.x*this.gl.lV()*e,i=r.y*this.gl.lV()*e,s=Math.ceil(t),o=Math.ceil(i);n=[s,o,Math.floor(t+r.width*this.gl.lV()*e)-s,Math.floor(i+r.height*this.gl.lV()*e)-o],this.gl.xV(n[0],n[1],n[2],n[3])}if(1!==t){for(const i of this.EY)if(i.getVisible()){if(i._M){const t=i._M.x*this.gl.lV()*e,s=i._M.y*this.gl.lV()*e,r=Math.ceil(t),n=Math.ceil(s),o=Math.floor(t+i._M.width*this.gl.lV()*e)-r,h=Math.floor(s+i._M.height*this.gl.lV()*e)-n;this.gl.xV(r,n,o,h)}i.QL(t,0),i._M&&n&&this.gl.xV(n[0],n[1],n[2],n[3])}}else{let r=((null===(s=i[i.length-1])||void 0===s?void 0:s.idLast)||0)+1;const o=Array.from(this.GY.values());for(let s=0;s{const e=new Float32Array(324);let i=0;return e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,{vertices:e,drawSize:i/9,drawMode:t.TRIANGLES}};class Ym extends Nm{constructor(t,e){super(t),this.UY="attribute",this.YY=e;const{vertices:i,indices:s}=Gm();this.OR=t.MV(i),this.wG=t.sO(s),this.CG=s.length,this.kG=t.gl.TRIANGLES}Jy(t,e,i,s){return this.ZR.CV(this.OR,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).uO(this.wG).FV(t.uniform("uEdgeRoundness"),this.YY/2).AO(this.kG,this.CG,0,e),this}Yz(){this.ZR.LV(this.OR),this.ZR.LV(this.wG)}HY(t){return this.YY=t,this}$Y(){return this.YY}}const Gm=()=>{const t=[{normal:{x:0,y:1,z:0},perpendA:{x:0,y:0,z:1},perpendB:{x:-1,y:0,z:0}},{normal:{x:0,y:0,z:-1},perpendA:{x:0,y:1,z:0},perpendB:{x:-1,y:0,z:0}},{normal:{x:-1,y:0,z:0},perpendA:{x:0,y:1,z:0},perpendB:{x:0,y:0,z:1}},{normal:{x:1,y:0,z:0},perpendA:{x:0,y:1,z:0},perpendB:{x:0,y:0,z:-1}},{normal:{x:0,y:0,z:1},perpendA:{x:0,y:1,z:0},perpendB:{x:1,y:0,z:0}},{normal:{x:0,y:-1,z:0},perpendA:{x:0,y:0,z:-1},perpendB:{x:-1,y:0,z:0}}],e=[];let i=0;const s=[];let r=0;for(const n of t){const{normal:t,perpendA:o,perpendB:h}=n,a=_e.multiply(o,-1),l=_e.multiply(h,-1),u=i;e[i]={thicknessDirection:_e.addVec(t,o,h),edge:_e.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:_e.addVec(t,a,h),edge:_e.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:_e.addVec(t,a,l),edge:_e.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:_e.addVec(t,o,l),edge:_e.addVec(a,h),normal:t},i+=1,s[r+0]=d,s[r+1]=u,s[r+2]=f,s[r+3]=d,s[r+4]=c,s[r+5]=u,r+=6;const g=[{A:o,B:h},{A:a,B:h},{A:a,B:l},{A:o,B:l}];for(const s of g){s.thicknessDirection=_e.addVec(t,s.A,s.B),s.stripVerticesA=[],s.stripVerticesB=[];const r=[{direction:s.A,other:s.B,vertices:s.stripVerticesA},{direction:s.B,other:s.A,vertices:s.stripVerticesB}];for(const n of r)for(let r=0;r<8;r+=1){const o=.5*r/7,h=_e.normalize(_e.lerp(t,n.direction,o)),a=Math.PI/2-_e.angle(h,t),l=_e.addVec(_e.multiply(_e.multiply(n.direction,-1),1-Math.cos(a)),_e.multiply(_e.multiply(t,-1),1-Math.sin(a)),_e.multiply(n.other,-1)),u=i;e[i]={thicknessDirection:s.thicknessDirection,normal:h,edge:l};const c=e[i];i+=1,n.vertices.push({index:u,vertex:c})}}for(let t=0;t{let i=t.GV.Uz.get(e);return i||(i=void 0!==e&&e>0?new Ym(t,Ft(e,0,1)):new Om(t),t.GV.Uz.set(e,i),i)};class Zm extends Ry{gv(t){return this.oV=this.nv.C(),this.nv._(t),this}PS(t){return this.jY=t,this}DS(){return this.jY}}class Hm extends Zm{constructor(t,e,i){super(t,e,i),this.ZY=t,this.bN=t.bN,this.ZR=this.bN._N()}}class Wm extends Hm{constructor(t,e,i){super(t,e,i),this.jY="cull-back",this.Ka=Oe,this.QY={},this.JY=[],this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStyleIndividual:()=>X(this.we)&&this.we,fillStylePaletted:()=>H(this.we)&&this.we}),this.we=Ir.fillStyle,this.nv._(jn)}Ls(t){const e=this.JY,i=this.we,s=i!==B,r=this.KY,n=this.aa()||this.qY!==r,o=this.nV(),h=this.No.C(),a=this.No.u;if(s){for(const t of e)t.id=void 0!==t.id?String(t.id):void 0,t.xSize=void 0!==t.xSize&&t.xSize<0?-t.xSize:t.xSize,t.ySize=void 0!==t.ySize&&t.ySize<0?-t.ySize:t.ySize,t.zSize=void 0!==t.zSize&&t.zSize<0?-t.zSize:t.zSize;const t=this.tH||0;let s=t;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.QY[e]||(s+=1)}let r,l=!1,u=!1;if(l=s!==t,u=l,r=!u&&(e.length<100?"chunks":"all"),l){const e=11*s,i=new Float32Array(e);this.$W&&i.set(this.$W),this.$W=i,this.iH=e,this.sH=11*t}const c=X(i)?i.getFallbackColor():void 0;for(const t of e){const e=t.id,i=void 0!==e&&this.QY[e],s=[t.xCenter,t.yCenter,t.zCenter,t.xSize,t.ySize,t.zSize,t.color?t.color.r:c?c.r:void 0,t.color?t.color.g:c?c.g:void 0,t.color?t.color.b:c?c.b:void 0,t.color?t.color.a:c?c.a:void 0,t.value];if(i){for(let t=0;t<11;t+=1)s[t]=void 0!==s[t]?s[t]:i.buffer[t];i.buffer.set(s)}else{const t=this.sH,i=new Float32Array(this.$W.buffer,t*Float32Array.BYTES_PER_ELEMENT,11);i.set(s),void 0!==e&&(this.QY[e]={location:t,buffer:i}),this.sH+=11}}if(u&&(this._G=this.ZR.MV(this.$W,!0)),"all"===r)this.ZR.tO(this._G,0,this.$W);else if("chunks"===r)for(const t of e){const e=t.id;if(void 0!==e){const t=this.QY[e];this.ZR.tO(this._G,t.location,t.buffer)}}if(n||o||a){const t=this.PN.fillStyleSolid(n),e=this.PN.fillStyleIndividual(n),i=this.PN.fillStylePaletted(n);t||e||i?(this.eH=Xm(this.ZR,this.hH()),this.kE=this.ZR.Mz(Ug["3D"],Ug.ColorShaded3D({dataType:e?"attribute":i?["lookup",i.getLookUpProperty(),i.lut]:"uniform",shadingStyle:this.nv.C().type}),Ug.VertexLocation({offset:{sizeUnit:"axis",dataType:"attribute",halved:!0},axisWorldTranslation:cg(this.At),normalSource:this.eH.UY}),void 0!==this.KY&&Ug.RoundedEdges3D),this.RY=h?this.ZR.Mz(Ug["3D"],Ug.VertexLocation({offset:{sizeUnit:"axis",dataType:"attribute",halved:!0},axisWorldTranslation:cg(this.At),normalSource:void 0}),Ug.MousePicking(),void 0!==this.KY&&Ug.RoundedEdges3D):void 0):(this.eH=void 0,this.kE=void 0,this.RY=void 0)}if(e.length>0){const t=y({x:Be,y:Be,z:Be},{x:ze,y:ze,z:ze});for(let e=0;en?t.max.x:n,t.max.y=t.max.y>l?t.max.y:l,t.max.z=t.max.z>f?t.max.z:f}this.Ka=t}this.tH=s,this.JY.length=0}return this.da(i),this.qY=r,this.nv.u=!1,this.No.u=!1,this}QL(t,e){const i=1===t?this.RY:this.kE,s=this.eH,r=this._G,n=this.we,o=this.tH,h=this.nv.C(),a=o||0;return i&&r&&void 0!==o&&this.ZR.wV(i,((l,u,c)=>{let d=!1;const f=u("aPos"),g=u("aOffsetAxis");this.ZR.aE(i).XV(l("uScale"),this.ZY._E.IV()).XV(l("uDisp"),this.ZY._E.PV()).ZV(l("uViewProjectionMatrix"),this.rH).FV(l("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(l("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(l("uRenderEffectMask"),2===t?1:0);const y={location:f,size:3},m={location:g,size:3},p={location:void 0,size:4};if(1!==t&&"phong"===h.type&&this.ZR.XV(l("uCameraLoc"),this.nH).XV(l("uLightLoc"),this.oH).FV(l("uAmbientReflection"),h.ambientReflection).FV(l("uSpecularReflection"),h.specularReflection).FV(l("uDiffuseReflection"),h.diffuseReflection).FV(l("uShininess"),h.shininess).TR(l("uLightColor"),h.specularColor).TR(l("uAmbientColor"),h.ambientColor),1===t)this.ZR.QV(l("uFirstId"),e).YO(c,a);else if(Y(n))this.ZR.TR(l("uColorDiffuse"),n.getColor());else if(X(n)){const t=u("aColor");p.location=t}else if(H(n)){const t=fg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.ZR.JO(c,n.lut,t)}return r&&(this.ZR.CV(r,1,y,m,p,{location:void 0,size:1}),s.Jy(c,o,"phong"===h.type&&1!==t,!1),d=!0),d})),{idCount:a}}TN(t,e,i,s,r){const n=11*(t-e);if(!this.$W)return{};const o=this.$W[n+0],h=this.$W[n+1],a=this.$W[n+2],l=this.$W[n+3],u=this.$W[n+4],c=this.$W[n+5],d=Pt(this.$W[n+6],void 0),f=Pt(this.$W[n+7],void 0),g=Pt(this.$W[n+8],void 0),y=Pt(this.$W[n+9],void 0),m=Pt(this.$W[n+10],void 0);let p;for(const t of Object.keys(this.QY))if(this.QY[t].location===n){p=t;break}return{info:{dataPoint:{x:o,y:h,z:a,xSize:l,ySize:u,zSize:c,r:d,g:f,b:g,a:y,intensity:m,id:p}}}}dispose(){return super.dispose(),this._G&&(this.ZR.LV(this._G),this._G=void 0),this.kE=void 0,this}KR(){return this.dispose(),this}wv(t){this.JY=he(this.JY,t,{canReturnB:!0})}Ie(t){return this.we=Qr(this.we,t),this}Hh(){return this.we}Mv(t){return this.KY=void 0!==t&&t>0?Ft(t,0,1):void 0,this}hH(){return this.KY}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}mv(){return this.Ka.max.z}vv(){return this.Ka.min.z}Cl(){return 0}kl(){return 0}Sv(){return 0}aa(){return qr(this.la,this.we)}da(t){this.la=t}}class jm extends by{constructor(t,e){super(t),this.UY="custom",this.bG=e;const{vertices:i,drawSize:s}=this.MG();this._G=t.MV(i),this.CG=s}aE(t){return this.ZR.CV(this._G,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Jy(t){return this.ZR.fO(this.ZR.gl.TRIANGLE_STRIP,0,this.CG,t),this}MG(){const t=this.bG,e=new Float32Array(2*(t+1)*3);let i=0;for(let s=0;s<=t;s+=1){const r=2*Math.PI*s/t,n=Math.cos(r),o=Math.sin(r);for(const t of[0,1])e[i+0]=t,e[i+1]=n,e[i+2]=o,i+=3}return{vertices:e,drawSize:i/3}}Yz(){this.ZR.LV(this._G)}}const Km=(t,e=16)=>{let i=t.GV.Gz.get(e);return i||(i=new jm(t,e),t.GV.Gz.set(e,i),i)};class $m extends Hm{constructor(t,e,i){super(t,e,i),this.jY="cull-back",this.aH=Oe,this.lH=[],this.uH=!1,this.gu=Ir.lineStyle,this.nv._(Hn)}Ls(t){const e=this.uH,i=this.gu,s=this.yu!==i,r=this.nV(),n=e;if(e){const t=te(this.lH);this.cH=this.ZR.MV(t,!1,this.cH)}if(n&&(this.aH=ti(this.lH)),s||r){const t=8,e=ts(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.zG=void 0,Y(e)&&("primitive"===s?this.zG={type:s,shader:this.ZR.Mz(Ug["3D"],Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0}),Ug.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.zG={type:s,shader:this.ZR.Mz(Ug["3D"],Ug.ColorShaded3D({dataType:"uniform",shadingStyle:this.nv.C().type}),Ug.LineInstanced3D({axisWorldTranslation:cg(this.At)})),geometry:Km(this.ZR,t),fillStyle:e}))}return this.uH=!1,this.yu=i,this.nv.u=!1,this}QL(t,e){if(1===t)return{};const i=this.ZR.gl,s=this.zG,r=this.cH,n=this.gu,o=this.nv.C();if(s&&r&&ts(n))switch(s.type){case"instanced":{const e=.5*this.Is.$m(n.thickness),h=s.fillStyle.getColor(),a=s.shader,l=s.geometry;this.ZR.wV(a,((s,n,u)=>{this.ZR.aE(a).XV(s("uScale"),this.ZY._E.IV()).XV(s("uDisp"),this.ZY._E.PV()).ZV(s("uViewProjectionMatrix"),this.rH).TR(s("uColorDiffuse"),h).FV(s("uOffsetWU"),e).FV(s("uIsHighlighted"),this.Yo).TR(s("uHighlightColorOffset"),2===t?k:this.jo).FV(s("uRenderEffectMask"),2===t?1:0),"phong"===o.type&&this.ZR.XV(s("uCameraLoc"),this.nH).XV(s("uLightLoc"),this.oH).FV(s("uAmbientReflection"),o.ambientReflection).FV(s("uSpecularReflection"),o.specularReflection).FV(s("uDiffuseReflection"),o.diffuseReflection).FV(s("uShininess"),o.shininess).TR(s("uLightColor"),o.specularColor).TR(s("uAmbientColor"),o.ambientColor),i.bindBuffer(i.ARRAY_BUFFER,r);const c=n("aLocationA"),d=n("aLocationB");return i.vertexAttribPointer(c,3,i.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.ZR.nO(c,1),i.enableVertexAttribArray(c),i.vertexAttribPointer(d,3,i.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.ZR.nO(d,1),i.enableVertexAttribArray(d),l.aE(u).Jy(this.lH.length/2),!0}));break}case"primitive":{const e=ts(n)?n.getFillStyle():void 0,o=e&&Y(e)?e.getColor():void 0;if(o){const e=s.shader;this.ZR.wV(e,((s,n)=>(this.ZR.aE(e).XV(s("uScale"),this.ZY._E.IV()).XV(s("uDisp"),this.ZY._E.PV()).ZV(s("uViewProjectionMatrix"),this.rH).TR(s("uColor"),o).FV(s("uIsHighlighted"),this.Yo).TR(s("uHighlightColorOffset"),2===t?k:this.jo).FV(s("uRenderEffectMask"),2===t?1:0).CV(r,void 0,{location:n("aPos"),size:3}).Jy(i.LINES,this.lH.length),!0)))}break}}return{idCount:this.lH.length}}TN(t,e,i,s,r){return{}}dl(t){for(let e=0;e{const l=e*r,u=Math.PI/2-t*n,c=Math.cos(u),d=c*Math.cos(l),f=c*Math.sin(l),g=Math.sin(u);i[s]=d,i[s+1]=g,i[s+2]=f,i[s+3]=o,i[s+4]=h,i[s+5]=a,s+=6};for(let i=0;i0&&(o(i,s,1,0,0),o(i,s+1,1,1,0),o(i+1,s,0,0,1)),i{this.ZR.mA.Kn&&s>i.length&&wt.console.warn("LightningChart JS unexpected error scenario, sphere geometry buffer size mismatch.\nA point series 3D component might have missing points.\n\nThis warning can be omitted with LightningChartOptions.warnings")})),{vertices:i,drawSize:s/6}}Yz(){this.ZR.LV(this._G)}}const qm=(t,e)=>{const i=Math.round(e);i<3&&pe(0,kt);const s=i;let r=t.GV.Wz.get(Array.from(t.GV.Wz.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new Qm(t,i,s),t.GV.Wz.set({sectors:i,stacks:s},r),r)};class Jm extends Hm{constructor(t,e,i){super(t,e,i),this.jY="cull-back",this.LM=[],this.zG={},this.zW=new sm(this.LM,(t=>t.vertexBuffer&&this.ZR.LV(t.vertexBuffer)),!0),this.bu=[],this.qa=0,this.tl=[],this.il=0,this.Ka=Oe,this.sl=Oe,this.PN=dg({lineStyleSolid:()=>{const t=this.gu;return ts(t)&&t},lineFillSolid:()=>{const t=this.gu.getFillStyle();return Y(t)&&t},lineFillPaletted:()=>{const t=this.gu.getFillStyle();return H(t)&&t},jointStyleTriangulatedPoints:()=>yr(this.Cv)&&this.Cv,jointSizeTriangulated:()=>{const t=this.Cv;return yr(t)&&t.getSize()},jointFillSolid:()=>{const t=this.Cv.getFillStyle();return Y(t)&&t},jointFillPaletted:()=>{const t=this.Cv.getFillStyle();return H(t)&&t},wireframeLineStyleSolid:()=>{const t=yr(this.Cv)&&this.Cv.getWireframeStyle();return ts(t)&&t},wireframeFillSolid:()=>{const t=yr(this.Cv)&&this.Cv.getWireframeStyle(),e=t&&t.getFillStyle();return Y(e)&&e}}),this.el=!1,this.gu=Ir.lineStyle,this.Cv=Ir.pointStyle3D,this.nv._(jn),this.WW={attributesPerVertex:3,prepareRenderData:(t,e)=>te(t)}}TN(t,e,i,s,r){return{info:{dataPoint:this.bu[t-e]}}}Ls(t){const e=this.el,i=this.tl,s=this.il,r=s>0,n=this.gu,o=n!==this.yu,h=this.Cv,a=h!==this.AH,l=this.nV(),u=this.No.u,c=this.No.C();this.sl&&(this.Ka=ii(this.Ka,this.sl),this.sl=void 0),r&&(this.bu=he(this.bu,i,{canReturnB:!0}),this.qa+=s);let d=i,f=s;if(e&&(this.LM.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=Oe})),this.zW.TW(),d=this.bu,f=this.qa),f>0){const t=1e5,e=Math.floor(this.bN.gH/(this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.Qo("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=Ft(i,t,e);this.zW.MW(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:Oe,vertexBuffer:this.ZR.qV(t*this.WW.attributesPerVertex,this.WW.prepareRenderData(e,i))})),((t,e,i,s)=>{this.ZR.tO(t.vertexBuffer,t.existingCoordinatesCount*this.WW.attributesPerVertex,this.WW.prepareRenderData(e,i)),t.existingDataPointsCount+=i-s,t.existingCoordinatesCount+=i,t.jointPointsCount+=s,t.lastDataPoint=e[i-1]}))}if(o||a||l||u){const t={},e=this.PN.lineStyleSolid(o),i=this.PN.lineFillSolid(o),s=this.PN.lineFillPaletted(o),r=i||s,h=this.PN.jointStyleTriangulatedPoints(a),l=this.PN.jointSizeTriangulated(a),u=this.PN.jointFillSolid(a),d=this.PN.jointFillPaletted(a),f=u||d,g=this.PN.wireframeLineStyleSolid(a),y=this.PN.wireframeFillSolid(a),m=n.getThickness()<0||1===n.getThickness()&&this.Qo("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",p=s?["lookup",s.getLookUpProperty(),s.lut]:"uniform";if("primitive"===m&&r?t.lines={type:"primitive",fillStyleSolid:i,fillStylePaletted:s,shader:this.ZR.Mz(Ug["3D"],Ug.Color({dataType:p}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})),mousePicking:c?{shader:this.ZR.Mz(Ug["3D"],Ug.MousePicking({useVertexId:!0}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0}))}:void 0}:"instanced"===m&&e&&r&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:i,fillStylePaletted:s,shader:this.ZR.Mz(Ug["3D"],Ug.ColorShaded3D({dataType:p,shadingStyle:this.nv.C().type}),Ug.LineInstanced3D({axisWorldTranslation:cg(this.At)})),geometry:tp(this.ZR,e.getThickness()),mousePicking:c?{shader:this.ZR.Mz(Ug["3D"],Ug.MousePicking(),Ug.LineInstanced3D({axisWorldTranslation:cg(this.At)}))}:void 0}),t.markers=void 0,f&&h){const e=ne(h.getShape(),{cube:()=>Xm(this.ZR),sphere:()=>ep(this.ZR,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof l&&l,pointSizeAxis:"object"==typeof l&&l,fillStyleSolid:u,fillStylePaletted:d,shader:this.ZR.Mz(Ug["3D"],Ug.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty(),d.lut]:"uniform",shadingStyle:this.nv.C().type,wireframe:!1!==y}),Ug.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:cg(this.At),normalSource:e.UY})),mousePicking:c?{shader:this.ZR.Mz(Ug["3D"],Ug.MousePicking(),Ug.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:cg(this.At),normalSource:void 0}))}:void 0,wireframe:g&&y&&{thickness:g.getThickness(),fillStyleSolid:y}}}this.zG=t}return this.el=!1,this.tl=[],this.il=0,this.yu=n,this.AH=h,this.nv.u=!1,this.No.u=!1,this}QL(t,e){var i,s;const r=this.ZR.gl,{lines:n,markers:o}=this.zG,h=this.nv.C(),a=this.qa,l=1===t?null===(i=null==n?void 0:n.mousePicking)||void 0===i?void 0:i.shader:null==n?void 0:n.shader;if(n&&l&&"instanced"===n.type){const i=l,{geometry:s,lineStyleSolid:o,fillStyleSolid:a,fillStylePaletted:u}=n;this.ZR.wV(i,((n,l,c)=>{let d=!1;if(this.ZR.aE(i).XV(n("uScale"),this.ZY._E.IV()).XV(n("uDisp"),this.ZY._E.PV()).ZV(n("uViewProjectionMatrix"),this.rH).FV(n("uOffsetWU"),this.Is.$m(o.getThickness())).FV(n("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(n("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===h.type&&this.ZR.XV(n("uCameraLoc"),this.nH).XV(n("uLightLoc"),this.oH).FV(n("uAmbientReflection"),h.ambientReflection).FV(n("uSpecularReflection"),h.specularReflection).FV(n("uDiffuseReflection"),h.diffuseReflection).FV(n("uShininess"),h.shininess).TR(n("uLightColor"),h.specularColor).TR(n("uAmbientColor"),h.ambientColor),1===t);else if(a)this.ZR.TR(n("uColorDiffuse"),a.getColor());else if(u){const t=fg(u,this,void 0);if(!t&&u.lut.percentageValues)return!1;this.ZR.JO(c,u.lut,t)}const f=Ve(e);return this.LM.forEach((e=>{if(1===t){const[t,i]=f.Ut(e.existingDataPointsCount);this.ZR.QV(n("uFirstId"),t).YO(c,i)}r.bindBuffer(r.ARRAY_BUFFER,e.vertexBuffer);const i=l("aLocationA"),o=l("aLocationB");r.vertexAttribPointer(i,3,r.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.ZR.nO(i,1),r.enableVertexAttribArray(i),r.vertexAttribPointer(o,3,r.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.ZR.nO(o,1),r.enableVertexAttribArray(o),s.aE(c).Jy(e.existingCoordinatesCount-1),d=!0})),d}))}if(n&&l&&"primitive"===n.type){const i=l,{fillStyleSolid:s,fillStylePaletted:o}=n;this.ZR.wV(i,((n,h,a)=>{let l=!1;if(this.ZR.aE(i).XV(n("uScale"),this.ZY._E.IV()).XV(n("uDisp"),this.ZY._E.PV()).ZV(n("uViewProjectionMatrix"),this.rH).FV(n("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(n("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(n("uRenderEffectMask"),2===t?1:0),1===t);else if(s)this.ZR.TR(n("uColor"),s.getColor());else if(o){const t=fg(o,this,void 0);if(!t&&o.lut.percentageValues)return!1;this.ZR.JO(a,o.lut,t)}const u=Ve(e);return this.LM.forEach((e=>{if(1===t){const[t,i]=u.Ut(e.existingDataPointsCount);this.ZR.QV(n("uFirstId"),t).WO(a,i)}this.ZR.CV(e.vertexBuffer,void 0,{location:h("aPos"),size:3}).Jy(r.LINE_STRIP,e.existingCoordinatesCount),l=!0})),l}))}const u=1===t?null===(s=null==o?void 0:o.mousePicking)||void 0===s?void 0:s.shader:null==o?void 0:o.shader;if(o&&u){const i=u,{geometry:s,fillStyleSolid:r,fillStylePaletted:n,pointSizeAxis:a,pointSizeNWU:l,wireframe:c}=o;this.ZR.wV(i,((o,u,d,f)=>{let g=!1;if(this.ZR.aE(i).XV(o("uScale"),this.ZY._E.IV()).XV(o("uDisp"),this.ZY._E.PV()).ZV(o("uViewProjectionMatrix"),this.rH).FV(f("uRatioNwuWu"),this.ZY.pH()).FV(o("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(o("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(o("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===h.type&&this.ZR.XV(o("uCameraLoc"),this.nH).XV(o("uLightLoc"),this.oH).FV(o("uAmbientReflection"),h.ambientReflection).FV(o("uSpecularReflection"),h.specularReflection).FV(o("uDiffuseReflection"),h.diffuseReflection).FV(o("uShininess"),h.shininess).TR(o("uLightColor"),h.specularColor).TR(o("uAmbientColor"),h.ambientColor),1===t);else if(r)this.ZR.TR(o("uColorDiffuse"),r.getColor());else if(n){const t=fg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.ZR.JO(d,n.lut,t)}c&&1!==t&&this.ZR.FV(o("uWireframeThickness"),c.thickness).TR(o("uWireframeColor"),c.fillStyleSolid.getColor()),!1!==a&&this.ZR.XV(o("uOffsetAxis"),[a.x,a.y,a.z]),!1!==l&&this.ZR.FV(o("uOffsetNWU"),l);const y=Ve(e);return this.LM.forEach((e=>{if(1===t){const[t,i]=y.Ut(e.existingDataPointsCount);this.ZR.QV(o("uFirstId"),t).YO(d,i)}this.ZR.CV(e.vertexBuffer,1,{location:u("aPos"),size:3}),s.Jy(d,e.existingCoordinatesCount,"phong"===h.type&&1!==t,Boolean(c)&&1!==t),g=!0})),g}))}return{idCount:a}}dl(t,e){Array.isArray(t)||(t=[t]),this.tl=he(this.tl,t,{canReturnB:!0}),this.il+=t.length;const i=e||ti(t);return this.sl=this.sl?ii(this.sl,i):i,this}Oe(t){return this.gu="function"==typeof t?t(this.gu):t,this}pu(){return this.gu}Nm(t){return this.Cv="function"==typeof t?t(this.Cv):t,this}yH(){return this.Cv}St(){return this.sl?Math.max(this.sl.max.x,this.Ka.max.x):this.Ka.max.x}vt(){return this.sl?Math.min(this.sl.min.x,this.Ka.min.x):this.Ka.min.x}bt(){return this.sl?Math.max(this.sl.max.y,this.Ka.max.y):this.Ka.max.y}xt(){return this.sl?Math.min(this.sl.min.y,this.Ka.min.y):this.Ka.min.y}mv(){return this.sl?Math.max(this.sl.max.z,this.Ka.max.z):this.Ka.max.z}vv(){return this.sl?Math.min(this.sl.min.z,this.Ka.min.z):this.Ka.min.z}Cl(){return Te(this.gu)}kl(){return Te(this.gu)}Sv(){return Te(this.gu)}nl(){return this.bu}rl(){return this.tl}fl(){return this.qa}Al(){return this.il}Ot(){return this.el=!0,this.bu.length=0,this.qa=0,this.tl=[],this.il=0,this.Ka=Oe,this.sl=void 0,this}dispose(){return super.dispose(),this.zW.FW(),this.zG={},this}KR(){return this.dispose(),this}}const tp=(t,e)=>Km(t,e>50?20:e>20?16:e>10?12:e>5?8:6),ep=(t,e)=>{const i=e.getSize();return qm(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class ip extends Hm{constructor(t,e,i){super(t,e,i),this.jY="disabled",this.mH=!1,this.vH=!1,this.SH={x:1,y:1,z:1},this.zS={x:0,y:0,z:0},this.ES={x:0,y:0,z:0},this.VS={x:0,y:0,z:0},this.OS={x:1,y:1,z:1},this.xH=Ay.projectionOrthographic(-1,1,-1,1,1,-1),this.bH=Ay.projectionOrthographic(-1,1,-1,1,1,-1),this.MH=!1,this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStyleValuePalette:()=>H(this.we)&&"value"===this.we.lookUpProperty&&this.we}),this.we=Ir.fillStyle,this.nv._(jn)}Ls(t){var e;const i=this.nV(),s=this.No.C(),r=this.No.u,n=this.aa();this.PN.fillStyleSolid(n);const o=this.PN.fillStyleValuePalette(n),h=this.VS,a=this.OS;if(this.mH&&this._H&&(this._G=this.ZR.MV(this._H.vertices,void 0,this._G),this.wG=this.ZR.sO(this._H.indices,this.wG),this.wH=this._H.indices.length),"phong"===this.nv.C().type&&(i||this.mH)&&(null===(e=this._H)||void 0===e?void 0:e.normals)&&(this.CH=this.ZR.MV(this._H.normals,void 0,this.CH)),!this.kH&&o&&"value"===o.lookUpProperty&&this._H&&(this.kH=new Float32Array(this._H.vertices.length/3),this.vH=!0),this.kH&&this.vH&&(this.TH=this.ZR.MV(this.kH,void 0,this.TH)),i||n||r){if(o&&"value"!==o.lookUpProperty)throw new Error("LightningChart JS MeshModel3D does not support look up by x/y/z. Must be value");this.kE=this.ZR.Mz(Ug["3D"],Ug.ColorShaded3D({dataType:o?["lookup","value",o.lut]:"uniform",shadingStyle:this.nv.C().type,wireframe:!1}),Ug.Model3D({normalSource:"phong"===this.nv.C().type?"attribute":void 0})),this.RY=s?this.ZR.Mz(Ug["3D"],Ug.MousePicking({useVertexId:!0}),Ug.Model3D({normalSource:void 0})):void 0}if(this.MH){const t=Ay.projectionOrthographic(-1,1,-1,1,1,-1);this.bH=Ay.rotateXYZ(t,h),this.xH=Ay.translate(t,a.x/2,a.y/2,a.z/2),this.xH=Ay.rotateXYZ(this.xH,h),this.xH=Ay.translate(this.xH,-a.x/2,-a.y/2,-a.z/2),this.MH=!1}return this.nv.u=!1,this.da(this.we),this.No.u=!1,this.mH=!1,this.vH=!1,this}QL(t,e){const i=1===t?this.RY:this.kE,s=1===t,r=this.wG,n=this.wH,o=this._G,h=this.CH,a=this.TH,l=this.zS,u=this.ES,c=this.SH,d=this.OS,f=this.xH,g=this.bH,y=this.PN.fillStyleValuePalette(!1),m=this.PN.fillStyleSolid(!1),p=this.nv.C(),x={location:void 0,size:1};if(!(i&&o&&r&&n&&this._H))return{};const A=this._H.vertices.length;return this.ZR.wV(i,((S,v,b,M)=>{if(this.ZR.aE(i).XV(S("uScale"),this.ZY._E.IV()).XV(S("uDisp"),this.ZY._E.PV()).ZV(S("uViewProjectionMatrix"),this.rH).FV(S("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(S("uHighlightColorOffset"),this.jo).FV(S("uRenderEffectMask"),2===t?1:0),s)this.ZR.QV(S("uFirstId"),e).WO(b,A);else{if(this.we===B)return!1;if(m)this.ZR.TR(S("uColorDiffuse"),m.getColor());else if(y){if(!a)return!1;const t=y.getPalette();x.location=v("aLookupValue"),this.ZR.JO(b,t,void 0).CV(a,void 0,x)}}return"phong"!==p.type||s||(this.ZR.XV(S("uCameraLoc"),this.nH).XV(S("uLightLoc"),this.oH).FV(S("uAmbientReflection"),p.ambientReflection).FV(S("uSpecularReflection"),p.specularReflection).FV(S("uDiffuseReflection"),p.diffuseReflection).FV(S("uShininess"),p.shininess).TR(S("uLightColor"),p.specularColor).TR(S("uAmbientColor"),p.ambientColor).ZV(S("uModelRotationNormals"),g),h&&this.ZR.CV(h,void 0,{location:b.attribute("aNormal"),size:3})),this.ZR.ZV(S("uModelRotation"),f).XV(S("uModelScale"),[c.x,c.y,c.z]).XV(S("uLocationAxis"),[l.x,l.y,l.z]).XV(S("uModelAlignment"),[u.x,u.y,u.z]).XV(S("uModelSize"),[d.x,d.y,d.z]),this.ZR.CV(o,0,{location:b.attribute("aGeoPos"),size:3}).uO(r).dO(n,this.ZR.gl.TRIANGLES),!0})),{idCount:A}}FH(t){if(this.IH)return this.IH;const e=this.zS,i=this.ES,s=this.SH,r=this.OS,n=this.VS,o=this.ZY.Dx(e),h=[],a=Ay.projectionOrthographic(-1,1,-1,1,1,-1);let l=Ay.translate(a,r.x/2,r.y/2,r.z/2);l=Ay.rotateXYZ(l,n),l=Ay.translate(l,-r.x/2,-r.y/2,-r.z/2);const u=(i.x+1)*(r.x/2),c=(i.y+1)*(r.y/2),d=(i.z+1)*(r.z/2);for(let e=0;et.map((t=>{const e={x:i.vertices[3*t],y:i.vertices[3*t+1],z:i.vertices[3*t+2]},s=r[t],o=this.ZY.Bx(s),h=this.ZY.jm(o);return{index:t,vertex:e,world:s,axis:o,dist:h?$e(h,n):Be}})))).flat();o.sort(((t,e)=>t.dist-e.dist));const h=o[0];if(!h)return;const a=this.kH?this.kH[h.index]:void 0;return{coordModel:h.vertex,coordAxis:h.axis,index:h.index,value:a}}dispose(){return super.dispose(),this._G&&(this.ZR.LV(this._G),this._G=void 0),this.wG&&(this.ZR.LV(this.wG),this.wG=void 0),this.CH&&(this.ZR.LV(this.CH),this.CH=void 0),this.TH&&(this.ZR.LV(this.TH),this.TH=void 0),this.kE=void 0,this.RY=void 0,this._H=void 0,this.kH=void 0,this}KR(){return this.dispose(),this}WS(t){return this._H=t,this.mH=!0,this.OS=t.modelSize,this}Ie(t){return this.we=Qr(this.we,t),this}Hh(){return this.we}YS(t){return this.SH=t,this.IH=void 0,this}IV(){return this.SH}HS(t){return this.zS=t,this.IH=void 0,this}$S(t){return this.ES=t,this.IH=void 0,this}XS(t){return this.VS=t,this.MH=!0,this.IH=void 0,this}jS(t){return this.jY=t,this}ZS(){return this.jY}St(){return ze}vt(){return Be}bt(){return ze}xt(){return Be}mv(){return ze}vv(){return Be}Cl(){return 0}kl(){return 0}Sv(){return 0}aa(){return qr(this.la,this.we)}da(t){this.la=t}}class sp extends Hm{constructor(t,e,i,s){super(t,e,i),this.jY="cull-back",this.LM=[],this.zW=new sm(this.LM,(t=>t.vertexBuffer&&this.ZR.LV(t.vertexBuffer)),!1),this.bu=[],this.qa=0,this.tl=[],this.il=0,this.Ka=Oe,this.sl=Oe,this.el=!1,this.PN=dg({fillStyleSolid:()=>{const t=this.Fv.getFillStyle();return Y(t)&&t},fillStyleIndividual:()=>{const t=this.Fv.getFillStyle();return X(t)&&t},fillStylePalette:()=>{const t=this.Fv.getFillStyle();return H(t)&&t},triangulatedPointStyle:()=>{const t=this.Fv;return yr(t)&&t},wireframeLineStyleSolid:()=>{const t=yr(this.Fv)&&this.Fv,e=t&&t.getWireframeStyle();return ts(e)&&e},wireframeFillStyleSolid:()=>{const t=yr(this.Fv)&&this.Fv,e=t&&t.getWireframeStyle(),i=e&&e.getFillStyle();return Y(i)&&i}}),this.hl=void 0,this.Qn=s,this.Fv=Ir.pointStyle3D,this.nv._(jn);const r=!0===(null==s?void 0:s.individualPointColorEnabled),n=!0===(null==s?void 0:s.individualPointSizeEnabled),o=!0===(null==s?void 0:s.individualLookupValuesEnabled),h=!0===(null==s?void 0:s.individualPointSizeAxisEnabled);let a,l,u,c,d=0;d+=3,r&&(a=d,d+=4),n&&(l=d,d+=1),o&&(u=d,d+=1),h&&(c=d,d+=3);const f=((t,e,i,s)=>t||e||i||s?!t||e||i||s?t||!e||i||s?t||e||!i||s?t||e||i||!s?(r,n,o)=>{const h=3+(t?4:0)+(e?1:0)+(i?1:0)+(s?3:0),a=r.length,l=new Float32Array(a*h);let u=0,c=u;for(let t=0;t((t,e)=>{const i=e&&e.getSize();let s={x:1,y:1,z:1};"object"==typeof i&&(s=i);const r=t.length,n=new Float32Array(6*r);let o=0;for(let e=0;e(t=>{const e=t.length,i=new Float32Array(4*e);for(let s=0,r=0;s((t,e)=>{const i=e&&e.getSize();let s=1;"number"==typeof i&&(s=i);const r=t.length,n=new Float32Array(4*r);for(let e=0,i=0;e((t,e)=>{const i=e&&X(e)&&e.getFallbackColor()||E,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;ete(t))(r,n,o,h);this.WW={individualPointColorEnabled:r,individualPointSizeEnabled:n,individualLookupValuesEnabled:o,individualPointSizeAxisEnabled:h,attributesPerVertex:d,attributeOffsetCoordinate:0,attributeOffsetColor:a,attributeOffsetSize:l,attributeOffsetLookUpValue:u,attributeOffsetPointSize3D:c,prepareRenderData:(t,e)=>f(t,this.Fv,this.Fv.fillStyle)}}TN(t,e,i,s,r){return{info:{dataPoint:this.bu[t-e]}}}Ls(t){const e=this.el,i=this.tl,s=this.il,r=s>0,n=this.Fv,o=this.Fv!==this.PH,h=this.No.C(),a=this.No.u,l=this.nV();this.sl&&(this.Ka=ii(this.Ka,this.sl),this.sl=void 0),r&&(this.bu=he(this.bu,i,{canReturnB:!0}),this.qa+=s);let u=i,c=s;if(e&&(this.LM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=Oe})),this.zW.TW(),u=this.bu,c=this.qa),c>0){const t=Math.floor(this.bN.gH/(this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=Ft(c,1e5,t);this.zW.MW(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:Oe,vertexBuffer:this.ZR.qV(t*this.WW.attributesPerVertex,this.WW.prepareRenderData(e,i))})),((t,e,i)=>{this.ZR.tO(t.vertexBuffer,t.existingCoordinatesCount*this.WW.attributesPerVertex,this.WW.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}const d=n.getFillStyle(),f=this.PN.fillStyleSolid(o),g=this.PN.fillStyleIndividual(o),y=this.PN.fillStylePalette(o),m=d===B&&B;if(o||l||a){let t;const e=n.getSize(),i=this.WW.individualPointColorEnabled,s=this.WW.individualPointSizeEnabled,r=this.WW.individualPointSizeAxisEnabled,a=this.WW.individualLookupValuesEnabled;if(g&&!i){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw wt.alert(t),new Error(t)}if(y&&"value"===y.getLookUpProperty()&&!a){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw wt.alert(t),new Error(t)}const l=this.PN.wireframeLineStyleSolid(o),u=this.PN.wireframeFillStyleSolid(o);if(f||g||y||u){const i=g?"attribute":y?["lookup",y.getLookUpProperty(),y.lut]:"uniform",o=s&&"number"==typeof e,a=r&&"object"==typeof e,c=o||a?"attribute":"uniform";if(yr(n)){const r=ne(n.getShape(),{cube:()=>Xm(this.ZR),sphere:()=>rp(this.ZR,n,s)});t={type:"instanced",shader:this.ZR.Mz(Ug["3D"],Ug.ColorShaded3D({dataType:i,shadingStyle:this.nv.C().type,wireframe:!1!==u}),Ug.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:cg(this.At),normalSource:r.UY})),pointStyle:n,useIndividualPointSize:o,useIndividualPointSize3D:a,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:y,fillStyleEmpty:m,mousePickingShader:h&&this.ZR.Mz(Ug["3D"],Ug.MousePicking(),Ug.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:cg(this.At),normalSource:void 0})),geometry:r,wireframe:l&&u&&{thickness:l.getThickness()<0?1:l.getThickness(),fillStyleSolid:u}}}else xr(n)&&"number"==typeof e&&(t={type:"primitive",shader:this.ZR.Mz(Ug["3D"],Ug.PointSize(c),Ug.Color({dataType:i}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:o,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:y,mousePickingShader:h&&this.ZR.Mz(Ug["3D"],Ug.PointSize(c),Ug.MousePicking({useVertexId:!0}),Ug.VertexLocation({axisWorldTranslation:cg(this.At),normalSource:void 0}))})}this.zG=t}if(void 0===this.hl&&y&&"value"===y.lookUpProperty&&y.lut.percentageValues){let t=ze,e=Be;for(let i=0;it&&(t=s.value)}this.hl={min:e,max:t}}return this.el=!1,this.tl=[],this.il=0,this.PH=n,this.nv.u=!1,this}QL(t,e){const i=this.ZR.gl,s=this.zG,r=this.qa;if(!s)return{};const n=1===t?s.mousePickingShader:s.shader;if(!n)return{};const o=this.nv.C(),{fillStyleSolid:h,fillStylePaletted:a,useIndividualPointSize:l}=s,u="instanced"===s.type&&s.useIndividualPointSize3D,c="instanced"===s.type&&s.wireframe;return this.ZR.wV(n,((r,d,f,g)=>{let y=!1;if(this.ZR.aE(n).XV(r("uScale"),this.ZY._E.IV()).XV(r("uDisp"),this.ZY._E.PV()).ZV(r("uViewProjectionMatrix"),this.rH).FV(r("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(r("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(r("uRenderEffectMask"),2===t?1:0),"instanced"===s.type){const{pointSizeAxis:t,pointSizeNWU:e}=s;!1!==t&&!1===u&&this.ZR.XV(r("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===l&&this.ZR.FV(r("uOffsetNWU"),e).FV(g("uRatioNwuWu"),this.ZY.pH())}else if("primitive"===s.type){const{pointSizePixels:t}=s;l||this.ZR.FV(r("uPointSize"),t).FV(r("uDevicePixelRatio"),this.ZR.lV())}if(1===t);else if("instanced"===s.type?("phong"===o.type&&this.ZR.XV(r("uCameraLoc"),this.nH).XV(r("uLightLoc"),this.oH).FV(r("uAmbientReflection"),o.ambientReflection).FV(r("uSpecularReflection"),o.specularReflection).FV(r("uDiffuseReflection"),o.diffuseReflection).FV(r("uShininess"),o.shininess).TR(r("uLightColor"),o.specularColor).TR(r("uAmbientColor"),o.ambientColor),c&&this.ZR.FV(r("uWireframeThickness"),c.thickness).TR(r("uWireframeColor"),c.fillStyleSolid.getColor()),h&&this.ZR.TR(r("uColorDiffuse"),h.getColor()),s.fillStyleEmpty&&this.ZR.TR(r("uColorDiffuse"),k)):"primitive"===s.type&&h&&this.ZR.TR(r("uColor"),h.getColor()),a){const t=fg(a,this,this.hl);if(!t&&a.lut.percentageValues)return!1;this.ZR.JO(f,a.lut,t)}const m=Ve(e);return this.LM.forEach((e=>{if(1===t){const[t,i]=m.Ut(e.existingDataPointsCount);this.ZR.QV(r("uFirstId"),t),"instanced"===s.type?this.ZR.YO(f,i):this.ZR.WO(f,i)}i.bindBuffer(i.ARRAY_BUFFER,e.vertexBuffer);const n=d("aPos");if(i.vertexAttribPointer(n,3,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.ZR.nO(n,1),i.enableVertexAttribArray(n),s.fillStyleIndividual&&void 0!==this.WW.attributeOffsetColor&&1!==t){const t=d("aColor");i.vertexAttribPointer(t,4,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.ZR.nO(t,1),i.enableVertexAttribArray(t)}if(l&&void 0!==this.WW.attributeOffsetSize){"instanced"===s.type?this.ZR.FV(g("uRatioNwuWu"),this.ZY.pH()):"primitive"===s.type&&this.ZR.FV(r("uDevicePixelRatio"),this.ZR.lV());const t=d("instanced"===s.type?"aOffsetNWU":"aPointSize");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.ZR.nO(t,1),i.enableVertexAttribArray(t)}if(u&&void 0!==this.WW.attributeOffsetPointSize3D&&"instanced"===s.type){const t=d("aOffsetAxis");i.vertexAttribPointer(t,3,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.ZR.nO(t,1),i.enableVertexAttribArray(t)}if(s.fillStylePaletted&&"value"===s.fillStylePaletted.getLookUpProperty()&&void 0!==this.WW.attributeOffsetLookUpValue&&1!==t){const t=d("aLookupValue");i.vertexAttribPointer(t,1,i.FLOAT,!1,this.WW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.WW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===s.type&&this.ZR.nO(t,1),i.enableVertexAttribArray(t)}"instanced"===s.type?(s.geometry.Jy(f,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(c)&&1!==t),y=!0):"primitive"===s.type&&(this.ZR.Jy(i.POINTS,e.existingCoordinatesCount),y=!0)})),y})),{idCount:r}}dl(t,e){Array.isArray(t)||(t=[t]),this.tl=he(this.tl,t,{canReturnB:!0}),this.il+=t.length;const i=e||ti(t);return this.sl=this.sl?ii(this.sl,i):i,this.hl=void 0,this}Iv(t){return this.Fv="function"==typeof t?t(this.Fv):t,this}DH(){return this.Fv}St(){return this.sl?Math.max(this.sl.max.x,this.Ka.max.x):this.Ka.max.x}vt(){return this.sl?Math.min(this.sl.min.x,this.Ka.min.x):this.Ka.min.x}bt(){return this.sl?Math.max(this.sl.max.y,this.Ka.max.y):this.Ka.max.y}xt(){return this.sl?Math.min(this.sl.min.y,this.Ka.min.y):this.Ka.min.y}mv(){return this.sl?Math.max(this.sl.max.z,this.Ka.max.z):this.Ka.max.z}vv(){return this.sl?Math.min(this.sl.min.z,this.Ka.min.z):this.Ka.min.z}Cl(){const t=this.Fv,e=t.getSize();return"number"==typeof e?yr(t)?e/2:xr(t)?5:0:0}kl(){return this.Cl()}Sv(){return this.Cl()}nl(){return this.bu}rl(){return this.tl}fl(){return this.qa}Al(){return this.il}Ot(){return this.el=!0,this.bu.length=0,this.qa=0,this.tl=[],this.il=0,this.Ka=Oe,this.sl=void 0,this.hl=void 0,this}dispose(){return super.dispose(),this.zW.FW(),this.zG=void 0,this}KR(){return this.dispose(),this}}const rp=(t,e,i)=>{const s=e.getSize();return qm(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class np extends Hm{constructor(t,e,i,s){super(t,e,i),this.jY="disabled",this.we=Ir.fillStyle,this.SS=Ir.lineStyle,this.kU=p("bilinear"),this.BH=[],this.LH=void 0,this.zG={},this.RH=!1,this.PN=dg({fillStyleSolid:()=>Y(this.we)&&this.we,fillStylePaletted:()=>H(this.we)&&this.we,wireframeStyleLine:()=>ts(this.SS)&&this.SS,wireframeStyleFill:()=>{const t=this.SS&&this.SS.getFillStyle();return Y(t)&&t}}),this.Pi={x:0,z:0},this.mw={x:1,z:1},this.nv._(Hn);const r="columns"===s.dataOrder?s.columns:s.rows,n="columns"===s.dataOrder?s.rows:s.columns;this.Qn={...s,primaryDimensionVectorsCount:r,secondaryDimensionVectorsCount:n},this.EH=new Array(this.Qn.primaryDimensionVectorsCount).fill(void 0),this.h_=new vm(this.bN,t.bN.UU,t.ls.At,kt,[],this.Qn).xS(nt),this.h_.IU=ym;const o=this.h_.DU.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,r=t.iFirstUniqueVector,n=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary),o={primary:t.sizeHeatmapDataVectors.primary-1,secondary:t.sizeHeatmapDataVectors.secondary-1};return{iFirstVector:t.iFirstVector,iFirstUniqueVector:t.iFirstUniqueVector,sizeHeatmapDataVectors:t.sizeHeatmapDataVectors,sizeUniqueHeatmapDataVectors:t.sizeUniqueHeatmapDataVectors,iFirstGeometryVector:s,iFirstGeometryUniqueVector:r,sizeGeometryDataVectors:e,sizeUniqueGeometryDataVectors:i,heightmapData:n,normalmapSize:o}})),h=this.h_.DU.gridTileSizes.map((t=>{const e=o.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary)),i=e[0].sizeGeometryDataVectors;return{...t,tiles:e,sizeGeometryData:i}})),a=o.reduce(((t,e)=>{const i=e.sizeHeatmapDataVectors.primary,s=e.sizeHeatmapDataVectors.secondary,r=i*s;return r>t.cells?{primary:i,secondary:s,cells:r}:t}),{primary:0,secondary:0,cells:0});this.zH={gridTiles:o,gridTileSizes:h,largestGridTileSize:a},this._S(this.Pi,this.mw)}TN(t,e,i,s,r){const n=t-e,o=n%(this.Qn.secondaryDimensionVectorsCount-1),h=Math.floor(n/(this.Qn.secondaryDimensionVectorsCount-1)),a="columns"===this.Qn.dataOrder?h:o,l="rows"===this.Qn.dataOrder?h:o,u=[{x:this.Pi.x+a*this.mw.x,z:this.Pi.z+l*this.mw.z,y:this.VH(h,o),intensity:this.OH(h,o),column:"columns"===this.Qn.dataOrder?h:o,row:"columns"===this.Qn.dataOrder?o:h},{x:this.Pi.x+(a+("columns"===this.Qn.dataOrder?1:0))*this.mw.x,z:this.Pi.z+(l+("rows"===this.Qn.dataOrder?1:0))*this.mw.z,y:this.VH(h+1,o),intensity:this.OH(h+1,o),column:"columns"===this.Qn.dataOrder?h+1:o,row:"columns"===this.Qn.dataOrder?o:h+1},{x:this.Pi.x+(a+1)*this.mw.x,z:this.Pi.z+(l+1)*this.mw.z,y:this.VH(h+1,o+1),intensity:this.OH(h+1,o+1),column:"columns"===this.Qn.dataOrder?h+1:o+1,row:"columns"===this.Qn.dataOrder?o+1:h+1},{x:this.Pi.x+(a+("columns"===this.Qn.dataOrder?0:1))*this.mw.x,z:this.Pi.z+(l+("rows"===this.Qn.dataOrder?0:1))*this.mw.z,y:this.VH(h,o+1),intensity:this.OH(h,o+1),column:"columns"===this.Qn.dataOrder?h:o+1,row:"columns"===this.Qn.dataOrder?o+1:h}],c=u.map((t=>this.ZY.jm(t))).map((t=>void 0===t?Be:$e(t,{x:s,y:r}))).map(((t,e)=>({i:e,dist:t})));return c.sort(((t,e)=>t.dist-e.dist)),{info:{dataPoint:{...u[c[0].i]}}}}VH(t,e){for(let i=0;i=s.iFirstVector.primary&&t<=s.iFirstVector.primary+s.sizeHeatmapDataVectors.primary-1&&e>=s.iFirstVector.secondary&&e<=s.iFirstVector.secondary+s.sizeHeatmapDataVectors.secondary-1){const i=t-s.iFirstVector.primary,r=e-s.iFirstVector.secondary,n=i*s.sizeHeatmapDataVectors.secondary+r;return s.heightmapData[n]}}return 0}OH(t,e){if(this.h_.FU)for(let i=0;i=s.iFirstVector.primary&&t<=s.iFirstVector.primary+s.sizeHeatmapDataVectors.primary-1&&e>=s.iFirstVector.secondary&&e<=s.iFirstVector.secondary+s.sizeHeatmapDataVectors.secondary-1){const i=t-s.iFirstVector.primary,r=e-s.iFirstVector.secondary,n=i*s.sizeHeatmapDataVectors.secondary+r;return s.intensityData[n]}}}NH(t){this.GH=t,this.LH=void 0}_S(t,e){this.Pi=t,this.mw=e;const i=this.Qn,s={min:{x:Math.min(this.Pi.x,this.Pi.x+(i.columns-1)*this.mw.x),z:Math.min(this.Pi.z,this.Pi.z+(i.rows-1)*this.mw.z)},max:{x:Math.max(this.Pi.x,this.Pi.x+(i.columns-1)*this.mw.x),z:Math.max(this.Pi.z,this.Pi.z+(i.rows-1)*this.mw.z)}},r=new Map;return this.zH.gridTiles.forEach((t=>{const e="columns"===this.Qn.dataOrder?{x:this.mw.x*(t.sizeHeatmapDataVectors.primary-1),z:this.mw.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.mw.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.mw.z*(t.sizeHeatmapDataVectors.primary-1)},i="columns"===this.Qn.dataOrder?{x:this.Pi.x+this.mw.x*t.iFirstVector.primary,z:this.Pi.z+this.mw.z*t.iFirstVector.secondary}:{x:this.Pi.x+this.mw.x*t.iFirstVector.secondary,z:this.Pi.z+this.mw.z*t.iFirstVector.primary};r.set(t,{sizeAxis:e,startLocationAxis:i})})),this.VU={WH:s,tilesInfo:r},this}wS(){return{start:this.Pi,step:this.mw,end:{x:this.Pi.x+this.mw.x*this.Qn.columns,z:this.Pi.z+this.mw.z*this.Qn.rows}}}Ls(t){const e=this.BH,i=qr(this.la,this.we),s=this.PN.fillStyleSolid(i),r=this.PN.fillStylePaletted(i),n=this.SS,o=this.SS!==this.BU,h=this.PN.wireframeStyleLine(o),a=this.PN.wireframeStyleFill(o),l=!1!==a,u=this.kU.u,c=this.kU.C(),d=this.nv.C(),f=this.nV(),g=this.No.C();this.h_.Ls();const y=this.h_.LU;if(!y)return this;this.UH=this.UH||this.YH(y);const m=this.UH;this.HH(m);const p=mm(e,m,void 0,(t=>t.sizeGeometryDataVectors));if(p.size>0&&(Am(this.ZR,p,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.RH=!0),"phong"===d.type&&(p.size>0||f)){const t=this.ZR.gl,e=this.ZR.Mz(Ug["2D"],Ug.DrawToNormalTexture({flipXZ:"rows"===this.Qn.dataOrder,vertexIdSource:this.ZR.GO(),normalTextureType:this.ZR.gl2?"uint":"ubyte",heightmapTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN}));m.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{var r;const n=s.normalmapTexture,o=null===(r=this.VU)||void 0===r?void 0:r.tilesInfo.get(s.tileData);if(!n||!o)return;const h={x:s.normalmapSize.secondary,y:s.normalmapSize.primary},a=h.x*h.y;this.ZR._O.QL((()=>{this.ZR.wV(e,((r,n,h,l)=>(this.ZR.aE(e).WO(h,a).kV(r("uTileDimensionsXZ"),["columns"===this.Qn.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.Qn.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).HV(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).kV(r("uTileStartLocationAxisXZ"),[o.startLocationAxis.x,o.startLocationAxis.z]).kV(r("uTileSizeAxisXZ"),[o.sizeAxis.x,o.sizeAxis.z]).TV(r("uHeightmapTexture"),s.heightmapDataTexture,1).Jy(t.POINTS,a),!0)))}),n,h,void 0,this.ls.Cn(),0)}))}))}const x=this.zG;if(i||o||u){const t=h&&a?{wireframeSolid:h,wireframeFillSolid:a}:void 0;s?x.surface={shader:this.ZR.Mz(Ug["3D"],Ug.SurfaceGrid({axisWorldTranslation:cg(this.At),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Qn.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.ZR.gl2?"uint":"ubyte",intensityTextureType:this.ZR.mz?"float":"ubyte",heightmapTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:r&&"value"===r.getLookUpProperty()?x.surface={shader:this.ZR.Mz(Ug["3D"],Ug.SurfaceGrid({axisWorldTranslation:cg(this.At),fillColor:["lookup","value",r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Qn.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.ZR.gl2?"uint":"ubyte",intensityTextureType:this.ZR.mz?"float":"ubyte",heightmapTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r},wireframe:t}:r?x.surface={shader:this.ZR.Mz(Ug["3D"],Ug.SurfaceGrid({axisWorldTranslation:cg(this.At),fillColor:["lookup",r.getLookUpProperty(),r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Qn.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.ZR.gl2?"uint":"ubyte",intensityTextureType:this.ZR.mz?"float":"ubyte",heightmapTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r},wireframe:t}:l&&(x.surface={shader:this.ZR.Mz(Ug["3D"],Ug.SurfaceGrid({axisWorldTranslation:cg(this.At),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Qn.dataOrder,shadingStyle:d.type,wireframe:l,normalTextureType:this.ZR.gl2?"uint":"ubyte",intensityTextureType:this.ZR.mz?"float":"ubyte",heightmapTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return x.mousePicking=g?this.zG.mousePicking||{shader:this.ZR.Mz(Ug["3D"],Ug.MousePicking(),Ug.SurfaceGrid({axisWorldTranslation:cg(this.At),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Qn.dataOrder,shadingStyle:"simple",wireframe:!1,normalTextureType:this.ZR.gl2?"uint":"ubyte",intensityTextureType:this.ZR.mz?"float":"ubyte",heightmapTextureType:this.ZR.mz?"float":"ubyte",littleEndian:this.ZR.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.zG=x,this.BH.length=0,this.la=this.we,this.BU=n,this.nv.u=!1,this}YH(t){const e=this.zH.gridTiles.map((e=>{const i=xm(this.ZR,e.sizeHeatmapDataVectors.secondary,e.sizeHeatmapDataVectors.primary),s=t.gridTiles.find((t=>t.iFirstUniqueVector.primary===e.iFirstUniqueVector.primary&&t.iFirstUniqueVector.secondary===e.iFirstUniqueVector.secondary));if(!s)throw new Error("Internal LC JS error prepare surface data 2D render data not found");return{...e,intensityDataTexture:s.intensityDataTexture,heightmapDataTexture:i,normalmap:void 0,tileData:e}})),i=this.zH.gridTileSizes.map((t=>{const i=e.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary));return{...t,tiles:i}})),s=this.ZR.MV([0,0,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,0]),r=this.ZR.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}HH(t){var e;if("phong"===this.nv.C().type)for(let i=0;i{t.normalmapTexture&&(this.ZR.qR(t.normalmapTexture),t.normalmapTexture=void 0)}))}QL(t,e){var i,s,r,n;const o=this.ZR.gl,h=this.UH;if(!h)return{};const a=this.nv.C(),l=this.zG,u=1===t?null===(i=l.mousePicking)||void 0===i?void 0:i.shader:null===(s=l.surface)||void 0===s?void 0:s.shader;if(!u)return{};const c=1!==t?null===(r=l.surface)||void 0===r?void 0:r.wireframe:void 0,d=1!==t?null===(n=l.surface)||void 0===n?void 0:n.fill:void 0;return this.ZR.wV(u,((i,s,r,n)=>{let l=!1;if(this.ZR.aE(u).YO(r,this.zH.largestGridTileSize.cells).XV(i("uScale"),this.ZY._E.IV()).XV(i("uDisp"),this.ZY._E.PV()).ZV(i("uViewProjectionMatrix"),this.rH).FV(i("uIsHighlighted"),1===t||2===t?0:this.Yo).TR(i("uHighlightColorOffset"),1===t||2===t?k:this.jo).FV(i("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===a.type&&this.ZR.XV(i("uCameraLoc"),this.nH).XV(i("uLightLoc"),this.oH).FV(i("uAmbientReflection"),a.ambientReflection).FV(i("uSpecularReflection"),a.specularReflection).FV(i("uDiffuseReflection"),a.diffuseReflection).FV(i("uShininess"),a.shininess).TR(i("uLightColor"),a.specularColor).TR(i("uAmbientColor"),a.ambientColor),c)){const{wireframeFillSolid:t,wireframeSolid:e}=c,s=e.getThickness()<0?1:e.getThickness();this.ZR.TR(i("uWireframeColor"),t.getColor()).FV(i("uWireframeThickness"),s)}return 1===t||"solid"===(null==d?void 0:d.fillMode)&&this.ZR.TR(i("uColorDiffuse"),d.fillStyleSolid.getColor()),h.gridTileSizes.forEach((n=>{this.ZR.kV(i("uTileDimensionsXZ"),["columns"===this.Qn.dataOrder?n.sizeHeatmapData.primary:n.sizeHeatmapData.secondary,"columns"===this.Qn.dataOrder?n.sizeHeatmapData.secondary:n.sizeHeatmapData.primary]).HV(i("uTileDimensions"),[n.sizeHeatmapData.primary,n.sizeHeatmapData.secondary]),n.tiles.forEach((a=>{var u;const f=null===(u=this.VU)||void 0===u?void 0:u.tilesInfo.get(a.tileData);if(!f)return;let g=0,m=(a.sizeHeatmapDataVectors.primary-1)*(a.sizeHeatmapDataVectors.secondary-1);if(this.GH){const t=this.GH.fill.iFirstPrimary,e=this.GH.fill.iFirstPrimary+this.GH.fill.amountPrimary-1,i=a.iFirstVector.primary,s=a.iFirstVector.primary+a.sizeHeatmapDataVectors.primary-1;if(i>e||sy(Math.max(t,i),Math.min(e,s)))(t,e,i,s);g=(r.min-a.iFirstVector.primary)*(n.sizeGeometryData.secondary-1),m=(r.max-r.min)*(n.sizeGeometryData.secondary-1)}if(!(g<0||m<=0)){if("intensity"===(null==d?void 0:d.fillMode)){const{fillStylePaletted:t}=d,e=this.h_.hl;this.ZR.JO(r,t.lut,e).TV(i("uTileIntensityValues"),a.intensityDataTexture,2).$V(i("uTileBoundsAxisXZ"),[f.startLocationAxis.x,f.startLocationAxis.z,f.sizeAxis.x,f.sizeAxis.z])}if("xyz"===(null==d?void 0:d.fillMode)){const{fillStylePaletted:t}=d,e="x"===t.getLookUpProperty()?{min:this.vt(),max:this.St()}:"y"===t.getLookUpProperty()?{min:this.xt(),max:this.bt()}:"z"===t.getLookUpProperty()?{min:this.vv(),max:this.mv()}:void 0;if(!e&&t.lut.percentageValues)return;this.ZR.JO(r,t.lut,e)}1!==t&&"phong"===this.nv.C().type&&a.normalmapTexture&&this.ZR.TV(i("uNormalmapTexture"),a.normalmapTexture,3),1===t&&this.ZR.QV(i("uFirstId"),e+g),this.ZR.CV(h.rectangleLocationsBuffer,0,{location:s("aGeoCellOffset"),size:2},{location:c?s("aTriangleBary"):void 0,size:3}).QV(i("uBaseInstance"),g).kV(i("uTileStartLocationAxisXZ"),[f.startLocationAxis.x,f.startLocationAxis.z]).kV(i("uTileSizeAxisXZ"),[f.sizeAxis.x,f.sizeAxis.z]).TV(i("uHeightmapTexture"),a.heightmapDataTexture,0).fO(h.rectangleLocationsDrawMode,0,h.rectangleLocationsDrawLength,m),l=!0,o.bindBuffer(o.ARRAY_BUFFER,null)}}))})),l})),{idCount:this.Qn.columns*this.Qn.rows}}dispose(){return super.dispose(),this.h_.dispose(),this.UH&&(this.UH.gridTileSizes.forEach((t=>{})),this.UH.gridTiles.forEach((t=>{this.ZR.qR(t.heightmapDataTexture),t.normalmapTexture&&this.ZR.qR(t.normalmapTexture)})),this.ZR.LV(this.UH.rectangleLocationsBuffer),this.UH=void 0),this.zG={},this}KR(){return this.dispose(),this.h_.KR(),this}FS(t){return this.h_.FS(t),this}IS(t){this.BH.push(t),pm(this.zH.gridTiles,t,(t=>t.heightmapData));for(let e=t.startPrimary;e{for(let n=Math.max(t,r.iFirstUniqueVector.primary);n<=Math.min(e,r.iFirstUniqueVector.primary+r.sizeUniqueHeatmapDataVectors.primary-1);n+=1){const t=(n-r.iFirstUniqueVector.primary)*r.sizeHeatmapDataVectors.secondary;let e=this.EH[n];if(e)i=ie.max?s:e.max;else{e={min:Be,max:ze},this.EH[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.LH={min:i,max:s},this.LH}}class op extends Hm{constructor(t,e,i,s){super(t,e,i),this.jY="disabled",this.NU=0,this.WU={},this.XH=new Map,this.Pi={x:0,z:0},this.mw={x:1,z:1},this.Qn={...s,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.WH={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===s.scrollDimension?this.Pi.x+(s.columns-1)*this.mw.x:this.Pi.x,z:"columns"===s.scrollDimension?this.Pi.z+(s.rows-1)*this.mw.z:this.Pi.z}};const r=()=>({shape:new np(this.ZY,kt,this.$o,{columns:s.columns+("columns"===s.scrollDimension?1:0),rows:s.rows+("rows"===s.scrollDimension?1:0),dataOrder:s.scrollDimension,heatmapDataType:"intensity"}).setVisible(!1),hasData:!1});this.LM=[r(),r()]}Ls(t){this.LM.forEach((e=>{e.shape.Ls(t)}));const e=this.LM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Pt(null===(i=e.shape.h_.hl)||void 0===i?void 0:i.min,Be)),t.max=Math.max(t.max,Pt(null===(s=e.shape.h_.hl)||void 0===s?void 0:s.max,ze)),t}),{min:Be,max:ze}),i=this.LM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Pt(null===(i=e.shape.LH)||void 0===i?void 0:i.min,Be)),t.max=Math.max(t.max,Pt(null===(s=e.shape.LH)||void 0===s?void 0:s.max,ze)),t}),{min:Be,max:ze});return this.LM.forEach((t=>{t.shape.h_.hl=e,t.shape.LH=i})),this}QL(t,e){let i=0;return this.LM.forEach((s=>{if(!s.hasData)return;s.shape.rH=this.rH,s.shape.nH=this.nH,s.shape.oH=this.oH;const{idCount:r}=s.shape.QL(t,e+i);void 0!==r&&(this.XH.set(s,{idFirst:e+i,idCount:r}),i+=r)})),{idCount:i}}TN(t,e,i,s,r){const n=Array.from(this.XH).find((e=>je(t,e[1].idFirst,e[1].idFirst+e[1].idCount-1)));return n?n[0].shape.TN(t,n[1].idFirst,n[1].idCount,s,r):{}}_S(t,e){return this.Pi=t,this.mw=e,this.LM.forEach((t=>{t.shape._S("columns"===this.Qn.scrollDimension?{x:t.shape.wS().start.x,z:this.Pi.z}:{x:this.Pi.x,z:t.shape.wS().start.z},this.mw)})),"columns"===this.Qn.scrollDimension?(this.WH.min.z=t.z,this.WH.max.z=this.Pi.z+(this.Qn.rows-1)*this.mw.z):(this.WH.min.x=t.x,this.WH.max.x=this.Pi.x+(this.Qn.columns-1)*this.mw.x),this}wS(){return{start:this.Pi,step:this.mw}}Ot(){return this.NU=0,this.WU={},this.WH={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===this.Qn.scrollDimension?this.Pi.x+(this.Qn.columns-1)*this.mw.x:this.Pi.x,z:"columns"===this.Qn.scrollDimension?this.Pi.z+(this.Qn.rows-1)*this.mw.z:this.Pi.z}},this.LM.forEach((t=>{t.shape.setVisible(!1),t.shape.RH=!1,t.hasData=!1})),this}LS(t){var e;const i=this.LM[0],s=this.LM[1],r=t.heightMapValues?t.heightMapValues.length:null===(e=t.intensityValues)||void 0===e?void 0:e.length;let n=0;if(!r)return this;do{const e=Math.floor(this.NU/this.Qn.scrollDimensionSize)%this.LM.length,o=this.LM[e],h=this.NU%this.Qn.scrollDimensionSize,a=this.Qn.scrollDimensionSize-h,l=0===h,u=Math.min(a,r),c=h+u,d=h,f=d+1,g=n,y=n+u,m=this.NU>=this.Qn.scrollDimensionSize&&c<=this.Qn.scrollDimensionSize-1,p=l;l&&(o.shape._S("columns"===this.Qn.scrollDimension?{x:this.Pi.x+(this.NU-1)*this.mw.x,z:this.Pi.z}:{x:this.Pi.x,z:this.Pi.z+(this.NU-1)*this.mw.z},this.mw),o.shape.setVisible(!0));const x=m?0:1,A=c+(m?1:0);o.shape.NH({fill:{iFirstPrimary:x,amountPrimary:A},wireframe:{iFirstPrimary:x,amountPrimary:A,connectNext:!1}});const S=o===i?s:i,v=c+1,b=1+this.Qn.scrollDimensionSize-v;S.shape.NH({fill:{iFirstPrimary:v,amountPrimary:b},wireframe:{iFirstPrimary:v,amountPrimary:b-1,connectNext:!0}});const M={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,y);let i=!1;p&&this.WU.yValues&&(i=!0,e.splice(0,0,this.WU.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Qn.staticDimensionSize,values:e,type:"y"};o.shape.IS(s),o.hasData=!0,M.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,y);let i=!1;p&&this.WU.intensityValues&&(i=!0,e.splice(0,0,this.WU.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Qn.staticDimensionSize,values:e,type:"intensity"};o.shape.FS(s),o.hasData=!0,M.intensityValues=e[u-1]}this.NU+=u,n+=u,this.WU=M}while(ne.shape.kS(t))),this}TS(){return this.LM[0].shape.TS()}Ie(t){return this.LM.forEach((e=>e.shape.Ie(t))),this}Hh(){return this.LM[0].shape.Hh()}xS(t){return this.LM.forEach((e=>e.shape.xS(t))),this}CS(){return this.LM[0].shape.CS()}KR(){return this.dispose(),this.LM.forEach((t=>t.shape.KR())),this}dispose(){return super.dispose(),this.LM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.LM.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}gv(t){return super.gv(t),this.LM.forEach((e=>e.shape.gv(t))),this}St(){return this.WH.max.x}vt(){return this.WH.min.x}bt(){return Math.max(this.LM[0].shape.bt(),this.LM[1].shape.bt())}xt(){return Math.min(this.LM[0].shape.xt(),this.LM[1].shape.xt())}mv(){return this.WH.max.z}vv(){return this.WH.min.z}Cl(){return 0}kl(){return 0}Sv(){return 0}us(t){return super.us(t),this.LM.forEach((e=>e.shape.us(t))),this}}class hp extends _m{constructor(t,e,i,s){super(t,e,i),this.jH=45,this.ZH=.1,this.QH=100,this.nH=f(0,0,1),this.JH=f(0,0,-1),this.KH=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.nv=new Zn,this.At=s}lx(){const{cellIndex:t,cellSpan:e,cellsAmount:i}=this.At,s=e.x/i.x,r=e.y/i.y,n=t.x/i.x,o=t.y/i.y,h=this.ls.oi();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.nH=t,this}getCameraLocation(){return this.nH}setCameraDirection(t){return this.JH=_e.normalize(t),this}getCameraDirection(){return this.JH}setLightLocation(t){return this.oH=t,this}getLightLocation(){return this.oH}qH(){return f(this.KH[0],this.KH[1],this.KH[2])}t$(){return f(this.KH[4],this.KH[5],this.KH[6])}}class ap extends hp{constructor(t,e,i,s){super(t,e,i,s),this._E=new Dy,this.i$=!0,this.s$="perspective",this.bN=t,this.gl=t._N(),this.GY=this.EY,this.e$=this.ls.Do((()=>{this.i$=!0})),this.h$=s.H((()=>{this.i$=!0}))}bV(t){const e=t.vt(),i=t.xt(),s=t.vv(),r=t.St(),n=t.bt(),o=t.mv();if(e===Be||r===ze||i===Be||n===ze||s===Be||o===ze)return Ne;const h=t.Cl(),a=t.kl(),l=t.Sv(),u=Math.abs(t.Is.$m(h)*t.At.x.rt()),c=Math.abs(t.Is.$m(a)*t.At.y.rt()),d=Math.abs(t.Is.$m(l)*t.At.z.rt()),f=e-u,g=r+u,y=i-c,m=n+c,p=s-d,x=o+d;let A;return[{x:f,y,z:p},{x:g,y,z:p},{x:f,y:m,z:p},{x:g,y:m,z:p},{x:f,y,z:x},{x:g,y,z:x},{x:f,y:m,z:x},{x:g,y:m,z:x}].map((e=>t.Is.jm(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};A=A?ei(A,{min:t,max:t}):e})),A||Ne}jm(t){if(this.r$(),this.n$(),!this.rH)return;const e=this._E.PV(),i=f(e[0],e[1],e[2]),s=this._E.IV(),r=f(s[0],s[1],s[2]),n=_e.divideVec(_e.subtractVec(t,i),r),o=this.rH,h=Ay.multiply(o,[n.x,n.y,n.z,1]),a=u(h[0]/h[3],h[1]/h[3]),l=this.ls.oi();return{x:.5*(1+a.x)*l.x,y:.5*(1+a.y)*l.y}}Dx(t){const e=this._E.PV(),i=this._E.IV(),s=_e.divideVec(_e.subtractVec(t,{x:e[0],y:e[1],z:e[2]}),{x:i[0],y:i[1],z:i[2]});return{...t,x:s.x,y:s.y,z:s.z}}Bx(t){const e=this._E.PV(),i=this._E.IV(),s=_e.addVec(_e.multiplyVec(t,{x:i[0],y:i[1],z:i[2]}),{x:e[0],y:e[1],z:e[2]});return{...t,x:s.x,y:s.y,z:s.z}}$m(t){return t/1e3}pH(){return.001}Ls(){const t=this.nH,e=this.oH,i=this.At.x.u||this.At.y.u||this.At.z.u;if(!e)throw pe(0,(()=>xe()));const{viewProjectionMatrix:s}=this.r$();this.n$();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.EY.forEach((t=>{t.rH=s,t.nH=r,t.oH=n,t.Ls(i)})),this}Ix(t){this.s$!==t&&(this.s$=t,this.i$=!0)}Px(){return this.s$}r$(){if(!this.i$&&this.rH)return{viewProjectionMatrix:this.rH};const t=this.lx(),e=t.width/t.height;if("perspective"===this.s$)this.o$=Ay.projectionPerspective(this.jH,e,this.ZH,this.QH);else{let t,i;e>1?(t=.5,i=t/e):(i=.5,t=i*e),this.o$=Ay.projectionOrthographic(-t,t,-i,i,this.ZH,this.QH)}const i=this.nH;this.KH[12]=i.x,this.KH[13]=i.y,this.KH[14]=i.z;const s=this.JH,r=f(0,1,0),n=_e.multiply(s,-1),o=_e.normalize(_e.cross(r,n)),h=_e.normalize(_e.cross(n,o));this.KH[0]=o.x,this.KH[1]=o.y,this.KH[2]=o.z,this.KH[4]=h.x,this.KH[5]=h.y,this.KH[6]=h.z,this.KH[8]=n.x,this.KH[9]=n.y,this.KH[10]=n.z,this.a$=Ay.inverse(this.KH);const{cellIndex:a,cellSpan:l,cellsAmount:u}=this.At,c=l.x/u.x,d=l.y/u.y,g=(a.x+l.x/2)/u.x,y=(a.y+l.y/2)/u.y,m=Ay.multiply(Ay.translation(zn(-1,1,g),zn(-1,1,y),0),Ay.scaling(c,d,1));return this.rH=Ay.multiply(m,Ay.multiply(this.o$,this.a$)),this.l$=Ay.inverse(this.rH),this.i$=!1,{viewProjectionMatrix:this.rH}}n$(){this._E.gN(this.At.x),this._E.pN(this.At.y),this._E.yN(this.At.z)}QL(t,e,i){var s;const r=this.gl.lV(),n=this.lx(),o={x:n.x*r*e,y:n.y*r*e,width:n.width*r*e,height:n.height*r*e};this.gl.xV(o.x,o.y,o.width,o.height);let h=((null===(s=i[i.length-1])||void 0===s?void 0:s.idLast)||0)+1;const a=Array.from(this.GY.values());for(let e=0;e(this.$i||this.vn||ey(this.ZR.gl)||(t&&(this.u$=!0),this.dn=!0,this.m$||this.hn.bz(t)),this),this.m$=!1,this.kz=t=>{if(this.$i||this.vn)return;const e=t-this.c$;if(e>=this.ho||-1===this.ho){this.m$=!0,this.c$=t,this.u$=!1;const i=e>50?1e3/60:e;this.fn&&this.fn(i),this.dn=!1,-1!==this.ho&&this.u$&&(this.hn.bz(this.u$),this.dn=!0),this.os.Ls(e),this.Tn(),this.Fn(),this.An&&this.An(),this.m$=!1,this.R.emit("render"),this.dn&&this.xs(this.u$)}else this.dn=!0,this.hn.bz()},this.v$=new Map,this._N=()=>this.ZR,this.S$=()=>{var t,e,i;const s=this.Hn(),r=this.d$,n=wt.performance.now(),o=null===(t=this.x$)||void 0===t?void 0:t.b$.reduce(((t,e)=>t?e.M$&&t.M$&&e.M$>t.M$?e:t:e),void 0),h=null==o?void 0:o.M$,a=null===(e=this.Nn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.$n)||void 0===i?void 0:i.timeStamp,u=this._$;return r?(this.xs(!0),!1):void 0===o||(void 0===o||!o.w$)&&(void 0!==l&&void 0!==h&&l>h||(void 0!==h&&void 0===s?n-h>=1e3:!(void 0!==h&&void 0!==a&&n-a>=2e3&&(void 0===u||n-u>=2e3))||n-h>=1e3))},this.C$=()=>{var t,e;this.k$=void 0;const i=null===(e=null===(t=this.x$)||void 0===t?void 0:t.T$)||void 0===e?void 0:e.F$;void 0===i||i>=this.f$||this.I$()},this.Fn=()=>{if(this.$i||this.vn)return this;const t=this.ZR.gl,e=wt.performance.now();this.ZR.vV(t.FRAMEBUFFER,this.hn.pz?this.az[0]:null);const i=this.Z,s=i.x>0&&i.y>0;if(this.wn.u&&this.ZR.pO(this.wn.C()),t.resize&&s&&t.resize(i.x*this.ZR.lV(),i.y*this.ZR.lV()),this.ZR.SV(0,0,i.x*this.ZR.lV(),i.y*this.ZR.lV()),this.ZR.xV(0,0,i.x*this.ZR.lV(),i.y*this.ZR.lV()),this.ZR.Ot(),s)for(const t of this.ln.values())t.QL(0,1,[]);if(this.Qn.io&&s&&(this.k$&&(wt.clearTimeout(this.k$),this.k$=void 0),this.S$()?(this.I$(),this.ZR.vV(t.FRAMEBUFFER,this.hn.pz?this.az[0]:null)):this.k$=wt.setTimeout(this.C$,500)),this.J(),this.sn(),this.Ln&&this.Bn(this.Ln),this.hn.pz){const e=this.ZR.gl2.ctx;e.bindFramebuffer(e.READ_FRAMEBUFFER,this.az[0]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.az[1]),e.clearBufferfv(e.COLOR,0,[1,1,1,1]),e.blitFramebuffer(0,0,this.Z.x*this.ZR.lV(),this.Z.y*this.ZR.lV(),0,0,this.Z.x*this.ZR.lV(),this.Z.y*this.ZR.lV(),t.COLOR_BUFFER_BIT,t.LINEAR)}else t.bindTexture(t.TEXTURE_2D,this.sz),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,this.Z.x*this.ZR.lV(),this.Z.y*this.ZR.lV(),0),t.bindTexture(t.TEXTURE_2D,null);return this.ZR.vV(t.FRAMEBUFFER,null),ey(this.ZR.gl)?this.hn.tz(0,0,this.Z.x*this.ZR.lV(),this.Z.y*this.ZR.lV(),[this]):this.hn.bz(),this.d$=!1,this.f$=e,this},this.Tn=()=>{if("use-window"===this.P$.mode){const t=wt.devicePixelRatio||1;this.ZR.FO(t)}const t=this.Z;if(0===t.x||0===t.y)return this;this.Ao.it(t);for(const t of this.ln.values())t.Ls();return this.J(),this},this.hn=t,this.hn.Az){this.D$=wt.document.createElement("canvas"),this.D$.style.width="100%",this.D$.style.height="100%",this.D$.style.display="block",this.D$.style.boxSizing="content-box",this.D$.style.position="absolute";const t=this.D$.getContext("2d",{willReadFrequently:!1,alpha:!0,desynchronized:!1});if(!t)throw new xt("No Canvas context available.");this.ez=t,this.Zr.appendChild(this.D$)}this.hn.Iz(this);const r={preserveDrawingBuffer:!0,antialias:e?e.antialias:void 0,alpha:!0,lineAntialias:!e||(!0===e.lineAntiAlias||!1===e.lineAntiAlias?e.lineAntiAlias:!1!==e.antialias)};let n;if(this.hn.pz&&t.gl2&&(n=new s(this,this.Qn,{type:"webgl2",ctx:t.gl2.ctx,antialias:r.antialias,lineAntialias:r.lineAntialias},this.Ki.isDark)),n||this.hn.pz||(n=new s(this,this.Qn,{type:"webgl1",ctx:t.gl,antialias:r.antialias,lineAntialias:r.lineAntialias},this.Ki.isDark)),!n)throw new xt("No WebGL context available");if(this.ZR=n,"number"==typeof(null==e?void 0:e.devicePixelRatio))this.P$={mode:"fixed",value:e.devicePixelRatio},this.ZR.FO(e.devicePixelRatio);else{const t=wt.document.head.querySelector('meta[name="viewport"]'),i=!0===e.devicePixelRatio||(null==t?void 0:t.content.includes("width=device-width")),s=wt.devicePixelRatio||1;this.P$=i?{mode:"use-window"}:{mode:"fixed",value:s},this.ZR.FO(s)}const o=e?e.width:void 0,h=e?e.height:void 0;this.co=this.B$(o),this.fo=this.B$(h),this.L$(this.co,this.fo),this.UU=this.GF("engine offscreen",1e6),this.R$=this.GF("engine bg",0);const a="function"==typeof this.Ki.lcjsBackgroundFillStyle?this.Ki.lcjsBackgroundFillStyle(this.Qn.Zs):this.Ki.lcjsBackgroundFillStyle;this.Ao=this.R$.Pe(this.At).Ie(a).Fe(this.Ki.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Be({x:0,y:0});const l=this.GF("engine effects",200001).WY(this.Ki.effect);this.ss=l;const u=this.hn.pz,d=this.oi();u&&(this.az=[n.zV(),n.zV()]);const f=this.ZR.gl;u&&(this.A$=f.createRenderbuffer(),this.g$=f.createRenderbuffer()),this.sz=f.createTexture();const g=d.x*this.ZR.lV(),y=d.y*this.ZR.lV();if(u){f.bindRenderbuffer(f.RENDERBUFFER,this.A$);const t=this.ZR.gl2.ctx;this.p$=this.hn.XE&&!1!==e.antialias?t.getParameter(t.MAX_SAMPLES):0,t.renderbufferStorageMultisample(t.RENDERBUFFER,this.p$,t.RGBA8,g,y),f.bindRenderbuffer(f.RENDERBUFFER,this.g$),f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,g,y),t.renderbufferStorageMultisample(t.RENDERBUFFER,this.p$,t.DEPTH_COMPONENT16,g,y)}u&&(this.ZR.vV(f.FRAMEBUFFER,this.az[0]),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.RENDERBUFFER,this.A$),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,this.g$)),f.bindTexture(f.TEXTURE_2D,this.sz),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,g,y,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),u&&(this.ZR.vV(f.FRAMEBUFFER,this.az[1]),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,this.sz,0)),this.ZR.vV(f.FRAMEBUFFER,null),this.Mn(),this.sn(),this.cp=Cr(this),this.dp={Ki:this.Ki,os:this.os,At:this.At,xs:t=>this.xs(t),Hn:()=>this.Hn(),vs:t=>(this._$=wt.performance.now(),this.vs({x:t.clientX,y:t.clientY})),ID:t=>this.ID(t),Qn:this.Qn,Xn:t=>this.Xn(t),ss:this.ss,Vo:t=>this.Vo(t),Oo:t=>this.Oo(t),Vg:{zg:(t,e,i)=>this.ZR.Xh(e.family).uE(t,e,i,this.Ki.isDark)}};const m=()=>{this.Y()};wt.addEventListener("unload",m),this.gn.push((()=>{wt.removeEventListener("unload",m)}))}get E$(){return this.ln}rn(t,e){let i=this.v$.get(t);if(!i){const e=this.ZR.RO(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.v$.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{PD:()=>e.Qz,DD:t=>{e.Qz?t():o.push(t)}}},this.v$.set(t,i),e.aE(this),e.eV((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new no(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}ID(t){const e=Array.from(this.v$.values()).find((e=>e.instances.has(t)));if(!e)throw pe(0,(()=>new Error("LightningChart JS error, attempted to use Icon that is disposed. Please check that you are not disposing an Icon that is still in use, or attempting to use a previously disposed Icon!")));return e.sharedEngineReference}vs(t){var e;const i=null===(e=this.x$)||void 0===e?void 0:e.T$;if(!i)return;const s=this.Re(t.x,t.y),r=Math.round(s.x*this.ZR.lV()),n=Math.round(s.y*this.ZR.lV());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.z$(i,r+t[0]/i.V$,n+t[1]/i.V$))).reduce(((t,e)=>{if(void 0===e)return t||void 0;const i=1e6*e.layerIndex+e.entityIndex;return!t||i>t.zIndexForComparison?{zIndexForComparison:i,entity:e.entity,collectionMember:e.collectionMember,info:e.info}:t}),void 0)}z$(t,e,i){const s=Math.round(e*t.V$),r=Math.round(i*t.V$);if(s<0||s>=t.Z.x||r<0||r>=t.Z.y)return;const n=4*(s+r*t.Z.x),o=t.O$[n+0],h=t.O$[n+1],a=t.O$[n+2],l=t.O$[n+3];if(void 0===o||void 0===h||void 0===a||void 0===l)return;if(0===o&&0===h&&0===a&&0===l)return;const u=16777216*o+65536*h+256*a+l,c=t.N$.find((t=>u>=t.idFirst&&u<=t.idLast));if(!c)return;const{collectionMember:d,info:f}=c.entity.TN(u,c.idFirst,c.idCount,e,i);return{entity:c.entity,collectionMember:d,entityIndex:c.entityIndex,layerIndex:c.layer.Pn(),info:f}}Kr(t,e,i){const s=this.ZR.gl;this.hn.pz?(this.ZR.vV(s.FRAMEBUFFER,this.az[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.sz,0)):this.ZR.vV(s.FRAMEBUFFER,null);const r=this.iz(),n=r.x,o=r.y,h=new Uint8Array(n*o*4);this.hn.pz||this.Fn(),s.readPixels(0,0,n,o,s.RGBA,s.UNSIGNED_BYTE,h);const a=new ImageData(new Uint8ClampedArray(h),n,o),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)throw new Error("Failed to create 2D context for saving image.");l.width=n,l.height=o,u.putImageData(a,0,0),u.translate(0,o),u.scale(1,-1),u.drawImage(l,0,0),this.hn.pz&&(this.ZR.vV(s.FRAMEBUFFER,this.az[0]),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,this.A$),this.ZR.vV(s.FRAMEBUFFER,this.az[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.sz,0)),this.ZR.vV(s.FRAMEBUFFER,null);const c=l.toDataURL(t,e);return i?c:(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=wt.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof zm))throw new Error("Unexpected Engine Layer error");return i}return this.In(new zm(this,e,t))}YF(t,e,i){const s=this.vo(e);if(s){if(pe(0,(()=>{})),!(s instanceof ap))throw new Error("Unexpected Engine Layer error");return s}return this.In(new ap(this,e,t,i))}oi(){return this.Z}iz(){const t=this.ZR.lV();return{x:Math.round(this.Z.x*t),y:Math.round(this.Z.y*t)}}B$(t){return t instanceof Array||(t=[t,t]),t}G$(){return this.hn.hz}W$(){return ey(this.ZR.gl)}I$(){var t;const e=this.ZR.gl,i=wt.performance.now(),s=this.Qn.qn,r={x:Math.ceil(this.Z.x*this.ZR.lV()*s),y:Math.ceil(this.Z.y*this.ZR.lV()*s)};this.x$||(this.x$={V$:s,U$:r,b$:[],T$:void 0});let n=this.x$.b$.find((t=>!t.w$)),o=!1;n||(o=!0,n={w$:!1,Z:r,jO:e.createTexture(),Y$:this.ZR.zV(),g$:this.ZR.VV(),H$:new Uint8Array,M$:void 0},this.x$.b$.push(n));const h=n;(o||h.Z.x!==r.x||h.Z.y!==r.y)&&(e.bindTexture(e.TEXTURE_2D,h.jO),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r.x,r.y,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),this.ZR.vV(e.FRAMEBUFFER,h.Y$),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,h.jO,0),e.bindRenderbuffer(e.RENDERBUFFER,h.g$),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,r.x,r.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,h.g$),h.H$=new Uint8Array(r.x*r.y*4),h.Z=r),h.w$=!0,h.M$=i,this.ZR.vV(e.FRAMEBUFFER,h.Y$),e.clearDepth(1),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.disable(e.BLEND),e.resize&&e.resize(r.x,r.y),this.ZR.SV(0,0,r.x,r.y);const a=[];for(const t of this.ln.values())t.QL(1,s,a);this.ZR.vV(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.ZR.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.x$){const t=this.x$.T$;if(t&&t.F$>i)return;this.x$.T$={F$:i,V$:s,Z:r,O$:h.H$,N$:a}}};l?this.ZR.HO(l,h.Y$,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.H$).then((()=>{this.$i||(h.w$=!1,u())})).catch((t=>{this.$i||(h.w$=!1,wt.console.warn("LightningChart JS mouse picking failed unexpectedly. This could mean that user interactions on charts are compromised.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact"))})):(this.ZR.$O(h.Y$,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.H$),h.w$=!1,u())}Mn(t){const e=this.ZR.lV();if("use-window"===this.P$.mode){const t=wt.devicePixelRatio||1;this.ZR.FO(t)}const i=this.Z.x,s=this.Z.y,r=t||{x:this.Zr.offsetWidth,y:this.Zr.offsetHeight},n=this.ZR.lV();if(0!==r.x&&0!==r.y&&(r.x!==i||r.y!==s||e!==n)){this.Z=r,this.At.x.q(0,r.x).it(r.x),this.At.y.q(0,r.y).it(r.y);const t=r.x*n,e=r.y*n,i=this.ZR.gl;this.hn.Az&&this.ez&&(this.ez.canvas.width=t,this.ez.canvas.height=e);const s=this.hn.pz;if(this.sz&&(i.bindTexture(i.TEXTURE_2D,this.sz),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null)),s){const s=this.ZR.gl2.ctx;this.A$&&(i.bindRenderbuffer(i.RENDERBUFFER,this.A$),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.p$,s.RGBA8,t,e)),this.g$&&(i.bindRenderbuffer(i.RENDERBUFFER,this.g$),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_COMPONENT16,t,e),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.p$,s.DEPTH_COMPONENT16,t,e))}i.bindRenderbuffer(i.RENDERBUFFER,null),this.R.emit("resize",[this.Z.x,this.Z.y])}}Y(){var t;this.$i||(super.Y(),this.k$&&(wt.clearTimeout(this.k$),this.k$=void 0),Array.from(this.ZR.zE.entries()).forEach((([t,e])=>{e.KR(!1),this.ZR.zE.delete(t)})),Array.from(this.ZR.WV.values()).forEach((t=>{t.unbindResources()})),this.ZR.WV.clear(),this.ZR.GV.Yz(),this.ZR.wO.Y(),this.ZR.LV(this.ZR.CO),this.ZR.LV(this.ZR.kO),this.ZR.xO.forEach(((t,e)=>{this.ZR.gl.deleteBuffer(e)})),this.ZR.xO.clear(),this.ZR.NO&&(this.ZR.LV(this.ZR.NO.buffer),this.ZR.NO=void 0),this.ZR.NV(this.az[0]),this.ZR.NV(this.az[1]),this.ZR.OV(this.A$),this.ZR.qR(this.sz),this.ZR.OV(this.g$),this.x$&&(this.x$.b$.forEach((t=>{this.ZR.OV(t.g$),this.ZR.NV(t.Y$),this.ZR.qR(t.jO)})),this.x$=void 0),this.ZR.mO.forEach((t=>this.ZR.LV(t))),this.v$.clear(),this.hn.Dz(this),this.D$&&(null===(t=this.D$.parentElement)||void 0===t||t.removeChild(this.D$),this.D$=void 0),this.ez&&(this.ez=void 0),this.ZR.gl=void 0)}}var up="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},cp={exports:{}};!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function s(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this.sV(t||0,e||10,i||"be"))}var n;"object"==typeof cp?cp.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=(void 0).Buffer}catch(t){}function o(t,e,s){for(var r=0,n=Math.min(t.length,s),o=0,h=e;h=49&&l<=54?l-49+10:l>=17&&l<=22?l-17+10:l,o|=a}return i(!(240&o),"Invalid character in "+t),r}function h(t,e,s,r){for(var n=0,o=0,h=Math.min(t.length,s),a=e;a=49?l-49+10:l>=17?l-17+10:l,i(l>=0&&o0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype.sV=function(t,e,s){if("number"==typeof t)return this.$$(t,e,s);if("object"==typeof t)return this.X$(t,e,s);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this.j$(t,r):this.Z$(t,e,r),"-"===t[0]&&(this.negative=1),this.Q$(),"le"===s&&this.X$(this.toArray(),e,s)},r.prototype.$$=function(t,e,s){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===s&&this.X$(this.toArray(),e,s)},r.prototype.X$=function(t,e,s){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<>>26-h&67108863,(h+=24)>=26&&(h-=26,n++);else if("le"===s)for(r=0,n=0;r>>26-h&67108863,(h+=24)>=26&&(h-=26,n++);return this.Q$()},r.prototype.j$=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=6)r=o(t,i,i+6),this.words[s]|=r<>>26-n&4194303,(n+=24)>=26&&(n-=26,s++);i+6!==e&&(r=o(t,e,i+6),this.words[s]|=r<>>26-n&4194303),this.Q$()},r.prototype.Z$=function(t,e,i){this.words=[0],this.length=1;for(var s=0,r=1;r<=67108863;r*=e)s++;s--,r=r/e|0;for(var n=t.length-i,o=n%s,a=Math.min(n,n-o)+i,l=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this.tX()},r.prototype.tX=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){r.prototype.inspect=l}else r.prototype.inspect=l;function l(){return(this.red?""}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,i){i.negative=e.negative^t.negative;var s=t.length+e.length|0;i.length=s,s=s-1|0;var r=0|t.words[0],n=0|e.words[0],o=r*n,h=67108863&o,a=o/67108864|0;i.words[0]=h;for(var l=1;l>>26,c=67108863&a,d=Math.min(l,e.length-1),f=Math.max(0,l-t.length+1);f<=d;f++){var g=l-f|0;u+=(o=(r=0|t.words[g])*(n=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[l]=0|c,a=0|u}return 0!==a?i.words[l]=0|a:i.length--,i.Q$()}r.prototype.toString=function(t,e){var s;if(e=0|e||1,16===(t=t||10)||"hex"===t){s="";for(var r=0,n=0,o=0;o>>24-r&16777215)||o!==this.length-1?u[6-a.length]+a+s:a+s,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(s=n.toString(16)+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],f=d[t];s="";var g=this.clone();for(g.negative=0;!g.isZero();){var y=g.modrn(f).toString(t);s=(g=g.idivn(f)).isZero()?y+s:u[l-y.length]+y+s}for(this.isZero()&&(s="0"+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}i(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16,2)},n&&(r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)}),r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,s){this.Q$();var r=this.byteLength(),n=s||Math.max(1,r);i(r<=n,"byte array longer than desired length"),i(n>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,n);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,r),o},r.prototype.iX=function(t,e){for(var i=0,s=0,r=0,n=0;r>8&255),i>16&255),6===n?(i>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i=0&&(t[i--]=o>>8&255),i>=0&&(t[i--]=o>>16&255),6===n?(i>=0&&(t[i--]=o>>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i>=0)for(t[i--]=s;i>=0;)t[i--]=0},Math.clz32?r.prototype.eX=function(t){return 32-Math.clz32(t)}:r.prototype.eX=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype.hX=function(t){if(0===t)return 26;var e=t,i=0;return!(8191&e)&&(i+=13,e>>>=13),!(127&e)&&(i+=7,e>>>=7),!(15&e)&&(i+=4,e>>>=4),!(3&e)&&(i+=2,e>>>=2),!(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this.eX(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var s=0;st.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),s=t%26;this.q$(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.Q$()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var s=t/26|0,r=t%26;return this.q$(s+1),this.words[s]=e?this.words[s]|1<t.length?(i=this,s=t):(i=t,s=this);for(var r=0,n=0;n>>26;for(;0!==r&&n>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;nt.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e.tX()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.tX();var i,s,r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,s=t):(i=t,s=this);for(var n=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==n&&o>26,this.words[o]=67108863&e;if(0===n&&o>>13,f=0|o[1],g=8191&f,y=f>>>13,m=0|o[2],p=8191&m,x=m>>>13,A=0|o[3],S=8191&A,v=A>>>13,b=0|o[4],M=8191&b,w=b>>>13,C=0|o[5],T=8191&C,R=C>>>13,E=0|o[6],k=8191&E,I=E>>>13,F=0|o[7],D=8191&F,P=F>>>13,L=0|o[8],V=8191&L,_=L>>>13,B=0|o[9],z=8191&B,N=B>>>13,O=0|h[0],U=8191&O,Y=O>>>13,G=0|h[1],X=8191&G,Z=G>>>13,H=0|h[2],W=8191&H,j=H>>>13,K=0|h[3],$=8191&K,Q=K>>>13,q=0|h[4],J=8191&q,tt=q>>>13,et=0|h[5],it=8191&et,st=et>>>13,rt=0|h[6],nt=8191&rt,ot=rt>>>13,ht=0|h[7],at=8191&ht,lt=ht>>>13,ut=0|h[8],ct=8191&ut,dt=ut>>>13,ft=0|h[9],gt=8191&ft,yt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var mt=(l+(s=Math.imul(c,U))|0)+((8191&(r=(r=Math.imul(c,Y))+Math.imul(d,U)|0))<<13)|0;l=((n=Math.imul(d,Y))+(r>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(g,U),r=(r=Math.imul(g,Y))+Math.imul(y,U)|0,n=Math.imul(y,Y);var pt=(l+(s=s+Math.imul(c,X)|0)|0)+((8191&(r=(r=r+Math.imul(c,Z)|0)+Math.imul(d,X)|0))<<13)|0;l=((n=n+Math.imul(d,Z)|0)+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(p,U),r=(r=Math.imul(p,Y))+Math.imul(x,U)|0,n=Math.imul(x,Y),s=s+Math.imul(g,X)|0,r=(r=r+Math.imul(g,Z)|0)+Math.imul(y,X)|0,n=n+Math.imul(y,Z)|0;var xt=(l+(s=s+Math.imul(c,W)|0)|0)+((8191&(r=(r=r+Math.imul(c,j)|0)+Math.imul(d,W)|0))<<13)|0;l=((n=n+Math.imul(d,j)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(S,U),r=(r=Math.imul(S,Y))+Math.imul(v,U)|0,n=Math.imul(v,Y),s=s+Math.imul(p,X)|0,r=(r=r+Math.imul(p,Z)|0)+Math.imul(x,X)|0,n=n+Math.imul(x,Z)|0,s=s+Math.imul(g,W)|0,r=(r=r+Math.imul(g,j)|0)+Math.imul(y,W)|0,n=n+Math.imul(y,j)|0;var At=(l+(s=s+Math.imul(c,$)|0)|0)+((8191&(r=(r=r+Math.imul(c,Q)|0)+Math.imul(d,$)|0))<<13)|0;l=((n=n+Math.imul(d,Q)|0)+(r>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(M,U),r=(r=Math.imul(M,Y))+Math.imul(w,U)|0,n=Math.imul(w,Y),s=s+Math.imul(S,X)|0,r=(r=r+Math.imul(S,Z)|0)+Math.imul(v,X)|0,n=n+Math.imul(v,Z)|0,s=s+Math.imul(p,W)|0,r=(r=r+Math.imul(p,j)|0)+Math.imul(x,W)|0,n=n+Math.imul(x,j)|0,s=s+Math.imul(g,$)|0,r=(r=r+Math.imul(g,Q)|0)+Math.imul(y,$)|0,n=n+Math.imul(y,Q)|0;var St=(l+(s=s+Math.imul(c,J)|0)|0)+((8191&(r=(r=r+Math.imul(c,tt)|0)+Math.imul(d,J)|0))<<13)|0;l=((n=n+Math.imul(d,tt)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(T,U),r=(r=Math.imul(T,Y))+Math.imul(R,U)|0,n=Math.imul(R,Y),s=s+Math.imul(M,X)|0,r=(r=r+Math.imul(M,Z)|0)+Math.imul(w,X)|0,n=n+Math.imul(w,Z)|0,s=s+Math.imul(S,W)|0,r=(r=r+Math.imul(S,j)|0)+Math.imul(v,W)|0,n=n+Math.imul(v,j)|0,s=s+Math.imul(p,$)|0,r=(r=r+Math.imul(p,Q)|0)+Math.imul(x,$)|0,n=n+Math.imul(x,Q)|0,s=s+Math.imul(g,J)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(y,J)|0,n=n+Math.imul(y,tt)|0;var vt=(l+(s=s+Math.imul(c,it)|0)|0)+((8191&(r=(r=r+Math.imul(c,st)|0)+Math.imul(d,it)|0))<<13)|0;l=((n=n+Math.imul(d,st)|0)+(r>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(k,U),r=(r=Math.imul(k,Y))+Math.imul(I,U)|0,n=Math.imul(I,Y),s=s+Math.imul(T,X)|0,r=(r=r+Math.imul(T,Z)|0)+Math.imul(R,X)|0,n=n+Math.imul(R,Z)|0,s=s+Math.imul(M,W)|0,r=(r=r+Math.imul(M,j)|0)+Math.imul(w,W)|0,n=n+Math.imul(w,j)|0,s=s+Math.imul(S,$)|0,r=(r=r+Math.imul(S,Q)|0)+Math.imul(v,$)|0,n=n+Math.imul(v,Q)|0,s=s+Math.imul(p,J)|0,r=(r=r+Math.imul(p,tt)|0)+Math.imul(x,J)|0,n=n+Math.imul(x,tt)|0,s=s+Math.imul(g,it)|0,r=(r=r+Math.imul(g,st)|0)+Math.imul(y,it)|0,n=n+Math.imul(y,st)|0;var bt=(l+(s=s+Math.imul(c,nt)|0)|0)+((8191&(r=(r=r+Math.imul(c,ot)|0)+Math.imul(d,nt)|0))<<13)|0;l=((n=n+Math.imul(d,ot)|0)+(r>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(D,U),r=(r=Math.imul(D,Y))+Math.imul(P,U)|0,n=Math.imul(P,Y),s=s+Math.imul(k,X)|0,r=(r=r+Math.imul(k,Z)|0)+Math.imul(I,X)|0,n=n+Math.imul(I,Z)|0,s=s+Math.imul(T,W)|0,r=(r=r+Math.imul(T,j)|0)+Math.imul(R,W)|0,n=n+Math.imul(R,j)|0,s=s+Math.imul(M,$)|0,r=(r=r+Math.imul(M,Q)|0)+Math.imul(w,$)|0,n=n+Math.imul(w,Q)|0,s=s+Math.imul(S,J)|0,r=(r=r+Math.imul(S,tt)|0)+Math.imul(v,J)|0,n=n+Math.imul(v,tt)|0,s=s+Math.imul(p,it)|0,r=(r=r+Math.imul(p,st)|0)+Math.imul(x,it)|0,n=n+Math.imul(x,st)|0,s=s+Math.imul(g,nt)|0,r=(r=r+Math.imul(g,ot)|0)+Math.imul(y,nt)|0,n=n+Math.imul(y,ot)|0;var Mt=(l+(s=s+Math.imul(c,at)|0)|0)+((8191&(r=(r=r+Math.imul(c,lt)|0)+Math.imul(d,at)|0))<<13)|0;l=((n=n+Math.imul(d,lt)|0)+(r>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(V,U),r=(r=Math.imul(V,Y))+Math.imul(_,U)|0,n=Math.imul(_,Y),s=s+Math.imul(D,X)|0,r=(r=r+Math.imul(D,Z)|0)+Math.imul(P,X)|0,n=n+Math.imul(P,Z)|0,s=s+Math.imul(k,W)|0,r=(r=r+Math.imul(k,j)|0)+Math.imul(I,W)|0,n=n+Math.imul(I,j)|0,s=s+Math.imul(T,$)|0,r=(r=r+Math.imul(T,Q)|0)+Math.imul(R,$)|0,n=n+Math.imul(R,Q)|0,s=s+Math.imul(M,J)|0,r=(r=r+Math.imul(M,tt)|0)+Math.imul(w,J)|0,n=n+Math.imul(w,tt)|0,s=s+Math.imul(S,it)|0,r=(r=r+Math.imul(S,st)|0)+Math.imul(v,it)|0,n=n+Math.imul(v,st)|0,s=s+Math.imul(p,nt)|0,r=(r=r+Math.imul(p,ot)|0)+Math.imul(x,nt)|0,n=n+Math.imul(x,ot)|0,s=s+Math.imul(g,at)|0,r=(r=r+Math.imul(g,lt)|0)+Math.imul(y,at)|0,n=n+Math.imul(y,lt)|0;var wt=(l+(s=s+Math.imul(c,ct)|0)|0)+((8191&(r=(r=r+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;l=((n=n+Math.imul(d,dt)|0)+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(z,U),r=(r=Math.imul(z,Y))+Math.imul(N,U)|0,n=Math.imul(N,Y),s=s+Math.imul(V,X)|0,r=(r=r+Math.imul(V,Z)|0)+Math.imul(_,X)|0,n=n+Math.imul(_,Z)|0,s=s+Math.imul(D,W)|0,r=(r=r+Math.imul(D,j)|0)+Math.imul(P,W)|0,n=n+Math.imul(P,j)|0,s=s+Math.imul(k,$)|0,r=(r=r+Math.imul(k,Q)|0)+Math.imul(I,$)|0,n=n+Math.imul(I,Q)|0,s=s+Math.imul(T,J)|0,r=(r=r+Math.imul(T,tt)|0)+Math.imul(R,J)|0,n=n+Math.imul(R,tt)|0,s=s+Math.imul(M,it)|0,r=(r=r+Math.imul(M,st)|0)+Math.imul(w,it)|0,n=n+Math.imul(w,st)|0,s=s+Math.imul(S,nt)|0,r=(r=r+Math.imul(S,ot)|0)+Math.imul(v,nt)|0,n=n+Math.imul(v,ot)|0,s=s+Math.imul(p,at)|0,r=(r=r+Math.imul(p,lt)|0)+Math.imul(x,at)|0,n=n+Math.imul(x,lt)|0,s=s+Math.imul(g,ct)|0,r=(r=r+Math.imul(g,dt)|0)+Math.imul(y,ct)|0,n=n+Math.imul(y,dt)|0;var Ct=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(r=(r=r+Math.imul(c,yt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((n=n+Math.imul(d,yt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(z,X),r=(r=Math.imul(z,Z))+Math.imul(N,X)|0,n=Math.imul(N,Z),s=s+Math.imul(V,W)|0,r=(r=r+Math.imul(V,j)|0)+Math.imul(_,W)|0,n=n+Math.imul(_,j)|0,s=s+Math.imul(D,$)|0,r=(r=r+Math.imul(D,Q)|0)+Math.imul(P,$)|0,n=n+Math.imul(P,Q)|0,s=s+Math.imul(k,J)|0,r=(r=r+Math.imul(k,tt)|0)+Math.imul(I,J)|0,n=n+Math.imul(I,tt)|0,s=s+Math.imul(T,it)|0,r=(r=r+Math.imul(T,st)|0)+Math.imul(R,it)|0,n=n+Math.imul(R,st)|0,s=s+Math.imul(M,nt)|0,r=(r=r+Math.imul(M,ot)|0)+Math.imul(w,nt)|0,n=n+Math.imul(w,ot)|0,s=s+Math.imul(S,at)|0,r=(r=r+Math.imul(S,lt)|0)+Math.imul(v,at)|0,n=n+Math.imul(v,lt)|0,s=s+Math.imul(p,ct)|0,r=(r=r+Math.imul(p,dt)|0)+Math.imul(x,ct)|0,n=n+Math.imul(x,dt)|0;var Tt=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(r=(r=r+Math.imul(g,yt)|0)+Math.imul(y,gt)|0))<<13)|0;l=((n=n+Math.imul(y,yt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(z,W),r=(r=Math.imul(z,j))+Math.imul(N,W)|0,n=Math.imul(N,j),s=s+Math.imul(V,$)|0,r=(r=r+Math.imul(V,Q)|0)+Math.imul(_,$)|0,n=n+Math.imul(_,Q)|0,s=s+Math.imul(D,J)|0,r=(r=r+Math.imul(D,tt)|0)+Math.imul(P,J)|0,n=n+Math.imul(P,tt)|0,s=s+Math.imul(k,it)|0,r=(r=r+Math.imul(k,st)|0)+Math.imul(I,it)|0,n=n+Math.imul(I,st)|0,s=s+Math.imul(T,nt)|0,r=(r=r+Math.imul(T,ot)|0)+Math.imul(R,nt)|0,n=n+Math.imul(R,ot)|0,s=s+Math.imul(M,at)|0,r=(r=r+Math.imul(M,lt)|0)+Math.imul(w,at)|0,n=n+Math.imul(w,lt)|0,s=s+Math.imul(S,ct)|0,r=(r=r+Math.imul(S,dt)|0)+Math.imul(v,ct)|0,n=n+Math.imul(v,dt)|0;var Rt=(l+(s=s+Math.imul(p,gt)|0)|0)+((8191&(r=(r=r+Math.imul(p,yt)|0)+Math.imul(x,gt)|0))<<13)|0;l=((n=n+Math.imul(x,yt)|0)+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,s=Math.imul(z,$),r=(r=Math.imul(z,Q))+Math.imul(N,$)|0,n=Math.imul(N,Q),s=s+Math.imul(V,J)|0,r=(r=r+Math.imul(V,tt)|0)+Math.imul(_,J)|0,n=n+Math.imul(_,tt)|0,s=s+Math.imul(D,it)|0,r=(r=r+Math.imul(D,st)|0)+Math.imul(P,it)|0,n=n+Math.imul(P,st)|0,s=s+Math.imul(k,nt)|0,r=(r=r+Math.imul(k,ot)|0)+Math.imul(I,nt)|0,n=n+Math.imul(I,ot)|0,s=s+Math.imul(T,at)|0,r=(r=r+Math.imul(T,lt)|0)+Math.imul(R,at)|0,n=n+Math.imul(R,lt)|0,s=s+Math.imul(M,ct)|0,r=(r=r+Math.imul(M,dt)|0)+Math.imul(w,ct)|0,n=n+Math.imul(w,dt)|0;var Et=(l+(s=s+Math.imul(S,gt)|0)|0)+((8191&(r=(r=r+Math.imul(S,yt)|0)+Math.imul(v,gt)|0))<<13)|0;l=((n=n+Math.imul(v,yt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,J),r=(r=Math.imul(z,tt))+Math.imul(N,J)|0,n=Math.imul(N,tt),s=s+Math.imul(V,it)|0,r=(r=r+Math.imul(V,st)|0)+Math.imul(_,it)|0,n=n+Math.imul(_,st)|0,s=s+Math.imul(D,nt)|0,r=(r=r+Math.imul(D,ot)|0)+Math.imul(P,nt)|0,n=n+Math.imul(P,ot)|0,s=s+Math.imul(k,at)|0,r=(r=r+Math.imul(k,lt)|0)+Math.imul(I,at)|0,n=n+Math.imul(I,lt)|0,s=s+Math.imul(T,ct)|0,r=(r=r+Math.imul(T,dt)|0)+Math.imul(R,ct)|0,n=n+Math.imul(R,dt)|0;var kt=(l+(s=s+Math.imul(M,gt)|0)|0)+((8191&(r=(r=r+Math.imul(M,yt)|0)+Math.imul(w,gt)|0))<<13)|0;l=((n=n+Math.imul(w,yt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(z,it),r=(r=Math.imul(z,st))+Math.imul(N,it)|0,n=Math.imul(N,st),s=s+Math.imul(V,nt)|0,r=(r=r+Math.imul(V,ot)|0)+Math.imul(_,nt)|0,n=n+Math.imul(_,ot)|0,s=s+Math.imul(D,at)|0,r=(r=r+Math.imul(D,lt)|0)+Math.imul(P,at)|0,n=n+Math.imul(P,lt)|0,s=s+Math.imul(k,ct)|0,r=(r=r+Math.imul(k,dt)|0)+Math.imul(I,ct)|0,n=n+Math.imul(I,dt)|0;var It=(l+(s=s+Math.imul(T,gt)|0)|0)+((8191&(r=(r=r+Math.imul(T,yt)|0)+Math.imul(R,gt)|0))<<13)|0;l=((n=n+Math.imul(R,yt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(z,nt),r=(r=Math.imul(z,ot))+Math.imul(N,nt)|0,n=Math.imul(N,ot),s=s+Math.imul(V,at)|0,r=(r=r+Math.imul(V,lt)|0)+Math.imul(_,at)|0,n=n+Math.imul(_,lt)|0,s=s+Math.imul(D,ct)|0,r=(r=r+Math.imul(D,dt)|0)+Math.imul(P,ct)|0,n=n+Math.imul(P,dt)|0;var Ft=(l+(s=s+Math.imul(k,gt)|0)|0)+((8191&(r=(r=r+Math.imul(k,yt)|0)+Math.imul(I,gt)|0))<<13)|0;l=((n=n+Math.imul(I,yt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(z,at),r=(r=Math.imul(z,lt))+Math.imul(N,at)|0,n=Math.imul(N,lt),s=s+Math.imul(V,ct)|0,r=(r=r+Math.imul(V,dt)|0)+Math.imul(_,ct)|0,n=n+Math.imul(_,dt)|0;var Dt=(l+(s=s+Math.imul(D,gt)|0)|0)+((8191&(r=(r=r+Math.imul(D,yt)|0)+Math.imul(P,gt)|0))<<13)|0;l=((n=n+Math.imul(P,yt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,s=Math.imul(z,ct),r=(r=Math.imul(z,dt))+Math.imul(N,ct)|0,n=Math.imul(N,dt);var Pt=(l+(s=s+Math.imul(V,gt)|0)|0)+((8191&(r=(r=r+Math.imul(V,yt)|0)+Math.imul(_,gt)|0))<<13)|0;l=((n=n+Math.imul(_,yt)|0)+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(l+(s=Math.imul(z,gt))|0)+((8191&(r=(r=Math.imul(z,yt))+Math.imul(N,gt)|0))<<13)|0;return l=((n=Math.imul(N,yt))+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,a[0]=mt,a[1]=pt,a[2]=xt,a[3]=At,a[4]=St,a[5]=vt,a[6]=bt,a[7]=Mt,a[8]=wt,a[9]=Ct,a[10]=Tt,a[11]=Rt,a[12]=Et,a[13]=kt,a[14]=It,a[15]=Ft,a[16]=Dt,a[17]=Pt,a[18]=Lt,0!==l&&(a[19]=l,i.length++),i};function y(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var s=0,r=0,n=0;n>>26)|0)>>>26,o&=67108863}i.words[n]=h,s=o,o=r}return 0!==s?i.words[n]=s:i.length--,i.Q$()}function m(t,e,i){return y(t,e,i)}Math.imul||(g=f),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):i<63?f(this,t,e):i<1024?y(this,t,e):m(this,t,e)},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),m(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){var e=t<0;e&&(t=-t),i("number"==typeof t),i(t<67108864);for(var s=0,r=0;r>=26,s+=n/67108864|0,s+=o>>>26,this.words[r]=67108863&o}return 0!==s&&(this.words[r]=s,this.length++),e?this.ineg():this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>r&1}return e}(t);if(0===e.length)return new r(1);for(var i=this,s=0;s=0);var e,s=t%26,r=(t-s)/26,n=67108863>>>26-s<<26-s;if(0!==s){var o=0;for(e=0;e>>26-s}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e=0),r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),h=67108863^67108863>>>n<o)for(this.length-=o,l=0;l=0&&(0!==u||l>=r);l--){var c=0|this.words[l];this.words[l]=u<<26-n|c>>>n,u=c&h}return a&&0!==u&&(a.words[a.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.Q$()},r.prototype.ishrn=function(t,e,s){return i(0===this.negative),this.iushrn(t,e,s)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,s=(t-e)/26,r=1<=0);var e=t%26,s=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==e&&s++,this.length=Math.min(s,this.length),0!==e){var r=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(a/67108864|0),this.words[r+s]=67108863&n}for(;r>26,this.words[r+s]=67108863&n;if(0===h)return this.Q$();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.Q$()},r.prototype.nX=function(t,e){var i=(this.length,t.length),s=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this.eX(o))&&(n=n.ushln(i),s.iushln(i),o=0|n.words[n.length-1]);var h,a=s.length-n.length;if("mod"!==e){(h=new r(null)).length=a+1,h.words=new Array(h.length);for(var l=0;l=0;c--){var d=67108864*(0|s.words[n.length+c])+(0|s.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),s.rX(n,d,c);0!==s.negative;)d--,s.negative=0,s.rX(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.Q$(),s.Q$(),"div"!==e&&0!==i&&s.iushrn(i),{div:h||null,mod:s}},r.prototype.divmod=function(t,e,s){return i(!t.isZero()),this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,e),"mod"!==e&&(n=h.div.neg()),"div"!==e&&(o=h.mod.neg(),s&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),e),"mod"!==e&&(n=h.div.neg()),{div:n,mod:h.mod}):this.negative&t.negative?(h=this.neg().divmod(t.neg(),e),"div"!==e&&(o=h.mod.neg(),s&&0!==o.negative&&o.isub(t)),{div:h.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modrn(t.words[0]))}:this.nX(t,e);var n,o,h},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,s=t.ushrn(1),r=t.andln(1),n=i.cmp(s);return n<0||1===r&&0===n?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(s*r+(0|this.words[n]))%t;return e?-r:r},r.prototype.modn=function(t){return this.modrn(t)},r.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*s;this.words[r]=n/t|0,s=n%t}return this.Q$(),e?this.ineg():this},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,s=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),h=new r(0),a=new r(1),l=0;e.isEven()&&s.isEven();)e.iushrn(1),s.iushrn(1),++l;for(var u=s.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;!(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var g=0,y=1;!(s.words[0]&y)&&g<26;++g,y<<=1);if(g>0)for(s.iushrn(g);g-- >0;)(h.isOdd()||a.isOdd())&&(h.iadd(u),a.isub(c)),h.iushrn(1),a.iushrn(1);e.cmp(s)>=0?(e.isub(s),n.isub(h),o.isub(a)):(s.isub(e),h.isub(n),a.isub(o))}return{a:h,b:a,gcd:s.iushln(l)}},r.prototype.oX=function(t){i(0===t.negative),i(!t.isZero());var e=this,s=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),h=new r(0),a=s.clone();e.cmpn(1)>0&&s.cmpn(1)>0;){for(var l=0,u=1;!(e.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,d=1;!(s.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(s.iushrn(c);c-- >0;)h.isOdd()&&h.iadd(a),h.iushrn(1);e.cmp(s)>=0?(e.isub(s),o.isub(h)):(s.isub(e),h.isub(o))}return(n=0===e.cmpn(1)?o:h).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var s=0;e.isEven()&&i.isEven();s++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var r=e.cmp(i);if(r<0){var n=e;e=i,i=n}else if(0===r||0===i.cmpn(1))break;e.isub(i)}return i.iushln(s)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return!(1&this.words[0])},r.prototype.isOdd=function(){return!(1&~this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,s=(t-e)/26,r=1<>>26,h&=67108863,this.words[o]=h}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,s=t<0;if(0!==this.negative&&!s)return-1;if(0===this.negative&&s)return 1;if(this.Q$(),this.length>1)e=1;else{s&&(t=-t),i(t<=67108863,"Number is too big");var r=0|this.words[0];e=r===t?0:rt.length)return 1;if(this.length=0;i--){var s=0|this.words[i],r=0|t.words[i];if(s!==r){sr&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new M(t)},r.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this).aX(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.aX=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.aX(t)},r.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},r.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},r.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},r.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},r.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},r.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.lX(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.lX(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.uX(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.uX(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.uX(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.uX(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.uX(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.uX(this),this.red.pow(this,t)};var p={k256:null,p224:null,p192:null,p25519:null};function x(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this.cX()}function A(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=r.dX(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function w(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r.oX(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype.cX=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},x.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var s=e0?i.isub(this.p):void 0!==i.strip?i.strip():i.Q$(),i},x.prototype.split=function(t,e){t.iushrn(this.n,0,e)},x.prototype.imulK=function(t){return t.imul(this.k)},s(A,x),A.prototype.split=function(t,e){for(var i=4194303,s=Math.min(t.length,9),r=0;r>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=r,e=s}return 0!==e&&(t.words[t.length++]=e),t},r.dX=function(t){if(p[t])return p[t];var e;if("k256"===t)e=new A;else if("p224"===t)e=new S;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new b}return p[t]=e,e},M.prototype.uX=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype.lX=function(t,e){i(!(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t).aX(this):(a(t,t.umod(this.m).aX(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).aX(this)},M.prototype.add=function(t,e){this.lX(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.aX(this)},M.prototype.iadd=function(t,e){this.lX(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function(t,e){this.lX(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.aX(this)},M.prototype.isub=function(t,e){this.lX(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function(t,e){return this.uX(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this.lX(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this.lX(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var s=this.m.add(new r(1)).iushrn(2);return this.pow(t,s)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var h=new r(1).toRed(this),a=h.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new r(2*u*u).toRed(this);0!==this.pow(u,l).cmp(a);)u.redIAdd(a);for(var c=this.pow(u,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),g=o;0!==f.cmp(h);){for(var y=f,m=0;0!==y.cmp(h);m++)y=y.redSqr();i(m=0;s--){for(var l=e.words[s],u=a-1;u>=0;u--){var c=l>>u&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++h||0===s&&0===u)&&(n=this.mul(n,i[o]),h=0,o=0)):h=0}a=26}return n},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new w(t)},s(w,M),w.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},w.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},w.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(s).iushrn(this.shift),n=r;return r.cmp(this.m)>=0?n=r.isub(this.m):r.cmpn(0)<0&&(n=r.iadd(this.m)),n.aX(this)},w.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).aX(this);var i=t.mul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(s).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o.aX(this)},w.prototype.invm=function(t){return this.imod(t.oX(this.m).mul(this.r2)).aX(this)}}(0,up);var dp=cp.exports;function fp(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];const i=[];if("string"!=typeof t){for(let e=0;e>8,n=255&s;r?i.push(r,n):i.push(n)}return i}const gp=function(t,e,i){const s=new Array(Math.max(t.bitLength(),i)+1);s.fill(0);const r=1<(r>>1)-1?(r>>1)-i:i,n.isubn(e)):e=0,s[t]=e,n.iushrn(1)}return s},yp=function(t,e){const i=[[],[]];t=t.clone(),e=e.clone();let s=0,r=0;for(;t.cmpn(-s)>0||e.cmpn(-r)>0;){let n,o,h=t.andln(3)+s&3,a=e.andln(3)+r&3;if(3===h&&(h=-1),3===a&&(a=-1),1&h){const e=t.andln(7)+s&7;n=3!==e&&5!==e||2!==a?h:-h}else n=0;if(i[0].push(n),1&a){const t=e.andln(7)+r&7;o=3!==t&&5!==t||2!==h?a:-a}else o=0;i[1].push(o),2*s===n+1&&(s=1-s),2*r===o+1&&(r=1-r),t.iushrn(1),e.iushrn(1)}return i};class mp{constructor(t,e){this.type=t,this.p=new dp(e.p,16),this.red=e.prime?dp.red(e.prime):dp.mont(this.p),this.zero=new dp(0).toRed(this.red),this.one=new dp(1).toRed(this.red),this.two=new dp(2).toRed(this.red),this.n=e.n&&new dp(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.fX=new Array(4),this.AX=new Array(4),this.gX=new Array(4),this.pX=new Array(4),this.yX=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.mX=!0,this.redN=this.n.toRed(this.red))}vX(t,e){const i=t.SX(),s=gp(e,1,this.yX);let r=(1<=t;r--)e=(e<<1)+s[r];n.push(e)}let o=this.jpoint(null,null,null),h=this.jpoint(null,null,null);for(let t=r;t>0;t--){for(let e=0;e=0;i--){for(let t=0;i>=0&&0===n[i];i--)t++;if(i>=0&&e++,o=o.dblp(e),i<0)break;const s=n[i];o="affine"===t.type?s>0?o.mixedAdd(r[s-1>>1]):o.mixedAdd(r[-s-1>>1].neg()):s>0?o.add(r[s-1>>1]):o.add(r[-s-1>>1].neg())}return"affine"===t.type?o.toP():o}MX(t,e,i,s,r){const n=this.fX,o=this.AX,h=this.gX;let a=0;for(let i=0;i=1;t-=2){const s=t-1,r=t;if(1!==n[s]||1!==n[r]){h[s]=gp(i[s],n[s],this.yX),h[r]=gp(i[r],n[r],this.yX),a=Math.max(h[s].length,a),a=Math.max(h[r].length,a);continue}const l=[e[s],null,null,e[r]];0===e[s].y.cmp(e[r].y)?(l[1]=e[s].add(e[r]),l[2]=e[s].toJ().mixedAdd(e[r].neg())):0===e[s].y.cmp(e[r].y.redNeg())?(l[1]=e[s].toJ().mixedAdd(e[r]),l[2]=e[s].add(e[r].neg())):(l[1]=e[s].toJ().mixedAdd(e[r]),l[2]=e[s].toJ().mixedAdd(e[r].neg()));const u=[-3,-1,-5,-7,0,7,5,1,3],c=yp(i[s],i[r]);a=Math.max(c[0].length,a),h[s]=new Array(a),h[r]=new Array(a);for(let t=0;t=0;t--){let e=0;for(;t>=0;){let i=!0;for(let e=0;e=0&&e++,l=l.dblp(e),t<0)break;for(let t=0;t0?i=o[t][e-1>>1]:e<0&&(i=o[t][-e-1>>1].neg()),l="affine"===i.type?l.mixedAdd(i):l.add(i))}}for(let t=0;t=Math.ceil((t.bitLength()+1)/e.step)}SX(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;const i=[this];let s=this;for(let r=0;r({a:new dp(t.a,16),b:new dp(t.b,16)}))):this.PX(i),{beta:e,lambda:i,basis:s}}IX(t){const e=t===this.p?this.red:dp.mont(t),i=new dp(2).toRed(e).redInvm(),s=i.redNeg(),r=new dp(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}PX(t){const e=this.n.ushrn(Math.floor(this.n.bitLength()/2));let i,s,r,n,o,h,a,l,u,c=t,d=this.n.clone(),f=new dp(1),g=new dp(0),y=new dp(0),m=new dp(1),p=0;for(;0!==c.cmpn(0);){const t=d.div(c);l=d.sub(t.mul(c)),u=y.sub(t.mul(f));const o=m.sub(t.mul(g));if(!r&&l.cmp(e)<0)i=a.neg(),s=f,r=l.neg(),n=u;else if(r&&2==++p)break;a=l,d=c,c=l,y=f,f=u,m=g,g=o}o=l.neg(),h=u;const x=r.sqr().add(n.sqr());return o.sqr().add(h.sqr()).cmp(x)>=0&&(o=i,h=s),r.negative&&(r=r.neg(),n=n.neg()),o.negative&&(o=o.neg(),h=h.neg()),[{a:r,b:n},{a:o,b:h}]}DX(t){const e=this.endo.basis,i=e[0],s=e[1],r=s.b.mul(t).divRound(this.n),n=i.b.neg().mul(t).divRound(this.n),o=r.mul(i.a),h=n.mul(s.a),a=r.mul(i.b),l=n.mul(s.b);return{k1:t.sub(o).sub(h),k2:a.add(l).neg()}}point(t,e,i){return new Ap(this,t,e,i)}pointFromX(t,e){(t=new dp(t,16)).red||(t=t.toRed(this.red));const i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b);let s=i.redSqrt();if(0!==s.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");const r=s.fromRed().isOdd();return(e&&!r||!e&&r)&&(s=s.redNeg()),this.point(t,s)}validate(t){if(t.inf)return!0;const e=t.x,i=t.y,s=this.a.redMul(e),r=e.redSqr().redMul(e).redIAdd(s).redIAdd(this.b);return 0===i.redSqr().redISub(r).cmpn(0)}BX(t,e,i){const s=this.TX,r=this.FX;let n=0;for(n=0;n":``}isInfinity(){return this.inf}add(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);let e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));const i=e.redSqr().redISub(this.x).redISub(t.x),s=e.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)}dbl(){if(this.inf)return this;const t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);const e=this.curve.a,i=this.x.redSqr(),s=t.redInvm(),r=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(s),n=r.redSqr().redISub(this.x.redAdd(this.x)),o=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,o)}getX(){return this.x.fromRed()}getY(){return this.y.fromRed()}mul(t){return t=new dp(t,16),this.isInfinity()?this:this.CX(t)?this.curve.vX(this,t):this.curve.endo?this.curve.BX([this],[t]):this.curve.xX(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.BX(s,r):this.curve.MX(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.BX(s,r,!0):this.curve.MX(1,s,r,2,!0)}eq(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))}neg(t){if(this.inf)return this;const e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){const t=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}toJ(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)}}class Sp extends pp{constructor(t,e,i,s){super(t,"jacobian"),null===e&&null===i&&null===s?(this.x=this.curve.one,this.y=this.curve.one,this.z=new dp(0)):(this.x=new dp(e,16),this.y=new dp(i,16),this.z=new dp(s,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}getY(){throw new Error("Method not implemented.")}getX(){throw new Error("Method not implemented.")}pointFromX(t,e){throw new Error("Method not implemented.")}point(t,e,i){throw new Error("Method not implemented.")}jpoint(t,e,i){return new Sp(this,t,e,i)}toP(){if(this.isInfinity())return this.curve.point(null,null);const t=this.z.redInvm(),e=t.redSqr(),i=this.x.redMul(e),s=this.y.redMul(e).redMul(t);return this.curve.point(i,s)}neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;const e=t.z.redSqr(),i=this.z.redSqr(),s=this.x.redMul(e),r=t.x.redMul(i),n=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(i.redMul(this.z)),h=s.redSub(r),a=n.redSub(o);if(0===h.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const l=h.redSqr(),u=l.redMul(h),c=s.redMul(l),d=a.redSqr().redIAdd(u).redISub(c).redISub(c),f=a.redMul(c.redISub(d)).redISub(n.redMul(u)),g=this.z.redMul(t.z).redMul(h);return this.curve.jpoint(d,f,g)}mixedAdd(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;const e=this.z.redSqr(),i=this.x,s=t.x.redMul(e),r=this.y,n=t.y.redMul(e).redMul(this.z),o=i.redSub(s),h=r.redSub(n);if(0===o.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const a=o.redSqr(),l=a.redMul(o),u=i.redMul(a),c=h.redSqr().redIAdd(l).redISub(u).redISub(u),d=h.redMul(u.redISub(c)).redISub(r.redMul(l)),f=this.z.redMul(o);return this.curve.jpoint(c,d,f)}dblp(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){let e=this;for(let i=0;i=0)return!1;if(i.redIAdd(r),0===this.x.cmp(i))return!0}}inspect(){return this.isInfinity()?"":``}isInfinity(){return 0===this.z.cmpn(0)}}class vp{constructor(t){this.curve=new xp(t),this.g=this.curve.g,this.n=this.curve.n}}const bp={};var Mp;bp.PresetCurve=vp,Mp={type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",{doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}]},Object.defineProperty(bp,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new vp(Mp);return Object.defineProperty(bp,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class wp{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.zX(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof wp?e:new wp(t,{pub:e,pubEnc:i})}validate(){const t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}}getPublic(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub}zX(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type||"short"===this.ec.curve.type||this.ec.curve.type,void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)}verify(t,e){return this.ec.verify(t,e,this)}}function Cp(t,e){const i=t[e.place++];if(!(128&i))return i;const s=15&i;if(0===s||s>4)return!1;let r=0,n=e.place;for(let e=0;e>>=0;return!(r<=127)&&(e.place=n,r)}class Tp{constructor(){this.place=0}}class Rp{constructor(t,e){if(t instanceof Rp)return t;this.VX(t,e)||(this.r=new dp(t.r,16),this.s=new dp(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}VX(t,e){t=fp(t,e);const i=new Tp;if(48!==t[i.place++])return!1;const s=Cp(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=Cp(t,i);if(!1===r)return!1;let n=t.slice(i.place,r+i.place);if(i.place+=r,2!==t[i.place++])return!1;const o=Cp(t,i);if(!1===o)return!1;if(t.length!==o+i.place)return!1;let h=t.slice(i.place,o+i.place);if(0===n[0]){if(!(128&n[1]))return!1;n=n.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new dp(n),this.s=new dp(h),this.recoveryParam=null,!0}}class Ep{constructor(t){if(!(this instanceof Ep))return new Ep(t);"string"==typeof t&&(t=bp[t]),t instanceof bp.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1)}keyFromPublic(t,e){return wp.fromPublic(this,t,e)}OX(t,e){const i=8*t.byteLength()-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t}verify(t,e,i,s){t=this.OX(new dp(t,16)),i=this.keyFromPublic(i,s);const r=(e=new Rp(e,"hex")).r,n=e.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;const o=n.invm(this.n),h=o.mul(t).umod(this.n),a=o.mul(r).umod(this.n);if(!this.curve.mX){const t=this.g.mulAdd(h,i.getPublic(),a);return!t.isInfinity()&&0===t.getX().umod(this.n).cmp(r)}const l=this.g.jmulAdd(h,i.getPublic(),a);return!l.isInfinity()&&l.eqXToP(r)}}var kp,Ip={exports:{}};Ip.exports=(kp=kp||function(t,e){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==up&&up.crypto&&(i=up.crypto),!i)try{i=e}catch(t){}var s=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function t(){}return function(e){var i;return t.prototype=e,i=new t,t.prototype=null,i}}(),n={},o=n.lib={},h=o.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=o.WordArray=h.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,i=t.words,s=this.sigBytes,r=t.sigBytes;if(this.clamp(),s%4)for(var n=0;n>>2]>>>24-n%4*8&255;e[s+n>>>2]|=o<<24-(s+n)%4*8}else for(var h=0;h>>2]=i[h>>>2];return this.sigBytes+=r,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4)},clone:function(){var t=h.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i>>2]>>>24-r%4*8&255;s.push((n>>>4).toString(16)),s.push((15&n).toString(16))}return s.join("")},parse:function(t){for(var e=t.length,i=[],s=0;s>>3]|=parseInt(t.substr(s,2),16)<<24-s%8*4;return new a.init(i,e/2)}},c=l.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,s=[],r=0;r>>2]>>>24-r%4*8&255;s.push(String.fromCharCode(n))}return s.join("")},parse:function(t){for(var e=t.length,i=[],s=0;s>>2]|=(255&t.charCodeAt(s))<<24-s%4*8;return new a.init(i,e)}},d=l.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},f=o.BufferedBlockAlgorithm=h.extend({reset:function(){this._w=new a.init,this.NX=0},GX:function(t){"string"==typeof t&&(t=d.parse(t)),this._w.concat(t),this.NX+=t.sigBytes},WX:function(e){var i,s=this._w,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this.UX,0))*o,u=t.min(4*l,n);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,m=l[f-2],p=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;l[f]=y+l[f-7]+p+l[f-16]}var x=s&r^s&n^r&n,A=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),S=d+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&u^~h&c)+a[f]+l[f];d=c,c=u,u=h,h=o+S|0,o=n,n=r,r=s,s=S+(A+x)|0}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+o|0,i[4]=i[4]+h|0,i[5]=i[5]+u|0,i[6]=i[6]+c|0,i[7]=i[7]+d|0},$X:function(){var t=this._w,i=t.words,s=8*this.NX,r=8*t.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=e.floor(s/4294967296),i[15+(r+64>>>9<<4)]=s,t.sigBytes=4*i.length,this.WX(),this.ZX},clone:function(){var t=n.clone.call(this);return t.ZX=this.ZX.clone(),t}});i.SHA256=n.XX(u),i.HmacSHA256=n.jX(u)}(Math),t.SHA256}(Ip.exports),Vp={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({HX:function(){this.ZX=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},$X:function(){var t=r.$X.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.XX(n),e.HmacSHA224=r.jX(n),t.SHA224;var e,i,s,r,n}(Ip.exports),_p={exports:{}}.exports=Ip.exports.enc.Hex,Bp={exports:{}}.exports=Ip.exports.enc.Utf8;!function(t){return i=(e=t).lib.WordArray,e.enc.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,s=this.QX;t.clamp();for(var r=[],n=0;n>>2]>>>24-n%4*8&255)<<16|(e[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|e[n+2>>>2]>>>24-(n+2)%4*8&255,h=0;h<4&&n+.75*h>>6*(3-h)&63));var a=s.charAt(64);if(a)for(;r.length%4;)r.push(a);return r.join("")},parse:function(t){var e=t.length,s=this.QX,r=this.JX;if(!r){r=this.JX=[];for(var n=0;n>>6-o%4*2;r[n>>>2]|=h<<24-n%4*8,n++}return i.create(r,n)}(t,e,r)},QX:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(Ip.exports),function(t){(function(e){var i=t,s=i.lib,r=s.WordArray,n=s.Hasher,o=i.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var a=o.MD5=n.extend({HX:function(){this.ZX=new r.init([1732584193,4023233417,2562383102,271733878])},YX:function(t,e){for(var i=0;i<16;i++){var s=e+i,r=t[s];t[s]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var n=this.ZX.words,o=t[e+0],a=t[e+1],f=t[e+2],g=t[e+3],y=t[e+4],m=t[e+5],p=t[e+6],x=t[e+7],A=t[e+8],S=t[e+9],v=t[e+10],b=t[e+11],M=t[e+12],w=t[e+13],C=t[e+14],T=t[e+15],R=n[0],E=n[1],k=n[2],I=n[3];R=l(R,E,k,I,o,7,h[0]),I=l(I,R,E,k,a,12,h[1]),k=l(k,I,R,E,f,17,h[2]),E=l(E,k,I,R,g,22,h[3]),R=l(R,E,k,I,y,7,h[4]),I=l(I,R,E,k,m,12,h[5]),k=l(k,I,R,E,p,17,h[6]),E=l(E,k,I,R,x,22,h[7]),R=l(R,E,k,I,A,7,h[8]),I=l(I,R,E,k,S,12,h[9]),k=l(k,I,R,E,v,17,h[10]),E=l(E,k,I,R,b,22,h[11]),R=l(R,E,k,I,M,7,h[12]),I=l(I,R,E,k,w,12,h[13]),k=l(k,I,R,E,C,17,h[14]),R=u(R,E=l(E,k,I,R,T,22,h[15]),k,I,a,5,h[16]),I=u(I,R,E,k,p,9,h[17]),k=u(k,I,R,E,b,14,h[18]),E=u(E,k,I,R,o,20,h[19]),R=u(R,E,k,I,m,5,h[20]),I=u(I,R,E,k,v,9,h[21]),k=u(k,I,R,E,T,14,h[22]),E=u(E,k,I,R,y,20,h[23]),R=u(R,E,k,I,S,5,h[24]),I=u(I,R,E,k,C,9,h[25]),k=u(k,I,R,E,g,14,h[26]),E=u(E,k,I,R,A,20,h[27]),R=u(R,E,k,I,w,5,h[28]),I=u(I,R,E,k,f,9,h[29]),k=u(k,I,R,E,x,14,h[30]),R=c(R,E=u(E,k,I,R,M,20,h[31]),k,I,m,4,h[32]),I=c(I,R,E,k,A,11,h[33]),k=c(k,I,R,E,b,16,h[34]),E=c(E,k,I,R,C,23,h[35]),R=c(R,E,k,I,a,4,h[36]),I=c(I,R,E,k,y,11,h[37]),k=c(k,I,R,E,x,16,h[38]),E=c(E,k,I,R,v,23,h[39]),R=c(R,E,k,I,w,4,h[40]),I=c(I,R,E,k,o,11,h[41]),k=c(k,I,R,E,g,16,h[42]),E=c(E,k,I,R,p,23,h[43]),R=c(R,E,k,I,S,4,h[44]),I=c(I,R,E,k,M,11,h[45]),k=c(k,I,R,E,T,16,h[46]),R=d(R,E=c(E,k,I,R,f,23,h[47]),k,I,o,6,h[48]),I=d(I,R,E,k,x,10,h[49]),k=d(k,I,R,E,C,15,h[50]),E=d(E,k,I,R,m,21,h[51]),R=d(R,E,k,I,M,6,h[52]),I=d(I,R,E,k,g,10,h[53]),k=d(k,I,R,E,v,15,h[54]),E=d(E,k,I,R,a,21,h[55]),R=d(R,E,k,I,A,6,h[56]),I=d(I,R,E,k,T,10,h[57]),k=d(k,I,R,E,p,15,h[58]),E=d(E,k,I,R,w,21,h[59]),R=d(R,E,k,I,y,6,h[60]),I=d(I,R,E,k,b,10,h[61]),k=d(k,I,R,E,f,15,h[62]),E=d(E,k,I,R,S,21,h[63]),n[0]=n[0]+R|0,n[1]=n[1]+E|0,n[2]=n[2]+k|0,n[3]=n[3]+I|0},$X:function(){var t=this._w,i=t.words,s=8*this.NX,r=8*t.sigBytes;i[r>>>5]|=128<<24-r%32;var n=e.floor(s/4294967296),o=s;i[15+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),i[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(i.length+1),this.WX();for(var h=this.ZX,a=h.words,l=0;l<4;l++){var u=a[l];a[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return h},clone:function(){var t=n.clone.call(this);return t.ZX=this.ZX.clone(),t}});function l(t,e,i,s,r,n,o){var h=t+(e&i|~e&s)+r+o;return(h<>>32-n)+e}function u(t,e,i,s,r,n,o){var h=t+(e&s|i&~s)+r+o;return(h<>>32-n)+e}function c(t,e,i,s,r,n,o){var h=t+(e^i^s)+r+o;return(h<>>32-n)+e}function d(t,e,i,s,r,n,o){var h=t+(i^(e|~s))+r+o;return(h<>>32-n)+e}i.MD5=n.XX(a),i.HmacMD5=n.jX(a)})(Math),t.MD5}(Ip.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({HX:function(){this.ZX=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},YX:function(t,e){for(var i=this.ZX.words,s=i[0],r=i[1],n=i[2],h=i[3],a=i[4],l=0;l<80;l++){if(l<16)o[l]=0|t[e+l];else{var u=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=u<<1|u>>>31}var c=(s<<5|s>>>27)+a+o[l];c+=l<20?1518500249+(r&n|~r&h):l<40?1859775393+(r^n^h):l<60?(r&n|r&h|n&h)-1894007588:(r^n^h)-899497514,a=h,h=n,n=r<<30|r>>>2,r=s,s=c}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+h|0,i[4]=i[4]+a|0},$X:function(){var t=this._w,e=t.words,i=8*this.NX,s=8*t.sigBytes;return e[s>>>5]|=128<<24-s%32,e[14+(s+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(s+64>>>9<<4)]=i,t.sigBytes=4*e.length,this.WX(),this.ZX},clone:function(){var t=r.clone.call(this);return t.ZX=this.ZX.clone(),t}}),e.SHA1=r.XX(h),e.HmacSHA1=r.jX(h),t.SHA1;var e,i,s,r,n,o,h}(Ip.exports),Dp=(Fp=Ip.exports).lib.Base,Pp=Fp.enc.Utf8,Fp.algo.HMAC=Dp.extend({init:function(t,e){t=this.KX=new t.init,"string"==typeof e&&(e=Pp.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.qX=e.clone(),n=this.tj=e.clone(),o=r.words,h=n.words,a=0;a>>2];t.sigBytes-=e}};i.BlockCipher=l.extend({cfg:l.cfg.extend({mode:d,padding:f}),reset:function(){var t;l.reset.call(this);var e=this.cfg,i=e.iv,s=e.mode;this.ej==this.ij?t=s.createEncryptor:(t=s.createDecryptor,this.UX=1),this.aj&&this.aj.lj==t?this.aj.init(this,i&&i.words):(this.aj=t.call(s,this,i&&i.words),this.aj.lj=t)},YX:function(t,e){this.aj.processBlock(t,e)},$X:function(){var t,e=this.cfg.padding;return this.ej==this.ij?(e.pad(this._w,this.blockSize),t=this.WX(!0)):(t=this.WX(!0),e.unpad(t)),t},blockSize:4});var g=i.CipherParams=s.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),y=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return(i?r.create([1398893684,1701076831]).concat(i).concat(e):e).toString(h)},parse:function(t){var e,i=h.parse(t),s=i.words;return 1398893684==s[0]&&1701076831==s[1]&&(e=r.create(s.slice(2,4)),s.splice(0,4),i.sigBytes-=16),g.create({ciphertext:i,salt:e})}},m=i.SerializableCipher=s.extend({cfg:s.extend({format:y}),encrypt:function(t,e,i,s){s=this.cfg.extend(s);var r=t.createEncryptor(i,s),n=r.finalize(e),o=r.cfg;return g.create({ciphertext:n,key:i,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:s.format})},decrypt:function(t,e,i,s){return s=this.cfg.extend(s),e=this.uj(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},uj:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),p=(e.kdf={}).OpenSSL={execute:function(t,e,i,s){s||(s=r.random(8));var n=a.create({keySize:e+i}).compute(t,s),o=r.create(n.words.slice(e),4*i);return n.sigBytes=4*e,g.create({key:n,iv:o,salt:s})}},x=i.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:p}),encrypt:function(t,e,i,s){var r=(s=this.cfg.extend(s)).kdf.execute(i,t.keySize,t.ivSize);s.iv=r.iv;var n=m.encrypt.call(this,t,e,r.key,s);return n.mixIn(r),n},decrypt:function(t,e,i,s){s=this.cfg.extend(s),e=this.uj(e,s.format);var r=s.kdf.execute(i,t.keySize,t.ivSize,e.salt);return s.iv=r.iv,m.decrypt.call(this,t,e,r.key,s)}})}()}(Ip.exports);var zp={exports:{}}.exports=function(t){return function(){var e=t,i=e.lib.BlockCipher,s=e.algo,r=[],n=[],o=[],h=[],a=[],l=[],u=[],c=[],d=[],f=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,s=0;for(e=0;e<256;e++){var g=s^s<<1^s<<2^s<<3^s<<4;g=g>>>8^255&g^99,r[i]=g,n[g]=i;var y=t[i],m=t[y],p=t[m],x=257*t[g]^16843008*g;o[i]=x<<24|x>>>8,h[i]=x<<16|x>>>16,a[i]=x<<8|x>>>24,l[i]=x,x=16843009*p^65537*m^257*y^16843008*i,u[g]=x<<24|x>>>8,c[g]=x<<16|x>>>16,d[g]=x<<8|x>>>24,f[g]=x,i?(i=y^t[t[t[p^y]]],s^=t[t[s]]):i=s=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],y=s.AES=i.extend({HX:function(){if(!this.cj||this.dj!==this.hj){for(var t=this.dj=this.hj,e=t.words,i=t.sigBytes/4,s=4*((this.cj=i+6)+1),n=this.fj=[],o=0;o6&&o%i==4&&(l=r[l>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l]):(l=r[(l=l<<8|l>>>24)>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l],l^=g[o/i|0]<<24),n[o]=n[o-i]^l);for(var h=this.Aj=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.gj(t,e,this.fj,o,h,a,l,r)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this.gj(t,e,this.Aj,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},gj:function(t,e,i,s,r,n,o,h){for(var a=this.cj,l=t[e]^i[0],u=t[e+1]^i[1],c=t[e+2]^i[2],d=t[e+3]^i[3],f=4,g=1;g>>24]^r[u>>>16&255]^n[c>>>8&255]^o[255&d]^i[f++],m=s[u>>>24]^r[c>>>16&255]^n[d>>>8&255]^o[255&l]^i[f++],p=s[c>>>24]^r[d>>>16&255]^n[l>>>8&255]^o[255&u]^i[f++],x=s[d>>>24]^r[l>>>16&255]^n[u>>>8&255]^o[255&c]^i[f++];l=y,u=m,c=p,d=x}y=(h[l>>>24]<<24|h[u>>>16&255]<<16|h[c>>>8&255]<<8|h[255&d])^i[f++],m=(h[u>>>24]<<24|h[c>>>16&255]<<16|h[d>>>8&255]<<8|h[255&l])^i[f++],p=(h[c>>>24]<<24|h[d>>>16&255]<<16|h[l>>>8&255]<<8|h[255&u])^i[f++],x=(h[d>>>24]<<24|h[l>>>16&255]<<16|h[u>>>8&255]<<8|h[255&c])^i[f++],t[e]=y,t[e+1]=m,t[e+2]=p,t[e+3]=x},keySize:8});e.AES=i.XX(y)}(),t.AES}(Ip.exports),Np={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.rj,s=i.blockSize,r=this.nj,n=this.pj;r&&(n=this.pj=r.slice(0),this.nj=void 0);var o=n.slice(0);i.encryptBlock(o,0),n[s-1]=n[s-1]+1|0;for(var h=0;h>>2]|=t[r]<<24-r%4*8;i.call(this,s,e)}else i.apply(this,arguments)};s.prototype=e}}(),t.lib.WordArray}(Ip.exports),Up={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(Ip.exports);const Yp="aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvYXBwLWRlcGxveW1lbnQv",Gp={"-4":["MDQxMmQ1MWU5MjFhYTMzODUwMWE4ZGYzN2ViZTE4NTU3ZDViYmRlZDg1Yzk0OGI3YTJkMDBmZTNhZGVlMjdjY2VmNzBiMWVlOWI3MDZjMTIwYTAzZDZlZTNkNmYyOTc5Y2E2NGEzN2Y3YjY4N2E1ZjljZWY2ODYxN2I1NWU5ZmJjMA=="],"-3":["MjAxODAxMjA="],"-2":["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2Vzc2lvbg==","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvdHJvdWJsZXNob290aW5nL3Jlc3RyaWN0ZWQtZmVhdHVyZXMv","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzLw=="],"-1":["WE1MSHR0cFJlcXVlc3Q=","ZG9jdW1lbnQ=","ZGVmYXVsdFZpZXc=","YQ==","Yg==","bGljZW5zZV9leHBpcmF0aW9uX2RhdGU=","bG9jYXRpb24=","aG9zdG5hbWU=","dGVzdF9kb21haW4=","ZG9tYWlucw==","Y3J5cHRv","U2lnbmF0dXJl","RUNEU0E=","U0hBMjI0d2l0aEVDRFNB","YWxn","Y3VydmU=","c2VjcDI1Nmsx","YWRkRXZlbnRMaXN0ZW5lcg==","cmVtb3ZlRXZlbnRMaXN0ZW5lcg==","bG9hZGVuZA==","ZXJyb3I=","YWJvcnQ=","dGltZW91dA==","cmVzcG9uc2VUZXh0","Q29udGVudC1UeXBl","YXBwbGljYXRpb24vanNvbg==","TWVzc2FnZURpZ2VzdA==","c2hhMjU2","Y3J5cHRvanM=","dXBkYXRlU3RyaW5n","ZGlnZXN0","Y29tcGFueQ==","YXBwVGl0bGU=","bGNqcy1zZXNzaW9u","bG9jYWxTdG9yYWdl","Z2V0SXRlbQ==","c2V0SXRlbQ==","ZA==","dA==","bGNqcy1zZXNzaW9uLTI="],0:["TGljZW5zZQ==","IA==","a2V5","aGFz","ZXhwaXJlZA==","Lg==","dmVyc2lvbg==","aXM=","dG9v","bmV3","b2xk","b3I=","aW52YWxpZA==","MDAwMQ==","SW52YWxpZA==","bnVtYmVy","b2Y=","ZG9tYWlucw==","ZGVwbG95bWVudA==","aW4=","ZG9tYWlu","RGVwbG95bWVudA==","ZG9tYWlu","dmFsaWRhdGlvbg==","ZmFpbGVk","Og==","UE9TVA==","c2VydmVy","cmVzcG9uZGVk","d2l0aA==","dW5leHBlY3RlZA==","dmFsdWU=","cmVxdWVzdA==","VEVTVA==","REVQTE9ZTUVOVA==","S2V5","VGFtcGVyaW5n","YmVlbg==","ZGV0ZWN0ZWQ=","TWlzc2luZw==","TGljZW5zZQ==","aW5mb3JtYXRpb24=","ZG9lcw==","bm90","aW5jbHVkZQ==","cGVybWlzc2lvbg==","dG8=","dXNl","Q2hhcnQ=","M0Q=","WFk=","RGF0YUdyaWQ=","TWFw","UG9sYXI=","RnVubmVs","R2F1Z2U=","UGll","UHlyYW1pZA==","U3BpZGVy","Zm9y","dGhpcw==","VHJhZGluZw==","ZmVhdHVyZXM=","Y2xpY2s=","aGVyZQ==","bW9yZQ==","c3VwcGxpZWQ=","Z2V0","bGljZW5zZQ==","VHJlZQ=="],1:["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2FuZGJveA=="]},Xp=wt,Zp=(...t)=>t.slice(1).reduce(((e,i)=>e+Xp.atob(Gp[t[0]][i].toString())),"");let Hp,Wp,jp,Kp=new Uint8Array([]);class $p{set e(t){Hp=t}get e(){Wp={rf:!1,nf:!1,af:!1,lf:!1,uf:!1,cf:!1,df:!1,ff:!1,Af:!1,gf:!1,pf:!1,yf:!1,mf:!1,vf:!1,Sf:!1,xf:!1,bf:!1,Mf:!1,_f:!1,wf:!1,Cf:!1,kf:!1,Tf:!1,Ff:!1};const t=Kp.length,e=t>=1?Kp[0]:void 0,i=t>=2?Kp[1]:void 0,s=t>=3?Kp[2]:void 0;return void 0!==e&&(Wp.rf=!!(1&e),Wp.nf=!!(2&e),Wp.af=!!(4&e),Wp.lf=!!(8&e),Wp.uf=!!(16&e),Wp.cf=!!(32&e),Wp.df=!!(64&e),Wp.ff=!!(128&e)),void 0!==i&&(Wp.Af=!!(1&i),Wp.gf=!!(2&i),Wp.pf=!!(4&i),Wp.yf=!!(8&i),Wp.mf=!!(16&i),Wp.vf=!!(32&i),Wp.Sf=!!(64&i),Wp.xf=!!(128&i)),void 0!==s&&(Wp.bf=!!(1&s),Wp.Mf=!!(2&s),Wp._f=!!(4&s),Wp.wf=!!(8&s),Wp.Cf=!!(16&s),Wp.kf=!!(32&s),Wp.Tf=!!(64&s),Wp.Ff=!!(128&s)),Wp.cf}set l(t){jp=t}get l(){return jp}}let Qp=!1;const qp=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},Jp=t=>{if(4===t.byteLength)return`${t[0].toString().padStart(2,"0")}${t[1].toString().padStart(2,"0")}${t[2].toString().padStart(2,"0")}${t[3].toString().padStart(2,"0")}`},tx=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),ex=t=>{const e={},i=t.split("-");if(3!==i.length)return{yj:Zp(0,0,1,7,1,12,5)};let s=0;const r=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(0)));s+=1;const n=r.subarray(s,s+=20),o=new DataView(r.buffer).getUint16(s,!0);s+=2;const h=Uint8Array.from(Array(o));for(let t=0;tt+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");return rx(d,f)?e:{yj:Zp(0,0,1,7,1,12,5)}},ix=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(qp(i,2)),e=t.slice(36,40),s=new Uint8Array(4),r=(t=>{let e;const i=[];for(let t=0;t<256;t+=1){e=t;for(let t=0;t<8;t+=1)e=1&e?3988292384^e>>>1:e>>>1;i[t]=e}let s=-1;for(let e=0;e>>8^i[255&(s^t[e])];return~s>>>0})(t.slice(0,36));new DataView(s.buffer).setUint32(0,r,!0);const n=t.slice(28,34);let o=0;for(let t=n.length-1;t>0;t-=1)o+=n[t]*2**(8*t);const h=new Date(o);if(tx(h)s[e]===t)))return{};break}case"0002":return ex(t);default:return{yj:Zp(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}return{yj:Zp(0,0,1,2,1,7,1,12,5)}},sx=t=>{if(!t)return{yj:Zp(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5)};const e=(t[Zp(-1,9)]||t[Zp(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(Xp[Zp(-1,6)][Zp(-1,7)])>-1)return{xj:!0};const i=e.filter((t=>t.indexOf("*")>-1));if(lx(Xp[Zp(-1,6)][Zp(-1,7)],i))return{xj:!0};const s=t[Zp(-1,8)]||t[Zp(-1,38)];if(""!==s&&null!=s){if(lx(Xp[Zp(-1,6)][Zp(-1,7)],[s]))return{xj:!1};if(s===Xp[Zp(-1,6)][Zp(-1,7)])return{xj:!1}}return{yj:Zp(0,14,1,20,5),vj:"aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvd2ViLWRlcGxveW1lbnQv"}},rx=(t,e)=>{const i=new Ep("secp256k1").keyFromPublic(Zp(-4,0),"hex"),s=Vp(t).toString();return i.verify(s,e)},nx=t=>{switch(t.slice(0,4)){case"0001":return(t=>{let e,i="";try{const e=t.split("-"),s=e[1],r=e[2],n=e[3];if(!rx(r,n))return{yj:Zp(0,21,1,2,1,7,1,12,5)};const o=_p.parse(r);i=zp.decrypt({ciphertext:_p.parse(s)},o,{mode:Np,padding:Up,iv:_p.parse("00000000000000000000000000000001")}).toString(Bp)}catch(t){return{yj:Zp(0,21,1,2,1,7,1,12,5)}}try{e=JSON.parse(i)}catch(t){return{yj:Zp(0,21,1,2,1,7,1,12,5)}}if(void 0===e[Zp(-1,5)]||null===e[Zp(-1,4)]||!e[Zp(-1,9)])return{yj:Zp(0,21,1,2,1,7,1,12,5)};const s=parseInt(Zp(-3,0),10)||Number(parseInt(Zp(-3,0),10));return e[Zp(-1,5)]{const e=ex(t),i=e.mj,s=e.Sj;if(e.yj||void 0===i||void 0===s)return e;let r,n="";try{const t=i.slice(e.Sj,s+16),r=new DataView(t.buffer),o=new Int32Array(4);for(let t=0;t{switch(t.slice(0,4)){case"0001":return((t,e)=>{if(!e)return{yj:Zp(0,39,1,40,1,41,5),vj:Yp};const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!rx(`${s}-${r}`,n))return{yj:Zp(0,21,1,2,1,7,1,12,5)};const o=Uint8Array.from(qp(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(Zp(-3,0),10)||Number(parseInt(Zp(-3,0),10))))return{yj:Zp(0,21,1,2,1,3,1,4,5)};const a=Int32Array.from(qp(s,8)),l=Lp(e[Zp(-1,31)]).toString(_p),u=Int32Array.from(qp(l,8)),c=Lp(e[Zp(-1,32)]).toString(_p),d=Int32Array.from(qp(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t))?{}:{yj:Zp(0,21,1,2,1,7,1,12,5)}})(t,e);case"0002":return((t,e)=>{if(!e)return{yj:Zp(0,39,1,40,1,41,5),vj:Yp};const i=ex(t),s=i.mj,r=i.Sj;if(i.yj||void 0===s||void 0===r)return i;const n=s.slice(r,s.length),o=new DataView(n.buffer),h=new Int32Array(8);for(let t=0;td[e]===t))?{}:{yj:Zp(0,21,1,2,1,7,1,12,5)}})(t,e);default:return{yj:Zp(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}},hx=(t,e,i=!0,s)=>{Qp=!1,e.lo();const r=e.Zr,n=!!r&&(r===wt.document.body||wt.document.body.contains(r)),o=r&&n?r:document.body;if(void 0===Array.from(o.children).find((t=>"lcjs-error"===t.id))){const r=wt.document.createElement("div");r.id="lcjs-error",o.append(r),r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="black",r.style.boxSizing="border-box",r.style.padding="20px",r.style.font="Arial",r.style.fontSize="20px";let n,h=(t||"LICENSE_ERROR").toLowerCase().split("_").join(" ");if(h=(i?Zp(0,0,1,2,1,23,1,24,25,1):"")+h.charAt(0).toUpperCase()+h.substr(1),s){const t=wt.document.createElement("a");t.href=s,n=t}else n=wt.document.createElement("p1");r.append(n),n.innerHTML=h,n.style.color="red",e.W$()&&Xp.console.error(h)}},ax=(t,e,i)=>{e?(t[Zp(-1,17)](Zp(-1,19),i),t[Zp(-1,17)](Zp(-1,20),i),t[Zp(-1,17)](Zp(-1,21),i),t[Zp(-1,17)](Zp(-1,22),i)):(t[Zp(-1,18)](Zp(-1,19),i),t[Zp(-1,18)](Zp(-1,20),i),t[Zp(-1,18)](Zp(-1,21),i),t[Zp(-1,18)](Zp(-1,22),i))},lx=(t,e)=>{const i=t.split(".").reverse();return e.some((t=>{const e=t.split(".").reverse();let s=!1;const r=e.findIndex((t=>"*"===t)),n=i.every(((t,i)=>{if(!s){if(!(i2,!s&&t!==e[i])return!1}return!0}));return!(r>i.length-1||!n)}))},ux=new Map;e.AbstractCursor=pa,e.Animation=j,e.AnimationEasings=W,e.Animator=K,e.AreaRangeSeries=Pu,e.AreaSeries=Ru,e.AreaSeriesBipolar=Eu,e.AreaSeriesMonopolar=ku,e.AreaSeriesNegative=Iu,e.AreaSeriesPositive=Fu,e.AreaSeriesTypes=Du,e.AutoFitStrategies=ga,e.AutoFitStrategy=ca,e.Axis=gh,e.Axis3D=$a,e.AxisScrollStrategies=Os,e.AxisTickStrategies=Us,e.Band=zs,e.BarChart=lf,e.BarChartBar=of,e.BarChartCategoryAxis=rf,e.BarChartSorting=uf,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=nf,e.BasicSeries=uu,e.BorderedPicture=_n,e.BoxFigure=ru,e.BoxSeries=du,e.BoxSeries3D=sl,e.Button=Yo,e.Chart=na,e.Chart3D=wl,e.ChartComponent=Zi,e.ChartWithSeries=cl,e.ChartXY=wc,e.Color=b,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return w(i[0],i[1],i[2],255*i[3])}if(t.startsWith("rgb")){const e=t.substr(4).slice(0,-1),i=JSON.parse(`[${e}]`);return w(i[0],i[1],i[2])}if(t.startsWith("hsl")){const e=t.substr(4).slice(0,-1).split(",").map(parseFloat),i=((t,e,i)=>{e/=100,i/=100;const s=(1-Math.abs(2*i-1))*e,r=t/60,n=s*(1-Math.abs(r%2-1));let o=[];isNaN(t)?o=[0,0,0]:r<=1?o=[s,n,0]:r<=2?o=[n,s,0]:r<=3?o=[0,s,n]:r<=4?o=[0,n,s]:r<=5?o=[n,0,s]:r<=6&&(o=[s,0,n]);const h=i-.5*s;return[Math.round(255*(o[0]+h)),Math.round(255*(o[1]+h)),Math.round(255*(o[2]+h))]})(e[0],e[1],e[2]);return w(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?C(t):C((t=>{const e=R[t.toLowerCase()];if(e)return e;throw new Error(`Unknown color code: ${t}`)})(t))}catch(t){}return console.warn(`ColorCSS parsing error: ${t}`),C("#fff")},e.ColorHEX=C,e.ColorHSV=T,e.ColorPalettes=On,e.ColorRGBA=w,e.ColorShadingStyles=Kn,e.ColorUint32=t=>w(255&t,255&(t>>=8),255&(t>>=8),255&(t>>=8)),e.ConstantLine=Ns,e.Cursor2D=Aa,e.Cursor3D=vl,e.CursorBuilder2D=Sa,e.CursorBuilder3D=bl,e.CursorBuilderXY=hc,e.CursorBuilders=Mf,e.CursorXY=oc,e.CustomTick=wn,e.Dashboard=vf,e.DashedLine=io,e.DataGrid=Qd,e.DataPatternsNew=Br,e.DataSetXY=lo,e.DateTimeTickStrategy=Yh,e.EllipseFigure=fu,e.EllipseSeries=gu,e.EmptyFill=_,e.EmptyTickStrategy=Qs,e.EmptyUIElement=Pn,e.Figure=su,e.FigureSeries=au,e.FontSettings=lr,e.FormattingFunctions=Di,e.FunnelChart=Hc,e.FunnelChartTypes=qc,e.FunnelChartWithLabelsInsideSlices=Qc,e.FunnelChartWithLabelsOnSides=$c,e.FunnelSlice=Uc,e.GaugeChart=gf,e.GenericAxis=ir,e.GlowEffect=ao,e.HeatmapGridSeries=vu,e.HeatmapGridSeriesIntensityValues=bu,e.HeatmapScrollingGridSeries=Mu,e.HeatmapScrollingGridSeriesIntensityValues=wu,e.Highlighter=Hi,e.Icon=no,e.ImageFill=qn,e.IndividualPointFill=G,e.LUT=L,e.LegendBoxBuilders=hh,e.LineAndPointSeries3D=rl,e.LineSeries=uc,e.LineSeries3D=nl,e.LinearGradientFill=it,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new it({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=Vl,e.MapRegions=Pf,e.MapRegionsAfrica=wf,e.MapRegionsAsia=Cf,e.MapRegionsAustralia=Tf,e.MapRegionsCanada=Rf,e.MapRegionsEurope=Ef,e.MapRegionsNorthAmerica=Ff,e.MapRegionsSouthAmerica=Df,e.MapRegionsUSA=If,e.MapRegionsWorld=kf,e.MapTypes=El,e.MeshModel3D=Sl,e.NumericTickStrategy=$h,e.OHLCSeries=tc,e.OHLCSeriesBars=ic,e.OHLCSeriesCandlesticks=ec,e.OHLCSeriesTypes=sc,e.OnScreenMenu=dc,e.OnScreenMenuAnimationsButton=Ms,e.OnScreenMenuButton=ys,e.OnScreenMenuControlBase=es,e.OnScreenMenuCustomButton=Cs,e.OnScreenMenuOsmToggleButton=Ts,e.OnScreenMenuToggleButton=ms,e.OnScreenMenuZoomInButton=ps,e.OnScreenMenuZoomInXButton=xs,e.OnScreenMenuZoomInYButton=As,e.OnScreenMenuZoomOutButton=Ss,e.OnScreenMenuZoomOutXButton=vs,e.OnScreenMenuZoomOutYButton=bs,e.OnScreenMenuZoomToFitButton=ws,e.PalettedFill=class extends Z{constructor(t){super({...t,fillType:"palette"})}toString(){return`palettedFill:lut=${this.lut.toString()},lookUpProperty=${this.lookUpProperty}`}getPalette(){return this.get("lut")}setLookUpProperty(t){return"function"==typeof t?this.set("lookUpProperty",t(this.get("lookUpProperty"))):this.set("lookUpProperty",t)}getLookUpProperty(){return this.get("lookUpProperty")}},e.Panel=ea,e.PhongShadingStyle=Wn,e.Picture=Vn,e.PieChart=za,e.PieChartTypes=Xa,e.PieChartWithLabelsInsideSlices=Ga,e.PieChartWithLabelsOnSides=Ya,e.PieSlice=Pa,e.PixelatedPoints3D=pr,e.PointCloudSeries3D=ll,e.PointLineAreaSeries=fc,e.PointLineSeries=zu,e.PointLineSeries3D=ol,e.PointSeries=cc,e.PointSeries3D=al,e.PointSeriesTypes3D=ul,e.PointStyle3D=Ar,e.PolarAreaSeries=Vc,e.PolarAreaSeriesInterior=_c,e.PolarAxis=zl,e.PolarAxisAmplitude=Ol,e.PolarAxisTick=Nl,e.PolarChart=zc,e.PolarHeatmapSeries=tu,e.PolarLineSeries=eu,e.PolarPointLineSeries=iu,e.PolarPointSeries=Dc,e.PolarPolygon=Pc,e.PolarPolygonSeries=Lc,e.PolarSector=Wl,e.PolarSeries=Kl,e.PolygonFigure=yu,e.PolygonSeries=mu,e.PyramidChart=nd,e.PyramidChartTypes=cd,e.PyramidChartWithLabelsInsideSlices=ud,e.PyramidChartWithLabelsOnSides=ld,e.PyramidSlice=ed,e.RadialGradientFill=J,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new J({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=Tu,e.RectangleFigure=pu,e.RectangleSeries=xu,e.SegmentFigure=Au,e.SegmentSeries=Su,e.Series2D=jl,e.Series3D=il,e.SeriesXY=nu,e.SimpleShadingStyle=Zn,e.Slice=Fa,e.SliceLabelFormatters=Ia,e.SliceSorters=ka,e.SolidFill=U,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new U({color:s(t)})},e.SolidLine=Ji,e.SpiderAxis=md,e.SpiderChart=Cd,e.SpiderSeries=pd,e.SplineSeries=Uu,e.StepSeries=Ju,e.StipplePatterns=to,e.SurfaceGridSeries3D=ml,e.SurfaceScrollingGridSeries3D=pl,e.Themes=tg,e.Tick=fh,e.TickStyle=Sh,e.TimeFormattingFunctions=Th,e.TimeTickStrategy=Eh,e.TreeMapChart=Of,e.TriangulatedPoints3D=gr,e.UIBackgrounds=ya,e.UICircle=So,e.UIColumnGrid=class extends Ro{constructor(){super(...arguments),this.wd=[]}addColumn(){return this.addElement(Do,void 0)}getColumn(t,e=!1){return e&&this.wd.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.wd[t]}},e.UIDiamond=vo,e.UIElementBuilders=oh,e.UIElementColumn=Eo,e.UIElementLine=To,e.UIElementRow=Ro,e.UIElementWithBackground=bn,e.UIEmptyBackground=Ln,e.UILabel=po,e.UILayoutBuilders=Tl,e.UILayoutGap=Co,e.UILegendBoxPanel=Rl,e.UIObject=pn,e.UIOrigins=Es,e.UIPanel=sa,e.UIPoint=Mo,e.UIPointer=bo,e.UIPolygon=Bn,e.UIRectangle=Ao,e.UIRowGrid=Io,e.VisibleFill=O,e.ZoomBandChart=Ic,e._translatePoint=ct,e.defaultOsmBackgroundColor=_s,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=B,e.emptyLine=nt,e.emptyPoints3D=dr,e.emptyTick=bh,e.formatLongitudeLatitude=_l,e.formatNumberAsUnicodeSuperscript=Pi,e.isColor=M,e.isCoordinate3D=Al,e.isCoordinateBarChart=hf,e.isCoordinateClient=Ui,e.isCoordinatePolar=Hl,e.isCoordinateXY=Gi,e.isDashedLine=so,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=z,e.isEmptyTick=Mh,e.isEmptyTickStrategy=qs,e.isFontSettings=ur,e.isGlowEffect=t=>!(!t||"object"!=typeof t||!("type"in t)||"glow"!==t.type),e.isHitBox=t=>t&&"object"==typeof t&&"figure"in t&&"start"in t&&"end"in t&&"median"in t&&"upperQuartile"in t,e.isHitBox3D=t=>t&&"object"==typeof t&&"xSize"in t&&"ySize"in t&&"zSize"in t,e.isHitEllipse=t=>t&&"object"==typeof t&&"figure"in t&&"x"in t&&"radiusX"in t&&"radiusY"in t,e.isHitHeatmap=ft,e.isHitMeshModel=mt,e.isHitOHLC=t=>t&&"object"==typeof t&&"position"in t&&"open"in t&&"high"in t&&"isPacked"in t,e.isHitPolarHeatmap=yt,e.isHitPolygon=t=>t&&"object"==typeof t&&"figure"in t&&"x"in t&&"coordinates"in t,e.isHitRectangle=t=>t&&"object"==typeof t&&"figure"in t&&"x1"in t&&"y2"in t&&"height"in t,e.isHitSampleXY=t=>t&&"object"==typeof t&&"x"in t&&"y"in t,e.isHitSegment=t=>t&&"object"==typeof t&&"figure"in t&&"startX"in t&&"endX"in t,e.isHitSurface=gt,e.isIcon=oo,e.isIndividualPointFill=X,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=st,e.isNumericTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"numeric-ticks"!==t.type),e.isPalettedFill=H,e.isPhongShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"phong"!==t.type),e.isPixelatedPoints3D=xr,e.isRadialGradientFill=tt,e.isSeriesSupportedByZoomBandChart=t=>t instanceof uu||t instanceof Ru||t instanceof Pu||t instanceof bu||t instanceof tc||t instanceof Ju||t instanceof fc,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=Y,e.isSolidLine=ts,e.isTickStyle=vh,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=yr,e.lightningChart=(t,e)=>{const i="object"==typeof t?t.license:t,s="object"==typeof t?t.licenseInformation:e,n="object"==typeof t?t:void 0,o=new $p;o.e=i;let h=ux.get(i||"E");return h||(h=((t,e)=>{let i,s,n=!1,o=!1,h=!1,a=!1,l="",u=!1,c=!1;try{if(Hp){const s=(()=>{if(!Hp)return;const t=Hp.split("-");if(t.length>0)switch(t[0]){case"0001":return"0001";case"0002":return"0002";case"T001":return"T001";default:return}})();if("0001"===s){Kp=new Uint8Array([2]);const e=(()=>{if(!Hp)return;const t=Hp.split("-");return 4===t.length?t[1].startsWith("m")?2:1:0})();if(1===e){const t=nx(Hp);h=!t.xj,i=t,n=!0}else 2===e?(i=ox(Hp,t),o=!0):(Qp=!0,i=ix(Hp),a=!0)}else if("0002"===s){const e=(()=>{if(!Hp)return;const t=Hp.split("-");return t.length>=2?Uint8Array.from(atob(t[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)Qp=!0,i=ix(Hp),a=!0;else if(189===e){const t=nx(Hp);h=!t.xj,i=t,n=!0}else 159===e?(i=ox(Hp,t),o=!0):i={yj:Zp(0,0,1,7,1,12,5)}}else if("T001"===s){const s=((t,e)=>{const i=Hp.split("-");if(3!==i.length)return{yj:Zp(0,0,1,7,1,12,5)};const s=`${i[1]}`,r=Array.prototype.reduce.call(atob(i[2]),((t,e)=>t+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");if(!rx(s,r))return{yj:Zp(0,0,1,7,1,12,5)};let n=0;const o=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(n))),h=o.subarray(n,n+=20),a=new DataView(o.buffer).getUint16(n,!0);n+=2;const l=Uint8Array.from(Array(a));for(let t=0;tm)return{yj:Zp(0,0,1,2,1,3,1,4,5)};const p=u.getUint16(n,!0),x=l.subarray(n+=2,n+p);if(Kp=new Uint8Array(x),e&&"dHJhZGVy"in e&&"dGVjaG5pY2FsIGFuYWx5c2lz"===e.dHJhZGVy)return{bj:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="};if(e&&"logoGraphic"in e&&e.logoGraphic){const t=e.logoGraphic.split("-");return 3===t.length&&rx(t[0],t[2])?{bj:t[0]}:{yj:Zp(0,0,1,7,1,12,5)}}return{yj:Zp(0,0,1,7,1,12,5)}})(0,t);i=s;const r=s.bj;r&&e?("string"==typeof r&&(e.l=r),n=!0):i={yj:Zp(0,0,1,7,1,12,5)}}else i={yj:Zp(0,0,1,7,1,12,5)}}else{const t=/^(10\.|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168)\./;["localhost","127.0.0.1","::1"].includes(window.location.hostname)||t.test(window.location.hostname)?i={yj:Zp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68),vj:Zp(-2,2)}:window.location.host===Xp.atob("c3RhY2tzbmlwcGV0cy5uZXQ=")?(c=!0,u=!1,Kp=new Uint8Array([38]),i={}):(c=!0,u=!0,Kp=new Uint8Array([38]),i={})}}catch(t){i={yj:Zp(0,0,1,7,1,12,5)}}try{a&&(s=Xp[Zp(-1,34)][Zp(-1,35)](Zp(-1,39))||void 0)}catch(t){Xp.console.error(t)}let d=!1;if(s){const t=s.split("-");if(2===t.length&&rx(t[0],t[1])){const[e,i]=t[0].split(":").map((t=>Number(t)));Date.now()-i<.95*e*1e3&&(d=!0)}}const f=!(c||u||i.yj||n||o||d),g=(()=>{const t=new(Xp[Zp(-1,0)]);return t.open(Zp(0,26),Zp(-2,0)),t.setRequestHeader(Zp(-1,24),Zp(-1,25)),t.withCredentials=!0,t})(),y=new r.Eventer;if(f){let t;try{t=parseInt(Hp?Hp.split("-")[1]:Math.floor(1e6*Math.random()).toString(),16)}catch(e){t=Math.floor(1e6*Math.random())}const e=Math.floor(1e6*Math.random());l=(t^e).toString();const i={};let s="",r="",n="";Hp=Hp||"";const o=Zp(-4,0);for(let t=0;t{const n=[],o={Xn:t=>{n.indexOf(t)>=0||(n.push(t),a())},jn:t=>y.on("logoChange",t),Zn:t=>y.off(t)},a=()=>{n.forEach((t=>{const e=d(t);if(!e)return;const{Mj:i,_j:s}=e,r=s?Zp(-2,1):void 0,n=`${Zp(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${i}${r?Zp(0,1,63,1,64,1,59,1,65,1,41):""}`;hx(n,m,!1,r)}))},c=t=>t.toLowerCase().split("_").join(" "),d=t=>{var e;const i=null===(e=Object.entries(dh).find((e=>e[1]===t)))||void 0===e?void 0:e[0];if(i){switch(t){case dh.af:return Wp.rf||Wp.af?void 0:{Mj:c(i),_j:!0};case dh.df:return Wp.rf||Wp.df?void 0:{Mj:c(i),_j:!0};case dh.ff:return Wp.rf||Wp.nf||Wp.ff?void 0:{Mj:c(i)};case dh.nf:return Wp.rf||Wp.nf?void 0:{Mj:c(i)};case dh.mf:return Wp.rf||Wp.nf||Wp.mf?void 0:{Mj:c(i)};case dh.xf:return Wp.rf||Wp.nf||Wp.xf?void 0:{Mj:c(i)};case dh.wf:return Wp.rf||Wp.nf||Wp.wf?void 0:{Mj:c(i)};case dh.kf:return Wp.rf||Wp.nf||Wp.kf?void 0:{Mj:c(i)};case dh.Tf:return Wp.rf||Wp.nf||Wp.Tf?void 0:{Mj:c(i)};case dh.Cf:return Wp.rf||Wp.nf||Wp.Cf?void 0:{Mj:c(i)};case dh.gf:return Wp.rf||Wp.nf||Wp.gf?void 0:{Mj:c(i)};case dh.Sf:return Wp.rf||Wp.nf||Wp.Sf?void 0:{Mj:c(i)};case dh.yf:return Wp.rf||Wp.nf||Wp.yf?void 0:{Mj:c(i)};case dh.bf:return Wp.rf||Wp.nf||Wp.bf?void 0:{Mj:c(i)};case dh._f:return Wp.rf||Wp.nf||Wp._f?void 0:{Mj:c(i)};case dh.Mf:return Wp.rf||Wp.nf||Wp.Mf?void 0:{Mj:c(i)};case dh.Af:return Wp.rf||Wp.nf||Wp.Af?void 0:{Mj:c(i)};case dh.pf:return Wp.rf||Wp.nf||Wp.pf?void 0:{Mj:c(i)};case dh.vf:return Wp.rf||Wp.nf||Wp.vf?void 0:{Mj:c(i)};case dh.Ff:return Wp.rf||Wp.nf||Wp.Ff?void 0:{Mj:c(i)};case dh.rf:case dh.lf:case dh.cf:case dh.uf:return}return we(0,"")}},m=new lp(r,t,o);(null==i?void 0:i.yj)&&hx(i.yj,m,void 0,i.vj);const p=t=>{if("error"===(null==t?void 0:t.type)&&s){const t=s.split("-");if(2===t.length&&rx(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return Qp=!1,void ax(g,!1,x)}}if(g.readyState===Xp[Zp(-1,0)].DONE)if(200===g.status){const t=JSON.parse(g[Zp(-1,23)]);if(!rx(l+Zp(-3,0),t.h)){const t=Zp(0,0,1,27,1,28,1,29,1,30,1,31,5);hx(t,m)}Xp[Zp(-1,34)][Zp(-1,36)](Zp(-1,39),t.t),Xp[Zp(-1,34)][Zp(-1,36)](Zp(-1,33),t.s),Qp=!1}else{let e=Zp(0,0,1,2,1,7,1,12,5);try{e=t&&"loadend"!==t.type?Zp(0,0,1,23,1,32,1,24,5):JSON.parse(g[Zp(-1,23)]).message,ax(g,!1,x)}catch(t){console.error(t)}hx(e,m,void 0,"aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvbGljZW5zZXMvZGV2ZWxvcGVyLWxpY2Vuc2Vz")}},x=t=>{p(t)};if(ax(g,!0,x),f?setTimeout((()=>{if(Qp){let t=!0;if(s){const e=s.split("-");if(2===e.length&&rx(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&hx(Zp(0,25,1,23,1,32,1,24,5),m)}}),1e4):ax(g,!1,x),u){const t=(()=>{const t=new(Xp[Zp(-1,0)]);return t.open(Zp(0,26),Zp(1,0)),t.setRequestHeader("Content-Type","text/plain"),t.withCredentials=!0,t})(),i=Array.from({length:10},(()=>String.fromCharCode(Math.floor(256*Math.random())))).join(""),s=s=>{if("error"===(null==s?void 0:s.type)){const t=Zp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);hx(t,m,!1,Zp(-2,2)),ax(g,!1,r)}if(t.readyState===Xp.XMLHttpRequest.DONE){const s=t.getResponseHeader("X-LCJS-SANDBOX-V");if(200!==t.status||s&&"1"!==s){const t=Zp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);hx(t,m,!1,Zp(-2,2)),ax(g,!1,r)}else{const s=JSON.parse(t.responseText);if(!rx(i,s.s)){const t=Zp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);hx(t,m,!1,Zp(-2,2)),ax(g,!1,r)}void 0!==e&&(e.l=s.l),y.emit("logoChange",s.l)}}else{const t=Zp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);hx(t,m,!1,Zp(-2,2)),ax(g,!1,r)}},r=t=>{s(t)};ax(t,!0,r),t.send(i),setTimeout((()=>{if(t.readyState<2){const t=Zp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);hx(t,m,!1,Zp(-2,2)),ax(g,!1,r)}}),1e4)}return h?(t=>{let e;Qp=!1;const i=()=>{e&&(t.Dn(e.Pn()),e=void 0);const i=t.oi();e=t.GF("deployment test"),e.Or(t.At).gr(Zp(0,34,1,33)).Be({x:i.x/2,y:i.y/2}).Fa(50).Zh(13).Ie(new U({color:w(128,128,128,100)})).ka("Arial").Pa(500).setMouseInteractions(!1),t.Tn().Fn()};t.Do((()=>{i()})),setTimeout(i,0),setInterval((()=>{e&&e.Pn(){var r,n,o,h,a,l,u,c;let d;if(i&&i.license){const t=i.license.split("-");d=t[t.length-1]}const f=null===(r=null==i?void 0:i.webgl)||void 0===r?void 0:r.version,g={hz:null===(n=null==i?void 0:i.sharedContextOptions)||void 0===n?void 0:n.canvas,Kn:null==i?void 0:i.warnings,gz:"webgl1"===f?1:"webgl2"===f?2:void 0,cz:!1!==(null===(o=null==i?void 0:i.sharedContextOptions)||void 0===o?void 0:o.antialias),uz:(null===(h=null==i?void 0:i.sharedContextOptions)||void 0===h?void 0:h.devicePixelRatio)||void 0,_z:(null===(a=null==i?void 0:i.sharedContextOptions)||void 0===a?void 0:a.noCanvasStyles)||void 0,Tz:(null===(l=null==i?void 0:i.sharedContextOptions)||void 0===l?void 0:l.noCanvasTransform)||void 0,fz:!1!==(null===(u=null==i?void 0:i.sharedContextOptions)||void 0===u?void 0:u.useStackingOrder),Az:!1!==(null===(c=null==i?void 0:i.sharedContextOptions)||void 0===c?void 0:c.useIndividualCanvas),wz:d||void 0},y=new iy(g),m=e=>t(e,y);return{Dashboard:sy(m,e,i,s),ChartXY:oy(m,e,i,s),Spider:hy(m,e,i,s),Polar:ay(m,e,i,s),Pie:ly(m,e,i,s),UIPanel:ny(m,e,i,s),Gauge:uy(m,e,i,s),Funnel:cy(m,e,i,s),Pyramid:dy(m,e,i,s),Chart3D:gy(m,e,i,s),Map:fy(m,e,i,s),DataGrid:yy(m,e,i,s),BarChart:my(m,e,i,s),ZoomBandChart:py(m,e,i,s),TreeMapChart:xy(m,e,i,s),dispose:y.Y.bind(y),layout:y.Bz.bind(y)}})(h,o.e,n,o.l)},e.onScreenMenuControlBaseHeight=Fs,e.onScreenMenuControlBaseWidth=Ds,e.onScreenMenuControlOpacity=Ps,e.onScreenMenuDefaultButtonShape=Vs,e.onScreenMenuSpriteURL=Ls,e.regularColorSteps=(t,e,i,s)=>{if(!i||0===i.length)throw new Error("Invalid use regularColorSteps 'colorPalette' is undefined or empty");const r=null==s?void 0:s.formatLabels,n=null==s?void 0:s.alpha;return i.map(((s,o)=>{const h=t+o/(i.length-1)*(e-t);return{color:void 0!==n?s.setA(n):s,value:h,label:r?r(h):void 0}}))},e.saveToFile=Qh,e.synchronizeAxisIntervals=dt,e.transparentFill=ks,e.transparentLine=Is,e.uint32ColorFromObject=t=>I(255*t.r,255*t.g,255*t.b,255*t.a),e.uint32ColorFromRGBA=I,e.useCursorFormatterSeriesOverride=aa,e.vec3Utils=_e,e.xDimensionStrategy=mh,e.yDimensionStrategy=ph}}]); \ No newline at end of file diff --git a/js/vendor.480392df39608d990ad3.bundle.js.LICENSE.txt b/js/vendor.a2fc4f246becc51c9c1c.bundle.js.LICENSE.txt similarity index 100% rename from js/vendor.480392df39608d990ad3.bundle.js.LICENSE.txt rename to js/vendor.a2fc4f246becc51c9c1c.bundle.js.LICENSE.txt