From fd5f31921ec00e92866f12293854400fc733e00e Mon Sep 17 00:00:00 2001 From: Snekw Date: Wed, 13 Mar 2024 09:20:15 +0000 Subject: [PATCH] deploy: 58c72b041856f0b448fdda51ab20038bfedad2b5 --- index.html | 2 +- js/app.483d8fd74916225cf94f.bundle.js | 1 - js/app.ac375a4ab75fc6604e09.bundle.js | 1 + js/vendor.69d25a86dde584646758.bundle.js | 1 + js/vendor.accf70b827d2d6ced06f.bundle.js | 2 -- ...or.accf70b827d2d6ced06f.bundle.js.LICENSE.txt | 8 -------- resources/zoomBandChart/cyberspace-selector.png | Bin 1073 -> 0 bytes resources/zoomBandChart/darkgold-selector.png | Bin 1064 -> 0 bytes resources/zoomBandChart/light-selector.png | Bin 1145 -> 0 bytes resources/zoomBandChart/lightnature-selector.png | Bin 1139 -> 0 bytes resources/zoomBandChart/turquoise-selector.png | Bin 1036 -> 0 bytes 11 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 js/app.483d8fd74916225cf94f.bundle.js create mode 100644 js/app.ac375a4ab75fc6604e09.bundle.js create mode 100644 js/vendor.69d25a86dde584646758.bundle.js delete mode 100644 js/vendor.accf70b827d2d6ced06f.bundle.js delete mode 100644 js/vendor.accf70b827d2d6ced06f.bundle.js.LICENSE.txt delete mode 100644 resources/zoomBandChart/cyberspace-selector.png delete mode 100644 resources/zoomBandChart/darkgold-selector.png delete mode 100644 resources/zoomBandChart/light-selector.png delete mode 100644 resources/zoomBandChart/lightnature-selector.png delete mode 100644 resources/zoomBandChart/turquoise-selector.png diff --git a/index.html b/index.html index a88306c..a9a5a6b 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.483d8fd74916225cf94f.bundle.js b/js/app.483d8fd74916225cf94f.bundle.js deleted file mode 100644 index 2e54155..0000000 --- a/js/app.483d8fd74916225cf94f.bundle.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk=self.webpackChunk||[]).push([[524],{44:(e,t,o)=>{const a=o(89),{lightningChart:r,AxisTickStrategies:s,SolidFill:l,SolidLine:i,ColorRGBA:n,ColorHEX:d,LegendBoxBuilders:g,LinearGradientFill:w,Themes:y}=a,h=r().ChartXY({}).setTitle("Daily temperature range, April 2019"),x=h.getDefaultAxisX(),c=h.getDefaultAxisY().setTitle("Temperature (°C)").setScrollStrategy(void 0);x.setTickStrategy(s.DateTime).setInterval({start:new Date(2019,0,1).getTime(),end:new Date(2019,0,31).getTime()});const u=h.addAreaRangeSeries(),m=h.addAreaRangeSeries(),S=new w({angle:0,stops:[{color:d("#0000FF9F"),offset:0},{color:d("#FF00009F"),offset:1}]}),F=(new i).setFillStyle(new l({color:n(250,91,70)})),f=(new i).setFillStyle(new l({color:n(63,138,250)})),p=new l({color:n(255,174,0,200)}),M=(new i).setFillStyle(new l({color:n(250,226,105)}));u.setName("Temperature records range").setHighFillStyle(S).setHighStrokeStyle(F).setLowStrokeStyle(f),m.setName("2019 temperatures").setHighFillStyle(p).setHighStrokeStyle(M).setLowStrokeStyle(M),u.setCursorResultTableFormatter(((e,t,o,a,r)=>e.addRow("Temperature records range").addRow("Date: "+x.formatValue(o)).addRow("Highest: "+a.toFixed(2)+" °C").addRow("Lowest: "+r.toFixed(2)+" °C"))),m.setCursorResultTableFormatter(((e,t,o,a,r)=>e.addRow("2019 temperatures").addRow("Date: "+x.formatValue(o)).addRow("Highest: "+a.toFixed(2)+" °C").addRow("Lowest: "+r.toFixed(2)+" °C")));const T=(e,t)=>Math.floor(Math.random()*(t-e+1))+e,C=[],R=[];for(let e=0;e<31;e++){const t=()=>{const t=new Date(2019,0,e+1).getTime();let o;if(e>0){const t=C[e-1].yMax;o=T(t-5,t+5)}else o=T(-5,25);return{x:t,yMax:o,yMin:T(o-5,o)-5}};C.push(t())}let D=C[0].yMax,k=C[0].yMin;for(let e=1;eD&&(D=C[e].yMax);c.setInterval({start:k-5,end:D+5,stopAxisAfter:!1});for(let e=0;e<31;e++){const t=()=>({x:new Date(2019,0,e+1).getTime(),yMax:T(D-2,D+2),yMin:T(k-1,k)});R.push(t())}R.forEach(((e,t)=>{u.add({position:e.x,high:e.yMax,low:e.yMin})})),C.forEach(((e,t)=>{m.add({position:e.x,high:e.yMax,low:e.yMin})})),h.addLegendBox(g.HorizontalLegendBox).setAutoDispose({type:"max-width",maxWidth:.8}).add(h)}},e=>{e.O(0,[502],(()=>(44,e(e.s=44)))),e.O()}]); \ No newline at end of file diff --git a/js/app.ac375a4ab75fc6604e09.bundle.js b/js/app.ac375a4ab75fc6604e09.bundle.js new file mode 100644 index 0000000..c443df9 --- /dev/null +++ b/js/app.ac375a4ab75fc6604e09.bundle.js @@ -0,0 +1 @@ +(self.webpackChunk=self.webpackChunk||[]).push([[524],{44:(e,t,o)=>{const a=o(89),{lightningChart:r,AxisTickStrategies:s,SolidFill:l,SolidLine:i,ColorRGBA:n,ColorHEX:d,LegendBoxBuilders:w,LinearGradientFill:g,Themes:h}=a,y=r().ChartXY({theme:h[new URLSearchParams(window.location.search).get("theme")||"darkGold"]||void 0}).setTitle("Daily temperature range, April 2019"),c=y.getDefaultAxisX(),x=y.getDefaultAxisY().setTitle("Temperature (°C)").setScrollStrategy(void 0);c.setTickStrategy(s.DateTime).setInterval({start:new Date(2019,0,1).getTime(),end:new Date(2019,0,31).getTime()});const m=y.addAreaRangeSeries(),u=y.addAreaRangeSeries(),S=new g({angle:0,stops:[{color:d("#0000FF9F"),offset:0},{color:d("#FF00009F"),offset:1}]}),F=(new i).setFillStyle(new l({color:n(250,91,70)})),f=(new i).setFillStyle(new l({color:n(63,138,250)})),p=new l({color:n(255,174,0,200)}),M=(new i).setFillStyle(new l({color:n(250,226,105)}));m.setName("Temperature records range").setHighFillStyle(S).setHighStrokeStyle(F).setLowStrokeStyle(f),u.setName("2019 temperatures").setHighFillStyle(p).setHighStrokeStyle(M).setLowStrokeStyle(M),m.setCursorResultTableFormatter(((e,t,o,a,r)=>e.addRow("Temperature records range").addRow("Date: "+c.formatValue(o)).addRow("Highest: "+a.toFixed(2)+" °C").addRow("Lowest: "+r.toFixed(2)+" °C"))),u.setCursorResultTableFormatter(((e,t,o,a,r)=>e.addRow("2019 temperatures").addRow("Date: "+c.formatValue(o)).addRow("Highest: "+a.toFixed(2)+" °C").addRow("Lowest: "+r.toFixed(2)+" °C")));const T=(e,t)=>Math.floor(Math.random()*(t-e+1))+e,R=[],C=[];for(let e=0;e<31;e++){const t=()=>{const t=new Date(2019,0,e+1).getTime();let o;if(e>0){const t=R[e-1].yMax;o=T(t-5,t+5)}else o=T(-5,25);return{x:t,yMax:o,yMin:T(o-5,o)-5}};R.push(t())}let k=R[0].yMax,D=R[0].yMin;for(let e=1;ek&&(k=R[e].yMax);x.setInterval({start:D-5,end:k+5,stopAxisAfter:!1});for(let e=0;e<31;e++){const t=()=>({x:new Date(2019,0,e+1).getTime(),yMax:T(k-2,k+2),yMin:T(D-1,D)});C.push(t())}C.forEach(((e,t)=>{m.add({position:e.x,high:e.yMax,low:e.yMin})})),R.forEach(((e,t)=>{u.add({position:e.x,high:e.yMax,low:e.yMin})})),y.addLegendBox(w.HorizontalLegendBox).setAutoDispose({type:"max-width",maxWidth:.8}).add(y)}},e=>{e.O(0,[502],(()=>(44,e(e.s=44)))),e.O()}]); \ No newline at end of file diff --git a/js/vendor.69d25a86dde584646758.bundle.js b/js/vendor.69d25a86dde584646758.bundle.js new file mode 100644 index 0000000..39a4974 --- /dev/null +++ b/js/vendor.69d25a86dde584646758.bundle.js @@ -0,0 +1 @@ +"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,y=e&&e.length,m=y?e[0]*s:t.length,p=i(t,0,m,s,!0),S=[];if(!p||p.next===p.prev)return S;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 x=s;xh&&(h=c),d>a&&(a=d);g=0!==(g=Math.max(h-n,a-o))?32767/g:0}return r(p,S,s,n,o,g,0),S}function i(t,e,i,s,r){var n,o;if(r===E(t,e,i,s)>0)for(n=e;n=e;n-=s)o=A(n,t[n],t[n+1],o);return o&&p(o,o.next)&&(T(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(T(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),T(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,x=u>c?u>f?u:f:c>f?c:f,b=d(y,p,e,i,s),v=d(S,x,e,i,s),M=t.prevZ,A=t.nextZ;M&&M.z>=b&&A&&A.z<=v;){if(M.x>=y&&M.x<=S&&M.y>=p&&M.y<=x&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(M.prev,M,M.next)>=0)return!1;if(M=M.prevZ,A.x>=y&&A.x<=S&&A.y>=p&&A.y<=x&&A!==r&&A!==o&&g(h,u,a,c,l,f,A.x,A.y)&&m(A.prev,A,A.next)>=0)return!1;A=A.nextZ}for(;M&&M.z>=b;){if(M.x>=y&&M.x<=S&&M.y>=p&&M.y<=x&&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.prevZ}for(;A&&A.z<=v;){if(A.x>=y&&A.x<=S&&A.y>=p&&A.y<=x&&A!==r&&A!==o&&g(h,u,a,c,l,f,A.x,A.y)&&m(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function h(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!p(n,o)&&S(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),T(r),T(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=M(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=M(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&&S(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 S(t,e,i,s){var r=b(m(t,e,i)),n=b(m(t,e,s)),o=b(m(i,s,t)),h=b(m(i,s,e));return r!==n&&o!==h||!(0!==r||!x(t,i,e))||!(0!==n||!x(t,s,e))||!(0!==o||!x(i,t,s))||!(0!==h||!x(i,e,s))}function x(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 b(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 M(t,e){var i=new w(t.i,t.x,t.y),s=new w(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 A(t,e,i,s){var r=new w(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 T(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 w(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 E(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:()=>w,Iterable:()=>Is,List:()=>ai,Map:()=>Re,OrderedMap:()=>Mi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>Yi,Record:()=>ys,Repeat:()=>Ms,Seq:()=>K,Set:()=>Vi,Stack:()=>Ci,default:()=>Cs,fromJS:()=>As,get:()=>ae,getIn:()=>ji,has:()=>he,hasIn:()=>$i,hash:()=>pt,is:()=>ft,isAssociative:()=>T,isCollection:()=>x,isImmutable:()=>_,isIndexed:()=>A,isKeyed:()=>v,isList:()=>hi,isMap:()=>ut,isOrdered:()=>D,isOrderedMap:()=>ct,isOrderedSet:()=>Di,isPlainObject:()=>re,isRecord:()=>B,isSeq:()=>P,isSet:()=>Li,isStack:()=>Ii,isValueObject:()=>dt,merge:()=>Te,mergeDeep:()=>Ee,mergeDeepWith:()=>Ie,mergeWith:()=>we,remove:()=>ue,removeIn:()=>me,set:()=>ce,setIn:()=>ge,update:()=>Se,updateIn:()=>de,version:()=>Es});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 S="@@__IMMUTABLE_ITERABLE__@@";function x(t){return Boolean(t&&t[S])}var b="@@__IMMUTABLE_KEYED__@@";function v(t){return Boolean(t&&t[b])}var M="@@__IMMUTABLE_INDEXED__@@";function A(t){return Boolean(t&&t[M])}function T(t){return v(t)||A(t)}var w=function(t){return x(t)?t:K(t)},E=function(t){function e(t){return v(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),I=function(t){function e(t){return A(t)?t:Q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),C=function(t){function e(t){return x(t)&&!T(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w);w.Keyed=E,w.Indexed=I,w.Set=C;var k="@@__IMMUTABLE_SEQ__@@";function P(t){return Boolean(t&&t[k])}var F="@@__IMMUTABLE_RECORD__@@";function B(t){return Boolean(t&&t[F])}function _(t){return x(t)||B(t)}var L="@@__IMMUTABLE_ORDERED__@@";function D(t){return Boolean(t&&t[L])}var z=0,O=1,R=2,V="function"==typeof Symbol&&Symbol.iterator,N="@@iterator",G=V||N,H=function(t){this.next=t};function U(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 W(){return{value:void 0,done:!0}}function X(t){return!!Array.isArray(t)||!!J(t)}function Y(t){return t&&"function"==typeof t.next}function j(t){var e=J(t);return e&&e.call(t)}function J(t){var e=t&&(V&&t[V]||t[N]);if("function"==typeof e)return e}H.prototype.toString=function(){return"[Iterator]"},H.KEYS=z,H.VALUES=O,H.ENTRIES=R,H.prototype.inspect=H.prototype.toSource=function(){return this.toString()},H.prototype[G]=function(){return this};var $=Object.prototype.hasOwnProperty;function q(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 K=function(t){function e(t){return null==t?nt():_(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 H((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return U(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(w),Z=function(t){function e(t){return null==t?nt().toKeyedSeq():x(t)?v(t)?t.toSeq():t.fromEntrySeq():B(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}(K),Q=function(t){function e(t){return null==t?nt():x(t)?v(t)?t.entrySeq():t.toIndexedSeq():B(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}(K),tt=function(t){function e(t){return(x(t)&&!T(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}(K);K.isSeq=P,K.Keyed=Z,K.Set=tt,K.Indexed=Q,K.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 H((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return U(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 $.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 H((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return U(t,o,i[o])}))},e}(Z);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=j(this._collection),s=0;if(Y(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(!Y(i))return new H(W);var s=0;return new H((function(){var e=i.next();return e.done?e:U(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 q(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)&&D(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 St(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 St(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>Ct?(void 0===(s=Ft[i=r])&&(s=xt(i),Pt===kt&&(Pt=0,Ft={}),Pt++,Ft[i]=s),s):xt(r);case"object":case"function":return function(t){var e;if(Tt&&void 0!==(e=At.get(t)))return e;if(void 0!==(e=t[It]))return e;if(!vt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[It]))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=Mt(),Tt)At.set(t,e);else{if(void 0!==bt&&!1===bt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(vt)Object.defineProperty(t,It,{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[It]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[It]=e}}return e}(r);case"symbol":return function(t){var e=wt[t];return void 0!==e||(e=Mt(),wt[t]=e),e}(r);default:if("function"==typeof r.toString)return xt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function St(t){return null===t?1108378658:1108378659}function xt(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===O||t.done?t:U(e,a-1,e===z?void 0:t.value[1],t)}))},l}function Gt(t,e,i,s){var r=qt(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(R,n),a=!0,l=0;return new H((function(){var t,n,u;do{if((t=h.next()).done)return s||r===O?t:U(r,l++,r===z?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===R?t:U(r,n,u,t)}))},r}function Ht(t,e,i){var s=qt(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 Yt(t,e,i,s){var r=qt(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(O,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=w(t),j(r?t.reverse():t)})),o=0,h=!1;return new H((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}:U(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function jt(t,e){return t===e?t:P(t)?e:t.constructor(e)}function Jt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function $t(t){return v(t)?E:A(t)?I:C}function qt(t){return Object.create((v(t)?Z:A(t)?Q:tt).prototype)}function Kt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):K.prototype.cacheResult.call(this)}function Zt(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 Ae(this,e,t)}function Ae(t,e,i){for(var s=[],r=0;r0;)e[i]=arguments[i+1];return ke(t,e)}function we(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return ke(e,i,t)}function Ee(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Ce(t,e)}function Ie(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 ke(t,e,function(t){return function e(i,s,r){return ne(i)&&ne(s)&&(n=s,o=K(i),h=K(n),A(o)===A(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(_(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?I:E,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=$.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 Be(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,qe(),(function(t){return ke(t,e)}))}function _e(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,qe(),(function(t){return Ce(t,e)}))}function Le(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function De(){return this.__ownerID?this:this.__ensureOwner(new l)}function ze(){return this.__ensureOwner()}function Oe(){return this.__altered}var Re=function(t){function e(e){return null==e?qe():ut(e)&&!D(e)?e:qe().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 qe().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 Ke(this,t,e)},e.prototype.remove=function(t){return Ke(this,t,h)},e.prototype.deleteAll=function(t){var e=w(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):qe()},e.prototype.sort=function(t){return Mi(Ut(this,t))},e.prototype.sortBy=function(t,e){return Mi(Ut(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 Ye(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?$e(this.size,this._root,t,this.__hash):0===this.size?qe():(this.__ownerID=t,this.__altered=!1,this)},e}(E);Re.isMap=ut;var Ve=Re.prototype;Ve[lt]=!0,Ve[s]=Ve.remove,Ve.removeAll=Ve.deleteAll,Ve.setIn=ye,Ve.removeIn=Ve.deleteIn=pe,Ve.update=xe,Ve.updateIn=be,Ve.merge=Ve.concat=ve,Ve.mergeWith=Me,Ve.mergeDeep=Pe,Ve.mergeDeepWith=Fe,Ve.mergeIn=Be,Ve.mergeDeepIn=_e,Ve.withMutations=Le,Ve.wasAltered=Oe,Ve.asImmutable=ze,Ve["@@transducer/init"]=Ve.asMutable=De,Ve["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ve["@@transducer/result"]=function(t){return t.asImmutable()};var Ne=function(t,e){this.ownerID=t,this.entries=e};Ne.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 We(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},Ge.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 He(t,o+1,h)}(t,m,f,c,S);if(g&&!S&&2===m.length&&Qe(m[1^y]))return m[1^y];if(g&&S&&1===m.length&&Qe(S))return S;var x=t&&t===this.ownerID,b=g?S?f:f^d:f|d,v=g?S?ii(m,y,S,x):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},He.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=Ze(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 We(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=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?xi(t,e).set(0,i):xi(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=bi(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){xi(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=bi(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 Si(t,e){if(e>=bi(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&o],s-=r;return i}}function xi(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=bi(h),y=bi(u);y>=1<g?new ui([],s):m;if(m&&y>g&&ar;x-=r){var b=g>>>x&o;S=S.array[b]=pi(S.array[b],s)}S.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):Ai(s,r)}Mi.isOrderedMap=ct,Mi.prototype[L]=!0,Mi.prototype[s]=Mi.prototype.remove;var Ei="@@__IMMUTABLE_STACK__@@";function Ii(t){return Boolean(t&&t[Ei])}var Ci=function(t){function e(t){return null==t?Bi():Ii(t)?t:Bi().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&&Ii(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):Bi()},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?Bi():(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 H((function(){if(s){var e=s.value;return s=s.next,U(t,i++,e)}return{value:void 0,done:!0}}))},e}(I);Ci.isStack=Ii;var ki,Pi=Ci.prototype;function Fi(t,e,i,s){var r=Object.create(Pi);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Bi(){return ki||(ki=Fi(0))}Pi[Ei]=!0,Pi.shift=Pi.pop,Pi.unshift=Pi.push,Pi.unshiftAll=Pi.pushAll,Pi.withMutations=Le,Pi.wasAltered=Oe,Pi.asImmutable=ze,Pi["@@transducer/init"]=Pi.asMutable=De,Pi["@@transducer/step"]=function(t,e){return t.unshift(e)},Pi["@@transducer/result"]=function(t){return t.asImmutable()};var _i="@@__IMMUTABLE_SET__@@";function Li(t){return Boolean(t&&t[_i])}function Di(t){return Li(t)&&D(t)}function zi(t,e){if(t===e)return!0;if(!x(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)||A(t)!==A(e)||D(t)!==D(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!T(t);if(D(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 Oi(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 Ri(t){if(!t||"object"!=typeof t)return t;if(!x(t)){if(!ne(t))return t;t=K(t)}if(v(t)){var e={};return t.__iterate((function(t,i){e[i]=Ri(t)})),e}var i=[];return t.__iterate((function(t){i.push(Ri(t))})),i}var Vi=function(t){function e(e){return null==e?Wi():Li(e)&&!D(e)?e:Wi().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(E(t).keySeq())},e.intersect=function(t){return(t=w(t).toArray()).length?Gi.intersect.apply(e(t.pop()),t):Wi()},e.union=function(t){return(t=w(t).toArray()).length?Gi.union.apply(e(t.pop()),t):Wi()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Hi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Hi(this,this._map.remove(t))},e.prototype.clear=function(){return Hi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Hi(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 Ki=w.prototype;Ki[S]=!0,Ki[G]=Ki.values,Ki.toJSON=Ki.toArray,Ki.__toStringMapper=oe,Ki.inspect=Ki.toSource=function(){return this.toString()},Ki.chain=Ki.flatMap,Ki.contains=Ki.includes,Oi(E,{flip:function(){return jt(this,zt(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 Zi=E.prototype;Zi[b]=!0,Zi[G]=Ki.entries,Zi.toJSON=qi,Zi.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Oi(I,{toKeyedSeq:function(){return new Bt(this,!1)},filter:function(t,e){return jt(this,Vt(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,Rt(this,!1))},slice:function(t,e){return jt(this,Nt(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,Ht(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=Ki.includes,ts.contains=ts.includes,ts.keys=ts.values,Oi(Z,Zi),Oi(Q,Qi),Oi(tt,ts);var ls=function(t){function e(t){return null==t?fs():Di(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(E(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Vi);ls.isOrderedSet=Di;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(Ti()))}cs[L]=!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},ys=function(t,e){var i;!function(t){if(B(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(_(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 Ts(t,e,i,s,r,n){if("string"!=typeof i&&!_(i)&&(q(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,K(i).map((function(s,n){return Ts(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function ws(t,e){return A(e)?e.toList():v(e)?e.toMap():e.toSet()}var Es="4.3.5",Is=w;const Cs={version:Es,Collection:w,Iterable:w,Seq:K,Map:Re,OrderedMap:Mi,List:ai,Stack:Ci,Set:Vi,OrderedSet:ls,PairSorting:gs,Record:ys,Range:Yi,Repeat:Ms,is:ft,fromJS:As,hash:pt,isImmutable:_,isCollection:x,isKeyed:v,isIndexed:A,isAssociative:T,isOrdered:D,isValueObject:dt,isPlainObject:re,isSeq:P,isList:hi,isMap:ut,isOrderedMap:ct,isStack:Ii,isSet:Li,isOrderedSet:Di,isRecord:B,get:ae,getIn:ji,has:he,hasIn:$i,merge:Te,mergeDeep:Ee,mergeWith:we,mergeDeepWith:Ie,remove:ue,removeIn:me,set:ce,setIn:ge,update:Se,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}l(){return this.o}}class l extends a{constructor(t,e){super(),this.u=t,this.o=e}S(t){return t!==this.u&&(this.u=t,this.o=!0),this}M(){return this.u}l(){return super.l()}}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:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(s)}),p=(t,e=!0)=>new l(t,e),S=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),x=S,b=(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 M extends v{constructor(t){super(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._||(this._=new M({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._}getLighter(){return this.C||(this.C=new M({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.C}getDarker(){return this.T||(this.T=new M({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.T}toRGBAString(){return`rgba( ${255*this.r}, ${255*this.g}, ${255*this.b}, ${255*this.a} )`}}const A=t=>!(!t||"object"!=typeof t||!("type"in t)||"color"!==t.type),T=(t,e,i,s=255)=>new M({r:t/255,g:e/255,b:i/255,a:s/255}),w=t=>{const e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new M({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 M({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 M({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 M({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}`)}},E=(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 M({r:s,g:r,b:n})},I={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"},C=new M({}),k=T(0,0,0,0),P=(t,e)=>t.value-e.value,F=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:T(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1}),B=t=>{const{steps:e}=t,i=e.length;e.sort(P);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 F{constructor(t){super(((t,e)=>({steps:t.steps,title:t.title,units:t.units,interpolate:t.interpolate,color:t.color,length:e.length,min:e.min,max:e.max,subranges:e.subranges,isValid:e.isValid}))(t,B(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.map((t=>`${t.value},${t.color.toString()}`)).join(",")}`}setSteps(t){return this.merge(B({...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")}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 M({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 L=s.Record({type:"fillstyle",fillType:"empty"});class D extends L{toString(){return"emptyFill"}}const z=new D,O=s.Record({type:"fillstyle",fillType:"solid",color:T(255,255,255)});class R extends O{}class V extends R{constructor(t){super({...t,fillType:"solid"})}toString(){return`solidFill:${this.color.toString()}`}setColor(t){return A(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 N=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType);class G extends R{constructor(t){super({...t,fillType:"individual"})}toString(){return`individualPointFill:${this.color.toString()}`}setFallbackColor(t){return A(t)?this.set("color",t):this.set("color",t(this.get("color")))}getFallbackColor(){return this.get("color")}}const H=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),U=s.Record({type:"fillstyle",fillType:"palette",lut:new _({steps:[]}),lookUpProperty:"value"}),W=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),X={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.I)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.D=n,this.eases=t.map((([t,e])=>s(t,e,i)))}O(){this.P.emit("start")}start(){return this.D.includes(this)||this.D.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 Y(t,e,i,s,this.D);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.P.on("start",t,e)}onAnimationEnd(t,e){return this.P.on("end",t,e)}onEveryAnimationEnd(t,e){return this.P.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.P.on("allEnd",t,e)}allOffAnimationEnd(){return this.P.topicOff("end"),this}allOffEveryAnimationEnd(){return this.P.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.P.topicOff("allEnd"),this}offAnimationEnd(t){return this.P.off(t,"end")}offEveryAnimationEnd(t){return this.P.off(t,"everyEnd")}offAllAnimationEnd(t){return this.P.off(t,"allEnd")}finish(t=!0){if(this.I=!0,this.D.splice(this.D.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.P.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.P.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.P.emit("end",e),this.P.emit("everyEnd",e)),e}t&&(this.P.emit("end",void 0),this.P.emit("everyEnd",void 0),this.P.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.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=xt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=X.linear)=>(r,n,h=t)=>{const a=new Y(r,n,h,e,i).start();return s||(s=xt.requestAnimationFrame(o)),a}};var J,$;e.GradientShape=void 0,(J=e.GradientShape||(e.GradientShape={})).circle="circle",J.ellipse="ellipse",e.GradientExtent=void 0,($=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",$.closestCorner="closest-corner",$.farthestSide="farthest-side",$.farthestCorner="farthest-corner";const q=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class K 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 Z=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),Q=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],angle:0});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("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?fi(t):t)}getAngle(t){return t?di(this.get("angle")):this.get("angle")}}const et=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),it=s.Record({type:"linestyle",lineType:"empty"}),st=new class extends it{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}L(){return 0}setFillStyle(t){return this}getFillStyle(){return z}};class rt{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new nt,this.y=new nt,this.z=new nt,this.P=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Oe,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(Oe,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.N(e),s.y.N(r)}}}G(){return this.V&&(this.V(),this.V=void 0),this}W(t){return this.P.on("cell-resize",t)}H(t){return this.P.off(t,"cell-resize")}}class nt extends a{constructor(){super(...arguments),this.U=0,this.$=10,this.j=1}Y(){return this.o=!1,this}X(){return this.o=!0,this}getInnerStart(){return this.U}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}Z(t,e){return this.U=t,this.$=e,this.K(),this}q(t){return this.j=t,this.K(),this}J(t){return t/this.j}K(){const t=this.J(this.$-this.U),e=this.j;void 0!==this.tt&&!1!==It(t,this.tt)||(this.o=!0,this.it=e,this.tt=t)}st(){return this.tt}et(){return this.it}ht(){return this.$new t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).nt({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new rt({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},ht=(t,e,i)=>e===i?t:i.ot(e.ut(t)),at=(t,e,i)=>{if(e===i)return t;const s=e instanceof Bi?e.x:e.x instanceof Bi?e.x.x:e.x.ct,r=e instanceof Bi?e.y:e.y instanceof Bi?e.y.y:e.y.ct,n=i instanceof Bi?i.x:i.x instanceof Bi?i.x.x:i.x.ct,o=i instanceof Bi?i.y:i.y instanceof Bi?i.y.y:i.y.ct;return{...t,x:ht(t.x,s,n),y:ht(t.y,r,o)}},lt=(...t)=>{if(0===t.length)return{remove:Et};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.dt(s,r,!1,!1,"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 ut{constructor(t){this.ft=t,this.yt=new Map}St(t){const e=this.yt.get(t);return e&&e.length>0?e[0]:void 0}xt(t){let e=this.yt.get(t.lut);e?e.push(t):(e=[t],this.yt.set(t.lut,e))}bt(t){const e=this.yt.get(t.lut);if(e){const i=e.indexOf(t);i>=0&&e.splice(i,1),0===e.length&&(this.ft.deleteTexture(t.texture),this.yt.delete(t.lut))}}vt(){this.yt.forEach((t=>{var e;const i=null===(e=t[0])||void 0===e?void 0:e.texture;i&&this.ft.deleteTexture(i)})),this.yt.clear()}}const ct=t=>new ut(t);class dt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,dt.prototype)}}class ft extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&xt.alert(s),Object.setPrototypeOf(this,ft.prototype)}}class gt extends ft{constructor(t){super(t),Object.setPrototypeOf(this,gt.prototype)}}var yt,mt,pt,St;e.UISpace=void 0,(yt=e.UISpace||(e.UISpace={}))[yt.Content=0]="Content",yt[yt.PaddedContent=1]="PaddedContent",yt[yt.PaddedBackground=2]="PaddedBackground",yt[yt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(mt=e.UIVisibilityModes||(e.UIVisibilityModes={}))[mt.never=0]="never",mt[mt.always=1]="always",mt[mt.whenHovered=2]="whenHovered",mt[mt.whenDragged=3]="whenDragged",mt[mt.whenNotDragged=4]="whenNotDragged",mt[mt.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(pt=e.UIDraggingModes||(e.UIDraggingModes={}))[pt.notDraggable=0]="notDraggable",pt[pt.draggable=1]="draggable",pt[pt.onlyHorizontal=2]="onlyHorizontal",pt[pt.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(St=e.UIDirections||(e.UIDirections={}))[St.Up=0]="Up",St[St.Right=1]="Right",St[St.Down=2]="Down",St[St.Left=3]="Left";const xt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},bt=(t,e)=>t.x===e.x&&t.y===e.y,vt=t=>t!==ke&&t!==Pe&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Mt=(t,e)=>Math.min(t,e.y),At=(t,e)=>Math.max(t,e.y),Tt=t=>t[1],wt=t=>t.dispose(),Et=()=>{},It=(t,e)=>t===e,Ct=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),kt=t=>Array.prototype.concat.apply([],t),Pt=(t,e)=>{const{x:i,y:s}={x:t[0].length,y:t.length},{column:r,row:n}=e,o=Math.max(0,r.start),h=Math.min(i,r.end),a=Math.max(0,n.start),l=Math.min(s,n.end),u=h-o,c=l-a,d=Array.from(Array(c)).map((()=>Array(u)));for(let e=a,i=0;e{const i=e&&void 0!==e.row.start?e.row.start:0,s=e&&void 0!==e.row.end?e.row.end:t.y,r=e&&void 0!==e.column.start?e.column.start:0,n=e&&void 0!==e.column.end?e.column.end:t.x;return[Math.min(i,s),Math.max(i,s),Math.min(r,n),Math.max(r,n)]},Bt=(t,e)=>{for(;e;)t.push(t.shift()),e-=1},_t=t=>{const e=[];for(const i of t)e.push(i.slice());return e},Lt=(t,e)=>void 0!==t?t:e,Dt=t=>t.Mt(),zt=t=>t._t(),Ot=t=>t.At(),Rt=t=>t.wt(),Vt=t=>t.min.x,Nt=t=>t.max.x,Gt=t=>t.min.y,Ht=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,Xt=u(0,1),Yt=u(1,0),jt=u(0,-1),Jt=u(-1,0),$t=u(0,0),qt=t=>{switch(t){case e.UIDirections.Up:return Xt;case e.UIDirections.Right:return Yt;case e.UIDirections.Down:return jt;case e.UIDirections.Left:return Jt;default:return $t}},Kt=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Zt=t=>{t.stopPropagation(),t.preventDefault()},Qt=(t,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)},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;igi(ni(t,i))-gi(ni(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:T(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=T(0,0,0);return i=>(i=le(i),new K({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(N(t)){if(0===t.getColor().getA())return;return t.getColor()}if(Z(t)||et(t)){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}W(t)}};return(e,i,s)=>{const r=[];if(s.fill&&r.push(s.fill),s.fill2&&r.push(s.fill2),s.stroke){const t=s.stroke.getFillStyle();t!==z&&r.push(t)}if(s.point3D){const t=s.point3D;r.push(t.getFillStyle())}let n;if(s.behavior&&!0===s.behavior.colorStep){const[e,s]=r.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]);n=e&&s?(o=e)===(h=s)||o.getR()===h.getR()&&o.getG()===h.getG()&&o.getB()===h.getB()?ue(o):(o=le(o),h=le(h),new tt({angle:0,stops:[{offset:0,color:h},{offset:.5,color:h},{offset:.5,color:o},{offset:1,color:o}]})):i.uiButtonFillStyle}else{const e=r.reduce(((e,i)=>e||t(i)),void 0);n=e?ue(e):i.uiButtonFillStyle}var o,h;e.setButtonOffFillStyle(new V({color:T(255,255,255,0)})).setButtonOffStrokeStyle(i.uiButtonStrokeStyle).setButtonOnFillStyle(n).setButtonOnStrokeStyle(st)}})(),de=t=>{const e=t;if(W(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(),Se=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new V({color:T(255,255,255,1)});const xe=t=>t===Fe||t.min.x===Fe.min.x&&t.max.x===Fe.max.x&&t.min.y===Fe.min.y&&t.max.y===Fe.max.y,be=t=>Array.from(new Set(t)),ve=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,Me=(t,e)=>{throw new Error(e)},Ae=()=>{const t=j((()=>{}));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)||X.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)}},Te=t=>{let e;return()=>e||(e=t(),e)},we=t=>{if(t===st)return 0;const e=t.getThickness();return e<0?1:1*e},Ee=(t,e,i,s)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please find the FAQ from API documentation at below link:\nhttps://lightningchart.com/js-charts/api-documentation/\nand read section "What is LightningChart JS Resources not found error?"`;if(s.shouldCrash)throw xt.alert(r),new Error(r);xt.console.warn(r)},Ie={left:0,right:0,top:0,bottom:0},Ce={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=>Ce.divide(t,Ce.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(Ce.dot(t,e)/(Ce.length(t)*Ce.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=Ce.dot(e,t),o=Ce.cross(e,t);return Ce.addVec(Ce.multiply(t,s),Ce.addVec(Ce.multiply(e,(1-s)*n),Ce.multiply(o,r)))},lerp:(t,e,i)=>(i=Ct(i,0,1),Ce.addVec(Ce.multiply(t,1-i),Ce.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)})},ke=Number.MAX_SAFE_INTEGER,Pe=-Number.MAX_SAFE_INTEGER,Fe=y(u(ke,ke),u(Pe,Pe)),Be=y(f(ke,ke,ke),f(Pe,Pe,Pe)),_e=(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))},Le=(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),ze=(t,e)=>y(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,e)=>e+t,Re=(t,e,i)=>{const s=ni(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=ni(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)},Ve=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,Ne=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},Ge=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},He=(t,e,i)=>{const s=Ge(e,i);if(0===s)return[Ge(t,e),e];let r=li(ni(t,e),ni(i,e))/s;r=Math.max(0,Math.min(1,r));const n=u(e.x+r*(i.x-e.x),e.y+r*(i.y-e.y));return[Ge(t,n),n]},Ue=(t,e,i)=>ri(t,si(ni(e,t),i)),We=(t,e,i)=>Ce.addVec(t,Ce.multiply(Ce.subtractVec(e,t),i));function Xe(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:ke,y:ke},max:{x:Pe,y:Pe}};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},Je=(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 $e(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}const qe=(t,e,i,s)=>u((t.x+e.x+i.x+s.x)/4,(t.y+e.y+i.y+s.y)/4),Ke=(t,e,i,s,r)=>{if(e.x>i.x)if(e.x>s.x)if(e.x>r.x){if(t.x>e.x)return!1;if(r.xr.x)return!1;if(s.xr.x){if(t.x>s.x)return!1;if(r.xr.x)return!1;if(t.xs.x)if(i.x>r.x){if(t.x>i.x)return!1;if(r.xr.x)return!1;if(s.xr.x){if(t.x>s.x)return!1;if(r.xr.x)return!1;if(s.xi.y)if(e.y>s.y)if(e.y>r.y){if(t.y>e.y)return!1;if(r.yr.y)return!1;if(s.yr.y){if(t.y>s.y)return!1;if(r.yr.y)return!1;if(t.ys.y)if(i.y>r.y){if(t.y>i.y)return!1;if(r.yr.y)return!1;if(s.yr.y){if(t.y>s.y)return!1;if(r.yr.y)return!1;if(s.y{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},ci=(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 di(t){return t*Math.PI/180}function fi(t){return 180*t/Math.PI}function gi(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function yi(t){return u(Math.cos(t),Math.sin(t))}function mi(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 pi=(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)},Si=(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 xi{constructor(){this.kt=!0}getInnerStart(){return this.U}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.$-this.U)}Z(t,e){return this.U=t,this.$=e,this}Y(){return this.kt=!1,this}X(){return this.kt=!0,this}}class bi extends xi{constructor(t,e,i,s){if(super(),this.Ct=!0,this.Tt=!0,this.Ft=[0,0],this.It=!0,this.Pt=t,this.Dt=e,this.Bt=i,this.Ot=t,this.Lt=e,s){const t=s.R(this.Rt.bind(this));this.Rt(s.M()),this.Et=()=>s.N(t)}}q(t){return this.j=t,this.Tt=!0,this}zt(t){return this.Ft=t.map(Math.abs),this.It=!0,this}Vt(){return this.Pt/this.Bt*this.j+this.Ft[0]}Nt(){return(this.Pt+this.Dt)/this.Bt*this.j-this.Ft[1]}Gt(){return this.getCellSize()-this.Wt()}Ht(){return this.j}getCellSize(){return this.Ut(this.j)}Wt(){return this.Ft[0]+this.Ft[1]}$t(){return this.Ft}Rt(t){this.Bt=t.reduce(Oe,0),this.Pt=t.reduce(((t,e,i)=>i>=this.Ot?t:t+e),0),this.Dt=t.reduce(((t,e,i)=>i>=this.Ot&&iwi;return!n&&!o||!!r&&(e>t?{start:n?Ti:t,end:o?wi:e}:{start:o?wi:t,end:n?Ti:e})}ut(t){const e=this.Vt(),i=this.Nt(),s=Math.max(t,Ti);return e+(this.Yt.function(s)-this.Xt.scaleStartLog)/this.Xt.scaleIntervalLog*(i-e)}ot(t){const e=this.Vt(),i=(t-e)/(this.Nt()-e),s=this.Xt.scaleStartLog+i*this.Xt.scaleIntervalLog;return this.Yt.number**s}jt(){this.Yt&&this.Zt()}Z(t,e){return super.Z(t,e),this.Yt&&this.Zt(),this}zt(t){return super.zt(t),this.Yt&&this.Zt(),this}q(t){return super.q(t),this.Yt&&this.Zt(),this}Kt(t){return this.Yt={internal:t,function:Mi(t),number:Ai(t)},this}qt(){return this.Yt.internal}Jt(t,e){const i=this.ut(t)+e;return this.ot(i)}Qt(){return this.Tt||this.kt||this.It||this.Ct}Zt(){const t=this.Yt.function(this.U),e=this.Yt.function(this.$)-t,i=2*this.Vt()/this.j-1,s=2*this.Nt()/this.j-1-i;return this.Xt={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.Xt}ti(){return this.Xt}}const Mi=t=>"e"===t?re:se(t),Ai=t=>"e"===t?Math.E:t,Ti=.9*1e-9,wi=1.1*10**32,Ei=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],Ii=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-_e(s,10),0);return t.toFixed(r)},Ci={Numeric:(t,e)=>Ii(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 Ei){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=_e(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-_e(i,10)):"")}return r+=n,r}},ki=(t,e)=>{const i=Mi(e);return"e"===e?t?(t,e)=>`${Math.floor(i(t))}e`:()=>"":(t,e)=>{const s=t.toString();if(t>1)return s;const r=Math.floor(i(t));return t.toFixed(Math.abs(r))}};class Pi extends bi{constructor(t,e,i,s){super(t,e,i,s),this.ii=!1,this.si=!1,this.ei=0,this.j=1e3,this.Z(0,10),this.K()}Qt(){return this.si}rt(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.ii){const i=((t,e,i)=>{const s=((t,e)=>{if(ePe&&tPe){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}}jt(){this.K()}ut(t){return this.Vt()+(t-this.U)/(this.$-this.U)*(this.Nt()-this.Vt())}ot(t){return this.U+(t-this.Vt())/(this.Nt()-this.Vt())*(this.$-this.U)}Z(t,e){return super.Z(t,e),this.K(),this}zt(t){return super.zt(t),this.K(),this}q(t){return super.q(t),this.hi=Fi(this.$-this.U,this.Ft,this.j,this.Dt,this.Bt),this.K(),this}ri(){return this.ii=!0,this}ni(){return this.ii}oi(){return Math.abs(this.ai)}li(){return this.oi()/this.hi}ui(){return this.ci}di(){return this.fi}getPixelSize(){return this.hi}ti(){return this.Xt}X(){return super.X(),this.si=!0,this}Y(){return super.Y(),this.si=!1,this}gi(t,e=Ci.Numeric){return e(t,this)}pi(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}mi(t){return Fi(t,this.Ft,this.j,this.Dt,this.Bt)}K(){let t=this.U,e=this.$,i=0;this.ii&&(t=0,e=this.$-this.U,i=this.U);const s=e-t,r=Fi(s,this.Ft,this.j,this.Dt,this.Bt);this.fi=t-this.Ft[0]*r,this.ci=e+this.Ft[1]*r;const n=this.ci-this.fi,o=n-this.ai,h=Math.abs(o/r),a=s-this.ei,l=Math.abs(a/r);(!this.Xt||h>=.4||l>=.4)&&(this.ei=s,this.ai=n,this.hi=r,this.si=!0);const u=this.ai*this.Bt/(2*this.Dt),c=-(this.fi-this.ai*this.Pt/this.Dt)-u,d=2*this.Vt()/this.j-1,f=2*this.Nt()/this.j-1-d;this.Xt={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}Jt(t,e){return t+this.hi*e}}const Fi=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Bi{yi(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}Y(){return this.x.Y(),this.y.Y(),this}X(){return this.x.X(),this.y.X(),this}q(t,e){return"object"==typeof t?(this.x.q(t.x),this.y.q(t.y)):(this.x.q(t),this.y.q(e)),this}Ht(){return u(this.x.Ht(),this.y.Ht())}Si(t){return this.x.zt(t),this}xi(t){return this.y.zt(t),this}Wt(){return u(this.x.Wt(),this.y.Wt())}bi(t,e){return this.x.Z(t,e),this}vi(t,e){return this.y.Z(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.Wt(),y:e-this.y.Wt()}}Mi(){return this.x.Qt()||this.y.Qt()}}class _i extends Bi{constructor(){super(...arguments),this._i="LinearScaleXY"}nt(t,e,i,s){return this.x=new Pi(t.x,e.x,i.x,s?s.x:void 0),this.y=new Pi(t.y,e.y,i.y,s?s.y:void 0),this}ni(){return this.x.ni()||this.y.ni()}Ai(){return u(this.x.getPixelSize(),this.y.getPixelSize())}ti(){return{x:this.x.ti(),y:this.y.ti()}}Jt(t,e){const i=this.Ai();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}wi(t,e,i,s){const r=this.Ai(),n=ei(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 Li extends Bi{constructor(){super(...arguments),this._i="MixedScaleXY"}ni(){return!1}Jt(t,e){const i=this.x.ut(t.x),s=this.y.ut(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.ot(r.x),y:this.y.ot(r.y)}}wi(t,e,i,s){const r={x:this.x.ut(t.x),y:this.y.ut(t.y)},n={x:this.x.ut(e.x),y:this.y.ut(e.y)},o=ti(ni(n,r)),h=ei(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.ot(a.x),y:this.y.ot(a.y)}}ti(){const t=this.x.ti(),e=this.y.ti();return{uScaleStart:[this.x.U,this.y.U],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 Di=(t,e)=>t instanceof vi||e instanceof vi?(new Li).yi(t,e):(new _i).yi(t,e),zi=t=>"client"===t,Oi=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),Ri=t=>"relative"===t,Vi=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y);var Ni;e.HighlightModes=void 0,(Ni=e.HighlightModes||(e.HighlightModes={}))[Ni.noHighlighting=0]="noHighlighting",Ni[Ni.onHover=1]="onHover";class Gi{constructor(t,i,s,n){this.ki=!0,this.Ci=e.HighlightModes.onHover,this.Ti=!1,this.Fi=!0,this.Ii=!1,this.P=new r.Eventer,this.Pi=[],this.Di=[],this.Bi=(t,e)=>{this.setVisible(e)},this.Oi=()=>this.setHighlight(1),this.Li=()=>this.setHighlight(0),this.onMouseEnter=t=>this.P.on("mouseEnter",t),this.onMouseLeave=t=>this.P.on("mouseLeave",t),this.onMouseClick=t=>this.P.on("mouseClick",t),this.onMouseDoubleClick=t=>this.P.on("mouseDoubleClick",t),this.onMouseDown=t=>this.P.on("mouseDown",t),this.onMouseUp=t=>this.P.on("mouseUp",t),this.onMouseMove=t=>this.P.on("mouseMove",t),this.offMouseEnter=t=>this.P.off(t,"mouseEnter"),this.offMouseLeave=t=>this.P.off(t,"mouseLeave"),this.offMouseClick=t=>this.P.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.P.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.P.off(t,"mouseDown"),this.offMouseUp=t=>this.P.off(t,"mouseUp"),this.offMouseMove=t=>this.P.off(t,"mouseMove"),this.offMouseDragStart=t=>this.P.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.P.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.P.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.P.off(t,"mouseWheel"),this.Ri=(t,i,s)=>{this.P.emit("mouseEnter",this,i),this.Ii=!0,this.Ci===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Ei=(t,i,s)=>{this.P.emit("mouseLeave",this,i),this.Ii=!1,this.Ci===e.HighlightModes.onHover&&this.setHighlight(!1)},this.zi=(t,e,i)=>{this.P.emit("mouseMove",this,e)},this.Vi=(t,e,i)=>this.P.emit("mouseClick",this,e),this.Ni=(t,e,i)=>this.P.emit("mouseDoubleClick",this,e),this.Gi=(t,e,i)=>this.P.emit("mouseDown",this,e),this.Wi=(t,e,i)=>this.P.emit("mouseUp",this,e),this.Hi=(t,e,i,s)=>{this.P.emit("mouseDragStart",this,e,i)},this.Ui=(t,e,i,s,r,n)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.$i=(t,e,i,s,r)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.ji=(t,e,i)=>{this.P.emit("mouseWheel",this,e)},this.Yi=(t,i,s)=>{this.P.emit("touchStart",this,i),this.Ii=!0,this.Ci===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Xi=(t,e,i)=>{this.P.emit("touchMove",this,e)},this.Zi=(t,i,s)=>{this.P.emit("touchEnd",this,i),this.Ii=!1,this.Ci===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Ki=t,this.qi=i,this.Ji=s,this.Qi=new Map,this.ts=n,this.ss=this.ts.es(this,{hs:{themeEffectEnabled:this.Ji.effectsText},rs:{}}),this.Ki.ls.os.ns(this,(t=>{this.Qi.forEach(((e,i)=>i.us(t))),this.Di.forEach((e=>e.setHighlight(t))),this.Pi.forEach((e=>e.us(t)))}),{animationEnabled:this.Ki.getAnimationsEnabled()})}cs(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.ds(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.ss.rs.ds(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.ki).setVisible(this.Fi).us(this.Ki.ls.os.fs(this,!0)),i&&t.setMouseEnterEventHandler(this.Ri).setMouseLeaveEventHandler(this.Ei).setMouseClickEventHandler(this.Vi).setMouseDoubleClickEventHandler(this.Ni).setMouseDownEventHandler(this.Gi).setMouseUpEventHandler(this.Wi).setMouseMoveEventHandler(this.zi).setMouseDragStartEventHandler(this.Hi).setMouseDragEventHandler(this.Ui).setMouseDragStopEventHandler(this.$i).setMouseWheelEventHandler(this.ji).setTouchStartEventHandler(this.Yi).setTouchMoveEventHandler(this.Xi).setTouchEndEventHandler(this.Zi);const n=t.onDispose((()=>{t.offDispose(n),this.Qi.delete(t)}))}gs(t){this.Pi=t;const e=this.Ki.ls.os.fs(this,!0);t.forEach((t=>{t.us(e).ps(this.Fi)}))}setEffect(t){return this.ss.hs.ys(t&&this.Ji.effectsText),this.ss.rs.ys(t),this.Ki.ls.Ss(),this}getEffect(){return this.ss.hs.xs()||this.ss.rs.xs()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setName(t){return this.bs=t,this.Di.forEach((t=>t.setText(this.bs))),this}getName(){return this.bs}dispose(){return this.Ti||(this.Ti=!0,this.Qi.forEach(((t,e)=>e.dispose())),this.qi(this),this.Di.forEach((t=>{t.dispose()})),this.Di.length=0,this.P.emit("dispose",this),this.Ki.ls.Ss()),this}setVisible(t){return t===this.Fi||(this.Fi=t,this.Qi.forEach(((e,i)=>i.setVisible(t))),this.Pi.forEach((e=>e.ps(t))),this.Di.forEach((e=>e.setOn(t))),this.P.emit("visibleStateChanged",this,this.Fi),this.Ki.ls.Ss()),this}getVisible(){return this.Fi}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}setHighlight(t){return this.Ki.ls.os.vs(this,t),this.P.emit("highlight",t),this}getHighlight(){return this.Ki.ls.os.fs(this)}setAnimationHighlight(t){return this.Ki.ls.os.Ms(this,t),this}getAnimationHighlight(){return this.Ki.ls.os._s(this)}setMouseInteractions(t){return this.ki=t,this.Qi.forEach(((e,i)=>i.setMouseInteractions(t))),this.Ki.ls.Ss(),this}getMouseInteractions(){return this.ki}getIsUnderMouse(){return this.Ii}setHighlightOnHover(t){return this.Ci=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Ci!==e.HighlightModes.noHighlighting}attach(t,e=!0){t.setText(this.bs),t.setButtonOffStrokeStyle(t.getButtonOffStrokeStyle().setThickness(1)),t.setButtonOnStrokeStyle(t.getButtonOnStrokeStyle().setThickness(1));const i=t.getLocked();return t.setLocked(!1).setOn(this.getVisible()).setLocked(i),e&&t.onSwitch(this.Bi),t.setLocked(!e),t.onMouseEnter(this.Oi),t.onMouseLeave(this.Li),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),this.Di.push(t),this}onMouseDragStart(t){return this.P.on("mouseDragStart",t)}onMouseDrag(t){return this.P.on("mouseDrag",t)}onMouseDragStop(t){return this.P.on("mouseDragStop",t)}onMouseWheel(t){return this.P.on("mouseWheel",t)}onTouchStart(t){return this.P.on("touchStart",t)}onTouchMove(t){return this.P.on("touchMove",t)}onTouchEnd(t){return this.P.on("touchEnd",t)}onDispose(t){return this.P.on("dispose",t)}offTouchStart(t){return this.P.off(t,"touchStart")}offTouchMove(t){return this.P.off(t,"touchMove")}offTouchEnd(t){return this.P.off(t,"touchEnd")}offDispose(t){return this.P.off(t,"dispose")}}class Hi extends Gi{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.As=t,this.axis=s,this.ct=r,this.ws=n,this.ks()}}const Ui=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.Ps?(this.Is.splice(t,1),t-=1):this.Is[t].state&&(s=!0);return this.Fs?0===e.interactions.length&&(this.Is.push({state:!1,time:i}),this.Fs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Is.push({state:!0,time:i}),s=!0,this.Fs=!0),s}Ts(t,e,i){if(i){const i=this.Is.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Ds(t,e),this.Is.length=0)}}},Yi=class{constructor(t,e,i,s=1,r=100){this.Bs=t,this.Os=e,this.Ls=i,this.Rs=s,this.Es=r}Cs(t,e){const i=e.interactions.length;if(i===this.Rs){if(void 0!==this.zs)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=Ui(t);let s=0;for(let r=0;r!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class Ki{constructor(t,e){this.Hs=t,this.Us=e,this.$s=e.rows*Is,this.js=e.columns*Cs}}var Zi,Qi;e.OnScreenMenuButtonType=void 0,(Zi=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[Zi.ZoomIn=0]="ZoomIn",Zi[Zi.ZoomInX=1]="ZoomInX",Zi[Zi.ZoomInY=2]="ZoomInY",Zi[Zi.ZoomOut=3]="ZoomOut",Zi[Zi.ZoomOutX=4]="ZoomOutX",Zi[Zi.ZoomOutY=5]="ZoomOutY",Zi[Zi.ZoomToFit=6]="ZoomToFit",Zi[Zi.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(Qi=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[Qi.Circle=0]="Circle",Qi[Qi.Rectangle=1]="Rectangle",Qi[Qi.RoundedRectangle=2]="RoundedRectangle";const ts={x:-43,y:0},es={x:-65,y:0},is={x:-86,y:0},ss={x:-107,y:-1},rs={x:-128,y:-3},ns={x:-150,y:0},os={x:-171,y:0},hs={x:-276,y:0},as={x:-298,y:0},ls={x:0,y:0},us={x:-21,y:0};class cs extends Ki{constructor(t,e,i,s){super(t,i),this.Ys=xt.document.createElement("button"),this.Xs=xt.document.createElement("div"),this.Zs=xt.document.createElement("label"),this.Us=i,this.Ks=e,this.Ki=s}qs(t,e,i,s){this.Js(t,s),this.Qs(),this.te(e),this.ie(),this.Zs.textContent=i||"";const r=xt.document.createElement("div");this.se(r),this.Ys.onclick=this.onClick.bind(this),r.appendChild(this.Xs),r.appendChild(this.Zs),this.Ys.appendChild(r)}ie(){this.Ys.style.cursor="pointer"}se(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}te(t){"string"==typeof t?(this.Xs.style.backgroundImage=`url(${t})`,this.Xs.style.backgroundSize="100%",this.Xs.style.backgroundRepeat="no-repeat",this.Xs.style.backgroundPosition="center",this.Xs.style.width="20px",this.Xs.style.height="20px"):this.applyStyleForSprite(t),this.Xs.style.margin="auto"}Qs(){switch(this.Ks){case e.OnScreenMenuButtonShape.RoundedRectangle:this.Ys.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.Ys.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.Ys.style.borderRadius="31px"}}Js(t,e){this.Ys.style.width=`${this.js.toString()}px`,this.Ys.style.height=`${this.$s.toString()}px`,this.Ys.style.backgroundColor=t,this.Ys.style.opacity=e||ks,this.Ys.style.alignItems="center",this.Ys.style.border="2px solid #707070",this.Ys.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.Xs.style.backgroundImage=`url(${this.Hs}/${Ps})`,this.Xs.style.backgroundPositionX=`${t.x}px`,this.Xs.style.backgroundPositionY=`${t.y}px`,this.Xs.style.backgroundSize="1600%",this.Xs.style.backgroundRepeat="no-repeat",this.Xs.style.width="20px",this.Xs.style.height="20px"}ee(t){return t.appendChild(this.Ys),t}he(){return this.Ys}}class ds extends cs{constructor(t,e,i,s){super(t,e,i,s),this.re="",this.ne="",this.oe=!1,this.Ki=s}ae(){this.le(),this.onToggledStateAction()}ue(){this.ce(),this.onInitialStateAction()}ce(){this.de(this.re)}le(){this.de(this.ne)}de(t){"string"==typeof t?this.Xs.style.background=t:(this.Xs.style.backgroundImage=`url(${this.Hs}/${Ps})`,this.Xs.style.backgroundPositionX=`${t.x}px`,this.Xs.style.backgroundPositionY=`${t.y}px`)}onClick(){this.oe?this.ue():this.ae(),this.oe=!this.oe}}class fs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),ts)}onClick(){const t=this.Ki.fe();t&&this.Ki.zoom(t,{x:-1,y:-1})}}class gs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),ss)}onClick(){const t=this.Ki.fe();t&&this.Ki.zoom(t,{x:-1,y:0})}}class ys extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),ns)}onClick(){const t=this.Ki.fe();t&&this.Ki.zoom(t,{x:0,y:-1})}}class ms extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),es)}onClick(){const t=this.Ki.fe();t&&this.Ki.zoom(t,{x:1,y:1})}}class ps extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),rs)}onClick(){const t=this.Ki.fe();t&&this.Ki.zoom(t,{x:1,y:0})}}class Ss extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),os)}onClick(){const t=this.Ki.fe();t&&this.Ki.zoom(t,{x:0,y:1})}}class xs extends ds{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.re=hs,this.ne=as,this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),this.re)}onToggledStateAction(){this.Ki.setAnimationsEnabled(!1)}onInitialStateAction(){this.Ki.setAnimationsEnabled(!0)}}class bs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),is)}onClick(){this.Ki.forEachAxis((t=>{t.fit(!0)}))}}class vs extends cs{constructor(t,e,i){super(t,e.shape||Fs,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.qs(r,n,o,h),this.ge=e.action}onClick(){this.ge(this.Ki)}}class Ms extends ds{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.Ki=i,this.pe=s,this.re=us,this.ne=ls,this.qs(Bs,this.re)}ce(){this.de(this.re),this.Ys.style.backgroundColor=Bs,this.Ys.style.border="2px solid #707070",this.Ys.style.margin="0px"}le(){this.de(this.ne),this.Ys.style.background="#FECC00 0% 0% no-repeat padding-box",this.Ys.style.border="10px solid #BCBCBC12",this.Ys.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.pe)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.pe)||void 0===t||t.style.setProperty("display","none")}}var As;e.MouseStyles=void 0,(As=e.MouseStyles||(e.MouseStyles={})).Move="move",As.ResizeColumn="col-resize",As.ResizeRow="row-resize",As.Horizontal="ew-resize",As.Vertical="ns-resize",As.NorthWest="nw-resize",As.NorthEast="ne-resize",As.Copy="copy",As.CrossHair="crosshair",As.Default="default",As.Help="help",As.Restricted="not-allowed",As.None="none",As.Point="pointer",As.Text="text",As.Wait="wait",As.ZoomIn="zoom-in",As.ZoomOut="zoom-out";const Ts={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)},ws=new V({color:T(255,255,255,0)}),Es=new $i({thickness:1,fillStyle:ws}),Is=60,Cs=60,ks="1.0",Ps="osm/osm-sprite-transparent.png",Fs=e.OnScreenMenuButtonShape.Circle,Bs="#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 Ls extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.bs="Band",this.me=0,this.ye=0,this.Se=this.Ji.bandFillStyle,this.xe=this.Ji.bandStrokeStyle,this.be=this.As._e(this.ct).Me(this.Se).ve(this.xe).us(this.getHighlight()),this.cs(this.be)}setValueStart(t){return this.me=t,this.P.emit("valueChange",this,this.me,this.ye),this.As.Ss(),this}getValueStart(){return this.me}setValueEnd(t){return this.ye=t,this.P.emit("valueChange",this,this.me,this.ye),this.As.Ss(),this}getValueEnd(){return this.ye}setFillStyle(t){this.Se="function"==typeof t?t(this.Se):t;const e=this.Se;return this.be.Me(e),this.As.Ss(),this}getFillStyle(){return this.Se}setStrokeStyle(t){this.xe="function"==typeof t?t(this.xe):t;const e=this.xe;return this.be.ve(e),this.As.Ss(),this}getStrokeStyle(){return this.xe}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}Ae(){return this.be.we(this.ws.toVec2(this.me,this.ws.getHeight(this.ct).getInnerStart())).q(this.ws.toVec2(this.ye-this.me,this.ws.getHeight(this.ct).getInnerInterval())),this}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se,stroke:this.xe}),this}ke(t,e){t.us(e),this.As.Ss()}ks(){let t,i;const s=(e,s)=>{const r=at(this.As.ls.Ce(s.x,s.y),this.As.ls.ct,this.ct),n=this.ws.getWidth(r),o=this.axis.ct.ut(this.me),h=this.axis.ct.ut(this.ye),a=(this.axis.ct.ut(n)-o)/(h-o);t=!(a<.1||a>.9),!1===t&&(i=a<.5)},r=(e,s,r,n,o)=>{const h=this.ws.getWidth(n);t?(this.me=this.axis.ct.Jt(this.me,h),this.ye=this.axis.ct.Jt(this.ye,h)):i?this.me=this.axis.ct.Jt(this.me,h):this.ye=this.axis.ct.Jt(this.ye,h),Zt(o),this.P.emit("valueChange",this,this.me,this.ye),this.As.Ss()};this.onMouseMove(((i,r)=>{s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.ws.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Te=this.Ki.engine.setMouseStyle(n,this.Te)})),this.onMouseLeave((()=>{this.Ki.engine.restoreMouseStyle(this.Te),this.Te=void 0})),this.onMouseDrag(((t,e,i,s,n)=>{0===i&&r(0,0,0,n,e)}));const n=Wi(new Yi(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Ds extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.bs="Constant Line",this.u=0,this.xe=this.Ji.constantLineStrokeStyle,this.Fe=!0,this.Ie=this.As.De(this.ct).Pe(this.xe).us(this.getHighlight()),this.cs(this.Ie)}setValue(t){return this.u=t,this.P.emit("valueChange",this,this.u),this.As.Ss(),this}getValue(){return this.u}setStrokeStyle(t){this.xe="function"==typeof t?t(this.xe):t;const e=this.xe;return this.Ie.Pe(e),this.As.Ss(),this}getStrokeStyle(){return this.xe}setInteractionMoveByDragging(t){return this.Fe=t,this}getInteractionMoveByDragging(){return this.Fe}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}Ae(){return this.Ie.Oe(this.ws.toVec2(this.u,this.ws.getHeight(this.ct).getInnerStart())).Be(this.ws.toVec2(this.u,this.ws.getHeight(this.ct).getInnerEnd())),this}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{stroke:this.xe}),this}ke(t,e){t.us(e),this.As.Ss()}ks(){const t=(t,e)=>{this.Fe&&(this.u=this.axis.ct.Jt(this.u,this.ws.getWidth(e)),this.P.emit("valueChange",this,this.u),this.As.Ss(),Zt(t))};this.onMouseMove((()=>{if(this.Fe){const t=this.ws.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Te=this.Ki.engine.setMouseStyle(t,this.Te)}})),this.onMouseLeave((()=>{this.Fe&&(this.Ki.engine.restoreMouseStyle(this.Te),this.Te=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this.Fe&&0===s&&t(i,n)}));const i=Wi(new Yi(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},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)},regressive:{start:(t,e,i,s)=>e>t?ie>t?zs.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Le,Vs=t=>void 0!==t.Re,Ns={Ee:Ci.Numeric},Gs=(t,e)=>[t,e],Hs=(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},Xs=(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)}},Ys=(...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))}},js=(t,e)=>{if(e.has(t))return e.get(t);const i=Xe(t.Ve.ze());return e.set(t,i),i},Js=t=>{const e=new Map;if(t!==Ns){for(const i of t.Ne)e.set(i,new Map);for(const i of t.Ge)e.set(i,new Map)}return e};class $s{constructor(t,e,i,s,n,o,h){this.P=new r.Eventer,this.We=Ns,this.He=Os.Empty,this.Ue=new Map,this.$e=new Map,this.je=zs.fitting,this.Ye=!0,this.Xe=j((()=>this.chart.ls.Ss()))(300,X.linear),this.Ze=!0,this.Fi=!0,this.Ke=!1,this.qe=Pe,this.Je=!1,this.Qe=!1,this.th=Pe,this.ih=Pe,this.sh=Pe,this.eh={},this.hh=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.Ue.get(e),l=(t?t.get(a):void 0)||this.rh(a,e);l.oh=!1;const u=this.ah(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.lh=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.dh!==i||!!t.find((t=>t===e)))).map((t=>Le(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&&i.fh&&e.every((t=>Rs(t.dh)))&&(t=!1),t&&i.fh&&i.fh.gh&&!1===i.fh.gh(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.We.Ee(t,this.ct),this.ph=([t,e])=>{this.mh(t,e)},this.chart=t,this.yh=e,this.Ji=s,this.Sh=o,this.ct=i,this.xh=h,"logarithmic"===h.type&&this.setAnimationZoom(X.logarithmic(Ai(h.base))),this.bh=o.numeric,this.Mh("Numeric"),this._h=i.getInnerStart(),this.Ah=i.getInnerEnd(),n&&this.setAnimationsEnabled(!1)}getTitle(){return this.kh.wh()}setTitle(t){return this.kh.Ch(t),this.chart.ls.Ss(),this}getTitleFillStyle(){return this.kh.Th()}setTitleFillStyle(t){return this.kh.Me(t),this.chart.ls.Ss(),this}getTitleFont(){return this.kh.Fh()}setTitleFont(t){return this.kh.Ih(t),this.chart.ls.Ss(),this}setTitleRotation(t){return this.kh.Ph(t),this.chart.ls.Ss(),this}getTitleRotation(){return this.kh.Dh()}setTitleEffect(t){return this.Bh.ys(t),this.chart.ls.Ss(),this}getTitleEffect(){return this.Bh.xs()}Mh(t,e){if(this.Ue.size>0&&this.Oh(),"Empty"===t)this.We=Ns,this.He=t;else if("Numeric"===t){"Numeric"!==this.He&&(this.bh=this.Sh.numeric);const i=e||(t=>t);this.bh=i(this.bh),this.We=this.bh.Lh(this.xh),this.He=t}else if("DateTime"===t){"DateTime"!==this.He&&(this.bh=this.Sh.datetime);const i=e||(t=>t);this.bh=i(this.bh),this.We=this.bh.Lh(this.xh),this.He=t}else if("Time"===t){"Time"!==this.He&&(this.bh=this.Sh.time);const i=e||(t=>t);this.bh=i(this.bh),this.We=this.bh.Lh(this.xh),this.He=t}return this.$e.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.$e=Js(this.We),this.chart.ls.Ss(),this}Rh(){return this.We}Eh(t){this.We=t,this.$e.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.$e=Js(this.We),this.chart.ls.Ss()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.dt(void 0!==e?e:this._h,void 0!==i?i:this.Ah,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}dt(t,e,i=!1,s=!0,r){let n={start:t,end:e};const o=Math.abs(e-t);if(Math.abs(this.Ah-this._h),void 0!==this.We.zh&&this.We.zh>o){const i=(e+t)/2,s=this.We.zh/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.We.Vh&&this.We.Vhe?-1:1);n={start:i-s,end:i+s}}const h=this.ct.rt(n.start,n.end,this._h,this.Ah,!0);if(!1===h)return this;let a;switch(!0===h||(n=h),r){case"userSetInterval":case"userFit":case"interactionSetInterval":case"interactionZoom":a=!0;break;case"zoomBandChart":case"synchronizedAxis":a=!1;break;default:return Me(0,""),this}if(this.Nh&&this.Nh.finishAll(!1),this.Xe&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.Nh||this.Nh.isOver()?this.Xe:this.Nh.NextAnimation.bind(this);this.Nh=e([[this._h,n.start],[this.Ah,n.end]],this.ph,t),this.Nh.onAnimationEnd((()=>{this.Nh=void 0,a&&(this.sh=xt.performance.now())})),this.Nh.onAnimationEnd((()=>this.setStopped(s)))}else this.mh(n.start,n.end),s&&this.setStopped(!0),a&&(this.sh=xt.performance.now());return this}getInterval(){return{start:this._h,end:this.Ah}}setStopped(t){return t===this.Ke||(t&&(this.Nh&&this.Nh.finishAll(!1),this.Nh=void 0),this.Ke=t,this.P.emit("stoppedStateChanged",this,this.Ke),this.qe=xt.performance.now(),this.chart.ls.Ss()),this}getStopped(){return this.Ke}onStoppedStateChanged(t){return this.P.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.P.off(t,"stoppedStateChanged")}fit(t,e=!1){const i=this.Gh();if(i){const s=this.Ah>=this._h,r=s?i.min:i.max,n=s?i.max:i.min;this.dt(r,n,t,e,"userFit")}return this}setScrollStrategy(t){return this.je=t,this.chart.ls.Ss(),this}getScrollStrategy(){return this.je}setAnimationScroll(t){return this.Ye=Boolean(t),this.chart.ls.Ss(),this}setAnimationZoom(t,e=300){return this.Nh&&(this.Nh.finishAll(!1),this.Nh=void 0),this.Xe=t?j((()=>this.chart.ls.Ss()))(e,t):void 0,this}setAnimationsEnabled(t){return this.Ze=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(X.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.Ze}setVisible(t){const e=this.Fi!==t;return this.Fi=t,this.kh.setVisible(t),this.Wh((e=>{e.Ve.setVisible(t)})),e&&this.P.emit("visibleStateChanged",this,this.Fi),this}getVisible(){return this.Fi}onIntervalChange(t){return this.P.on("scaleChange",t)}offIntervalChange(t){return this.P.off(t,"scaleChange")}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}Hh(t,e){const i=new Map;if(this.We===Ns||!this.Fi)return this.Oh(),i;e=e||new Map;const s=this.Uh(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.eh.physicalAxisSize=h;const a=Ks(this.We,r,n,this._h,this.Ah,h),l=[];if(this.$h(),l.push(...this.jh(this.We,r,n,a,e,t,i)),this.Yh(this.We,r,n,a,e,t,l,i),this.Xh(),a)for(const[t,e]of this.$e){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.eh.min=r,this.eh.max=n,this.eh.scaleInterval=o,this.eh.physicalAxisSize=h,i}Zh(t){const e=t.dh.Kh;t.Ve.Ch(e(t.u,this.ct)).Ts()}qh(t,e){const i=e.Jh;t.Ve.Me(i.getLabelFillStyle()).Ih(i.getLabelFont()).Ph(i.getLabelRotation())}rh(t,e){const i=this.$e.get(e);let s=i.get(t);s?(i.delete(t),s.dh=e,s.ps(!0)):s=this.Qh(t,e);const r=this.Ue.get(e)||new Map;return r.set(t,s),this.Ue.set(e,r),this.qh(s,e),s}ah(t,e){const i=this.tr(t,e);return this.Zh(t),i}jh(t,e,i,s,r,n,o){const h=[];for(const a of t.Ne){const t=s.get(a);for(const s of t){if(si)continue;const t=this.Ue.get(a),l=(t?t.get(s):void 0)||this.rh(s,a),u=this.ah(l,n),c=js(l,r);h.find((t=>Le(c,js(t,r))))&&l.Ve.setVisible(!1),l.oh=!1,o.set(l,u),h.push(l)}}return h}Yh(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.Ge){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.fh){p=!1;break}const t=u.fh.ir;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const m=this.lh(y.filter((t=>a.some((e=>It(t.u,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.sr(e)}))}if(l=m,!p)break}}sr(t){const e=this.Ue.get(t.dh);null==e||e.delete(t.u);const i=this.$e.get(t.dh);i&&i.has(t.u)?t.dispose():i&&(t.ps(!1),i.set(t.u,t))}Wh(t){for(const e of this.Ue.values())for(const i of e.values())t(i)}er(t,e){for(const i of this.Ue.values())for(const s of i.values())e=t(e,s);return e}Oh(){this.Ue.forEach(((t,e)=>{t.forEach((t=>this.sr(t)))})),this.Ue.clear()}$h(){for(const t of this.Ue.values())for(const e of t.values())e.oh=!0}Xh(){for(const t of this.Ue.values())for(const[e,i]of t.entries())i.oh&&(i.dispose(),t.delete(e))}Uh(){const t=this.ct.getInnerStart()this.ct.getInnerStart()?this.ct.getInnerEnd():this.ct.getInnerStart();return y(t,e)}uh(t,e){return!(t.oh||0===t.Ve.wh().length||Rs(e)&&!0!==e.hr)}rr(t,e){return this.We===Ns||(this.We.Ne.forEach((i=>{e=t(e,i.Jh)})),this.We.Ge.forEach((i=>{(t=>void 0!==t.Kh)(i)&&(e=t(e,i.Jh))}))),e}Gh(){let t=this.yh.nr();const e=this.yh.ar();let i;if(void 0!==t&&vt(t)&&void 0!==e&&vt(e)&&("logarithmic"===this.xh.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&&vt(i.min)&&vt(i.max))return It(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}lr(){let t=0;const e=this.yh.ur();return e&&(t=Math.max(t,e)),t}cr(){const t=this.Je;let e=!1;if(this.je&&!this.Ke){const t=this.Gh();if(t){const i=this._h,s=this.Ah;let r=this.je.start(i,s,t.min,t.max),n=this.je.end(i,s,t.min,t.max);const o=!1===It(i,r),h=!1===It(s,n);if(r=o?r:i,n=h?n:s,o||h){let t=!1;if(this.Ye)if(this.Ye){t=!0;const a=o?this.dr(i,r):i,l=h?this.dr(s,n):s;if(!0===this.mh(a,l,{allowClamping:!1})&&(o&&!1===It(a,r)||h&&!1===It(l,n))){this.chart.ls.Ss(!0),e=!0;let t=Math.abs(n-r)/Math.abs(a-l);t<1&&(t=1/t),this.Qe=t>=1.4}}else t=!1;t||this.mh(r,n)}}}e?(this.Je!==e&&(this.Je=e,this.th=xt.performance.now()),this.gr&&(clearTimeout(this.gr),this.gr=void 0)):!0===t&&void 0===this.gr&&(this.Qe=!1,this.gr=setTimeout((()=>{!1!==this.Je&&(this.Je=!1,this.th=xt.performance.now()),this.gr=void 0,this.chart.ls.Ss()}),200))}mh(t,e,i){const s=!i||!("allowClamping"in i)||void 0===i.allowClamping||i.allowClamping;let r={start:t,end:e},n=!0;const o=Math.abs(e-t),h=Math.abs(this.Ah-this._h);if(void 0!==this.We.zh&&this.We.zh>o){const i=(e+t)/2,o=(s?this.We.zh/2:h/2)*(t>e?-1:1);r={start:i-o,end:i+o},n=!1}if(void 0!==this.We.Vh&&this.We.Vhe?-1:1);r={start:i-o,end:i+o},n=!1}let a=this.ct.rt(r.start,r.end,this._h,this.Ah,s);if(!1===a)return!1;!0!==a&&(r=a);const l=this.lr(),u=this.pr(Math.min(r.start,r.end),Math.max(r.start,r.end),l);return a=this.ct.rt(r.end>r.start?u.min:u.max,r.end>r.start?u.max:u.min,this._h,this.Ah,!1),!!a&&(!0===a?this.ct.Z(r.end>r.start?u.min:u.max,r.end>r.start?u.max:u.min):this.ct.Z(r.start,r.end),this._h=r.start,this.Ah=r.end,this.P.emit("scaleChange",this,r.start,r.end),this.ih=xt.performance.now(),this.chart.ls.Ss(),n)}mr(){return this.Je}yr(){return void 0!==this.Nh}}class qs{constructor(t,e,i,s,r=i.Sr(s).setMouseInteractions(!1)){this.oh=!1,this.Ti=!1,this.Qi=[],this.dh=t,this.u=e,this.br=i,this.vr=s,this.Ve=r,this.Qi.push(r)}ps(t){this.Qi.forEach((e=>e.setVisible(t)))}dispose(){return this.Ti||(this.Ti=!0,this.Qi.forEach((t=>t.dispose()))),this}}const Ks=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.Ne){let t=n.Mr(e,i,s,r);t=Zs(t),o.set(n,t)}let h;for(const s of t.Ge){let t;if(void 0===h)t=s.Mr(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._r&&s._r>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),Qs=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class tr extends Qs{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 er=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),ir=new tr,sr=new class{},rr=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new V,wireframeStyle:st});class nr extends rr{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 or=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),hr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new V});class ar extends hr{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 lr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),ur={Triangulated:nr,Pixelated:ar};class cr{constructor(t){this.Ar=new Map,this.ls=t}ns(t,e,i){const s=i.animationEnabled;this.Ar.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.Ar.delete(t),t.offDispose(r)}))}wr(t,e){const i=e.animationEnabled,s=[],r=t.onDispose((()=>{s.forEach((t=>{this.Ar.delete(t)})),t.offDispose(r)}));return{kr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Ar.set(t,r)}}}vs(t,e){const i=this.Ar.get(t);i&&(i.curUnanimatedHighlightValue=ve(e),this.ls.Ss())}fs(t,e=!1){const i=this.Ar.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}Ms(t,e){const i=this.Ar.get(t);i&&(i.animationEnabled=e)}_s(t){const e=this.Ar.get(t);return!!e&&e.animationEnabled}Ts(t){let e=!1;this.Ar.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.Ss(!0)}}const dr=new Map,fr=t=>{const e=t.getSize(),i=t.getFamily(),s=t.getWeight(),r=t.getStyle(),n=t.getVariant(),o=`${r} ${n?"small-caps":"normal"} ${s} ${e}px ${i}`;let h=dr.get(o);return h||(h=((t,e)=>({font:t,properties:e}))(o,{type:"font",size:e,family:i,style:r,variant:n,weight:s}),dr.set(o,h)),h};var gr,yr;!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"}(gr||(gr={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(yr||(yr={}));const mr=t=>({container:t.Cr,scale:t.ct,setMouseStyle:(e,i)=>t.Tr(e,i),restoreMouseStyle:e=>t.Fr(e),clientLocation2Engine:(e,i)=>t.Ce(e,i),engineLocation2Client:(e,i)=>t.Ir(e,i),captureFrame:(e,i)=>t.Pr(e,i),renderFrame:(e,i,s=!1)=>t.Dr(e,i,s),layout:()=>{t.Br(),t.Or()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.Lr(e,i)}),pr=[];let Sr;const xr=()=>{if(void 0!==Sr){const t=xt.getComputedStyle(xt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));Sr.style.height=xt.innerHeight-e+"px",(()=>{for(let t=0;tthis.Ss()),60),this.zr=u(0,0),this.Vr=void 0,this.Nr=Et,this.Gr=()=>{},this.Wr=[],this.Hr=-1,this.Ur=[],this.$r=!0,this.Ti=!1,this.Or=()=>{const{bottom:t,left:e}=this.jr().getBoundingClientRect();return this.zr=u(Math.floor(e),Math.floor(t)),this},this.Br=()=>{this.Yr&&this.Yr()},this.Tr=(t,e)=>{if(!e){this.Cr.style.cursor=t;const e=this.Hr;return this.Hr+=1,this.Ur.push([e,t]),e}return this.Fr(e),this.Tr(t)},this.Fr=t=>{const e=t?this.Ur.findIndex((e=>e[0]===t)):-1;e>=0?(this.Ur.splice(e,1),this.Ur.length>0?this.Cr.style.cursor=this.Ur[this.Ur.length-1][1]:this.Cr.style.cursor="default"):(this.Ur.push([0,"default"]),this.Cr.style.cursor="default")},this.Xr=t=>(this.Zr.S(t),this),this.Kr=()=>this.Zr.M(),this.qr=()=>{this.Nr&&this.Nr(1e3/60),this.Jr(),this.Qr(),this.Gr&&this.Gr()},this.tn=t=>(this.Rr.set(t.sn(),t),this.Rr=new Map([...this.Rr.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.en=t=>(this.Rr.delete(t),this),this.Y=()=>(this.Zr.o=!1,this),this.X=()=>(this.Zr.o=!0,this),this.hn=t=>{if(!this.$r)return;const e=this.rn,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.Ce(t.clientX,t.clientY),r=this.nn(t,{x:t.clientX,y:t.clientY});if(this.an&&((null==r?void 0:r.entity)!==this.an.entity||r.collectionMember!==this.an.collectionMember)&&!this.ln){this.an.entity.Ii=!1;const e=this.an.entity.un;e&&e(this.an.entity,t,this.an.collectionMember)}if(r&&r.entity.getMouseInteractions()&&!this.ln)if(r.entity.Ii){if(!i){const e=r.entity.cn;e&&e(r.entity,t,r.collectionMember)}}else{r.entity.Ii=!0;const e=r.entity.dn;e&&e(r.entity,t,r.collectionMember)}if(this.ln){const i=this.ln.entity.fn,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.ln.entity,t,this.ln.button,this.ln.startLocation,s,this.ln.collectionMember)}this.gn=t,this.rn=t,this.pn=s,this.an=r},this.mn=t=>{if(this.$r=!1,this.pn=void 0,this.gn=t,this.rn=void 0,this.ln){const e=this.ln.entity.yn;e&&e(this.ln.entity,t,this.ln.button,this.ln.startLocation,this.ln.collectionMember),this.ln.entity.Ii=!1;const i=this.ln.entity.un;i&&i(this.ln.entity,t,this.ln.collectionMember),this.ln=void 0}if(this.Sn){const e=this.Sn.entity.xn;e&&e(this.Sn.entity,t,this.Sn.collectionMember),this.Sn=void 0}if(this.an){this.an.entity.Ii=!1;const e=this.an.entity.un;e&&e(this.an.entity,t,this.an.collectionMember),this.an=void 0}},this.bn=t=>{this.$r=!0,this.gn=t},this.vn=()=>this.pn,this.Ji=t.theme,this.Mn=e.Mn,this._n={An:e.An,wn:e.wn,kn:e.kn,Cn:e.Cn,Tn:e.Tn,Fn:e.Fn,In:t&&t.overrideInteractionMouseButtons?t.overrideInteractionMouseButtons:void 0,Hs:t&&void 0!==t.resourcesBaseUrl&&null!==t.resourcesBaseUrl?t.resourcesBaseUrl:`${xt.location.origin}/resources`,Pn:!t||!("warnings"in t)||"boolean"!=typeof t.warnings||t.warnings,Dn:(()=>{const e=null==t?void 0:t.pickingPrecision;if("string"==typeof e){const t=e.toLowerCase();if("best"===t)return 1;if("high"===t)return.5;if("low"===t)return 1/8}return 1/4})(),Bn:void 0===(null==t?void 0:t.interactable)||t.interactable,On:void 0===t.textPixelSnappingEnabled||t.textPixelSnappingEnabled};const i=t?t.container:void 0;if(i){if("string"==typeof i){const t=xt.document.getElementById(i);if(!t)throw new Error(`Container "${i}" doesn't exist.`);this.Cr=t}else this.Cr=i;xt.addEventListener("resize",this.Br),this.Wr.push((()=>{xt.removeEventListener("resize",this.Br)}))}else{if(void 0===Sr){const t=xt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",xt.document.body.appendChild(t),Sr=t,xt.addEventListener("resize",xr)}let t=1;for(;null!==xt.document.getElementById(`chart-${t}`);)t+=1;this.Cr=xt.document.createElement("div"),this.Cr.id=`chart-${t}`,this.Cr.style.flex="1",Sr.appendChild(this.Cr),xr(),pr.push(this.Br),this.Wr.push((()=>{Sr&&Sr.removeChild(this.Cr),pr.includes(this.Br)&&pr.splice(pr.indexOf(this.Br),1),0===pr.length&&Sr&&(xt.document.body.removeChild(Sr),Sr=void 0,xt.removeEventListener("resize",xr))}))}if(xt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Cr&&this.Br()};this.Ln=new xt.ResizeObserver(t.bind(this)),this.Ln.observe(this.Cr)}""===this.Cr.style.position&&(this.Cr.style.position="relative"),this.Cr.style.boxSizing="content-box",this.Cr.addEventListener("fullscreenchange",this.Br),this.Cr.addEventListener("webkitfullscreenchange",this.Br);const s=t?t.maxFps:void 0;this.Rn=s?-1===s?-1:0!==s?1e3/s:0:0;const n=new Map;let o=!1;const h=(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":n.set(i.pointerId,s);break;default:n.delete(i.pointerId),o=!1}switch(i.interactions=Array.from(n.values()),i.pointerType){case"pen":case"mouse":default:t&&t(i);break;case"touch":e&&e(i)}i.defaultPrevented&&(o=!0)};if(this.Cr.onwheel=this.En(gr.wheel),this.Cr.oncontextmenu=this.En(gr.contextmenu),this.Cr.onclick=this.En(gr.click),this.Cr.ondblclick=this.En(gr.dbclick),this.Cr.onlostpointercapture=()=>{o=!1},this.Cr.ontouchmove=t=>{o&&t.preventDefault()},this.Cr.onpointerover=h(),this.Cr.onpointerenter=h(this.bn),this.Cr.onpointerdown=h(this.En(gr.mouseDown),this.zn(yr.touchStart)),this.Cr.onpointermove=h(this.hn,this.zn(yr.touchMove)),this.Cr.onpointerup=h(this.En(gr.mouseUp),this.zn(yr.touchEnd)),this.Cr.onpointercancel=h(),this.Cr.onpointerout=h(),this.Cr.onpointerleave=h(this.mn,this.zn(yr.touchEnd)),!xt.requestAnimationFrame||!xt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");xt.addEventListener("scroll",this.Or),this.Zr=p(new M({r:0,g:0,b:0,a:0})),this.os=new cr(this)}Vn(){return this.Nn}Gn(){return this.Wn}setBackgroundFillStyle(t){return this.Hn.Me(t),this}getBackgroundFillStyle(){return this.Hn.Th()}setBackgroundStrokeStyle(t){return this.Hn.ve(t),this}getBackgroundStrokeStyle(){return this.Hn.Un()}$n(t){return this.Gr=t,this}jn(t){return this.Nr=t,this}Yn(t){return this.Rr.get(t)}Xn(){return Array.from(this.Rr.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}En(t){return e=>this.Zn(t,e)}Zn(t,e){if(!this.$r)return;t===gr.contextmenu&&Zt(e);const i=this.Ce(e.clientX,e.clientY),s=this.nn(e,{x:e.clientX,y:e.clientY});if(t===gr.mouseUp){if(this.ln){const t=this.ln.entity.yn;if(t&&t(this.ln.entity,e,this.ln.button,this.ln.startLocation,this.ln.collectionMember),(null==s?void 0:s.entity)!==this.ln.entity||s.collectionMember!==this.ln.collectionMember){this.ln.entity.Ii=!1;const t=this.ln.entity.un;t&&t(this.ln.entity,e,this.ln.collectionMember)}this.ln=void 0}if(this.Sn){const t=this.Sn.entity.getMouseInteractions()&&this.Sn.entity.xn;t&&t(this.Sn.entity,e,this.Sn.collectionMember),this.Sn=void 0}}else if(s&&s.entity.getMouseInteractions()){const i=t===gr.click?s.entity.Kn:t===gr.dbclick?s.entity.qn:t===gr.mouseDown?s.entity.Jn:t===gr.wheel?s.entity.Qn:t===gr.contextmenu?s.entity.io:void 0;if(i&&i(s.entity,e,s.collectionMember),t===gr.mouseDown){this.Sn={entity:s.entity,collectionMember:s.collectionMember,event:e};const t=this.Sn.event.button,i=s.entity.so;i&&i(s.entity,e,t,s.collectionMember),this.ln={entity:s.entity,collectionMember:s.collectionMember,button:t,startLocation:u(e.clientX,e.clientY)}}}this.gn=e,this.pn=i,this.an=s}zn(t){return e=>this.eo(t,e)}eo(t,e){const i=e.interactions.length;if(this.ho=e,this.ro){const s=t===yr.touchMove?this.ro.entity.no:t===yr.touchEnd?this.ro.entity.oo:t===yr.touchStart?this.ro.entity.ao:void 0;s&&s(this.ro.entity,e,this.ro.collectionMember),t===yr.touchEnd&&0===i&&(this.ro.entity.Ii=!1,this.ro=void 0)}else if(t===yr.touchStart){for(let t=0;t{t()})),this.Wr.length=0,this.Vr&&xt.cancelAnimationFrame(this.Vr)}Ce(t,e){return u(t-this.zr.x,this.zr.y-e)}Ir(t,e){return u(t+this.zr.x,this.zr.y-e)}do(t){const e=this.Ce(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}fo(t){const e=this.Ir(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const Ar=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=si(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=si(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=si(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=si(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?Cr.Nearest:"nearest-x"===t?Cr.NearestX:"nearest-y"===t?Cr.NearestY:void 0;return void 0!==e?e:Cr.NearestX},Pr=(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===Cr.Nearest)return Fr(t,e,n,o,c,d);if(i===Cr.NearestX||i===Cr.NearestY){if("boolean"==typeof l&&("x"===a&&i===Cr.NearestX||"y"===a&&i===Cr.NearestY))return Lr(t,at(e,o,n),a,l,c,d);if(i===Cr.NearestX)return Br(t,at(e,o,n),h,c,d);if(i===Cr.NearestY)return _r(t,at(e,o,n),h,c,d)}},Fr=(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=at(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)):ke,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.P.on("dispose",t),this.offDispose=t=>this.P.off(t,"dispose"),this.ls=t,this.bo=e,this.vo=i,this.Mo=zr,zr+=1,this._o=t.Ji.highlightColorOffset}Ao(t){return void 0!==this.vo.find((e=>e.type===t))}wo(t,e){var i;return!!this.Ao(t)&&!0===e(null===(i=this.vo.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.Ti||(this.Ii&&this.un&&this.un(this,void 0,void 0),this.Ti=!0,this.bo(this),this.P.emit("dispose",this)),this}setVisible(t){const e=this.Fi;return this.Fi=t,!t&&e&&(this.Ii&&this.un&&this.un(this,void 0,void 0),this.Ii=!1),this}getVisible(){return this.Fi}setMouseInteractions(t){const e=this.po.M();return this.po.S(t),t||(e&&this.Ii&&this.un&&this.un(this,void 0,void 0),this.Ii=!1),this}getMouseInteractions(){return this.po.M()}getIsUnderMouse(){return this.Ii}getIsGrabbed(){return this.yo}setMouseMoveEventHandler(t){return this.cn=t,this}setMouseEnterEventHandler(t){return this.dn=t,this}setMouseLeaveEventHandler(t){return this.un=t,this}setMouseClickEventHandler(t){return this.Kn=t,this}setMouseDoubleClickEventHandler(t){return this.qn=t,this}setMouseDownEventHandler(t){return this.Jn=t,this}setMouseUpEventHandler(t){return this.xn=t,this}setMouseWheelEventHandler(t){return this.Qn=t,this}setMouseContextMenuEventHandler(t){return this.io=t,this}setMouseDragEventHandler(t){return this.fn=t,this}setMouseDragStartEventHandler(t){return this.so=t,this}setMouseDragStopEventHandler(t){return this.yn=t,this}setTouchStartEventHandler(t){return this.ao=t,this}setTouchMoveEventHandler(t){return this.no=t,this}setTouchEndEventHandler(t){return this.oo=t,this}ko(t){return this.So=t,this}Co(){return this.So?this.So:Rr}us(t){return this.xo=t,this}To(){return this.xo}Fo(t){return this._o=t,this}Io(){return this._o}}const Rr=y(u(0,0),u(0,0));class Vr extends Or{constructor(t,e,i,s){super(t,i,s),this.Po=0,this.As=e,this.As.Do=!0}Bo(t){return this.Po===t||(this.Po=t,this.As.Do=!0),this}Oo(){return this.Po}}class Nr extends Vr{constructor(t,e,i,s,r){super(t,e,s,r),this.Lo=!0,this.ct=i}}const Gr=(t,e,i)=>{if(i instanceof _i){const s=i.Ai(),r=oi(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.Jt(u(t.min.x,t.min.y),si(e,-1)),i.Jt(u(t.max.x,t.max.y),e))},Hr=(t,e)=>"function"==typeof e?e(t):e,Ur=(t,e)=>!t||t!==e,Wr=(t,e)=>t===z&&e!==z,Xr=t=>t!==z;class Yr extends Nr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Se=vr.fillStyle,this.ls=t}Me(t){return this.Se=Hr(this.Se,t),this}Th(){return this.Se}Ro(){return Ur(this.Eo,this.Se)}zo(){return Wr(this.Eo,this.Se)}Vo(){return Xr(this.Se)}No(t){this.Eo=t}}class jr extends Yr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.xe=vr.lineStyle,this.ls=t}ve(t){return this.xe="function"==typeof t?t(this.xe):t,this}Un(){return this.xe}Go(){return!this.Wo||this.Wo!==this.xe}Ho(t){return!this.Wo||this.Wo.getThickness()!==t}Vo(){return this.xe!==st||super.Vo()}zo(){return(this.xe!==st||this.Se!==z)&&this.Wo===st&&this.Eo===z}Uo(t){this.Wo=t}}class Jr extends Yr{constructor(t,e,i,s,r,n=p(5)){super(t,e,i,s,r),this.size=p(5),this.size=n}q(t){return this.size.S(t),this}}class $r extends Yr{constructor(t,e,i,s,r,n=p(vr.font)){super(t,e,i,s,r),this.$o=p(""),this.jo=p(u(0,0)),this.Yo=p(0),this.Xo=p(0),this.Zo=p(u(0,0)),this.Ko=p(0),this.qo=p(ir),this.Jo=u(0,0),this.Ft=p(S(1,1,1,1)),this.Qo=p(x(4,4,4,4)),this.font=p(vr.font),this.ta=!1,this.font=n}Vo(){return Xr(this.Se)&&this.$o.M().length>0}zo(){return!1===this.ta&&this.Vo()}Ch(t){return this.$o.S(t),this}wh(){return this.$o.M()}Ih(t){return er(t)?this.qo.S(t):this.qo.S(t(this.qo.M())),this}Fh(){return this.qo.M()}ia(t){return this.qo.S(this.qo.M().setFamily(t)),this}sa(){return this.qo.M().getFamily()}ea(t){return this.qo.S(this.qo.M().setSize(t)),this}ha(){return this.qo.M().getSize()}ra(t){return this.qo.S(this.qo.M().setWeight(t)),this}na(){return this.qo.M().getWeight()}oa(t){return this.qo.S(this.qo.M().setStyle(t)),this}aa(){return this.qo.M().getStyle()}la(t){return this.qo.S(this.qo.M().setVariant(t)),this}ua(){return this.qo.M().getVariant()}we(t){return this.jo.S(t),this}ca(){return this.jo.M()}Ph(t){return this.Ko.S(t),this}Dh(){return this.Ko.M()}da(t,e){return this.Zo.S(u(t,e)),this}fa(){return this.Zo.M()}ga(t){return this.Xo.S(t),this}pa(){return this.Xo.M()}ma(t){return this.Yo.S(t),this}ya(){return this.Yo.M()}Sa(t){return this.Xo.S(t.x),this.Yo.S(t.y),this}xa(t){return this.Ft.S(t),this}ba(){return this.Ft.M()}va(t){return this.Qo.S(t),this}Ma(){return this.Qo.M()}}class qr extends Jr{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,p(o)),this._a=[],this.Aa=p(e.PointShape.Square),this.Ko=p(0),this.wa=p(!1),this.ka=p(!1),this.Ca=p(!1),this.Ta=Fe,this.Fa=0,this.Ia=[],this.Pa=0,this.Da=Fe,this.Ba=Cr.Nearest,this.Oa=!1}La(t){return this.Ba=t,this}Ra(){return this.Ia}Ea(){return this._a}za(t){return this.Aa.S(t),this}Ph(t){return this.Ko.S(t),this}Va(t){return this.wa.S(t),this}Na(t){return this.ka.S(t),this}Ga(t){return this.Ca.S(t),this}Wa(t,e){return Array.isArray(t)||(t=[t]),this.Pa+=t.length,this.Ia=he(this.Ia,t,{canReturnB:!0}),this.Da&&(this.Da=e?je(this.Da,e):void 0),this}Ha(){return this.Oa=!0,this._a.length=0,this.Fa=0,this.Ta=Fe,this.Ia=[],this.Pa=0,this}Ua(){return this.Fa}$a(){return this.Pa}}class Kr extends jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.jo=p(u(0,0)),this.j=p(u(100,100)),this.Ko=p(0),this.Jo=p(u(0,0)),this.ja=!1}Ts(){return this.Ya(),this}we(t){const e=this.jo.M();return t.x===e.x&&t.y===e.y||(this.jo.S(t),this.Ya()),this}ca(){return this.jo.M()}Xa(t){const e=this.jo.M();return t!==e.x&&(this.jo.S(u(t,e.y)),this.Ya()),this}Za(t){const e=this.jo.M();return t!==e.y&&(this.jo.S(u(e.x,t)),this.Ya()),this}q(t){const e=this.j.M();return t.x===e.x&&t.y===e.y||(this.j.S(u(t.x,t.y)),this.Ya()),this}Ht(){return this.j.M()}Ka(t){const e=this.j.M();return t!==e.x&&(this.j.S(u(t,e.y)),this.Ya()),this}qa(t){const e=this.j.M();return t!==e.x&&(this.j.S(u(e.x,t)),this.Ya()),this}Ph(t){return this.Ko.S(t),this}Dh(){return this.Ko.M()}Ja(t){const e=this.Jo.M();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.ja=!1,this.Ya()):(this.ja=!0,this.Jo.S(t))),this}Ya(){if(!this.ja){const t=this.jo.M(),e=this.j.M(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.Jo.M();i.x===s.x&&i.y===s.y||this.Jo.S(i)}}}class Zr extends jr{constructor(){super(...arguments),this._a=[],this.jo=p(u(0,0)),this.Ta=Fe,this.Qa=!1}tl(t){return t=ie(t),this._a=t,this.Qa=!0,this}il(){return this._a}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return 0}el(){return 0}}class Qr extends Zr{}class tn extends Yr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.hl=new Array,this.rl=new Array,this.nl=p({type:"disabled",packager:(t,e,i)=>t.slice()}),this.Ta=Fe,this.ol=0,this.al=!1,this.Ia=[Array(),Array()],this.ll=!1,this.ul=(new V).setColor(T(42,171,240)),this.Oa=!1,this.cl=!1,this.dl=!1}Wa(t,e){const i=this.ol-1,s=i>0&&!this.ll;let[r,n]=s?[[this.hl[i]],[this.rl[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.ll?(this.Ia[0]=he(this.Ia[0],r,{canReturnB:!0}),this.Ia[1]=he(this.Ia[1],n,{canReturnB:!0})):(this.Ia=[r,n],this.ll=!0),this.Ta=je(this.Ta,e||je(Xe(r),Xe(n))),this}Ha(){return this.Oa=!0,this.hl.length=0,this.rl.length=0,this.ol=0,this.Ta=Fe,this}Ea(){return[this.hl,this.rl]}Ra(){return[this.Ia[0],this.Ia[1]]}fl(t){return this.nl.S(t),this}pl(){return this.nl.M()}ml(t){return this.ul="function"==typeof t?t(this.ul):t,this}yl(){return this.ul}Ua(){return this.ol-(Number(this.cl)+Number(this.dl))}$a(){return this.Ia.length}Sl(t){return this.cl=t,this}xl(){return this.cl}bl(t){return this.dl=t,this}vl(){return this.dl}zo(){return this.Eo===z&&this.Ml===z&&(this.Se!==z||this.ul!==z)}_l(t){this.Ml=t}Vo(){return this.ul!==z||super.Vo()}Ro(){return super.Ro()||!this.Ml||this.Ml!==this.ul}}class en extends jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.jo=p(u(0,0)),this.Al=p(0),this.ci=p(360),this.wl=p(100),this.kl=p(100),this.Cl=p(0),this.Tl=p(void 0),this.Fl=u(0,0),this.Il=u(0,0),this.Pl=u(0,0)}Dl(){return this.wl.M()}Bl(){return this.kl.M()}ca(){return this.jo.M()}Ol(){return this.Al.M()}ui(){return this.ci.M()}Ll(){return this.Cl.M()}Rl(){return this.Tl.M()}El(){return this.Fl}zl(){return this.Il}Vl(){return this.Pl}we(t){return this.jo.S(t),this}Nl(t){return this.Al.S(t),this}Be(t){return this.ci.S(t),this}Gl(t){return this.kl.S(t),this.wl.S(t),this}Wl(t){return this.wl.S(t),this}Hl(t){return this.kl.S(t),this}Ul(t){return this.Cl.S(t<0?0:t),this}$l(t){return this.Tl.S(void 0!==t&&t<=0?void 0:t),this}}var sn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(sn||(sn={}));class rn extends Nr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.jl=vr.lineStyle,this.engine=t}Pe(t){return this.jl=((t,e)=>"function"==typeof e?e(t):e)(this.jl,t),this}Yl(){return this.jl}Go(){return((t,e)=>!t||t!==e)(this.Xl,this.jl)}Zl(t){return((t,e)=>!t||t.getThickness()!==e)(this.Xl,t)}zo(){return((t,e)=>t===st&&e!==st)(this.Xl,this.jl)}Vo(){return(t=>t!==st&&t.getFillStyle()!==z)(this.jl)}Kl(t){this.Xl=t}}class nn extends rn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fi=u(0,0),this.ci=u(0,0),this.ql=!1}S({min:t,max:e}){return t.x===this.fi.x&&t.y===this.fi.y&&e.x===this.ci.x&&e.y===this.ci.y||(this.ql=!0,this.fi=t,this.ci=e),this}di(){return this.fi}ui(){return this.ci}Oe(t){return t.x===this.fi.x&&t.y===this.fi.y||(this.ql=!0,this.fi=t),this}Be(t){return t.x===this.ci.x&&t.y===this.ci.y||(this.ql=!0,this.ci=t),this}}class on extends rn{constructor(t,e,i,s,r){super(t,e,i,s,r)}}class hn extends rn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Jl=[],this.Ta=Fe,this.Ia=new Array,this.Fa=0,this.Ba=Cr.NearestX,this.Oa=!1,this.Ql=p(void 0),this.cl=!1,this.dl=!1}tu(t){return this.Ql.S(t),this}iu(){return this.Ql.M()}Ra(){return this.Ia}Ea(){return this.Jl}La(t){return this.Ba=t,this}Ha(){return this.Oa=!0,this.Jl.length=0,this.Fa=0,this.Ia=[],this.Ta=Fe,this}Ua(){return this.Fa-(Number(this.cl)+Number(this.dl))}$a(){return this.Ia.length}Sl(t){return this.cl=t,this}xl(){return this.cl}bl(t){return this.dl=t,this}vl(){return this.dl}}class an extends Yr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ol=0,this.su=0,this.j=p({x:0,y:0}),this.eu=p({x:0,y:0}),this.hu=p({x:0,y:0}),this.fi={x:0,y:0},this.ci={x:0,y:0},this.ru=!0,this.nu=!0,this.ou=!0,this.Ta=Fe,this.au=!0,this.lu=z}uu(t){return this.lu=Hr(this.lu,t),this}cu(){return this.lu}S(t){return ln.S(this,t,((t,e)=>({x:t,y:e}))),this}du(){return ln.du(this)}fu(){return ln.fu(this)}ca(){return ln.ca(this)}$a(){return ln.$a(this)}gu(t,e,i){return ln.gu(this,t,e,i),this}pu(t,e,i){return ln.pu(this,t,e,i),this}mu(t,e){return ln.mu(this,t,e),this}yu(t,e){return ln.yu(this,t,e),this}Su(t,e){return ln.Su(this,t,e),this}Ha(){return ln.Ha(this,((t,e)=>({x:t,y:e}))),this}xu(){return ln.xu(this)}bu(){return ln.bu(this)}vu(){return ln.vu(this)}Ua(){return ln.Ua(this)}zo(){return ln.zo(this)}Vo(){return ln.Vo(this)}Mu(){return this._u}Au(){return this.wu}}const ln={S(t,e,i){t.ru=!0,t.nu=!0,t.ou=!0;const{start:s}=e,{end:r}=e,{rows:n}=e,{columns:o}=e;t.au=e.pixelate;const h={x:e.pixelate&&o>=1||!e.pixelate&&o>1?o:0,y:e.pixelate&&n>=1||!e.pixelate&&n>1?n:0};t.eu.S(h),t.fi={...s},t.ci={...r},t.j.S(ni(r,s)),ln.ku(t,i)},ku(t,e){const i=t.eu.M();if(i.x>0&&i.y>0){t._u?t._u.length=0:t._u=[];const s=t.au?ri(i,{x:1,y:1}):{x:i.x,y:i.y};t.hu.S(s),t._u=Array.from(Array(s.y)).map((()=>Array(s.x))),t.wu=Array.from(Array(i.y)).map((()=>Array(i.x))),ln.Cu(t,i,s,e),t.ol=s.x*s.y,t.su=i.x*i.y}else t._u=void 0,t.hu.S({x:0,y:0})},Cu(t,e,i,s){const r=t.fi,n=t.ci,o=t._u,h=t.wu;if(o){const e=i.x,h=i.y,{x:a,y:l}=t.j.M(),u={x:a/(e-1),y:l/(h-1)};for(let t=0;tt.eu.o||t.hu.o,fu(t){const e=t.eu.M();return{columns:e.x,rows:e.y}},ca(t){const e=t.fi,i=t.ci;return{start:{x:e.x,y:e.y},end:{x:i.x,y:i.y}}},$a(t){throw new Error("Method not implemented.")},gu(t,e,i,s){const r="geometry"===i||"y"===i?t._u:t.wu;if(r){const n=t.hu.M();if("y"===i){const t=_t(r);for(let i=0;iBt(t,e)));const o=r===t._u?t.hu.M():t.eu.M(),h={column:{start:o.x-e,end:o.x},row:{start:0,end:o.y}},a=(t=>{const e=t.length,i=e>0?t[0].length:0,s=Array.from(Array(i)).map((()=>Array(e)));for(let r=0;r0?e[0].length:0;for(let a=r,l=0;a0?e[0].length:0;for(let a=r,l=0;a0?e[0].length:0;for(let a=r,l=0;a0?e[0].length:0;for(let a=r,l=0;at.ol,Ua:t=>t.su,zo:t=>Wr(t.Eo,t.Se)||Wr(t.Iu,t.lu),Vo:t=>Xr(t.Se)||Xr(t.lu)},un=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 cn{constructor(){this.Fi=!0,this.P=new r.Eventer,this.Pu=0,this.Du=(t,e)=>{0===this.Pu&&this.P.emit("mouseEnter",this,e),this.Pu+=1},this.Bu=(t,e)=>{this.Pu-=1,this.Pu<1&&(this.P.emit("mouseLeave",this,e),this.Pu=0)},this.Ou=(t,e)=>{this.P.emit("mouseClick",this,e)},this.Lu=(t,e)=>{this.P.emit("mouseDoubleClick",this,e)},this.Ru=(t,e)=>{this.P.emit("mouseDown",this,e)},this.Eu=(t,e)=>{this.P.emit("mouseUp",this,e)},this.zu=(t,e)=>{this.P.emit("mouseMove",this,e)},this.Vu=(t,e,i)=>{this.P.emit("mouseDragStart",this,e,i)},this.Nu=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.Gu=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.Wu=(t,e)=>{this.P.emit("mouseWheel",this,e)},this.Hu=(t,e)=>{this.Pu+=1,this.P.emit("touchStart",this,e)},this.Uu=(t,e)=>{this.P.emit("touchMove",this,e)},this.$u=(t,e)=>{this.Pu-=1,this.P.emit("touchEnd",this,e)},this.ju=t=>(t instanceof Nr?t.setMouseEnterEventHandler(this.Du).setMouseLeaveEventHandler(this.Bu).setMouseClickEventHandler(this.Ou).setMouseDoubleClickEventHandler(this.Lu).setMouseDownEventHandler(this.Ru).setMouseUpEventHandler(this.Eu).setMouseMoveEventHandler(this.zu).setMouseDragEventHandler(this.Nu).setMouseDragStartEventHandler(this.Vu).setMouseDragStopEventHandler(this.Gu).setMouseWheelEventHandler(this.Wu).setTouchStartEventHandler(this.Hu).setTouchMoveEventHandler(this.Uu).setTouchEndEventHandler(this.$u):(t.onMouseEnter(this.Du),t.onMouseLeave(this.Bu),t.onMouseClick(this.Ou),t.onMouseDoubleClick(this.Lu),t.onMouseDown(this.Ru),t.onMouseUp(this.Eu),t.onMouseMove(this.zu),t.onMouseDrag(this.Nu),t.onMouseDragStart(this.Vu),t.onMouseDragStop(this.Gu),t.onMouseWheel(this.Wu),t.onTouchStart(this.Hu),t.onTouchMove(this.Uu),t.onTouchEnd(this.$u)),t)}onMouseEnter(t){return this.P.on("mouseEnter",t)}onMouseLeave(t){return this.P.on("mouseLeave",t)}onMouseClick(t){return this.P.on("mouseClick",t)}onMouseDoubleClick(t){return this.P.on("mouseDoubleClick",t)}onMouseDown(t){return this.P.on("mouseDown",t)}onMouseUp(t){return this.P.on("mouseUp",t)}onMouseMove(t){return this.P.on("mouseMove",t)}onMouseDragStart(t){return this.P.on("mouseDragStart",t)}onMouseDrag(t){return this.P.on("mouseDrag",t)}onMouseDragStop(t){return this.P.on("mouseDragStop",t)}onMouseWheel(t){return this.P.on("mouseWheel",t)}onTouchStart(t){return this.P.on("touchStart",t)}onTouchMove(t){return this.P.on("touchMove",t)}onTouchEnd(t){return this.P.on("touchEnd",t)}offMouseEnter(t){return this.P.off(t,"mouseEnter")}offMouseLeave(t){return this.P.off(t,"mouseLeave")}offMouseClick(t){return this.P.off(t,"mouseClick")}offMouseDoubleClick(t){return this.P.off(t,"mouseDoubleClick")}offMouseDown(t){return this.P.off(t,"mouseDown")}offMouseUp(t){return this.P.off(t,"mouseUp")}offMouseMove(t){return this.P.off(t,"mouseMove")}offMouseDragStart(t){return this.P.off(t,"mouseDragStart")}offMouseDrag(t){return this.P.off(t,"mouseDrag")}offMouseDragStop(t){return this.P.off(t,"mouseDragStop")}offMouseWheel(t){return this.P.off(t,"mouseWheel")}offTouchStart(t){return this.P.off(t,"touchStart")}offTouchMove(t){return this.P.off(t,"touchMove")}offTouchEnd(t){return this.P.off(t,"touchEnd")}getIsUnderMouse(){return this.Pu>0}setVisible(t){const e=this.Fi!==t;return this.Fi=t,e&&this.P.emit("visibleStateChanged",this,this.Fi),this}getVisible(){return this.Fi}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}const dn=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.Jt(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.Jt({x:o.x.getInnerStart(),y:o.y.getInnerStart()},oi({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.Jt({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},oi({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)}},fn=(t,e,i,s,r)=>{dn(t,r,e)},gn=(t,e,i,s,r)=>{dn(t,s,r)};class yn extends cn{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.Ti=!1,this.Yu=void 0,this.Xu=void 0,this.Zu=un,this.Ku=void 0,this.qu=()=>{const t="function"==typeof this.Zu?this.Zu(this):this.Zu;t&&(this.Xu=this.As.ls.Tr(t))},this.Ju=()=>{this.As.ls.Fr(this.Xu)},this.Ft=S(0,0,0,0),this.As=t,this.renderingScale=e,this.scale=i,this.bo=s,this.Ji=r,this.As.Ss(),this.onMouseEnter(this.qu),this.onMouseLeave(this.Ju),this.onMouseDrag(fn);const n=Wi(new Yi(Et,gn,Et));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.Ji=r}setEffect(t){return this.ss=this.ss||this.As.ls.ss.es(this,{Qu:{shapes:this.tc()}}),this.ss.Qu.ys(t),this}getEffect(){return!!this.ss&&this.ss.Qu.xs()}setAutoDispose(t){return this.Ku=t,this.As.Ss(),this}getAutoDispose(){return this.Ku}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this.Ft.left+this.Ft.right),this.size.y+(this.Ft.bottom+this.Ft.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this.Ft="object"==typeof t?b(this.Ft,t):{left:t,top:t,right:t,bottom:t},this.As.Ss(),this}getMargin(){return this.Ft}Ae(){if(this.Ku){const t=this.size,e=this.renderingScale.Ht(),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}Ts(){return this}dispose(){return this.Ti||(this.As.Ss(),this.Ti=!0,this.bo(this),this.P.emit("dispose",this)),this}setVisible(t){return super.setVisible(t),this.As.Ss(),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setPosition(t){return this.position=t,this.As.Ss(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.Jt(this.position,oi({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.Jt(r,oi({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.Jt(r,{x:this.Ft.left,y:this.Ft.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.Jt(n,oi({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.As.Ss(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Yu=t,this.As.Ss(),this}getDraggingMode(){return void 0!==this.Yu?this.Yu:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Zu=t,this}getMouseStyle(){return this.Zu}}class mn extends yn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Qo=S(),this.ic=0,this.As=t,this.sc=s,this.backgroundElement=new this.sc(this.As,this.renderingScale,this.scale,Et,n),this.ju(this.backgroundElement)}tc(){return this.backgroundElement.tc()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}Ae(){return super.Ae(),this.Ti||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).Ae(),this}Ts(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.hc(t).Ts(),super.Ts()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.Qo="object"==typeof t?b(this.Qo,t):{left:t,top:t,right:t,bottom:t},this.As.Ss(),this}getPadding(){return this.Qo}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.Qo.left+this.Qo.right,i.y+this.Qo.bottom+this.Qo.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.rc()+this.backgroundElement.nc(),i.y+this.backgroundElement.oc()+this.backgroundElement.ac())),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.Jt(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.Jt(n,oi({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.Jt(n,{x:this.backgroundElement.rc(),y:this.backgroundElement.oc()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.Jt(o,oi({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.Jt(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.Jt(a,oi({x:(t.x+1)/2,y:(t.y+1)/2},l))}setMouseInteractions(t){return this.backgroundElement.setMouseInteractions(t),this}getMouseInteractions(){return this.backgroundElement.getMouseInteractions()}getHighlight(){return this.ic}setHighlight(t){return this.ic=ve(t),this.backgroundElement.setHighlight(t),this.P.emit("highlight",t),this}}const pn=t=>"setBackground"in t;class Sn extends cn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.u=0,this.lc=1,this.uc=!0,this.cc=new tr,this.dc=!0,this.Ti=!1,this.axisScale=s,this.renderingScale=r,this.fc=o,this.gc=h,this.mc=a,this.bo=l,this.yc=e,this.Sc=i,this.xc=this.ju(this.yc.De(this.renderingScale)),this.Ji=u,this.bc=this.ju(this.mc.vc(this.Sc,this.renderingScale,n,Et,this.Ji,!1).setOrigin(qt(this.gc)).setDirection(this.gc)),this.axis=t,this.setMouseInteractions(!1),"major"===this.bc.Mc?this.xc.Pe(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.bc.Mc?this.xc.Pe(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.bc.Mc&&this.xc.Pe(u.cursorGridStrokeStyleX)}setValue(t){return this.u=t,this.Sc.Ss(),this.P.emit("valueChange",this.u),this}getValue(){return this.u}setTextFormatter(t){return this._c=t,this.Sc.Ss(),this}setTickLength(t){return this.bc.setPointerLength(t),this.yc.Ss(),this}getTickLength(){return this.bc.getPointerLength()}setTickLabelPadding(t){return this.bc.setTickLabelPadding(t),this.yc.Ss(),this}setTickLabelRotation(t){return this.bc.setTextRotation(t),this.yc.Ss(),this}getTickLabelRotation(){return this.bc.getTextRotation()}getTickLabelPadding(){return this.bc.getTickLabelPadding()}setGridStrokeLength(t){return this.lc=t,this.yc.Ss(),this}getGridStrokeLength(){return this.lc}setGridStrokeStyle(t){return this.xc.Pe(t),this.yc.Ss(),this}getGridStrokeStyle(){return this.xc.Yl()}dispose(){return this.Ti||(this.Ti=!0,this.xc.dispose(),this.bc.dispose(),this.bo(this),this.yc.ls.Ss(),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setMarkerVisible(t){return this.uc=t,this.Sc.Ss(),this}getMarkerVisible(){return this.uc}setMarker(t){return t(this.bc),this.Sc.Ss(),this}getMarker(){return this.bc}setMouseInteractions(t){return this.bc.setMouseInteractions(t),this.xc.setMouseInteractions(t),this}getMouseInteractions(){return this.xc.getMouseInteractions()}setAllocatesAxisSpace(t){return this.dc=t,this.Sc.Ss(),this}getAllocatesAxisSpace(){return this.dc}isInScale(){return Ve(this.u,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}}class xn extends Sn{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.Ac=!1,this.bo=a,this.yc=e,this.Sc=i}dispose(){return this.Ac=!1,super.dispose()}update(){return this}plot(t,e,i,s){if(this.isInScale()&&this.getVisible()){this.Ac=!1;const r=ht(this.u,this.axisScale,this.fc.getWidth(this.renderingScale));this.xc.setVisible(!0).Oe(this.fc.toPoint(r,t)).Be(this.fc.toPoint(r,t-(i+e*this.lc))),this.uc?(this._c&&this.bc.setText(this._c(this.u,this)),this.bc.setVisible(!0).setPosition(this.fc.toPoint(r,s))):this.bc.setVisible(!1)}else this.xc.setVisible(!1),this.bc.setVisible(!1);return this.bc.Ts().Ae(),this}wc(){const t=this.bc.Ts().getSize();return this.fc.getHeight(t)}}const bn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),vn=(t,e)=>(ce(t.setButtonOffSize(e.uiButtonSize).setButtonOnSize(e.uiButtonSize),e,{fill:e.uiButtonFillStyle}),t),Mn=(t,e,i)=>{i&&pn(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},An={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}},Tn={background:void 0,setBackground(t){return{...this,background:t}}},wn={vc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return Mn(o,r,n),o}},En={vc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return Mn(o,r,n),o}};class In extends yn{constructor(){super(...arguments),this.kc=!0}Ae(){return super.Ae(),this}setMouseInteractions(t){return this.kc=t,this}getMouseInteractions(){return this.kc}tc(){return[]}}class Cn extends In{onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}hc(t){return this.size=t,this}rc(){return 0}nc(){return 0}ac(){return 0}oc(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return z}setStrokeStyle(){return this}getStrokeStyle(){return st}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class kn extends Cn{constructor(){super(...arguments),this.setSize=this.hc.bind(this)}}class Pn extends yn{constructor(){super(...arguments),this.Se=z,this.P=new r.Eventer,this.ic=0}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}tc(){return[this.Aa]}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.Aa.Me(this.Se),this.As.Ss(),this}getFillStyle(){return this.Se}getHighlight(){return this.ic}setHighlight(t){return this.ic=t,this.Aa.us(t),this.P.emit("highlight",t),this.As.Ss(),this}setMouseInteractions(t){return this.Aa.setMouseInteractions(t),this}getMouseInteractions(){return this.Aa.getMouseInteractions()}dispose(){return super.dispose(),this.Aa.dispose(),this}setVisible(t){return super.setVisible(t),this.Aa.setVisible(t),this}}class Fn extends Pn{constructor(){super(...arguments),this.xe=st}setStrokeStyle(t){return this.xe="function"==typeof t?t(this.xe):t,this.Aa.ve(this.xe),this.As.Ss(),this}getStrokeStyle(){return this.xe}}class Bn extends Fn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.As=t,this.Aa=this.As.Cc(this.renderingScale,sn.Simple).ve(this.getStrokeStyle()).Me(this.getFillStyle()).setVisible(!1),this.ju(this.Aa)}Tc(){const t=this.Fc();if(t.length>2){const e=Xe(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=ri(t,si(e.min,-1));return this.scale.Jt(this.position,ri(s,oi(si(ri(this.origin,u(1,1)),-.5),i)))})).map((t=>at(t,this.scale,this.renderingScale)));this.Aa.tl(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.Aa&&this.Aa.setVisible(!1),this.setContentSize(u(0,0))}Ae(){return super.Ae(),this.Ti||this.Tc(),this}Ts(){return this.Tc(),super.Ts()}setVisible(t){return super.setVisible(t),this.Aa.setVisible(t),this}}class _n extends Pn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.$o="label",this.Aa=this.As.Sr(this.renderingScale).Me(this.Se).Ch(this.$o),this.ju(this.Aa)}Ae(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=at(t,this.scale,this.renderingScale);return this.Aa.we(i),this}Ts(){this.Aa.Ts();const t=0===this.$o.length?u(0,0):this.Aa.Ic();return this.setContentSize(t),super.Ts()}setText(t){return this.$o=t,this.Aa.Ch(this.$o),this.As.Ss(),this}getText(){return this.$o}setFont(t){return this.Aa.Ih(t),this.As.Ss(),this}getFont(){return this.Aa.Fh()}setTextRotation(t){return this.Aa.Ph(t),this.As.Ss(),this}getTextRotation(){return this.Aa.Dh()}}const Ln={...An,...wn,uiElement:_n};class Dn extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.hc.bind(this),this.setSize=this.fitTo,this.Aa=this.As._e(e).Me(this.Se).ve(this.getStrokeStyle()),this.ju(this.Aa)}Ae(){const t=Xe([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>at(t,this.scale,this.renderingScale)))),i={x:t.max.x-t.min.x,y:t.max.y-t.min.y};return this.Aa.q(i).we(at(this.getPosition(u(-1,-1),e.UISpace.Content),this.scale,this.renderingScale)),this}hc(t){return this.setContentSize(t),this.As.Ss(),this}rc(){return 0}nc(){return 0}ac(){return 0}oc(){return 0}}class zn extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Pc=u(0,0),this.setSize=this.fitTo.bind(this),this.Aa=t.Dc(e).Nl(0).Be(360).Me(this.Se).ve(this.getStrokeStyle()),this.ju(this.Aa)}Ae(){const t=this.getSize(e.UISpace.Content).x/2;return this.Aa.Wl(t*this.renderingScale.Ai().x).Hl(t*this.renderingScale.Ai().y).we(at(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).$l(255).Ts(),this}hc(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.Pc=t,this.As.Ss(),this}rc(){return(this.getSize(e.UISpace.Content).x-this.Pc.x)/2}nc(){return(this.getSize(e.UISpace.Content).x-this.Pc.x)/2}ac(){return(this.getSize(e.UISpace.Content).y-this.Pc.y)/2}oc(){return(this.getSize(e.UISpace.Content).y-this.Pc.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.Pc=t,this}}class On extends Bn{constructor(t,e,i,s,r){super(t,e,i,sn.Simple,s,r),this.Bc=p(u(0,0)),this.Oc=!1,this.setSize=this.fitTo.bind(this),this.As=t,this.Tc()}Fc(){const t=this.Bc.M();if(this.Oc){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.Bc.M().x*this.Bc.M().x/4+this.Bc.M().y*this.Bc.M().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=ri(r,ri(i,s)),o=ri(n,ri(s,si(i,-1)));return[r,n,o,ni(o,ri(i,s))]}hc(t){return this.Bc.S(t),this.Oc=!1,this.As.Ss(),this}rc(){return this.Oc?0:(this.getSize(e.UISpace.Content).x-this.Bc.M().x)/2}nc(){return this.Oc?0:(this.getSize(e.UISpace.Content).x-this.Bc.M().x)/2}ac(){return this.Oc?0:(this.getSize(e.UISpace.Content).y-this.Bc.M().y)/2}oc(){return this.Oc?0:(this.getSize(e.UISpace.Content).y-this.Bc.M().y)/2}fitTo(t){return this.Bc.S(t),this.Oc=!0,this.As.Ss(),this}}class Rn extends Bn{constructor(t,i,s,r,n){super(t,i,s,sn.Simple,r,n),this.Lc=p(u(0,0)),this.Rc=p(10),this.Ec=p(void 0),this.gc=p(e.UIDirections.Right),this.Tc()}setDirection(t){return this.gc.S(t),this.As.Ss(),this}getDirection(){return this.gc.M()}setPointerLength(t){return this.Rc.S(t),this.As.Ss(),this}getPointerLength(){return this.Rc.M()}setPointerAngle(t){return this.Ec.S(t),this.As.Ss(),this}getPointerAngle(){let t=this.Ec.M();if(void 0===t){const e=this.zc();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)}hc(t){return this.Lc.S(t),this.As.Ss(),this}Vc(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}Nc(){return Kt(this.gc.M())?this.Lc.M().x:this.Lc.M().y}zc(){return Kt(this.gc.M())?this.Lc.M().y:this.Lc.M().x}rc(){switch(this.gc.M()){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.Vc()-this.zc());default:return 0}}nc(){switch(this.gc.M()){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.Vc()-this.zc());default:return 0}}ac(){switch(this.gc.M()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Vc()-this.zc());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}oc(){switch(this.gc.M()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Vc()-this.zc());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}Fc(){const t=qt(this.gc.M()),e=ei(u(0,0),t),i=this.getPointerLength(),s=this.Vc(),r=this.Nc(),n=this.zc();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=ri(ri(o,si(t,-i)),si(e,s/2)),a=ri(h,si(e,(n-s)/2)),l=ri(a,si(t,-r)),c=ri(ri(o,si(t,-i)),si(e,-s/2)),d=ri(c,si(e,-(n-s)/2)),f=ri(d,si(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 Vn extends In{setSize(t){return this.setContentSize(t),this.As.Ss(),this}}class Nn extends mn{constructor(){super(...arguments),this.Gc=[],this.Wc=0,this.Hc=t=>{const e=this.Gc.indexOf(t);e>=0&&this.Gc.splice(e,1)}}getMembers(){return this.Gc}getMemberCount(){return this.Gc.length}setMinimumSize(t){return this.Uc=t,this.As.Ss(),this}getMinimumSize(){return this.Uc}addElement(t,e=-1){const i=t.vc(this.As,this.renderingScale,this.scale,this.Hc,this.Ji,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.Gc.splice(e,0,i):this.Gc.push(i),i.setVisible(this.getVisible()),this.ju(i),this.Ti&&(pe(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.Gc.slice().forEach(wt),this}setVisible(t){return super.setVisible(t),this.Gc.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof Vn)),0),s=i>0?(this.size.x-this.Wc)/i:0;return this.Gc.reduce(((e,i)=>i instanceof Vn?this.scale.Jt({x:e,y:t.y},{x:s+i.getSize().x,y:0}).x:i.setOrigin(u(-1,1)).setPosition(u(e,t.y)).Ae().getPosition(u(1,0)).x),t.x),this}Ts(){for(let t=0;tt+ +(e instanceof Vn)),0),s=i>0?(this.size.y-this.Wc)/i:0;return this.Gc.reduce(((e,i)=>i instanceof Vn?this.scale.Jt({x:t.x,y:e},{x:0,y:-(s+i.getSize().y)}).y:i.setOrigin(u(-1,1)).setPosition(u(t.x,e)).Ae().getPosition(u(0,-1)).y),t.y),this}Ts(){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},qn=$n("Text",[]),Kn={button:void 0,isLocked:!1,setOn(t){if(!this.isLocked){const e=this.button.getOn()!==t;this.button.setOn(t),e&&this.P.emit("switch",t)}return this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.P.on("switch",(e=>t(this,e)))},offSwitch(t){return this.P.off(t,"switch")},setButtonOffFillStyle(t){return this.button.setOffFillStyle(t),this},getButtonOffFillStyle(){return this.button.getOffFillStyle()},setButtonOffStrokeStyle(t){return this.button.setOffStrokeStyle(t),this},getButtonOffStrokeStyle(){return this.button.getOffStrokeStyle()},setButtonOffSize(t){return this.button.setOffSize(t),this},getButtonOffSize(){return this.button.getOffSize()},setButtonOnFillStyle(t){return this.button.setOnFillStyle(t),this},getButtonOnFillStyle(){return this.button.getOnFillStyle()},setButtonOnStrokeStyle(t){return this.button.setOnStrokeStyle(t),this},getButtonOnStrokeStyle(){return this.button.getOnStrokeStyle()},setButtonOnSize(t){return this.button.setOnSize(t),this},getButtonOnSize(){return this.button.getOnSize()}},Zn={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()}},Qn={...An,...Tn,background:Dn,vc(t,e,i,s,r,n){const o=new Gn(t,e,i,this.background,s,r),h=o.addElement(Ln,void 0),a=Object.assign(o,Jn,{setTextLabel:h},qn,{stylableTexts:[h]});return Mn(a,r,n),this.applyStylers(a,r)}}.addStyler(bn),to={...An,...Tn,background:Rn,vc(t,i,s,r,n,o){const h=new Gn(t,i,s,this.background,r,n),a=h.addElement(Ln,void 0),l=h.getBackground(),u=Object.assign(h,Jn,{setTextLabel:a},qn,{stylableTexts:[a]},Zn,{pointable:l},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?this.setPadding({top:t}):this.getDirection()===e.UIDirections.Down?this.setPadding({bottom:t}):this.getDirection()===e.UIDirections.Right?this.setPadding({right:t}):this.getDirection()===e.UIDirections.Left&&this.setPadding({left:t}),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.Mc="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))),Mn(u,n,o),this.applyStylers(u,n)}};class eo extends yn{constructor(t,e,i,s,n,o,h){super(t,e,i,o,h),this.Fs=!1,this.P=new r.Eventer,this.getOn=()=>this.Fs,this.jc=this.ju(new s(this.As,this.renderingScale,this.scale,Et,h)),this.Yc=this.ju(new n(this.As,this.renderingScale,this.scale,Et,h))}tc(){return[...this.jc.tc(),...this.Yc.tc()]}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setOn(t){return this.Fs=t,this.As.Ss(),this}setOffFillStyle(t){return this.jc.setFillStyle(t),this}getOffFillStyle(){return this.jc.getFillStyle()}setOffStrokeStyle(t){return this.jc.setStrokeStyle(t),this}getOffStrokeStyle(){return this.jc.getStrokeStyle()}setOffSize(t){return this.jc.fitTo("number"==typeof t?u(t,t):t),this}getOffSize(){return this.jc.getSize()}setOnFillStyle(t){return this.Yc.setFillStyle(t),this}getOnFillStyle(){return this.Yc.getFillStyle()}setOnStrokeStyle(t){return this.Yc.setStrokeStyle(t),this}getOnStrokeStyle(){return this.Yc.getStrokeStyle()}setOnSize(t){return this.Yc.fitTo("number"==typeof t?u(t,t):t),this}getOnSize(){return this.Yc.getSize()}Ae(){return super.Ae(),this.Fs?(this.jc.setVisible(!1),this.Yc.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).Ae()):(this.jc.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).Ae(),this.Yc.setVisible(!1)),this}Ts(){const t=this.jc.Ts().getSize(),e=this.Yc.Ts().getSize();return this.setContentSize(u(Math.max(t.x,e.x),Math.max(t.y,e.y))),super.Ts()}dispose(){return super.dispose(),this.jc.dispose(),this.Yc.dispose(),this}setMouseInteractions(t){return this.Yc.setMouseInteractions(t),this.jc.setMouseInteractions(t),this}getMouseInteractions(){return this.Yc.getMouseInteractions()}setHighlight(t){const e=ve(t);return this.Yc.setHighlight(e),this.jc.setHighlight(e),this.P.emit("highlight",t),this.As.Ss(),this}getHighlight(){return this.Yc.getHighlight()}}const io={...An,uiElement:eo,pictureOff:zn,pictureOn:zn,setPictureOff(t){return{...this,pictureOff:t}},setPictureOn(t){return{...this,pictureOn:t}},vc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.pictureOff,this.pictureOn,s,r),r);return Mn(o,r,n),o}},so={...An,...Tn,background:Dn,buttonBuilder:io,setPictureOff(t){return{...this,buttonBuilder:this.buttonBuilder.setPictureOff(t)}},setPictureOn(t){return{...this,buttonBuilder:this.buttonBuilder.setPictureOn(t)}},vc(t,i,s,r,n,o){const h=new Gn(t,i,s,this.background,r,n),a=h.addElement(Yn);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Yn);u.addGap();const c=u.addElement(Ln);u.addGap(),h.addGap();const d=Object.assign(h,Jn,{setTextLabel:c},qn,{stylableTexts:[c]},Kn,{button:l});return d.onMouseClick(((t,e)=>{d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setPadding({left:6}),Mn(d,n,o),this.applyStylers(d,n)}}.addStyler(bn).addStyler(vn);class ro extends yn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Xc=[],this.Zc=2,this.Kc="",this.qc=(t,e)=>void 0!==t.label?t.label:Ii(t.value,e.min,e.max),this.Jc=0,this.Qc=0,this.td=!1,this.As=t,this.sd=n,this.ed=this.ju(t._e(e).ve(st)),this.hd=this.ju(t.Sr(e).Me(r.uiTextFillStyle).Ih(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.rd=140,this.nd=25):(this.rd=160,this.nd=15)}tc(){return[this.ed,this.hd]}od(t){this.ad=t;const e=ho(t,"vertical"===this.sd?0:90,this.td);return this.ed.Me(e),this.As.Ss(),this}ld(){return this.ad}ud(t){return this.rd=t,this.As.Ss(),this}dd(){return this.rd}fd(t){return this.nd=t,this.As.Ss(),this}gd(){return this.nd}pd(t){return this.Kc=t,this.As.Ss(),this}md(){return this.Kc}yd(t){return this.qc=t,this.As.Ss(),this}setLUTDisplayProportionalSteps(t){if(this.td=t,this.ad){const t=ho(this.ad,"vertical"===this.sd?0:90,this.td);this.ed.Me(t)}return this.As.Ss(),this}getLUTDisplayProportionalSteps(){return this.td}setFillStyle(t){return this.hd.Me(t),this.As.Ss(),this}getFillStyle(){return this.hd.Th()}setFont(t){return this.hd.Ih(t),this.As.Ss(),this}getFont(){return this.hd.Fh()}setTextRotation(t){return this.Qc=t,this.hd.Ph(t),this.As.Ss(),this}getTextRotation(){return this.hd.Dh()}Ae(){var t,i,s,r;if(super.Ae(),this.Ti)return this;const n=this.ad;if(n){const o=this.renderingScale.Ai(),h=n.min,a=n.max;if("vertical"===this.sd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=ri(s,{x:this.ed.Ht().x+this.Zc*o.x,y:0}),l={x:r.x,y:r.y+(this.Kc.length>0?this.Jc*o.y+this.hd.Ht().y:0)+.5*((null===(t=this.Xc[0])||void 0===t?void 0:t.Ht().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Xc[this.Xc.length-1])||void 0===i?void 0:i.Ht().y)||0)};this.ed.we({x:s.x,y:l.y}),this.hd.Sa({x:-1,y:-1}).we(r),n.getSteps().forEach(((t,e)=>{const i=Ue(l,u,this.td?!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.Xc[e].Sa({x:-1,y:0}).we(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.Xc.reduce(((t,e)=>Math.max(t,e.Ht().y)),0),u=ri(t,{x:.5*((null===(s=this.Xc[0])||void 0===s?void 0:s.Ht().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Xc[this.Xc.length-1])||void 0===r?void 0:r.Ht().x)||0)+(this.Kc.length>0?this.Jc*o.x+this.hd.Ht().x:0)),y:u.y},f={x:u.x,y:u.y+this.Zc*o.y};this.ed.we(f),this.hd.Sa({x:1,y:1}).we(c),n.getSteps().forEach(((t,e)=>{const i=Ue(u,d,this.td?!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.Xc[e].Sa({x:0,y:1}).we(i)}))}}return this}Ts(){if(this.ad&&this.getVisible()){const t=this.ad.getSteps();for(let e=this.Xc.length;eMath.max(t,e.Ts().Ic().x)),0),this.hd.Ts().Ic().x),s=(this.Kc.length>0?this.Jc+this.hd.Ts().Ic().y:0)+e+.5*this.Xc[0].Ts().Ic().y+.5*this.Xc[this.Xc.length-1].Ts().Ic().y;this.setContentSize({x:i,y:s})}else{const t=this.rd,e=this.nd;this.ed.q({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Kc.length>0?this.Jc+this.hd.Ts().Ic().x:0,.5*this.Xc[this.Xc.length-1].Ts().Ic().x),s=t+.5*this.Xc[0].Ts().Ic().x+i,r=e+this.Zc+this.Xc.reduce(((t,e)=>Math.max(t,e.Ts().Ic().y)),0);this.setContentSize({x:s,y:r})}}else this.Xc.forEach((t=>t.dispose())),this.Xc.length=0,this.hd.setVisible(!1),this.ed.setVisible(!1),this.setContentSize({x:0,y:0});return super.Ts()}dispose(){return super.dispose(),this.ed.dispose(),this.Xc.forEach(wt),this.hd.dispose(),this}setMouseInteractions(t){return this.ed.setMouseInteractions(t),this}getMouseInteractions(){return this.ed.getMouseInteractions()}}const no={lutElement:{},setLUT(t){return this.lutElement.od(t),this},getLUT(){return this.lutElement.ld()},setLUTLength(t){return this.lutElement.ud(t),this},getLUTLength(){return this.lutElement.dd()},setLUTThickness(t){return this.lutElement.fd(t),this},getLUTThickness(){return this.lutElement.gd()},setLookUpUnit(t){return this.lutElement.pd(t),this},getLookUpUnit(){return this.lutElement.md()},setLUTStepValueFormatter(t){return this.lutElement.yd(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},oo={...An,...Tn,background:Dn,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},vc(t,e,i,s,r,n){const o=new Hn(t,e,i,this.background,s,r),h=o.addElement({vc:()=>new ro(t,e,i,Et,r,this.alignment)}),a=Object.assign(o,qn,{stylableTexts:[h]},no,{lutElement:h});return Mn(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 tt({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 ro(t,i,s,Et,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,Jn,{setTextLabel:c},qn,{stylableTexts:[c,d]},$n("LUTText",[d]),Kn,{button:l},no,{lutElement:d});return f.onMouseClick((()=>{f.setOn(!f.getOn())})),f.onMouseEnter((()=>f.setHighlight(!0))),f.onMouseLeave((()=>f.setHighlight(!1))),f.setMouseStyle(e.MouseStyles.Point),f.setPadding({left:6}),this.applyStylers(f,n)}}.addStyler(bn).addStyler(vn),lo={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=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return this.legendBoxDisposed()||(t instanceof Vh?this.addChart(t,i,s):"attach"in t?this.addAttachable(t,i,s):t&&this.addDashboard(t,i,s)),this},addAttachable(t,e,i){const s=t.ld&&t.ld();let r=i;r||(r=s?ao.setAlignment(this.alignment):so);const n=this.addElement(r);if(s&&"setLUT"in n){n.setLUT(s.lut);const t=s.lut.getUnits(),e=s.lookUpProperty,i=t.length>0?t:"x"===e?"x":"y"===e?"y":"z"===e?"z":"";n.setLookUpUnit(i)}return this.entryStylers.forEach((t=>t(n))),this.entries.push({entry:n,component:t}),t.attach(n,e),this},addChart(t,e,i){return t.Sd().forEach((t=>this.addAttachable(t,e,i))),this},addDashboard(t,e,i){return t.getCells().filter((t=>t.panel instanceof Vh)).forEach((t=>this.addChart(t.panel,e,i))),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}},uo={alignment:"vertical",layoutBuilder:Yn,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?jn:Yn}},getAlignment(){return this.alignment},titleBuilder:Qn,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},co={...An,...Tn,...uo,background:Dn,vc(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).vc(t,e,i,s,r,!1);let h=Object.assign(o,lo,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.Ti});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Yn:jn),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}),Mn(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class fo extends yn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.xd=10,this.bd=e.UIDirections.Up,this.vd=0,this.Mc="major",this.$o=this.ju(t.Sr(this.renderingScale)),this.Ie=this.ju(t.De(this.renderingScale))}tc(){return[this.$o]}Ae(){if(super.Ae(),this.Ti)return this;const t=at(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.Jt(t,{x:this.bd===e.UIDirections.Right?-this.xd:this.bd===e.UIDirections.Left?this.xd:0,y:this.bd===e.UIDirections.Up?-this.xd:this.bd===e.UIDirections.Down?this.xd:0}),s=this.renderingScale.Jt(i,{x:this.bd===e.UIDirections.Right?-this.vd:this.bd===e.UIDirections.Left?this.vd:0,y:this.bd===e.UIDirections.Up?-this.vd:this.bd===e.UIDirections.Down?this.vd:0});return this.Ie.Oe(t).Be(i),this.$o.we(s).Sa(this.bd===e.UIDirections.Up?{x:0,y:1}:this.bd===e.UIDirections.Down?{x:0,y:-1}:this.bd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Ts(){const t=this.Ie.Yl().getThickness();return this.size=this.bd===e.UIDirections.Left||this.bd===e.UIDirections.Right?{x:this.xd+this.vd+this.$o.Ts().Ic().x,y:t}:{y:this.xd+this.vd+this.$o.Ts().Ic().y,x:t},super.Ts()}dispose(){return super.dispose(),this.$o.dispose(),this.Ie.dispose(),this}setVisible(t){return super.setVisible(t),this.$o.setVisible(t),this.Ie.setVisible(t),this}setMouseInteractions(t){return this.$o.setMouseInteractions(t),this.Ie.setMouseInteractions(t),this}getMouseInteractions(){return this.$o.getMouseInteractions()}getText(){return this.$o.wh()}setTextFillStyle(t){return this.$o.Me(t),this.As.Ss(),this}getTextFillStyle(){return this.$o.Th()}setTextFont(t){return this.$o.Ih(t),this}setTextRotation(t){return this.$o.Ph(t),this}getTextRotation(){return this.$o.Dh()}getTextFont(){return this.$o.Fh()}setText(t){return this.$o.Ch(t),this.As.Ss(),this}setDirection(t){return this.bd=t,this.As.Ss(),this}getDirection(){return this.bd}setPointerLength(t){return this.xd=t,this.As.Ss(),this}getPointerLength(){return this.xd}setTickLabelPadding(t){return this.vd=t,this.As.Ss(),this}getTickLabelPadding(){return this.vd}setTickStyle(t){return this.Ie.Pe(t),this.As.Ss(),this}getTickStyle(){return this.Ie.Yl()}}const go={...An,vc(t,e,i,s,r,n){const o=new fo(t,e,i,s,r);return Mn(o,r,n),this.applyStylers(o,r)}}.addStyler(bn),yo=go.addStyler(((t,e)=>(t.Mc="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)))),mo=go.addStyler(((t,e)=>(t.Mc="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)))),po=so.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),So=co.setAlignment("horizontal"),xo=co.setAlignment("vertical"),bo={TextBox:Qn,CheckBox:so,ButtonBox:po,PointableTextBox:to,AxisTickMajor:yo,AxisTickMinor:mo,LUTRange:oo},vo={HorizontalLegendBox:So,VerticalLegendBox:xo},Mo=(t,e,i)=>t*(1-i)+e*i,Ao=(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=Mo(i.value,r.value,n),c=Mo(e.value,s.value,h);return Mo(c,u,l)},To={warm:t=>e=>E(60/(t-1)*e,.8,.8),cold:t=>e=>E(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>E(360/t*e,.8,.8),reverseSpectrum:t=>e=>E(360/t*(t-e),.8,.8),flatUI:t=>e=>E(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return E(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return E(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return E(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return E(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return E(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>E(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return E(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return E(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),E(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return E(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=>E(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>wo([{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=>wo([{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=>wo([{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=>wo([{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=>wo([{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=>wo([{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)},wo=(t,e,i)=>{const s=Io(e,i),[r,n]=Co(s,t),o=Eo(t[r]),h=Eo(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:Mo(o.h,h.h,a),s:Mo(o.s,h.s,a),v:Mo(o.v,h.v,a)};return E(l.h,l.s,l.v)},Eo=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},Co=(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),Ro={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},Vo=s.Record({type:"linestyle",lineType:"dashed",pattern:Ro.DashedEqual,fillStyle:new V({color:T(255,255,255)}),thickness:1,patternScale:3}),No=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),Go=s.Record({type:"icon",width:void 0,height:void 0,Md:void 0,_d:Et,Ad:Et});class Ho extends Go{constructor(t,e,i,s){super({...s,Md:t,_d:e,Ad:i})}dispose(){return this.Ad(this),this}setWidth(t){const e=this.set("width",t);return this._d(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this._d(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this._d(i),i}Ht(){if(!this.Md)return{x:0,y:0};const t=this.Md.width,e=this.Md.height,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 Uo=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),Wo=s.Record({type:"glow",color:T(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class Xo extends Wo{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")}}const Yo=(t,e)=>{if(Oi(t)){const i=e.do(t);return{x:i.engineX,y:i.engineY}}return t},jo=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}},Jo=(t,e,i,s=1)=>Ct(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),$o=(t,e,i,s=1)=>{const r=i.ut(t),n=i.ut(e);return Ct(i.ot(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)};class qo extends qs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this.wd=r,this.kd=n}}class Ko extends $s{constructor(t,i,s,n,o,h,a,l,c,d,f,g,y,m,p,S,x){var b;super(f,d,l,p,S,{numeric:d.getWidth({x:p.xAxisNumericTicks,y:p.yAxisNumericTicks}),datetime:d.getWidth({x:p.xAxisDateTimeTicks,y:p.yAxisDateTimeTicks}),time:d.getWidth({x:p.xAxisTimeTicks,y:p.yAxisTimeTicks})},x),this.Cd=new Map,this.Td=void 0,this.Fd=0,this.Id=[],this.Pd=[],this.je=zs.fitting,this.Dd=!0,this.Bd=0,this.Od=8,this.Ld=void 0,this.Rd=void 0,this.Ed=20,this.zd=1,this.Vd=!0,this.Nd=!0,this.Gd=!0,this.Wd=!0,this.Hd=!0,this.Ud=!0,this.$d=!0,this.jd=!0,this.Yd=!0,this.Xd=!0,this.Zd=this.yh.defaultDragMouseStyle,this.Kd=this.yh.defaultDragMouseStyle,this.qd=this.yh.defaultDragMouseStyle,this.Jd=this.yh.defaultDragMouseStyle,this.Qd=this.yh.defaultDragMouseStyle,this.P=new r.Eventer,this.tf=[],this.if=t=>{const e=this.Pd.indexOf(t);e>=0&&this.Pd.splice(e,1)},this.sf=t=>(this.Pd.indexOf(t)<0&&this.Pd.push(t),this.if),this.Yi=(t,e)=>this.P.emit("axisAreaTouch",this,e),this.ef=ee(this.tf),this.onAxisInteractionAreaMouseClick=t=>this.P.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.P.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.P.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.P.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.P.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.P.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.P.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.P.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.P.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.P.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.P.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.P.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.P.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.P.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.P.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.P.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.P.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.P.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.P.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.P.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.P.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.P.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.P.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.P.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.P.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.P.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.P.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.P.off(t,"axisAreaTouchEnd"),this.hf=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().wc()):t,this.rf=t=>{const e=this.Id.indexOf(t);-1!==e&&this.Id.splice(e,1)},this.nf=(t,e)=>{this.P.emit("axisAreaDoubleClick",this,e),this.Wd&&(this.setStopped(!1),Zt(e))},this.af=t=>{this.P.emit("axisAreaMouseEnter",this),(this.Nd||this.Vd||this.Gd||this.Wd)&&this.lf(t)},this.uf=t=>{this.cf(t),this.P.emit("axisAreaMouseLeave",this)},this.df=(t,e,i)=>{var s,r;this.P.emit("axisAreaMouseDragStart",this,e,i);const n=Lt(null===(s=this.chart.ff.In)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Lt(null===(r=this.chart.ff.In)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Nd?(this.gf(t),Zt(e)):i===n&&this.Vd&&(this.pf(t,h),Zt(e))},this.mf=(t,e,i,s,r)=>{var n,o;this.P.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Lt(null===(n=this.chart.ff.In)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Lt(null===(o=this.chart.ff.In)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Nd?(this.yf(t,r),Zt(e)):i===h&&this.Vd&&(this.Sf(t,s,l,r),Zt(e))},this.xf=(t,e,i,s)=>{var r,n;this.P.emit("axisAreaMouseDragStop",this,e,i,s);const o=Lt(null===(r=this.chart.ff.In)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Lt(null===(n=this.chart.ff.In)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Nd?(this.bf(t),Zt(e)):i===o&&this.Vd&&(this.vf(t,s,a),Zt(e)),t.getIsUnderMouse()&&(this.Nd||this.Vd||this.Gd||this.Wd)&&this.lf(t)},this.Mf=(t,e)=>{if(this.P.emit("axisAreaMouseWheel",this,e),this.Gd){this.setStopped(!0);const t=this.yh.getWidth(this._f.ls.Ce(e.clientX,e.clientY)),i=this.ct.ot(t);this.zoom(i,me(e)),Zt(e)}},this.Af=(t,e)=>this.P.emit("axisAreaMouseClick",this,e),this.wf=(t,e)=>this.P.emit("axisAreaMouseDown",this,e),this.kf=(t,e)=>this.P.emit("axisAreaMouseUp",this,e),this.Cf=(t,e)=>this.P.emit("axisAreaMouseMove",this,e),this.Tf=(t,e,i)=>{this.P.emit("axisAreaTouchStart",this,i),this.Vd&&(this.lf(t),this.pf(t,e),Zt(i))},this.Ff=(t,e,i,s,r)=>{this.P.emit("axisAreaTouch",this,r),this.Vd&&(this.Sf(t,e,i,s),Zt(r))},this.If=(t,e,i,s)=>{this.P.emit("axisAreaTouchEnd",this,s),this.Vd&&(this.vf(t,e,i),this.cf(t),Zt(s))},this.Pf=(t,e,i,s)=>{(this.Nd||this.Gd)&&(this.lf(t),this.gf(t),Zt(s))},this.Df=(t,e,i,s,r,n)=>{if(this.Nd){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.yf(t,e),Zt(n)}if(this.Gd){const t=this._f.ls.Ce(e.x,e.y),o=this._f.ls.Ce(i.x,i.y),h=Math.abs(this.yh.getWidth(ni(t,s))-this.yh.getWidth(ni(o,r)))-Math.abs(this.yh.getWidth(t)-this.yh.getWidth(o)),a=this.ct.Jt(this._h,-h),l=this.ct.Jt(this.Ah,h);this.mh(a,l),Zt(n)}},this.Bf=(t,e,i,s)=>{(this.Nd||this.Gd)&&(this.bf(t),this.cf(t),Zt(s))},this.Of=(t,e)=>{(this.Hd||this.Ud)&&this.Lf(t)},this.Rf=(t,e)=>{this.Ef(t)},this.zf=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Hd&&this.Vf(t,s)},this.Nf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Hd&&this.Gf(t,n,s,r)},this.Wf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Hd&&this.Hf(t,n,s,r)},this.Uf=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.Hd||this.Ud)&&this.$f(t,r,s),(this.Hd||this.Ud)&&this.Lf(t)},this.jf=(t,e)=>{this.Ud&&(this.setStopped(!0),this.zoom(this._h,me(e)),Zt(e))},this.Yf=(t,e)=>{this.Ud&&(this.setStopped(!0),this.zoom(this.Ah,me(e)),Zt(e))},this.Xf=(t,e,i)=>{this.Hd&&(this.Lf(t),this.Vf(t,e),Zt(i))},this.Zf=(t,e,i,s,r)=>{this.Hd&&(this.Gf(t,e,i,s),Zt(r))},this.Kf=(t,e,i,s,r)=>{this.Hd&&(this.Hf(t,e,i,s),Zt(r))},this.qf=(t,e,i,s)=>{this.Hd&&(this.$f(t,e,i),this.Ef(t),Zt(s))},this.wd=t,this.Jf=i,this._f=s,this.Qf=o,this.tg=h,this.chart=f,this.ig=y,this.sg=n,this.ts=a,m(this,this.sf),l.eg=this,this.hg=g,this.rg=this.hg>50?1:-1,this.ng=(b=this.yh.toPoint(0,-this.rg),Math.abs(b.x)>=Math.abs(b.y)?b.x>=0?e.UIDirections.Right:e.UIDirections.Left:b.y>=0?e.UIDirections.Up:e.UIDirections.Down),this.og=c,this.ag=this.ct instanceof Pi?(new _i).yi(this.yh.toVec2(this.ct,this.og)):(new Li).yi(this.yh.toVec2(this.ct,this.og)),this.lg=this.chart.pixelScale,this.ug=(new _i).yi(this.yh.toVec2(this.yh.getWidth(this.lg),this.og)),this.cg=this._f.De(this.ag).setMouseInteractions(!1),this.dg=this._f.De(this.ag).setMouseInteractions(!1),this.gg=this._f.De(this.ag).setMouseInteractions(!1),this.pg=this.sg._e(this.lg).Me(d.getWidth({x:p.xAxisOverlayStyle,y:p.yAxisOverlayStyle})).ve(st).Fo(p.highlightColorOffsetAxisOverlay||p.highlightColorOffset),this.mg=this.sg._e(this.lg).Me(d.getWidth({x:p.xAxisZoomingBandFillStyle,y:p.yAxisZoomingBandFillStyle})).ve(d.getWidth({x:p.xAxisZoomingBandStrokeStyle,y:p.yAxisZoomingBandStrokeStyle})),this.yg=this.sg._e(this.lg).Me(d.getWidth({x:p.xAxisOverlayStyle,y:p.yAxisOverlayStyle})).ve(st).Fo(p.highlightColorOffsetAxisOverlay||p.highlightColorOffset),this.Sg=this.sg._e(this.lg).Me(d.getWidth({x:p.xAxisOverlayStyle,y:p.yAxisOverlayStyle})).ve(st).Fo(p.highlightColorOffsetAxisOverlay||p.highlightColorOffset),this.kh=this.sg.Sr(this.ag).setMouseInteractions(!1).Ph(this.yh.getTitleTextRotation(this.rg)),this.chart.ls.os.ns(this.pg,(t=>this.pg.us(t)),{animationEnabled:this.Ze}),this.chart.ls.os.ns(this.yg,(t=>this.yg.us(t)),{animationEnabled:this.Ze}),this.chart.ls.os.ns(this.Sg,(t=>this.Sg.us(t)),{animationEnabled:this.Ze});const v=Wi(new Yi(this.Tf,this.Ff,this.If,1),new ji(this.Pf,this.Df,this.Bf),new Xi(this.nf)),M=Wi(new Yi(this.Xf,this.Zf,this.qf)),A=Wi(new Yi(this.Xf,this.Kf,this.qf));this.pg.setMouseEnterEventHandler(this.af).setMouseLeaveEventHandler(this.uf).setMouseDragStartEventHandler(this.df).setMouseDragEventHandler(this.mf).setMouseDragStopEventHandler(this.xf).setMouseWheelEventHandler(this.Mf).setMouseDoubleClickEventHandler(this.nf).setMouseClickEventHandler(this.Af).setMouseDownEventHandler(this.wf).setMouseUpEventHandler(this.kf).setMouseMoveEventHandler(this.Cf).setTouchStartEventHandler(v.onTouchStart).setTouchMoveEventHandler(v.onTouchMove).setTouchEndEventHandler(v.onTouchEnd),this.yg.setMouseEnterEventHandler(this.Of).setMouseLeaveEventHandler(this.Rf).setMouseDragStartEventHandler(this.zf).setMouseDragEventHandler(this.Nf).setMouseDragStopEventHandler(this.Uf).setMouseWheelEventHandler(this.jf).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.Sg.setMouseEnterEventHandler(this.Of).setMouseLeaveEventHandler(this.Rf).setMouseDragStartEventHandler(this.zf).setMouseDragEventHandler(this.Wf).setMouseDragStopEventHandler(this.Uf).setMouseWheelEventHandler(this.Yf).setTouchStartEventHandler(A.onTouchStart).setTouchMoveEventHandler(A.onTouchMove).setTouchEndEventHandler(A.onTouchEnd),this.cg.Pe(d.getWidth({x:p.xAxisStrokeStyle,y:p.yAxisStrokeStyle})),this.dg.Pe(d.getWidth({x:p.xAxisNibStyle,y:p.yAxisNibStyle})),this.gg.Pe(d.getWidth({x:p.xAxisNibStyle,y:p.yAxisNibStyle})),this.kh.Me(d.getWidth({x:p.xAxisTitleFillStyle,y:p.yAxisTitleFillStyle})).Ih(d.getWidth({x:p.xAxisTitleFont,y:p.yAxisTitleFont})),this.ss=a.es(this,{}),this.Bh=this.ss.xg([this.kh]).ys(p.effectsText)}mr(){return this.Je}yr(){return void 0!==this.Nh}setTickStrategy(t,e){return super.Mh(t,e)}getTickStrategy(){return this.He}addBand(t=!0){const e=t?this.tg:this.Qf,i=new Ls(e,this.chart,this.ef,this,this.ag,this.yh,this.Ji,this.ts);return this.tf.push(i),i}addConstantLine(t=!0){const e=t?this.tg:this.Qf,i=new Ds(e,this.chart,this.ef,this,this.ag,this.yh,this.Ji,this.ts);return this.tf.push(i),i}bg(t){this.tf.forEach(t)}vg(t){return this.tf.map(t)}getHighlighters(){return this.tf}setThickness(t){return"number"==typeof t?(this.Mg=t,this._g=t):"object"==typeof t&&(this.Mg=t.min,this._g=t.max),this.wd.Ss(),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)}Ag(){return this.Pd}Qh(t,e){return new qo(e,t,this._f,this.ag,this.wd,this.ag)}Oh(){if(this.Cd){for(const t of this.Cd)t[1].grid.dispose(),t[1].tick.dispose();this.Cd.clear()}super.Oh()}tr(t,e){const{tickStart:i}=e,s=t.dh.Jh,r=i+s.getTickLength()*this.rg+s.getTickPadding()*this.rg;t.Ve.we(this.yh.toPoint(t.u,r)).Sa(this.yh.toPoint(s.getLabelAlignment(),-this.rg)).Ph(s.labelRotation).setVisible(this.getVisible())}wg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.dh.Jh,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.rg;return{gridStroke:{start:this.yh.toPoint(t.u,r),end:this.yh.toPoint(t.u,h)},tickStroke:{start:this.yh.toPoint(t.u,n),end:this.yh.toPoint(t.u,a)}}}kg(t,e,i,s){return this.wd.De(this.ag).Pe(new $i({fillStyle:new V({color:E(360*(1-s))}),thickness:5})).Oe(this.yh.toVec2(t,0)).Be(this.yh.toVec2(t,this.rg*(50*s)))}dr(t,e){return"linear"===this.xh.type?Jo(t,e,this.ct):$o(t,e,this.ct)}Cg(t,e){return e instanceof Pi?Jo:$o}pr(t,e,i){if("logarithmic"!==this.xh.type){const s=this.ct.mi(e-t);return{min:t-i*s,max:e+i*s}}const s=this.ct;return{min:s.Jt(t,-i),max:s.Jt(e,i)}}Ae(t,e,i){const s=this.cg.Yl(),r=this.ct.getInnerStart()this.ct.getInnerStart()?this.ct.getInnerEnd():this.ct.getInnerStart(),o=this.ct.Gt(),h=this.og.getInnerInterval(),a=s.getThickness()*this.rg/2,l=this.hg/100*h,u=l+t,c=u+a,d=h*this.rg,f=c+a,g=this.Id.reduce(this.hf,0);let y,m=0;if(this.Fi||this.Oh(),this.We!==Ns&&this.Fi){const t=this.ct.Gt();this.Hh({physicalAxisSize:t,startPosition:l,gridStrokeLen:d,gridStrokeStart:u,tickStart:f});for(const[e,i]of this.Ue){let s=this.Cd.get(e);if(!s)if(e.Le)s={grid:this.wd.Tg(this.ag).setMouseInteractions(!1),tick:this.wd.Tg(this.ag).setMouseInteractions(!1)};else if("Fg"in e){const t=Array.from(this.Ue.keys()).filter((t=>"Fg"in t)).reverse().indexOf(e),i=this.Jf[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.Tg(this.ag).setMouseInteractions(!1),tick:i.Tg(this.ag).setMouseInteractions(!1)}}if(s){s.grid.Ha(),s.tick.Ha();for(const[e,r]of i){const e=this.wg(r,{physicalAxisSize:t,startPosition:l,gridStrokeLen:d,gridStrokeStart:u,tickStart:f});s.grid.kr().Ig(e.gridStroke.start,e.gridStroke.end),s.tick.kr().Ig(e.tickStroke.start,e.tickStroke.end)}s.grid.Pe(e.Jh.getGridStrokeStyle()),s.tick.Pe(e.Jh.getTickStyle()),this.Cd.set(e,s)}}for(const t of this.Ue.values()){let e=Pe;for(const i of t.values()){const t=i.dh.Jh,s=this.yh.getHeight(i.Ve.Ht()),r=t.getTickLength()+t.getTickPadding()+s+t.getLabelPadding();e=Math.max(e,r)}m=Math.max(m,e)}y=f+Math.max(m,g)*this.rg}else m=0,y=f+g*this.rg;this.cg.Oe(this.yh.toPoint(r,c)).Be(this.yh.toPoint(n,c)),this.dg.Oe(this.yh.toPoint(this.ct.Jt(this.ct.getInnerStart(),this.Od),c)).Be(this.yh.toPoint(this.ct.getInnerStart(),c)),this.gg.Oe(this.yh.toPoint(this.ct.Jt(this.ct.getInnerEnd(),-this.Od),c)).Be(this.yh.toPoint(this.ct.getInnerEnd(),c));const p=this.kh&&this.kh.wh().length>0?this.yh.getHeight(this.kh.Ts().Ht()):0,S=y+.5*p*this.rg;this.kh.we(this.yh.toPoint(this.ct.Jt(this.ct.getInnerStart(),o/2),S));const x=f,b=x+this.rg*this.Fd,v=this.Hd||this.Ud?Math.min(this.Ed,.25*o):0,M={start:this.yh.toVec2(this.ct.Jt(this.ct.getInnerStart(),v),x),end:this.yh.toVec2(this.ct.Jt(this.ct.getInnerEnd(),-v),b)};if(this.Td){const e=this.hg/100*h+t,i=-this.rg*h-t,s={start:this.yh.toVec2(this.Td.min,f+this.rg*this.Fd),end:this.yh.toVec2(this.Td.max,e+i)},r=at(s.start,this.ag,this.lg),n=at(s.end,this.ag,this.lg);this.mg.we(r).q(ni(n,r)).setVisible(!0)}else this.mg.setVisible(!1);const A=at(this.yh.toVec2(this.ct.getInnerStart(),b),this.ag,this.lg),T=at(M.start,this.ag,this.lg),w=at(M.end,this.ag,this.lg),E=at(this.yh.toVec2(this.ct.getInnerEnd(),x),this.ag,this.lg);this.pg.we(T).q(ni(w,T)),this.yg.we(A).q(ni(T,A)),this.Sg.we(w).q(ni(E,w));for(const e of this.Id)e.update().plot(u,d,t,f);for(const t of this.tf)t.Ae();const I=s.getThickness()+Math.max(m,g)+(this.kh&&this.kh.wh().length>0?p+this.Bd:0);return this.Fd=Ct(I,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:ke),this}Pg(t){const e=this.cg.Yl().getThickness()*this.rg/2,i=this.og.getInnerInterval(),s=this.hg/100*i+t,r=s+e,n=i*this.rg,o=r+e;for(const e of this.Id)e.update().plot(s,n,t,o);for(const t of this.tf)t.Ae()}Dg(){return this.Fd}Bg(t,e){e=e||bo.AxisTickMajor;const i=new xn(this,t?this.wd:this.sg,this.sg,this.ct,this.ug,this.ug,this.yh,this.ng,this.rf,this.Ji,e).setTextFormatter(this.formatValue);return this.Id.push(i),i}lf(t){this.chart.ls.os.vs(t,1),this.Ld=t.ls.Tr(this.Zd,this.Ld)}cf(t){this.chart.ls.os.vs(t,0),t.ls.Fr(this.Ld)}gf(t){this.setStopped(!0),t.ls.Fr(this.Ld)}yf(t,e){const i=-this.yh.getWidth(e);this.pan(i),this.Ld=t.ls.Tr(this.Kd,this.Ld)}pan(t){const e=this._h,i=this.Ah,s=this.ct.Jt(e,t),r=this.ct.Jt(i,t);this.mh(s,r,{allowClamping:!1})}zoom(t,e){const i=this.ct.ut(this._h),s=this.ct.ut(this.Ah),r=this.ct.ut(t),n=Ct((r-i)/(s-i),0,1),o=.2*this.ct.Gt(),h=n*this.zd*o*-e,a=(1-n)*this.zd*o*e,l=this.ct.Jt(this._h,h),u=this.ct.Jt(this.Ah,a);this.mh(l,u)}bf(t){this.Td=void 0,t.ls.Fr(this.Ld)}pf(t,e){this.setStopped(!0),t.ls.Fr(this.Ld),this.chart.ls.os.vs(this.pg,0)}Sf(t,e,i,s){const r=at(this._f.ls.Ce(i.x,i.y),this._f.ls.ct,this.ag),n=Ct(this.yh.getWidth(r),this._h,this.Ah),o=this.yh.getWidth(at(this._f.ls.Ce(e.x,e.y),this._f.ls.ct,this.ag)),h=Ve(this.yh.getHeight(r),this.yh.getHeight(at(this.pg.ca(),this.lg,this.ag)),this.yh.getHeight(at(ri(this.pg.ca(),this.pg.Ht()),this.lg,this.ag)));Math.abs(this.ct.ut(n)-this.ct.ut(o))>10&&h?(this.Td=y(Math.min(n,o),Math.max(n,o)),this.Ld=t.ls.Tr(this.qd,this.Ld)):(this.Td=void 0,this.Ld=t.ls.Tr(this.Zd,this.Ld)),this._f.Ss()}vf(t,e,i){if(this.Td){const t=this.Td.min,e=this.Td.max,i=this.Ah{e.ps(t)}));for(const e of this.Cd.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.wd.Ss(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.Ze),this}}const Zo={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},Qo={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},th=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof Ko&&"y"in t&&t.y instanceof Ko),eh=s.Record({type:"visible-ticks",gridStrokeLength:1,gridStrokeStyle:new $i,tickLength:7,tickStyle:new $i,tickPadding:0,labelFont:new tr,labelFillStyle:new V,labelPadding:0,labelAlignment:0,labelRotation:0});class ih extends eh{}class sh extends ih{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 rh=t=>!(!t||"object"!=typeof t||!("type"in t)||"visible-ticks"!==t.type),nh=Object.assign(Object.create(new class extends ih{}({type:"empty-ticks"})),{}),oh=(t,e,i,s,r)=>n=>o=>{const h=new Date(o+n),a={year:h.getFullYear(),monthIndex:h.getMonth(),day:h.getDate(),hours:h.getHours(),minutes:h.getMinutes(),seconds:h.getSeconds(),millis:h.getMilliseconds()},l=s?s(a):void 0;if(0===t&&!0===l)return o;const u=a[e];r.includes("year")&&(a.year=Math.floor(a.year/i)*i),r.includes("monthIndex")&&(a.monthIndex=0),r.includes("day")&&(a.day=1),r.includes("hours")&&(a.hours=0),r.includes("minutes")&&(a.minutes=0),r.includes("seconds")&&(a.seconds=0),r.includes("millis")&&(a.millis=0);let c=(0===t?1:t)*i;return-1===t&&!1===l&&(c=0),0!==c&&(a[e]=i*(c>0?Math.floor((u+c)/i):Math.ceil((u+c)/i))),new Date(a.year,a.monthIndex,a.day,a.hours,a.minutes,a.seconds,a.millis).getTime()-n},hh=(t,e,i,...s)=>oh(-1,t,e,i,s),ah=(t,e,i,...s)=>oh(-1,t,e,i,s),lh=(t,e,i,...s)=>oh(0,t,e,i,s),uh=(t,e,...i)=>oh(1,t,e,void 0,i),ch=t=>e=>i=>{const s=new Date(i+e),r=s.getDay(),n=1===r&&0===s.getHours()&&0===s.getMinutes()&&0===s.getSeconds()&&0===s.getMilliseconds();if(0===t&&!0===n)return i;let o=s.getDate();return-1===t&&1===r&&!1===n||(-1===t?o-=r>=2?r-1:r+6:o+=r>0?8-r:1),new Date(s.getFullYear(),s.getMonth(),o,0,0,0,0).getTime()-e},dh=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:Xs({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:Xs(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:hh("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Ys(5,10,15,30)},minorTicks:{amount:4,fitFunction:Xs(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:hh("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Ys(5,10,15,30)},minorTicks:{amount:12,fitFunction:Xs(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:hh("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Ys(3,6,12)},minorTicks:{amount:8,fitFunction:Xs(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:hh("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:Xs({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:Xs({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:ch(-1),getNextKeyValueIncludingRef:ch(0),getNextKeyValue:ch(1),greatTicks:!0,majorTicks:{fitFunction:Xs(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:ah("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:lh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:uh("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Xs(void 0,2,3)},minorTicks:{fitFunction:Xs(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:ah("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:lh("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:uh("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Xs({ignore:"first"},2,5)},minorTicks:{fitFunction:Xs(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:ah("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:lh("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:uh("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Xs(void 0,2,4)},minorTicks:{fitFunction:Xs(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:ah("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:lh("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:uh("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:ah("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:lh("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:uh("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],fh=(t,e,i)=>{let s=((t,e,i,s,r)=>{const n=e-t;let o;for(let t=0;t(i,s,r,n)=>{const o=fh("great",i,s);if(void 0===o)return[];if("Decade"===o.label||"Century"===o.label||"Millennium"===o.label)return[];const h=n>r?i:s,a=(i+s)/2,l=n>r?s:i;if(dh.indexOf(o)<=dh.findIndex((t=>"Hour"===t.label)))return"left"===e?[h]:[];let u;if(!0===o.irregular)u=Ws(i,s,o.getPrevKeyValue(t),o.getNextKeyValue(t));else{const e=o.greatTicks.getReferenceKeyValue(t)(i);u=Us(i,s,o.unit,e,1)}const c=((t,e,i)=>{for(const s of i)if(s>=t&&s<=e)return s})(i,s,u);return"left"===e?void 0===c||Ve(c,a,l)?[h]:[c]:void 0!==c&&Ve(c,a,l)?[c]:[l]},yh=(t,e)=>(i,s,r,n)=>{const o=fh(t,r,n);let h;if(void 0===o)return[];if("great"===t&&void 0!==o.greatTicks)if(!0===o.irregular)h=Ws(i,s,o.getPrevKeyValue(e),o.getNextKeyValue(e));else{const t=o.greatTicks.getReferenceKeyValue(e)(i);h=Us(i,s,o.unit,t,1)}else if("major"===t&&void 0!==o.majorTicks)h=!0===o.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})(i,s,o.getPrevKeyValue(e),o.getNextKeyValue(e)):((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})(i,s,o.unit);else{if("minor"!==t||void 0===o.minorTicks)return[];if(!0===o.irregular)h=((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})(i,s,o.getNextKeyValueIncludingRef(e),o.getNextKeyValue(e));else{const t=(t=>{if(void 0!==t)return dh[dh.indexOf(t)+1]})(o);if(void 0===t)return[];h=Hs(i,s,t.unit/o.minorTicks.amount,1)}}return h},mh=t=>(e,i,s,r,n,o)=>{const h=fh(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},ph=s.Record({type:"date-time-ticks",locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new sh,majorTickStyle:new sh,minorTickStyle:new sh,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 Sh extends ph{Lh(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>dh.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]},`;xt.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=fh(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)(n):c.greatTicks.getReferenceKeyValue(e)(n+1*c.unit):"left"===i&&!1===u||"right"===i&&!0===u?c.getPrevKeyValue(e)(n):c.getNextKeyValue(e)(n),h=s+e,"right"===i&&!0===t)return""}const d=s.get(t);if(void 0===d)return r(h);const f=d[dh.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{Ve:"Great ticks (directive)",Fg:0,Re:!0,Mr:yh("great",e),_r:void 0},{Ve:"Major ticks",Fg:1,Jh:this.majorTickStyle,Kh:n("major"),Mr:yh("major",e),fh:{ir:mh("major")},_r:void 0}];this.greatTickStyle!==nh&&(o.push({Ve:"Great ticks (left)",Jh:this.greatTickStyle.setLabelAlignment(-1),Kh:n("great","left"),Mr:gh(e,"left"),Le:!0,hr:!1}),o.push({Ve:"Great ticks (right)",Jh:this.greatTickStyle.setLabelAlignment(1),Kh:n("great","right"),Mr:gh(e,"right"),Le:!0,hr:!1})),this.minorTickStyle!==nh&&h.push({Ve:"Minor ticks",Fg:2,Jh:this.minorTickStyle,Kh:n("minor"),Mr:yh("minor",e),fh:{ir:mh("minor"),gh:(t,e,i,s,r,n)=>{const o=fh("minor",r,n);return!o||"Week"!==o.label}},_r:void 0});const a=this.cursorFormatter;return{Ne:o,Ge:h,Ee: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)} `},zh:1e3,Vh:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setGreatTickStyle(t){if("function"==typeof t){const e=this.get("greatTickStyle");return e!==nh?this.set("greatTickStyle",t(e)):this}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 e!==nh?this.set("minorTickStyle",t(e)):this}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}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 xh=(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 Us(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)},bh=(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=Xs(void 0,2,5),Mh=(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,Ah=(t,e)=>{const i=Mi(t),s=Ai(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&&si(e+t,s,r),Mr:Gs,Le:!0,hr:!0}),o.push({Ve:"Major ticks",Fg:0,Jh:this.majorTickStyle,Kh:void 0===e?s:(t,i,r)=>s(e+t,i,r),Mr:"logarithmic"===t.type?Ah(t.base,!0):xh(0,!0),fh:"logarithmic"===t.type?void 0:{ir:bh},_r:void 0}),this.minorTickStyle!==nh&&o.push({Ve:"Minor ticks",Fg:1,Jh:this.minorTickStyle,Kh:void 0===e?r:(t,i,s)=>r(e+t,i,s),Mr:"logarithmic"===t.type?Ah(t.base,!1):xh(1,!1),fh:"logarithmic"===t.type?{ir:Mh}:{ir:vh},_r:50});const h=this.cursorFormatter?this.cursorFormatter:Ci.Numeric;return{Ne:n,Ge:o,Ee:void 0===e?h:(t,i,s)=>h(e+t,i,s),zh:1e-9,Vh: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 e!==nh?this.set("extremeTickStyle",t(e)):this}return this.set("extremeTickStyle",t)}getExtremeTickStyle(){return this.get("extremeTickStyle")}setFormattingOffset(t){return this.set("formattingOffset",t)}getFormattingOffset(){return this.get("formattingOffset")}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 e!==nh?this.set("minorTickStyle",t(e)):this}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 Eh=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new sh,minorTickStyle:new sh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Ih=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=6e4?"MajorMinutes":i>=1e4?"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"},Ch={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}`}},kh={MajorHours12:{major:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Us(t,e,r,void 0,1e6)},fitKeyValues:Xs({ignore:"first"},2,4)},minor:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,36e5,1e6),fitKeyValues:Xs({},2,3,4,6)},defaultValueFormatter:Ch.hhmmss},MajorHours:{major:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Us(t,e,r,void 0,1e6)},fitKeyValues:Xs({ignore:"first"},2,6,12)},minor:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,3e5,1e6),fitKeyValues:Xs({},2,4,6)},defaultValueFormatter:Ch.hhmmss},MajorMinutes15:{major:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Us(t,e,9e5,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2)},minor:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,6e4,1e6),fitKeyValues:Xs({},3,5)},defaultValueFormatter:Ch.hhmmss},MajorMinutes:{major:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Us(t,e,6e4,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,5e3,1e6),fitKeyValues:Xs({},2,3,4,6)},defaultValueFormatter:Ch.hhmmss},MajorSeconds15:{major:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Us(t,e,15e3,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,4)},minor:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,1e3,1e6),fitKeyValues:Xs({},3,5)},defaultValueFormatter:Ch.hhmmss},MajorSeconds:{major:{format:Ch.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Us(t,e,1e3,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,100,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.hhmmssmmm},MajorMilliseconds100:{major:{format:Ch.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Us(t,e,100,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,10,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.hhmmssmmm},MajorMilliseconds10:{major:{format:Ch.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Us(t,e,10,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,1,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.hhmmssmmm},MajorMilliseconds:{major:{format:Ch.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Us(t,e,1,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.1,1e6),fitKeyValues:Xs({},2)},defaultValueFormatter:Ch.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Ch.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Us(t,e,.1,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.01,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Ch.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Us(t,e,.01,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.001,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Ch.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Us(t,e,.001,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Hs(t,e,100*1e-6,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Ch.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Us(t,e,r,void 0,1e6)},fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Hs(t,e,10*1e-6,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.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 Ph extends Eh{Lh(t){const e=this.timeOrigin||0,i=[{Ve:"Major ticks",Fg:0,Jh:this.majorTickStyle,Kh:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Ih(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,kh[r].major.format)(t+e,i,s)},Mr:(t,e,i,s)=>{const r=Ih(i,s);return(0,kh[r].major.getKeyValues)(t,e,i,s)},fh:{ir:(t,e,i,s,r,n)=>{const o=Ih(r,n),h=kh[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},_r:void 0}];return rh(this.minorTickStyle)&&i.push({Ve:"Minor ticks",Fg:1,Jh:this.minorTickStyle,Kh:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Ih(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,kh[r].minor.format)(t+e,i,s)},Mr:(t,e,i,s)=>{const r=Ih(i,s);return(0,kh[r].minor.getKeyValues)(t,e,i,s)},fh:{ir:(t,e,i,s,r,n)=>{const o=Ih(r,n),h=kh[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},_r:void 0}),{Ne:[],Ge:i,Ee:this.cursorFormatter||((t,i,s)=>{const r=Ih(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return kh[r].defaultValueFormatter(t+e,i,s)}),zh:1e-4,Vh:864e6}}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 e!==nh?this.set("minorTickStyle",t(e)):this}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 Fh=(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(xt.navigator.msSaveBlob)xt.navigator.msSaveBlob(r,e);else{const t=xt.document.createElement("a");xt.document.body.appendChild(t);const i=xt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{xt.URL.revokeObjectURL(i),xt.document.body.removeChild(t)}),0)}},Bh=(t,i,s,r,n,o)=>{const h=t.vc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},_h=(t,e)=>{if("relative"===t)return e;if(t instanceof Bi)return t;const i=t.x instanceof $s?t.x.ct:t.x.x,s=t.y instanceof $s?t.y.ct:t.y.y;return Di(i,s)},Lh=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=th(o)?o:Ri(o)?s:void 0;if(h&&zi(i)){const t=at(n,h,r.ct);return r.fo({engineX:t.x,engineY:t.y})}if(h&&Ri(i))return at(n,h,s);if(h&&th(i))return at(n,h,i)}else{const i=t;if(Ri(e)){const t=r.do(i);return at({x:t.engineX,y:t.engineY},r.ct,s)}if(th(e)){const t=e,s=r.do(i);return at({x:s.engineX,y:s.engineY},r.ct,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class Dh{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.Og=[],this.Lg=[],this.P=new r.Eventer,this.Rg=void 0,this.Eg=void 0,this.zg=void 0,this.Ft=S(0,0,0,0),this.Ti=!1,this.Vg=()=>{this.Ng=!0,this.Gg.Ss()},this.Wg=t=>e=>{const i=this.Og.indexOf(e);-1!==i&&this.Og.splice(i,1),this.ls.Ss(),t.G()},this.Hg=t=>{const e=this.Lg.indexOf(t);-1!==e&&this.Lg.splice(e,1),this.ls.Ss()},this.Ng=!0,this.ff=t,this.Ug=i,this.Gg=s,this.removePanel=n,this.Ji=e.ls.Ji;const l=e.ls.Ht();if(this.uiScale=i.d2({scaleXYConstructor:_i}).bi(0,100).vi(0,100).q(l),this.pixelScale=i.d2({scaleXYConstructor:_i}).bi(0,this.uiScale.x.getCellSize()).vi(0,this.uiScale.y.getCellSize()).q(l),this.engine=e.ls.$g,this.ls=e.ls.jg,this.ss=this.ls.ss.es(this,{}),this.Yg=()=>e.Xg("unidentified ui"),this.Zg=e.Kg(),this.qg=this.Gg._e(this.uiScale).we(u(0,0)).q(u(100,100)).Me(o).ve(h).setMouseMoveEventHandler(((t,e)=>this.P.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.P.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.P.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.P.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.P.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.P.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.P.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.P.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.P.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.P.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.P.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.P.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.P.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.P.emit("touchEndPanelBackground",this,e))),a){const t=a.on(this.Vg);this.Jg=()=>a.off(t)}else{const t=e.ls.lo(this.Vg);this.Qg=e.ls.uo.bind(e.ls,t)}this.Rg=n}getTheme(){return this.Ji}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.qg.Me(t),this.Gg.Ss(),this}getBackgroundFillStyle(){return this.qg.Th()}setBackgroundStrokeStyle(t){return this.qg.ve(t),this.Gg.Ss(),this}getBackgroundStrokeStyle(){return this.qg.Un()}translateCoordinate(t,e,i){return Lh(t,e,i,this.pixelScale,this.ls)}tp(t){return this.Og.push(t),this.ls.Ss(),t}ip(t){return this.Lg.push(t),this.ls.Ss(),t}addUIElement(t=Qn,e=this.uiScale){e=_h(e,this.pixelScale);const i=this.Yg();return this.tp(Bh(t,i,this.uiScale,e,this.Wg(i),this.Ji))}addLegendBox(t=co,i=this.uiScale){i=_h(i,this.pixelScale);const s=this.ip(Bh(t,this.Zg,this.uiScale,i,this.Hg,this.Ji));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Ts.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Ts.CenterBottom).setPosition(this.uiScale.Jt({x:50,y:0},{x:0,y:3}))),s}dispose(){return this.Ti||(this.Ti=!0,this.Qg&&this.Qg(),this.Jg&&this.Jg(),zh(this.uiScale),zh(this.pixelScale),this.Eg&&this.Eg(),this.Gg.G(),this.Zg.G(),this.Og.slice().forEach((t=>{t.dispose()})),this.Lg.slice().forEach((t=>{t.dispose()})),this.ls.Ss(),this.Rg&&this.Rg(this),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}saveToFile(t,e,i){return Fh(this.engine,t,e,i),this}xa(t){this.Ft=t,this.Vg()}Y(){return this.pixelScale.Y(),this.uiScale.Y(),this}X(){return this.pixelScale.X(),this.uiScale.X(),this}Ae(t){if(this.Ng){const t=this.Gg.ls.Ht(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=[this.Ft.left,this.Ft.right],r=[this.Ft.bottom,this.Ft.top];this.uiScale.Si(s),this.uiScale.xi(r);const n=this.uiScale.getInnerIntervalPixels();this.pixelScale.bi(0,n.x).Si(s).vi(0,n.y).xi(r),this.P.emit("resize",this,n.x,n.y,e,i)}this.Ng=!1}sp(){for(let t=0;t{t.Et&&t.Et()};class Oh extends Dh{constructor(t,e,i,s,r,n){super(t,e,i,e.hp("uipanel bg",0),s,e.ls.Ji.uiPanelBackgroundFillStyle,e.ls.Ji.uiPanelBackgroundStrokeStyle,n),this.ep(r,this.pixelScale)}setMinimumSize(t){return this.Uc=t,this.ls.Ss(),this}getMinimumSize(){return this.Uc}Ae(t){super.Ae(t),super.sp()}}const Rh=S(10,10,10,10);class Vh extends Dh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.rp={},this.Qo=Rh,this.Ze=!0,this.np=e.op("chart internal ui",0),this.ap=this.np.Sr(this.uiScale).Ch("Chart").we(u(50,100)).Sa(u(0,1)).Ih(h).Me(a).setMouseInteractions(!1),this.lp=this.ss.xg([this.ap]).ys(this.Ji.effectsText)}setAnimationsEnabled(t){return this.Ze=t,this}getAnimationsEnabled(){return this.Ze}setTitle(t){return this.ap.Ch(t),this.ls.Ss(),this}getTitle(){return this.ap.wh()}getTitleSize(){return this.ap.Ts().Ic()}setTitleFillStyle(t){return this.ap.Me(t),this.Vg(),this}getTitleFillStyle(){return this.ap.Th()}setTitleFont(t){return this.ap.Ih(t),this.Vg(),this}getTitleFont(){return this.ap.Fh()}setTitleRotation(t){return this.ap.Ph(t),this.ls.Ss(),this}getTitleRotation(){return this.ap.Dh()}setTitleEffect(t){return this.lp.ys(t),this.ls.Ss(),this}getTitleEffect(){return this.lp.xs()}setTitleMargin(t){var e,i;return this.rp="object"==typeof t?this.rp?(e=this.rp,{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.Vg(),this}getTitleMargin(){return this.rp}setPadding(t){return this.Qo="object"==typeof t?b(this.Qo,t):{left:t,top:t,right:t,bottom:t},this.Vg(),this}getPadding(){return this.Qo}up(t){const e=t.cp(),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.np.G(),this}}const Nh={dp:(t,e)=>t.Th()!==z&&0!==t.wh().length&&t.getVisible()?t.Ts().Ic().y:0,fp(t,e){t.we(u(50,100)).xa({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var Gh;e.SliceLabelIndices=void 0,(Gh=e.SliceLabelIndices||(e.SliceLabelIndices={}))[Gh.LabelsInsideSlices=0]="LabelsInsideSlices",Gh[Gh.LabelsOnSides=1]="LabelsOnSides";const Hh={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},Uh={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class Wh extends Gi{constructor(){super(...arguments),this.bs="Slice",this.u=0}}const Xh=(t,e)=>{Zt(e),t.setExploded(!t.getExploded())};class Yh extends Wh{}class jh extends Yh{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.gp=!1,this.pp=z,this.mp=z,this.yp=this.u,this.Sp=this.gp?1:0,this.xp=this.getVisible(),this.bp=j((()=>this.Ki.ls.Ss())),this.vp=j((()=>this.Ki.ls.Ss())),this.Mp=()=>{this._p=void 0},this.Ap=()=>{this.wp=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this.kp=e.Dc(r).us(this.getHighlight()),this.cs(this.kp),this.Ve=i.Sr(r).us(this.getHighlight()),this.cs(this.Ve,{isText:!0}),this.onMouseClick(Xh),this.onTouchEnd(Xh)}setValue(t){return this.Ki.getAnimationsEnabled()?this.xp&&this.Cp(this.yp,t):this.yp=t,this.u=t,this.Ki.ls.Ss(),this}getValue(){return this.u}setExploded(t){if(t&&!1===this.Ki.getMultipleSliceExplosion()){const t=this.Ki.getSlices();for(let e=0;e{this.Sp=t,this.Ki.ls.Ss()})),this.wp.onEveryAnimationEnd(this.Ap),this.gp=!this.gp):!1!==this.Ki.getMultipleSliceExplosion()||t?(this.Sp=this.gp?0:1,this.gp=!this.gp):(this.Sp=0,this.gp=!this.gp),this.Ki.ls.Ss(),this}getExploded(){return this.gp}setVisible(t){return this.xp=t,!1===t?this.Ki.getAnimationsEnabled()&&this.yp>0?(this._p&&(this._p.finish(!1),this._p=void 0),this.Cp(this.yp,0,(()=>super.setVisible(!1)))):(this.yp=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this._p&&(this._p.finish(!1),this._p=void 0),super.setVisible(!0),this.Cp(this.yp,this.u)):(this.yp=this.u,super.setVisible(!0)),this}Cp(t,e,i){this._p=this.bp(300,X.ease)([[t,e]],(([t])=>{this.yp=t,this.Ki.ls.Ss()})),this._p.onEveryAnimationEnd(this.Mp),i&&this._p.onAnimationEnd(i)}setStyle(t,e,i,s){this.pp=t,this.mp=i,this.kp.Me(this.pp).ve(e),this.Ve.Me(this.mp).Ih(s);for(let t=0;tri(e,si(yi(.5*(t.Ol()+t.ui())*Math.PI/180),i)),$h=(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.Tp.indexOf(t);e>=0&&(this.Tp.splice(e,1),this.Gp())},this.ff.wn||this.ff.An||this.ls.Mn(7),this.Wp=e.Hp("pieChart bottom",0),this.$p=e.Hp("pieChart top",1),this.ap.Ch("Pie Chart"),this.ep(r,this.pixelScale),this.onBackgroundMouseDoubleClick(qh);const h=Wi(new Xi(qh));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}addSlice(t,e){const i=new jh(this.Lp,this.Wp,this.$p,this,this.pixelScale,this.Np,this.Ji,this.ls.ss);this.Lp+=1,i.setName(t);const s=this.Ze;return this.Ze=!1,i.setValue(e),this.Ze=s,i.setEffect(this.zp),this.jp(i),this.Tp.push(i),this.Gp(),i.setHighlightOnHover(this.Dp),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.ys(t))),this.ls.Ss(),this}getSliceEffect(){return this.zp}setSliceSorter(t){return this.Fp=t,this.Tp=this.Tp.sort(this.Fp),this.ls.Ss(),this}getSliceSorter(){return this.Fp}setLabelFillStyle(t){this.Op="function"==typeof t?t(this.Op):t;for(let t=0;te.ss.hs.ys(t))),this.ls.Ss(),this}getLabelEffect(){return this.Vp}setLabelFormatter(t){return this.Yp=t,this.ls.Ss(),this}getLabelFormatter(){return this.Yp}setSliceHighlightOnHover(t){return this.Dp=t,this.Tp.forEach((e=>e.setHighlightOnHover(t))),this}Ae(t){super.Ae(t),Nh.fp(this.ap,this.rp),super.sp();const e=Nh.dp(this.ap,this.rp),i=u(this.pixelScale.x.getInnerInterval()-(this.Qo.left+this.Qo.right),this.pixelScale.y.getInnerInterval()-(this.Qo.bottom+this.Qo.top+e)),s=u(this.Qo.left+i.x/2,this.Qo.bottom+i.y/2);if(this.ad){const t=this.ad;this.Tp.forEach((e=>{this.jp(e,new V({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Tp[t].kp.setVisible(e),this.Tp[t].Ve.setVisible(e)}this.Tp=this.Tp.sort(this.Fp);const r=this.Tp.filter((t=>t.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tt.dispose())),this}}const Zh={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Qh=(...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};var ta;!function(t){t[t.TopRight=0]="TopRight",t[t.TopLeft=1]="TopLeft",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight"}(ta||(ta={}));const ea=(t,e,i,s,r,n,o,h,a)=>{if(0===t.length)return;const l=s.x+e*r.x*.5,c=1===i?Math.max:Math.min;let d;for(let r=0;r{const o=r*t.getAnimatedExplosion(),h=t.kp,a=t.Ve,l=Jh(h,i,s+n+o),c=ci(a.ca().y,l,i),d=u(a.ca().x-e*(n+a.Ht().x),c.y);return-1===e&&c.xd.x?[l,d]:[l,c,d]},sa=(...t)=>e=>{const i=(t=>{let e=.5*(t.kp.Ol()+t.kp.ui());for(e%=360;e<0;)e+=360;return e<=90?ta.TopRight:e<180?ta.TopLeft:e<270?ta.BottomLeft:ta.BottomRight})(e);return t.includes(i)},ra=sa(ta.BottomLeft,ta.TopLeft),na=sa(ta.BottomRight,ta.TopRight),oa=sa(ta.TopLeft,ta.TopRight),ha=sa(ta.BottomLeft,ta.BottomRight);class aa extends Kh{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Yp=Uh.NamePlusValue,this.Zp=5,this.Kp=5,this.qp=[],this.Jp=this.Ji.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.Jp=t;for(let t=0;t{if(qi(t)){const e=t.getThickness(),i=t.getFillStyle();if(N(i))return 1===e?sr:new nr({size:e,fillStyle:i,shape:"sphere"})}return sr};class da{constructor(t,e,i,s){this.sm=[],this.hm=t,this.rm=e,this.nm=i,this.om=s}am(){this.sm.forEach((t=>t.Ha())),this.nm&&this.nm();const t=[];return{add:(e,i)=>{t.push({instanceUniqueProperties:e,instanceSharedProperties:i})},finishPlot:()=>{const e=[];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 i=this.sm.slice();e.forEach((t=>{let e=i.pop();e||(e=this.hm(),this.sm.push(e)),this.rm(e,t.instances,t.sharedProperties)})),i.forEach((t=>{t.dispose();const e=this.sm.indexOf(t);e<0?pe(0,(()=>{})):this.sm.splice(e,1)})),this.om&&this.om(this.sm)}}}lm(){this.sm.forEach((t=>{t.dispose()})),this.sm.length=0}}class fa{constructor(t){this.um=[],this.dm=t}am(){return this.fm(),{add:()=>this.gm(),finishPlot:()=>{this.pm()}}}gm(){let t=this.um.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.dm()},this.um.push(t)),t.isFree=!1,t.shape}fm(){this.um.forEach((t=>{t.isFree=!0}))}pm(){this.um.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.um.splice(this.um.indexOf(t),1)}))}lm(){this.um.forEach((t=>t.shape.dispose())),this.um.length=0}}class ga{constructor(t,e,i,s,n,o,h,a,l,u){this.P=new r.Eventer,this.u=0,this.Fi=!0,this.Ti=!1,this.Ss=t,this.ym=e,this.Sm=i,this.xm=s,this.bm=n,this.vm=o,this.Qc=h,this.Mm=a,this._m=l,this._c=u}setValue(t){return t===this.u||(this.u=t,this.Ss(),this.P.emit("valueChange",this.u)),this}getValue(){return this.u}setTickStyle(t){return this.Sm="function"==typeof t?t(this.Sm):t,this.Ss(),this}getTickStyle(){return this.Sm}setTickLength(t){return this.xm=t,this.Ss(),this}getTickLength(){return this.xm}setGridStrokeStyle(t){return this.bm="function"==typeof t?t(this.bm):t,this.Ss(),this}getGridStrokeStyle(){return this.bm}setTextPadding(t){return this.vm=t,this.Ss(),this}getTextPadding(){return this.vm}setTextRotation(t){return this.Qc=t,this.Ss(),this}getTextRotation(){return this.Qc}setTextFillStyle(t){return this.Mm="function"==typeof t?t(this.Mm):t,this.Ss(),this}getTextFillStyle(){return this.Mm}setTextFont(t){return this._m="function"==typeof t?t(this._m):t,this.Ss(),this}getTextFont(){return this._m}setTextFormatter(t){return this._c=t,this.Ss(),this}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}dispose(){return this.Ti||(this.Ti=!0,this.ym(),this.Ss(),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setVisible(t){const e=this.Fi!==t;return this.Fi=t,e&&(this.P.emit("visibleStateChanged",this,this.Fi),this.Ss()),this}getVisible(){return this.Fi}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}class ya extends $s{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Am({x:t.ls.Ji.xAxis3DNumericTicks,y:t.ls.Ji.yAxis3DNumericTicks,z:t.ls.Ji.zAxis3DNumericTicks}),datetime:e.Am({x:t.ls.Ji.xAxis3DDateTimeTicks,y:t.ls.Ji.yAxis3DDateTimeTicks,z:t.ls.Ji.zAxis3DDateTimeTicks}),time:e.Am({x:t.ls.Ji.xAxis3DTimeTicks,y:t.ls.Ji.yAxis3DTimeTicks,z:t.ls.Ji.zAxis3DTimeTicks})},{type:"linear"}),this.Id=[],this.wm=()=>{},this.km=()=>{},this.Cm=()=>{},this.Tm=()=>{},this.chart=t,this.Fm=r,this.Im=n,this.Pm=o,this.Dm=this.Fm.ct;const l=this.yh.Am({x:this.Ji.xAxis3DStrokeStyle,y:this.Ji.yAxis3DStrokeStyle,z:this.Ji.zAxis3DStrokeStyle});this.Bm=this.Fm.tm([Zh.InternalUI]).Pe(l).Om(ca(l)).setMouseInteractions(!1),this.kh=this.Im.Sr(this.Pm).setMouseInteractions(!1).Me(e.Am({x:t.ls.Ji.xAxis3DTitleFillStyle,y:t.ls.Ji.yAxis3DTitleFillStyle,z:t.ls.Ji.zAxis3DTitleFillStyle})).Ih(e.Am({x:t.ls.Ji.xAxis3DTitleFont,y:t.ls.Ji.yAxis3DTitleFont,z:t.ls.Ji.zAxis3DTitleFont})),this.Lm=new fa((()=>this.Im.Sr(this.Pm))),this.Rm=new da((()=>this.Fm.Tg().setMouseInteractions(!1)),((t,e,i)=>{t.Ha().Pe(i.lineStyle),e.forEach((({positions:e})=>t.Wa(e)))})),this.ss=a,this.Bh=this.ss.xg([this.kh]).ys(s.effectsText),this.Bm.setMouseEnterEventHandler(this.wm).setMouseLeaveEventHandler(this.km).setMouseDragEventHandler(this.Cm).setMouseDragStopEventHandler(this.Tm),i.eg=this}setTickStrategy(t,e){return super.Mh(t,e)}getTickStrategy(){return this.He}addCustomTick(){const t=new ga((()=>this.chart.ls.Ss()),(()=>{const e=this.Id.indexOf(t);e>=0&&this.Id.splice(e,1)}),this.Ji.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.Ji.xAxis3DNumericTicks.majorTickStyle.tickLength,this.Ji.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.Ji.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.Ji.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.Ji.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.Ji.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)));return this.Id.push(t),this.chart.ls.Ss(),t}setStrokeStyle(t){return this.Bm.Pe(t).Om(ca(this.Bm.Yl())),this.chart.ls.Ss(),this}getStrokeStyle(){return this.Bm.Yl()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.Bm.setVisible(t),!1===t&&(this.Rm.lm(),this.Lm.lm()),this.Im.Ss(),this}Ag(){return this.chart.getSeries()}Em(t){return Math.abs(this.ct.J(t)*this.Fm.zm(1))}pr(t,e,i){const s=Math.abs(this.ct.J(e-t)*this.Fm.zm(1));return{min:t-i*s,max:e+i*s}}Qh(t,e){return new ma(e,t,this.Im,this.Pm,this.Fm)}tr(t,e){const i=this.Vm(e,t.u,t.dh.Jh.tickLength,t.dh.Jh.tickPadding);return t.Ve.we(i.labelPosition).Sa(i.labelAlignment),i}Vm(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.ct.getInnerStart())/(this.ct.getInnerEnd()-this.ct.getInnerStart()),c=Ce.addVec(We(n,o,l),Ce.multiplyVec(Ce.multiply(h,this.Fm.zm(.5*this.Bm.Yl().getThickness())),r)),d=Ce.addVec(c,Ce.multiplyVec(Ce.multiply(h,this.Fm.zm(i)),r)),f=this.Fm.Nm(d)||u(0,0);return{labelPosition:ri(at(f,this.chart.engine.scale,this.Pm),si(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}kg(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.ct.getInnerStart())/(this.ct.getInnerEnd()-this.ct.getInnerStart()),a=Ce.addVec(We(r,n,h),Ce.multiplyVec(Ce.multiply(o,this.Fm.zm(.5*this.Bm.Yl().getThickness())),s)),l=Ce.addVec(a,Ce.multiplyVec(Ce.multiply(o,this.Fm.zm(10)),s)),c=this.Fm.Nm(a)||u(0,0),d=this.Fm.Nm(l)||u(0,0);return this.Im.De(this.Pm).Oe(c).Be(d).Pe(new $i({fillStyle:new V({color:E(120*i)}),thickness:1}))}dr(t,e){return pa(t,e,this.ct)}Ae(t){if(!this.Fi)return;const e=Math.min(this._h,this.Ah),i=Math.max(this._h,this.Ah),s=this.Dm,r=f(s.x.st(),s.y.st(),s.z.st());let n,o;this.Gm()?(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.yh.Wm(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.yh.bd,a=this.Fm.Nm(n)||u(0,0),l=this.Fm.Nm(o)||u(0,0),c=We(n,o,.5),d=Ce.addVec(c,Ce.multiplyVec(Ce.multiply(h,-1),r)),g=this.Fm.Nm(c)||u(0,0),y=this.Fm.Nm(d)||u(0,0),m=ti(ni(at(g,this.chart.engine.scale,this.Pm),at(y,this.chart.engine.scale,this.Pm)));this.Bm.Ha().Wa([n,o]);const{gridlinePositionA:p,gridlinePositionB:S,gridlinePositionC:x}=this.yh.Hm(t),b=t=>({x:-1===t.x?this.Dm.x.getInnerStart():1===t.x?this.Dm.x.getInnerEnd():0,y:-1===t.y?this.Dm.y.getInnerStart():1===t.y?this.Dm.y.getInnerEnd():0,z:-1===t.z?this.Dm.z.getInnerStart():1===t.z?this.Dm.z.getInnerEnd():0}),v=b(p),M=b(S),A=b(x),T={physicalAxisSize:ii(ni(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:m,gridlinePositionA:v,gridlinePositionB:M,gridlinePositionC:A},w=this.Hh(T),E=this.Rm.am();for(const[t,e]of this.Ue)for(const[,i]of e){const e=w.get(i);if(!e)continue;const s=this.Um(T,e);E.add({positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.Jh.tickStyle}),s.gridStroke&&E.add({positions:s.gridStroke},{lineStyle:t.Jh.gridStrokeStyle})}const I=this.Lm.am(),C={x:0,y:0};this.Id.forEach((t=>{if(!t.Fi||t.ui)return;const s=this.Vm(T,t.u,t.xm,t.vm),r=this.Um(T,s),n=I.add().we(s.labelPosition).Sa(s.labelAlignment).Me(t.Mm).Ih(t._m).Ch(t._c(t.u)).Ph(t.Qc).Ts().Ht();C.x=Math.max(C.x,n.x),C.y=Math.max(C.y,n.y),E.add({positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.Sm}),r.gridStroke&&E.add({positions:r.gridStroke},{lineStyle:t.bm})})),I.finishPlot(),E.finishPlot();const k=this.er(((t,e)=>{const i=e.Ve.Ht();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:C.x,y:C.y}),P=Math.atan((l.y-a.y)/(l.x-a.x));this.kh.Sa({x:0,y:0}).Ph(180*-P/Math.PI);const F=Ce.addVec(c,Ce.multiplyVec(Ce.multiply(h,this.Fm.zm(.5*this.Bm.Yl().getThickness()+this.rr(((t,e)=>Math.max(t,e.tickLength)),0))),r)),B=this.Fm.Nm(F)||u(0,0),_=ri(at(B,this.chart.engine.scale,this.Pm),ri(ri(oi(k,m),si(m,this.rr(((t,e)=>Math.max(t,e.labelPadding)),0))),oi(si(this.kh.Ts().Ht(),.5),m)));this.kh.we(_),this.Bm.$m={overrideFollowing:!1,skipMousePicking:!1}}Um(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.jm()?{...i,x:n.x}:this.Ym()?{...i,y:n.y}:this.Gm()?{...i,z:n.z}:{x:0,y:0,z:0},this.jm()?{...s,x:n.x}:this.Ym()?{...s,y:n.y}:this.Gm()?{...s,z:n.z}:{x:0,y:0,z:0},this.jm()?{...r,x:n.x}:this.Ym()?{...r,y:n.y}:this.Gm()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}Oh(){super.Oh(),this.Rm.lm(),this.Lm.lm()}jm(){return this.yh.jm()}Ym(){return this.yh.Ym()}Gm(){return this.yh.Gm()}}class ma extends qs{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.wd=r}}const pa=(t,e,i)=>Ct(t+.1*(e-t)+Math.abs(i.st())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),Sa=(t,e,i,s)=>({nr:()=>{const i=t();let s;for(const t of i){if(!t.Xm())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},ar:()=>{const e=t();let s;for(const t of e){if(!t.Xm())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},ur:()=>{const e=t();let i;for(const t of e){if(!t.Xm())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),xa=t=>({...Sa(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.ur().y)),Am:t=>t.y,Wm:(t,e)=>({x:e.x,y:t.y,z:e.z}),bd:f(-1,0,0),Hm: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)}},jm:()=>!1,Ym:()=>!0,Gm:()=>!1}),ba=t=>({...Sa(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.ur().z)),Am:t=>t.z,Wm:(t,e)=>({x:e.x,y:e.y,z:t.z}),bd:f(1,0,0),Hm: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)}},jm:()=>!1,Ym:()=>!1,Gm:()=>!0});class va extends Gi{constructor(t,e,i,s,r){super(t,e,s,r),this.Zm=Bo,this.Km=!0,this.qm=!0,this.Ki=t,this.Fm=i,this.Qi=new Map,this.onMouseWheel(this.Ki.Jm),this.onMouseDrag(this.Ki.Qm),this.onTouchStart(this.Ki.ty.onTouchStart),this.onTouchMove(this.Ki.ty.onTouchMove),this.onTouchEnd(this.Ki.ty.onTouchEnd)}setAutoScrollingEnabled(t){return this.Km=t,this.Ki.ls.Ss(),this}getAutoScrollingEnabled(){return this.Km}setColorShadingStyle(t){return this.Zm=t,this.Qi.forEach(((e,i)=>i.iy(t))),this.Fm.Ss(),this}getColorShadingStyle(){return this.Zm}setDepthTestEnabled(t){return this.qm=t,this.Qi.forEach(((e,i)=>i.sy(t))),this.Fm.Ss(),this}getDepthTestEnabled(){return this.qm}ey(){}Ae(){}om(){}getXMax(){const t=this.Aa;return t?t._t():void 0}getXMin(){const t=this.Aa;return t?t.Mt():void 0}getYMax(){const t=this.Aa;return t?t.wt():void 0}getYMin(){const t=this.Aa;return t?t.At():void 0}getZMax(){const t=this.Aa;return t?t.hy():void 0}getZMin(){const t=this.Aa;return t?t.ny():void 0}ur(){const t=this.Aa;return t?f(t.sl(),t.el(),t.oy()):f(0,0,0)}}class Ma extends va{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.bs="Box Series 3D",this.ly=.25,this.ld=()=>de(this.Se),this.Se=ye(this.Ji.boxSeries3DFillStyle,r),this.Aa=this.Fm.gy().sy(this.qm).Me(this.Se).uy(this.ly).us(this.getHighlight()),this.cs(this.Aa)}invalidateData(t){const e=t.length;if(0===e)return this;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.jl.getFillStyle())}setStrokeStyle(t){this.jl="function"==typeof t?t(this.jl):t;const e=this.jl;return this.Aa.Pe(e),this.Fm.Ss(),this}getStrokeStyle(){return this.jl}add(t){return(t=Array.isArray(t)?t:[t])?(this.Aa.Wa(t.slice()),this.Fm.Ss(),this):this}clear(){return this.Aa.Ha(),this}getPointAmount(){const t=this.Aa;return t.Ua()+t.$a()}Xm(){return this.Km&&this.getPointAmount()>0&&this.getVisible()}ke(t,e){t.us(e),this.Fm.Ss()}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{stroke:this.jl}),this}}class Ta extends Aa{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.bs="Line Series 3D",this.jl=ye(s.lineSeries3DStrokeStyle,r),this.my=vr.pointStyle3D,this.yy(this.jl),this.Aa=this.Fm.tm([Zh.UserSeries]).sy(this.qm).Pe(this.jl).Om(this.my).us(this.getHighlight()),this.cs(this.Aa)}setStrokeStyle(t){super.setStrokeStyle(t),this.yy(this.jl);const e=this.my;return this.Aa.Om(e),this}yy(t){const e=new ur.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.my=e}}class wa extends Aa{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.bs="Point Line Series 3D",this.ld=()=>de(this.jl.getFillStyle())||de(this.my.getFillStyle()),this.my=ye(s.pointLineSeries3DPointStyle,r),this.jl=ye(s.lineSeries3DStrokeStyle,r),this.Sy(),this.Aa=this.Fm.tm([Zh.UserSeries]).sy(this.qm).Pe(this.jl).Om(this.my).us(this.getHighlight()),this.cs(this.Aa)}setPointStyle(t){return this.my="function"==typeof t?t(this.my):t,this.Sy(),this.Aa.Om(this.my),this.Fm.Ss(),this}getPointStyle(){return this.my}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.jl,i=Math.abs(e.getThickness()),s=this.my;i>s.getSize()&&(this.my=s.setSize(i)),this.Sy();const r=this.my;return this.Aa.Om(r),this.Fm.Ss(),this}Sy(){const t=this.my,e=t.getSize();this.my=t.setSize(e)}ke(t,e){t.us(e),this.Fm.Ss()}}class Ea extends va{constructor(t,e,i,s,r,n){super(t,e,i,s,r)}add(t){return(t=Array.isArray(t)?t:[t])?(this.Aa.Wa(t.slice()),this.Fm.Ss(),this):this}clear(){return this.Aa.Ha(),this}getPointAmount(){const t=this.Aa;return t.Ua()+t.$a()}Xm(){return this.Km&&this.getPointAmount()>0&&this.getVisible()}ke(t,e){t.us(e),this.Fm.Ss()}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{point3D:this.xy}),this}}class Ia extends Ea{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.bs="Point Series 3D",this.ld=()=>de(this.xy.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.Ki.getSeries().length;this.xy=ye(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Aa=this.Fm.vy(h).sy(this.qm).by(this.xy).us(this.getHighlight()),this.cs(this.Aa)}setPointStyle(t){this.xy="function"==typeof t?t(this.xy):t;const e=this.xy;return this.Aa.by(e),this.Fm.Ss(),this}getPointStyle(){return this.xy}}class Ca extends Ea{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.bs="Point Cloud Series 3D",this.ld=()=>de(this.xy.getFillStyle());const o=this.Ki.getSeries().length;this.xy=ye(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Aa=this.Fm.vy(h).by(this.xy).us(this.getHighlight()),this.cs(this.Aa)}setPointStyle(t){this.xy="function"==typeof t?t(this.xy):t;const e=this.xy;return this.Aa.by(e),this.Fm.Ss(),this}getPointStyle(){return this.xy}}const ka={Triangulated:Ia,Pixelated:Ca};class Pa extends Vh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.My=[],this._y=0,this.Ay=t=>{const e=this.My.indexOf(t);e>=0&&(this.My.splice(e,1),this.P.emit("seriesDispose",this,t))},this.wy=()=>{this._y+=1},this.ky=()=>{this._y-=1},this.onSeriesBackgroundMouseEnter=t=>this.P.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.P.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.P.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.P.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.P.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.P.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.P.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.P.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.P.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.P.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.P.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.P.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.P.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.P.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.P.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.P.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.P.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.P.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.P.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.P.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.P.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.P.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.P.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.P.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.P.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.P.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.P.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.P.off(t,"touchEndSeriesBackground"),this.Cy=this.ss.xg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.My.forEach((e=>e.setAnimationHighlight(t))),this}Ty(t,e){this.Cy.ds([e]),t.setMouseMoveEventHandler(((t,e)=>{this.P.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.P.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.P.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.P.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.P.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.P.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.P.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.P.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.P.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.P.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.P.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.P.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.P.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.P.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.Fy.Me(t),this.ls.Ss(),this}getSeriesBackgroundFillStyle(){return this.Fy.Th()}setSeriesBackgroundStrokeStyle(t){return this.Iy.ve(t),this.ls.Ss(),this}getSeriesBackgroundStrokeStyle(){return this.Iy.Un()}setSeriesBackgroundEffect(t){return this.Cy.ys(t),this.ls.Ss(),this}getSeriesBackgroundEffect(){return this.Cy.xs()}Py(t){this.My.push(t),t.onMouseEnter(this.wy),t.onMouseLeave(this.ky),void 0!==this.Dy&&t.setHighlightOnHover(this.Dy),this.P.emit("seriesAdded",this,t)}Sd(){return this.My}By(){return this._y}setSeriesHighlightOnHover(t){return this.Dy=t,this.My.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.My.slice().forEach(wt),super.dispose()}}const Fa=Ce.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class Ba{constructor(t,e,i,s){this.Oy=!0,this.Ly=!0,this.Ry=2*-Math.PI/2160,this.Ey=2*Math.PI/2160,this.zy=.1,this.Vy=1*Math.PI/180,this.Ny=t,this.Gy=e,this.Wy=i,this.Nm=s}getDefaultCameraConfiguration(t){const e={direction:Fa,location:Ce.multiply(Fa,-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.Hy(i,t):"wheel-zoom"===t.type?i=this.Uy(i,t):"rotate+zoom"===t.type?i=this.$y(i,t):"fixed-rotate"===t.type?i=this.jy(i,t):"move"===t.type&&(i=this.Yy(i,t))})),this.Oy?i=this.Xy(t.boundingBox,i):this.Ly&&(i=this.Zy(t.boundingBox,i)),i}Hy(t,e){const{rotation:i}=e,s=t.location,r=Ce.multiply(Ce.normalize(t.location),-1),{Right:n,Up:o}=this.Ky(r);let h=s;const a=this.qy(r),l=i.x*this.Ry*a;h=Ce.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.Ey,a-this.Vy);return 0!==u&&(h=Ce.rotateAroundAxis(h,n,u)),{location:h,direction:Ce.multiply(Ce.normalize(h),-1)}}Uy(t,e){const{deltaY:i}=e;this.Oy&&this.Jy(!1);const s=t.location,r=Ce.multiply(Ce.normalize(s),-1),n=i*this.zy,o=Ce.length(s)*-n;return{direction:r,location:Ce.addVec(s,Ce.multiply(r,o))}}$y(t,e){const{rotation:i,cameraDistance:s}=e;this.Oy&&this.Jy(!1);let r=this.Hy(t,{type:"rotate",rotation:i});const n=r.location,o=Ce.multiply(Ce.normalize(n),-1),h=Ce.multiply(o,-s);return r={direction:Ce.multiply(Ce.normalize(h),-1),location:h},r}jy(t,e){this.Oy&&this.Jy(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.Ky(r),h=i.x*this.Ry;let a=Ce.normalize(Ce.rotateAroundAxis(r,o,h));const l=i.y*this.Ey;return a=Ce.normalize(Ce.rotateAroundAxis(a,n,l)),{location:s,direction:a}}Yy(t,e){this.Oy&&this.Jy(!1),this.Ly=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.Ky(n);return{location:Ce.addVec(r,Ce.multiply(n,.01*s),Ce.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:Ce.multiply(Ce.normalize(t.cameraLocation),-1)};return this.Oy?this.Xy(t.boundingBox,e):this.Zy(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:Ce.multiply(Ce.normalize(t.cameraLocation),-1)};return this.Oy?this.Xy(t.boundingBox,e):this.Zy(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:Ce.multiply(Ce.normalize(t.cameraLocation),-1)};if(this.Oy)return this.Xy(t.boundingBox,e)}Xy(t,e,i){let s=e;i=void 0!==i?i:0,s=this.Qy(t,s,100,20,1,i,5);const r=this.qy(s.direction);return s=this.tS(s,this.iS(t,s,100,1),r),s}Qy(t,e,i,s,r,n,o){return _a(n,o,(t=>({direction:e.direction,location:Ce.multiply(e.direction,-t)})),(e=>this.sS(t,e)),i,r,"linear",s)}iS(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.Ky(e.direction),a=this.eS(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:Ce.normalize(Ce.lerp(l.direction,h,t))})),(e=>this.hS(t,e)),0,u,!0,i):La(0,c,(t=>({location:l.location,direction:Ce.normalize(Ce.lerp(l.direction,o,t))})),(e=>this.hS(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:Ce.normalize(Ce.lerp(l.direction,n,t))})),(e=>this.rS(t,e)),0,u,!0,i):La(0,c,(t=>({location:l.location,direction:Ce.normalize(Ce.lerp(l.direction,r,t))})),(e=>this.rS(t,e)),0,u,!0,i)),l}sS(t,e){const i=this.eS(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}rS(t,e){const i=this.eS(t,!1,e);return Math.abs(i.left-i.right)}hS(t,e){const i=this.eS(t,!1,e);return Math.abs(i.top-i.bottom)}eS(t,e,i){const s=Xe(this.nS(t,e,i).map((t=>at(t,this.Ny,this.Gy))));return{left:s.min.x,right:this.Gy.x.getInnerEnd()-s.max.x,top:this.Gy.y.getInnerEnd()-s.max.y,bottom:s.min.y}}nS(t,e,i){const s=this.Wy,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.Nm(t,i))).filter((t=>void 0!==t))}Zy(t,e){const i=Ce.length(e.location),s=this.oS(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.Se),this.Zm=Po;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ki.getSeries().length;this.Se=ye(this.Ji.surfaceGridSeries3DFillStyle,o),this.lu=ye(this.Ji.surfaceGridSeries3DWireframeStyle,o);const h=s.start||{x:0,z:0},a=s.end?{x:(s.end.x-h.x)/s.columns,z:(s.end.z-h.z)/s.rows}:s.step||{x:1,z:1},l={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows,start:h,step:a};this._n=l,this.Aa=this.Fm.lS(l).Me(this.Se).uu(this.lu).iy(this.Zm).us(this.getHighlight()),this.cs(this.Aa)}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.Aa.Me(this.Se),this.Fm.Ss(),this}getFillStyle(){return this.Se}setWireframeStyle(t){return this.lu="function"==typeof t?t(this.lu):t,this.Aa.uu(this.lu),this.Fm.Ss(),this}getWireframeStyle(){return this.Aa.cu()}setIntensityInterpolation(t){return t=t||"disabled",this.Aa.uS(t),this.Fm.Ss(),this}getIntensityInterpolation(){return this.Aa.cS()}invalidateIntensityValues(t){if(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._n.dataOrder?t.length:t[0].length,rows:"rows"===this._n.dataOrder?t.length:t[0].length},i="columns"===this._n.dataOrder?this._n.columns:this._n.rows,s="columns"===this._n.dataOrder?this._n.rows:this._n.columns;if(e.x>i||e.y>s){if(!0===this.Ki.ff.Pn){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this._n.columns}x${this._n.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;xt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.ff.Pn){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this._n.columns}x${this._n.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.`;xt.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.ff.Pn){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this._n.columns}x${this._n.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;xt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.ff.Pn){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this._n.columns}x${this._n.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.`;xt.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.Se),this.Zm=Po;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ki.getSeries().length;this.Se=ye(this.Ji.surfaceScrollingGridSeries3DFillStyle,o),this.lu=ye(this.Ji.surfaceScrollingGridSeries3DWireframeStyle,o);const h=s.start||{x:0,z:0},a=s.step||{x:1,z:1},l={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows,start:h,step:a};this._n=l,this.Aa=this.Fm.mS(l).Me(this.Se).uu(this.lu).iy(this.Zm).us(this.getHighlight()),this.cs(this.Aa)}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.Aa.Me(this.Se),this.Fm.Ss(),this}getFillStyle(){return this.Se}setWireframeStyle(t){return this.lu="function"==typeof t?t(this.lu):t,this.Aa.uu(this.lu),this.Fm.Ss(),this}getWireframeStyle(){return this.Aa.cu()}setIntensityInterpolation(t){return t=t||"disabled",this.Aa.uS(t),this.Fm.Ss(),this}getIntensityInterpolation(){return this.Aa.cS()}clear(){return this.Aa.Ha(),this.Fm.Ss(),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._n.scrollDimension?this._n.rows:this._n.columns;if(i>s-1){if(!0===this.Ki.ff.Pn){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this._n.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;xt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.Ki.ff.Pn){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this._n.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;xt.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.Aa.yS({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.Fm.Ss(),this}setCullMode(t){return this.Aa.gS("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.Aa.pS()}ey(){}Ae(){}om(){}Xm(){return this.Km&&this.getVisible()}ke(t,e){t.us(e),this.Fm.Ss()}}const Oa=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof Va),Ra=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 Va extends Pa{constructor(t,e,i,s,r,n,o){var h;let a;super(t,e,i,e.hp("chart3D bg",0),s,e.ls.Ji.chart3DBackgroundFillStyle,e.ls.Ji.chart3DBackgroundStrokeStyle,e.ls.Ji.chart3DTitleFont,e.ls.Ji.chart3DTitleFillStyle,n),this.SS=1,this.xS=[],this.bS=2,this.vS=!0,this.MS=!0,this._S=!0,this.AS=0,this.coordsAxis={id:"axes",chart:this},this.coordsWorld={id:"world",chart:this},this.axes={id:"axes",chart:this},this.world={id:"world",chart:this},this.Wr=[],this.Yr=()=>{const t=this.Fm.wS();this.CS.kS(t),this.TS.kS(t);const e=this.FS.viewportChanged(this.IS());e&&this.PS(e),this.ls.Ss()},this.Qm=(t,e,i,s,r)=>{if(this._S){const t=r;this.xS.push({type:"rotate",rotation:t}),this.ls.Ss(),Zt(e)}},this.Jm=(t,e)=>{if(this.MS){if(this.vS)Math.sign(this.AS)!==Math.sign(e.deltaY)?this.AS=me(e):this.AS+=me(e);else{const t=me(e);this.xS.push({type:"wheel-zoom",deltaY:t})}this.ls.Ss(),Zt(e)}},this.ff.wn||this.ff.An||this.ls.Mn(1),this.ap.Ch("Chart3D"),this.DS=i.d3(),this.DS.x.Z(-1,1),this.DS.y.Z(-1,1),this.DS.z.Z(-1,1),this.Fm=e.BS("chart3D layer3D",0,this.DS),this.CS=e.OS("chart3D series bg",0),this.TS=e.Hp("chart3D axis ui",1),this.LS={x:new ya(this,(h=()=>this.My,{...Sa(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.ur().x)),Am:t=>t.x,Wm:(t,e)=>({x:t.x,y:e.y,z:e.z}),bd:f(0,-1,0),Hm: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)}},jm:()=>!0,Ym:()=>!1,Gm:()=>!1}),this.DS.x,this.Ji,this.Fm,this.TS,this.pixelScale,!1,this.ss),y:new ya(this,xa((()=>this.My)),this.DS.y,this.Ji,this.Fm,this.TS,this.pixelScale,!1,this.ss),z:new ya(this,ba((()=>this.My)),this.DS.z,this.Ji,this.Fm,this.TS,this.pixelScale,!1,this.ss)},this.RS=this.Fm.tm([Zh.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.Ji.chart3DBoundingBoxStrokeStyle),this.Fy=this.CS.Cc(this.engine.scale,sn.Simple).Me(this.Ji.chart3DSeriesBackgroundFillStyle).ve(st).setMouseInteractions(!0),this.Iy=this.CS.Cc(this.engine.scale,sn.Simple).Me(z).ve(this.Ji.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Ty(this.Fy,this.Iy),this.ES({x:1,y:1,z:1},!0),this.FS=new Ba(this.engine.scale,this.pixelScale,this.DS,((t,e)=>(e&&this.PS(e),this.Fm.Nm(t)))),this.zS=this.FS.getDefaultCameraConfiguration(this.VS(this.NS)),this.PS(this.zS),this.ty=Wi(new ji(((t,e,i)=>{a={locationOne:e,locationTwo:i,cameraLocation:this.Fm.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this._S&&!this.MS)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=Ce.length(a.cameraLocation),c=o/h*l,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.xS.push({type:"rotate+zoom",rotation:this._S?d:{x:0,y:0},cameraDistance:this.MS?c:l}),this.ls.Ss(),Zt(n)}),(t=>{})),new Yi((t=>{}),((t,e,i,s,r)=>{if(this._S){const t=s;this.xS.push({type:"rotate",rotation:t}),this.ls.Ss(),Zt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.ty.onTouchStart),this.onBackgroundTouchMove(this.ty.onTouchMove),this.onBackgroundTouchEnd(this.ty.onTouchEnd),this.onSeriesBackgroundTouchStart(this.ty.onTouchStart),this.onSeriesBackgroundTouchMove(this.ty.onTouchMove),this.onSeriesBackgroundTouchEnd(this.ty.onTouchEnd),this.onBackgroundMouseDrag(this.Qm),this.onBackgroundMouseWheel(this.Jm),this.onBackgroundMouseDown(((t,e)=>{Zt(e)})),this.onSeriesBackgroundMouseDrag(this.Qm),this.onSeriesBackgroundMouseWheel(this.Jm),this.onSeriesBackgroundMouseDown(((t,e)=>{Zt(e)})),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.onResize(this.Yr),this.Yr(),this.ep(r,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||Ia)(this,this.Ay,this.Fm,this.Ji,this.ls.ss,t);return this.Py(e),e}addLineSeries(t){const e=new Ta(this,this.Ay,this.Fm,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addPointLineSeries(t){const e=new wa(this,this.Ay,this.Fm,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addSurfaceGridSeries(t){const e=new Da(this,this.Ay,this.Fm,t,this.Ji,this.ls.ss);return this.Py(e),e}addSurfaceScrollingGridSeries(t){const e=new za(this,this.Ay,this.Fm,t,this.Ji,this.ls.ss);return this.Py(e),e}addBoxSeries(t){const e=new Ma(this,this.Ay,this.Fm,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}translateCoordinate(t,e,i){if(Oa(e)||Oa(i)||Ra(t)){if(Oa(e)&&Oa(i)&&Ra(t)){if("axes"===e.id&&"world"===i.id)return this.Fm.GS(t);if("world"===e.id&&"axes"===i.id)return this.Fm.WS(t);if(e.id===i.id)return t}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return Lh(t,e,i,this.pixelScale,this.ls)}getDefaultAxisX(){return this.LS.x}getDefaultAxisY(){return this.LS.y}getDefaultAxisZ(){return this.LS.z}getDefaultAxes(){return[this.LS.x,this.LS.y,this.LS.z]}setCameraLocation(t){let e={location:t,direction:Ce.normalize(Ce.multiply(t,-1))};const i=this.FS.cameraLocationChanged(this.IS(e));return i&&(e=i),this.PS(e),this.ls.Ss(),this}getCameraLocation(){return this.Fm.getCameraLocation()}getCameraDirection(){return this.Fm.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.FS.Jy(t);const e=this.FS.cameraLocationChanged(this.IS());return e&&this.PS(e),this}getCameraAutomaticFittingEnabled(){return this.FS.aS()}onCameraChange(t){return this.P.on("cameraChange",t)}offCameraChange(t){return this.P.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.RS.Pe(t).Om(ca(this.RS.Yl())),this.Fm.Ss(),this}getBoundingBoxStrokeStyle(){return this.RS.Yl()}setBoundingBox(t){return this.ES(t,!1),this}ES(t,e){this.NS=t;const i=this.VS(t);if(this.DS.x.q(i.x),this.DS.y.q(i.y),this.DS.z.q(-i.z),!e){const t=this.FS.boundingBoxChanged(this.IS());t&&this.PS(t)}this.ls.Ss()}getBoundingBox(){return this.NS}Ae(t){if(Nh.fp(this.ap,this.rp),0!==this.AS){const e=this.AS*t*.006;this.xS.push({type:"wheel-zoom",deltaY:e}),this.AS=Math.sign(this.AS)*Math.max(Math.abs(this.AS)-.01*t,0),0!==this.AS&&this.ls.Ss(!0)}const e=this.getCameraDirection();if(this.xS.length>0){const t=this.FS.applyCameraInteractions(this.IS(),this.xS);t&&this.PS(t),this.xS.length=0}this.HS&&Ce.equals(this.HS.location,this.zS.location)&&Ce.equals(this.HS.direction,this.zS.direction)||this.P.emit("cameraChange",this,this.getCameraLocation()),this.HS=this.zS,super.Ae(t);for(let t=0;tthis.Fm.Nm(t))),o=this.Fm.Nm(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.Wr.length=0,this.DS.G(),this.Fm.G(),this.TS.G(),this.CS.G(),super.dispose()}Y(){return this.DS.x.Y(),this.DS.y.Y(),this.DS.z.Y(),super.Y()}X(){return super.X()}PS(t){this.Fm.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(Ce.addVec(t.location,Ce.multiply(t.direction,-this.bS))),this.zS=t,this.ls.Ss()}VS(t){return Ce.divide(t,Ce.length(t)/this.SS)}IS(t=this.zS){return{boundingBox:this.VS(this.NS),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.MS=t,this}getMouseInteractionZoom(){return this.MS}setMouseInteractionRotate(t){return this._S=t,this}getMouseInteractionRotate(){return this._S}forEachAxis(t){return t(this.LS.x),t(this.LS.y),t(this.LS.z),this}getSeries(){return this.My}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.vS=!!t,this}getAnimationZoom(){return this.vS}}const Na={Column:Yn,Row:jn};class Ga extends Oh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.US=new Map,this.$S=this.addUIElement(Na.Row).setPosition({x:0,y:100}).setOrigin(Ts.LeftTop).setBackground((t=>t.setFillStyle(z).setStrokeStyle(st)))}add(t,e){return(t instanceof Vh?[t]:t instanceof Vf?t.getCells().filter((t=>t.panel instanceof Vh)).map((t=>t.panel)):[]).forEach((t=>{const i=this.$S.addElement(vo.VerticalLegendBox).setBackground((t=>t.setFillStyle(z).setStrokeStyle(st))).add(t,e).setTitle(t.getTitle());this.US.set(t,i)})),this.ls.Ss(),this}setLegendBoxes(t){return this.US.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.$S.getSize()}}class Ha{constructor(t,e){this.jS=t,this.YS=e}alter(t){this.XS=void 0!==this.XS?this.XS:this.YS(),this.ZS=t,this.jS(t)}resetValue(){void 0!==this.ZS&&(void 0!==this.XS&&this.isAltered()&&this.jS(this.XS),this.XS=void 0,this.ZS=void 0)}getNormalValue(){return void 0!==this.XS?this.XS:this.YS()}isAltered(){return void 0!==this.ZS&&this.YS()===this.ZS}}class Ua{constructor(t,e){this.KS=[],this.qS=t,this.ct=e}update(){return this.qS.getVisible()?!(this.JS()&&(!this.QS()||(this.resetTable(),this.qS.Ts(),this.JS()))&&(this.tx(),this.qS.Ts(),this.JS()&&(this.resetTable(),this.qS.Ts(),1))):(this.QS()&&this.resetTable(),!0)}QS(){for(let t=0;t{const s=at(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=at(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.qS,this.ct)}ix(){return((t,i)=>{const s=at(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=at(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.qS,this.ct)}sx(){return((t,i)=>{const s=at(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=at(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.qS,this.ct)}hx(t){return this.KS.push(t),t}}class Wa extends Ua{constructor(){super(...arguments),this.Jo=this.hx(new Ha((t=>this.qS.setOrigin(t)),(()=>this.qS.getOrigin())))}tx(){const t=this.Jo.getNormalValue(),e=u(this.ix()?-t.x:t.x,this.sx()?-t.y:t.y);this.Jo.alter(e)}}class Xa extends Ua{constructor(t,e,i,s){super(t,e),this.nx=this.hx(new Ha((t=>this.qS.setTextFont((e=>e.setSize(t)))),(()=>this.qS.getTextFont().getSize()))),this.ox=i,this.lx=s}tx(){const t=this.nx.getNormalValue(),e=this.ox;if(enew Wa(t,e),FontSize:(t=5,e=5)=>(i,s)=>new Xa(i,s,t,e)};class ja{constructor(){this.ux=[]}addRow(...t){return this.ux.push(t),this}}class Ja extends ja{vc(){const t=this.ux;return this.ux=[],t}gx(){return this.ux.length=0,this}}class $a extends Wn{constructor(){super(...arguments),this.cc=this.Ji.cursorResultTableTextFont,this.Qc=0,this.Mm=this.Ji.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!==o&&o.length>0){for(let t=h.length;t=h.length)t=r.addElement(Ln,void 0);else{const e=h[n];e instanceof Vn?(r.getMembers()[n].dispose(),t=r.addElement(Ln,n)):t=e}t.setFont(this.cc).setFillStyle(this.Mm).setText(o).setTextRotation(this.Qc)}else{for(let t=h.length;t=h.length?r.addGap(void 0,void 0):h[n]instanceof _n&&(r.getMembers()[n].dispose(),r.addGap(void 0,n))}}}}return this.As.Ss(),this}setTextFillStyle(t){this.Mm="function"==typeof t?t(this.Mm):t;for(let t=0;tt.setFillStyle(n.cursorResultTableFillStyle).setStrokeStyle(n.cursorResultTableStrokeStyle))).setTextFillStyle(n.cursorResultTableTextFillStyle).setTextFont(n.cursorResultTableTextFont),this._x=Ya.Flip(this.qS,this.scale)}dispose(){return this.Mx.dispose(),this.qS.dispose(),this}pointAt(t){return this.jo=t.scale===this.scale?t.location:at(t.location,t.scale,this.scale),this.Mx.setPosition(this.jo),this.qS.setPosition(this.jo).setContent(t.resultTableContent),this.As.Ss(),this}getPosition(){return this.jo}setVisible(t){return this.Fi=t,this.As.Ss(),this}getVisible(){return this.Fi}setPointMarkerVisible(t){return this.yx=t,this.As.Ss(),this}getPointMarkerVisible(){return this.yx}setPointMarker(t){return t(this.Mx),this.As.Ss(),this}getPointMarker(){return this.Mx}setResultTableVisible(t){return this.Sx=t,this.As.Ss(),this}getResultTableVisible(){return this.Sx}setResultTable(t){return t(this.qS),this.As.Ss(),this}getResultTable(){return this.qS}setAutoFitStrategy(t){return this._x&&this._x.resetTable(),this._x=t?t(this.qS,this.As.ls.ct):void 0,this.As.Ss(),this}getAutoFitStrategy(){return void 0!==this._x}Ae(){return this._x&&this._x.update(),this.qS.setVisible(this.xx&&this.Fi&&this.Sx),this.Mx.setVisible(this.xx&&this.Fi&&this.yx),this.Mx.Ae(),this.qS.Ae(),this}Ts(){return this.Mx.Ts(),this.qS.Ts(),this.xx=((t,e,i=e)=>{const s=e!==i?at(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.jo,this.scale),this}}class Ka extends qa{constructor(){super(...arguments),this.Ax=!1}pointAt(t){return this.wx(t.fillStyle),super.pointAt(t)}wx(t){t&&this.Ax&&this.qS.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.Ax=t,this.As.Ss(),this}getResultTableAutoTextStyle(){return this.Ax}}class Za extends qa{setPosition(t){return this.jo=t,this.Mx.setPosition(t),this.qS.setPosition(t),this.As.Ss(),this}}class Qa{constructor(t,e,i=[]){this.kx=[],this.Cx=(t,e)=>(this.kx.forEach((i=>i(t,e))),t),this.bx=t,this.vx=e,this.kx=i}}class tl extends Qa{constructor(){super(...arguments),this.Tx=(t,e,i,s)=>this.Cx(new Ka(t,e,i,this.bx,this.vx,s),s),this.addStyler=t=>new tl(this.bx,this.vx,this.kx.map((t=>t)).concat(t)),this.setPointMarker=t=>new tl(t,this.vx,this.kx.map((t=>t))),this.setResultTableBackground=t=>new tl(this.bx,t,this.kx.map((t=>t)))}}class el extends Qa{constructor(){super(...arguments),this.Fx=(t,e,i,s)=>this.Cx(new Za(t,e,i,this.bx,this.vx,s),s),this.addStyler=t=>new el(this.bx,this.vx,this.kx.map((t=>t)).concat(t)),this.setPointMarker=t=>new el(t,this.vx,this.kx.map((t=>t))),this.setResultTableBackground=t=>new el(this.bx,t,this.kx.map((t=>t)))}}const il=t=>t.setPointMarker((t=>t.setSize(u(5,5)).setOrigin(u(0,0)))).setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),sl=(t,e)=>t.setPointMarker((t=>t.setFillStyle(e.chartMarkerPointMarkerFillStyle).setStrokeStyle(e.chartMarkerPointMarkerStrokeStyle).setSize(u(20,20)).setOrigin(u(0,0)))).setResultTable((t=>t.setEffect(!0).setBackground((t=>t)).setOrigin(u(-1,-1)).setMargin(10))),rl=new tl(Dn,Dn,[il]),nl=new tl(Dn,Rn,[il,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof Rn&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),ol=rl,hl=nl;new el(On,Dn,[sl,t=>t.setResultTableVisible(!1)]);const al=new el(kn,Dn,[sl,t=>t.setResultTable((t=>t.setOrigin(Ts.LeftBottom)))]),ll=(t,e,i,s,r)=>({location:t,scale:e,resultTableContent:i,series:s,fillStyle:r}),ul={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},cl=(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(),dl=(t,e)=>{let i=e.geometry;return i=fl(t,e,i),i=gl(t,e,i),i},fl=(t,e,i)=>{if(t===ul.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===ul.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=Xe(kt(i)),h=[];for(let e=0;e{this.My.includes(t)||(this.My.push(t),this.P.emit("seriesAdded",this,t))},this.Dx=i.Bx();const c=()=>{this.Ix!==e.AutoCursorModes.disabled&&this.ls.Ss()},d=()=>{this.Ix!==e.AutoCursorModes.disabled&&this.ls.Ss()},f=()=>{this.Ix!==e.AutoCursorModes.disabled&&this.ls.Ss()},g=()=>{this.Ix!==e.AutoCursorModes.disabled&&this.ls.Ss()},y=()=>{this.Ix!==e.AutoCursorModes.disabled&&this.ls.Ss()},m=()=>{this.Ix!==e.AutoCursorModes.disabled&&this.ls.Ss()};this.onSeriesBackgroundMouseEnter(c),this.onSeriesBackgroundMouseMove(d),this.onSeriesBackgroundMouseLeave(f),this.onSeriesBackgroundTouchStart(g),this.onSeriesBackgroundTouchMove(y),this.onSeriesBackgroundTouchEnd(m),this.Ox(((t,e)=>{const i=e.onMouseEnter(c),s=e.onMouseMove(d),r=e.onMouseLeave(f),n=e.onTouchStart(g),o=e.onTouchMove(y),h=e.onTouchEnd(m),a=this.Lx(((t,l)=>{l===e&&(e.offMouseEnter(i),e.offMouseMove(s),e.offMouseLeave(r),e.offTouchStart(n),e.offTouchMove(o),e.offTouchEnd(h)),this.Rx(a)}))}))}setAutoCursor(t){return this.Ex&&t(this.Ex),this.ls.Ss(),this}getAutoCursor(){return this.Ex}setAutoCursorMode(t){return this.Ix=t,this.ls.Ss(),this}getAutoCursorMode(){return this.Ix}zx(t){if(t.xthis.uiScale.x.Nt()||t.ythis.uiScale.y.Nt())return;let e,i=Number.MAX_VALUE;for(const s of this.My)if(s.getCursorEnabled()&&s.getVisible()){const r=s.zx(t,!1);if(r){const s=at(r.location,r.scale,this.engine.scale),n=Ne(t,s);Number.isNaN(n)||e&&!(nt.getIsUnderMouse())),r=this.Fy.getIsUnderMouse();this.Ix===e.AutoCursorModes.snapToClosest?(r||void 0!==s)&&(i=t&&this.zx(t)):this.Ix===e.AutoCursorModes.onHover&&void 0!==s&&s.getCursorEnabled()&&(i=t&&s.zx(t,!0))}i?this.Ex.pointAt(i).setVisible(!0):this.Ex.setVisible(!1),this.Ex.Ts().Ae()}Ox(t){return this.P.on("seriesAdded",t)}Nx(t){return this.P.off(t)}Lx(t){return this.P.on("seriesDispose",t)}Rx(t){return this.P.off(t)}dispose(){return this.Dx.G(),this.Ex.dispose(),super.dispose()}}class xl extends Vh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.hp("mapChart bg",0),r,i.ls.Ji.mapChartBackgroundFillStyle,i.ls.Ji.mapChartBackgroundStrokeStyle,i.ls.Ji.mapChartTitleFont,i.ls.Ji.mapChartTitleFillStyle,h),this.Gx=[],this.ct=this.Ug.d2({scaleXYConstructor:_i}),this.ki=!0,this.Wx=this.Ji.mapChartSeparateRegionFillStyle,this.Hx=this.Ji.mapChartSeparateRegionStrokeStyle,this.Ux=e.AutoCursorModes.onHover,this.$x=bl,this.Ze=!0,this.jx=0,this.Yx=!0,this.Xx=new Map,this.onMouseEnter=t=>this.P.on("mouseEnter",t),this.onMouseLeave=t=>this.P.on("mouseLeave",t),this.onMouseClick=t=>this.P.on("mouseClick",t),this.onMouseDoubleClick=t=>this.P.on("mouseDoubleClick",t),this.onMouseDown=t=>this.P.on("mouseDown",t),this.onMouseUp=t=>this.P.on("mouseUp",t),this.onMouseMove=t=>this.P.on("mouseMove",t),this.offMouseEnter=t=>this.P.off(t,"mouseEnter"),this.offMouseLeave=t=>this.P.off(t,"mouseLeave"),this.offMouseClick=t=>this.P.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.P.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.P.off(t,"mouseDown"),this.offMouseUp=t=>this.P.off(t,"mouseUp"),this.offMouseMove=t=>this.P.off(t,"mouseMove"),this.offMouseDragStart=t=>this.P.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.P.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.P.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.P.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.P.on("mapDataReady",t);return this.Zx&&xt.setTimeout((()=>t())),e},this.onViewChange=t=>this.P.on("viewChange",t),this.Kx=(t,e,i,s,r)=>{this.ct.x.q(s).zt([this.Ft.left+this.Qo.left,this.Ft.right+this.Qo.right]),this.ct.y.q(r).zt([this.Ft.bottom+this.Qo.bottom,this.Ft.top+this.Qo.top+Nh.dp(this.ap,this.rp)]),this.qx&&this.Jx(this.Qx,this.ct,this.qx)},this.Ri=(t,i)=>{const s=i;if(!s||!this.Zx)return;const{iRegion:r,region:n}=this.tb(this.Zx,s);this.Ux!==e.AutoCursorModes.disabled&&(this.ib(n,r),Zt(t)),this.Yx&&this.ls.os.vs(n,!0),this.P.emit("mouseEnter",this,t)},this.Ei=(t,e)=>{const i=e;if(!i||!this.Zx)return;const{iRegion:s,region:r}=this.tb(this.Zx,i);this.sb(r,s),this.Yx&&this.ls.os.vs(r,!1),this.P.emit("mouseLeave",this,t),t&&Zt(t)},this.zi=(t,i)=>{const s=i;if(!s||!this.Zx)return;const{iRegion:r,region:n}=this.tb(this.Zx,s);this.Ux!==e.AutoCursorModes.disabled&&(this.ib(n,r),Zt(t)),this.P.emit("mouseMove",this,t)},this.Vi=(t,e)=>this.P.emit("mouseClick",this,t),this.Ni=(t,e)=>this.P.emit("mouseDoubleClick",this,t),this.Gi=(t,e)=>this.P.emit("mouseDown",this,t),this.Wi=(t,e)=>this.P.emit("mouseUp",this,t),this.Hi=(t,e,i)=>{this.P.emit("mouseDragStart",this,t,e)},this.Ui=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,t,e,i,s)},this.$i=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,t,e,i)},this.ji=(t,e)=>{this.P.emit("mouseWheel",this,t)},this.Yi=(t,e)=>{const i=e;if(!i||!this.Zx)return;const{iRegion:s,region:r}=this.tb(this.Zx,i);this.eb=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.ib(r,s),this.Yx&&this.ls.os.vs(r,!0),this.P.emit("touchStart",this,t),Zt(t)},this.Xi=(t,e)=>{const i=e;if(!i||!this.Zx)return;const{iRegion:s,region:r}=this.tb(this.Zx,i);this.eb=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.ib(r,s),this.P.emit("touchMove",this,t),Zt(t)},this.Zi=(t,e)=>{const i=e;if(!i||!this.Zx)return;const{iRegion:s,region:r}=this.tb(this.Zx,i);this.eb=void 0,this.sb(r,s),this.Yx&&this.ls.os.vs(r,!1),this.P.emit("touchEnd",this,t),Zt(t)},this.ff.wn||this.ff.An||this.ls.Mn(3),(null==o?void 0:o.disableAnimations)&&(this.Ze=!1),this.hb=i.Hp("mapChart plotting",0),this.onResize(this.Kx),this.ap.Ch("Map Chart");const a=Lt(o?o.autoCursorBuilder:void 0,al);this.rb=a.Fx(i.Bx(),this.ct,this.ct,this.Ji).setVisible(!1),this.nb=this.ss.xg(),this.ep(n,this.uiScale),this.ob=this.hb.ab(this.ct).setMouseInteractions(this.ki).setMouseEnterEventHandler(((t,e,i)=>this.Ri(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.Ei(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Vi(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.Ni(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Gi(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Wi(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.zi(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Hi(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Ui(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.$i(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.ji(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Yi(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Xi(e,i))).setTouchEndEventHandler(((t,e,i)=>this.Zi(e,i))).Me(this.Ji.mapChartFillStyle).ve(this.Ji.mapChartStrokeStyle),this.lb=this.hb.ab(this.ct).setMouseInteractions(this.ki).Me(this.Ji.mapChartOutlierRegionFillStyle).ve(this.Ji.mapChartOutlierRegionStrokeStyle);const l=Lt(o&&o.type,ul.World);this.Qx=l,this.ub(l).then((()=>{this.P.emit("mapDataReady")}))}setFillStyle(t){return this.ob.Me(t),this.ls.Ss(),this}getFillStyle(){return this.ob.Th()}setStrokeStyle(t){return this.ob.ve(t),this.ls.Ss(),this}getStrokeStyle(){return this.ob.Un()}setEffect(t){return this.nb.ys(t),this.ls.Ss(),this}getEffect(){return this.nb.xs()}setOutlierRegionFillStyle(t){return this.lb.Me(t),this.ls.Ss(),this}getOutlierRegionFillStyle(){return this.lb.Th()}setOutlierRegionStrokeStyle(t){return this.lb.ve(t),this.ls.Ss(),this}getOutlierRegionStrokeStyle(){return this.lb.Un()}setSeparateRegionFillStyle(t){return this.Wx="function"==typeof t?t(this.Wx):t,this.Gx.forEach((t=>t.Me(this.Wx))),this.ls.Ss(),this}getSeparateRegionFillStyle(){return this.Wx}setSeparateRegionStrokeStyle(t){return this.Hx="function"==typeof t?t(this.Hx):t,this.Gx.forEach((t=>t.ve(this.Hx))),this.ls.Ss(),this}getSeparateRegionStrokeStyle(){return this.Hx}invalidateRegionValues(t){if(!this.Zx||!this.cb)return this.fb=this.fb||[],this.fb.push(t),this;if("function"==typeof t)for(let e=0;e{t.gb(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.gb(e.value)}))}}return this.ls.Ss(),this}setAutoCursor(t){return this.rb&&t(this.rb),this.ls.Ss(),this}getAutoCursor(){return this.rb}setAutoCursorMode(t){return this.Ux=t,this.ls.Ss(),this}getAutoCursorMode(){return this.Ux}setCursorResultTableFormatter(t){return this.$x=t,this.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}onMouseDragStart(t){return this.P.on("mouseDragStart",t)}onMouseDrag(t){return this.P.on("mouseDrag",t)}onMouseDragStop(t){return this.P.on("mouseDragStop",t)}onMouseWheel(t){return this.P.on("mouseWheel",t)}onTouchStart(t){return this.P.on("touchStart",t)}onTouchMove(t){return this.P.on("touchMove",t)}onTouchEnd(t){return this.P.on("touchEnd",t)}offTouchStart(t){return this.P.off(t,"touchStart")}offTouchMove(t){return this.P.off(t,"touchMove")}offTouchEnd(t){return this.P.off(t,"touchEnd")}setMouseInteractions(t){return this.ki=t,this.ob.setMouseInteractions(t),this}getMouseInteractions(){return this.ki}setHighlight(t){var e;return t=ve(t),this.jx=t,null===(e=this.Zx)||void 0===e||e.regions.forEach((e=>{this.ls.os.vs(e,t)})),this.P.emit("highlight",t),this}getHighlight(){return this.jx}setAnimationHighlight(t){var e;return null===(e=this.Zx)||void 0===e||e.regions.forEach((e=>{this.ls.os.Ms(e,t)})),this}getAnimationHighlight(){var t;return this.ls.os._s(null===(t=this.Zx)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.Yx=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Yx}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}offMapDataReady(t){return this.P.off(t,"mapDataReady")}offViewChange(t){return this.P.off(t,"viewChange")}async ub(t){const e=await((t,e)=>{let i;if(t===ul.World)i="countries_world.json";else if(t===ul.NorthAmerica)i="countries_northAmerica.json";else if(t===ul.SouthAmerica)i="countries_southAmerica.json";else if(t===ul.Africa)i="countries_africa.json";else if(t===ul.Europe)i="countries_europe.json";else if(t===ul.Asia)i="countries_asia.json";else if(t===ul.USA)i="states_usa.json";else if(t===ul.Canada)i="territoriesProvinces_canada.json";else{if(t!==ul.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw xt.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return xt.fetch(s).then((t=>t.json())).catch((t=>{Ee(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.ff.Hs);this.cb=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=yl[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.lb.kr().tl(e);if(t===ul.USA){const t=25.8,e=29.7;this.Gx.push(this.hb._e(this.ct).setMouseInteractions(!1).Me(this.Wx).ve(this.Hx).we({x:-126,y:t}).q({x:10,y:e-t}),this.hb._e(this.ct).setMouseInteractions(!1).Me(this.Wx).ve(this.Hx).we({x:-113,y:t}).q({x:7,y:e-t}))}const s=this.ls.os.wr(this.ob,{animationEnabled:this.Ze});for(let i=0;i{o.forEach((e=>e.us(t)))}))}if(this.nb.ds([this.ob]),this.qx=i,this.Jx(t,this.ct,i),this.Zx=e,this.fb){for(const t of this.fb)this.invalidateRegionValues(t);this.fb=void 0}this.ls.Ss()}Jx(t,e,i){const s=ml[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.Z(o.min.x,o.max.x),e.y.Z(o.min.y,o.max.y);const h=this.ct.x.$t(),a=this.ct.y.$t();this.P.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]}})}ib(t,e){this.pb={region:t,iRegion:e},this.ls.Ss()}sb(t,e){this.pb&&t===this.pb.region&&(this.pb=void 0,this.ls.Ss())}tb(t,e){const i=Array.from(this.Xx.entries()).findIndex((([t,i])=>i.includes(e)));return{iRegion:i,region:null==t?void 0:t.regions[i]}}setAnimationsEnabled(t){return this.Ze=!t,this}getAnimationsEnabled(){return this.Ze}getMinimumSize(){}Sd(){return[this]}Ae(t){super.Ae(t),super.sp(),Nh.fp(this.ap,this.rp);const e=m(this.ct.x.Vt(),this.ct.y.Vt(),this.ct.x.Gt(),this.ct.y.Gt());this.hb.kS(e);const i=this.ls.vn()||this.eb;if(this.pb&&i){const t=this.cb&&this.cb[this.pb.iRegion];let e=at(i,this.engine.scale,this.ct);e={x:Ct(e.x,this.ct.x.getInnerStart(),this.ct.x.getInnerEnd()),y:Ct(e.y,this.ct.y.getInnerStart(),this.ct.y.getInnerEnd())};let s=e.x,r=e.y;const n=this.pb.region.transform;this.pb.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.rb.setPosition(e).setVisible(!0).getResultTable().setContent(this.$x(new Ja,this.pb.region,t,s,r,this).vc())}else this.rb.setVisible(!1);return this.rb.Ts().Ae(),this}dispose(){return this.hb.G(),this.rb.dispose(),zh(this.ct),super.dispose()}Y(){return super.Y(),this.ct.Y(),this}X(){return super.X(),this.ct.X(),this}ld(){return de(this.getFillStyle())}attach(t,e){return t.setText(this.getTitle()),t.setButtonOffStrokeStyle(t.getButtonOffStrokeStyle().setThickness(1)),t.setButtonOnStrokeStyle(t.getButtonOnStrokeStyle().setThickness(1)),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))),ce(t,this.Ji,{fill:this.getFillStyle()}),this}}const bl=(t,e,i,s,r,n)=>(t.addRow(`${e.name}`).addRow(vl(s,r)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),vl=(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")}`};class Ml extends $s{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.mb(i),s,r,{numeric:e.yb({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.yb({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.yb({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.Sb=n,this.xb=o,this.bb=h,this.ss=a,this.vb=i,this.Mb=e.yb({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.kh=h.Sr(i).setMouseInteractions(!1).Ih(e.yb({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).Me(e.yb({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Bh=this.ss.xg([this.kh]).ys(s.effectsText)}setTickStrategy(t,e){return super.Mh(t,e)}setStrokeStyle(t){return this.Mb="function"==typeof t?t(this.Mb):t,this.xb.Ss(),this}getStrokeStyle(){return this.Mb}Qh(t,e){return new Al(e,t,this.vb,this.bb,this.bb,this._b(this.Sb,this.vb),this.bb.De(this.vb).setMouseInteractions(!1))}tr(t,e){const i=this.Ab(this.vb,t);this.wb&&!1===this.wb(t)?t.Ve.setVisible(!1):t.Ve.setVisible(!0).we(ri(this.kb(this.vb,t.u),i.padding)).Sa(i.alignment).Ph(i.rotation).da(i.offset.x,i.offset.y),this.Cb(this.vb,t.Tb,t.Fb,t)}setMouseInteractions(t){return this}Ae(){this.Hh({physicalAxisSize:0});const t=this.er(((t,e)=>{const i=e.dh.Jh,s=.5*this.Mb.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Ve.Ts().Ht().y/this.vb.Ai().y)+i.labelPadding;return Math.max(t,s)}),0);return this.Ib(this.vb,this.Mb,t),this.Pb(this.vb,this.kh,t),t}}class Al extends qo{constructor(t,e,i,s,r,n,o,h){super(t,e,s,i,r,i,h),this.Tb=n,this.Fb=o,n.setMouseInteractions(!1),this.Qi.push(n,o)}}class Tl extends Ml{constructor(t,e,i,s,r,n,o,h,a){super(t,wl((()=>this.Ag())),e,i,s,r,n,o,h),this.Bm=this.xb.De(this.vb).setMouseInteractions(!1),this.Db=a,this.setScrollStrategy(zs.expansion),this.setTickStrategy(Os.Numeric),this.setTitle("Amplitude")}Ag(){return this.Db()}dr(t,e){return Jo(t,e,this.vb.y)}pr(t,e,i){const s=2*(e-t),r=this.vb.x.mi(s);return{min:t-i*r,max:e+i*r}}kb(t,e){return{x:t.Bb()?e-t.Ob().start:t.Ob().start-e,y:0}}_b(t,e){return t.Dc(e)}Cb(t,e,i,s){const r=s.dh.Jh,n=t.Bb()?s.u-t.Ob().start:t.Ob().start-s.u;It(s.u,t.Ob().start)||It(s.u,t.Ob().end)?e.setVisible(!1):e.setVisible(!0).Nl(0).Be(360).$l(void 0).Ul(0).Gl(n).$l(60).Me(z).ve(r.gridStrokeStyle);const o=.5*this.Mb.getThickness();i.Oe({x:n,y:-o*t.Ai().y}).Be({x:n,y:-(o+r.tickLength)*t.Ai().y}).Pe(r.tickStyle)}Ab(t,e){const i=e.dh.Jh;return{alignment:{x:0,y:1},padding:{x:0,y:t.Ai().y*-(.5*this.Mb.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}Ib(t,e,i){const s=t.Bb()?t.Ob().end-t.Ob().start:t.Ob().start-t.Ob().end;this.Bm.Oe({x:0,y:0}).Be({x:s,y:0}).Pe(e)}Pb(t,e,i){const s=t.Bb()?(t.Ob().start+t.Ob().end)/2-t.Ob().start:t.Ob().start-(t.Ob().start+t.Ob().end)/2;e.Sa({x:0,y:1}).we({x:s,y:-i*t.Ai().y})}}const wl=t=>({...Sa(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),mb:t=>({getInnerStart:()=>t.Ob().start,getInnerEnd:()=>t.Ob().end,Z:(e,i)=>t.Lb(e,i),rt:(e,i,s,r,n)=>t.y.rt(e,i,s,r,n)}),yb:t=>t.amplitude});class El extends Ml{constructor(t,e,i,s,r,n,o,h){super(t,Cl,e,i,s,r,n,o,h),this.Rb=90,this.Eb=12,this.zb=Il,this.Bm=this.xb.Dc(this.vb).setMouseInteractions(!1),this.wb=t=>{let e=180*(t.u-this.vb.Vb())/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.je=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Rb)}setTickStyle(t){return this.Nb="function"==typeof t?t(this.Nb):t,this.Gb(),this.xb.Ss(),this}getTickStyle(){return this.Nb}setTickFormattingFunction(t){return this.zb=t,this.Gb(),this.xb.Ss(),this}getTickFormattingFunction(){return this.zb}setClockwise(t){this.vb.Wb(t);const e=this.Rb*Math.PI/180;return t?this.vb.Hb(e+Math.PI/2):this.vb.Hb(e-Math.PI/2),this.xb.Ss(),this}getClockwise(){return!this.vb.Ub()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Rb=t;const e=t*Math.PI/180;return this.getClockwise()?this.vb.Hb(e+Math.PI/2):this.vb.Hb(e-Math.PI/2),this.xb.Ss(),this}getNorth(){return 180*this.vb.Vb()/Math.PI}setDivision(t){return this.Eb=t,this.Gb(),this.xb.Ss(),this}getDivision(){return this.Eb}Ag(){return[]}dr(t,e){return e}pr(t,e,i){return{min:t,max:e}}kb(t,e){const i=t.Ub()?1:-1,s=t.Vb(),r=t.Bb()?t.Ob().end-t.Ob().start:t.Ob().start-t.Ob().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}_b(t,e){return t.De(e)}Cb(t,e,i,s){const r=this.Nb,n=t.Ub()?1:-1,o=t.Vb(),h=(s.u-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.Bb()?t.Ob().end-t.Ob().start:t.Ob().start-t.Ob().end,c={x:a*u,y:l*u};e.Oe({x:0,y:0}).Be(c);const d={x:c.x+a*r.tickLength*t.Ai().x,y:c.y+l*r.tickLength*t.Ai().y};i.Oe(c).Be(d),e.Pe(r.gridStrokeStyle),i.Pe(r.tickStyle)}Ab(t,e){const i=this.Nb,s=t.Ub()?1:-1,r=t.Vb();let n,o=(e.u-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.Ai().x,l=Math.sin(o)*h*t.Ai().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}Ib(t,e,i){const s=t.Bb()?t.Ob().end-t.Ob().start:t.Ob().start-t.Ob().end;this.Bm.Nl(0).Be(360).Ul(0).Gl(s+.5*e.getThickness()*t.Ai().x).$l(360).Me(z).ve(e)}Pb(t,e,i){const s=t.Vb(),r=this.Ab(t,{u:0+s}),n=t.Bb()?t.Ob().end-t.Ob().start:t.Ob().start-t.Ob().end;e.Sa(r.alignment).Ph(r.rotation).da(r.offset.x,r.offset.y).we(ri({x:n,y:0},r.padding))}Gb(){this.Eh({Ne:[],Ge:[{Ve:"Radial ticks",Fg:0,Jh:this.Nb,Kh:this.zb,Mr:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Eb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},fh:{ir:()=>{},gh:()=>!1},_r:void 0}],Ee:Il,zh:void 0,Vh:void 0})}}const Il=(t,e,i)=>(180*t/Math.PI).toFixed(0),Cl={nr:()=>{},ar:()=>{},ur:()=>{},mb:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,Z:(t,e)=>{},rt:(e,i,s,r,n)=>t.x.rt(e,i,s,r,n)}),yb:t=>t.radial},kl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),Pl=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class Fl extends Gi{constructor(t,e,i,s,r,n){super(e,i,r,n),this.bs="Sector",this.$b=0,this.jb=1*Math.PI/2,this.Yb=void 0,this.Xb=void 0,this.As=t,this.vb=s,this.kp=this.As.Dc(this.vb).us(this.getHighlight()),this.cs(this.kp),this.Se=r.polarSectorFillStyle,this.xe=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.$b=Ct(t,0,360),this.As.Ss(),this}getAngleStart(){return this.$b}setAngleEnd(t){return this.jb=Ct(t,0,360),this.As.Ss(),this}getAngleEnd(){return this.jb}setAmplitudeStart(t){return this.Yb=t,this.As.Ss(),this}getAmplitudeStart(){return this.Yb}setAmplitudeEnd(t){return this.Xb=t,this.As.Ss(),this}getAmplitudeEnd(){return this.Xb}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.As.Ss(),this}getFillStyle(){return this.Se}setStrokeStyle(t){return this.xe="function"==typeof t?t(this.xe):t,this.As.Ss(),this}getStrokeStyle(){return this.xe}Ae(){const t=this.vb.Ob(),e=180*this.vb.Vb()/Math.PI,i=void 0!==this.Yb?Ct(this.Yb,t.start,t.end):t.start,s=void 0!==this.Xb?Ct(this.Xb,t.start,t.end):t.end,r=this.vb.Bb()?i-t.start:t.start-i,n=this.vb.Bb()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.vb.Ub()?1:-1,l=Math.abs(this.jb-this.$b);this.kp.Nl((this.$b-e)*a).Be((this.jb-e)*a).Ul(100*o/h).Gl(h).Me(this.Se).ve(this.xe).$l(Math.ceil(l/2))}ke(t,e){t.us(e),this.As.Ss()}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se,stroke:this.xe}),this}}class Bl extends Gi{constructor(){super(...arguments),this.Km=!0,this.Zb=!0}setAutoScrollingEnabled(t){return this.Km=t,this.Ki.ls.Ss(),this}getAutoScrollingEnabled(){return this.Km}ey(){}Ae(){}om(){}setCursorEnabled(t){return this.Zb=t,this}getCursorEnabled(){return this.Zb}}class _l extends Bl{constructor(t,e,i,s,r,n){super(e,i,r,n),this.As=t,this.Ki=e,this.scale=s}getAmplitudeMin(){return this.Kb?this.Kb.min:void 0}getAmplitudeMax(){return this.Kb?this.Kb.max:void 0}}const Ll=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(s)),Dl=(t,e)=>{const i=[],s=e.Ob().start,r=e.Ob().end,n=e.Bb(),o=e.Ub()?1:-1,h=e.Vb(),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=Ct(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},zl=t=>{const e={min:ke,max:Pe};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},Ol=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),Rl=(t,e)=>{let i=gi(t);for(e.Ub()||(i*=-1),i+=180*e.Vb()/Math.PI;i<0;)i+=360;i%=360;const s=ii(t),r=e.Ob(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:Mo(r.start,r.end,s/n)}};class Vl extends _l{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this.bs="Heatmap Series",this.qb=!0,this.$x=Nl,this.ld=()=>de(this.Se);const h=this.Ki.getSeries().length;this.Se=ye(this.Ji.polarHeatmapSeriesFillStyle||this.Ji.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._n=u,this.Jb=t.Qb(s,[],u).Me(this.Se).us(this.getHighlight()),this.cs(this.Jb);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.Kb={min:c,max:d},this.setHighlightOnHover(!1)}invalidateIntensityValues(t){if(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._n.dataOrder?t[0].length:t.length,annuli:"annuli"===this._n.dataOrder?t.length:t[0].length},i="annuli"===this._n.dataOrder?this._n.annuli:this._n.sectors,s="annuli"===this._n.dataOrder?this._n.sectors:this._n.annuli;if(e.x>i||e.y>s){if(!0===this.Ki.ff.Pn){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.`;xt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.ff.Pn){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.`;xt.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.Jb.dS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.As.Ss(),this}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.Jb.Me(this.Se),this.As.Ss(),this}getFillStyle(){return this.Se}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}clear(){return this.Jb.Ha(),this.As.Ss(),this}setCursorInterpolationEnabled(t){return this.qb=t,this.As.ls.Ss(),this}getCursorInterpolationEnabled(){return this.qb}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.Jb.uS(t),this.As.Ss(),this}getIntensityInterpolation(){return this.Jb.cS()}Xm(){return this.Km&&this.getVisible()}ke(t,e){t.us(e),this.As.Ss()}zx(t,e){const i=at(t,this.Ki.engine.scale,this.scale),s=Rl(i,this.scale),r=this.qb?this.Jb.tv(s):this.Jb.zx(s);if(r)return ll(Dl([r],this.scale)[0],this.scale,this.$x(new Ja,this,{angleDeg:r.angle,amplitude:r.amplitude,intensity:r.cellValue,iAnnulus:r.iAnnulus,iSector:r.iSector},this.Ki.getAmplitudeAxis().formatValue).vc(),this,this.Se)}solveNearestFromScreen(t){return this.zx(Yo(t,this.Ki.ls),!1)}Ae(){}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se}),this}}const Nl=(t,e,i,s)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i.angleDeg).toString()).addRow("Amplitude","",s(i.amplitude)).addRow("Intensity","",i.intensity.toFixed(1));class Gl extends _l{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.bs="Line Series",this.sv=[],this.ev=!1,this.hv=!1,this.$x=Ll,this.jl=ye(this.Ji.polarLineSeriesStrokeStyle,n),this.rv=t.tm(s,void 0,[Zh.UserSeries]).Pe(this.jl).us(this.getHighlight()).La(Cr.Nearest),this.cs(this.rv)}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}setData(t){return this.sv=Ol(t),this.ev=!0,this.Kb=zl(this.sv),this.As.Ss(),this}setStrokeStyle(t){this.jl="function"==typeof t?t(this.jl):t;const e=this.jl;return this.rv.Pe(e),this.As.Ss(),this}getStrokeStyle(){return this.jl}setConnectDataAutomaticallyEnabled(t){return this.hv=t,this.As.Ss(),this}getConnectDataAutomaticallyEnabled(){return this.hv}Xm(){return this.Km&&this.sv.length>0&&this.getVisible()}ke(t,e){t.us(e),this.As.Ss()}zx(t,e){return this.nv(t,this.rv)}solveNearestFromScreen(t){return this.nv(Yo(t,this.Ki.ls),this.rv)}nv(t,e){const i=e.ov(t);if(!i)return;const{angle:s,amplitude:r}=Rl(i,this.scale);return ll(i,this.scale,this.$x(new Ja,this,s,r,this.Ki.getAmplitudeAxis().formatValue).vc(),this,this.jl.getFillStyle())}Ae(){if(this.ev||this.scale.av()){const t=Dl(this.sv,this.scale),e=Xe(t);this.hv?(t.push({...t[0]}),this.rv.bl(!0)):this.rv.bl(!1),this.rv.Ha().Wa(t).ko(e),this.ev=!1,this.rv.Ts()}}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{stroke:this.jl}),this}}class Hl extends _l{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.bs="Point Line Series",this.sv=[],this.ev=!1,this.hv=!1,this.lv=3,this.Ko=0,this.uv=e.PointShape.Circle,this.$x=Ll,this.Se=ye(this.Ji.polarPointLineSeriesFillStyle,o),this.jl=ye(this.Ji.polarPointLineSeriesStrokeStyle,o),this.rv=t.tm(r,void 0,[Zh.UserSeries]).Pe(this.jl).us(this.getHighlight()).La(Cr.Nearest),this.cs(this.rv),this.cv=t.vy(r).Me(this.Se).za(this.uv).q(this.lv).us(this.getHighlight()).La(Cr.Nearest),this.cs(this.cv)}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}setData(t){return this.sv=Ol(t),this.ev=!0,this.Kb=zl(this.sv),this.As.Ss(),this}setStrokeStyle(t){this.jl="function"==typeof t?t(this.jl):t;const e=this.jl;return this.rv.Pe(e),this.As.Ss(),this}getStrokeStyle(){return this.jl}setPointFillStyle(t){this.Se="function"==typeof t?t(this.Se):t;const e=this.Se;return this.cv.Me(e),this.As.Ss(),this}getPointFillStyle(){return this.Se}setPointSize(t){return this.lv=t,this.cv.q(t),this.As.Ss(),this}getPointSize(){return this.lv}setPointShape(t){return this.uv=t,this.cv.za(this.uv),this}getPointShape(){return this.uv}setPointRotation(t){return this.Ko=t,this.cv.Ph(t),this.As.Ss(),this}getPointRotation(){return this.Ko}setConnectDataAutomaticallyEnabled(t){return this.hv=t,this.As.Ss(),this}getConnectDataAutomaticallyEnabled(){return this.hv}Xm(){return this.Km&&this.sv.length>0&&this.getVisible()}ke(t,e){t.us(e),this.As.Ss()}zx(t,e){return this.nv(t,this.rv)}solveNearestFromScreen(t){return this.nv(Yo(t,this.Ki.ls),this.rv)}nv(t,e){const i=e instanceof qr?e.zx(t):e.ov(t);if(!i)return;const{angle:s,amplitude:r}=Rl(i,this.scale);return ll(i,this.scale,this.$x(new Ja,this,s,r,this.Ki.getAmplitudeAxis().formatValue).vc(),this,"color"in i&&H(this.Se)?new V({color:i.color}):this.Se)}Ae(){if(this.ev||this.scale.av()){const t=Dl(this.sv,this.scale),e=Xe(t);this.hv?(t.push({...t[0]}),this.rv.bl(!0)):this.rv.bl(!1),this.rv.Ha().Wa(t).ko(e),this.cv.Ha().Wa(t).ko(e),this.ev=!1,this.rv.Ts(),this.cv.Ts()}}}class Ul extends _l{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.bs="Point Series",this.sv=[],this.ev=!1,this.lv=3,this.Ko=0,this.uv=e.PointShape.Circle,this.$x=Ll,this.Se=ye(this.Ji.polarPointSeriesFillStyle,o),this.cv=t.vy(r).Me(this.Se).za(this.uv).q(this.lv).us(this.getHighlight()).La(Cr.Nearest),this.cs(this.cv)}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}setData(t){return this.sv=Ol(t),this.ev=!0,this.Kb=zl(this.sv),this.As.Ss(),this}setPointFillStyle(t){this.Se="function"==typeof t?t(this.Se):t;const e=this.Se;return this.cv.Me(e),this.As.Ss(),this}getPointFillStyle(){return this.Se}setPointSize(t){return this.lv=t,this.cv.q(t),this.As.Ss(),this}getPointSize(){return this.lv}setPointShape(t){return this.uv=t,this.cv.za(this.uv),this}getPointShape(){return this.uv}setPointRotation(t){return this.Ko=t,this.cv.Ph(t),this.As.Ss(),this}getPointRotation(){return this.Ko}Xm(){return this.Km&&this.sv.length>0&&this.getVisible()}ke(t,e){t.us(e),this.As.Ss()}zx(t,e){const i=this.cv.zx(t);if(!i)return;const{angle:s,amplitude:r}=Rl(i,this.scale);return ll(i,this.scale,this.$x(new Ja,this,s,r,this.Ki.getAmplitudeAxis().formatValue).vc(),this,"color"in i&&H(this.Se)?new V({color:i.color}):this.Se)}solveNearestFromScreen(t){return this.zx(Yo(t,this.Ki.ls),!1)}Ae(){if(this.ev||this.scale.av()){const t=Dl(this.sv,this.scale),e=Xe(t);this.cv.Ha().Wa(t).ko(e),this.ev=!1,this.cv.Ts()}}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se}),this}}class Wl{constructor(t,e,i,s){this.P=new r.Eventer,this.dv=!1,this.Ki=t,this.fv=e,this.My=i,this.Aa=s}setGeometry(t){return this.gv=t,this.dv=!0,this.Ki.ls.Ss(),this}getGeometry(){return this.gv}setMouseInteractions(t){return this.Aa.setMouseInteractions(t),this}dispose(){return this.Aa.dispose(),this.fv(this),this.P.emit("dispose",this),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setVisible(t){const e=this.Aa.getVisible()!==t;return this.Aa.setVisible(t),e&&this.P.emit("visibleStateChanged",this,t),this.Ki.ls.Ss(),this}getVisible(){return this.Aa.getVisible()}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}const Xl=(t,e,i)=>{const s=e.ct,r=i.ct;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.rg&&(n=1-n),1===e.rg&&(o=1-o),u(o,n)};class Yl extends Za{constructor(t,e,i,s,r,n,o,h,a){super(t,e,Di(i.ct,s.ct),r,n,a),this.pv=!1,this.mv=!1,this.yv=!0,this.Sv=!0,this.xv=!1,this.bv=!1,this.setGridStrokeYStyle=t=>(this.vv.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.vv.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.Mv=o,this._v=h,this.Av=this.axisX.Bg(!1,this.Mv).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.vv=this.axisY.Bg(!1,this._v).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.Av.dispose(),this.vv.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(at(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.Av.setValue(t.x),this.vv.setValue(t.y);const e=Xl(u(this.Av.getValue(),this.vv.getValue()),this.axisX,this.axisY);return this.Av.setGridStrokeLength(this.xv?e.x:1),this.vv.setGridStrokeLength(this.bv?e.y:1),this}Ae(){this.Av.setVisible(this.Fi&&this.xx).setMarkerVisible(this.Fi&&this.xx&&this.pv),this.vv.setVisible(this.Fi&&this.xx).setMarkerVisible(this.Fi&&this.xx&&this.mv);const t=Xl(u(this.Av.getValue(),this.vv.getValue()),this.axisX,this.axisY);return this.Av.setGridStrokeLength(this.xv?t.x:1),this.vv.setGridStrokeLength(this.bv?t.y:1),super.Ae()}setGridStrokeXCut(t){return this.xv=t,this.As.Ss(),this}getGridStrokeXCut(){return this.xv}setGridStrokeYCut(t){return this.bv=t,this.As.Ss(),this}getGridStrokeYCut(){return this.bv}setGridStrokeXStyle(t){return this.Av.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.Av.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.pv=t,this.As.Ss(),this}getTickMarkerXVisible(){return this.pv}setTickMarkerYVisible(t){return this.mv=t,this.As.Ss(),this}getTickMarkerYVisible(){return this.mv}setTickMarkerX(t){return this.Av.setMarker(t),this}setTickMarkerY(t){return this.vv.setMarker(t),this}getTickMarkerX(){return this.Av.getMarker()}getTickMarkerY(){return this.vv.getMarker()}}class jl extends Ka{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,h),this.xv=!1,this.bv=!1,this.wv=!1,this.kv=!1,this.Cv=new Map,this.Tv=new Map,this.pv=!0,this.mv=!0,this.bx=s,this.vx=r,this.Mv=n,this._v=o,this.Fv=h.cursorGridStrokeStyleX,this.Iv=h.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.Cv.forEach((t=>t.dispose())),this.Tv.forEach((t=>t.dispose())),this.Pv=void 0,this.Dv=void 0,this}Ae(){return this.Pv&&this.Pv.setVisible(this.Fi&&this.xx).setMarkerVisible(this.Fi&&this.xx&&this.pv),this.Dv&&this.Dv.setVisible(this.Fi&&this.xx).setMarkerVisible(this.Fi&&this.xx&&this.mv),super.Ae()}pointAt(t){const{location:e}=t,{series:i}=t,{axisX:s}=i,{axisY:r}=i,n=this.rh(s,!0),o=this.rh(r,!1);n!==this.Pv&&this.Pv&&this.Pv.setVisible(!1),o!==this.Dv&&this.Dv&&this.Dv.setVisible(!1),n.setValue(e.x),o.setValue(e.y);const h=Xl(u(e.x,e.y),s,r);return n.setGridStrokeLength(this.xv?h.x:1),o.setGridStrokeLength(this.bv?h.y:1),this.Pv=n,this.Dv=o,super.pointAt(t)}wx(t){if(super.wx(t),t){const e=e=>e.setTextFillStyle(t);this.Pv&&this.wv&&this.Pv.setMarker(e),this.Dv&&this.kv&&this.Dv.setMarker(e)}}rh(t,e){let i=(e?this.Cv:this.Tv).get(t);return i||(e?(i=t.Bg(!1,this.Mv),this.Cv.set(t,i)):(i=t.Bg(!1,this._v),this.Tv.set(t,i)),this.qh(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}qh(t,e){const i=e?this.Fv:this.Iv;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.pv:this.mv)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.xv=t,this.As.Ss(),this}getGridStrokeXCut(){return this.xv}setGridStrokeYCut(t){return this.bv=t,this.As.Ss(),this}getGridStrokeYCut(){return this.bv}setGridStrokeXStyle(t){return this.Fv=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.Cv.forEach((t=>t.setGridStrokeStyle(this.Fv))),this}getGridStrokeXStyle(){return this.Fv}setGridStrokeYStyle(t){return this.Iv=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.Tv.forEach((t=>t.setGridStrokeStyle(this.Iv))),this}getGridStrokeYStyle(){return this.Iv}setTickMarkerXVisible(t){return this.pv=t,this.As.Ss(),this}getTickMarkerXVisible(){return this.pv}setTickMarkerYVisible(t){return this.mv=t,this.As.Ss(),this}getTickMarkerYVisible(){return this.mv}setTickMarkerX(t){return this.Cv.forEach((e=>e.setMarker(t))),this.Mv=this.Mv.addStyler(t),this.As.Ss(),this}setTickMarkerY(t){return this.Tv.forEach((e=>e.setMarker(t))),this._v=this._v.addStyler(t),this.As.Ss(),this}setTickMarkerXAutoTextStyle(t){return this.wv=t,this.As.Ss(),this}getTickMarkerXAutoTextStyle(){return this.wv}setTickMarkerYAutoTextStyle(t){return this.kv=t,this.As.Ss(),this}getTickMarkerYAutoTextStyle(){return this.kv}}class Jl extends Qa{constructor(t,e,i,s,r){super(t,e,r),this.bx=t,this.vx=e,this.Mv=i,this._v=s,this.kx=r}}class $l extends Jl{constructor(){super(...arguments),this.Tx=(t,e,i,s)=>this.Cx(new jl(t,e,i,this.bx,this.vx,this.Mv,this._v,s),s),this.addStyler=t=>new $l(this.bx,this.vx,this.Mv,this._v,this.kx.map((t=>t)).concat(t)),this.setPointMarker=t=>new $l(t,this.vx,this.Mv,this._v,this.kx.map((t=>t))),this.setResultTableBackground=t=>new $l(this.bx,t,this.Mv,this._v,this.kx.map((t=>t)))}}class ql extends Jl{constructor(){super(...arguments),this.Fx=(t,e,i,s,r)=>this.Cx(new Yl(t,e,i,s,this.bx,this.vx,this.Mv,this._v,r),r),this.addStyler=t=>new ql(this.bx,this.vx,this.Mv,this._v,this.kx.map((t=>t)).concat(t)),this.setPointMarker=t=>new ql(t,this.vx,this.Mv,this._v,this.kx.map((t=>t))),this.setResultTableBackground=t=>new ql(this.bx,t,this.Mv,this._v,this.kx.map((t=>t)))}}const Kl=new $l(Dn,Dn,bo.PointableTextBox,bo.PointableTextBox,[(t,e)=>{il(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),pn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),pn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Zl=new ql(On,Dn,bo.PointableTextBox,bo.PointableTextBox,[(t,e)=>{sl(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),pn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),pn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Ql=(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}},tu=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class eu{constructor(t,i,s,n,o,h){this.Bv=e.UIVisibilityModes.always,this.Ov=e.UIVisibilityModes.always,this.po=!0,this.Ti=!1,this.Lv=!1,this.Rv=!1,this.jo=u(0,0),this.Yu=e.UIDraggingModes.draggable,this.Xu=void 0,this.P=new r.Eventer,this.Fi=!0,this.Ev=(t,i,s)=>{this.Lv=!0,this.As.Ss();const r=this.Yu===e.UIDraggingModes.notDraggable?this.Yu:s||this.Yu;this.Xu=this.As.ls.Tr(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.zv=()=>{this.Lv=!1,this.As.Ss(),this.As.ls.Fr(this.Xu)},this.Vv=(t,e)=>{this.Rv=!0,Zt(e),this.As.Ss()},this.Nv=(t,i)=>{if(this.Yu!==e.UIDraggingModes.notDraggable){const s=i||this.Yu,r=at(this.As.ls.Ce(t.x,t.y),this.As.ls.ct,this.scale),n=u(s!==e.UIDraggingModes.onlyVertical?tu(r.x,this.scale.x):this.jo.x,s!==e.UIDraggingModes.onlyHorizontal?tu(r.y,this.scale.y):this.jo.y);return this.setPosition(n),!0}return!1},this.Gv=(t,e)=>{this.Rv=!1,Zt(e),this.As.Ss()},this.onDispose=t=>this.P.on("dispose",t),this.offDispose=t=>this.P.off(t,"dispose"),this.As=t,this.renderingScale=i,this.scale=s,this.rb=n,this.Wv=o,this.Ji=h;const a=n.getPointMarker().setMouseInteractions(!0);a.onMouseEnter(((t,e)=>this.Ev(t,e))),a.onMouseLeave(this.zv),a.onMouseDragStart(this.Vv),a.onMouseDrag(((t,e)=>this.Nv(u(e.clientX,e.clientY))&&Zt(e))),a.onMouseDragStop(this.Gv),a.onTouchStart(this.Vv),a.onTouchMove(((t,e)=>this.Nv(u(e.clientX,e.clientY))&&Zt(e))),a.onTouchEnd(this.Gv),n.getResultTable().setMouseInteractions(!0),this.setPosition(this.jo)}setPosition(t){return this.jo=t,this.rb.setPosition(t),this.P.emit("positionChange",this,this.jo),this}getPosition(){return this.jo}onPositionChange(t){return this.P.on("positionChange",t)}offPositionChange(t){return this.P.off(t,"positionChange")}setPointMarkerVisibility(t){return this.Bv=t,this.As.Ss(),this}getPointMarkerVisibility(){return this.Bv}setResultTableVisibility(t){return this.Ov=t,this.As.Ss(),this}getResultTableVisibility(){return this.Ov}setMouseInteractions(t){return this.po=t,this.rb.getPointMarker().setMouseInteractions(t),this.rb.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.po}setAutoFitStrategy(t){return this.rb.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.rb.getAutoFitStrategy()}isAttached(){return!0}Ae(){const t=this.isAttached();return Ql(this.Bv,this.Lv,this.Rv)?this.rb.setPointMarkerVisible(!0):this.rb.setPointMarkerVisible(!1),t&&Ql(this.Ov,this.Lv,this.Rv)?this.rb.setResultTableVisible(!0):this.rb.setResultTableVisible(!1),this.rb.Ae(),this}Ts(){return this.rb.Ts(),this}pointAt(t){return this.rb.pointAt(t),this}dispose(){return this.Ti||(this.Ti=!0,this.Wv(this),this.rb.dispose(),this.P.emit("dispose")),this}setVisible(t){const e=this.Fi!==t;return this.Fi=t,this.rb.setVisible(t),e&&this.P.emit("visibleStateChanged",this,this.Fi),this}getVisible(){return this.Fi}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}setPointMarker(t){return this.rb.setPointMarker(t),this}getPointMarker(){return this.rb.getPointMarker()}setResultTable(t){return this.rb.setResultTable(t),this}getResultTable(){return this.rb.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Yu=t,this.As.Ss(),this}getDraggingMode(){return this.Yu}}class iu extends eu{constructor(t,i,s,r,n,o,h){super(t,i,Di(s.ct,r.ct),n.Fx(t,i,s,r,h),o,h),this.Hv=e.UIVisibilityModes.always,this.Uv=e.UIVisibilityModes.always,this.$v=e.UIVisibilityModes.always,this.jv=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.rb.getGridStrokeXStyle(),this.gridStrokeStyleY=this.rb.getGridStrokeYStyle(),this.As=t,this.axisX=s,this.axisY=r,this.Wv=o;const a=this.rb.getTickMarkerX().setMouseInteractions(!0);a.onMouseEnter(((t,i)=>this.Ev(t,i,e.UIDraggingModes.onlyHorizontal))),a.onMouseLeave(this.zv),a.onMouseDragStart(this.Vv),a.onMouseDrag(((t,i)=>this.Nv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Zt(i))),a.onMouseDragStop(this.Gv),a.onTouchStart(this.Vv),a.onTouchMove(((t,i)=>this.Nv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Zt(i)));const l=this.rb.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.Ev(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.zv),l.onMouseDragStart(this.Vv),l.onMouseDrag(((t,i)=>this.Nv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Zt(i))),l.onMouseDragStop(this.Gv),l.onTouchStart(this.Vv),l.onTouchMove(((t,i)=>this.Nv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Zt(i)))}Ae(){const t=this.isAttached();return this.Fi&&t&&Ql(this.$v,this.Lv,this.Rv)?this.rb.setTickMarkerXVisible(!0):this.rb.setTickMarkerXVisible(!1),this.Fi&&t&&Ql(this.jv,this.Lv,this.Rv)?this.rb.setTickMarkerYVisible(!0):this.rb.setTickMarkerYVisible(!1),this.rb.setGridStrokeXStyle(this.Fi&&t&&Ql(this.Hv,this.Lv,this.Rv)?this.gridStrokeStyleX:st),this.rb.setGridStrokeYStyle(this.Fi&&t&&Ql(this.Uv,this.Lv,this.Rv)?this.gridStrokeStyleY:st),super.Ae()}setGridStrokeXVisibility(t){return this.Hv=t,this.As.Ss(),this}getGridStrokeXVisibility(){return this.Hv}setGridStrokeYVisibility(t){return this.Uv=t,this.As.Ss(),this}getGridStrokeYVisibility(){return this.Uv}setTickMarkerXVisibility(t){return this.$v=t,this.As.Ss(),this}getTickMarkerXVisibility(){return this.$v}setTickMarkerYVisibility(t){return this.jv=t,this.As.Ss(),this}getTickMarkerYVisibility(){return this.jv}setGridStrokeXCut(t){return this.rb.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.rb.getGridStrokeXCut()}setGridStrokeYCut(t){return this.rb.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.rb.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.rb.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.rb.getGridStrokeYStyle()}setTickMarkerX(t){return this.rb.setTickMarkerX(t),this}getTickMarkerX(){return this.rb.getTickMarkerX()}setTickMarkerY(t){return this.rb.setTickMarkerY(t),this}getTickMarkerY(){return this.rb.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.rb.getTickMarkerX().setMouseInteractions(t),this.rb.getTickMarkerY().setMouseInteractions(t),this}}class su extends iu{}class ru extends su{constructor(t,e,i,s,r,n){super(t,e,i.axisX,i.axisY,s,r,n),this.Yv=!1,this.As=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.Yv=!1,this.As.Ss(),this}Ts(){if(!this.Yv){const t=this.owningSeries.solveNearestFromScreen(at(this.jo,this.scale,this.As.ls.ct));t?(this.jo=at(t.location,this.owningSeries.scale,this.scale),this.rb.pointAt(t),this.Yv=!0):this.rb.setPosition(this.jo)}return super.Ts()}isAttached(){return this.Yv}}class nu extends Bl{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.Xv=[],this.addMarker=(t=Zl)=>{const e=new ru(this.Zv(),this.Ki.uiScale,this,t,this.removeMarker,this.Ji);return this.Xv.push(e),e},this.removeMarker=t=>{const e=this.Xv.indexOf(t);-1!==e&&this.Xv.splice(e,1)},this.Qi=new Map,this.chart=t,this.As=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.Zv=h,this.scale=Di(s.ct,r.ct),this.Kv=t.qv,t.qv+=1,this.Jv(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.Qv),this.onMouseLeave(this.chart.tM),this.onMouseWheel(this.chart.Jm),this.onMouseDragStart(this.chart.iM),this.onMouseDrag(this.chart.Qm),this.onMouseDragStop(this.chart.sM),this.onTouchStart(this.chart.ty.onTouchStart),this.onTouchMove(this.chart.ty.onTouchMove),this.onTouchEnd(this.chart.ty.onTouchEnd)}attacheAxis(){this.eM=this.axisXAttachHandler(this),this.hM=this.axisYAttachHandler(this)}Ae(){super.Ae();for(let t=0;t{e.Bo(this.Kv)})),this.Ki.ls.Ss(),this}dispose(){return super.dispose(),this.Xv.slice().forEach((t=>t.dispose())),this.eM(this),this.hM(this),this}rM(){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;it.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i)).addRow("Y","",e.axisY.formatValue(s));class uu extends nu{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,i,s,r,n,o,h,a,u,c),this.nM=[],this.Jl=[],this.oM=0,this.Ii=!1,this.Ci=e.HighlightModes.onHover,this.$x=lu,this.aM=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.oM=void 0!==e&&e>0?e:0,this.As.Ss(),this}add(t){if(Array.isArray(t)?this.lM(t):this.lM([t]),this.Jl.length>0){const t=this.Jl[this.Jl.length-1];this.uM={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.uM?this.uM.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.Ua()+e.$a()),this.Jl.length)}clear(){this.cM=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.aM.getXMax(this.nM,this.cM)||0}getXMin(){return this.aM.getXMin(this.nM,this.cM)||0}getYMax(){return this.aM.getYMax(this.nM,this.cM)||0}getYMin(){return this.aM.getYMin(this.nM,this.cM)||0}ur(){const t=u(0,0);for(const e of this.nM)t.x=Math.max(t.x,e.sl()),t.y=Math.max(t.y,e.el());return t}dM(t,e,i,s){this.aM.dM(t,e,i,s,this.scale,(t=>{}))}ey(){super.ey();const t=this.nM.length;this.fM&&this.dM(this.nM,this.getPointAmount(),this.fM,this.oM),t!==this.nM.length&&this.rM()}Ae(){super.Ae();const t=this.getBoundaries();this.Jl.length>0&&(this.gM(this.Jl),this.Jl=[]);for(const e of this.nM)e.ko(t);return super.Ae()}om(){super.om(),this.cM=void 0,this.Jl.length=0}lM(t){0!==t.length&&(this.cM?this.cM=je(this.cM,Xe(t)):this.cM=Xe(t),this.P.emit("dataAdd",this,t,this.cM),this.Jl=he(this.Jl,t,{canReturnB:!1}),this.As.Ss())}pM(){return hu(this.nM)}mM(t){return this.P.on("dataAdd",t)}yM(t){return this.P.off(t)}SM(t){return this.P.on("dataClear",t)}xM(t){return this.P.off(t)}}const cu=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;h{const e=this.vM.indexOf(t);e>=0&&this.vM.splice(e,1);const i=this.bM.findIndex((e=>e===t.Aa));i>=0&&this.bM.splice(i,1),this.As.Ss()},this.Se=ye(this.Ji.polarPolygonSeriesFillStyle,n),this.xe=ye(this.Ji.polarPolygonSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}addPolygon(){const t=new Wl(this.Ki,this.MM,this,this._M());return this.vM.push(t),t}setFillStyle(t){this.Se="function"==typeof t?t(this.Se):t;const e=this.Se;for(const t of this.bM)t.Me(e);return this.As.Ss(),this}getFillStyle(){return this.Se}setStrokeStyle(t){this.xe="function"==typeof t?t(this.xe):t;const e=this.xe;for(const t of this.bM)t.ve(e);return this.As.Ss(),this}getStrokeStyle(){return this.xe}Xm(){return this.Km&&void 0!==this.vM.find((t=>void 0!==t.AM))&&this.getVisible()}Ae(){this.vM.forEach((t=>{(t.dv||this.scale.av())&&t.wM&&(t.Aa.tl(Dl(t.wM,this.scale)),t.dv=!1,t.Aa.Ts())}))}ey(){super.ey();const t=y(ke,Pe);this.vM.forEach((e=>{if(!e.gv)return;const i=!e.dv&&e.wM?e.wM:Ol(e.gv);e.wM=i;const s=!e.dv&&e.AM?e.AM:zl(i);e.AM=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.Kb=t}ke(t,e){t.us(e),this.As.Ss()}zx(t,e){const i=cu(t,this.bM,((t,e)=>{const i=t.zx(e);if(i)return at(i,this.scale,t.ls.ct)}),Ne);if(!i)return;const s=at(i[0],i[1].ls.ct,this.scale),r=this.kM(i[1]);if(!r)return;const{angle:n,amplitude:o}=Rl(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.$x(new Ja,this,n,o,this.Ki.getAmplitudeAxis().formatValue).vc(),series:this,fillStyle:this.Se,polarPolygon:r}}solveNearestFromScreen(t){return this.zx(Yo(t,this.Ki.ls),!1)}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se,stroke:this.xe}),this}_M(){const t=this.As.Cc(this.scale,sn.Simple).Me(this.Se).ve(this.xe).us(this.getHighlight());return this.bM.push(t),this.cs(t),t}kM(t){return this.vM.find((e=>e.Aa===t))}}class fu extends _l{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.bs="Area Series",this.sv=[],this.ev=!1,this.hv=!1,this.CM=!1,this.$x=Ll,this.Se=ye(this.Ji.polarAreaSeriesFillStyle,n),this.xe=ye(this.Ji.polarAreaSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}setData(t){const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se,stroke:this.xe}),this}}class gu extends fu{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.TM=this.As.Cc(this.scale,sn.Simple).us(this.getHighlight()),this.cs(this.TM)}Ae(){if(this.ev||this.scale.av()){const t=this.sv,e=!0===this.hv?Dl(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.FM.start}Wb(t){this.IM=t,this.LM=!0}Ub(){return!1===this.IM}Hb(t){this.PM=t,this.LM=!0}Vb(){return this.PM}Qt(){return this.si}ni(){return!1}nt(t,e,i,s){return this.x=new Pi(t.x,e.x,i.x,s?s.x:void 0),this.y=new Pi(t.y,e.y,i.y,s?s.y:void 0),this}ti(){return this.Xt}av(){return this.OM}zM(){return this.LM}Ai(){return this.RM}Y(){return this.o=!1,this.si=!1,this.OM=!1,this.LM=!1,this}X(){return this.o=!0,this.si=!0,this.OM=!0,this.LM=!0,this}q(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.EM(),this}Si(t){return this.DM=t,this.EM(),this}xi(t){return this.BM=t,this.EM(),this}Wt(){return u(this.DM[0]+this.DM[1],this.BM[0]+this.BM[1])}Ht(){return this.j}EM(){const t=this.FM,e=u(this.x.Ut(this.j.x),this.y.Ut(this.j.y)),i=this.DM[0]+this.DM[1],s=this.BM[0]+this.BM[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.DM[0]+Math.max((r-2*o)/2,0),this.DM[1]+Math.max((r-2*o)/2,0)],a=[this.BM[0]+Math.max((n-2*o)/2,0),this.BM[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.q(this.j.x).zt(h).Z(-l,l),this.y.q(this.j.y).zt(a).Z(-l,l),this.RM={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.Xt={x:this.x.ti(),y:this.y.ti()},this.X()}Jt(t,e){const i=this.Ai();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}wi(t,e,i,s){const r=this.Ai(),n=ei(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 mu extends Sl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.hp("polarChart bg",0),r,i.ls.Ji.polarChartBackgroundFillStyle,i.ls.Ji.polarChartBackgroundStrokeStyle,i.ls.Ji.polarChartTitleFont,i.ls.Ji.polarChartTitleFillStyle,h),this.coordsClient="client",this.Ix=e.AutoCursorModes.snapToClosest,this.tf=[],this.po=!0,this.VM=(t,e,i,s,r)=>{this.vb.q(s,r)},this.ef=ee(this.tf),this.NM=t=>{this.tf.push(t)},this.GM=()=>this.My,this.ff.wn||this.ff.An||this.ls.Mn(4),this.WM=i.OS("polarChart series bg",0),this.HM=i.Hp("polarChart axis gridlines",0),this.UM=i.Hp("polarChart series",1),this.$M=i.Hp("polarChart axis lines",2),this.jM=i.Hp("polarChart axis ticks",3),this.vb=s.d2({scaleXYConstructor:yu}),this.onResize(this.VM),this.ap.Ch("Polar Chart");const a=Lt(o?o.autoCursorBuilder:void 0,hl);this.Ex=a.Tx(this.Dx,this.uiScale,this.uiScale,this.Ji),this.Fy=this.WM.Dc(this.vb).Me(this.Ji.polarChartSeriesBackgroundFillStyle).ve(st).Nl(0).Be(360).Ul(0),this.Iy=this.WM.Dc(this.vb).Me(z).ve(this.Ji.polarChartSeriesBackgroundStrokeStyle).Nl(0).Be(360).Ul(0),super.Ty(this.Fy,this.Iy),this.ep(n,this.pixelScale),this.YM=new Tl(this,this.vb,this.Ji,!(!o||!0!==o.disableAnimations),this.HM,this.$M,this.jM,this.ss,this.GM),this.XM=new El(this,this.vb,this.Ji,!(!o||!0!==o.disableAnimations),this.HM,this.$M,this.jM,this.ss),this.coordsAxis={axisAmplitude:this.YM,axisRadial:this.XM},o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1)}getSeries(){return this.My}translateCoordinate(t,e,i){if(i){const e=t,s=this.pixelScale,r=i;if(zi(r)){const t=at(e,s,this.engine.scale);return this.ls.fo({engineX:t.x,engineY:t.y})}if(Ri(r))return e;if(kl(r)){const t=at(e,s,this.vb);return Rl(t,this.vb)}}else{const i=t,s=e;if(Oi(i)){if(kl(s)){const t=this.ls.do(i),e=at({x:t.engineX,y:t.engineY},this.engine.scale,this.vb);return Rl(e,this.vb)}if(zi(s))return i;if(Ri(s)){const t=this.ls.do(i);return at({x:t.engineX,y:t.engineY},this.ls.ct,this.pixelScale)}}else if(Pl(i)){if(kl(s))return i;const t=Dl([i],this.vb)[0];if(zi(s)){const e=at(t,this.vb,this.engine.scale),i={engineX:e.x,engineY:e.y};return this.ls.fo(i)}if(Ri(s))return at(t,this.vb,this.pixelScale)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new Gl(this.UM,this,this.Ay,this.vb,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addPointSeries(t){const e=new Ul(this.UM,this,this.Ay,this.vb,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addPointLineSeries(t){const e=new Hl(this.UM,this,this.Ay,this.vb,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addAreaSeries(t){const e=new gu(this.UM,this,this.Ay,this.vb,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addPolygonSeries(t){const e=new du(this.UM,this,this.Ay,this.vb,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addHeatmapSeries(t){const e=new Vl(this.UM,this,this.Ay,this.vb,this.Ji,this.ls.ss,t);return this.Py(e),e}addSector(){const t=new Fl(this.UM,this,this.ef,this.vb,this.Ji,this.ls.ss);return this.NM(t),t}getAmplitudeAxis(){return this.YM}getRadialAxis(){return this.XM}Ae(t){var e,i;super.Ae(t),Nh.fp(this.ap,this.rp);for(const t of this.My)t.ey();this.YM.cr(),this.XM.cr();for(const t of this.My)t.Ae();for(let t=1;t<=2;t+=1){const e=this.YM.Ae(),i=this.XM.Ae(),s=Nh.dp(this.ap,this.rp),r=[this.Qo.left+i,this.Qo.right+i],n=[this.Qo.bottom+i,this.Qo.top+i+s];this.vb.Si(r).xi(n);const o=4;if(!(!this.ZM||Math.abs(this.ZM.amplitude-e)>=o||Math.abs(this.ZM.radial-i)>=o)||1!==t){this.ZM={amplitude:e,radial:i};break}}const s=this.vb.Ob().start,r=this.vb.Ob().end,n=this.vb.Bb()?((null===(e=this.ZM)||void 0===e?void 0:e.radial)||0)*this.vb.x.getPixelSize()+r-s:((null===(i=this.ZM)||void 0===i?void 0:i.radial)||0)*this.vb.x.getPixelSize()+s-r;this.Fy.Gl(n).$l(360),this.Iy.Gl(n).$l(360);for(const t of this.tf)t.Ae();this.Vx(!1);for(const t of this.My)t.om();return super.sp(),this.KM(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.YM.setAnimationsEnabled(t),this.XM.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.po=t,this}getMouseInteractions(){return this.po}getMinimumSize(){return u(pu,pu)}KM(){}forEachAxis(t){return t(this.YM),t(this.XM),this}dispose(){return this.WM.G(),this.HM.G(),this.UM.G(),this.$M.G(),this.jM.G(),this.tf.slice().forEach((t=>t.dispose())),super.dispose()}Sd(){return[...this.My,...this.tf]}}const pu=300;class Su extends Wh{}class xu extends Su{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.bs="Slice",this.u=0,this.gp=!1,this.qM=z,this.mp=z,this.yp=this.u,this.bp=j((()=>this.Ki.ls.Ss())),this.Mp=()=>{this._p=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this.TM=e.Cc(r,sn.Simple).us(this.getHighlight()),this.cs(this.TM),this.Ve=i.Sr(r).us(this.getHighlight()),this.cs(this.Ve,{isText:!0})}setValue(t){return this.Ki.getAnimationsEnabled()?this.getVisible()&&this.Cp(this.yp,t):this.yp=t,this.u=t,this.Ki.ls.Ss(),this}getValue(){return this.u}setVisible(t){return!1===t?this.Ki.getAnimationsEnabled()&&this.yp>0?(this._p&&(this._p.finish(!1),this._p=void 0),this.Cp(this.yp,0,(()=>super.setVisible(!1)))):(this.yp=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this._p&&(this._p.finish(!1),this._p=void 0),super.setVisible(!0),this.Cp(this.yp,this.u)):(this.yp=this.u,super.setVisible(!0)),this}Cp(t,e,i){this._p=this.bp(300,X.ease)([[t,e]],(([t])=>{this.yp=t,this.Ki.ls.Ss()})),this._p.onEveryAnimationEnd(this.Mp),i&&this._p.onAnimationEnd(i)}setStyle(t,e,i,s){this.qM=t,this.mp=i,this.TM.Me(this.qM).ve(e),this.Ve.Me(this.mp).Ih(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Mu=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=vu(i,r.x),s=vu(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+S*o,y:g.y-o},f={x:y.x-S*o,y:y.y-o}),b=(i+c/u*(s-i))/2,g={x:a-b,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-x:x}`,10)},y={x:a+b,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&y.x>g.x&&p.TM.tl([g,d,f,y])}};class Au extends Vh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.hp("funnelChart bg",0),r,i.ls.Ji.funnelChartBackgroundFillStyle,i.ls.Ji.funnelChartBackgroundStrokeStyle,i.ls.Ji.funnelChartTitleFont,i.ls.Ji.funnelChartTitleFillStyle,o),this.Tp=[],this.Fp=Hh.None,this.Dp=!0,this.Lp=0,this.JM=80,this.QM=20,this.t_=0,this.i_=e.FunnelSliceModes.VariableHeight,this.zp=!0,this.Np=t=>{const e=this.Tp.indexOf(t);e>=0&&(this.Tp.splice(e,1),this.Gp())},this.ff.wn||this.ff.An||this.ls.Mn(5),this.Vp=this.Ji.effectsText,this.Wp=i.Hp("funnelChart bottom",0),this.$p=i.Hp("funnelChart top",1),this.ap.Ch("Funnel Chart"),this.Ip=this.Ji.funnelChartSliceFillStylePalette,this.Pp=this.Ji.funnelChartSliceStrokeStyle,this.Bp=this.Ji.funnelChartSliceLabelFont,this.Op=this.Ji.funnelChartSliceLabelFillStyle,h&&this.setAnimationsEnabled(!1),this.ep(n,this.pixelScale)}addSlice(t,e){const i=new xu(this.Lp,this.Wp,this.$p,this,this.pixelScale,this.Np,this.Ji,this.ls.ss);return this.Lp+=1,i.setName(t),i.setValue(e),i.ss.hs.ys(this.Vp),i.ss.rs.ys(this.zp),this.Tp.push(i),this.ls.Ss(),i.setHighlightOnHover(this.Dp),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.ys(t))),this.ls.Ss(),this}getSliceEffect(){return this.zp}setSliceSorter(t){return this.Fp=t,this.Tp=this.Tp.sort(this.Fp),this.ls.Ss(),this}getSliceSorter(){return this.Fp}setLabelFillStyle(t){return this.Op="function"==typeof t?t(this.Op):t,this.ls.Ss(),this}getLabelFillStyle(){return this.Op}setLabelFont(t){return this.Bp="function"==typeof t?t(this.Bp):t,this.ls.Ss(),this}getLabelFont(){return this.Bp}setLabelEffect(t){return this.Vp=t,this.Tp.forEach((e=>e.ss.hs.ys(t))),this.ls.Ss(),this}getLabelEffect(){return this.Vp}setLabelFormatter(t){return this.Yp=t,this.ls.Ss(),this}getLabelFormatter(){return this.Yp}setSliceHighlightOnHover(t){return this.Dp=t,this.Tp.forEach((e=>e.setHighlightOnHover(t))),this}Ae(t){super.Ae(t),Nh.fp(this.ap,this.rp),super.sp();const e=Nh.dp(this.ap,this.rp),i=u(this.pixelScale.x.getInnerInterval()-(this.Qo.left+this.Qo.right),this.pixelScale.y.getInnerInterval()-(this.Qo.bottom+this.Qo.top+e)),s=u(this.Qo.left+i.x/2,this.Qo.bottom+i.y/2);this.Tp=this.Tp.sort(this.Fp);for(let t=0,{length:e}=this.Tp;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tt.dispose())),super.dispose()}}const Tu=(t,i,s)=>{const r=t.il();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}}},wu=t=>{const e=t.il();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 Eu extends Au{constructor(){super(...arguments),this.Yp=Uh.NamePlusValue,this.Zp=10,this.s_=e.FunnelLabelSide.Left,this.e_=e.SliceLabelIndices.LabelsOnSides,this.qp=[],this.Jp=this.Ji.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Jp=t;for(let t=0;t{const e=this.Tp.indexOf(t);e>=0&&this.Tp.splice(e,1)},this.ff.wn||this.ff.An||this.ls.Mn(6),this.As=e.Hp("gaugeChart layer",0),this.$p=e.Hp("gaugeChart top layer",1),this.ap.Ch("Gauge Chart"),this.ep(r,this.pixelScale);const h=Wi();this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}dispose(){return this.As.G(),this.$p.G(),this.Tp.slice().forEach((t=>t.dispose())),super.dispose()}}class Bu extends Fu{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Il=90,this.Pl=-270,this.n_={min:this.Il,max:this.Pl},this.o_=j((()=>this.As.Ss())),this.a_=()=>{this.l_=void 0},this.u_=e.Hp("radialGaugeChart bg arc",2),this.c_=this.As.Dc(this.pixelScale).Me(this.Ji.gaugeChartEmptyGaugeFillStyle).ve(this.Ji.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.Il,s=this.Pl,r=this.n_;return this.getAnimationsEnabled()?this.d_(r,{min:t,max:e}):(r.min=t,r.max=e,this.Il=t,this.Pl=e),this.P.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.ls.Ss(),this}getAngleInterval(){return{min:this.Il,max:this.Pl}}setGaugeFillStyle(t){return this.c_.Me(t),this.ls.Ss(),this}setGaugeStrokeStyle(t){return this.c_.ve(t),this.ls.Ss(),this}d_(t,e,i){this.l_=this.o_(1e3,X.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.n_={min:t,max:e},this.Il=t,this.Pl=e,this.As.Ss()})),this.l_.onEveryAnimationEnd(this.a_),i&&this.l_.onAnimationEnd(i)}onAngleIntervalChange(t){return this.P.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.P.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.u_.G(),this}}class _u extends Wh{f_(t){return this.P.on("valueChange",t)}g_(t){return this.P.on("valueIntervalChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}offIntervalChange(t){return this.P.off(t,"valueIntervalChange")}attach(t,e=!0){return super.attach(t,e),this.styleAttachedEntry(t),this}styleAttachedEntry(t){ce(t,this.Ji,{fill:this.p_})}}class Lu extends _u{onValueChange(t){return this.f_(t)}onIntervalChange(t){return this.g_(t)}}class Du extends Lu{constructor(t,e,i,s,r,n,o){super(i,r,n,o),this.Il=0,this.Pl=0,this.m_=0,this.y_=0,this.S_=0,this.x_=100,this.b_=!0,this.yp=this.u,this.xp=this.getVisible(),this.bp=Ae(),this.v_=t=>{this.yp=t,this.Ki.ls.Ss()},this.M_=t,this.br=e,this.Ki=i,this.scale=s,this.p_=this.Ji.gaugeChartGaugeFillStyle,this.kp=t.Dc(s).Me(this.p_).ve(st).us(this.getHighlight()),this.cs(this.kp),this.__=e.Sr(s).us(this.getHighlight()),this.cs(this.__,{isText:!0}),this.A_=e.Sr(s).us(this.getHighlight()),this.cs(this.A_,{isText:!0}),this.Ve=e.Sr(s).us(this.getHighlight()),this.cs(this.Ve,{isText:!0}),this.__.Me(n.gaugeChartIntervalLabelsFillStyle).Ih(n.gaugeChartIntervalLabelsFont),this.A_.Me(n.gaugeChartIntervalLabelsFillStyle).Ih(n.gaugeChartIntervalLabelsFont),this.Ve.Me(n.gaugeChartValueLabelFillStyle).Ih(n.gaugeChartValueLabelFont),this.setName("Gauge Slice")}Ae(){const t=this.Ki.getDataLabelFormatter(),e=this.Il/90r&&(i=r);const n=this.Pl-e*this.y_,o=this.Il+e*this.m_,h=this.x_-this.S_,a=(0!==h?(n-o)/h:1/0)*(i-this.S_);this.kp.Nl(o).Be(o+a);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>r}):t.format(i);this.Ve.Ch(l)}w_(){const t=this.Ki.getIntervalLabelFormatter(),e="function"==typeof t?t(this.S_,{getInnerStart:()=>this.S_,getInnerEnd:()=>this.x_}):t.format(this.S_);return this.__.Ch(e).Ts(),this.__.Ht()}k_(){const t=this.Ki.getIntervalLabelFormatter(),e="function"==typeof t?t(this.x_,{getInnerStart:()=>this.S_,getInnerEnd:()=>this.x_}):t.format(this.x_);return this.A_.Ch(e).Ts(),this.A_.Ht()}setName(t){return super.setName(t),this.Ki.ls.Ss(),this}setValue(t){const e=this.u;return this.Ki.getAnimationsEnabled()?this.xp&&this.bp(e,t,this.v_):this.yp=t,this.u=t,this.P.emit("valueChange",this,e,t),this.Ki.ls.Ss(),this}getValue(){return this.u}setVisible(t){return this.xp=t,!1===t?this.Ki.getAnimationsEnabled()&&this.yp>0?this.bp(this.yp,0,this.v_,{onCompleted:()=>super.setVisible(!1)}):(this.yp=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(super.setVisible(!0),this.bp(this.yp,this.u,this.v_)):(this.yp=this.u,super.setVisible(!0)),this}setInterval(t,e){const i=this.S_,s=this.x_;return this.P.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.S_=t,this.x_=e,this.Ki.ls.Ss(),this}setIntervalLabelsFont(t){return this.__.Ih(t),this.A_.Ih(t),this.Ki.ls.Ss(),this}getIntervalLabelsFont(){return this.__.Fh()}setIntervalLabelsFillStyle(t){return this.__.Me(t),this.A_.Me(t),this.Ki.ls.Ss(),this}getIntervalLabelsFillStyle(){return this.__.Th()}setIntervalLabelsVisible(t){return t?(this.__.setVisible(!0),this.A_.setVisible(!0)):(this.__.setVisible(!1),this.A_.setVisible(!1)),this.b_=t,this}getIntervalLabelsVisible(){return this.b_}setAngleInterval(t,e){return this.Il=t,this.Pl=e,this.Ki.ls.Ss(),this}setMinAngle(t){return this.Il=t,this.Ki.ls.Ss(),this}setMaxAngle(t){return this.Pl=t,this.Ki.ls.Ss(),this}setMarginInDegrees(t=this.m_,e=this.y_){return t!==this.m_&&(this.m_=t),e!==this.y_&&(this.y_=e),this.Ki.ls.Ss(),this}setFillStyle(t){this.p_="function"==typeof t?t(this.p_):t;const e=this.p_;this.kp.Me(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 Ou extends Bu{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.nd=20,this.F_=new Intl.NumberFormat,this.I_=new Intl.NumberFormat,this.P_=!1,this.D_=5;const h=new Du(this.As,this.$p,this,this.pixelScale,this.Np,this.Ji,this.ls.ss);this.B_=h,this.Tp.push(h),this.setPadding(10)}Ae(t){super.Ae(t),Nh.fp(this.ap,this.rp),super.sp();const e=Nh.dp(this.ap,this.rp),i=Xe([this.B_.w_(),this.B_.k_()]),s=u(this.pixelScale.x.getInnerInterval()-(this.Qo.left+this.Qo.right+2*i.max.x),this.pixelScale.y.getInnerInterval()-(this.Qo.bottom+this.Qo.top+1*i.max.y+e)),r=Math.max(.5*Math.min(s.x,s.y),0),n=u(this.Qo.left+i.max.x+.5*s.x,this.Qo.bottom+i.max.y+.5*s.y),o=this.P_?this.O_(n,r):n,h=this.c_.xe.getThickness(),a=r-.5*h,l=r-this.nd;let c=l/r*100;c=c>100||c<0?99:c;const d=100*(1-(this.nd-h)/r);this.L_(o,l)&&(this.c_.Gl(r).Ul(c),this.B_.kp.Gl(a).Ul(d));const f=.5*(g=r,(y=this.Pl-this.Il)/(2*Math.PI*g*(y/360))*h);var g,y;this.c_.Nl(this.Il).Be(this.Pl).we(o),this.B_.kp.we(o),this.B_.Ve.we(o),this.ad&&this.B_.setFillStyle(new V({color:this.ad.getColors(this.B_.getAnimatedValue())})),this.B_.setMinAngle(this.Il).setMaxAngle(this.Pl).setMarginInDegrees(f,f).Ae();const m=this.c_.Dl();if(this.B_.getIntervalLabelsVisible()){this.R_(this.Il,this.Pl,o,m+this.D_);const t=this.B_.__.Ts().ze(),e=this.B_.A_.Ts().ze();De(t,e)&&this.E_(t,e,o,m+this.D_)}}L_(t,e){const i=si(this.B_.Ve.Ts().Ht(),.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]}O_(t,e){const[i]=zu(t,this.Il,this.Pl,e,e),s=Xe(i),r=.5*(s.max.x-s.min.x),n=.5*(s.max.y-s.min.y);return ri(ni(t,u(s.min.x+r,s.min.y+n)),t)}R_(t,e,i,s){const r=di(t),n=di(e);this.B_.__.we(Ze(u(i.x+s,i.y),i,-r)),this.B_.A_.we(Ze(u(i.x+s,i.y),i,-n)),this.B_.__.Sa(u(-Math.cos(r),-Math.sin(r))),this.B_.A_.Sa(u(-Math.cos(n),-Math.sin(n)))}getDefaultSlice(){return this.B_}setAutoScaling(t){return this.P_=t,this.ls.Ss(),this}getAutoScaling(){return this.P_}setDataLabelFormatter(t){return this.I_=t,this.ls.Ss(),this}getDataLabelFormatter(){return this.I_}setIntervalLabelFormatter(t){return this.F_=t,this.ls.Ss(),this}getIntervalLabelFormatter(){return this.F_}setIntervalLabelPadding(t){return this.D_=t,this.ls.Ss(),this}getIntervalLabelPadding(){return this.D_}setThickness(t){return this.nd=t,this}setLUT(t){return this.ad=t,this.ls.Ss(),this}setDataLabelFont(t){return this.B_.Ve.Ih(t),this.ls.Ss(),this}getDataLabelFont(){return this.B_.Ve.Fh()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.B_.C_(t),this.ls.Ss(),this}getDataLabelFillStyle(){return this.B_.T_()}Sd(){return this.Tp}dispose(){return this.B_.dispose(),super.dispose()}}class Ru extends Wh{}class Vu extends Ru{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.bs="Slice",this.u=0,this.gp=!1,this.qM=z,this.mp=z,this.yp=this.u,this.bp=j((()=>this.Ki.ls.Ss())),this.Mp=()=>{this._p=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this.TM=e.Cc(r,sn.Simple).us(this.getHighlight()),this.cs(this.TM),this.Ve=i.Sr(r).us(this.getHighlight()),this.cs(this.Ve,{isText:!0})}setValue(t){return this.Ki.getAnimationsEnabled()?this.getVisible()&&this.Cp(this.yp,t):this.yp=t,this.u=t,this.Ki.ls.Ss(),this}getValue(){return this.u}setVisible(t){return!1===t?this.Ki.getAnimationsEnabled()&&this.yp>0?(this._p&&(this._p.finish(!1),this._p=void 0),this.Cp(this.yp,0,(()=>super.setVisible(!1)))):(this.yp=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this._p&&(this._p.finish(!1),this._p=void 0),super.setVisible(!0),this.Cp(this.yp,this.u)):(this.yp=this.u,super.setVisible(!0)),this}Cp(t,e,i){this._p=this.bp(300,X.ease)([[t,e]],(([t])=>{this.yp=t,this.Ki.ls.Ss()})),this._p.onEveryAnimationEnd(this.Mp),i&&this._p.onAnimationEnd(i)}setStyle(t,e,i,s){this.qM=t,this.mp=i,this.TM.Me(this.qM).ve(e),this.Ve.Me(this.mp).Ih(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Gu=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=Nu(i,r.x),s=Nu(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+S*o,y:g.y-o},f={x:y.x-S*o,y:y.y-o}),b=(i+c/u*(s-i))/2,g={x:a-b,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-x:x}`,10)},y={x:a+b,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&y.x>=g.x&&p.TM.tl([g,d,f,y])}};class Hu extends Vh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.hp("pyramidChart bg",0),r,i.ls.Ji.pyramidChartBackgroundFillStyle,i.ls.Ji.pyramidChartBackgroundStrokeStyle,i.ls.Ji.pyramidChartTitleFont,i.ls.Ji.pyramidChartTitleFillStyle,o),this.Tp=[],this.Fp=Hh.None,this.Ip=this.Ji.pyramidChartSliceFillStylePalette,this.Pp=this.Ji.pyramidChartSliceStrokeStyle,this.Dp=!0,this.Bp=this.Ji.pyramidChartSliceLabelFont,this.Op=this.Ji.pyramidChartSliceLabelFillStyle,this.Lp=0,this.JM=0,this.QM=80,this.t_=0,this.i_=e.PyramidSliceModes.VariableHeight,this.zp=!0,this.Np=t=>{const e=this.Tp.indexOf(t);e>=0&&(this.Tp.splice(e,1),this.Gp())},this.ff.wn||this.ff.An||this.ls.Mn(8),this.Vp=this.Ji.effectsText,this.Wp=i.Hp("pyramidChart bottom",0),this.$p=i.Hp("pyramidChart top",1),this.ap.Ch("Pyramid Chart"),h&&this.setAnimationsEnabled(!1),this.ep(n,this.pixelScale)}addSlice(t,e){const i=new Vu(this.Lp,this.Wp,this.$p,this,this.pixelScale,this.Np,this.Ji,this.ls.ss);return this.Lp+=1,i.setName(t),i.setValue(e),i.ss.hs.ys(this.Vp),i.ss.rs.ys(this.zp),this.Tp.push(i),this.ls.Ss(),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.ys(t))),this.ls.Ss(),this}getSliceEffect(){return this.zp}setSliceSorter(t){return this.Fp=t,this.Tp=this.Tp.sort(this.Fp),this.ls.Ss(),this}getSliceSorter(){return this.Fp}setLabelFillStyle(t){return this.Op="function"==typeof t?t(this.Op):t,this.ls.Ss(),this}getLabelFillStyle(){return this.Op}setLabelFont(t){return this.Bp="function"==typeof t?t(this.Bp):t,this.ls.Ss(),this}getLabelFont(){return this.Bp}setLabelEffect(t){return this.Vp=t,this.Tp.forEach((e=>e.ss.hs.ys(t))),this.ls.Ss(),this}getLabelEffect(){return this.Vp}setLabelFormatter(t){return this.Yp=t,this.ls.Ss(),this}getLabelFormatter(){return this.Yp}setSliceHighlightOnHover(t){return this.Dp=t,this.Tp.forEach((e=>e.setHighlightOnHover(t))),this}Ae(t){super.Ae(t),Nh.fp(this.ap,this.rp),super.sp();const e=Nh.dp(this.ap,this.rp),i=u(this.pixelScale.x.getInnerInterval()-(this.Qo.left+this.Qo.right),this.pixelScale.y.getInnerInterval()-(this.Qo.bottom+this.Qo.top+e)),s=u(this.Qo.left+i.x/2,this.Qo.bottom+i.y/2);this.Tp=this.Tp.sort(this.Fp);for(let t=0,{length:e}=this.Tp;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tt.dispose())),super.dispose()}}const Uu=(t,i,s)=>{const r=t.il();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}}},Wu=t=>{const e=t.il();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 Xu extends Hu{constructor(){super(...arguments),this.Yp=Uh.NamePlusValue,this.Zp=10,this.s_=e.PyramidLabelSide.Left,this.e_=e.SliceLabelIndices.LabelsOnSides,this.qp=[],this.Jp=this.Ji.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Jp=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),qu=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Ku;e.SpiderWebMode=void 0,(Ku=e.SpiderWebMode||(e.SpiderWebMode={}))[Ku.Normal=0]="Normal",Ku[Ku.Circle=1]="Circle";class Zu{constructor(t,e,i,s,n,o,h,a){this.P=new r.Eventer,this.V_=t,this.br=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.N_=h,this.G_=a,this.W_=this.V_.De(this.scale).setMouseInteractions(!1),this.H_=this.br.Sr(this.scale).Ch(this.tag).setMouseInteractions(!1),this.U_=this.N_(this,this.br.tm(this.scale,void 0,[Zh.InternalUI])).Pe(this.chart.getNibStyle()),this.G_.ds([this.H_])}Xp(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.H_.setVisible(!0).we(ri(c,u(h.paddingX,h.paddingY))).ga(h.alignmentX).ma(h.alignmentY):this.H_.setVisible(!1)}getLabelSize(){return this.H_.Ih(this.chart.getAxisLabelFont()).Me(this.chart.getAxisLabelStyle()).Ts().Ht()}dispose(){this.W_&&this.W_.dispose(),this.H_&&this.H_.dispose(),this.U_&&this.U_.dispose()}}const Qu=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Axis:","",s).addRow("Value:","",r(i));class tc extends Bl{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this.bs="Spider Series",this.Jl=new Map,this.Ci=e.HighlightModes.onHover,this.$x=Qu,this.lv=8,this.Ko=0,this.j_=Ae(),this.Y_={},this.X_={},this.xp=this.getVisible(),this.Z_=1,this.K_=((t,e)=>{const i=j((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||X.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.Z_=t,this.As.ls.Ss()}),(t=>{super.setVisible(t)})),this.Ki=t,this.As=i,this.uv=r,this.q_=n,this.LS=o,this.J_=h,this.Q_=a,this.scale=s,this.tA=ye(u.spiderSeriesFillStyle,c),this.iA=ye(u.spiderSeriesStrokeStyle,c),this.sA=ye(u.spiderSeriesPointFillStyle,c)}Xm(){return this.Km&&this.Jl.size>0&&this.getVisible()}addPoints(...t){t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.j_(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.Jl.set(s,r+t*(e-r)),this.As.ls.Ss()}))}),{easing:this.Y_.easing,durationMs:this.Y_.durationMs,onStart:()=>{i=new Map(this.Jl)}})}else for(let e=0;e=3&&(this.TM||(this.TM=this.As.Cc(this.scale,sn.Simple).ve(this.iA).Me(this.tA).us(this.getHighlight()),this.cs(this.TM)),this.TM.tl(t),this.cv||(this.cv=this.As.vy(this.scale).q(this.lv).za(this.uv).Ph(this.Ko).Me(this.sA).us(this.getHighlight()),this.cs(this.cv)),this.cv.Ha().Wa(t))}}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{fill:this.tA,stroke:this.iA}),this}eA(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},ic=t=>Xe(t.H_.ze()),sc=t=>Xe(t.ze()),rc=(t,i,s,r)=>t.Ul(0).we(s).Nl(90).Be(-270).$l(i===e.SpiderWebMode.Circle?void 0:r.length),nc={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},oc={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},hc=()=>{oc.alignmentX=0,oc.alignmentY=0,oc.paddingX=0,oc.paddingY=0};class ac extends Sl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.hp("spiderChart bg",0),r,i.ls.Ji.spiderChartBackgroundFillStyle,i.ls.Ji.spiderChartBackgroundStrokeStyle,i.ls.Ji.spiderChartTitleFont,i.ls.Ji.spiderChartTitleFillStyle,h),this.Ix=e.AutoCursorModes.onHover,this.Qo=S(20,20,20,20),this.axisScale=ot.d1({scale1DConstructor:Pi,dimension:"x"}).Z(0,1),this.LS=[],this.hA=[],this.rA=[],this.nA=zs.expansion,this.oA=!0,this.aA=qu,this.lA=$u,this.po=!0,this.uA=e.SpiderWebMode.Normal,this.cA=4,this.dA=this.Ji.spiderChartWebStyle,this.fA=this.Ji.spiderChartScaleLabelFillStyle,this.gA=this.Ji.spiderChartScaleLabelFont,this.pA=5,this.mA=this.Ji.spiderChartAxisLabelFillStyle,this.yA=this.Ji.spiderChartAxisLabelFont,this.SA=5,this.xA=this.Ji.spiderChartAxisStrokeStyle,this.bA=this.Ji.spiderChartAxisNibStrokeStyle,this.Od=10,this.vA=S(),this.hasAxis=t=>this.LS.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.gi(t,Ci.Numeric),this.MA=()=>(t=>{const e=t.length;for(let i=0;ithis.AA.Dc(this.pixelScale).setMouseInteractions(!1),this.wA=t=>t.dispose(),this.kA=()=>this._f.Sr(this.pixelScale).setMouseInteractions(!1),this.CA=t=>t.dispose(),this.TA=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.FA=(t,e)=>{let i,s;const r=()=>{void 0!==this.IA&&this.IA.finish(),i=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.nA,this.nA=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.LS.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=ec(a,this.LS.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=ii(ni(t.W_.di(),t.W_.ui())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.Z(i.min,l),Zt(o),this.ls.Ss()}},o=()=>{if(i=void 0,void 0!==s)if(this.Ze){const t=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.PA(),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.IA=this.Gg.ls.Er(300,X.ease)([[0,1]],(([e])=>{this.axisScale.Z(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.IA.onAnimationEnd((()=>{this.IA=void 0,this.nA=i}))}else this.nA=s}else this.nA=s;s=void 0};e.setMouseEnterEventHandler(this.DA).setMouseLeaveEventHandler(this.BA).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=Wi(new Yi(((t,e,i)=>{this.DA(t),r(),Zt(i)}),n,((t,e,i,s)=>{this.BA(t),o(),Zt(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.OA=t=>{this.oA&&!this.hasAxis(t)&&this.addAxis(t)},this.J_=(t,e)=>{for(const i of this.LS)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return Ue(i.W_.di(),i.W_.ui(),t)}},this.Q_=t=>{if(0===this.LS.length)return;const e=ni(at(t,this.engine.scale,this.pixelScale),this.LS[0].W_.di()),i=Math.atan2(e.y,e.x);let s,r=ke;for(const t of this.LS){const e=ni(t.W_.ui(),t.W_.di()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.po&&(t.Pe(this.bA),this.ls.Ss())},this.BA=t=>{t.Pe(this.bA),this.ls.Ss()},this.ff.wn||this.ff.An||this.ls.Mn(9),this.WM=i.OS("spiderChart series bg",0),this.AA=i.Hp("spiderChart web shapes",0),this.LA=i.Hp("spiderChart axis bg",1),this.hb=i.Hp("spiderChart plotting",2),this._f=i.Hp("spiderChart fg",3),this.G_=this.ss.xg().ys(this.Ji.effectsText),this.ap.Ch("Spider Chart");const a=Lt(o?o.autoCursorBuilder:void 0,nl);this.Ex=a.Tx(this.Dx,this.uiScale,this.uiScale,this.Ji),this.Fy=this.WM.Dc(this.pixelScale).Me(this.Ji.spiderChartSeriesBackgroundFillStyle).ve(st).Nl(90).Be(-270).Ul(0),this.Iy=this.WM.Dc(this.pixelScale).Me(z).ve(this.Ji.spiderChartSeriesBackgroundStrokeStyle).Nl(90).Be(-270).Ul(0),super.Ty(this.Fy,this.Iy),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.ep(n,this.pixelScale)}getSeries(){return this.My}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Zu(this.LA,this._f,this.pixelScale,this,t,this.axisScale,this.FA,this.G_);this.LS.push(e)}}else t&&this.LS.push(t);return this.G_.ds(this.LS.map((t=>t.H_))),this.ls.Ss(),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.My.length,r=new tc(this,this.hb,this.pixelScale,i,this.OA,this.LS,this.J_,this.Q_,this.Ay,this.Ji,s,this.ls.ss);return this.Py(r),r}getSeriesCount(){return this.My.length}setWebMode(t){return this.uA=t,this.ls.Ss(),this}getWebMode(){return this.uA}setWebCount(t){return this.cA=t,this.ls.Ss(),this}getWebCount(){return this.cA}setWebStyle(t){return this.dA="function"==typeof t?t(this.dA):t,this.ls.Ss(),this}getWebStyle(){return this.dA}setScaleLabelStyle(t){return this.fA="function"==typeof t?t(this.fA):t,this.ls.Ss(),this}getScaleLabelStyle(){return this.fA}setScaleLabelFont(t){return this.gA="function"==typeof t?t(this.gA):t,this.ls.Ss(),this}getScaleLabelFont(){return this.gA}setScaleLabelPadding(t){return this.pA=t,this.ls.Ss(),this}getScaleLabelPadding(){return this.pA}setScaleLabelStrategy(t){return this.aA=t,this.ls.Ss(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.ls.Ss(),this}setAxisLabelStyle(t){return this.mA="function"==typeof t?t(this.mA):t,this.ls.Ss(),this}getAxisLabelStyle(){return this.mA}setAxisLabelFont(t){return this.yA="function"==typeof t?t(this.yA):t,this.ls.Ss(),this}getAxisLabelFont(){return this.yA}setAxisLabelEffect(t){return this.G_.ys(t),this.ls.Ss(),this}getAxisLabelEffect(){return this.G_.xs()}setAxisLabelPadding(t){return this.SA=t,this.ls.Ss(),this}getAxisLabelPadding(){return this.SA}setAxisLabelStrategy(t){return this.lA=t,this.ls.Ss(),this}setAxisStyle(t){return this.xA="function"==typeof t?t(this.xA):t,this.ls.Ss(),this}getAxisStyle(){return this.xA}setNibStyle(t){return this.bA="function"==typeof t?t(this.bA):t,this.ls.Ss(),this}getNibStyle(){return this.bA}setNibLength(t){return this.Od=t,this.ls.Ss(),this}getNibLength(){return this.Od}setAutoAxis(t){return this.oA=t,this}getAutoAxis(){return this.oA}setMouseInteractions(t){return this.po=t,this}getMouseInteractions(){return this.po}setAxisScrollStrategy(t){return this.nA=t,this.ls.Ss(),this}getAxisScrollStrategy(){return this.nA}setAxisInterval(t,e=0){return this.axisScale.Z(e,t),this.ls.Ss(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}Ae(t){super.Ae(t),Nh.fp(this.ap,this.rp);const e=this.LS.length,i=Nh.dp(this.ap,this.rp),s=u(this.pixelScale.x.getInnerInterval()-(this.Qo.left+this.Qo.right),this.pixelScale.y.getInnerInterval()-(this.Qo.bottom+this.Qo.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.lA){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.nA){const t=this.PA();if(void 0!==t){const e=this.nA.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.nA.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.Z(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.vA=S(this.Ft.left+this.Qo.left+r.left,this.Ft.top+this.Qo.top+i+r.top,this.Ft.right+this.Qo.right+r.right,this.Ft.bottom+this.Qo.bottom+r.bottom),this.Xp(n,o);for(const t of this.My)t.ey();for(const t of this.My)t.Ae();super.sp(),this.Vx(!1);for(const t of this.My)t.om()}dispose(){return this.WM.G(),this.AA.G(),this.LA.G(),this.hb.G(),this._f.G(),super.dispose()}getMinimumSize(){return u(this.vA.left+this.vA.right+100,this.vA.bottom+this.vA.top+100)}Xp(t,e){const i=this.LS.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];rc(h,i,s,n);const u=r*((l+1)/e);h.Gl(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=Ue(n,o[a],s);e.we(ri(c,u(m.paddingX,m.paddingY))).ga(m.alignmentX).ma(m.alignmentY).Ch(l(s))}}}for(let e=f;e1;for(const s of this.LS)for(const r of this.My){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 lc=t=>({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...Sa(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.ur().x))}),uc=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...Sa(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.ur().y))});class cc extends cn{constructor(t,e,i,s){super(),this.Qi=[],this.ic=0,this.kc=!0,this.P=new r.Eventer,this.RA=t=>(this.Qi.push(t),this.ju(t),t.setMouseInteractions(this.kc),t),this.getHighlight=()=>this.ic,this.As=t,this.scale=e,this.EA=i,this.Ji=s}zA(){return this.Qi}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}dispose(){return this.Qi.forEach(wt),this.EA&&this.EA(this),this.As.ls.Ss(),this.P.emit("dispose",this),this}setVisible(t){return super.setVisible(t),this.Qi.forEach((e=>e.setVisible(t))),this.As.ls.Ss(),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setHighlight(t){return this.ic=ve(t),this.As.Ss(),this}setMouseInteractions(t){this.kc=t;for(let t=0;t{const e=this.VA.findIndex((e=>e===t));e>=0&&this.VA.splice(e,1),this.As.Ss()}}clear(){return this.VA.slice().forEach(wt),this.VA.length=0,this.As.Ss(),this}NA(t,e){void 0!==e?this.VA.splice(e,0,t):this.VA.push(t),t.zA().forEach((t=>this.cs(t,{setEventHandlers:!1}))),t.onMouseEnter(((t,e)=>this.Ri(t,e))),t.onMouseLeave(((t,e)=>this.Ei(t,e))),t.onMouseClick(((t,e)=>this.Vi(t,e))),t.onMouseDoubleClick(((t,e)=>this.Ni(t,e))),t.onMouseDown(((t,e)=>this.Gi(t,e))),t.onMouseUp(((t,e)=>this.Wi(t,e))),t.onMouseMove(((t,e)=>this.zi(t,e))),t.onMouseDragStart(((t,e,i)=>this.Hi(t,e,i))),t.onMouseDrag(((t,e,i,s,r)=>this.Ui(t,e,i,s,r))),t.onMouseDragStop(((t,e,i,s)=>this.$i(t,e,i,s))),t.onMouseWheel(((t,e)=>this.ji(t,e))),t.onTouchStart(((t,e)=>this.Yi(t,e))),t.onTouchMove(((t,e)=>this.Xi(t,e))),t.onTouchEnd(((t,e)=>this.Zi(t,e))),this.As.Ss()}ke(t,e){t.setHighlight(e)}GA(t){return this.VA.find((e=>e.zA().includes(t)))}setCursorEnabled(t){return super.setCursorEnabled(t)}}class fc extends cc{}class gc extends dc{constructor(){super(...arguments),this.WA=void 0,this.HA=()=>{this.WA=void 0}}Xm(){return this.Km&&this.VA.length>0&&this.getVisible()}setDefaultStyle(t){this.UA=t,this.VA.forEach(t),t(this.$A);for(let t=0;tt.getVisible()&&t.getIsUnderMouse())):this.VA.filter((t=>t.getVisible())),this.YA,Ne);if(void 0!==i)return{location:at(i[0],this.As.ls.ct,this.scale),scale:this.scale,resultTableContent:this.$x(new Ja,this,i[1]).vc(),series:this,fillStyle:i[1].getDominantStyle(),figure:i[1]}}solveNearestFromScreen(t){return this.zx(Yo(t,this.Ki.ls),!1)}NA(t){super.NA(t),this.UA&&this.UA(t)}clear(){return this.WA=void 0,super.clear()}getXMax(){return this.WA||(this.WA=this.XA()),this.WA.max.x}getXMin(){return this.WA||(this.WA=this.XA()),this.WA.min.x}getYMax(){return this.WA||(this.WA=this.XA()),this.WA.max.y}getYMin(){return this.WA||(this.WA=this.XA()),this.WA.min.y}ur(){return u(0,0)}XA(){const t=y(c(ke,ke),c(Pe,Pe));for(let e=0;e{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)},Tc=(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=ti(ni(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]=ri(si(r,l),f[1]),f[2]=ni(f[2],si(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.nM.length>0){const e=this.nM[this.nM.length-1];if(t.length>0){const i=e.Ea(),s=e.Ra(),r=i.length+s.length-+e.xl();if(r>=this.fM){const n=s.length>0?s[s.length-1]:i[e.xl()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.Wa(o,y(u(o.x,o.y),u(o.x,o.y))).bl(!0),this.kw([o].concat(t)).Sl(!0)}else e.Wa(t,this.cM)}}else t.length>0&&this.kw(t)},this.Cw=t=>{if(this.Aw.length>0){const e=this.Aw[this.Aw.length-1];t.length>0&&((e.Ea().length+e.Ra().length)*this._w>=this.fM?this.Tw(t):e.Wa(t))}else t.length>0&&this.Tw(t)},this.Fw=(t,e)=>{const i=t.zx(e);if(i)return at(i,this.scale,this.As.ls.ct)},this.Iw=(t,e)=>{const i=t.Pw(e);if(i)return at(i,this.scale,this.As.ls.ct)},this.uv=l,this.Dw=f,this.Bw=ye(c.pointLineSeriesFillStyle,g),this.jl=ye(this.Ji.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}pM(){return hu(this.Aw)}setStrokeStyle(t){this.jl="function"==typeof t?t(this.jl):t;const e=this.jl;for(let t=0;te.setVisible(t))),this}setCursorInterpolationEnabled(t){return this.qb=t,this.As.ls.Ss(),this}getCursorInterpolationEnabled(){return this.qb}setCursorSolveBasis(t){return this.Mw=t,this.nM.forEach((e=>e.La(kr(t)))),this.Aw.forEach((e=>e.La(kr(t)))),this.As.Ss(),this}getCursorSolveBasis(){return this.Mw}ld(){return de(this.Bw)||de(this.jl.getFillStyle())}Jv(t){}ke(t,e){t.us(e),this.As.Ss()}gM(t){const e=this.nM.length>0?this.nM[this.nM.length-1].Ea().length+this.nM[this.nM.length-1].Ra().length-+this.nM[this.nM.length-1].xl():void 0;ou(t,e,this.fM,this.ww),ou(t,e,this.fM,this.Cw)}Tw(t,e){const i=this.As.vy(this.scale).Wa(t,e).setMouseInteractions(this.ki).Me(this.Bw).za(this.uv).q(this.lv).Ph(this.Ko).Va(this.wa).Na(this.ka).Ga(this.Ca).La(kr(this.Mw)).us(this.getHighlight());return this.cs(i),this.Aw.push(i),i}kw(t,e){const i=this.As.tm(this.scale,void 0,[Zh.UserSeries,...this.Dw]).Wa(t,e).setMouseInteractions(this.ki).Pe(this.jl).La(kr(this.Mw)).us(this.getHighlight());return this.cs(i),this.nM.push(i),i}attach(t,e=!0){return ce(t,this.Ji,{stroke:this.jl,fill:this.Bw}),super.attach(t,e)}getPointAmount(){return this.Aw.reduce(((t,e)=>t+e.Ua()+e.$a()),this.Jl.length)}clear(){super.clear();for(let t=0;t{}))}zx(t,e,i=this.qb){const s=i?cu(t,e?this.nM.filter((t=>t.getIsUnderMouse())):this.nM,this.Iw,"nearest-x"===this.Mw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Mw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):cu(t,e?this.Aw.filter((t=>t.getIsUnderMouse())):this.Aw,this.Fw,"nearest-x"===this.Mw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Mw?(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=at(s[0],this.As.ls.ct,this.scale),e=s[1]instanceof hn?s[1].Yl():s[1].Th(),i=s[1]instanceof qr?s[1].Th():void 0,r=s[1]instanceof hn?s[1].Yl().getFillStyle():void 0,n=H(e)?s[0].color?new V({color:s[0].color}):new V({color:e.getFallbackColor()}):void 0;return ll(t,this.scale,this.$x(new Ja,this,t.x,t.y,t).vc(),this,r||n||i)}}solveNearestFromScreen(t,e=this.qb){return this.zx(Yo(t,this.Ki.ls),!1,e)}}const Ec=(t,e)=>t.Ra().length>=e?t.Ra().slice(-e):Array.prototype.concat(t.Ea(),t.Ra()).slice(-e),Ic=(t,e,i)=>{const s=Array.prototype.concat(t.Ea(),t.Ra()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Ha().Wa(s).Ts()};class Cc extends wc{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,c,d,f),this.bs="Spline Series",this._w=32,this.fM=8e3,this.Ow=t=>{if(0===t.length)return;const e=this.Aw.length;if(e>0){const i=e>1,s=this.Aw[e-1];if(i){const i=Array.prototype.concat(s.Ea(),s.Ra()),r=i.length;if(32*r>=this.fM){const i=Ec(s,3),r=Array.prototype.concat(i,t),n=Tc(r,32);Ic(this.nM[e-1],n,32),this.kw(n.slice(66))}else if(r<5){const s=this.Aw[e-2],r=Ec(s,3),n=Array.prototype.concat(r,i,t),o=Tc(n,32),h=this.nM[e-1],a=o.slice(66);h.Ha().Wa(a).Ts()}else{const i=this.nM[e-1],r=Array.prototype.concat(i.Ea(),i.Ra()),n=Ec(s,4),o=Array.prototype.concat(n,t),h=Tc(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Ha().Wa(a).Ts()}}else{const i=Array.prototype.concat(s.Ea(),s.Ra()),r=i.length,n=this.nM[e-1];if(32*r>=this.fM){const e=Ec(s,3),i=Array.prototype.concat(e,t),r=Tc(i,32);Ic(this.nM[0],r,32),this.kw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=Tc(e,32);n.Ha().Wa(s).Ts()}else n.Wa(t)}}else{const e=t.length>0?Tc(t,32):t,i=Xe(e);this.kw(e,i)}this.Cw(t)}}setCursorInterpolationEnabled(t){return super.setCursorInterpolationEnabled(t)}gM(t){const e=this.Aw.length,i=this.Aw.length>0?this.Aw[e-1].Ea().length+this.Aw[e-1].Ra().length:void 0;ou(t,i,Math.ceil(this.fM/this._w),this.Ow)}solveNearestFromScreen(t,e=this.qb){if(e)return super.solveNearestFromScreen(Yo(t,this.Ki.ls),e);const i=cu(Yo(t,this.Ki.ls),this.Aw,this.Fw,"nearest-x"===this.Mw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Mw?(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=at(i[0],this.As.ls.ct,this.scale);return ll(t,this.scale,this.$x(new Ja,this,t.x,t.y,t).vc(),this,i[1].Th())}}}class kc{constructor(){this._i="FreeformPattern",this.nl={type:"disabled",packager:(t,e,i)=>t.slice()}}dM(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}},Fc=s.Record({nl:{type:"disabled",packager:(t,e,i)=>t.slice()}});class Bc extends Fc{dM(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.Rw(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.At();return t?Math.min(i,t):i},Lc=(t,e)=>{const i=e.wt();return t?Math.max(i,t):i};class Dc extends Bc{Lw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(Lc,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(_c,e?e.min.y:void 0)}}const zc=(t,e)=>{const i=e.Mt();return t?Math.min(i,t):i},Oc=(t,e)=>{const i=e._t();return t?Math.max(i,t):i};class Rc extends Bc{Lw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(Oc,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(zc,e?e.min.x:void 0)}}const Vc={horizontalProgressive:new class extends Dc{constructor(){super({nl:Ar()}),this._i="HorizontalProgressivePattern"}Rw(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]._t():void 0}getXMin(t=[],e){return t.length>0&&t[0].Ua()>0?t[0].Mt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",Ar(Pc(t)))}},horizontalRegressive:new class extends Dc{constructor(){super({nl:Tr()}),this._i="HorizontalRegressivePattern"}Rw(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].Ua()>0?t[0]._t():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].Mt():void 0}setPrecision(t){return this.set("_columnPackaging",Tr(Pc(t)))}},verticalProgressive:new class extends Rc{constructor(){super({nl:wr()}),this._i="VerticalProgressivePattern"}Rw(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].wt():void 0}getYMin(t=[],e){return t.length>0&&t[0].Ua()>0?t[0].At():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",wr(Pc(t)))}},verticalRegressive:new class extends Rc{constructor(){super({nl:Er()}),this._i="VerticalRegressivePattern"}Rw(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].Ua()>0?t[0].wt():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].At():void 0}setPrecision(t){return this.set("_columnPackaging",Er(Pc(t)))}},freeform:new kc};class Nc extends wc{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g){super(t,e,i,s,r,n,o,h,Vc.horizontalProgressive,a,c,d,f,g),this.bs="Step Series",this.ww=t=>{const e=this.nM.length>0?this.nM[this.nM.length-1].Ea().length+this.nM[this.nM.length-1].Ra().length:void 0;ou(t,e,this.fM,this.Ew)},this.Ew=t=>{const e=t.length;if(this.nM.length>0){const i=this.nM[this.nM.length-1];if(e>0){const e=i.Ea(),s=i.Ra(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Mc([r].concat(t),this.zw);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.fM?(i.Wa(o,y(u(o.x,o.y),u(o.x,o.y))).bl(!0),this.kw(h).Sl(!0),this.Tw(t)):i.Wa(h)}}else e>0&&this.kw(Mc(t,this.zw));this.Cw(t)},this.zw=l,void 0===this.Dw.find((t=>"DataPattern"===t.type))&&this.Dw.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class Gc 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.nM=[],this.bs="Line Series",this.qb=!0,this.fM=void 0,this.Mw="nearest-x",this.Ql=void 0,this.ld=()=>de(this.jl.getFillStyle()),this.Vw=(t,e)=>{const i=t.ov(e);if(i)return at(i,this.scale,this.As.ls.ct)},this.Iw=(t,e)=>{const i=t.Pw(e);if(i)return at(i,this.scale,this.As.ls.ct)},this.Dw=c,this._n=f,this.jl=ye(this.Ji.lineSeriesStrokeStyle,d),this.Nw={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.jl="function"==typeof t?t(this.jl):t;const e=this.jl;for(let t=0;tt.tu(this.Ql))),this.As.Ss(),this}setCursorInterpolationEnabled(t){return this.qb=t,this.As.ls.Ss(),this}getCursorInterpolationEnabled(){return this.qb}setCursorSolveBasis(t){return this.Mw=t,this.nM.forEach((e=>e.La(kr(t)))),this.As.Ss(),this}getCursorSolveBasis(){return this.Mw}Jv(t){}gM(t){let e=this.nM[0];e||(e=this.kw(),this.nM.push(e),this.cs(e)),e.Wa(t)}kw(){return this.As.tm(this.scale,this.Nw,[Zh.UserSeries,...this.Dw]).Pe(this.jl).tu(this.Ql).La(kr(this.Mw)).us(this.getHighlight())}attach(t,e=!0){return ce(t,this.Ji,{stroke:this.jl}),super.attach(t,e)}ke(t,e){t.us(e),this.As.Ss()}dM(t,e,i,s){}zx(t,e,i=this.qb){const s=cu(t,e?this.nM.filter((t=>t.getIsUnderMouse())):this.nM,i?this.Iw:this.Vw,"nearest-x"===this.Mw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Mw?(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=at(s[0],this.As.ls.ct,this.scale),e=s[1].Yl();return ll(t,this.scale,this.$x(new Ja,this,t.x,t.y,t).vc(),this,e.getFillStyle())}}solveNearestFromScreen(t,e=this.qb){return this.zx(Yo(t,this.Ki.ls),!1,e)}}class Hc extends fc{constructor(t,e,i,s,r,n){super(t,e,i,r),this.Gw={x:0,y:0,width:0,height:0},this.Ww={x1:0,y1:0,x2:0,y2:0},this.Ta=y(u(0,0),u(0,0)),this.Se=ye(r.rectangleSeriesFillStyle,n),this.As=t,this.HA=s,this.scale=e,this.xe=ye(r.rectangleSeriesStrokeStyle,n),this.be=this.RA(this.As._e(this.scale)).Me(this.Se).ve(this.xe)}getBoundaries(){return this.Ta}setDimensions(t){return"x"in t?(this.Gw=t,this.Ww={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.Ww=t,this.Gw={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.be.we(u(this.Gw.x,this.Gw.y)).q(u(this.Gw.width,this.Gw.height)),this.Ta=Xe([this.Gw,u(this.Gw.x+this.Gw.width,this.Gw.y+this.Gw.height)]),this.HA(),this.As.Ss(),this}getDimensionsPositionAndSize(){return this.Gw}getDimensionsTwoPoints(){return this.Ww}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.be.Me(this.Se),this.As.Ss(),this}getFillStyle(){return this.Se}setStrokeStyle(t){return this.xe="function"==typeof t?t(this.xe):t,this.be.ve(this.xe),this.As.Ss(),this}getStrokeStyle(){return this.xe}getDominantStyle(){return this.be.Th()}}class Uc extends gc{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.bs="Rectangle Series",this.$x=(t,e,i)=>{const s=i.getDimensionsPositionAndSize();return t.addRow(e.bs).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.YA=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return at(i,this.scale,this.As.ls.ct)},this.Hw=c,this.$A=new Hc(this.As,this.scale,Et,Et,this.Ji,this.Hw).dispose()}Jv(t){}add(t){const e=new Hc(this.As,this.scale,this.EA,this.HA,this.Ji,this.Hw).setDimensions(t);return this.NA(e),e}}class Wc extends fc{constructor(t,e,i,s,r,n){super(t,e,i,r),this.Uw=[],this.Ta=Fe,this.As=t,this.scale=e,this.HA=s,this.Se=ye(r.polygonSeriesFillStyle,n),this.xe=ye(r.polygonSeriesStrokeStyle,n),this.TM=this.RA(this.As.Cc(this.scale,sn.Simple)).ve(this.xe).Me(this.Se)}getBoundaries(){return this.Ta}setDimensions(t){return this.Uw=t,this.TM.tl(this.Uw),this.Ta=Xe(this.Uw),this.HA(),this.As.Ss(),this}getDimensions(){return this.Uw}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.TM.Me(this.Se),this.As.Ss(),this}getFillStyle(){return this.Se}setStrokeStyle(t){return this.xe="function"==typeof t?t(this.xe):t,this.TM.ve(this.xe),this.As.Ss(),this}getStrokeStyle(){return this.xe}getDominantStyle(){return this.TM.Th()}}class Xc extends gc{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.bs="Polygon Series",this.$x=(t,e,i)=>t.addRow(e.getName()),this.YA=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return at(i,this.scale,this.As.ls.ct)},this.Hw=c,this.$A=new Wc(this.As,this.scale,Et,Et,this.Ji,this.Hw).dispose()}Jv(t){if(!(t instanceof _i))throw new Error("PolygonSeries can only be attached to a pair of Linear Axes.")}add(t){const e=new Wc(this.As,this.scale,this.EA,this.HA,this.Ji,this.Hw).setDimensions(t);return this.NA(e),e}}class Yc extends fc{constructor(t,e,i,s,r,n){super(t,e,i,r),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.Ta=y(u(0,0),u(0,0)),this.Ie=this.RA(this.As.De(this.scale)),this.Ji=r,this.As=t,this.scale=e,this.HA=s,this.Se=ye(r.segmentSeriesStrokeStyle,n),this.Ie.Pe(this.Se)}getBoundaries(){return this.Ta}setDimensions(t){return this.dimensions=t,this.Ie.Oe(u(t.startX,t.startY)).Be(u(t.endX,t.endY)),this.Ta=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.HA(),this.As.Ss(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.Ie.Pe(this.Se),this.As.Ss(),this}getStrokeStyle(){return this.Se}getDominantStyle(){const t=this.Ie.Yl();return t!==st?t.getFillStyle():z}}class jc extends gc{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.bs="Segment Series",this.$x=(t,e,i)=>t.addRow(e.bs).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.YA=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return at(i,this.scale,this.As.ls.ct)},this.Hw=c,this.$A=new Yc(this.As,this.scale,Et,Et,this.Ji,this.Hw).dispose()}Jv(t){}add(t){const e=new Yc(this.As,this.scale,this.EA,this.HA,this.Ji,this.Hw).setDimensions(t);return this.NA(e),e}}class Jc extends fc{constructor(t,e,i,s,r,n){super(t,e,i,r),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.Ta=y(u(0,0),u(0,0)),this.$w=this.RA(this.As.Dc(this.scale)).$l(50),this.As=t,this.scale=e,this.HA=s,this.Se=ye(r.ellipseSeriesFillStyle,n),this.xe=ye(r.ellipseSeriesStrokeStyle,n),this.$w.Me(this.Se).ve(this.xe)}getBoundaries(){return this.Ta}setDimensions(t){return this.dimensions=t,this.$w.we(u(t.x,t.y)).Wl(t.radiusX).Hl(t.radiusY),this.Ta=y(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.HA(),this.As.Ss(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.$w.Me(this.Se),this.As.Ss(),this}getFillStyle(){return this.Se}setStrokeStyle(t){return this.xe="function"==typeof t?t(this.xe):t,this.$w.ve(this.xe),this.As.Ss(),this}getStrokeStyle(){return this.xe}getDominantStyle(){return this.$w.Th()}}class $c extends gc{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.bs="Ellipse Series",this.$x=(t,e,i)=>t.addRow(e.bs).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.YA=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return at(i,this.scale,this.As.ls.ct)},this.Hw=c,this.$A=new Jc(this.As,this.scale,Et,Et,this.Ji,this.Hw).dispose()}Jv(t){if(!(t instanceof _i||t instanceof Li))throw new Error("EllipseSeries only supports Linear Axes")}add(t){const e=new Jc(this.As,this.scale,this.EA,this.HA,this.Ji,this.Hw).setDimensions(t);return this.NA(e),e}}function qc(t,e){return t===e?0:tthis.Wa(t))):this.Wa(t))}qw(t){return!!this.root&&(this.Jw(t),this.contentEquals(t,this.root.value))}Qw(t,e){return this.jw(((i,s)=>i&&t.call(e,s)),!0)}tk(t,e){return this.jw(((i,s)=>{t.call(e,s)}),void 0)}M(t){if(this.root&&(this.Jw(t),this.contentEquals(t,this.root.value)))return this.root}Wa(t){const e=new Zc(t);if(!this.root)return this.root=e,this.length+=1,e;if(this.Jw(t),!this.contentEquals(t,this.root.value)){const i=this.contentCompare(t,this.root.value);if(0===i)throw new Error(`SortedSet cannot contain incomparable but inequal values: ${t} and ${this.root.value}`);return i<0?(e.right=this.root,e.left=this.root.left,this.root.left=null,this.root.Xw()):(e.left=this.root,e.right=this.root.right,this.root.right=null,this.root.Xw()),e.Xw(),this.root=e,this.length+=1,e}}ik(t){if(this.root&&(this.Jw(t),this.contentEquals(t,this.root.value))){if(this.root.left){const{right:e}=this.root;this.root=this.root.left,this.Jw(t),this.root.right=e}else this.root=this.root.right;return this.length-=1,this.root&&this.root.Xw(),!0}return!1}sk(){if(this.root){let t=this.root;for(;t.right;)t=t.right;return t}}ek(){if(this.root){let t=this.root;for(;t.left;)t=t.left;return t}}hk(t){if(this.root)return this.Jw(t),this.contentCompare(this.root.value,t)>0?this.root.Kw():this.root}rk(t){if(this.root)return this.Jw(t),this.contentCompare(this.root.value,t)>=0?this.root.Kw():this.root}nk(t){if(this.root)return this.Jw(t),this.contentCompare(this.root.value,t)>=0?this.root:this.root.Zw()}ak(t){if(this.root)return this.Jw(t),this.contentCompare(this.root.value,t)<=0?this.root.Zw():this.root}lk(t){t instanceof Array?t.forEach((t=>this.Wa(t))):this.Wa(t)}Jw(t){let e,i,s,r,n,o;if(this.root){for(e=new Zc,i=e,s=e,o=new Zc,n=this.root;;){const e=this.contentCompare(t,n.value);if(e<0){if(!n.left)break;if(this.contentCompare(t,n.left.value)<0&&(r=n.left,n.left=r.right,n.Xw(),r.right=n,r.Xw(),n=r,!n.left))break;r=new Zc,r.right=n,r.left=o.left,o.left=r,s.left=n,s.Xw(),s=n,n=n.left}else{if(!(e>0))break;if(!n.right)break;if(this.contentCompare(t,n.right.value)>0&&(r=n.right,n.right=r.left,n.Xw(),r.left=n,r.Xw(),n=r,!n.right))break;r=new Zc,r.left=n,r.right=o.right,o.right=r,i.right=n,i.Xw(),i=n,n=n.right}}for(i.right=n.left,i.Xw(),s.left=n.right,s.Xw(),n.left=e.right,n.right=e.left;o.left;)o.left.right.Xw(),o.left=o.left.left;for(;o.right;)o.right.left.Xw(),o.right=o.right.right;n.Xw(),this.root=n}}jw(t,e,i){return this.root&&(e=this.root.jw(t,e,0,i,this)),e}Yw(t,e,i){return this.root&&(e=this.root.Yw(t,e,this.length-1,i,this)),e}Ha(){this.root=null,this.length=0}uk(t,e){let i,s=this.ek();for(;s;){const r=this.ak(s.value);t.call(e,i?i.value:void 0,s.value,r?r.value:void 0),i=s,s=r}}ck(t,e,i){let s,r=this.ek(),n=0;for(;r;){const o=this.ak(r.value);e=t.call(i,e,s?s.value:void 0,r.value,o?o.value:void 0,n++,this),s=r,r=o}return e}}class td{constructor(t,e){this.key=t,this.value=e}equals(t){return Kc(this.key,t.key)&&Kc(this.value,t.value)}compare(t){return qc(this.key,t.key)}}class ed{constructor(t,e=Kc,i=qc){this.length=0,this.contentEquals=e,this.contentCompare=i,this.store=new Qc(void 0,((t,i)=>e(t.key,i.key)),((t,e)=>i(t.key,e.key))),t&&(Array.isArray(t)?t.forEach((t=>this.Wa(t.key,t.value))):this.Wa(t.key,t.value))}M(t){const e=this.store.M(new td(t,void 0));return e?e.value.value:void 0}S(t,e){const i=new td(t,e),s=this.store.M(i);if(s)return s.value.value=e,s;const r=this.store.Wa(i);return this.length+=1,r}Wa(t,e){return this.S(t,e)}qw(t){return this.store.qw(new td(t,void 0))}Ha(){this.store.Ha(),this.length=0}jw(t,e,i){return this.store.jw(((e,s)=>t.call(i,e,s.value,s.key,this)),e,this.store)}Yw(t,e,i){return this.store.Yw(((e,s)=>t.call(i,e,s.value,s.key,this)),e,this.store)}ik(t){const e=new td(t,void 0);return!!this.store.qw(e)&&(this.store.ik(e),this.length--,!0)}tk(t,e){return this.jw(((i,s,r)=>{t.call(e,s,r)}),void 0)}dk(t){return this.store.M(new td(t,void 0))||void 0}uk(t,e){let i,s=this.store.ek();for(;s;){const r=this.store.ak(s.value);t.call(e,i?i.value.value:void 0,s.value.value,r?r.value.value:void 0),i=s,s=r}}ck(t,e,i){let s,r=this.store.ek(),n=0;for(;r;){const o=this.store.ak(r.value);e=t.call(i,e,s?s.value.value:void 0,r.value.value,o?o.value.value:void 0,n++,this),s=r,r=o}return e}sk(){return this.store.sk()}ek(){return this.store.ek()}hk(t){return this.store.hk(new td(t,void 0))}rk(t){return this.store.rk(new td(t,void 0))}nk(t){return this.store.nk(new td(t,void 0))}ak(t){return this.store.ak(new td(t,void 0))}}const id={minGapNew:1.75,minGapSplit:2,maxGapFuse:1.5},sd=(t,e)=>Math.min(t,e[3]),rd=(t,e)=>Math.max(t,e[2]),nd=(t,e)=>{const i=t.length;if(!(i<2))return[e,t[0].y,t.reduce(At,Pe),t.reduce(Mt,ke),t[i-1].y]},od=(t,e)=>{let i=[];const s=t.getDataIndices(),r=e.getDataIndices();return Array.isArray(s)?i=i.concat(s):i.push(s),Array.isArray(r)?i=i.concat(r):i.push(r),i},hd=(t,e)=>{if(t.length>0)return e>0?t[t.length-1]:t[0]},ad=(t,e,i)=>t.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i.getPosition())).addRow("Open","",i.getOpen().toFixed(2)).addRow("High","",i.getHigh().toFixed(2)).addRow("Low","",i.getLow().toFixed(2)).addRow("Close","",i.getClose().toFixed(2));class ld extends dc{constructor(t,i,s,r,n,o,h,a,l,u,d,f,g){super(t,i,s,r,n,o,h,a,d,f),this.bs="OHLC Series",this.fk=new ed,this.WA=y(c(ke,ke),c(Pe,Pe)),this.gk=0,this.pk=5,this.mk=id,this.Ql=void 0,this.yk=void 0,this.Sk=void 0,this.xk=!0,this.Ci=e.HighlightModes.onHover,this.$x=ad,this.bk=l,this.vk=u,this.Mk=new this.bk(this.As,this.scale,Et,!0,this.Ji).dispose(),this._k=new this.vk(this.As,this.scale,Et,!1,this.Ji).dispose()}Jv(t){if(!(t.x instanceof Pi))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.Ak=t.x}setStyle(t){return this.wk=t,this.kk(),this.As.Ss(),this}setPositiveStyle(t){return this.Ck=t,this.kk(),this.As.Ss(),this}setNegativeStyle(t){return this.Tk=t,this.kk(),this.As.Ss(),this}setFigureWidth(t){return this.pk=t,this.As.Ss(),this}getFigureWidth(){return this.pk}setFigureAutoFitting(t){return this.mk=t?id:void 0,this.As.Ss(),this}getFigureAutoFitting(){return void 0!==this.mk}Fk(t,e){return t-e/2<=this.scale.x.getInnerEnd()+.1*this.scale.x.getInnerInterval()&&this.scale.x.getInnerStart()-.1*this.scale.x.getInnerInterval()<=t+e/2}Ik(t,e,i,s){const r=(t=>t[4]>=t[1])(t),n=new(r?this.bk:this.vk)(this.As,this.scale,this.EA,r,this.Ji);return this.NA(n,s),this.Pk(n),this.ke(n,this.getHighlight()),n.dw(t[0],t[1],t[2],t[3],t[4],e).Ka(i),n}Dk(t){const e=this.gk;return this.gk+=1,this.fk.S(e,t),this.xk=!0,this.P.emit("dataAdd",this,[t],void 0),e}kk(){this.VA.forEach((t=>{this.wk&&this.wk(t),t.positive&&this.Ck?this.Ck(t):!t.positive&&this.Tk&&this.Tk(t)}))}Pk(t){this.wk&&this.wk(t),t.positive&&this.Ck?this.Ck(t):!t.positive&&this.Tk&&this.Tk(t)}Bk(t){return t*this.Ak.getPixelSize()}Ok(t){return t/this.Ak.getPixelSize()}Lk(t){if(!Array.isArray(t))return this.fk.M(t);if(this.fk.M(t[0])&&this.fk.M(t[t.length-1])){let e=0;const i=this.fk.M(t[0])[1];let s=Pe,r=ke;const n=this.fk.M(t[t.length-1])[4];for(let i=0;i1){const e=t>0?this.VA.length-1:0;this.VA[e].dispose()}let s;do{s=!1;const r=hd(this.VA,t);if(r){const n=r.getPosition(),o=r.getDataIndices();let h,a=("number"==typeof o?o:o[t>0?o.length-1:0])+t;const l=[],u=[];for(;;){const s=this.fk.M(a);if(!s)break;if(!this.Fk(s[0],e))break;if(h){if(Math.abs(n-s[0])>=1.5*i)break;t>0?h[4]=s[4]:h[1]=s[1],h[2]=Math.max(h[2],s[2]),h[3]=Math.min(h[3],s[3])}else h=s.slice();l.push(s[0]),t>0?u.push(a):u.splice(0,0,a),a+=t}if(h){const i=t>0?void 0:0;this.Ik(h,u,e,i),s=!0}}}while(s)}dM(t){var e;if(t&&"maxDataPointCount"in t){const e=t.maxDataPointCount;if(e&&this.fk.length>e){const t=this.gk-1,i=this.fk.store.ek();if(i){for(let s=t-e;s>=i.value.key;s-=1)this.fk.ik(s);let s=!0;this.WA.min.y=ke,this.WA.max.y=Pe;for(let i=1+t-e;i<=t;i+=1){const t=this.fk.M(i);t&&(this.WA.min.y=Math.min(this.WA.min.y,t[3]),this.WA.max.y=Math.max(this.WA.max.y,t[2]),s&&(this.WA.min.x=t[0],s=!1))}}}}else if(t&&"minDataPointCount"in t&&t.minDataPointCount){const i=t.minDataPointCount,s=this.scale.x.getInnerStart(),r=this.gk-1;let n=this.fk.store.ek();if(n){const t=n.value.key;let o;for(let t=n.value.key;t<=r&&!((null===(e=this.fk.M(t))||void 0===e?void 0:e[0])>=s);t+=1)o=t;if(void 0!==o&&o-t>=1e3&&this.fk.length-(o-t)>=i){for(let e=o;e>=t;e-=1)this.fk.ik(e);n=this.fk.store.ek();let e=!0;if(this.WA.min.y=ke,this.WA.max.y=Pe,n)for(let t=n.value.key;t<=r;t+=1){const i=this.fk.M(t);i&&(this.WA.min.y=Math.min(this.WA.min.y,i[3]),this.WA.max.y=Math.max(this.WA.max.y,i[2]),e&&(this.WA.min.x=i[0],e=!1))}}}}return this}setDataCleaning(t){return this.Ql=t,this.As.Ss(),this}om(){super.om(),this.dM(this.Ql);const t=this.Ak.getPixelSize(),e=this.yk,i=y(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd()),s=this.Sk,r=this.Bk(this.pk),n=!s||i.max-i.min!=s.max-s.min,o=this.VA.length;if(!s||i.min>s.min)for(let t=0;t=0;t-=1){const e=this.VA[t];if(this.Fk(e.getPosition(),r))break;e.dispose()}if(0===this.VA.length&&this.fk.length>0)for(let t=0;t0){const o=this.mk?r*this.mk.minGapNew:0;if((n||!s||i.mins.max)&&(this.Rk(1,r,o),this.xk=!0),this.mk){const i=r*this.mk.maxGapFuse,s=r*this.mk.minGapSplit;if(void 0===e||t!==e||this.xk){let t,e;do{t=!1;for(let e=0;e1){const o=i.getPosition(),h=e>0?this.VA[e-1]:void 0,a=e=1.5*s)&&(!a||a.getPosition()-o>=1.5*s)){t=!0,i.dispose();const s=n.length,o=Math.round(s/2),h=n.splice(o,s-o),a=this.Lk(n),l=this.Lk(h);void 0!==a&&this.Ik(a,n,r,e),void 0!==l&&this.Ik(l,h,r,e+1),e+=1}}}}while(t);do{e=!1;for(let t=0;tt.getIsUnderMouse()));return t&&{location:u(t.getPosition(),t.getClose()),scale:this.scale,resultTableContent:this.$x(new Ja,this,t).vc(),series:this,fillStyle:t.getDominantStyle(),ohlcSegment:t}}if(i>0){const e=((t,e,i)=>{if(tthis.VA[t].getPosition()));if(void 0===e)return;const s=this.VA[e];return{location:u(s.getPosition(),s.getClose()),scale:this.scale,resultTableContent:this.$x(new Ja,this,s).vc(),series:this,fillStyle:s.getDominantStyle(),ohlcSegment:s}}}solveNearestFromScreen(t){return this.zx(Yo(t,this.Ki.ls),!1)}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}setCursorEnabled(t){return super.setCursorEnabled(t)}clear(){return this.fk.Ha(),this.xk=!0,this.WA.min.x=ke,this.WA.min.y=ke,this.WA.max.x=Pe,this.WA.max.y=Pe,this.P.emit("dataClear",this),super.clear()}getXMax(){return this.WA.max.x}getXMin(){return this.WA.min.x}getYMax(){return this.WA.max.y}getYMin(){return this.WA.min.y}ur(){return u(this.pk/2,0)}pM(){const t=[];return this.fk.tk((e=>{t.push(e)})),t}mM(t){return this.P.on("dataAdd",t)}yM(t){return this.P.off(t)}SM(t){return this.P.on("dataClear",t)}xM(t){return this.P.off(t)}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{fill:this.Mk.getDominantStyle(),fill2:this._k.getDominantStyle(),behavior:{colorStep:!0}}),this}}class ud extends ld{add(t){if(t.length>0){if(Array.isArray(t[0])){const e=t;for(let t=0;t0&&this.getVisible()}}class cd extends ld{constructor(){super(...arguments),this.Jl=[]}Xm(){return this.Km&&(this.fk.length>0||this.Jl.length>0)&&this.getVisible()}add(t){Array.isArray(t)?this.addPoints(t):this.addPoint(t);const e=this.Jl[this.Jl.length-1];return this.uM=e?{x:e.x,y:e.y}:void 0,this}addPoint(t){return this.Jl.push(t),this.As.Ss(),this.WA.min.x=Math.min(this.WA.min.x,t.x),this.WA.max.x=Math.max(this.WA.max.x,t.x),this.WA.min.y=Math.min(this.WA.min.y,t.y),this.WA.max.y=Math.max(this.WA.max.y,t.y),this}addPoints(t){return t.length>0&&(this.Jl=this.Jl.concat(t),this.As.Ss(),this.WA.min.x=Math.min(this.WA.min.x,t[0].x),this.WA.max.x=Math.max(this.WA.max.x,t[t.length-1].x),this.WA.min.y=t.reduce(Mt,this.WA.min.y),this.WA.max.y=t.reduce(At,this.WA.max.y)),this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.uM?this.uM.x+e:0),this.add(au(t,e,s)),this}om(){if(this.dM(this.Ql),this.Jl.length>0){let t;if(void 0!==this.Ek)t=this.Ek;else{const e=this.mk?this.mk.minGapNew:1;t=this.Bk(this.pk*e)}const e=void 0!==this.zk?this.zk:this.Jl[0].x,i=((t,e,i)=>{const s=[],r=[];let n=!1;for(;t.length>0;){for(let o=0;o=i+e,n){const n=nd(r,i+e/2);void 0!==n&&(s.push(n),t.splice(0,r.length-1)),i+=e;break}}if(r.length=0,!n)break}return s})(this.Jl,t,e);if(i.length>0){for(let t=0;tt.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 gd extends gc{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,u,c),this.bs="Box Series",this.$x=fd,this.YA=t=>at(this.ws.toPoint((t.start+t.end)/2,t.median),this.scale,this.As.ls.ct),this.Vk=a,this.ws=l,this.$A=new this.Vk(this.As,this.scale,this.EA,this.ws,0,0,0,0,0,0,0,this.Ji).dispose()}Jv(t){if(!(t instanceof _i||t instanceof Li))throw new Error("BoxSeries only supports Linear Axes")}add(t){const e=new this.Vk(this.As,this.scale,this.EA,this.ws,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.Ji),i=e.boundaries;return this.WA=this.WA?je(this.WA,i):i,this.As.Ss(),this.NA(e),e}}class yd extends nu{constructor(){super(...arguments),this.nM=[],this.Jl=[],this.Nk=[],this.Gk=[],this.fM=1e3,this.oM=0,this.Ci=e.HighlightModes.onHover,this.nl={type:"disabled",packager:(t,e,i)=>t.slice()},this.qb=!0,this.Wk=[],this.Hk=[],this.Uk=!1,this.ld=()=>de(this.$k)||de(this.jk),this.Yk=t=>{const e=t.length;if(this.nM.length>0){const i=this.nM.length-1,s=this.nM[i];if(e>0){const[e,i]=s.Ea(),[r,n]=s.Ra();if((r?e.length+r.length:e.length)>=this.fM){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=ui(a,o,u(t[0].position,t[0].high)).y,c=ui(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.Wa(f,y(u(a,c),u(a,l))).bl(!0),this.Xk([f].concat(t)).Sl(!0)}else s.Wa(t)}}else e>0&&this.Xk(t)},this.Zk=t=>{const e=this.Wk,i=t.length;if(this.Wk.length>0){if(i>0){const i=e[e.length-1],s=i.Ea(),r=i.Ra();if(s.length+r.length>=this.fM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=ui(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.Wa(a,y(u(o,h),u(o,h))).bl(!0),e.push(this.Kk([a].concat(t),this.cM).Sl(!0))}else i.Wa(t)}}else i>0&&e.push(this.Kk(t))},this.qk=t=>{const e=this.Hk,i=t.length;if(this.Hk.length>0){if(i>0){const i=e[e.length-1],s=i.Ea(),r=i.Ra();if(s.length+r.length>=this.fM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=ui(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.Wa(a,y(u(o,h),u(o,h))).bl(!0),e.push(this.Jk([a].concat(t)).Sl(!0))}else i.Wa(t)}}else i>0&&e.push(this.Jk(t))},this.Qk=(t,e)=>{const i=t.ov(e);if(i)return[at(i[0],this.scale,this.As.ls.ct),at(i[1],this.scale,this.As.ls.ct)]},this.tC=(t,e)=>{const i=t.Pw(e);if(i)return[at(i[0],this.scale,this.As.ls.ct),at(i[1],this.scale,this.As.ls.ct)]}}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.oM=void 0!==e&&e>0?e:0,this.As.Ss(),this}clear(){for(let t=0;tt+e.Ua()+e.$a()),this.Jl.length)}setCursorInterpolationEnabled(t){return this.qb=t,this.As.ls.Ss(),this}getCursorInterpolationEnabled(){return this.qb}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}setCursorEnabled(t){return super.setCursorEnabled(t)}getCursorResultTableFormatter(){return this.$x}getXMax(){return Ut(this.nM,zt,Math.max,Nt,this.cM)}getXMin(){return Ut(this.nM,Dt,Math.min,Vt,this.cM)}getYMax(){return Ut(this.nM,Rt,Math.max,Ht,this.cM)}getYMin(){return Ut(this.nM,Ot,Math.min,Gt,this.cM)}ur(){const t=u(0,0);for(const e of this.nM)t.x=Math.max(t.x,e.sl()),t.y=Math.max(t.y,e.el());return t}Xm(){return this.Km&&this.getPointAmount()>0&&this.getVisible()}Jv(t){}lM(t,e,i){this.Jl=he(this.Jl,t,{canReturnB:!1}),this.Nk=he(this.Nk,e,{canReturnB:!1}),this.Gk=he(this.Gk,i,{canReturnB:!1}),this.As.Ss()}iC(t,e,i,s){this.sC(e,i,s),this.lM(Array.isArray(t)?t:[t],e,i)}sC(t,e,i){const s=je(Xe(t),Xe(e));this.cM?this.cM=je(this.cM,s):this.cM=s,i&&(this.cM=je(this.cM,i))}Rw(){const t=this.nM.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.nM[this.nM.length-1]:void 0,i=e?e.Ea()[0].length+(e.Ra()[0]?e.Ra()[0].length:0):void 0;ou(t,i,this.fM,this.Yk)}hC(t){const e=this.Wk.length>0?this.Wk[this.Wk.length-1].Ea().length+this.Wk[this.Wk.length-1].Ra().length:void 0;ou(t,e,this.fM,this.Zk)}rC(t,e){const i=this.Wk.length>0?this.Wk[this.Wk.length-1].Ea().length+this.Wk[this.Wk.length-1].Ra().length:void 0;ou(t,i,this.fM,this.Zk),ou(e,i,this.fM,this.qk)}Xk(t,e){const i=this.As.nC(this.scale).Wa(t,e).Me(this.$k).ml(this.jk).fl(this.nl).us(this.getHighlight());return this.nM.push(i),this.cs(i),i}oC(t,e,i){const s=this.As.tm(this.scale,void 0,[Zh.UserSeries]).Wa(t,i).setMouseInteractions(!1).Pe(e).us(this.getHighlight());return this.cs(s),s}Kk(t,e){return this.oC(t,this.aC,e)}Jk(t,e){return this.oC(t,this.lC,e)}uC(t){this.$k="function"==typeof t?t(this.$k):t;const e=this.$k;for(let t=0;t0){const t=this.nM.length,e=this.Rw();this.dM(this.nM,this.fM,this.oM,e);const i=this.nM.length;this.Wk.length>0&&this.dM(this.Wk,this.fM,this.oM,e),this.Hk.length>0&&this.dM(this.Hk,this.fM,this.oM,e),t!==i&&this.rM(),this.Uk=!0}}Ae(){if(super.Ae(),this.Jl.length>0&&(this.eC(this.Jl),this.SC(this.Nk,this.Gk),this.Uk=!0),this.Uk){const t=this.getBoundaries();for(const e of this.nM)e.ko(t);for(const e of this.Wk)e.ko(t);for(const e of this.Hk)e.ko(t)}}om(){this.cM=void 0,this.Jl.length=0,this.Nk.length=0,this.Gk.length=0}zx(t,e,i=this.qb){const s=((t,e,i)=>{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.getIsUnderMouse())):this.nM,i?this.tC:this.Qk);if(void 0!==s&&void 0!==s[0]){const t=at(s[0][0],this.As.ls.ct,this.scale),e=at(s[0][1],this.As.ls.ct,this.scale);return ll(t,this.scale,this.$x(new Ja,this,t.x,t.y,e.y).vc(),this,s[1].Th())}}solveNearestFromScreen(t,e=this.qb){return this.zx(Yo(t,this.Ki.ls),!1,e)}}const md=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Position","",e.axisX.formatValue(i)).addRow("Value","",e.axisY.formatValue(s)).addRow("Base","",e.axisY.formatValue(r));class pd extends yd{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.bs="Area Series",this.$x=md,this.xC=a}add(t){const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.bC(e),[i,s]=this.vC(t);this.iC(t,i,s,y(u(ke,this.xC),u(Pe,this.xC)));const r=this.Jl[this.Jl.length-1];this.uM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.P.emit("dataAdd",this,e,this.cM)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.uM?this.uM.position+e:0),this.add(au(t,e,s)),this}mM(t){return this.P.on("dataAdd",t)}yM(t){return this.P.off(t)}SM(t){return this.P.on("dataClear",t)}xM(t){return this.P.off(t)}}class Sd extends pd{constructor(){super(...arguments),this.lC=st}SC(t){return this.hC(t)}vC(t){const e=t.length,i=Array(e);for(let s=0;s=n){const t=d(r.x,r.y,n);if(0!==i&&Wt(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=pi(u(Pe,n),u(ke,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}pM(){return hu(this.nM,(t=>t[0]||[]))}setFillStyle(t){return this.uC(t),this}getFillStyle(){return this.dC()}attach(t,e=!0){return ce(t,this.Ji,{fill:this.$k,stroke:this.aC}),super.attach(t,e)}}class bd extends Sd{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.$k=z,this.jk=ye(this.Ji.areaSeriesNegativeFillStyle,c),this.aC=ye(this.Ji.areaSeriesNegativeStrokeStyle,c)}bC(t){return this.wC(t)}wC(t){const e=[];return 1===t.length?this._C(t[0],e):this.AC(t,e),e}_C(t,e,i=0){const s=this.xC;return e[i]=t.y>s?d(t.x,s,s):d(t.x,t.y,s),i+1}AC(t,e,i=0){let s=0;const r=t.length-1,n=this.xC;for(;sn){const t=pi(u(Pe,n),u(ke,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&&Wt(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=pi(u(Pe,n),u(ke,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}pM(){return hu(this.nM,(t=>t[1]))}setFillStyle(t){return this.cC(t),this}getFillStyle(){return this.yl()}attach(t,e=!0){return ce(t,this.Ji,{fill:this.jk,stroke:this.aC}),super.attach(t,e)}}class vd extends pd{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.$k=ye(this.Ji.areaSeriesBipolarHighFillStyle,c),this.aC=ye(this.Ji.areaSeriesBipolarHighStrokeStyle,c),this.jk=ye(this.Ji.areaSeriesBipolarLowFillStyle,c),this.lC=ye(this.Ji.areaSeriesBipolarLowStrokeStyle,c)}bC(t){return this.kC(t)}SC(t,e){return this.rC(t,e)}kC(t){let e=0;const i=[],s=t.length,r=this.xC;return s>0&&(this.CC&&(this.CC.y<=r&&r<=t[0].y||this.CC.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.CC.x+t[0].x),r,r),e+=1),this.CC=t[s-1],1===s?this._C(t[0],i,e):this.AC(t,i)),i}_C(t,e,i=0){return e[i]=d(t.x,t.y,this.xC),i+1}AC(t,e){let i=0,s=0;const r=t.length-1,n=this.xC;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:Mo(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}vC(t){const e=t.length,i=Array(e),s=Array(e),r=this.xC;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.uC(t),this}setNegativeFillStyle(t){return this.cC(t),this}setPositiveStrokeStyle(t){return this.fC(t),this}setNegativeStrokeStyle(t){return this.gC(t),this}getPositiveFillStyle(){return this.dC()}getNegativeFillStyle(){return this.yl()}getPositiveStrokeStyle(){return this.pC()}getNegativeStrokeStyle(){return this.mC()}attach(t,e=!0){return ce(t,this.Ji,{fill:this.$k,fill2:this.jk,behavior:{colorStep:!0}}),super.attach(t,e)}}const Md={Positive:xd,Negative:bd,Bipolar:vd},Ad=(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 Td extends yd{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.bs="Area Range Series",this.$x=Ad;const c=u;this.$k=ye(this.Ji.areaRangeSeriesFillStyle,c),this.aC=ye(this.Ji.areaRangeSeriesStrokeStyle,c),this.jk=ye(this.Ji.areaRangeSeriesFillStyleInverted,c),this.lC=ye(this.Ji.areaRangeSeriesStrokeStyleInverted,c)}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.iC(t,i,s);const r=this.Jl[this.Jl.length-1];return this.uM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.P.emit("dataAdd",this,e,this.cM),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.uM?this.uM.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=t.zx(e);if(i)return at(i,this.scale,this.As.ls.ct)},this.uv=a,this.Se=ye(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}ld(){return de(this.Se)}Jv(t){}attach(t,e=!0){return ce(t,this.Ji,{fill:this.Se}),super.attach(t,e)}ke(t,e){t.us(e),this.As.Ss()}setPointFillStyle(t){this.Se="function"==typeof t?t(this.Se):t;const e=this.Se;for(let t=0;tt.getIsUnderMouse())):this.nM,this.Fw,Ne);if(void 0!==i){const t=at(i[0],this.As.ls.ct,this.scale),e=i[1].Th(),s=H(e)?i[0].color?new V({color:i[0].color}):new V({color:e.getFallbackColor()}):e;return ll(t,this.scale,this.$x(new Ja,this,t.x,t.y,t).vc(),this,s)}}solveNearestFromScreen(t){return this.zx(Yo(t,this.Ki.ls),!1)}setCursorResultTableFormatter(t){return super.setCursorResultTableFormatter(t)}}class Ed{constructor(t,e,i,s){this.TC=!1,this.P=new r.Eventer,this.chart=i,this.FC=s,this.Hs=t.Hs,this.Ks=s||Fs,this.IC=xt.document.createElement("div"),this.IC.style.position="absolute",this.IC.style.pointerEvents="none",xt.document.body.append(this.IC);const n=()=>{const t=i.engine.container.getBoundingClientRect();this.IC.style.left=`${t.left}px`,this.IC.style.top=`${t.top}px`,this.IC.style.width=`${t.width}px`,this.IC.style.height=`${t.height}px`};n(),i.onResize(n),this.PC(this.IC),this.DC(),this.BC(),this.OC(),this.LC(e),this.chart.RC().push(this)}PC(t){this.EC=xt.document.createElement("div"),this.EC.style.pointerEvents="all",t.append(this.EC),this.zC=xt.document.createElement("div"),this.VC=new Ms(this.Hs,this.Ks,this.chart,this.zC),this.NC=xt.document.createElement("table"),this.NC.style.borderSpacing="0",this.EC.appendChild(this.VC.he()),this.EC.appendChild(this.zC),this.zC.appendChild(this.NC)}BC(){let t=0,e=0,i=0,s=0,r=!1;this.TC=!1,this.EC.onmousedown=n=>{n=n||xt.event,i=n.clientX,s=n.clientY,r=!0,xt.document.onmouseup=t=>{this.TC?this.EC.addEventListener("click",Zt,!0):this.EC.removeEventListener("click",Zt,!0),r=!1,this.TC=!1,xt.document.onmouseup=null,xt.document.onmousemove=null},xt.document.onmousemove=n=>{n=n||xt.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.TC=!0,this.EC.style.top=this.EC.offsetTop-e+"px",this.EC.style.left=this.EC.offsetLeft-t+"px",this.EC.style.removeProperty("right"),this.EC.style.removeProperty("bottom"))}}}OC(){let t=0,e=0,i=0,s=0,r=!1;this.EC.ontouchstart=n=>{n=n||xt.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.EC.ontouchend=()=>{r=!1,xt.document.ontouchend=null,xt.document.ontouchmove=null},this.EC.ontouchmove=n=>{r&&(Zt(n),n=n||xt.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.EC.style.top=this.EC.offsetTop-e+"px",this.EC.style.left=this.EC.offsetLeft-t+"px",this.EC.style.removeProperty("right"),this.EC.style.removeProperty("bottom"))}}}DC(){this.EC.style.setProperty("top","10px"),this.EC.style.setProperty("left","10px"),this.EC.style.position="absolute",this.EC.style.display="flex",this.EC.style.alignItems="flex-start",this.zC.style.setProperty("display","none")}removePositionProperty(){this.EC.style.removeProperty("top"),this.EC.style.removeProperty("left"),this.EC.style.removeProperty("bottom"),this.EC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.EC.style.setProperty("bottom","10px"),this.EC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.EC.style.setProperty("top","10px"),this.EC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.EC.style.setProperty("bottom","10px"),this.EC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.EC.style.setProperty("top","10px"),this.EC.style.setProperty("right","10px")}}LC(t){for(let e=0;et.addRow(e.getName()).addRow("X:","",e.axisX.formatValue(i.x)).addRow("Y:","",e.axisY.formatValue(i.y)).addRow("Intensity:","",i.intensity.toFixed(1));class Cd 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.bs="Heatmap Grid Series",this.$x=Id,this.qb=!1,this.HC=a,this.Ji=l;const d=c;this.Se=ye(l.heatmapGridSeriesFillStyle,d),this.lu=ye(this.Ji.heatmapGridSeriesWireframeStyle,d);const f=a.start||{x:0,y:0},g=a.end?{x:(a.end.x-f.x)/a.columns,y:(a.end.y-f.y)/a.rows}:a.step||{x:1,y:1},y={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows,start:f,step:g};this._n=y,this.UC=this.As.$C(this.scale,[],y).Me(this.Se).uu(this.lu).us(this.getHighlight()),this.cs(this.UC),this.setHighlightOnHover(!1)}clear(){return this.UC.Ha(),this.As.Ss(),this.P.emit("dataClear",this),this}setWireframeStyle(t){return this.lu="function"==typeof t?t(this.lu):t,this.UC.uu(this.lu),this.As.Ss(),this.P.emit("styleChange",this),this}getWireframeStyle(){return this.lu}setCursorInterpolationEnabled(t){return this.qb=t,this.As.ls.Ss(),this}getCursorInterpolationEnabled(){return this.qb}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.UC.uS(t),this.As.Ss(),this.P.emit("styleChange",this),this}getIntensityInterpolation(){return this.UC.cS()}Xm(){return this.Km&&this.getVisible()}ld(){return de(this.Se)}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se}),this}jC(t){this.UC.jC().forEach((e=>{t.UC.dS(e)}))}xM(t){return this.P.off(t)}SM(t){return this.P.on("dataClear",t)}YC(t){return this.P.on("styleChange",t)}XC(t){return this.P.off(t)}zx(t,e,i=this.qb){const s=at(t,this.As.ls.ct,this.scale),r=e?this.UC.getIsUnderMouse()?this.UC:void 0:this.UC;if(!r)return;const n=i?r.tv(s):r.zx(s);return n?ll(n,this.scale,this.$x(new Ja,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).vc(),this):void 0}solveNearestFromScreen(t,e=this.qb){return this.zx(Yo(t,this.Ki.ls),!1,e)}getXMax(){const t=this.UC;return t?t._t():void 0}getXMin(){const t=this.UC;return t?t.Mt():void 0}getYMax(){const t=this.UC;return t?t.wt():void 0}getYMin(){const t=this.UC;return t?t.At():void 0}ur(){const t=u(0,0);return t.x=Math.max(t.x,this.UC.sl()),t.y=Math.max(t.y,this.UC.el()),t}Jv(t){if(!(t instanceof _i))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof _i&&t.ni())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}ke(t,e){t.us(e),this.As.Ss()}Ae(){return super.Ae(),this.UC.ko(this.getBoundaries()),this}}class kd extends Cd{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.$x=Id}invalidateIntensityValues(t){if(Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this._n.dataOrder?t.length:t[0].length,rows:"rows"===this._n.dataOrder?t.length:t[0].length},i="columns"===this._n.dataOrder?this._n.columns:this._n.rows,s="columns"===this._n.dataOrder?this._n.rows:this._n.columns;if(e.x>i||e.y>s){if(!0===this.chart.ff.Pn){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this._n.columns}x${this._n.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;xt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.ff.Pn){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this._n.columns}x${this._n.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.`;xt.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.UC.dS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.P.emit("invalidateIntensity",this,t),this.As.Ss(),this}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.UC.Me(this.Se),this.P.emit("styleChange",this),this.As.Ss(),this}getFillStyle(){return this.Se}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}ZC(t){return this.P.on("invalidateIntensity",t)}KC(t){return this.P.off(t)}}class Pd 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.bs="Scrolling Heatmap Grid Series",this.$x=Id,this.qb=!1;const d=c;this.Se=ye(l.heatmapScrollingGridSeriesFillStyle,d),this.lu=ye(this.Ji.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",start:{x:0,y:0},step:{x:1,y:1},...a};this._n=f;const g=[{type:"DataPattern",args:{pattern:"columns"===f.scrollDimension?f.step.x>0?"ProgressiveX":"RegressiveX":f.step.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}];this.qC=this.As.JC(this.scale,g,f).Me(this.Se).uu(this.lu).us(this.getHighlight()),this.cs(this.qC),this.setHighlightOnHover(!1)}clear(){return this.qC.Ha(),this.As.Ss(),this}setWireframeStyle(t){return this.lu="function"==typeof t?t(this.lu):t,this.qC.uu(this.lu),this.As.Ss(),this}getWireframeStyle(){return this.lu}setPixelInterpolationMode(t){return t=t||"disabled",this.qC.uS(t),this.As.Ss(),this}getPixelInterpolationMode(){return this.qC.cS()}setCursorInterpolationEnabled(t){return this.qb=t,this.As.ls.Ss(),this}getCursorInterpolationEnabled(){return this.qb}setCursorEnabled(t){return super.setCursorEnabled(t)}setDataCleaning(t){return this.qC.tu(t),this.As.Ss(),this}Xm(){return this.Km&&this.getVisible()}ld(){return de(this.Se)}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se}),this}Me(t){return this.Se="function"==typeof t?t(this.Se):t,this.qC.Me(this.Se),this.As.Ss(),this}zx(t,e,i=this.qb){const s=at(t,this.As.ls.ct,this.scale),r=e?this.qC.getIsUnderMouse()?this.qC:void 0:this.qC;if(!r)return;const n=i?r.tv(s):r.zx(s);return n?ll(n,this.scale,this.$x(new Ja,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).vc(),this):void 0}solveNearestFromScreen(t,e=this.qb){return this.zx(Yo(t,this.Ki.ls),!1,e)}Jv(t){if(!(t instanceof _i))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof _i&&t.ni())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.qC._t()||0}getXMin(){return this.qC.Mt()||0}getYMax(){return this.qC.wt()||0}getYMin(){return this.qC.At()||0}ur(){const t=u(0,0);return t.x=Math.max(t.x,this.qC.sl()),t.y=Math.max(t.y,this.qC.el()),t}ke(t,e){t.us(e),this.As.Ss()}}class Fd extends Pd{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.$x=Id}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this._n.scrollDimension?t.length:t[0].length,"rows"===this._n.scrollDimension?t.length:t[0].length,0+i-1),r=this._n.resolution-1;if(s>r){if(!0===this.chart.ff.Pn){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this._n.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;xt.console.warn(t)}const s=[];for(let i=0;i(e,i)=>t.forEach((t=>t.forEach((t=>{t.ct.q(e),t.og.q(i)})))),_d=(t,e)=>{const i=t.indexOf(e);-1!==i&&t.splice(i,1)},Ld=u(10,10);var Dd;e.AxisPosition=void 0,(Dd=e.AxisPosition||(e.AxisPosition={}))[Dd.Top=0]="Top",Dd[Dd.Bottom=1]="Bottom",Dd[Dd.Left=2]="Left",Dd[Dd.Right=3]="Right";const zd=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),Od=t=>t.cr(),Rd=t=>t.setStopped(!0),Vd=t=>t.getChartInteractionFitByDrag()?t.fit(!0).setStopped(!1):void 0,Nd=(t,e)=>{const i="linear-highPrecision"===t.xh.type||"linear-highPrecision"===e.xh.type,s="logarithmic"===t.xh.type||"logarithmic"===e.xh.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.xh.type}, y: ${e.xh.type})`;throw new Error(i)}};var Gd,Hd,Ud;!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"}(Gd||(Gd={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(Hd||(Hd={}));class Wd extends Sl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.hp("chartXY bg",0),r,i.ls.Ji.chartXYBackgroundFillStyle,i.ls.Ji.chartXYBackgroundStrokeStyle,i.ls.Ji.chartXYTitleFont,i.ls.Ji.chartXYTitleFillStyle,h),this.QC=this.Ug.d2({scaleXYConstructor:_i}),this.tT=[],this.iT=[],this.sT=[],this.eT=[],this.hT=new Map,this.rT=!0,this.nT=!0,this.oT=!0,this.zd=2,this.aT=!0,this.lT=!0,this.uT=[],this.cT=this.np._e(this.QC).Me(z).ve(st).setMouseInteractions(!1),this.dT=this.np.De(this.QC).Pe(st).setMouseInteractions(!1),this.fT=this.np.De(this.QC).Pe(st).setMouseInteractions(!1),this.gT=this.Ji.chartXYZoomingRectangleFillStyle,this.pT=this.Ji.chartXYZoomingRectangleStrokeStyle,this.mT=this.Ji.chartXYFittingRectangleFillStyle,this.yT=this.Ji.chartXYFittingRectangleStrokeStyle,this.ST=e.MouseStyles.Default,this.xT=e.MouseStyles.Move,this.bT=e.MouseStyles.ZoomIn,this.vT=e.MouseStyles.Default,this.MT=void 0,this._T=Xd,this.qv=0,this.AT=Bd(this.iT,this.tT),this.wT=Bd(this.sT,this.eT),this.kT=(t,e,i,s,r)=>{this.AT(s,r),this.wT(r,s),this.QC.q(s,r);const n=this.iT.map((t=>t.Dg())),o=this.tT.map((t=>t.Dg())),h=this.sT.map((t=>t.Dg())),a=this.eT.map((t=>t.Dg())),l=n.reduce(Oe,0),c=o.reduce(Oe,0),d=h.reduce(Oe,0),f=a.reduce(Oe,0),g=this.CT(d,f,c,l),y=this.QC.x.getCellSize()-(g.left+g.right),m=this.QC.y.getCellSize()-(g.bottom+g.top),p=[g.left,g.right],S=[g.bottom,g.top];this.QC.x.Z(0,y),this.QC.y.Z(0,m),this.QC.Si(p),this.QC.xi(S),this.Fy.q(u(y,m));for(let t=0;t{this.hT.set(t,e)},this.ig=t=>{this.iT.includes(t)?_d(this.iT,t):this.tT.includes(t)?_d(this.tT,t):this.sT.includes(t)?_d(this.sT,t):this.eT.includes(t)&&_d(this.eT,t),this.hT.delete(t),this.ls.Ss()},this.FT=(t=!1)=>{const e=t=>(e,i,s,r)=>(i.Ae(e,s,r.length),e+i.Dg()*t),i=this.iT.reduce(e(-1),0),s=this.tT.reduce(e(1),0),r=this.sT.reduce(e(-1),0),n=this.eT.reduce(e(1),0),o=this.CT(r,n,s,i),h=this.QC.x.getCellSize()-(o.left+o.right),a=this.QC.y.getCellSize()-(o.bottom+o.top),l=[o.left,o.right],c=[o.bottom,o.top];this.QC.x.Z(0,h),this.QC.y.Z(0,a),this.QC.x.zt(l),this.QC.y.zt(c);for(const t of this.iT)t.ct.zt(l);for(const t of this.tT)t.ct.zt(l);for(const t of this.sT)t.ct.zt(c);for(const t of this.eT)t.ct.zt(c);if((!this.ZM||Math.abs(this.ZM.bottom-i)>=4||Math.abs(this.ZM.left-r)>=4||Math.abs(this.ZM.right-n)>=4||Math.abs(this.ZM.top-s)>=4)&&!t)return void this.FT(!0);this.ZM={bottom:i,left:r,top:s,right:n},this.Fy.we(u(0,0)).q(u(h,a)),this.Iy.we(u(0,0)).q(u(h,a));const d=this.getDefaultAxisX(),f=this.getDefaultAxisY();if(!d||!f)return;const g=m(d.ct.Vt(),f.ct.Vt(),d.ct.Gt(),f.ct.Gt());this.hb.kS(g),this.Qf.kS(g),this.tg.kS(g),this.zg&&this.zg();const y=t=>(e,i,s,r)=>(i.Pg(e),e+i.Dg()*t);return this.iT.reduce(y(-1),0),this.tT.reduce(y(1),0),this.sT.reduce(y(-1),0),this.eT.reduce(y(1),0),g},this.addAreaSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();Nd(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Md.Positive)(this,this.Ay,this.hb,e,i,this.IT(e),this.IT(i),this.Yg,s,this.Ji,this.ls.ss,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length);return this.Py(r),r},this.addAreaRangeSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();Nd(e,i);const s=new Td(this,this.Ay,this.hb,e,i,this.IT(e),this.IT(i),this.Yg,this.Ji,this.ls.ss,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length);return this.Py(s),s},this.PT=!1,this.DT=!1,this.Qv=()=>{(this.rT||this.nT)&&(this.MT=this.engine.setMouseStyle(this.ST))},this.tM=()=>{this.PT=!1,this.engine.restoreMouseStyle(this.MT)},this.iM=(t,e,i)=>{var s,r;const n=Lt(null===(s=this.ff.In)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Lt(null===(r=this.ff.In)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.MT);const h=this.np.ls.Ce(e.clientX,e.clientY);i===n&&(this.rT||this.nT)?(this.BT(t,h),Zt(e)):i===o&&this.aT&&(this.MT=this.engine.setMouseStyle(this.xT),this.DT=!0,Zt(e))},this.Qm=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=Lt(null===(n=this.ff.In)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=Lt(null===(o=this.ff.In)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.rT||this.nT)?(this.OT(t,s,h),Zt(e)):i===l&&this.aT&&(this.LT(si(r,-1)),Zt(e)),this.ls.Ss()},this.sM=(t,e,i,s)=>{var r,n;const o=Lt(null===(r=this.ff.In)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=Lt(null===(n=this.ff.In)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.rT||this.nT)){const i=u(e.clientX,e.clientY);this.RT(t,s,i),Zt(e)}else i===h&&this.aT&&Zt(e);this.engine.restoreMouseStyle(this.MT),this.Fy.getIsUnderMouse()&&(this.MT=this.engine.setMouseStyle(this.ST)),this.PT=!1,this.DT=!1},this.Jm=(t,e)=>{if(this.oT){const t=this.np.ls.Ce(e.clientX,e.clientY);this.ET(t,u(me(e),me(e))),Zt(e)}},this.zT=(t,e,i,s)=>{},this.VT=(t,e,i,s,r,n)=>{if(this.aT){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.LT(t),Zt(n),this.DT=!0}if(this.oT){const t=this.engine.clientLocation2Engine(e.x,e.y),o=this.engine.clientLocation2Engine(i.x,i.y),h=ni(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.dt(t.ct.Jt(t.getInterval().start,-h.x),t.ct.Jt(t.getInterval().end,h.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.dt(t.ct.Jt(t.getInterval().start,-h.y),t.ct.Jt(t.getInterval().end,h.y),!1,!0,"interactionZoom")})),Zt(n),this.PT=!0}},this.NT=(t,e,i,s)=>{this.DT=!1,this.PT=!1},this.GT=(t,e,i)=>{(this.nT||this.rT)&&(this.BT(t,e),Zt(i))},this.WT=(t,e,i,s,r)=>{(this.nT||this.rT)&&(this.OT(t,e,i),Zt(r))},this.HT=(t,e,i,s)=>{(this.nT||this.rT)&&(this.RT(t,e,i),Zt(s))},this.ff.wn||this.ff.An||this.ls.Mn(0),this.setPadding({right:24}),this.WM=i.OS("chartXY series bg",Gd.seriesBackground),this.UT=[Gd.gridLine0,Gd.gridLine1,Gd.gridLine2].map((t=>i.OS(`chartXY gridline #${t}`,t))),this.Qf=i.OS("chartXY highlighters below",Gd.highlightersBelow),this.hb=i.Hp("chartXY plotting",Hd.plotting),this.tg=i.Hp("chartXY highlighters above",Hd.highlightersAbove),this._f=i.Hp("chartXY fg",Hd.fg),this.QC.x.Z(0,this.uiScale.x.getCellSize()-(this.Ft.left+this.Ft.right+this.Qo.left+this.Qo.right)),this.QC.y.Z(0,this.uiScale.y.getCellSize()-(this.Ft.bottom+this.Ft.top+this.Qo.bottom+this.Qo.top)),this.QC.q(this.uiScale.Ht().x,this.uiScale.Ht().y),this.Fy=this.WM._e(this.QC).Me(this.Ji.chartXYSeriesBackgroundFillStyle).ve(st),this.Iy=this.tg._e(this.QC).Me(z).ve(this.Ji.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Ty(this.Fy,this.Iy),this.setSeriesBackgroundEffect(!1);const a=Lt(o?o.autoCursorBuilder:void 0,Kl);this.Ex=a.Tx(this.Dx,this.QC,this.QC,this.Ji),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.kT),this.ap.Ch("ChartXY"),this.ty=Wi(new Yi(this.GT,this.WT,this.HT,1),new ji(this.zT,this.VT,this.NT)),this.onSeriesBackgroundMouseEnter(this.Qv),this.onSeriesBackgroundMouseLeave(this.tM),this.onSeriesBackgroundMouseWheel(this.Jm),this.onSeriesBackgroundMouseDragStart(this.iM),this.onSeriesBackgroundMouseDrag(this.Qm),this.onSeriesBackgroundMouseDragStop(this.sM),this.onSeriesBackgroundTouchStart(this.ty.onTouchStart),this.onSeriesBackgroundTouchMove(this.ty.onTouchMove),this.onSeriesBackgroundTouchEnd(this.ty.onTouchEnd),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.ep(n,this.QC)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.My}getMinimumSize(){const t={x:0,y:0};t.x+=this.Ft.left+this.Ft.right+this.Qo.left+this.Qo.right,t.y+=this.Ft.top+this.Ft.bottom+this.Qo.top+this.Qo.bottom;const e=this.ap.Ts().Ic(),i=b(Yd(this._T||Xd),this.rp);t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom;const s={x:0,y:0};return this.forEachAxisX((t=>{s.x=Math.max(s.x,t.Dg())})),this.forEachAxisY((t=>{s.y=Math.max(s.y,t.Dg())})),t.x+=s.x,t.y+=s.y,t.x+=Ld.x,t.y+=Ld.y,t}addChartMarkerXY(t=Zl,e,i){const s=this.Yg(),r=new su(s,this.uiScale,e||this.getDefaultAxisX(),i||this.getDefaultAxisY(),t,this.Wg(s),this.Ji);return this.tp(r),r}addAxisX(t){const{opposite:e,type:i}=jo(t);let s;s="linear"===i.type?this.Ug.d1({dimension:"x",scale1DConstructor:Pi}):"linear-highPrecision"===i.type?this.Ug.d1({dimension:"x",scale1DConstructor:Pi}).ri():this.Ug.d1({dimension:"x",scale1DConstructor:vi}).Kt(i.base),s.q(this.QC.x.Ht());const r=e?this.tT:this.iT,n=new Ko(this.Qf,this.UT,this._f,this.np,this.Qf,this.tg,this.ls.ss,s,this.QC.y,(o=()=>n.Ag(),{...Zo,...lc(o)}),this,e?100:0,this.ig,this.TT,this.Ji,!this.Ze,i);var o;return r.push(n),this.ls.Ss(),n}addAxisY(t){const{opposite:e,type:i}=jo(t);let s;s="linear"===i.type?this.Ug.d1({dimension:"y",scale1DConstructor:Pi}):"linear-highPrecision"===i.type?this.Ug.d1({dimension:"y",scale1DConstructor:Pi}).ri():this.Ug.d1({dimension:"y",scale1DConstructor:vi}).Kt(i.base),s.q(this.QC.y.Ht());const r=e?this.eT:this.sT,n=new Ko(this.Qf,this.UT,this._f,this.np,this.Qf,this.tg,this.ls.ss,s,this.QC.x,(o=()=>n.Ag(),{...Qo,...uc(o)}),this,e?100:0,this.ig,this.TT,this.Ji,!this.Ze,i);var o;return r.push(n),this.ls.Ss(),n}dispose(){return this.WM.G(),this.hb.G(),this._f.G(),this.UT.forEach((t=>t.G())),this.tg.G(),this.Qf.G(),this.RC().forEach((t=>t.dispose())),zh(this.QC),this.forEachAxis((t=>{t.dispose()})),this.My.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){return this.iT[0]?this.iT[0]:this.tT[0]}getDefaultAxisY(){return this.sT[0]?this.sT[0]:this.eT[0]}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):zd;return kt(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.tT;case e.AxisPosition.Bottom:return this.iT;case e.AxisPosition.Left:return this.sT;case e.AxisPosition.Right:return this.eT}})))}$T(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.iT.slice().forEach(t),this.tT.slice().forEach(t)}forEachAxisY(t){this.sT.slice().forEach(t),this.eT.slice().forEach(t)}setTitlePosition(t){return this._T=t,this.ls.Ss(),this}getTitlePosition(){return this._T}CT(t,e,i,s){const r=this._T||Xd;let n,o=b(Yd(r),this.rp);this.getTitleFillStyle()===z||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.ap.Ts().Ic();const h=Math.abs(s)+this.Qo.bottom+this.Ft.bottom,a=Math.abs(i)+this.Qo.top+this.Ft.top,l={left:Math.abs(t)+this.Qo.left+this.Ft.left,right:Math.abs(e)+this.Qo.right+this.Ft.right,top:a,bottom:h},u=this.uiScale.Ai(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=jd(r,u,l,n,o,this.Qo);return this.ap.we(f).ga(c).ma(d),g}Ae(t){super.Ae(t);for(const t of this.My)t.ey();for(const t of this.My)t.Ae();this.forEachAxis(Od);let e=!1;this.forEachAxis((t=>{(t.mr()||t.yr())&&(e=!0)}));const i=this.PT||this.DT||!this.lT&&e;this.Vx(i),this.FT(),super.sp();for(const t of this.My)t.om()}Y(){for(let t=0;t=10;n&&a&&o.x===s.x&&this.rT?(this.PT=!0,this.cT.Me(this.gT).ve(this.pT),this.dT.Pe(st),this.fT.Pe(st),this.MT=this.engine.setMouseStyle(this.bT,this.MT)):n&&a&&h.x===s.x&&this.nT?(this.PT=!0,this.cT.Me(this.mT).ve(this.yT),this.dT.Pe(this.yT).Oe(s).Be(r),this.fT.Pe(this.yT).Oe(u(s.x,r.y)).Be(u(r.x,s.y)),this.MT=this.engine.setMouseStyle(this.vT,this.MT)):(this.PT=!1,this.cT.ve(st).Me(z),this.dT.Pe(st),this.fT.Pe(st),this.engine.restoreMouseStyle(this.MT)),this.ls.Ss()}RT(t,e,i){if(this.PT){const t=at(this.engine.clientLocation2Engine(i.x,i.y),this.np.ls.ct,this.QC),s=Ve(t.x,this.QC.x.getInnerStart(),this.QC.x.getInnerEnd())&&Ve(t.y,this.QC.y.getInnerStart(),this.QC.y.getInnerEnd()),r=i.x>=e.x?"zoom":"fit",n=this.cT.ca(),o=ri(n,this.cT.Ht()),h=Math.min(this.cT.Ht().x,this.cT.Ht().y)>=10;s&&h&&"zoom"===r&&this.rT?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=at(n,this.QC,t.ag).x,i=at(o,this.QC,t.ag).x;t.dt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=at(n,this.QC,t.ag).y,i=at(o,this.QC,t.ag).y;t.dt(e,i,!0,!0,"interactionSetInterval")}}))):s&&h&&"fit"===r&&this.nT&&this.forEachAxis(Vd)}this.cT.ve(st).Me(z),this.dT.Pe(st),this.fT.Pe(st),this.ls.Ss()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}LT(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(Rd),this.forEachAxisX((i=>{i.zoom(i.ct.ot(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.ct.ot(t.y),e.y)}))}ET(t,e){this.forEachAxis(Rd),this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&i.zoom(i.ct.ot(t.x),e.x)})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&i.zoom(i.ct.ot(t.y),e.y)}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}Sd(){const t=[];return this.forEachAxis((e=>e.bg((e=>t.push(e))))),super.Sd().concat(t)}RC(){return this.uT}fe(){return this.up(this.hb)}setAutoCursorEnabledDuringAxisAnimation(t){return this.lT=t,this}getAutoCursorEnabledDuringAxisAnimation(){return this.lT}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,r=e,n=th(r)?r:Ri(r)?this.pixelScale:void 0;if(n&&zi(i)){const t=at(s,n,this.engine.scale);return this.ls.fo({engineX:t.x,engineY:t.y})}if(n&&Ri(i))return at(s,n,this.pixelScale);if(n&&th(i))return at(s,n,i)}else{const i=t;if(Ri(e)){const t=this.ls.do(i);return at({x:t.engineX,y:t.engineY},this.engine.scale,this.pixelScale)}if(th(e)){const t=e,s=this.ls.do(i);return at({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,(Ud=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",Ud.RightTop="right-top",Ud.LeftTop="left-top",Ud.CenterBottom="center-bottom",Ud.RightBottom="right-bottom",Ud.LeftBottom="left-bottom",Ud.SeriesCenterTop="series-center-top",Ud.SeriesRightTop="series-right-top",Ud.SeriesLeftTop="series-left-top",Ud.SeriesCenterBottom="series-center-bottom",Ud.SeriesRightBottom="series-right-bottom",Ud.SeriesLeftBottom="series-left-bottom";const Xd=e.ChartXYTitlePositionOptions.CenterTop,Yd=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 Me(0,`Unexpected ChartXY title position selection ${t}`)},jd=(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 Me(0,`Unexpected ChartXY title position selection ${t}`)},Jd=t=>t instanceof uu||t instanceof pd||t instanceof Td||t instanceof kd||t instanceof ld||t instanceof Nc;class $d{constructor(t,i,s,n,o,h,a,l,u){this.coordsRelative="relative",this.coordsClient="client",this.P=new r.Eventer,this.jT=new Map,this.My=new Map,this.YT=({series:t},e)=>{this.XT&&(e instanceof Td||e instanceof Nc||e instanceof kd||e instanceof uu||e instanceof pd||e instanceof ld)&&this.XT(t,e)},this.ZT=t=>{const e=t.map((t=>t.xh.type));if(1!==[...new Set(e)].length)throw new Error("All ZoomBandChart axes must be of the same type")},this.KT=(t,e,i)=>{0!==this.My.size&&void 0!==[...this.My.values()].find((({series:t})=>!0===t.getVisible()))||this.qT.dt(e,i,!1,!1,"zoomBandChart")},this.ff=t,this.JT=n,this.attachedAxes=Array.isArray(o)?o:[o],this.ZT(this.attachedAxes);const c=this.attachedAxes[0].chart.$T(this.attachedAxes[0])||"x";this.QT=c,this.fc="x"===c?Zo:Qo;const d=this.attachedAxes[0].onIntervalChange(this.KT);this.tF=()=>this.attachedAxes[0].offIntervalChange(d);const f=this.fc.toVec2("linear"===(g=this.attachedAxes[0].xh).type||"linear-highPrecision"===g.type?g:{type:"logarithmic",base:"number"==typeof g.base?g.base:"e"===g.base?"e":(()=>{throw new Error(`Unhandled logarithmic base: ${g.base}`)})()},void 0);var g;const y=f.x,m=f.y;this.iF=new Wd(t,i,s,Et,a,{...l,defaultAxisX:y,defaultAxisY:m},u).setTitle("Zoom Band Chart").setMouseInteractions(!1).setAutoCursorMode(e.AutoCursorModes.disabled),this.engine=this.iF.engine;const p=this.iF.getDefaultAxisX().setMouseInteractions(!1),S=this.iF.getDefaultAxisY().setMouseInteractions(!1);this.qT=this.fc.getWidth({x:p,y:S}).setScrollStrategy(zs.fitting).setAnimationScroll(!1),this.sF(this.fc.getHeight({x:p,y:S})),this.qT.Eh(this.attachedAxes[0].Rh()),this.band=this.qT.addBand(h),this.eF(this.band,this.attachedAxes);for(let t=0;t{t.chart.Ox(((t,e)=>{("x"===c?e.axisX:e.axisY)===this.attachedAxes[0]&&Jd(e)&&this.sf(e)})),t.chart.Lx(((t,e)=>{var i;if(this.My.has(e)){const t=null===(i=this.My.get(e))||void 0===i?void 0:i.series;t&&t.dispose()}}))}))}disposeSeries(t){const e=this.My.get(t);if(e){const{clearReferences:i}=e;i(),this.My.delete(t),e.series.dispose();const s=this.fc.getHeight({x:t.axisX,y:t.axisY}),r=this.jT.get(s);r&&0===r.Ag().length&&r!==this.fc.getHeight({x:this.iF.getDefaultAxisX(),y:this.iF.getDefaultAxisY()})&&(this.jT.delete(s),r.dispose())}return this}setSeriesStyle(t){return this.XT=t,this.My.forEach(this.YT),this}getDefaultAxisX(){return this.iF.getDefaultAxisX()}getDefaultAxisY(){return this.iF.getDefaultAxisY()}sF(t){t.setTickStrategy(Os.Empty).setMouseInteractions(!1).setNibStyle(st).setStrokeStyle(st)}eF(t,e){t.setValueStart(e[0].getInterval().start).setValueEnd(e[0].getInterval().end);let i,s,r=!1,n=!1;e.length>1&<(...e),e[0].onIntervalChange(((e,i,o)=>{if(r)return;n=!0;const h=xt.performance.now();s=h,t.setValueStart(i).setValueEnd(o),requestAnimationFrame((()=>requestAnimationFrame((()=>{s!==h||(n=!1)}))))})),t.onValueChange(((t,s,o)=>{if(n)return;r=!0;const h=xt.performance.now();i=h,e[0].dt(s,o,!1,!0,"zoomBandChart"),requestAnimationFrame((()=>requestAnimationFrame((()=>{i!==h||(r=!1)}))))}))}sf(t){var e;const i=this.fc.getHeight({x:t.axisX,y:t.axisY});let s=this.jT.get(i);s||(0===this.jT.size?s=this.fc.getHeight({x:this.iF.getDefaultAxisX(),y:this.iF.getDefaultAxisY()}):(s=this.fc.getHeight({x:this.iF.addAxisX.bind(this.iF),y:this.iF.addAxisY.bind(this.iF)})(),this.sF(s))),this.jT.set(i,s);const r=this.fc.getWidth({x:this.qT,y:s}),n=this.fc.getHeight({x:this.qT,y:s});let o,h;if(t instanceof Td){o=this.iF.addAreaRangeSeries({xAxis:r,yAxis:n});const e=o;e.add(t.pM());const i=t.mM(((t,i,s)=>e.add(i))),s=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.yM(i),t.offVisibleStateChanged(s)}}else if(t instanceof Nc){const e=t.zw;o=this.iF.addStepSeries({mode:e,xAxis:r,yAxis:n});const i=o;i.add(t.pM());const s=t.mM(((t,e,s)=>i.add(e))),a=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.yM(s),t.offVisibleStateChanged(a)}}else if(t instanceof kd){const e={...t.HC,xAxis:void 0,yAxis:void 0},i=this.iF.addHeatmapGridSeries(e);o=i;const s=()=>{i.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};s();const r=t.YC(s);t.jC(i);const n=t.ZC(((t,e)=>{i.invalidateIntensityValues(e)})),a=t.onVisibleStateChanged(((t,e)=>{i.setVisible(e)}));h=()=>{t.XC(r),t.KC(n),t.offVisibleStateChanged(a)}}else{const i={};t instanceof Gc&&(i.dataPattern=null===(e=t._n)||void 0===e?void 0:e.dataPattern);const r=this.iF.addLineSeries({...i,xAxis:this.fc.getWidth({x:this.qT,y:s}),yAxis:this.fc.getHeight({x:this.qT,y:s})});if(o=r,t instanceof ld){const e=t=>{const e=[],i=t.length;for(let s=0;s{r.add(e(i))})),s=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.yM(i),t.offVisibleStateChanged(s)}}else{r.add(t.pM());const e=t.mM(((t,e)=>r.add(e))),i=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.yM(e),t.offVisibleStateChanged(i)}}}t.onHighlight(((t=!0)=>{o.setHighlight(t)})),o.setMouseInteractions(!1),this.YT({series:o},t);const a=t.SM((()=>{o.clear()})),l=h;h=()=>{t.xM(a),l()},this.My.set(t,{series:o,clearReferences:h})}getSizePixels(){return this.iF.getSizePixels()}onResize(t){return this.iF.onResize(((e,i,s,r,n)=>t(this,i,s,r,n)))}offResize(t){return this.iF.offResize(t)}xa(t){this.iF.xa(t)}getMinimumSize(){return this.iF.getMinimumSize()}Y(){return this.iF.Y()}X(){return this.iF.X()}Ae(t){const e=Array.from(new Set(this.attachedAxes.map((t=>t.chart))).values());if("x"===this.QT){const t=e.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=0===t.hg?t.Dg():0})),Math.max(t,i)}),0),i=e.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=100===t.hg?t.Dg():0})),Math.max(t,i)}),0),s=e.reduce(((t,e)=>Math.max(t,e.getPadding().left)),0),r=e.reduce(((t,e)=>Math.max(t,e.getPadding().right)),0);this.getDefaultAxisY().setThickness(t),this.iF.setPadding({left:s,right:r+i})}else{const t=e.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=0===t.hg?t.Dg():0})),Math.max(t,i)}),0),i=e.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=100===t.hg?t.Dg():0})),Math.max(t,i)}),0),s=e.reduce(((t,e)=>Math.max(t,e.getPadding().bottom)),0),r=e.reduce(((t,e)=>Math.max(t,e.getPadding().top)),0);this.getDefaultAxisX().setThickness(t),this.iF.setPadding({bottom:s,top:r+i})}return this.iF.Ae(t)}getTheme(){return this.iF.getTheme()}setTitle(t){return this.iF.setTitle(t),this}getTitle(){return this.iF.getTitle()}setTitleFillStyle(t){return this.iF.setTitleFillStyle(t),this}getTitleFillStyle(){return this.iF.getTitleFillStyle()}setTitleFont(t){return this.iF.setTitleFont(t),this}getTitleFont(){return this.iF.getTitleFont()}setTitleMargin(t){return this.iF.setTitleMargin(t),this}getTitleMargin(){return this.iF.getTitleMargin()}setPadding(t){return this.iF.setPadding(t),this}getPadding(){return this.iF.getPadding()}setBackgroundFillStyle(t){return this.iF.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.iF.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.iF.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.iF.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return Lh(t,e,i,this.iF.pixelScale,this.iF.ls)}addUIElement(t,e){return this.iF.addUIElement(t,e)}addLegendBox(t,e){return this.iF.addLegendBox(t,e)}saveToFile(t,e,i){return this.iF.saveToFile(t,e,i),this}dispose(){return this.iF.dispose(),this.band.dispose(),this.jT.clear(),this.My.clear(),this.JT(this),this}onDispose(t){return this.iF.onDispose((()=>t(this)))}offDispose(t){return this.iF.offDispose(t)}}const qd=(t,e)=>{const i=Math.floor(99999/e),s=Math.floor(99999/e),r=Math.floor(99998/e),n=Math.floor(99999/(e+1)),o=Math.floor(89999/(e+1)),h=410001+e*o;let a=0;return{hF:()=>{const e=t.rF("dashboard ui",h+a);return a+=1,e},nF:()=>t.rF("dashboard legend",41e4),oF:e=>{const h=1+e*i,a=100001+e*s,l=200002+e*r,u=300001+e*n,c=410001+e*o;let d=0;return{ls:t,hp:(e,i)=>{const s=h+i;return t.rF(e,s)},OS:(e,i)=>{const s=a+i;return t.rF(e,s)},Hp:(e,i)=>{const s=l+i;return t.rF(e,s)},BS:(e,i,s)=>{const r=l+i;return t.aF(e,r,s)},op:(e,i)=>{const s=u+i;return t.rF(e,s)},Xg:e=>{const i=c+d,s=t.rF(e,i);return d+=1,s},Kg:()=>t.rF("panel legend",400002+e),Bx:()=>t.rF("panel cursor",500001+e)}}}};class Kd{constructor(t){this.P=new r.Eventer,this.u=t}S(t){return this.u=t,this.P.emit("set",t),this}M(){return this.u}R(t){return this.P.on("set",t)}N(t){return this.P.off(t,"set")}}const Zd={Ke:!1,qe:0,Je:!1,th:0,Qe:!1,ih:0,sh:0,je:zs.fitting},Qd=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))},tf=(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&&uf(t,e,u,n,o,h),"spark-bar"===a&&cf({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&cf({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&df(t,e,u,n,o,h),"spark-pie"===a&&ff(t,e,u,n,o,h)},ef=(t,e,i,s)=>({x:rf(t.x,e.x,i.x,s),y:nf(t.y,e.y,i.y,s)}),sf=(t,e,i,s)=>({position:rf(t.position,e.x,i.x,s),high:nf(t.high,e.y,i.y,s),low:nf(t.low,e.y,i.y,s)}),rf=(t,e,i,s)=>{const r=Ct(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},nf=(t,e,i,s)=>{const r=Ct(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},of=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&hf(a,e,i,r,n,o,h),"axis-band"===a.type&&af(a,i,r,n,o,h),"constant-line"===a.type&&lf(a,i,s,r,n,o,h)},hf=(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=ef(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().Ha().za(void 0!==u?u:e.PointShape.Circle).Ph(d||0).q(c||5).Me(l||h.sparkPointChartFillStyle).Wa(f)},af=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(Pe,ke),f=u(Pe,ke);"x"===o&&(d=ef({x:h,y:Pe},e,i,s),f=ef({x:a,y:ke},e,i,s)),"y"===o&&(d=ef({x:Pe,y:h},e,i,s),f=ef({x:ke,y:a},e,i,s));const g=s[0],y=s[1],m=Ct(d.x,g.x,g.x+y.x),p=Ct(d.y,g.y,g.y+y.y),S=Ct(f.x,g.x,g.x+y.x),x=Ct(f.y,g.y,g.y+y.y);r.rect.add().Xa(m).Za(p).q(u(S-m,x-p)).Me(l||n.sparkChartBandFillStyle).ve(c||n.sparkChartBandStrokeStyle).ve(st)},lf=(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=ef(u(g,c),{x:g,y:d},s,r),e=ef(u(y,c),{x:g,y:d},s,r);m.push([t,e])}if("x"===h&&g<=c&&c<=y){const t=ef(u(c,d),{x:g,y:d},s,r),e=ef(u(c,f),{x:g,y:d},s,r);m.push([t,e])}m.length>0&&n.line.add().Pe(l||o.sparkChartConstantLineStrokeStyle).Oe(m[0][0]).Be(m[0][1])},uf=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.Pn&&xt.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=ke,c=Pe,d=ke,f=Pe;for(let t=0;tef(t,{x:u,y:d},g,i)));e.lineSet.add().us(n).Pe(o||s.sparkLineChartStrokeStyle).Ha().Wa(y),a&&of(a,y,{x:u,y:d},{x:c,y:f},g,i,e,s)},cf=(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=ke,S=Pe;if(g)p=-1,S=1;else for(const t of o)p=Math.min(p,t),S=Math.max(S,t);const x={x:0,y:g?-1:Math.min(0,p)},b={x:1*o.length+(o.length-1)*m,y:g?2:Math.max(S,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*m,y:g?t>=y?1:0:t},r=ef({x:1*e+e*m,y:g?t>=y?0:-1:0},x,b,i),n=ef(s,x,b,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).we(t.position).qa(t.height).Ka(t.width).Me((i=t.value,g?(i>=y?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).ve(a||s.sparkBarChartStrokeStyle)}))},df=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.Pn&&xt.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=ke,f=Pe,g=ke,y=Pe;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=ef(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).we(d).Gl(g).Ul(0).Nl(y).Be(y+r).Me(l[i]||ye(s.sparkPieChartFillStyle,i)).ve(h||s.sparkPieChartStrokeStyle),y+=r}))};var gf,yf,mf;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(gf||(gf={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(yf||(yf={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(mf||(mf={}));class pf extends cn{constructor(t,e,i,s,r){super(),this.Fs=!1,this.Gw={x:0,y:0,height:20,width:20},this.lF={x:10,y:10},this.As=t,this.uF=r,this.cF=new Dn(t,e,i,Et,s).setMouseInteractions(!0),this.dF=t.Cc(e,sn.Simple).Me(s.dataGridScrollBarButtonArrowFillStyle).ve(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.ju(this),this.cF.onMouseEnter((t=>t.setHighlight(1))),this.cF.onMouseLeave((t=>t.setHighlight(0)))}fF(){switch(this.uF){case mf.Up:this.dF.tl([{x:this.Gw.x,y:this.Gw.y+this.lF.y/2},{x:this.Gw.x+this.lF.x/2,y:this.Gw.y-this.lF.y/2},{x:this.Gw.x-this.lF.x/2,y:this.Gw.y-this.lF.y/2}]);break;case mf.Down:this.dF.tl([{x:this.Gw.x-this.lF.x/2,y:this.Gw.y+this.lF.y/2},{x:this.Gw.x+this.lF.x/2,y:this.Gw.y+this.lF.y/2},{x:this.Gw.x,y:this.Gw.y-this.lF.y/2}]);break;case mf.Left:this.dF.tl([{x:this.Gw.x-this.lF.x/2,y:this.Gw.y},{x:this.Gw.x+this.lF.x/2,y:this.Gw.y+this.lF.y/2},{x:this.Gw.x+this.lF.x/2,y:this.Gw.y-this.lF.y/2}]);break;case mf.Right:this.dF.tl([{x:this.Gw.x-this.lF.x/2,y:this.Gw.y+this.lF.y/2},{x:this.Gw.x+this.lF.x/2,y:this.Gw.y},{x:this.Gw.x-this.lF.x/2,y:this.Gw.y-this.lF.y/2}])}}we(t){return this.Gw.x=t.x,this.Gw.y=t.y,this}ca(){return u(this.Gw.x,this.Gw.y)}q(t){return this.Gw.height=t.x,this.Gw.width=t.y,this}Ht(){return{x:this.Gw.height,y:this.Gw.width}}onMouseDown(t){return this.cF.onMouseDown(t)}onMouseUp(t){return this.cF.onMouseUp(t)}setFillStyle(t){return this.cF.setFillStyle(t),this}getFillStyle(){return this.cF.getFillStyle()}setStrokeStyle(t){return this.cF.setStrokeStyle(t),this}getStrokeStyle(){return this.cF.getStrokeStyle()}Ae(){return this.cF.Ae(),this.fF(),this}Ts(){return this.cF.setSize(u(this.Gw.height,this.Gw.width)).setPosition(u(this.Gw.x,this.Gw.y)),this}setVisible(t){return this.cF.setVisible(t),this.dF.setVisible(t),this}dispose(){return this.cF.dispose(),this.dF.dispose(),this}setMouseInteractions(t){return this.cF.setMouseInteractions(t),this}getMouseInteractions(){return this.cF.getMouseInteractions()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}getHighlight(){return this.cF.getHighlight()}setHighlight(t){return this.cF.setHighlight(ve(t)),this.P.emit("highlight",Boolean(t)),this.As.Ss(),this}}const Sf=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class xf{constructor(t,i,s,n,o,h,a){this.Bc={x:0,y:0},this.Gw={x:0,y:0,height:0,width:0},this.P=new r.Eventer,this.gF={min:u(0,0),max:u(0,0)},this.Lv=!1,this.Rv=!1,this.pF={x:0,y:0},this.Xu=void 0,this.mF=u(0,0),this.yF={x:0,y:0},this.SF=0,this.xF=15,this.Ev=(t,i)=>{this.Lv=!0,this._f.Ss();const s=this.bF.getDraggingMode();this.Xu=this._f.ls.Tr(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.vF&&clearInterval(this.vF)},this.zv=()=>{this.Lv=!1,this._f.Ss(),this._f.ls.Fr(this.Xu)},this.Vv=t=>(this.Rv=!0,this.pF=at(this._f.ls.Ce(t.x,t.y),this._f.ls.ct,this.scale),!0),this.MF=(t,e)=>(this._F(e),this.vF=setInterval((()=>this._F(e)),300),!0),this.AF=()=>(clearInterval(this.vF),!0),this.Nv=(t,i)=>{const s=this.bF.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=at(this._f.ls.Ce(t.x,t.y),this._f.ls.ct,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?Sf(n.x,this.scale.x):this.Gw.x,r!==e.UIDraggingModes.onlyHorizontal?Sf(n.y,this.scale.y):this.Gw.y),h=u(o.x-this.pF.x,o.y-this.pF.y),a=u(this.bF.getPosition().x+h.x,this.bF.getPosition().y+h.y),l=this.wF(a),c={x:Math.abs(this.mF.x-l.x),y:Math.abs(this.mF.y-l.y)};return this.kF(c),this.yF.y>h.y&&(this.pF=n),this.Ae(),!0}return!1},this.Gv=(t,e)=>{this.Rv=!1,Zt(e),this._f.Ss()},this._f=t,this.Gg=i,this.scale=n,this.contentScale=o,this.CF=a,this.TF=new pf(t,s,n,h,a===gf.UpToDown?mf.Up:mf.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.FF=new pf(t,s,n,h,a===gf.UpToDown?mf.Down:mf.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.bF=new Dn(t,s,n,Et,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===gf.UpToDown?e.UIDraggingModes.onlyVertical:a===gf.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.IF=new Dn(i,s,n,Et,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.bF.onMouseEnter(this.Ev),this.bF.onMouseLeave(this.zv),this.bF.onMouseDragStart(((t,e)=>this.Vv(u(e.clientX,e.clientY))&&Zt(e))),this.bF.onMouseDrag(((t,e)=>this.Nv(u(e.clientX,e.clientY))&&Zt(e))),this.bF.onMouseDragStop(this.Gv),this.bF.onTouchStart(((t,e)=>this.Vv(u(e.clientX,e.clientY))&&Zt(e))),this.bF.onTouchMove(((t,e)=>this.Nv(u(e.clientX,e.clientY))&&Zt(e))),this.bF.onTouchEnd(this.Gv),this.TF.onMouseDown(((t,e)=>this.MF(t,e)&&Zt(e))),this.FF.onMouseDown(((t,e)=>this.MF(t,e)&&Zt(e))),this.TF.onMouseUp(((t,e)=>this.AF()&&Zt(e))),this.FF.onMouseUp(((t,e)=>this.AF()&&Zt(e))),this.IF.onMouseWheel(((t,e)=>this.PF(e))),this.bF.onMouseWheel(((t,e)=>this.PF(e))),this.IF.onMouseDown(((t,e)=>this.MF(t,e)&&Zt(e))),this.IF.onMouseUp(((t,e)=>this.AF()&&Zt(e)))}DF(t){return this.Gw=t,this}Ka(t){return this.Gw.width=t,this}gw(){return this.Gw.width}BF(t){return this.mF=t,this}OF(t){return this.Bc=t,this}LF(){return this.Bc}RF(t){return this.xF=t,this}EF(){return this.CF}zF(t){let e;switch(this.CF){case gf.UpToDown:return e=t>0?Math.min(this.mF.y-this.gF.max.y,this.yF.y+t):Math.max(0,this.yF.y+t),e!==this.yF.y&&(this.kF({x:0,y:e}),this.Ae(),!0);case gf.LeftToRight:return e=Math.min(this.gF.max.x-this.mF.x,this.yF.x+t),e!==this.yF.x&&(this.kF({y:0,x:e}),this.Ae(),!0);default:return!1}}VF(t){let e;switch(this.CF){case gf.UpToDown:return e=Math.max(0,this.yF.y-t),e!==this.yF.y&&(this.kF({x:0,y:e}),this.Ae(),!0);case gf.LeftToRight:return e=t>0?Math.max(0,this.yF.x-t):Math.min(this.gF.max.x-this.mF.x,this.yF.x-t),e!==this.yF.x&&(this.kF({x:e,y:0}),this.Ae(),!0);default:return!0}}NF(t){switch(this.CF){case gf.UpToDown:return this.P.on("scrollY",t);case gf.LeftToRight:return this.P.on("scrollX",t)}return this.P.on("scrollY",t)}wF(t){switch(this.CF){case gf.UpToDown:if(t.y>this.gF.min.y)return u(t.x,this.gF.min.y);if(t.ythis.gF.max.x)return u(this.gF.max.x,t.y)}return t}PF(t){t.deltaY>0&&this.GF()&&Zt(t),t.deltaY<0&&this.WF()&&Zt(t)}_F(t){const e=at(this._f.ls.Ce(t.clientX,t.clientY),this._f.ls.ct,this.scale);let i;const s=this.bF.getPosition(),r=this.bF.getSize();this.HF(e,s,r)?clearInterval(this.vF):(i=this.CF===gf.UpToDown?u(0,e.y-s.y>0?this.xF:-this.xF):u(s.x-e.x>0?this.xF:-this.xF,0),(i.x>0||i.y>0)&&this.UF(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.$F(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}HF(t,e,i){return this.CF===gf.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.Gw.height?Math.min(this.mF.y-this.gF.max.y,this.yF.y+t):0,e!==this.yF.y&&(this.kF({x:0,y:e}),this.Ae(),!0)}case gf.LeftToRight:{const e=Math.min(this.gF.max.x-this.mF.x,this.yF.x+t);return e!==this.yF.x&&(this.kF({y:0,x:e}),this.Ae(),!0)}default:return!1}}WF(){return this.UF(this.xF)}GF(){return this.$F(this.xF)}kF(t){if(t.x===this.yF.x&&t.y===this.yF.y)return;let e;switch(this.yF=t,this.CF){case gf.UpToDown:e=this.yF.y*this.SF*this.contentScale.Ai().y,this.P.emit("scrollY",yf.Vertical,e),this._f.ls.Ss();break;case gf.LeftToRight:e=this.yF.x*this.SF*this.contentScale.Ai().x,this.P.emit("scrollX",yf.Horizontal,e)}}setVisible(t){return this.TF.setVisible(t),this.FF.setVisible(t),this.IF.setVisible(t),this.bF.setVisible(t),this}dispose(){return this.TF.dispose(),this.FF.dispose(),this.IF.dispose(),this.bF.dispose(),this.vF&&clearInterval(this.vF),this}Ts(){switch(this.YF(),this.XF(),this.CF){case gf.UpToDown:this.TF.we({x:this.Gw.x,y:this.Gw.y+this.Gw.height-this.TF.Ht().x/2}).q(u(this.Gw.width,this.Gw.width)).Ts(),this.FF.we({x:this.Gw.x,y:this.Gw.y+10}).q(u(this.Gw.width,this.Gw.width)).Ts(),this.IF.setSize({x:this.Gw.width,y:this.Gw.height-2*this.TF.Ht().x}).setPosition({x:this.Gw.x,y:this.Gw.y+this.FF.Ht().y+this.IF.getSize().y/2}),this.bF.setSize(u(this.Gw.width,this.ZF())),this.mF={x:this.Gw.x,y:this.TF.ca().y-this.TF.Ht().y/2-this.bF.getSize().y/2},this.jF({min:{x:this.Gw.x,y:this.TF.ca().y-this.TF.Ht().y/2-this.bF.getSize().y/2},max:{x:this.Gw.x,y:this.FF.ca().y+this.FF.Ht().x/2+this.bF.getSize().y/2}});break;case gf.LeftToRight:this.TF.we({x:this.Gw.x,y:this.Gw.y}).q(u(this.Gw.height,this.Gw.height)).Ts(),this.FF.we({x:this.Gw.x+this.Gw.width-this.FF.Ht().x,y:this.Gw.y}).q(u(this.Gw.height,this.Gw.height)).Ts(),this.IF.setSize({y:this.Gw.height,x:this.Gw.width-2*this.TF.Ht().y}).setPosition({x:this.Gw.x+this.TF.Ht().x/2+this.IF.getSize().x/2,y:this.Gw.y}),this.bF.setSize(u(this.ZF(),this.Gw.height)),this.mF={x:this.TF.ca().x+this.TF.Ht().x/2+this.bF.getSize().x/2,y:this.Gw.y},this.jF({min:{x:this.TF.ca().x+this.TF.Ht().x/2+this.bF.getSize().x/2,y:this.Gw.y},max:{x:this.FF.ca().x-this.FF.Ht().x/2-this.bF.getSize().x/2,y:this.Gw.y}})}return this.KF(),this}YF(){switch(this.CF){case gf.UpToDown:this.qF()||this.setVisible(!1),this.qF()&&this.setVisible(!0);break;case gf.LeftToRight:this.JF()||this.setVisible(!1),this.JF()&&this.setVisible(!0)}}XF(){switch(this.CF){case gf.UpToDown:this.qF()||this.kF({x:0,y:0});break;case gf.LeftToRight:this.JF()||this.kF({x:0,y:0})}}qF(){return this.Bc.x>this.Gw.height}JF(){return this.Bc.y>this.Gw.width}ZF(){switch(this.CF){case gf.UpToDown:return this.Gw.height*(this.Gw.height-2*this.TF.Ht().x)/this.Bc.x;case gf.LeftToRight:return this.Gw.width*(this.Gw.width-2*this.TF.Ht().y)/this.Bc.y;default:return 0}}KF(){switch(this.CF){case gf.UpToDown:this.SF=(this.Bc.x-this.Gw.height)/(this.gF.min.y-this.gF.max.y);break;case gf.LeftToRight:this.SF=(this.Bc.y-this.Gw.width)/(this.gF.max.x-this.gF.min.x)}}Ae(){switch(this.TF.Ae(),this.FF.Ae(),this.IF.Ae(),this.CF){case gf.UpToDown:this.bF.setPosition({x:this.Gw.x,y:this.TF.ca().y-this.TF.Ht().y/2-this.bF.getSize().y/2-this.yF.y}).Ae();break;case gf.LeftToRight:this.bF.setPosition({y:this.Gw.y,x:this.TF.ca().x+this.TF.Ht().x/2+this.bF.getSize().x/2+this.yF.x}).Ae()}return this}}class bf{constructor(t,e,i,s,r,n,o){switch(this._f=t,this.Gg=e,this.scale=s,this.contentScale=r,o){case yf.Vertical:this.QF=this.tI(i,n,gf.UpToDown);break;case yf.Horizontal:this.iI=this.tI(i,n,gf.LeftToRight);break;case yf.Both:this.QF=this.tI(i,n,gf.UpToDown),this.iI=this.tI(i,n,gf.LeftToRight)}this.sI=Wi(new Yi(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.iI)||void 0===n?void 0:n.VF(s.x))&&Zt(r),0!==s.y&&(null===(o=this.QF)||void 0===o?void 0:o.zF(s.y))&&Zt(r)})))}tI(t,e,i){return new xf(this._f,this.Gg,t,this.scale,this.contentScale,e,i)}gw(){return 20}OF(t){var e,i;return null===(e=this.QF)||void 0===e||e.OF(t),null===(i=this.iI)||void 0===i||i.OF(t),this}eI(t){var e;return null===(e=this.iI)||void 0===e||e.RF(t),this}hI(t){var e;return null===(e=this.QF)||void 0===e||e.RF(t),this}rI(t){const e=this.QF;return e&&e.PF(t),this}nI(t){return this.sI.onTouchStart(this,t),this}oI(t){return this.sI.onTouchMove(this,t),this}aI(t){return this.sI.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.iI)||void 0===e||e.NF(t),null===(i=this.QF)||void 0===i||i.NF(t),this}dispose(){var t,e;return null===(t=this.QF)||void 0===t||t.dispose(),null===(e=this.iI)||void 0===e||e.dispose(),this}Ae(){var t,e;return null===(t=this.QF)||void 0===t||t.Ae(),null===(e=this.iI)||void 0===e||e.Ae(),this}Ts(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.QF)||void 0===t||t.DF({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.iI)||void 0===e||e.DF({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.QF)||void 0===i||i.Ts(),null===(s=this.iI)||void 0===s||s.Ts(),this}}class vf extends Vh{constructor(t,e,i,s,r,n){super(t,e,i,e.hp("dataGrid bg",0),s,e.ls.Ji.dataGridBackgroundFillStyle,e.ls.Ji.dataGridBackgroundStrokeStyle,e.ls.Ji.dataGridTitleFont,e.ls.Ji.dataGridTitleFillStyle,n),this.lI=[],this.uI=[],this.cI=[],this.dI=new Map,this.fI=!0,this.gI=!0,this.pI=!0,this.mI=!0,this.yI=!0,this.SI=!0,this.xI=!0,this.bI=!0,this.vI=!0,this.MI=!0,this._I=!0,this.AI=!0,this.wI=!0,this.kI=!0,this.CI=!0,this.TI=!0,this.FI=new Set,this.II=new Set,this.DI=!0,this.BI=!0,this.OI=(t,e)=>{t.borders=void 0===e?Ef:{...t.borders,...e},this.LI(t),this.AI=!0,this.ls.Ss()},this.LI=t=>{t.borders&&(!1===t.borders.top&&this.RI(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.EI,bottom:!1}})),!1===t.borders.bottom&&this.RI(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.EI,top:!1}})),!1===t.borders.left&&this.RI(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.EI,right:!1}})),!1===t.borders.right&&this.RI(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.EI,left:!1}})),!0===t.borders.top&&this.RI(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.EI,bottom:!0}})),!0===t.borders.bottom&&this.RI(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.EI,top:!0}})),!0===t.borders.left&&this.RI(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.EI,right:!0}})),!0===t.borders.right&&this.RI(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.EI,left:!0}})))},this.zI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseEnter,i,e)},this.VI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseLeave,i,e)},this.NI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseClick,i,e)},this.GI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseDoubleClick,i,e)},this.WI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseDown,i,e)},this.HI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseUp,i,e)},this.UI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseMove,i,e)},this.$I=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseDrag,i,e)},this.jI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseDragStart,i,e)},this.YI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseDragStop,i,e)},this.XI=(t,e)=>{const i=this.dI.get(t);i&&(this.P.emit(Mf.cellMouseWheel,i,e),!e.defaultPrevented&&this.DI&&this.ZI.rI(e))},this.KI=(t,e)=>{const i=this.dI.get(t);i&&(this.P.emit(Mf.cellTouchStart,i,e),!e.defaultPrevented&&this.BI&&this.ZI.nI(e))},this.qI=(t,e)=>{const i=this.dI.get(t);i&&(this.P.emit(Mf.cellTouchMove,i,e),!e.defaultPrevented&&this.BI&&this.ZI.oI(e))},this.JI=(t,e)=>{const i=this.dI.get(t);i&&(this.P.emit(Mf.cellTouchEnd,i,e),!e.defaultPrevented&&this.BI&&this.ZI.aI(e))},this.ff.An||this.ff.kn||this.ls.Mn(2),this.ap.Ch("Data Grid"),this.QI=i.d2({scaleXYConstructor:_i}),this.QI.x.eg=Zd,this.tP=i.d2({scaleXYConstructor:_i}),this.iP={x:0,y:0},this.sP=this.Ji.dataGridTextFont,this.eP=this.Ji.dataGridTextFillStyle,this.EI={top:!0,bottom:!0,left:!0,right:!0},this.hP=this.Ji.dataGridCellBackgroundFillStyle,this.rP=this.Ji.dataGridBorderStrokeStyle,this.nP="left-center",this.oP={left:5,right:5,bottom:5,top:5},this.aP=e.OS("dataGrid grid bg",0),this.lP=e.OS("dataGrid cell bg",1),this.uP=e.Hp("dataGrid cell content",0),this.cP=e.Hp("dataGrid scrollbar bg",1),this.dP=e.Hp("dataGrid scrollbar fg",2),this.ZI=this.fP(),this.onBackgroundMouseWheel(((t,e)=>{this.DI&&this.ZI.rI(e)})),this.onBackgroundTouchStart(((t,e)=>{this.BI&&this.ZI.nI(e)})),this.onBackgroundTouchMove(((t,e)=>{this.BI&&this.ZI.oI(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.BI&&this.ZI.aI(e)})),this.gP=this.aP._e(this.QI).Me(this.Ji.dataGridBackgroundFillStyle).ve(st).setMouseInteractions(!1),this.pP=this.uP.Tg(this.QI).setMouseInteractions(!1),this.mP=new fa((()=>this.lP._e(this.QI).setMouseInteractions(!0).setMouseEnterEventHandler(this.zI).setMouseLeaveEventHandler(this.VI).setMouseClickEventHandler(this.NI).setMouseDoubleClickEventHandler(this.GI).setMouseDownEventHandler(this.WI).setMouseUpEventHandler(this.HI).setMouseMoveEventHandler(this.UI).setMouseDragEventHandler(this.$I).setMouseDragStartEventHandler(this.jI).setMouseDragStopEventHandler(this.YI).setMouseWheelEventHandler(this.XI).setTouchStartEventHandler(this.KI).setTouchMoveEventHandler(this.qI).setTouchEndEventHandler(this.JI))),this.yP=new fa((()=>this.uP._e(this.QI).setMouseInteractions(!1))),this.SP=new fa((()=>this.uP.Sr(this.QI).setMouseInteractions(!1))),this.xP=new fa((()=>this.uP.tm(this.QI,{},[Zh.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.bP=new fa((()=>this.uP.De(this.QI).setMouseInteractions(!1))),this.vP=new fa((()=>this.uP.vy(this.QI).setMouseInteractions(!1))),this.MP=new fa((()=>this.uP._e(this.QI).setMouseInteractions(!1))),this._P=new fa((()=>this.uP.nC(this.QI).setMouseInteractions(!1))),this.AP=new fa((()=>this.uP.Dc(this.QI).setMouseInteractions(!1))),this.ep(r,this.uiScale),this.onResize((()=>{this.fI=!0,this.ls.Ss(),this.QI.q(this.pixelScale.Ht()),this.tP.q(this.pixelScale.Ht())})),this.wP=this.ss.xg([this.gP])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}Sd(){return[]}dispose(){return super.dispose(),this.aP.G(),this.lP.G(),this.uP.G(),this.cP.G(),this.dP.G(),zh(this.QI),zh(this.tP),this.ZI.dispose(),this.SP.lm(),this.mP.lm(),this.yP.lm(),this.xP.lm(),this.bP.lm(),this.vP.lm(),this.MP.lm(),this._P.lm(),this.AP.lm(),this}Y(){return super.Y(),this.QI.Y(),this.tP.Y(),this}X(){return super.X(),this.QI.X(),this.tP.X(),this}setBackgroundEffect(t){return this.wP.ys(t),this.ls.Ss(),this}getBackgroundEffect(){return this.wP.xs()}setInteractionScrollOnWheel(t){return this.DI=t,this}getInteractionScrollOnWheel(){return this.DI}setInteractionPanOnTouch(t){return this.BI=t,this}getInteractionPanOnTouch(){return this.BI}onCellMouseEnter(t){return this.P.on(Mf.cellMouseEnter,t)}offCellMouseEnter(t){return this.P.off(t)}onCellMouseLeave(t){return this.P.on(Mf.cellMouseLeave,t)}offCellMouseLeave(t){return this.P.off(t)}onCellMouseClick(t){return this.P.on(Mf.cellMouseClick,t)}offCellMouseClick(t){return this.P.off(t)}onCellMouseDoubleClick(t){return this.P.on(Mf.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.P.off(t)}onCellMouseDown(t){return this.P.on(Mf.cellMouseDown,t)}offCellMouseDown(t){return this.P.off(t)}onCellMouseUp(t){return this.P.on(Mf.cellMouseUp,t)}offCellMouseUp(t){return this.P.off(t)}onCellMouseMove(t){return this.P.on(Mf.cellMouseMove,t)}offCellMouseMove(t){return this.P.off(t)}onCellMouseDrag(t){return this.P.on(Mf.cellMouseDrag,t)}offCellMouseDrag(t){return this.P.off(t)}onCellMouseDragStart(t){return this.P.on(Mf.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.P.off(t)}onCellMouseDragStop(t){return this.P.on(Mf.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.P.off(t)}onCellMouseWheel(t){return this.P.on(Mf.cellMouseWheel,t)}offCellMouseWheel(t){return this.P.off(t)}onCellTouchStart(t){return this.P.on(Mf.cellTouchStart,t)}offCellTouchStart(t){return this.P.off(t)}onCellTouchMove(t){return this.P.on(Mf.cellTouchMove,t)}offCellTouchMove(t){return this.P.off(t)}onCellTouchEnd(t){return this.P.on(Mf.cellTouchEnd,t)}offCellTouchEnd(t){return this.P.off(t)}setGridBackgroundFillStyle(t){return this.gP.Me(t),this.ls.Ss(),this}getGridBackgroundFillStyle(){return this.gP.Th()}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.uI.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.uI.splice(this.uI.indexOf(i),1):(i.min=e,i.max=e),this.SI=!0,this.ls.Ss(),this}setRowHeight(t,e){let i=this.cI.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.cI.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.cI.splice(this.cI.indexOf(i),1):(i.min=e,i.max=e),this.SI=!0,this.ls.Ss(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.CP(t,(t=>this.TP(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.FP(t,(t=>this.TP(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=x(i,i,i,i)),this.RI(t,e,(t=>this.TP(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=x(t,t,t,t)),this.oP={...this.oP,...t},this.IP((t=>this.TP(t,this.oP))),this}setCellBorders(t,e,i){return this.RI(t,e,(t=>this.OI(t,i))),this}setRowBorders(t,e){return this.FP(t,(t=>this.OI(t,e))),this}setColumnBorders(t,e){return this.CP(t,(t=>this.OI(t,e))),this}setCellsBorders(t){return this.EI=void 0===t?Ef:t,this.IP((t=>this.OI(t,this.EI))),this}setCellsBorderStrokeStyle(t){return this.rP="function"==typeof t?t(this.rP):t,this.kI=!0,this.ls.Ss(),this}setColumnTextFillStyle(t,e){return this.CP(t,(t=>this.PP(t,e))),this}setRowTextFillStyle(t,e){return this.FP(t,(t=>this.PP(t,e))),this}setCellTextFillStyle(t,e,i){return this.RI(t,e,(t=>this.PP(t,i))),this}setCellsTextFillStyle(t){return this.eP="function"==typeof t?t(this.eP):t,this.IP((t=>this.PP(t,this.eP))),this}setColumnTextFont(t,e){return this.CP(t,(t=>this.DP(t,e))),this}setRowTextFont(t,e){return this.FP(t,(t=>this.DP(t,e))),this}setCellTextFont(t,e,i){return this.RI(t,e,(t=>this.DP(t,i))),this}setCellsTextFont(t){return this.sP="function"==typeof t?t(this.sP):t,this.IP((t=>this.DP(t,this.sP))),this}setColumnContentAlignment(t,e){return this.CP(t,(t=>this.BP(t,e))),this}setRowContentAlignment(t,e){return this.FP(t,(t=>this.BP(t,e))),this}setCellContentAlignment(t,e,i){return this.RI(t,e,(t=>this.BP(t,i))),this}setCellsContentAlignment(t){return this.nP=t,this.IP((t=>this.BP(t,this.nP))),this}setCellBackgroundFillStyle(t,e,i){return this.RI(t,e,(t=>this.OP(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.CP(t,(t=>this.OP(t,e))),this}setRowBackgroundFillStyle(t,e){return this.FP(t,(t=>this.OP(t,e))),this}setCellsBackgroundFillStyle(t){return this.hP="function"==typeof t?t(this.hP):t,this.IP((t=>this.OP(t,this.hP))),this}setCellHighlight(t,e,i){return this.RI(t,e,(t=>{t.highlight=ve(i)})),this.wI=!0,this.ls.Ss(),this}setColumnHighlight(t,e){const i=ve(e);return this.CP(t,(t=>{t.highlight=i})),this.wI=!0,this.ls.Ss(),this}setRowHighlight(t,e){const i=ve(e);return this.FP(t,(t=>{t.highlight=i})),this.wI=!0,this.ls.Ss(),this}removeCell(t,e){return this.RI(t,e,(t=>this.lI.splice(this.lI.indexOf(t),1))),this.yI=!0,this.ls.Ss(),this}removeRow(t){return this.FP(t,(t=>this.lI.splice(this.lI.indexOf(t),1))),this.lI.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.yI=!0,this.ls.Ss(),this}removeColumn(t){return this.CP(t,(t=>this.lI.splice(this.lI.indexOf(t),1))),this.lI.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.yI=!0,this.ls.Ss(),this}removeCells(){return this.lI.splice(0),this.yI=!0,this.ls.Ss(),this}getColumnMax(){return 0===this.lI.length?0:this.lI.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.lI.length?0:this.lI.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}Ae(t){super.Ae(t),Nh.fp(this.ap,this.rp),super.sp();const e=Math.round(this.rP.L()),i=e/2;let s=this.gI||this.pI||this.mI||this.yI||this.SI||this.xI||this._I||this.AI||this.kI||this.TI;if(s){this.lI.forEach((t=>{this.II.add(t.column)})),this.lI.forEach((t=>{this.FI.add(t.row)}));const t=this.SP.am(),r=this.LP(i,t);t.finishPlot();const n=this.RP(this.II.size,r),o=this.EP(this.FI.size,r),h=n.reduce(Oe,0)+e,a=o.reduce(Oe,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.zP.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.zP={columnWidths:n,rowHeights:o,dataGridWidth:h,dataGridHeight:a,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:r}}const r=s||this.pI||this.mI||this.yI||this.bI||this.vI||this.MI||this.AI||this.wI||this.kI||this.fI||this.TI;if((r||this.CI)&&this.zP){const t=this.pixelScale.getInnerIntervalPixels(),s=Nh.dp(this.ap,this.rp),n=[this.Qo.left+i,this.Qo.right+i],o=[this.Qo.bottom+i,this.Qo.top+s+i],h={x:t.x-n[0]-n[1],y:t.y-o[0]-o[1]},a=[this.Qo.left,this.Qo.right],l=[this.Qo.bottom,this.Qo.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.tP.Si(n).xi(o).bi(0,h.x).vi(0,h.y),this.ZI.OF({x:this.zP.dataGridHeight,y:this.zP.dataGridWidth}).Ts().Ae();const d={x:Math.round(this.iP.x),y:Math.round(Math.min(0,this.iP.y))};this.QI.Si(a).xi(l).bi(d.x,u.x+d.x).vi(d.y,u.y+d.y),this.gP.we({x:c.x,y:c.y});const f={x:this.QI.x.Vt(),y:this.QI.y.Vt()+this.ZI.gw(),width:this.QI.x.Gt()+e-this.ZI.gw(),height:this.QI.y.Gt()+e};this.uP.kS(f),this.lP.kS(f),this.aP.kS(f),r&&this.VP(c,this.zP,e)}this.fI=!1,this.gI=!1,this.pI=!1,this.mI=!1,this.yI=!1,this.SI=!1,this.xI=!1,this.bI=!1,this.vI=!1,this.MI=!1,this._I=!1,this.AI=!1,this.wI=!1,this.kI=!1,this.CI=!1,this.TI=!1}LP(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.lI){const{content:r}=t,n={...this.oP,...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.Ch(i).Ih(t.textFont||this.sP).Ts().Ic()}if(Qd(r)&&(h=r,l={x:200,y:50}),Uo(r)){const t=this.ls.NP(r);t.GP()?(a=r,l=a.Ht()):t.WP((()=>{this.TI=!0,this.ls.Ss()}))}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}VP(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.gP.q(c),this.pP.Pe(this.rP),this.dI.clear();const d={cellBackground:this.mP.am(),cellIconRect:this.yP.am(),lineSet:this.xP.am(),line:this.bP.am(),pointSet:this.vP.am(),rect:this.MP.am(),junction:this._P.am(),arc:this.AP.am()},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]},S={x:p.x+y.left,y:p.y+y.bottom},x={x:S.x+g.left,y:S.y+g.bottom},b={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:b.x-y.left-y.right,y:b.y-y.top-y.bottom},M={x:v.x-g.left-g.right,y:v.y-g.top-g.bottom};if(n){const t=wf(x,M,r.contentAlignment||this.nP);n.we(t[0]).Sa({x:t[1],y:t[2]}).Me(this.HP(r.textFillStyle||this.eP,r.content,this.eP)).us(r.highlight)}const A=this.HP(r.backgroundFillStyle||this.hP,r.content);if(A!==z){const t=d.cellBackground.add();t.we(p).q(b).Me(A).ve(st).us(r.highlight),this.dI.set(t,m)}const T=r.borders||this.EI;if(T&&Tf(p,b,T,s,f),o){const t=x,e=M;tf(o,d,this.QI,t,e,this.Ji,this.ff,r.highlight)}if(c){const t=c.Ht(),i=wf(x,M,r.contentAlignment||this.nP);d.cellIconRect.add().we({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).q(t).Me(new zo({source:c.Md,fitMode:e.ImageFitMode.Stretch})).ve(st).us(r.highlight)}}this.pP.Ha();for(const t of f)this.pP.kr().Ig(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()}RP(t,e){const i=new Array(t).fill(0);for(const t of this.II.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.uI.find((e=>e.column===t)),n=r?Ct(s,void 0!==r.min?r.min:Pe,void 0!==r.max?r.max:ke):s;i[t]=n}return i}EP(t,e){const i=new Array(t).fill(0);for(const t of this.FI.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.cI.find((e=>e.row===t)),n=r?Ct(s,void 0!==r.min?r.min:Pe,void 0!==r.max?r.max:ke):s;i[t]=n}return i}HP(t,e,i){if(W(t)){try{const i=Number(e);return new V({color:t.getPalette().getColors(i)})}catch(t){}return i||z}return t}PP(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.eP):e,this.MI=!0,this.ls.Ss()}DP(t,e){t.textFont="function"==typeof e?e(t.textFont||this.sP):e,this._I=!0,this.ls.Ss()}OP(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.hP):e,this.vI=!0,this.ls.Ss()}BP(t,e){t.contentAlignment=e,this.bI=!0,this.ls.Ss()}TP(t,e){t.padding={...t.padding,...e},this.xI=!0,this.ls.Ss()}kP(t,e,i){let s=this.RI(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.lI.push(s),this.mI=!0),"string"==typeof s.content||"number"==typeof s.content?this.gI=!0:this.pI=!0,this.ls.Ss()}IP(t){this.lI.forEach((e=>t(e)))}RI(t,e,i){const s=this.lI.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}CP(t,e){const i=this.lI.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}FP(t,e){const i=this.lI.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}fP(){return new bf(this.dP,this.cP,this.tP,this.tP,this.QI,this.Ji,yf.Both).onScroll(((t,e)=>{this.zP&&(t===yf.Vertical&&(this.iP.y=-e),t===yf.Horizontal&&(this.iP.x=e),this.CI=!0,this.ls.Ss())})).eI(50).hI(12)}}const Mf={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 Af;e.DataGridCellContentAlignmentOptions=void 0,(Af=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",Af.RightCenter="right-center",Af.LeftCenter="left-center",Af.RightTop="right-top",Af.LeftTop="left-top",Af.RightBottom="right-bottom",Af.LeftBottom="left-bottom",Af.CenterTop="center-top",Af.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])},wf=(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 Me(0,`Unidentified DataGrid cell content alignment option: ${i}`)},Ef={top:!1,bottom:!1,left:!1,right:!1};class If extends $s{constructor(t,e,i,s,r,n){super(t,{ar(){},nr(){},ur(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.ss=n,this.As=r,this.kh=r.Sr(t.UP).Ih(this.Ji.barChartCategoryAxisTitleFont||this.Ji.xAxisTitleFont).Me(this.Ji.barChartCategoryAxisTitleFillStyle||this.Ji.xAxisTitleFillStyle),this.setTitleRotation(this.chart.ws.getWidth({x:0,y:-90})),this.Bh=this.ss.xg([this.kh]).ys(e.effectsText),this.$P=r.De(t.UP).Pe(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.ls.Ss(),this}getThickness(){return{min:this.Mg,max:this._g}}setStrokeStyle(t){return this.$P.Pe(t),this.chart.ls.Ss(),this}getStrokeStyle(){return this.$P.Yl()}Ts(){if(!this.Fi)return{jP:0,YP:0,nd:Ct(0,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:ke)};const t=this.$P.Yl().L()/2,e=this.chart.ws.getHeight(this.kh.Ts().Ic());return{jP:t,YP:e,nd:t+e}}Ae(t,e,i,s){const r=this.getInterval(),n=this.chart.valueAxis.getInterval();this.$P.Oe(this.chart.ws.toPoint(r.start,n.start)).Be(this.chart.ws.toPoint(r.end,n.start)).setVisible(this.Fi),this.kh.we(this.chart.ws.toPoint(.5*(r.start+r.end),this.chart.valueAxis.ct.Jt(0,-(t.jP+s.labelMarginBeforeCategoryAxisPixels)))).Sa(this.chart.ws.toPoint(0,1)).setVisible(this.Fi)}setMouseInteractions(t){return this}Qh(t,e){return new qs(e,t,this.As,this.chart.UP)}tr(t,e){return{}}dr(t,e){return e}pr(t,e,i){return{min:t,max:e}}}class Cf extends $s{constructor(t,e,i,s,r,n,o){super(t,{ar:()=>{var e;if(t.XP){if("positive"===t.ZP||"bipolar"===t.ZP){if("after-bar"===(null===(e=t.KP)||void 0===e?void 0:e.position)){const e=this.ct.Gt();return this.ct.Jt(t.XP.max,Math.min(this.chart.ws.getHeight(this.chart.qP())+t.KP.labelMargin,.3*e))}return t.XP.max}return t.JP?Ct(-1,-1e-6,t.XP.max):0}},nr:()=>{var e;if(t.XP){if("negative"===t.ZP||"bipolar"===t.ZP){if("after-bar"===(null===(e=t.KP)||void 0===e?void 0:e.position)){const e=this.ct.Gt();return console.log("asd",t.XP.min,this.ct.Jt(t.XP.min,-10),this.getInterval()),this.ct.Jt(t.XP.min,-Math.min(this.chart.ws.getHeight(this.chart.qP())+t.KP.labelMargin,.3*e))}return t.XP.min}return t.JP?Ct(1,1e-6,t.XP.min):0}},ur:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.ss=n,this.As=r,this.kh=r.Sr(t.UP).Ih(this.Ji.barChartValueAxisTitleFont||this.Ji.yAxisTitleFont).Me(this.Ji.barChartValueAxisTitleFillStyle||this.Ji.yAxisTitleFillStyle),this.setTitleRotation(this.chart.ws.getHeight({x:0,y:-90})),this.Bh=this.ss.xg([this.kh]).ys(e.effectsText),this.$P=r.De(t.UP).Pe(e.barChartValueAxisStrokeStyle||this.Ji.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.ls.Ss(),this}getThickness(){return{min:this.Mg,max:this._g}}setStrokeStyle(t){return this.$P.Pe(t),this.chart.ls.Ss(),this}getStrokeStyle(){return this.$P.Yl()}setTickStrategy(t,e){return super.Mh(t,e)}Ts(t){if(!this.Fi)return this.Oh(),{jP:0,YP:0,nd:Ct(0,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:ke)};const e=this.chart.ws.getWidth(this.chart.UP).Gt(),i=this.ct.Gt();this.Hh({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.Ue.values())for(const e of t.values()){const t=e.dh.Jh,i=this.chart.ws.getWidth(e.Ve.Ic()),r=t.getTickLength()+t.getTickPadding()+i+t.getLabelPadding();s=Math.max(s,r)}const r=s+this.$P.Yl().L()/2,n=this.chart.ws.getWidth(this.kh.Ts().Ic());return{jP:r,YP:n,nd:Ct(r+n,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:ke)}}Ae(t){const e=this.getInterval();this.$P.Oe(this.chart.ws.toPoint(-.5,this._h)).Be(this.chart.ws.toPoint(-.5,this.Ah)).setVisible(this.Fi),this.kh.we(this.chart.ws.toPoint(this.chart.categoryAxis.ct.Jt(-.5,t.jP*this.chart.ws.QP),.5*(e.start+e.end))).Sa(this.chart.ws.toPoint(this.chart.ws.tD,0)).setVisible(this.Fi)}setMouseInteractions(t){return this}Qh(t,e){return new qs(e,t,this.As,this.chart.UP)}tr(t,e){const i=t.dh.Jh,s=this.chart.ws.toPoint(-.5,t.u),r=this.chart.UP.Jt(s,this.chart.ws.toPoint(i.getTickLength()*this.chart.ws.QP,0)),n=this.chart.UP.Jt(s,this.chart.ws.toPoint(i.gridStrokeLength*e.oppositeAxisSize,0)),o=this.chart.UP.Jt(r,this.chart.ws.toPoint(i.getTickPadding()*this.chart.ws.QP,0));t.Ve.we(o).Sa(this.chart.ws.toPoint(this.chart.ws.tD,i.getLabelAlignment())).Ph(i.getLabelRotation()),i.tickStyle!==st&&0!==i.tickLength&&e.plotLines.add({positions:[s,r]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==st&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,n]},{lineStyle:i.gridStrokeStyle})}dr(t,e){return"linear"===this.xh.type?Jo(t,e,this.ct):$o(t,e,this.ct)}pr(t,e,i){return{min:t,max:e}}}class kf extends Bl{constructor(t,e,i,s,r,n){super(t,e,i,s),this.u=0,this.chart=t,this.Ki=t,this.category=r,this.bs=r,this.Se=ye(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,n),this.xe=ye(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,n),this.onVisibleStateChanged((()=>{this.Ki.iD()})),this.onDispose((()=>{this.Ki.iD(),this.Ki.sD.delete(this),this.Ki.eD.delete(this)}))}setValue(t){return this.u=t,this.Ki.iD(),this.Ki.ls.Ss(),this.Ki.sD.delete(this),this.Ki.eD.delete(this),this}getValue(){return this.u}get value(){return this.u}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.Ki.iD(),this}getFillStyle(){return this.Se}setStrokeStyle(t){return this.xe="function"==typeof t?t(this.xe):t,this.Ki.iD(),this}getStrokeStyle(){return this.xe}Xm(){return this.Km}zx(t,e){return ll(t,this.Ki.engine.scale,this.Ki.$x(new Ja,this.category,this.u,this).vc(),this,void 0)}solveNearestFromScreen(t){}setEffect(t){return this.Ki.setBarsEffect(t),this}}const Pf=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),Ff=(t,e,i)=>{const s=t.Xc.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 Bf extends Sl{constructor(t,i,s,r,n,o,h){var a;let l;super(t,i,s,i.hp("barChart bg",0),r,i.ls.Ji.barChartBackgroundFillStyle||i.ls.Ji.chartXYBackgroundFillStyle,i.ls.Ji.barChartBackgroundStrokeStyle||i.ls.Ji.chartXYBackgroundStrokeStyle,i.ls.Ji.barChartTitleFont||i.ls.Ji.chartXYTitleFont,i.ls.Ji.barChartTitleFillStyle||i.ls.Ji.chartXYTitleFillStyle,o),this.coordsBars="barChart",this.hD=_f.Descending,this.rD=this.Ji.barChartCategoryLabels,this.KP=this.Ji.barChartValueLabelsAfterBars,this.$x=(t,e,i,s)=>(this.categoryAxis.getTitle().length>0&&t.addRow(this.categoryAxis.getTitle()),t.addRow(e),this.valueAxis.getTitle().length>0&&t.addRow(this.valueAxis.getTitle()),t.addRow(this.valueAxis.formatValue(i)),t),this.nD=!1,this.oD=(()=>{const t=new Map;return{aD:e=>(e.setMouseEnterEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ri(e,i,s)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ei(e,i,s)})),e.setMouseClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Vi(e,i,s)})),e.setMouseDoubleClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ni(e,i,s)})),e.setMouseDownEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Gi(e,i,s)})),e.setMouseUpEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Wi(e,i,s)})),e.setMouseMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.zi(e,i,s)})),e.setMouseDragEventHandler(((e,i,s,r,n,o)=>{const h=o&&t.get(o);h&&h.Ui(e,i,s,r,n,o)})),e.setMouseDragStartEventHandler(((e,i,s,r)=>{const n=r&&t.get(r);n&&n.Hi(e,i,s,r)})),e.setMouseDragStopEventHandler(((e,i,s,r,n)=>{const o=n&&t.get(n);o&&o.$i(e,i,s,r,n)})),e.setMouseWheelEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.ji(e,i,s)})),e.setTouchStartEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Yi(e,i,s)})),e.setTouchMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Xi(e,i,s)})),e.setTouchEndEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Zi(e,i,s)})),e),lD:(e,i)=>{t.set(e,i)},Ha:()=>{t.clear()}}})(),this.sD=new Map,this.eD=new Map,this.ZP="positive",this.uD=!0,this.cD=new Map,this.dD={speed:1},this._p={speed:1},this.fD=.08,this.Yr=(t,e,i,s,r)=>{this.UP.q(s,r)},this.ws="horizontal"===(null==h?void 0:h.type)?Df:Lf,this.ap.Ch("Bar Chart"),this.gD=i.Hp("barChart plotting 1",0),this.pD=i.Hp("barChart plotting 2",1),this.JP="logarithmic"===(null===(a=null==h?void 0:h.valueAxis)||void 0===a?void 0:a.type),this.JP?"horizontal"===this.ws.mD?(l=s.d1({scale1DConstructor:Pi,dimension:"y"}),this.UP=(new Li).yi(s.d1({scale1DConstructor:vi,dimension:"x"}),l)):(l=s.d1({scale1DConstructor:Pi,dimension:"x"}),this.UP=(new Li).yi(l,s.d1({scale1DConstructor:vi,dimension:"y"}))):(this.UP=s.d2({scaleXYConstructor:_i}),l=this.ws.getWidth(this.UP)),this.yD=this.ss.xg(),this.SD=new da((()=>this.oD.aD(this.gD.ab(this.UP).Bo(0))),((t,e,i)=>{t.Me(i.fillStyle).ve(i.strokeStyle),e.forEach((e=>{const i=t.kr().tl(e.vertices);this.oD.lD(i,e.bar),e.bar.gs([i])}))}),(()=>{this.oD.Ha()}),(t=>{this.yD.ds(t)})),this.Fy=this.Gg._e(this.UP).Me(this.Ji.barChartSeriesBackgroundFillStyle||z).ve(st),this.Iy=this.Gg._e(this.UP).Me(z).ve(this.Ji.barChartSeriesBackgroundStrokeStyle||st).setMouseInteractions(!1),super.Ty(this.Fy,this.Iy),this.categoryAxis=new If(this,this.Ji,!(!h||void 0===h.disableAnimations)&&h.disableAnimations,l,this.pD,this.ss);const u=jo(null==h?void 0:h.valueAxis);this.valueAxis=new Cf(this,this.Ji,!(!h||void 0===h.disableAnimations)&&h.disableAnimations,this.ws.getHeight(this.UP),this.pD,this.ss,u.type),this.xD=new fa((()=>this.pD.Sr(this.UP).va(Ie).xa(Ie).Bo(1))),this.bD=new da((()=>this.Gg.Tg(this.UP).setMouseInteractions(!1)),((t,e,i)=>{t.Ha().Pe(i.lineStyle),e.forEach((({positions:e})=>t.kr().Ig(e[0],e[1])))}));const c=Lt(h?h.autoCursorBuilder:void 0,ol);this.Ex=c.Tx(this.Dx,this.uiScale,this.uiScale,this.Ji),this.onResize(this.Yr),this.ep(n,this.UP),this.setAutoCursorMode(e.AutoCursorModes.onHover),(null==h?void 0:h.disableAnimations)&&this.setAnimationsEnabled(!1)}getSeries(){return this.My}setBarsMargin(t){return this.fD=Ct(t,0,.49),this.nD=!0,this.ls.Ss(),this}getBarsMargin(){return this.fD}setBarsEffect(t){return this.yD.ys(t),this.ls.Ss(),this}getBarsEffect(){return this.yD.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})}}if(this.hD&&e.sort(this.hD),e.forEach(((t,e)=>{let i=this.My.find((e=>e.category===t.category));i||(i=new kf(this,this.Ay,this.Ji,this.ls.ss,t.category,e),this.Py(i),this.cD.set(i,{category:e,value:void 0!==t.value?t.value:0})),void 0!==t.value&&i.setValue(t.value)})),this.My.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category))&&(t.dispose(),this.cD.delete(t))})),this.categoryAxis.setInterval(this.ws.getWidth({x:{start:-.5,end:this.My.length-.5},y:{start:this.My.length-.5,end:-.5}})),this.XP=0===this.My.length?void 0:this.My.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:ke,max:Pe}),this.XP&&(this.ZP=this.XP.min>=0?"positive":this.XP.max<=0?"negative":"bipolar",("bipolar"===this.ZP||"negative"===this.ZP)&&this.JP))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");return this.hD&&this.My.sort(this.hD),this.sD.clear(),this.eD.clear(),this.nD=!0,this.ls.Ss(),this}setCategoryLabels(t){const e="function"==typeof t?this.rD?t(this.rD):this.rD:t;return this.rD=e?{...this.Ji.barChartCategoryLabels,...e}:void 0,this.sD.clear(),this.ls.Ss(),this}getCategoryLabels(){return this.rD}setValueLabels(t){var e;const i="function"==typeof t?this.KP?t(this.KP):this.KP:t,s=(null==i?void 0:i.position)||(null===(e=this.KP)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.KP={...this.Ji.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.KP={...this.Ji.barChartValueLabelsInsideBars,...i}):this.KP=void 0,this.eD.clear(),this.ls.Ss(),this}getValueLabels(){return this.KP}setLabelFittingEnabled(t){return this.uD=t,this.ls.Ss(),this}getLabelFittingEnabled(){return this.uD}getBar(t){const e=this.My.find((e=>e.category===t));if(!e)throw new Error(`BarChart.getBar() no such bar: "${t}"`);return e}getBars(){return this.My}setSorting(t){return this.hD=t,t&&this.My.sort(t),this.ls.Ss(),this}getSorting(){return this.hD}setCursorResultTableFormatter(t){return this.$x=t,this.ls.Ss(),this}setAnimationCategoryPosition(t,e=1){return this.dD=t?{speed:e}:void 0,this.ls.Ss(),this}setAnimationValues(t,e=1){return this._p=t?{speed:e}:void 0,this.ls.Ss(),this}translateCoordinate(t,e,i){if(i&&Vi(t)&&Ri(e))return super.translateCoordinate(t,e,i);const s=e;let r;if(Oi(t))r=this.ls.do(t);else if(Vi(t)){const e=at(t,this.pixelScale,this.ls.ct);r={engineX:e.x,engineY:e.y}}else{if(!Pf(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=at(this.ws.toPoint(t.iCategory,t.value),this.UP,this.ls.ct);r={engineX:e.x,engineY:e.y}}}if(zi(s))return this.ls.fo(r);if("barChart"===s){const t=at({x:r.engineX,y:r.engineY},this.ls.ct,this.UP);return{iCategory:this.ws.getWidth(t),value:this.ws.getHeight(t)}}if(Ri(s))return at({x:r.engineX,y:r.engineY},this.ls.ct,this.pixelScale);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}Ae(t){var e,i;super.Ae(t);const s=this.xD.am(),r=this.bD.am(),n=this.My.filter((t=>t.getVisible())),o=5e-4*t*((null===(e=this.dD)||void 0===e?void 0:e.speed)||0),h=.003*t*((null===(i=this.dD)||void 0===i?void 0:i.speed)||0),a=this.valueAxis.ct,l=a instanceof Pi?(t,e)=>{var i;return Jo(t,e,a,(null===(i=this._p)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return $o(t,e,a,(null===(i=this._p)||void 0===i?void 0:i.speed)||0)};n.forEach(((t,e)=>{const i={category:e,value:t.value};let s,r,n=this.cD.get(t);if(void 0===n&&(n=i),this.dD&&n.category!==i.category){const t=Math.sign(i.category-n.category);s=n.category+o*t+h*(i.category-n.category),t!==Math.sign(i.category-s)&&(s=i.category)}else s=i.category;if(this._p&&n.value!==i.value){const t=Math.sign(i.value-n.value);r=l(n.value,i.value),t!==Math.sign(i.value-r)&&(r=i.value)}else r=i.value;this.cD.set(t,{category:s,value:r}),s===i.category&&r===i.value||this.ls.Ss(!0),s===n.category&&r===n.value||(this.nD=!0)})),Nh.fp(this.ap,this.rp),this.categoryAxis.cr(),this.valueAxis.cr();const u=this.categoryAxis.Ts(),c=this.valueAxis.Ts(r),{labelMarginBeforeCategoryAxisPixels:d}=this.vD(n,s,r);this.categoryAxis.Ae(u,s,r,{labelMarginBeforeCategoryAxisPixels:d}),this.valueAxis.Ae(c);const f=this.categoryAxis.getThickness(),g=Ct(u.nd+d,void 0!==f.min?f.min:0,void 0!==f.max?f.max:ke),y={x:Math.min(this.UP.x.getInnerStart(),this.UP.x.getInnerEnd()),y:Math.min(this.UP.y.getInnerStart(),this.UP.y.getInnerEnd())},m=Math.max(this.UP.x.getInnerStart(),this.UP.x.getInnerEnd()),p=Math.max(this.UP.y.getInnerStart(),this.UP.y.getInnerEnd()),S={x:m-y.x,y:p-y.y};this.Fy.we(y),this.Fy.q(S),this.Iy.we(y),this.Iy.q(S),super.sp(),this.Vx(!1);const x=Nh.dp(this.ap,this.rp);if(this.UP.xi([this.Ft.bottom+this.Qo.bottom+("vertical"===this.ws.mD?g:0),this.Ft.top+this.Qo.top+x+("horizontal"===this.ws.mD?c.nd:0)]),this.UP.Si([this.Ft.left+this.Qo.left+this.ws.getHeight({x:g,y:c.nd}),this.Ft.right+this.Qo.right]),this.gD.kS({x:this.UP.x.Vt(),y:this.UP.y.Vt(),width:this.UP.x.Gt(),height:this.UP.y.Gt()}),this.zg&&this.zg(),this.nD){const t=this.SD.am(),e=1-2*this.fD;n.forEach(((i,s)=>{const r=this.cD.get(i);if(void 0===r)return;const n=r.category-.5*e,o=r.category+.5*e,h=this.JP?1e-6:0,a=[this.ws.toPoint(n,h),this.ws.toPoint(n,r.value),this.ws.toPoint(o,r.value),this.ws.toPoint(o,h)];t.add({vertices:a,bar:i},{fillStyle:i.Se,strokeStyle:i.xe})})),t.finishPlot()}s.finishPlot(),r.finishPlot(),this.nD=!1}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationCategoryPosition(!1),this.setAnimationValues(!1),this.valueAxis.setAnimationsEnabled(!1),this.categoryAxis.setAnimationsEnabled(!1),this}solveNearest(t){}dispose(){return this.pD.G(),this.gD.G(),super.dispose()}vD(t,e,i){let s=0;const r=this.rD,n=this.KP,o=this.valueAxis.getInterval(),h=this.ws.getWidth({x:this.UP.x.Gt(),y:this.UP.y.Gt()});if(r&&r.labelFillStyle!==z){const n=r.tickLength+r.labelMargin,a=this.ws.toPoint(0,1),l={Xc:t.map(((t,e)=>{const i=r.formatter(t,t.category,t.value);if(!i)return;const s=this.cD.get(t);return void 0!==s?{text:i,position:this.ws.toPoint(s.category,this.valueAxis.ct.Jt(o.start,-n)),alignment:a,rotation:r.labelRotation,sizePixels:this.MD(t)}:void 0})),cc:r.labelFont,ct:this.UP},u=l?this.uD?Ff(l,h,this.ws.getWidth):l.Xc:[];u.forEach((t=>{t&&e.add().Ch(t.text).we(t.position).Sa(t.alignment).Ph(t.rotation).Me(r.labelFillStyle).Ih(r.labelFont)})),r.tickStyle!==st&&0!==r.tickLength&&u.forEach((t=>{if(!t)return;const e=this.ws.getWidth(t.position);i.add({positions:[this.ws.toPoint(e,this.valueAxis.ct.getInnerStart()),this.ws.toPoint(e,this.valueAxis.ct.Jt(o.start,-r.tickLength))]},{lineStyle:r.tickStyle})})),s=u.reduce(((t,e)=>e?Math.max(t,this.ws.getHeight(e.sizePixels)):t),0)+r.tickLength+r.labelMargin}if(n&&n.labelFillStyle!==z){let i;"after-bar"===n.position?i={Xc:t.map(((t,e)=>{const i=n.formatter(t,t.category,t.value);if(!i)return;const s=this.cD.get(t);return void 0!==s?{text:i,position:this.ws.toPoint(s.category,this.valueAxis.ct.Jt(s.value,n.labelMargin*Math.sign(s.value))),alignment:this.ws.toPoint(0,-1*Math.sign(s.value)),rotation:n.labelRotation,sizePixels:this._D(t)}:void 0})),cc:n.labelFont,ct:this.UP}:"inside-bar"!==n.position&&"inside-bar-start"!==n.position&&"inside-bar-centered"!==n.position&&"inside-bar-end"!==n.position||(i={Xc:t.map(((t,e)=>{const i=n.formatter(t,t.category,t.value);if(!i)return;const s=this.cD.get(t);if(void 0===s)return;const r=this.JP?1e-6:0,o="bipolar"===this.ZP?Math.sign(s.value):"negative"===this.ZP?-1:1,h=this.ws.toPoint(0,"inside-bar"===n.position||"inside-bar-end"===n.position?1*o:"inside-bar-centered"===n.position?0:-1*o);return{text:i,position:this.ws.toPoint(s.category,"inside-bar"===n.position||"inside-bar-end"===n.position?this.valueAxis.ct.Jt(s.value,-n.labelMargin*o):"inside-bar-centered"===n.position?(r+s.value)/2:this.valueAxis.ct.Jt(r,n.labelMargin*o)),alignment:h,rotation:n.labelRotation,sizePixels:this._D(t)}})),cc:n.labelFont,ct:this.UP}),i&&(i?this.uD?Ff(i,h,this.ws.getWidth):i.Xc:[]).forEach((t=>{t&&e.add().Ch(t.text).we(t.position).Sa(t.alignment).Ph(t.rotation).Me(n.labelFillStyle).Ih(n.labelFont)}))}return{labelMarginBeforeCategoryAxisPixels:s}}MD(t){if(!this.rD||this.rD.labelFillStyle===z)return{x:0,y:0};const e=this.sD.get(t);if(e)return e;const i=this.rD.formatter(t,t.category,t.value),s=this.ls.wD.AD(i,this.rD.labelFont,this.rD.labelRotation);return s.isEstimate?this.ls.Ss(!0):this.sD.set(t,s),s}_D(t){if(!this.KP||this.KP.labelFillStyle===z)return{x:0,y:0};const e=this.eD.get(t);if(e)return e;const i=this.ls.wD.AD(this.KP.formatter(t,t.category,t.value),this.KP.labelFont,this.KP.labelRotation);return i.isEstimate?this.ls.Ss(!0):this.eD.set(t,i),i}qP(){return this.My.reduce(((t,e)=>{const i=this._D(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}iD(){this.nD=!0,this.ls.Ss()}getMinimumSize(){return{x:200,y:200}}}const _f={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)},Lf={...Zo,mD:"vertical",QP:-1,tD:1},Df={...Qo,mD:"horizontal",QP:1,tD:-1},zf=(t,e)=>e?t.x:t.y,Of=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),Rf=(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(zf(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&&eOf(t,h,n,e))).reduce(((t,e)=>Math.max(t,zf(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>zf(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))/zf(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.Ti=!1,this.lI=new Array,this.P=new r.Eventer,this.kD=[],this.Lg=[],this.CD=void 0,this.TD=!0,this.FD=!0,this.ID=!0,this.PD=!0,this.DD=()=>{this.PD=!0,this.ls.Ss()},this.BD=[],this.OD=t=>{for(let e=0;e{const e=this.kD.indexOf(t);e>=0&&this.kD.splice(e,1)},this.Hg=t=>{const e=this.Lg.indexOf(t);e>=0&&this.Lg.splice(e,1)},this.RD=(t,e,i,s,r)=>{if(this.ED(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.lI.push(n),this.zD(n),this.TD=!0,t}throw new dt("Out of dashboard range.")},this.VD=e.numberOfRows,this.ND=e.numberOfColumns,this.ff=t,this.GD=e,this.WD=s;const o=this.ND*this.VD;this.HD={x:new Kd(new Array(this.ND).fill(1)),y:new Kd(new Array(this.VD).fill(1))},this.Ji=i.Ji,this.UD=this.Ji.dashboardSplitterStyle,this.Ze=void 0===e.disableAnimations||!e.disableAnimations,this.$D=qd(i,o),this.jD=i.rF("dashboard splitters",400001),this.Zv=()=>this.$D.hF(),this.Zg=this.$D.nF(),this.ss=i.ss.es(this,{YD:{}}),this.ss.YD.ys(this.Ji.effectsDashboardSplitters);const h=i.Ht();this.uiScale=ot.d2({scaleXYConstructor:_i}).bi(0,100).vi(0,100).q(h),this.pixelScale=ot.d2({scaleXYConstructor:_i}).bi(0,this.uiScale.x.getCellSize()).vi(0,this.uiScale.y.getCellSize()).q(h),this.XD=i.ZD.bind(i),this.KD=i.qD.bind(i),this.JD=i.QD.bind(i),this.tB=i.iB.bind(i),this.Vn=i.Vn.bind(i),this.Gn=i.Gn.bind(i),this.engine=i.$g,this.ls=i.jg,i.lo((()=>this.DD())),i.Ss(),this.sB(),this.setAnimationsEnabled(this.Ze);const a=((t,e)=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.P);this.createChartXY=t=>{const e=Nf(t,this.GD,this.Ze);return this.RD(new Wd(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=Nf(t,this.GD,this.Ze);return this.RD(new ac(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=Nf(t,this.GD,this.Ze);return this.RD(new mu(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=Nf(t,this.GD,this.Ze),i=e&&e.type?e.type:aa;return this.RD(new i(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=Nf(t,this.GD,this.Ze),i=e&&e.type?e.type:Ou;return this.RD(new i(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=Nf(t,this.GD,this.Ze),i=e&&e.type?e.type:Eu;return this.RD(new i(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=Nf(t,this.GD,this.Ze),i=t&&t.type?t.type:Xu;return this.RD(new i(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=Nf(t,this.GD,this.Ze);return this.RD(new Oh(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=Nf(t,this.GD,this.Ze);return this.RD(new Ga(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=Nf(t,this.GD,this.Ze),i=void 0===e.bandAboveSeries||e.bandAboveSeries;return this.RD(new $d(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,e.axis,i,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=Nf(t,this.GD,this.Ze);return this.RD(new xl(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=Nf(t,this.GD,this.Ze),i=new Va(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a,e);return this.RD(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=Nf(t,this.GD,this.Ze),i=new vf(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a);return this.RD(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=Nf(t,this.GD,this.Ze),i=new Bf(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a,e);return this.RD(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}eB(t,e){return t+e*this.ND}hB(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.ND:this.VD,"x"===i.dimension?e.x:e.y),d2:i=>(new i.scaleXYConstructor).nt({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.ND,y:this.VD},e),d3:()=>new rt({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.ND,y:this.VD},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.XD(t[0]),this.KD(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.JD(t[0]),this.tB(t[1]),this}getWidth(){return this.Vn()}getHeight(){return this.Gn()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.jD.Ss(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.jD.Ss(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.Ji}setSplitterStyle(t){const e=this.UD;return this.UD="function"==typeof t?t(this.UD):t,this.rB(e),this}getSplitterStyle(){return this.UD}setSplitterEffect(t){return this.ss.YD.ys(t),this.ls.Ss(),this}getSplitterEffect(){return this.ss.YD.xs()}setAnimationHighlight(t){return this.ID=t,this.BD.forEach((e=>this.ls.os.Ms(e.line,t))),this}getAnimationHighlight(){return this.ID}rB(t){for(const t of this.BD)t.line.Pe(this.UD);this.sB()}setColumnWidth(t,e){const i=this.HD.x.M();return t>=0&&t=e.length)throw new dt("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.HD.y.M();return t>=0&&t=e.length)throw new dt("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}onResize(t){return this.P.on("resize",t)}offResize(t){return this.P.off(t,"resize")}nB(t,e,i){if(i&&Math.abs(t.x)>0)this.oB(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.aB(e,t.y)}for(const t of this.lI)t.panel.X();this.DD()}aB(t,e){const i=Rf(this.lI,this.HD.y.M(),t,e,this.pixelScale.Ht(),!1);this.HD.y.S(i),this.DD()}oB(t,e){const i=Rf(this.lI,this.HD.x.M(),t,e,this.pixelScale.Ht(),!0);this.HD.x.S(i),this.DD()}lB(){this.BD.forEach((t=>t.line.dispose())),this.BD.length=0;for(let t=1;t<=this.ND-1;t+=1)for(let e=0;e<=this.VD-1;e+=1)if(void 0!==this.lI.find((i=>Ve(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=Wi(new Yi((()=>{this.uB(t)}),((e,i,s,r,n)=>{this.nB(r,t,!0),Zt(n)}),(()=>{this.cB(t)}))),s=this.jD.De(this.pixelScale).Pe(this.UD).setMouseEnterEventHandler((()=>{this.uB(t)})).setMouseLeaveEventHandler((()=>{this.cB(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.nB(n,t,!0),Zt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.ls.os.ns(s,(t=>s.us(t)),{animationEnabled:this.ID}),this.BD.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.VD-1;t+=1)for(let e=0;e<=this.ND-1;e+=1)if(void 0!==this.lI.find((i=>Ve(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=Wi(new Yi((()=>{this.dB(t)}),((e,i,s,r,n)=>{this.nB(r,t,!1),Zt(n)}),(()=>{this.fB(t)}))),s=this.jD.De(this.pixelScale).Pe(this.UD).setMouseEnterEventHandler((()=>{this.dB(t)})).setMouseLeaveEventHandler((()=>{this.fB(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.nB(n,t,!1),Zt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.ls.os.ns(s,(t=>s.us(t)),{animationEnabled:this.ID}),this.BD.push({row:t,column:e,line:s,alignment:"horizontal"})}this.ss.YD.ds(this.BD.map((t=>t.line)))}gB(){const t=this.pixelScale.Ht(),e=this.HD.x.M(),i=e.reduce(((t,e)=>t+e)),s=this.HD.y.M(),r=s.reduce(((t,e)=>t+e));this.BD.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).Be(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).Be(h)}}))}uB(t){this.BD.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.ls.os.vs(e.line,1),this.jD.pB(e.line))})),this.CD=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.ls.Ss()}dB(t){this.BD.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.ls.os.vs(e.line,1),this.jD.pB(e.line))})),this.CD=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.ls.Ss()}cB(t){this.BD.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.ls.os.vs(e.line,0)})),this.engine.restoreMouseStyle(this.CD),this.ls.Ss()}fB(t){this.BD.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.ls.os.vs(e.line,0)})),this.engine.restoreMouseStyle(this.CD),this.ls.Ss()}setAnimationsEnabled(t){return this.Ze=t,this.getCells().filter((t=>t.panel instanceof Vh)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.Ze),this}getAnimationsEnabled(){return this.Ze}getCells(){return this.lI.slice()}dispose(){return this.Ti||(this.lI.slice().forEach((t=>t.panel.dispose())),this.kD.slice().forEach((t=>t.dispose())),this.Lg.slice().forEach((t=>t.dispose())),this.Ti=!0,this.WD(),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}saveToFile(t,e,i){return Fh(this.engine,t,e,i),this}mB(t){if(this.PD){const t=this.ls.ct.Ht(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=this.uiScale.getInnerIntervalPixels();this.pixelScale.bi(0,s.x).vi(0,s.y),this.P.emit("resize",this,s.x,s.y,e,i),this.FD=!0}this.TD&&(this.lB(),this.TD=!1,this.FD=!0),this.FD&&(this.gB(),this.FD=!1);for(const e of this.lI)e.panel.Ae(t);return this.kD.forEach((t=>t.Ts())),this.kD.forEach((t=>t.Ae())),this.Lg.forEach((t=>t.Ts())),this.Lg.forEach((t=>t.Ae())),this.PD=!1,this}Y(){for(const t of this.lI)t.panel.Y();return this.pixelScale.x.Y(),this.pixelScale.y.Y(),this.uiScale.x.Y(),this.uiScale.y.Y(),this}X(){for(const t of this.lI)t.panel.X();return this.pixelScale.x.X(),this.pixelScale.y.X(),this.uiScale.x.X(),this.uiScale.y.X(),this}translateCoordinate(t,e,i){return Lh(t,e,i,this.pixelScale,this.ls)}addUIElement(t=Qn,e=this.uiScale){e=_h(e,this.pixelScale);const i=Bh(t,this.Zv(),this.uiScale,e,this.LD,this.Ji);return this.kD.push(i),i}addLegendBox(t=co,i=this.uiScale){i=_h(i,this.pixelScale);const s=Bh(t,this.Zg,this.uiScale,i,this.Hg,this.Ji);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.Lg.push(s),s}ED(t,e,i,s){return e>=0&&t>=0&&e+s<=this.VD&&t+i<=this.ND}zD(t){const e=this.UD,i=e===st?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.xa(s)}sB(){this.uiScale.x.zt([0,0]),this.uiScale.y.zt([0,0]),this.pixelScale.x.zt([0,0]),this.pixelScale.y.zt([0,0]);for(const t of this.lI)this.zD(t);this.ls.Ss()}}const Nf=(t,e,i)=>{const s={...t,columnSpan:t.columnSpan||1,rowSpan:t.rowSpan||1,disableAnimations:void 0!==t.disableAnimations?t.disableAnimations:!i};var r,n;return s.rowIndex=(r=s.rowIndex,n=s.rowSpan,e.numberOfRows-(r+n)),s},Gf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAgCAYAAADwkoGKAAAACXBIWXMAACxLAAAsSwGlPZapAAAE7mlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4yLWMwMDAgNzkuMWI2NWE3OSwgMjAyMi8wNi8xMy0xNzo0NjoxNCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIzLjUgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAyMi0wNy0yMFQxMjowODo1OCswMzowMCIgeG1wOk1vZGlmeURhdGU9IjIwMjItMDktMDdUMTU6MDc6MjErMDM6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMjItMDktMDdUMTU6MDc6MjErMDM6MDAiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjIwMGQwMzM2LWEyOTktZjU0YS05MmYzLTg0NzlmNWM5MzEyMiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDBkMDMzNi1hMjk5LWY1NGEtOTJmMy04NDc5ZjVjOTMxMjIiIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyMDBkMDMzNi1hMjk5LWY1NGEtOTJmMy04NDc5ZjVjOTMxMjIiPiA8eG1wTU06SGlzdG9yeT4gPHJkZjpTZXE+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJjcmVhdGVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjIwMGQwMzM2LWEyOTktZjU0YS05MmYzLTg0NzlmNWM5MzEyMiIgc3RFdnQ6d2hlbj0iMjAyMi0wNy0yMFQxMjowODo1OCswMzowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDIzLjUgKFdpbmRvd3MpIi8+IDwvcmRmOlNlcT4gPC94bXBNTTpIaXN0b3J5PiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ptd9sFgAABOuSURBVHic7Zx7dFXVncc/55x77r1JIBBCSIhAkiYoQkArUhCrtrRVBHWm1WpptdbxMV1o26mOnXb6sEttq7aOVjtabWdq2/FZ2ooMY2tFK1YlgLwfCYQYkEdISEJCEu6957Hnj98+9557c8NjtY6sWfzWOuuce84++/nd399v/377XEMpBcAll1zCEFIEXGkYxidM0ywxDAPDMLISBHn4vo9SCqVU+tr3/fSR+9v3fTzPw/f9d5VSi5VSS3v6DL70qX185fN7YWCoKg0hBvx59zfZ0z+DiJk4zpffcxkNXIf0pwJeBt54X2sE44D/BD4PtOl7FcAvgWuA9uPJ7KqrrkpfR46S9gzTNH9pmuYZpmlimuYgUAFpMJmmmQaMYRj4vg9AAMbgdz7xff9GpdQS4Dql6Aw9GgZYQM9RW2aAr47WpPdN5gB3AY8DhcAS4Ebgt8g4VCGD2w+MAlJAn363DDiAALIUSOh01frcodOV6PdGAHv1vQ8AXcDBUF3G6XSTgTqddyD1+l4MOAXYg0yGglC6QmBkqIxBkh4Fy7Jyn401DGOJZVnjLctKgyofW4WPgIWUUscEqCAPANfj0oGk9RQwF+noawEDeCTvi2bo2oDGzktpP1xPxEwesbz3SWYBvwO+rH+PBc4DmhHWiABR4B912krgnxCWuxeoBTzgBeDbwBeA04A48BDwH8Bv9HsbgO8C9yOgjOp3lgI/A2YDvQh4VgBuqJ6nA+XAkwgAnwD+AvwQOBsB9+/08fhQjU0DyzTNrAeGYXwjANVQwMoFVC6YgrRyMvSRLb6ClGuQchSjhif46FkHLvzkBZ1vkWIa8LTu3EPZlRNmaj14Pnv7P4hpeHgqyu6+GRiG0m0/4eQMoFGfJwEfQgD1K0T1PA7cgoDhXgR0ceCrCGOMBq5CQHOJzuNfgGnA3cBLwFTgDgQMv0c64nbgIgRodcC5CHv6Oq/ncuo5C/gTcD0wAXgFAd9IhC0vBoYjQB5S0sCKRLJUSJFpmpdZlkUkEiGsBvMBK2wzBWnC6XzfwPMVGCoLwEqBaSjOPrWXOdPb+ci0TsrHpcBjJoovE+XhrLmEdFVP/ym82XYbnYm69E0DpZnqhARVFBmksQiguoCbgK0Iw/ybTtcC2MAmxAT4HjKwqxDmmgt8CgHNIeAfEBb7bwRohxBG8hHArQFu0GleAeYjTBSosH26rEAMBPi36zom9bs7EWa9BrgaAZ13pAan0WTbdvj+KNM0RwXAsixrEGDysVQ+UBmGQV8iwsVnrqeo0OapV2spiCZRymAgGeHSD7XwrRt2ilqzoKstwt2/ql5dEPUerq/rZ2pVP7atQIGvfOx4BVsPf4Oe5Fhs83it+/dNJiFGcT1iswTTZRRiI92PgOzbiB3WBExEwFGDgOpB/Xw3wnxjgOd1useAzyJg8BCAbEXUXZDmfuA24IvAu8A5Ov+1oXqW67p+Ved/DcJWTcBbyAT4JrDuaA0eCljKNE0ViUQGMRYMVoFiV/kYhpcFLMMwSLkRRtjbuGH+dgwjxrJ14+g+ZGFaJl7qAJfN2i3d4MO2HUX86+N1bGwpwDIVv10OhTEfwwCFwnUcPn3lAiZPHott9pNPtZ6gEgd+gcz8sHQBlwJfQwzxWxFjHoRZtiPgeAP4L8SWAlGZX0NWc1v1vX5EtYLQ9jXA13WaVQhr/ghZCH1S5/1DhLUCGQE8gADvcgRUd+ln3Qij3n8sDTYCw/n6668P3x9nmuZm27aLw4wVSLZdBYeTYKgU4OF5XuBCwFcGTduaue/6Vcw5zwUFz71UxyNL60kM9FI9aiPPfK8DTNi6Yzi3/HgKnT0mMdtZrRQzpCwpM5VyqKmp5uqrr8b3vbTBf1Lec/k7hOWqERX45lAJw+6GtMFj2/YxHQGL2bZNxC6gqyfF+RP/zDmnbcfxY5imiWVZ2LbNxs3vMO+DG5hzvguHgRRcOruV2opuWlr38pk5PTKPDFj02il09MQpjPtARqWaZnDArFkzsSzzJKj+b2UjYuBfwRFAlStDGe9pcORjLNM02d/Rx+6d6/n8R1dy1fwetu6YwBtNkzENWUW+va6REnszX79uQExAAB8KRrjMnriBFauiXDTbARcOdtmsbBzFsLiHYZh6ZZcRx3Goqamhrq4Ox3GOu2dOyl8lLfo4LhnSjxUAy7bt9DPLskgkkqxe24zT08CdN7RwzgwgCTVlbZSPPER3/wgaGzfzbutWXnygj8JiJWwVSALmn9NDaXGMgiIFJry1ZTT7DxYQt1N4nthmYVYyDIOZM2diWRaed8TFyEk5QeSIwApUXjQaxfM8du3aw8o1Wzmrags/uHU/ZeWkwy7xohT143fz0+c7Wb1qI9//4gBnTXcyvmMDMSk9qCjz+fuPHRbfbwSWravANBlk+AO4rsuECROora0Ns1UR8A1Ekf4AMSzD8jnEH/ME8PZR+qAcMYTfAX4yRJpPI36lx8leng8lBvDPiOf6Po7goT5O+SCymhuNuBQMJCLxKGL/1AHfRxYFf0tZCJwK3EMm9APSvuHIqjFLzQzpIA3bSr29PWxpfIe9e3Zzw9xmFl6+X5oUZiITqkaspqFhGBfNcrnlswOZWJ+BrEU8XbyvDxve3VPEhndKiNl+umphxvJ9n8LCwly2qkOWvYcQ52Cu3I74Y54/Soeh090KLGJoYH0FcSz+8hjyA3Ek3ou0/N5jfOdIUgD8O+J2yJXNiJP1AaSHv/03KC8sFnAn0qa7QveDCMF+neYeyITihgysGYaB4zh0dHTQ+m4ncfMA9y9s4sNnd4jNlBulcWByVQ+zptjcs7CPSFRJRAsgBo8+PYyPn51gYo2b8eJY8Nqmcg4NRCmIJhlKy0UikVyDfbI+v40sx8NiIt7nOLJcDqQAiXEpMvzZhYQwQIzUEn0dMGAE8efUIMv5XmRJ3od4ooNKGfpZQKkOstzvRmb4MOmFdNkpcqMJIiN0mUE6R+f7IAKq3QhTbyMTyjiAMEccMa7jup0HyTgxLZ13IAYy7cPUMFKnAxndbkQj1Ot+CZh6GBJemqnTDUPY/grEnwaEVoVB6EYfllLK6unppaPLYVp1Fw/d3MCHp3dIVfKF/jwYORx+dcdBJtemMqCKw7pNcW5/uJglbxRI9+qS3cMGyzdUYEcGZxhWi5WVlbmMeqY+b85Tk8AZeC0ChmJEVbQgzsmdupP+gHRwAKzvIAPXBLxIJoTShHjHi5AQyCPAdJ1Hi36nFViPOClBQiZ3AucjIPk94tTcjfiIGoGf6zzR+b2k67YH8XJvRlR0DeI9d4HPIP6slUADMnGayUy02bqMFsTrPlff/5i+Hxy7dP1v088rgNUIYIP+uRsJA72O4KRe1/123TcNul9ORQLqY8KDkB4t04qnD9u2I4qInXKjXDy9ke9e8yqnlPdlwDKEGEDVeDczT0xwEhZPvX4ew4tH8tzLNskeU0qNwNbWkTTvK84LrKPINH3OZ+9MQWaUq6u0CPHD7Edm1ItIR6aQQZ9KJrD6W/3eXIRxNur3QTr+h8CvgbN0Hi3AU8hAn46wCcAMZFfBQWQqzUZY5DfAYgTs1yNquAoB1ScQxnkMAWo5MsiXIj22mqG32UzR59eAZxCn6TQyarENAcp39PGkrt99iPe/WvdZC+JErUScqOsRAIFMxB/p/msELgD+iMRzb0FYKy1pYJUUdlNS1M3weC9Jx3Ys0+Wa85dx3YWvE4u4GZIPS4zsHQaQnc6G59+oZ3vbOD50Vh3Ne4t4eaUtZG3AK+srSTkmxlHiezkLizgSdgDYkid50MmvAxciA/YKMthfIRM8Xa1rPwkxrq9EvNQ/DYpFGCro2KeRQfkDEuUH+BbCJjfq34FqCRhkFTJghcCrCIsu0PUBMSq+iQzubcA8XccgzNKIqBw48t6tYKLdjgD2i6H80e14EgnLrACeRbbaBBH7oD+fRmy1TsTMeJbM5P2xbv8KhFWfQQBZp39nBbPTNtZXL3wUDEi5Ud7trBwbtxNWdeVuAUq+cS+EJS8VUjvOYfJEZzDwbGjeOZrnG+qxrQSWXUht7USe/OMh5s9J0t9rs6JxDNGI0Fuu0zPw7kejUSoqKsKG+wRgPGIjbMtTs3p93gxcpq+fIFPD2fq8FrFNRgHLQu+fps8b9XmWPjeG0gTAadXniaEyg+cKAf55+l4wCUydPthTdTECyPDCYDpicOxEGA1EDeUTE2FLBxlgyABlPWIn/R4Bba5sR2ypM/XvnYj9OFnXDWRChtsayAsI0xaSZxWa8bxHXGzLpSg+cNGk8c2Lqst3W2llkSsFsPiPMRbcMZJX345J1XNydVIWv1g2k0TKwjR8XNdlXGUpze21tO6ATe+UsvdAIZbpp0GVe8691jKJjJE5Ok/tApupiRy9ryVgtA2h62BWGvqe0u+DqErIAGM4Yld0ILZKOM1aRM1VI6q3DXERhMuoQNRQM5nFgE9mLAoQltuDMGl4gHP1A4jKrEFU0X59L2CwBkSlzUPU1hRk4gQM26zPZ+jzdsSQadflluj0XeSfxAmGcG1kVoUyfhaKB/EZly8xADFYv30Sd/66iFRyF29sjHGz05edxobFf5nK1l1jiNmH8X0dtPY9ho0Yz5KGNvrdMag0Ew8GVcBYsViMWCwWBlighgL18hpiL3nIkvwDyIDtQtTdFUhUfhZC8R/WHdJMZhYH7DQa6ch9yMCaZMB7D2KHbUaW3m+R8dKdqc/r9Ps2MkgKsccgw3jB7swWXU6TbtP/ICpyOLLSegux9xYhKv1zCGB2IRPARFTXRp1fIxnrNgDzZv0eCDN/UqeZHmq3gUyMPjITJZARZFbKDyL21Yscg+S6G8oQwy2/xGBN00SeeO0ipk4boKPjAKu3DNCx36KszJNuiMIOrQKjdnLQ/veiuOKVTfW4niJuu2nQwWB28jyP4cOHM2LEiPAu1BJkJispjQt15+xDBsFH7AMH2Q1wGmJn3Rh6Zxuy3A9AGLDJOKQVq8iozp8g20jmI53fqc+B7QWiUrsRVpurnweujgqEuYKwSOC6WKXrc6Ou5xn6CNg4YMifI+C+FlGhAaMaCLDG6fxW6vQ2Mo7tyArwGWRj4DSE9ZRuY69+ZxRiizWQvX0ZRP0+ijiIv4So7GMCVnp3A28bIF7d/IHGGLzdWMvPXr4QX5nEYyatra38eXkDT9/Vy/yPJSAJjmfx3Sfn0rinlKiZxMv+aALf93BchfJ9lArthMhK469WSs0I9notWLCACRMmBJ73AsSAz9WRDgKqUt3R3Tpt4IsqQlZYd+vOXoAMWBRRIZ7OdzQCjHAnlyAD2Y8MfCmiAgI1VUEG3MXITA+eVyIDGXyYEDzvROxEU5c7Rj+7D9nxeSWyigwkioDA1G03dZ4xXb8DyMCbOi+lnyudplTnE4ASRJ37utwkQ3++Uqbz6DpCmiN+THFq3jdisGpLDY+9NAdf+UQsh0TCoLKyknHja3h55Sbmf1ya/vyyejbvKqMgmsDzsr/IkUNh4ON6Dq7r4nkeiYT4MaLRaNZeL4BkMklDQwMTJkwIanOYbMderuzWZwPxr1xAxrVQhHT293WaAznvJkLvhyU3ZJTbueEwRy/ZTtvccE74eS2yeo0iE6MIUYV/QnaFhiWVU04gDhmVDAKU3HTJPPUIS277cqXjKM8HSS6w6geliEHDpmoe+cMFKOUTsVzc0HbhqVNOZfOudvz+d9jZMZrfrZhCNJIcBKgwYFzXpby8PB3knjRpEu3t7SxfvjwrLch2nm3btrFz506qqqqOZ3eDiQzQBjIzfA9iJx13tP49Eg9Zpgfsq5D6PsuRJ88JL7nAOj3rVxzWbqnkxy/Mxscnarm4KnvDXzwWIVY8mTVN7SxddxaHEwbRiJNWgfmOZDJJTU0NY8eOpbS0lPXr1zNv3jzWrVtHZ2dnVqwwCC2tWLGCqqoqjkM8/jZxuvdSWpGPRf7fSSTnui79Kw5rtpRz36JzSHk+MTuJ68lqN7xF2fM8ioYV87NlF9DVNwzbSuJ5+T9OzWWtRCLB4cOHaWtr44UXXsDVVBhmLKXUX8NaJ+V9krBfpBK0m8GG1RvHcNeTM+gbUBgqheO4OI7YRcE5ODzXof1gEb7nprcmZ21Rzvny2XGc9AeuixYt4tprr2XNmjV0d3cHn46Zud8rplIp3nzzzbwfzJ6UE0/CwKoGirDgQFfs9e89Pe1A34CBaaSygOR53iBweZ4HyskLptxVn2VZlJSU4Ps+lmXR3t7O0qVLWbhwIUDwsWsiF1i2bdPY2MiOHTuIRnM9siflRJMwsCQMYLP0zU1l89o67bWWmcJ1sxnIcZxBrDTUkctWjuNQVlbG5ZdfTl9fH0opbrrpJlauXIlSitLS0gBYr+dTo77vs3jxYnp7ewftHzspJ5aER+c8YDmKK9c2j+xTvvtwWN3lMlYYQOHfYXbKBZdSip6eHqqrq7nsssvYt28fruty8803U1xcTH9/P0qpXqXUY/kqG4lE2L9/P2vXrj3JWie4hI33Ncj/CgwoFAq1xPO8O5VS3wlWafm2DgeSG4oZ6vP7zs5OHnroIYqKimhpaSEajVJZWUlnZyf9/f0JwzC+QM4WjKwKRyI0NTVx7rnnDtobf1JOHAkD64HgIoCMUuoO13W3GIZxq2maUw3DKMj3xyBhyQesXHC1tbXheR6madLf38+WLVt6gb+YpnkX2bs+B4lhGCSTyaz/hjgpJ578LzXVOI5QBFhrAAAAAElFTkSuQmCC",Hf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAgCAYAAADwkoGKAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5goDBwssgK9G3QAAEq5JREFUeNrtnHtsFNe9xz8zsw9717s2Zv0Ib0LBJEAOIQkl0Eua3Ju2N6LcNmracG9VqWpVqWrzb1QpUh9qm6pKpVaR2ihR1fSPKgVKm5oktzeBAMmlkIILHGxMCGAMfuHX4rV3vd7HzNw//Ju9441NTJq2AXGk0T7mzJkz5/c939/vfH9n12AW5aGHHlpqmuYi0zQjxmRxAQzDwHVdAFzXnXI4jvOu1xkOw3Ec13GctOM4nceOHeviBi1a6zrgDsABTKBVKTXwT+7TfGAt8CellCPffQRYqpTa837bDbxXhS1bttxrWdYK0zQLlmXlAFfAVQKU9+oHkWmaOI5TAp9hGFMOrwhIDaAWWLpmzZq21tbWY975tra2EFANJFevXm1f59haA8wF2uWZPqG1blZKjWmt5wEx4LxSqqi1rgXGlFIFrXUIqFBKjYrh5yqlhrXWVcBCoMd3LgpEAVMpdVlrXQPcAnQppdI+QDUBw0ACwAOVlFogqLVeDEwopfrlXqbvPjEgrJQaumZgbd26VVmWtdKyrGHLshzTNEuAmomtbNt+F5gcx5m2fcMwsG0by7IAcplMxrp8+bJatmzZ2PPPP9+1cOHCNZlMJgK8Dbg3AGnFgf1KqUExzmKgRmu9FFgGZIEmrfVeQAFdwDngE8Jwu+WalVrrd4BbgXFgqdb6mFLqMvAQEASOa60rgI8AGanzFjAKfBrIAY3AAuB4WT8rgBpgKdCgtT4MhICVwMtaawv4d+AIcG3A+sxnPlNlWdaKQCAwYlmWa5qmYZpmCSzloPLYygOSx1Z+EE1MTGBZFpZl4boupmlimiYDAwOk02mjsbHR/uxnP5vcunXrbbfeeus9uVwuHQwG32hqakrdAG6wQsZ7kdZ6DrAE6BF2aQKalVJ5rfWnxIBJwNBaVwN1QKfW2pS6F6VOVsDXKGBLC6heEhb8L6BT6iwAbgcmgLTn5rTW/wn4mcwUUB1VSp3VWi8A7gIOiWcBuAcYUkp1XrMrDAQCtwQCgVAgEJgIBAL4QeUv5THUdO4uEAiQTqeprKwsMZppmgCMjIywfPlyHnzwQdatW2c0NTXZhmHE2tvbL23atOngDRRi1Yhh4uJqssCfgbuBlFIqL/WCwkJXgNXAYuB1YI4w1xDQIXFRh9Q/JyBdCgwKqBrlfpelTrtcuxFoERCF5F7+iVsNVCqlzsrnSmHLJJDSWn9M6rz2vmKsUCgUDAQCBAIBLMsqsYtXPKbyx1KmaZaA4xXTNEmnJyfEt771LV544QWOHTvGnDlzyOfz2LbN448/zqpVq5iYmCCXyxlPP/201dzcfOEGi92XAwWl1P4yJusClmmt7xX2soB3gLC4w6NKqUsSUN8OPCPMNgrUAyMSIyWlDQ8kKTlXJyAuSqx0CdgkrnQ54Cil/MCqF/f8McCWOgeVUrbW+oqAe7tSqnC1hzVnOhEMBp1gMOgGg0FCoRChUIhgMDjl8IAXDAZL7s4DogfGSCRCR0cHn/zkJ1m/fj33338/tm0TDAbp7e1l5cqVLFmyhKGhIVKpFN/5znf49a9/7RSLxegNBqxLwNHyL5VSfcAeiWFGgZclkC4A/+OxC3AGeFEplZXPeyVOmiPXIax0StrNSrseC43J938FTgpw24D/LetSCnhZmK4C2KuU6pBzc2Ul2/NeD2vMdOIrX/nKymAwuC4QCIz5XaF/Beg4DuFwmOHhYYrFYsnV2bZNsVikurqa/fv3s2zZMp599lnGxsYIh8P8+Mc/5vjx45w9e5annnqKLVu2MD4+zo9+9CNefPFFFi1aFDMM4+iRI0fOcrN8GOLDlSKTjAL7fG77fTFWiY3KGcqyLKqqqqitraW9vZ3Kykq+/OUvE4/HyeVyGIZBIpHg5MmTDA4O8t3vfpdisUg2m8WyLD7/+c9z+vRp5s+fz/33308ul6Ojo4NDhw6xYMECAoFAaXFws3woSo8w557ZgOq9gnc8NxgIBEorQcuyqKmp4cKFC+zbt4+NGzfy2GOPUV9fT0tLC52dnTQ0NHD+/HkOHjzIs88+y5IlS+ju7sayLEZHR1mxYgX19fVs2rSpBMa//OUvZDIZbrnllnfFaTfLP7copcY8V/o3C6SWZZXA5b2PRqMUi0VeffVVWltb+epXv8rXv/51stlsaXXX0dFBX18fzc3NbNu2jc997nP09vaWAn/btslmszz99NNUVFQwMjJCoVCgpaWFaDQ6RZ64Wa7fclVgeYCqrq7Gsiw6Ozt55ZVXcF2XZ555hs2bN3P58mUKhQKhUIimpiZ2797Njh07WLRoEU8++SQjIyPYtl1yofl8nnQ6TVNTE4VCAcuyOHnyJOfPn6e6unrWoNJaN8hS/ZxS6kzZuSCwCSgCh8pU5enamgesA/4qwfR0dT4q43X4vdqT+lXAx2T5/9cPKNYJiuCZEAnBASLAWdGcNotaf/wDjrEMYIN8fEsp5frOzZeVbK9SqviewDIMA8uyqKioIJ1O09rayltvvcWGDRv4wQ9+QHV1NV1dXSWZoVgsUl9fT19fH47j8POf/5xoNEpvb28JqJ4rdV2XTCYDQDQa5ciRI+RyOaqrq7Fte7bgmidaznRAqJRUR/9sQCBa0UrRlaYbWFOAd3GW7SHSwaJrdSFXMW4t8ICIocMidHq62GkRYO8G3vo7EdBdAmBX+lMJrBJQ5WTFeHw2KR3XdV0GBwdpa2tjcHCQxx57jC9+8Yvkcjn6+/un6FqeWHrPPfdQV1fHhg0b6OubtHltbS0HDhxg586d/PSnPy1pYKFQiKGhIU6cOEEsFrvWh40Cg0D/NOfs8nSDgKNWFiyODEhWcl+VQC8Q0VoHRPO5ItfFBKRZEQgbRR+ypT1bDGwAw0opL5+ZA94Eun3AsHyr8azELuXqvDcQjtgnKcy7WTSpN4G3RcsyAEMp5Witb5XUTVZrnZDnLPVHax0Wkdbf3zFPvpA0zRy5zgRySqkrWuuIpI4ywKjv+efI8xTkc2hWrjAcDgdyuZxx7tw54vE43/jGN1i/fj2pVIpcLvcuUAEMDw/zyCOPEA6HGRwcxHGckv71y1/+kjfffJNvfvObrFq1iuHhYaqqqjh8+DDd3d0kEokZc4ozUHO1pCLSMzDQfaLjDEtaYqPM7qIYPSKz+5QMigv8q4xJUWv9tuhOd4pIOADMZzKR/KJc/28ysF4Z0VoflMTscmHUnQLqB0UXMrxZrrVuVUppeabbhRVCYvys3OMPMokWAO1KqZO+oNrl/3OocVHRbxdhtbw/q4B/ERAYAp6s1vqIUuq8uNdPyfi4gKm1PiKT5zaZpIuk7d9L/7IyEUJl6v3MwHIcx0wmkzQ1NfGFL3yBhoYGhoaGSmq7Pxbz3Jdt24RCIRzHIZ/PYxgGsViMffv2kcvlANi+fTs/+clPME2zFLS/j2C9SgZyptVKjbz2yYx7SDSYN2TwF4rRBwSkCXGpZ0Q4XC0GOgNoGehlwGExzKAANS/gHBfQ3c3kToIhmdF5ue8cmQjtwAUByjpxv1prvUhAeo7JhPuEANiS9yuFwS5eZUziUueITByvP4ulP6fl3h6jeq51NXBeQFwF/EkmyzZR4dsEOEuZzBeOSXtV8qxvSz9X+b3HjDrWxMREbt26debXvvY1amtrSSaTUwBg2zbRaJSKioop6Z1isUixOBnDVVVV0dPTw44dO1i6dCl33nknL730EhcuXKCuro6uri7a2tqoqakptTHLUi0Plpoh5omLC5kQYc8EXldKnRXVuCAzMylt1TC59aRbZu+YGCAn6Q6PGc4ppby4rV7uf0Yp1cVkohcf0OPAFWGVWjFOh1KqRyn1jhg/JQH5XWKUV5VSHUqpXpn0KR8IRr30zQwxYC2TyeWzSqlLPhBmfUp8WPpdJ+yZFRfnjaktz9Erk+q8UspjOEfavqyUcsWNt8gkqQRaZ8VYDz/8cH1DQ0Petm3Gx8ensJRt2zQ0NHD06FG2b9/OE088UYqxPGU+GAximia/+93vSgnoO+64g87OTv74xz/yxBNP0NLSwvDwMA0NDSXWm2WJy8AkpxnkChmkYVk5LQAueVtVfPmwlOS/5spMz/hWXrVAUik1IfUbgQFfvBITYF8sa7MADEqcFhcG8oCRFaAje6SqmUwiR+XaFl/7UbnmrLRZKUYfv0q8GZ+hPz0yJv8h7aTleQ0ZnyFfH8eAoFJqHGj2jUeDhALl+tawjPN7K+9tbW2h06dP39fY2LjQtu1MPp+fAirHcairq6Ojo4MvfelLbN++nZGRESKRyFTLx+O88cYbnDhxgkQiUVLeV61axfHjxxkYGODUqVOEw+EpbFX+ehVgTQB1EpSWn6uS2Z0Tmq6UVYw3u+cwuXvAy39N+Jgm5rGN1J8j342X3SNSFlfMATJKqYy0WeG7h2e0tO8eETmf933nB0qVMJAj7FoJ3CqgRWttyLN49SNljFYj16fErTcwuRdsl1LqD+Li475r5gAjAirKnivmY7b3rWM12ra9zLbtwUnPZ0wBVSwWI5VK8atf/YrR0VEcx6GlpYVt27YxNjaG67rEYjF6enpobm4uiZ6u65LL5UgkEmSzWZ5//nkGBgaIx+PXBCoZzHkyg5cA9VrrjBhCC5gSTO4kcGX3wF3Ap7XWw+LSLN9MXSzGTfuAVudL/noDsEhrvQU4KEb2YjxvVi/wgc/bDeox6kLgsi8dUi/ni0qpca11L3Cb1jou/Qj4gmMvAd0A3MvkvitbSKFCa/2iAMtbzCDgW+i7PiostUI0O0fas2VxE5SY7OR06oA3TtK/E+KqrzlXGBXjvEtKiMVijI+P84tf/IJQKMTDDz8MwOHDh0tbZ0KhEIZhsGvXLsbGxohEIti2PWWHqWVZHDhwgPHx8ZKu5e3r8h8zpTF9gfZpeT8urJOX4x0JsFFKHZLVYZ+4hgqJNTyGugKc8Yl7jrigfrk+KfpWv1xryj3e9rmBkAD1HflclEDdM1q/BMheyctq1GOB/5ZFQMrHTrYHFBGA90j7Y3JdRoBbkD6f9k2WsLz37nlSJp0nKSRkvNokVopIbHVpGnc3KJNpUOrNapVlTOMK18sKKF0Oqmw2y3PPPUdvby+JRIJ4PM6uXbsYHx9nz549BAIBYrEYe/bs4Te/+Q1z584t7YKwbXvKa6FQKLXt/16OmG3bR48ePfo3724QF1gQQAaBj8oKZ5eA5u+9M8DwK9XTnLcEmEXpX4VIEy7wB7+a/c/q4weV0on6lqQ4jkM8Hi8xVU9PD4lEglwux9jYGA888AC//e1vOXToENu2baO9vZ3m5uZSzFX+qxyPjQKBAMlkEsdxyGazJcabO3duSZr4gNTqrWKkvBjOAt74R4DKpzVdrSwTqSElzFMhHmP/PwJUs+zj3wYs+UVMVGYPjuNQU1NDJpPhZz/7GT09PTQ0NJTYJp1OE4/HWb58Oe3t7ViWxY4dO0ilUtTV1VEsFt8FKM/tZbNZNm/eTDKZZN26ddTX17N//35ef/11qqurP6htM1nggG+iGBKgjn6I8rX9TG7oy/sU8X6lVI7ruASmER4rgIIHqnQ6zVNPPUV3dzeNjY3k81O34ySTSRYvXgzACy+8QGtrK7W1tVNANd2RyWRYu3YtiUSC7u5uent7efTRR9m1axexWOwDAZZoN50fZgPIqu26/7HIbIAVdBwnV1NTY2QyGfeHP/whly5dYv78+SU1vXylWFlZSX9/P+fOnSMajZaCdD9blQPLMIyS8r5y5Up2797N3r17mTdvnlf/5r6Z67iUrwpjrusSiUTCyWQy/L3vfc85e/YsdXV15PP5kqpeKBRK723bplAokM1mS9uXve+nYyrLsrhy5Qqjo6MkEgn27t3LwYMHefzxxzl8+LC3e9Rwb24hvaGAFQVikUhkYOfOnWeOHz9eWV9fPwVIHmjK33s48INqOnClUinWrFnD4sWL6evrY+PGjezevZuLFy/y/e9/n66uLi8Wm7hpnhvHFd4SDodHe3t7//zkk0/aGzZsuK1YLAYMwyjO9BP5KUpamQ413f84dHd38+1vf5tTp07R19fHxz/+cerq6njttdd49NFHXdu2KxzHGXddd+CmeW4cxgqGw+E/3X333TZAMBh8u1Ao1Ni2bRSLRdf/Cxzv/XSHn6HKP0ciEfbv38/atWuZN28ezz33HLW1tTzyyCPuwYMHrUAgEHNdt/3kyZO5m+a5fotRJjckVq9ePeW3+Pfdd9+9pmmuME2zYJpmzvsTj+lYqzznNx1rGYbBlStXqK+vZ2Jigu7ubrexsdGorKys6O7utiKRSJvW+thN09xAwJqpbN68ealhGItM04yKKywF1v7/cbgauDxgeXHYxMRkCBUKhYxsNusWCoV0MBjsbGtr67ppluu//B9N0zw2U/fnYwAAAABJRU5ErkJggg==",Uf={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)=>Uf.multiply(t,Uf.translation(e,i,s)),xRotate:(t,e)=>Uf.multiply(t,Uf.xRotation(e)),yRotate:(t,e)=>Uf.multiply(t,Uf.yRotation(e)),zRotate:(t,e)=>Uf.multiply(t,Uf.zRotation(e)),scale:(t,e,i,s)=>Uf.multiply(t,Uf.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],S=t[0],x=t[1],b=t[2],v=t[3],M=t[4],A=t[5],T=t[6],w=t[7],E=t[8],I=t[9],C=t[10],k=t[11],P=t[12],F=t[13],B=t[14],_=t[15],L=[];return L[0]=i*S+s*M+r*E+n*P,L[1]=i*x+s*A+r*I+n*F,L[2]=i*b+s*T+r*C+n*B,L[3]=i*v+s*w+r*k+n*_,L[4]=o*S+h*M+a*E+l*P,L[5]=o*x+h*A+a*I+l*F,L[6]=o*b+h*T+a*C+l*B,L[7]=o*v+h*w+a*k+l*_,L[8]=u*S+c*M+d*E+f*P,L[9]=u*x+c*A+d*I+f*F,L[10]=u*b+c*T+d*C+f*B,L[11]=u*v+c*w+d*k+f*_,L[12]=g*S+y*M+m*E+p*P,L[13]=g*x+y*A+m*I+p*F,L[14]=g*b+y*T+m*C+p*B,L[15]=g*v+y*w+m*k+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],S=d*p,x=m*f,b=a*p,v=m*l,M=a*f,A=d*l,T=r*p,w=m*n,E=r*f,I=d*n,C=r*l,k=a*n,P=u*y,F=g*c,B=o*y,_=g*h,L=o*c,D=u*h,z=i*y,O=g*s,R=i*c,V=u*s,N=i*h,G=o*s,H=S*h+v*c+M*y-(x*h+b*c+A*y),U=x*s+T*c+I*y-(S*s+w*c+E*y),W=b*s+w*h+C*y-(v*s+T*h+k*y),X=A*s+E*h+k*c-(M*s+I*h+C*c),Y=1/(i*H+o*U+u*W+g*X);return e[0]=Y*H,e[1]=Y*U,e[2]=Y*W,e[3]=Y*X,e[4]=Y*(x*o+b*u+A*g-(S*o+v*u+M*g)),e[5]=Y*(S*i+w*u+E*g-(x*i+T*u+I*g)),e[6]=Y*(v*i+T*o+k*g-(b*i+w*o+C*g)),e[7]=Y*(M*i+I*o+C*u-(A*i+E*o+k*u)),e[8]=Y*(P*l+_*f+L*p-(F*l+B*f+D*p)),e[9]=Y*(F*n+z*f+V*p-(P*n+O*f+R*p)),e[10]=Y*(B*n+O*l+N*p-(_*n+z*l+G*p)),e[11]=Y*(D*n+R*l+G*f-(L*n+V*l+N*f)),e[12]=Y*(B*d+D*m+F*a-(L*m+P*a+_*d)),e[13]=Y*(R*m+P*r+O*d-(z*d+V*m+F*r)),e[14]=Y*(z*a+G*m+_*r-(N*m+B*r+O*a)),e[15]=Y*(N*d+L*r+V*a-(R*a+G*d+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 Wf{constructor(t){this.yB=t}}class Xf{constructor(){this.SB=new Array,this.xB=t=>(this.SB.push(t),t),this.bB=this.xB(new Map),this.vB=this.xB(new Map),this.MB=this.xB(new Map),this._B=this.xB(new Map),this.AB=this.xB(new Map)}wB(){this.SB.forEach((t=>{t.forEach((t=>t.wB())),t.clear()}))}}class Yf{constructor(t,e){this.Jo=t,this.j=e,this.kB=!0,this.CB=null,this.TB=null}}class jf{constructor(t){this.FB=!1,this.IB=1,this.PB=t,this.DB={Jo:u(0,0),j:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),kB:!0,CB:null,TB:null},this.BB=u(64,64),this.OB=new Uint8ClampedArray(this.BB.x*this.BB.y*this.IB)}LB(t,e){if(!t.kB)return null;if(t.CB&&t.TB){const i=this.LB(t.CB,e);return null!==i?i:this.LB(t.TB,e)}const i=c(t.j.x,t.j.y);if(t.Jo.x+t.j.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.BB.x-t.Jo.x-1),t.Jo.y+t.j.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.BB.y-t.Jo.y-1),t.j.x===e.x&&t.j.y===e.y)return t.kB=!1,t;if(i.xt.j.y)),h?(s=new Yf(ri(t.Jo,{x:0,y:1}),u(t.j.x,e.y)),r=new Yf(ri(t.Jo,{x:0,y:e.y+1}),u(t.j.x,t.j.y-1-e.y))):(s=new Yf(ri(t.Jo,{x:1,y:0}),u(e.x,t.j.y)),r=new Yf(ri(t.Jo,{x:e.x+1,y:0}),u(t.j.x-1-e.x,t.j.y))),t.CB=s,t.TB=r,this.LB(t.CB,e)}RB(t,e){const i={EB:!1,Jo:null};let s=this.LB(this.DB,e);if(null===s)for(;null===s&&this.BB.xthis.PB||t.y>this.PB)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.IB);for(let i=0;i{this.yB.YB(t)})),this.HB.clear(),this}XB(t,e){const i=this.WB.get(e);if(i)return i.get(t)}ZB(t,e,i){let s=this.WB.get(e);if(s||(s=new Map,this.WB.set(e,s)),s.has(t.glyph))return $f.Success;const r=this.UB.RB(i,t.size);if(!r||!r.Jo)return $f.Fail;r.EB&&this.KB();const n=this.UB.NB(r.GB);if(!n)return $f.Fail;let o=this.HB.get(r.GB);if(!o){const t=this.yB.gl.createTexture();if(!t)throw new ft("Failed to create texture for font!");o=t,this.HB.set(r.GB,t)}const h=r.Jo,a=n.BB.x,l=n.BB.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,S=[g,y,m,y,g,p,g,p,m,y,m,p],x=[u,c,d,c,u,f,u,f,d,c,d,f],b={origin:h,size:t.size,advanceX:t.advance,baseline:t.baseline,vertices:x,texCoords:S,packerId:r.GB,texture:o};s.set(t.glyph,b);const v=this.yB.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.BB.x,n.BB.y,0,v.LUMINANCE,v.UNSIGNED_BYTE,this.yB.qB?n.OB:new Uint8Array(n.OB)),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.EB?$f.Resize:$f.Success}KB(){this.WB.forEach((t=>{t.forEach(((e,i)=>{const s=this.UB.NB(e.packerId);if(!s)return;const r=e.origin,n=s.BB.x,o=s.BB.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 Zf=t=>{if(t instanceof _i||t instanceof yu)return t.ni()?"linear-highPrecision":"linear";if(t instanceof Li){const e={};return t.x instanceof vi&&(e.x={base:t.x.qt()}),t.y instanceof vi&&(e.y={base:t.y.qt()}),["logarithmic",e]}return"linear"},Qf=t=>(e,i)=>i%2?e:e+t;class tg{constructor(t){this.JB=new Map,this.QB=fe("font"),this.tO=new Map,this.iO=new Set,this.yB=t}jB(){return this.JB.forEach((t=>t.jB())),this.iO.clear(),this}sO(t){this.iO.add(t)}eO(t){this.iO.delete(t)}hO(t,e,i){const s=`${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let r=this.tO.get(s);r||(r=this.QB(),this.JB.set(r,new Kf(this.yB)),this.tO.set(s,r));const n=this.JB.get(r);if(!n)throw new ft("Failed to get font texture!");let o=0,h=0,a=0;const l=t.split(""),u=e.size,c=.7*e.size,d=Math.round(1*e.size);let f=!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)}})(a,h-o+1,i);return{x:g.x,y:g.y,isEstimate:f}}rO(t,e){const i=`${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let s=this.tO.get(i);s||(s=this.QB(),this.JB.set(s,new Kf(this.yB)),this.tO.set(i,s));const r=this.JB.get(s);if(!r)throw new ft("Failed to get font texture!");let n=0,o=0,h=0;const a=t.split(""),l=new Map;let c=0;const d=e.size;for(let t=0;t{t.$o.o=!0})),t=-1,c=0,o=0,n=0,l.clear();continue}if(a===$f.Fail)throw new ft("Failed to create glyph");if(h=r.XB(i,d),!h)throw new ft("Failed to get glyph after creation")}if(""!==i.trim()){let t=l.get(h.texture);t||(t={vertices:[],texCoords:[]},l.set(h.texture,t)),t.vertices.push(...h.vertices.map(Qf(s))),t.texCoords.push(...h.texCoords),o=Math.max(o,h.baseline),n=Math.min(n,h.baseline-(h.size.y-1))}c+=h.advanceX}h=c;const f=y(u(0,n),u(h,o)),g=[];return l.forEach(((t,e)=>{g.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[g,f]}}class eg 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 ig=(...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},sg={roundUnsigned:{aO:"roundUnsigned",lO:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{aO:"linearStep",lO:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{aO:"decodeUbyteRGBAEncodedFloat",lO:"\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:{aO:"texelFetchWithFallback",lO:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{aO:"texelFetchWithFallback",lO:"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:{aO:"texelFetchUnsignedWithFallback",lO:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{aO:"texelFetchUnsignedWithFallback",lO:"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:{aO:"modulus",lO:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{aO:"computeScreenSpaceWireframe",lO:"#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}"}},rg={"2D":"\nvoid main(void) {\n gl_Position = vec4(posWorld, 0.0, 1.0 );\n}\n","3D":"\nuniform mat4 uViewProjectionMatrix;\nvoid main(void) {\n gl_Position = uViewProjectionMatrix * vec4(posWorld, 1.0);\n}\n"},ng={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 og{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>hg(t)));for(const i of e)t=i(t);return`${be(this.modifiers.filter((t=>ag(t)))).map((t=>t.lO)).join("\n")}\n${t}`}}const hg=t=>"function"==typeof t,ag=t=>t&&"object"==typeof t&&"aO"in t,lg=(...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},ug=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),cg=(...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},fg=(t,...e)=>i=>{const s=e.filter((t=>!1!==t));for(let t=0;t{if(!l.includes(e))throw new Error(`ShaderAfter misusage (not found: "${e}", match: "${t}", result: "${l}")`)})),l},gg=(...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},yg=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=lg(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=lg(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return gg(`\t${r} = ${s};`)(i)},mg=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e};class pg{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new gt(`Could not find ${this.uO()} ${this.cO()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}uO(){return this.id.toString()}cO(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class Sg extends pg{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class xg extends pg{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class bg{constructor(t,e,i,s){this.dO=new Map,this.fO=new Map,this.ft=i,this.gO=i.createProgram(),this.pO=`${t.uO()} vertex`,this.mO=`${e.uO()} fragment`,i.attachShader(this.gO,t.shader),i.attachShader(this.gO,e.shader),i.bindAttribLocation(this.gO,0,"aPos"),i.linkProgram(this.gO),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""}yO(t){return pe(0,(()=>Se()))}SO(t){const e=this.xO(t);if(void 0===e)throw this.yO(`Could not get ${t} uniform from ${this.pO} and ${this.mO} shaders.`);return e}xO(t){const e=this.dO.get(t);if(e)return e;const i=this.ft.getUniformLocation(this.gO,t);return i?(this.dO.set(t,i),i):void 0}bO(t){const e=this.vO(t);if(void 0===e)throw this.yO(`Could not get ${t} attribute from ${this.pO} and ${this.mO} shaders.`);return e}vO(t){const e=this.fO.get(t);if(e||0===e)return e;const i=this.ft.getAttribLocation(this.gO,t);return i>=0?(this.fO.set(t,i),i):void 0}G(){this.ft.deleteProgram(this.gO)}}const vg=(t,e,i)=>()=>{t.MO=e,i&&i()};class Mg{constructor(t,e){if(this._O=0,this.AO=0,this.wO=!1,this.MO=!1,this.kO=!1,this.CO=!1,this.TO=!1,this.FO=new Set,this.IO=new Set,this.Md=e,this.ft=t,this.PO=null,this.wO=e instanceof xt.HTMLVideoElement,this.Md instanceof xt.HTMLImageElement)this.Md.addEventListener("load",(()=>{this.CO=!0,this.DO()})),this.Md.addEventListener("error",(()=>{this.TO=!0})),this.Md.complete&&(this.CO=!0,this.DO());else if(this.Md instanceof xt.HTMLVideoElement){const t=this;this.Md.addEventListener("canplay",(function(){t.AO=this.videoHeight,t._O=this.videoWidth,t.CO=!0,t.DO()}),!0),this.Md.addEventListener("play",vg(this,!0,(()=>this.DO()))),this.Md.addEventListener("playing",vg(this,!0,(()=>this.DO()))),this.Md.addEventListener("pause",vg(this,!1)),this.Md.addEventListener("ended",vg(this,!1)),this.Md.readyState>=1&&(this._O=this.Md.videoWidth,this.AO=this.Md.videoHeight,this.MO=!this.Md.paused,this.CO=!0,this.DO())}else this.CO=!0,this.DO()}sO(t){0===this.IO.size&&this.CO&&this.DO(),this.IO.add(t)}eO(t){this.IO.delete(t),0===this.IO.size&&this.unbindResources()}BO(t){this.FO.add(t),this.kO&&(t(),this.OO(t))}OO(t){this.FO.delete(t)}DO(){if(this.TO||this.kO||!this.CO)return;const t=this.ft.gl;if(!this.PO&&this.Md&&t){this.PO=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.PO),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.Md,o=this._O>0?this._O:n.width,h=this.AO>0?this.AO: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._O=o,this.AO=h,t.bindTexture(t.TEXTURE_2D,null)}this.kO=!0,this.FO&&this.FO.forEach((t=>{t(),this.OO(t)}))}Ts(){const t=this.ft.gl;if(!this.TO&&this.kO&&this.PO){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.Md;n&&(t.bindTexture(t.TEXTURE_2D,this.PO),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}LO(){return this.PO}unbindResources(){return this.kO&&(this.PO&&(this.ft.YB(this.PO),this.PO=null),this.kO=!1),this}}class Ag extends Or{constructor(t,e,i){super(t.ls,e,i),this.qm=!0,this.$m={},this.Zm=p(Po),this.As=t,this.ct=t.ct}RO(){var t;return this.Zm.o&&this.Zm.M().type!==(null===(t=this.EO)||void 0===t?void 0:t.type)}sy(t){return this.qm=t,this}zO(t){return this.$m=t,this}}const Tg=(t,e)=>[lg("uniform float uLookupMin","uniform float uLookupMax","uniform sampler2D uLookupTexture","uniform float uLookupTextureHeightPx","uniform vec4 uFallbackColor"),sg.texelFetchWithFallback[e],dg("colorFragment","vec4 colorFragment = vec4(0.0)",`if (${t} <= -340282346638528859811704183484516925440.0) {\n colorFragment = uFallbackColor;\n } else {\n int texCoordY = int(clamp((${t} - uLookupMin) / (uLookupMax - uLookupMin), 0.0, 1.0) * (uLookupTextureHeightPx - 1.0));\n colorFragment = texelFetchWithFallback(uLookupTexture, ivec2(0, texCoordY), vec2(1.0, uLookupTextureHeightPx));\n }`)],wg=[lg("uniform sampler2D uMaskTexture"),lg("varying vec2 vMaskTextureCoord"),fg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],Eg=[lg("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;"),fg("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)")],Ig=t=>void 0!==t.find((t=>{var e;return null===(e=t.VO)||void 0===e?void 0:e.NO})),Cg=t=>void 0!==t.find((t=>{var e;return null===(e=t.VO)||void 0===e?void 0:e.GO})),kg=t=>void 0!==t.find((t=>{var e;return null===(e=t.VO)||void 0===e?void 0:e.WO})),Pg=(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(lg("attribute vec3 aNormal"),cg("vec3 normal = aNormal")),"linear-highPrecision"!==n)i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&(!0!==c?s.push(cg(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(cg(`${r} ${t.variableNameAxisCoord} = ${e?`vec3(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y, ${t.attributeNameAxisCoord}Z)`:`vec2(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y)`}`)))}));else{if(!0===c)throw new Error("splitPosAttribute: true not supported with axisWorldTranslation: linear-highPrecision");i.forEach((t=>{s.push(cg(`${r} ${t.variableNameAxisCoord}_highpart = ${t.attributeNameAxisCoord}_highpart`),cg(`${r} ${t.variableNameAxisCoord}_lowpart = ${t.attributeNameAxisCoord}_lowpart`))}))}if(a&&a.rotation){const t=a.rotation.dataType,e=("uniform"===t?"u":"a")+"Rot";s.push(lg(`${t} vec2 ${e}`));const i="aInstanceGeo";s.push(cg(`vec2 rotatedGeo = vec2(${i}.x * ${e}.y + ${i}.y * ${e}.x, ${i}.y * ${e}.y - ${i}.x * ${e}.x)`))}if(a&&s.push(lg(`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(lg(`${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(lg(`${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(lg(`${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(lg(`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(lg(`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(lg("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("logarithmic"===n[0]){s.push(lg(`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(${Ai(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(lg(...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(lg("uniform vec2 uRatioPxClip"));const t=("attribute"===a.dataType?"a":"u")+"OffsetPixels",e=!0===a.symmetric?"float":r;s.push(lg(`${a.dataType} ${e} ${t}`));const n=a.halved?" * 0.5":"",o=`${t} * ${a.rotation?"rotatedGeo":"aInstanceGeo"}${n}`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${o} * uRatioPxClip`)}))}if(a&&"wu"===a.sizeUnit){const t=("attribute"===a.dataType?"a":"u")+"OffsetWU",n=!0===a.symmetric?"float":r;s.push(lg(`${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(lg("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(lg(`${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(lg("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(dg("gl_Position =",...f)),s},Fg=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(fg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(fg(i,`${o} ${s} = ${i} * uScale + uDisp + uScaleStart_highpart + uScaleStart_lowpart`));else{if("matrix"===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(fg(i,...t))}}return r},Bg={"2D":{idFeature:"2D",apply:t=>({idVertex:"2D",idFragment:"2D",defaultVertexShader:"2D",defaultFragmentShader:"FragmentShader"})},"3D":{idFeature:"3D",VO:{NO:!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:${ig(t)}`,idFragment:void 0,vertexShaderModifiers:[lg(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),gg(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTexture;return{idFeature:"Color",VO:{GO:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,WO:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(r,n)=>{let o,h=`Color:${ig(t)}`;const a=[],l=[];if("uniform"===i)l.push(lg("uniform vec4 uColor"),cg("vec4 colorFragment = uColor"),...s?wg:[]);else if("attribute"===i)o="colorAttribute",a.push(yg("attribute vec4 aColor","varying vec4 vColor")),l.push(lg("varying vec4 vColor"),cg("vec4 colorFragment = vColor"));else if("texture"===i)o="colorTexCoord",a.push(yg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),l.push(lg("varying vec2 vTextureCoord"),lg("uniform sampler2D uColorTexture"),lg("uniform vec4 uColor"),cg("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)&&"image"===i[0])o="colorTexCoord",a.push(yg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1]===e.ImageFitMode.Tile?l.push(lg("uniform sampler2D uColorTexture"),lg("varying vec2 vTextureCoord"),cg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);")):l.push(lg("uniform sampler2D uColorTexture"),lg("varying vec2 vTextureCoord"),lg("uniform vec4 uColor"),cg("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)o="lookup:value",a.push(yg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;o=`lookup:${t}`,a.push(yg(e,"varying float vLookupValue"))}l.push(lg("varying float vLookupValue"),...Tg("vLookupValue",n))}else if(Array.isArray(i)&&"gradient"===i[0]){h=`Color:${ig(t)}`;const e=i[1],r=e.getColorStops();Z(e)?l.push(lg("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),lg(...kt(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),sg.linearStep,cg("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))",...r.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, mixVal));`)),"vec4 colorFragment = color"),...s?wg:[]):et(e)&&l.push(lg("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),lg(...kt(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),sg.linearStep,cg("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))",...r.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, magnitude))`)),"vec4 colorFragment = color"),...s?wg:[])}if(!0===s){const t="maskTexture";o=o?`${o} ${t}`:`Color:${t}`,a.push(yg("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return{vertexShaderModifiers:a,fragmentShader:"FragmentShader",fragmentShaderModifiers:l,idVertex:o,idFragment:h}}}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let r;const n=`ColorShaded3D:${ig(t)}`;return{idFeature:"ColorShaded3D",VO:{GO:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,WO:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const h=[],a=[];if(h.push("phong"===i&&yg("normal","varying vec3 vNormal"),yg("posWorld","varying vec3 vPosWorld")),"uniform"===e)a.push(lg("uniform vec4 uColorDiffuse"),cg("vec4 colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",h.push(yg("attribute vec4 aColor","varying vec4 vColor")),a.push(lg("varying vec4 vColor"),cg("vec4 colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",h.push(yg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,h.push(yg(e,"varying float vLookupValue"))}a.push(lg("varying float vLookupValue"),...Tg("vLookupValue",o))}if(s){const t="wireframe";r=r?`${r},${t}`:t,h.push(yg("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),a.push(lg("varying vec3 vTriangleBary"),lg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),sg.computeScreenSpaceWireframe,fg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&a.push(...Eg),{idVertex:r,idFragment:n,vertexShaderModifiers:h,fragmentShader:"FragmentShader",fragmentShaderModifiers:a}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=[],s=Ig(e),r=s?"vec3":"vec2";if("linear-highPrecision"!==t.axisWorldTranslation)!0!==t.splitPosAttribute?i.push(lg(`attribute ${r} aPos`)):i.push(lg("attribute float aPosX"),lg("attribute float aPosY"),s&&lg("attribute float aPosZ"));else{if(!0===t.splitPosAttribute)throw new Error("splitPosAttribute: true not supported with axisWorldTranslation: linear-highPrecision");i.push(lg(`attribute ${r} aPos_highpart`),lg(`attribute ${r} aPos_lowpart`))}return i.push(...Pg(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),{idVertex:`VertexLocation:${ig(t)}`,idFragment:void 0,vertexShaderModifiers:i}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",apply:e=>({idVertex:`LineInstanced2D:${ig(t)}`,idFragment:void 0,vertexShaderModifiers:[lg("uniform float uThicknessPixels"),lg("uniform vec2 uRatioPxClip"),"linear-highPrecision"!==t.axisWorldTranslation&&lg("attribute vec2 aLocationA"),"linear-highPrecision"!==t.axisWorldTranslation&&lg("attribute vec2 aLocationB"),"linear-highPrecision"===t.axisWorldTranslation&&lg("attribute vec2 aLocationA_highpart"),"linear-highPrecision"===t.axisWorldTranslation&&lg("attribute vec2 aLocationB_highpart"),"linear-highPrecision"===t.axisWorldTranslation&&lg("attribute vec2 aLocationA_lowpart"),"linear-highPrecision"===t.axisWorldTranslation&&lg("attribute vec2 aLocationB_lowpart"),lg("attribute vec2 aSegmentPosition"),lg("attribute float aSegmentSide"),...Pg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),fg("worldB = ","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"),...kg(e)?[ug("attribute float aLookupValue"),ug("vLookupValue = aLookupValue"),lg("attribute float aLookupValueA"),lg("attribute float aLookupValueB"),gg("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],...Cg(e)?Fg(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${ig(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[lg("uniform float uOffsetWU"),lg("attribute vec3 aLocationA"),lg("attribute vec3 aLocationB"),lg("attribute float aSegmentPosition"),lg("attribute float aPerpendHorizontal"),lg("attribute float aPerpendVertical"),...Pg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Ig(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),fg("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"),...Cg(e)?Fg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[lg("attribute vec3 aEdge"),lg("uniform float uEdgeRoundness"),fg("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:${ig(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[lg("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&sg.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?cg("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"})`):cg("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})`)),...Tg("intensityP",n)]})}},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(lg("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&&sg.roundUnsigned,sg.modulus,sg.texelFetchWithFallback[h],"ubyte"===r&&sg.decodeUbyteRGBAEncodedFloat,cg(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(lg("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),cg("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${ig(t)}`,idFragment:`DrawToNormalTexture:${ig(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(lg("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&&sg.roundUnsigned,sg.modulus,sg.texelFetchWithFallback[d],"ubyte"===a&&sg.decodeUbyteRGBAEncodedFloat,cg(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(...Pg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&f.push(yg("posWorld","varying vec3 vPosWorld"),..."uint"===h?[sg.texelFetchUnsignedWithFallback[d],gg("vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[gg("vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],gg("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),lg("varying vec3 vNormal",..."uint"===h?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),g.push(lg("varying vec3 vTriangleBary")),"uniform"===e?g.push(lg("uniform vec4 uColorDiffuse"),cg("vec4 colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]?"value"===e[1]?(f.push(yg("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),g.push(lg("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===l&&sg.decodeUbyteRGBAEncodedFloat,"bilinear"===i?cg("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"})`):cg("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"),...Tg("intensityP",d))):(f.push(yg(`posAxis.${e[1]}`,"varying float vLookupValue")),g.push(lg("varying float vLookupValue"),...Tg("vLookupValue",d))):void 0===e&&g.push(cg("vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0)")),"phong"===r&&g.push(...Eg),n&&(f.push(lg("attribute vec3 aTriangleBary"),yg("aTriangleBary","varying vec3 vTriangleBary")),g.push(lg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),sg.computeScreenSpaceWireframe,fg("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:${ig(t)}`,idFragment:`SurfaceGrid:${ig(t)}`,vertexShaderModifiers:f,fragmentShader:"FragmentShader",fragmentShaderModifiers:g}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${ig(t)}`,idFragment:`DebugSurfaceGridNormals:${ig(t)}`,vertexShaderModifiers:[lg("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"]),sg.roundUnsigned,sg.modulus,sg.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&sg.decodeUbyteRGBAEncodedFloat,cg(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?[sg.texelFetchUnsignedWithFallback[i]]:[],...Pg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),fg("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:[gg("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",apply:t=>({idVertex:"OffsetTowardsCamera",idFragment:void 0,vertexShaderModifiers:[lg("uniform vec3 uCameraLoc"),fg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[lg("attribute float aSegmentInside"),lg("varying float vSegmentInside"),lg("varying float vSegmentSide"),fg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[mg("#extension GL_OES_standard_derivatives : enable"),lg("uniform float uAALimit"),lg("varying float vSegmentInside"),lg("varying float vSegmentSide"),fg("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:${ig(t)}`,idFragment:`Glow1D:${ig(t)}`,vertexShaderModifiers:[yg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[lg("uniform sampler2D uTexture"),lg("varying vec2 vTextureCoord"),lg("uniform vec2 uTextureSize"),r&&lg("uniform vec2 uOffsetPx"),!r&&lg("uniform sampler2D uTextureFirstGlowPass"),!r&&lg("uniform vec4 uGlowColor"),fg("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:[lg("uniform vec4 uColor"),cg("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:[yg("attribute vec4 aColor","varying vec4 vColor")],fragmentShaderModifiers:[lg("varying vec4 vColor"),cg("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:[yg("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:[lg("attribute vec2 aLengthSoFar"),lg("varying float vLengthSoFar"),lg("uniform vec2 uStippleCount"),gg("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[lg("uniform sampler2D uStippleTexture"),lg("uniform float uStippleScale"),lg("varying float vLengthSoFar"),"webgl1"===e&&lg("uniform float uStippleTextureWidthLimiter"),fg("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:[lg("attribute vec2 aLengthSoFarA"),lg("attribute vec2 aLengthSoFarB"),lg("varying float vLengthSoFar"),lg("uniform vec2 uStippleCount"),gg("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[lg("uniform sampler2D uStippleTexture"),lg("uniform float uStippleScale"),lg("varying float vLengthSoFar"),"webgl1"===e&&lg("uniform float uStippleTextureWidthLimiter"),fg("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:${ig(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[lg("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"),sg.texelFetchWithFallback[i],"ubyte"===o&&sg.decodeUbyteRGBAEncodedFloat,cg("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&&cg("vec4 colorFragment = uColor"),r&&fg("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?Tg("intensityP",i):[]]}}})};class _g{constructor(t){this.gL=[],this.yB=t}pL(t,e){((t,e,i,s)=>{const r=t.oO(),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.HO(),l=t.UO(),u=t.$O(),c=t.jO(),d=t.YO();t.XO("disabled"),t.sy(!1),t.ZO(!1);const f=e.KO();((t,e,i)=>{const s=t.gl,r=t.oO();s.bindFramebuffer(s.FRAMEBUFFER,i.frameBuffer),s.bindRenderbuffer(s.RENDERBUFFER,i.depthBuffer),s.bindTexture(s.TEXTURE_2D,i.texture),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.clear(s.DEPTH_BUFFER_BIT);const n=i.sizeDpr;t.qO(0,0,n.x,n.y),e.forEach((e=>{let i;e instanceof Vr?i=e.As.cp():e instanceof Ag&&(i=e.As.wS()),i?t.JO(i.x*r,i.y*r,i.width*r,i.height*r):t.ZO(!1),e.mB(2)})),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindRenderbuffer(s.RENDERBUFFER,null),s.bindTexture(s.TEXTURE_2D,null),t.ZO(!1)})(t,s,f);let g=f;const y=n+o+5,m=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;iLe(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 Vr||t instanceof Ag?t.As.QO(t):Fe;if(xe(e))return Fe;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?Fe:r})).filter((t=>!xe(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=hi(t.min,s),i=hi(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.tL(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.iL()),p=e.KO(f,g),S=t.sL(Bg["2D"],Bg.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),Bg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r,n)=>{const o=t.gl;o.bindFramebuffer(o.FRAMEBUFFER,i.frameBuffer),o.bindRenderbuffer(o.RENDERBUFFER,i.depthBuffer),o.bindTexture(o.TEXTURE_2D,i.texture),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.clear(o.DEPTH_BUFFER_BIT),t.qO(0,0,i.sizeDpr.x,i.sizeDpr.y),t.eL(s,((h,a,l,u)=>(t.sO(s),n&&n(h),t.oL(h("uIsHighlighted"),0).aL(h("uHighlightColorOffset"),C).oL(h("uRenderEffectMask"),0).nL(h("uTexture"),e.texture,0).rL(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).rL(h("uScale"),i.uniforms.lL()).rL(h("uDisp"),i.uniforms.uL()).rL(h("uScaling"),[i.size.x,i.size.y]).rL(h("uTranslationAxis"),[0,0]).hL(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).Xp(o.TRIANGLES,r.vertexCount,0),!0))),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,g,p,S,m,((e,i,s,r)=>(t.rL(e("uOffsetPx"),[h.x,h.y]),!0))),g=p,t.ZO(l),t.cL(d);const x=t.sL(Bg["2D"],Bg.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),Bg.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.Ht().x,y:t.ls.Ht().y};t.qO(0,0,o.x*t.oO(),o.y*t.oO());const h=ot.d2({scaleXYConstructor:_i}).q(o).bi(0,o.x).vi(0,o.y),a=new zg;a.dL(h),t.eL(i,((h,l,u,c)=>(t.sO(i),r&&r(h),t.oL(h("uIsHighlighted"),0).aL(h("uHighlightColorOffset"),C).oL(h("uRenderEffectMask"),0).nL(h("uTexture"),e.texture,0).rL(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).rL(h("uScale"),a.lL()).rL(h("uDisp"),a.uL()).rL(h("uScaling"),[o.x,o.y]).rL(h("uTranslationAxis"),[0,0]).hL(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).Xp(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,x,m,((e,s,r,n)=>(t.nL(e("uTextureFirstGlowPass"),p.texture,1).aL(e("uGlowColor"),i.color),!0))),t.qO(a.x,a.y,a.width,a.height),t.XO(u),t.sy(c),t.fL(m.vertexBuffer)})(this.yB,this,e,t)}iL(){const t=this.yB.ls.Ht();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}KO(...t){const e=this.gL,i=this.iL(),s={x:Math.ceil(i.x*this.yB.oO()),y:Math.ceil(i.y*this.yB.oO())},r=this.yB.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.q(i).bi(0,i.x).vi(0,i.y),n.uniforms.dL(n.scale)),n;const o=r.createTexture(),h=this.yB.mL(),a=this.yB.yL();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),r.bindFramebuffer(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),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindRenderbuffer(r.RENDERBUFFER,null);const l=ot.d2({scaleXYConstructor:_i}).q(i).bi(0,i.x).vi(0,i.y),u=new zg;u.dL(l);const c={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:l,uniforms:u};return e.push(c),c}G(){[this.gL].forEach((t=>{t.forEach((t=>{this.yB.SL(t.depthBuffer),this.yB.xL(t.frameBuffer),this.yB.YB(t.texture)})),t.length=0}))}}class Lg{constructor(t,i,s,r,n=!0){this.bL=new Xf,this.vL=new Map,this.ML=new Map,this._L=new Map,this.AL=[],this.wL=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(xt.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.qm=!1,this.rL=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.kL=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.CL=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.TL=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.FL=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.IL=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.aL=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.oL=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.PL=(t,e)=>(this.gl.uniform1i(t,e),this),this.nL=(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 ft("Could not bind a texture.")},this.DL=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.tL=(t,e=!1,i)=>{const s=t.length,r=this.BL(s,i);if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,r),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof Float32Array?t:new Float32Array(t),e?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),r)return r;throw new ft("Could not create vertex buffer")},this.OL=(t,e,i)=>{const s=i||this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(t),this.gl.STATIC_DRAW),e&&this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,e instanceof Float32Array?e:new Float32Array(e)),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),s)return s;throw new ft("Could not create vertex buffer")},this.LL=(t,e,i)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferSubData(this.gl.ARRAY_BUFFER,e*Float32Array.BYTES_PER_ELEMENT,i instanceof Float32Array?i:new Float32Array(i)),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.RL=(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.EL=(t,e)=>{const i=t.length,s=this.BL(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 ft("Could not create index buffer")},this.zL=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 ft("Could not create float buffer")},this.VL=(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.NL=(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.hL=(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.GL(s,e)}return this},this.WL=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.HL=(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.UL=(t,e)=>(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)),this),this.$L=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.Xp=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.jL=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.YL=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.XL.ANGLE_instanced_arrays)return xt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.XL.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.ZL=(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.XL.ANGLE_instanced_arrays)return xt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.XL.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.GL=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.XL.ANGLE_instanced_arrays)return xt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.XL.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.KL=(t,e,i,s=0)=>{const r=this.gl.TEXTURE0+s;this.gl.activeTexture(r),this.gl.bindFramebuffer(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 n=this.UO();n&&this.ZO(!1),t(),n&&this.ZO(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null)},this.qL=(t,e,i)=>{const s=xt.document.createElement("canvas").getContext("2d").createImageData(i.x,i.y),r=s.data;return this.gl.readPixels(t,e,i.x,i.y,this.gl.RGBA,this.gl.UNSIGNED_BYTE,r),s},this.Ha=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.clear(this.gl.DEPTH_BUFFER_BIT),this),this.JL=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.sO=t=>(this.gl.useProgram(t.gO),this),this.QL=!1,this.tR=[],this.ls=t,this.ff=i,this.ls=t,this.gl=s.ctx,this.iR=s.antialias,this.sR=s.lineAntialias,this.eR=new Map,n&&(this.cL(!0),this.hR());const o=[];if(this.XL={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.XL).forEach((t=>{null===this.XL[t]&&o.push(t)})),"webgl2"===s.type)this.gl2={ctx:s.ctx},this.rR=!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.sR=!1),Object.keys(t).forEach((e=>{null===t[e]&&o.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.rR=!!e.OES_texture_float,this.gl1={ctx:s.ctx,XL:t,optional:e}}this.AL=o,this.$B=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.qB=this.nR(),this.sL=(t=>{const e=t.gl,i=new Map,s=new Map,r=new Map,n={totalMs:0,vertexShaders:0,fragmentShaders:0,programs:0},o=(e,i,s=[])=>{const r=[],n=[],o={allAttributeNames:Array.from(e.matchAll(/attribute\s[^\s]*\s(.*);/g)).map((t=>t[1])),allUniformNames:Array.from(e.matchAll(/uniform\s[^\s]*\s(.*);/g)).map((t=>t[1])),allVaryingNames:Array.from(e.matchAll(/varying\s[^\s]*\s(.*);/g)).map((t=>t[1])),removedVariableNames:[]};if(t.gl1){const t=e.match(/#extension.*/g);t&&n.push(...t),e=e.replace(/#extension.*/g,"")}else if(r.push("#version 300 es"),(e=(e=(e=e.replace(/#extension.*/g,"")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).includes("usampler2D")&&r.push("precision highp usampler2D;"),"vertex"===i)e=e.replace(/varying/g,"out");else{e=e.replace(/varying/g,"in");const t=s.find((t=>"fragOutput"===t.type));e=(e=t?`out ${t.fragOutput} fragOutput;\n${e}`:`out vec4 fragOutput;\n${e}`).replace(/gl_FragColor/g,"fragOutput")}return n&&r.push(...n),r.push("precision highp float;"),r.push("precision highp int;"),{source:e=`${r.join("\n")}\n${e}`,info:o}};return(...h)=>{const a=t.gl2?"webgl2":"webgl1";let l,u,c,d,f,g,y,m,p;try{const t=xt.performance.now();l=h.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 eg(`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 eg(`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 eg("No vertex shader template defined",n);if(!u)throw new eg("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 S=r.get(u.id);if(c="new",S)return c="existing",g=S.vertexShaderSrc,y=S.fragmentShaderSrc,S;const x=u.vertexShader.id;let b=i.get(x);if(b)g=b.src,d="existing";else{d="new";const t=new og(u.vertexShader.modifiers).build(rg[u.vertexShader.template]),{source:s,info:r}=o(t,"vertex");g=s,m=r,b=new Sg(x,s,e,r),i.set(x,b),n.vertexShaders+=1}const v=u.fragmentShader;let M;const A=v.id;if(M=s.get(A),M)y=M.src,f="existing";else{f="new";const t=ng[v.template],i=new og([...v.modifiers]).build(t),{source:r,info:h}=o(i,"fragment",u.hints);y=r,p=h,M=new xg(A,r,e,h),s.set(A,M),n.fragmentShaders+=1}const T=new bg(b,M,e,u);return r.set(u.id,T),n.programs+=1,n.totalMs+=xt.performance.now()-t,T}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 xt.alert(t),new Error(t)}))}}})(this),this.oR=ct(this.gl),this.aR=new Rg(this),this.nO=(t=>{const e=xt.document.createElement("canvas"),i=e.getContext("2d",{willReadFrequently:!0});if(!i)throw new ft("Failed to get Text canvas rendering context");return i.fillStyle="#fff",(s,r,n)=>{const o=`${r.style} ${r.weight} ${r.size*n}px ${r.family}`;i.font=o,i.textBaseline="alphabetic",i.textAlign="left";const h=i.measureText(s);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(r.size*n),d=void 0!==h.actualBoundingBoxLeft?h.actualBoundingBoxLeft:0;e.width=a>0?a:l,e.height=2*c,i.font=o,i.textBaseline="alphabetic",i.textAlign="left",t?(i.clearRect(0,0,e.width,e.height),i.fillStyle="#fff"):(i.fillStyle="rgba(255,255,255,0)",i.fillRect(0,0,e.width,e.height),i.fillStyle="#000"),i.fillText(s,d,c);const f=i.getImageData(0,0,e.width,e.height);let g=0,y=0;const m=f.width;for(let t=0;t=0;t-=1){for(let e=0;e=t&&s.size-t<1e6?i=e:this.fL(e)}return i||(i=this.gl.createBuffer(),this.eR.set(i,{size:t})),i}pR(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 ft("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}YB(t){this.gl.deleteTexture(t)}mL(){const t=this.gl.createFramebuffer();if(!t)throw new ft("Couldn't reserve Framebuffer.");return t}xL(t){this.gl.deleteFramebuffer(t)}yL(){const t=this.gl.createRenderbuffer();if(!t)throw new ft("Couldn't reserve Render buffer.");return t}SL(t){this.gl.deleteRenderbuffer(t)}qO(t,e,i,s){return this.mR&&t===this.mR.x&&e===this.mR.y&&i===this.mR.width&&s===this.mR.height||(this.gl.viewport(t,e,i,s),this.mR={x:t,y:e,width:i,height:s}),this}HO(){return this.mR||{x:0,y:0,width:0,height:0}}JO(t,e,i,s){return this.ZO(!0),this.gl.scissor(Math.max(t,0),Math.max(e,0),Math.max(i,0),Math.max(s,0)),this}ZO(t){return t===this.yR||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.yR=t),this}cL(t){return t!==this.QL&&(this.QL=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}YO(){return this.QL}hR(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)}UO(){return void 0!==this.yR&&this.yR}eL(t,e){const i=new Vg(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}fL(t){this.gl.deleteBuffer(t),this.eR.delete(t)}SR(t,e,i){this.rL(t.uniform("uCenter"),e.center).rL(t.uniform("uDistance"),e.distance).CL(t.uniform("uBounds"),e.bounds).oL(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.wR.buffer;this.wR&&(this.fL(this.wR.buffer),this.wR=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.tR.splice(this.tR.indexOf(l),1)}))}PR(t,e,i,s,r,n,o,h){const a=this.gl;a.bindFramebuffer(a.FRAMEBUFFER,t),a.readPixels(e,i,s,r,n,o,h),a.bindFramebuffer(a.FRAMEBUFFER,null)}DR(t){const e=this._L.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new ft("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{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 xt.setTimeout(o,r)};xt.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 zg{dL(t){if(t instanceof _i||t instanceof yu){const e=t.ti();this.RR=e.x.scaling,this.ER=-e.x.displacement,this.zR=e.y.scaling,this.VR=-e.y.displacement,this.NR=e.x.highPrecisionOffset,this.GR=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.WR=e.y.highPrecisionOffset,this.HR=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof Li&&(this.MixedScaleXY=t.ti());return this}uL(){return[this.ER,this.VR]}lL(){return[this.RR,this.zR]}UR(){return[this.NR,this.WR]}$R(){return[this.GR,this.HR]}}class Og{constructor(){this.RR=0,this.zR=0,this.jR=0,this.ER=0,this.VR=0,this.YR=0}XR(t){return this.RR=t.st(),this.ER=t.getInnerStart()+.5*this.RR*t.et(),this}ZR(t){return this.zR=t.st(),this.VR=t.getInnerStart()+.5*this.zR*t.et(),this}KR(t){return this.jR=t.st(),this.YR=t.getInnerStart()+.5*this.jR*t.et(),this}lL(){return[this.RR,this.zR,this.jR]}uL(){return[this.ER,this.VR,this.YR]}qR(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=Uf.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class Rg{constructor(t){this.yB=t}mB(t,e,i,s,r,n=0){const o=this.yB,h=void 0===s;if(!(s=s||o.mL()))throw new ft("Could not bind a framebuffer.");const a=o.HO(),l=o.YO();o.cL(!1),o.KL((()=>{o.qO(0,0,i.x,i.y),t()}),s,e,n),h&&o.xL(s),this.yB.JL(r),this.yB.qO(a.x,a.y,a.width,a.height),o.cL(l)}}class Vg{constructor(t,e){this.JR=[],this.QR=[],this.uniform=t=>{const e=this.shader.SO(t);return this.QR.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.xO(t);return this.QR.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.bO(t);return this.JR.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.JR)this.glUtils.WL(t.location),this.glUtils.GL(t.location,0)}}class Ng extends Vr{constructor(t,e,i,s,r){super(t,e,i,s),this.tE=new Map,this.iE=t,this.sE=e,this.yB=t.eE(),this.hE=r,this.sE=e}rE(t){return!1}jB(){return this}mB(t){if(!this.hE||0!==t||0===this.tE.size)return this;const e=Array.from(this.tE.values()).map((t=>t.nE.filter((t=>t.oE)).map((t=>t.Qi)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===e.length)return this;const i=this.hE;return this.yB.lR.pL(e,i),this}Ts(){return this}_t(){return 0}Mt(){return 0}wt(){return 0}At(){return 0}sl(){return 0}el(){return 0}es(t,e){const i={nE:[]},s=(t,e)=>{const s={Qi:t||[],oE:void 0===e||e};i.nE.push(s);const r={ds:t=>(s.Qi=t,r),ys:t=>(s.oE=t,r),xs:()=>s.oE};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={xg:s,...r};this.tE.set(t,i);const o=t.onDispose((()=>{this.tE.delete(t),t.offDispose(o)}));return n}}function Gg(t,i,s,r,n,o){let h=i.x.ut(t.max.x),a=i.x.ut(t.min.x),l=i.y.ut(t.max.y),u=i.y.ut(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,S=g>m?[m,g]:[g,m],x=y>p?[p,y]:[y,p];let b,v,M=1,A=1;switch(r){default:case e.GradientExtent.closestSide:if(b=S[0]/c,v=x[0]/d,n===e.GradientShape.circle){const t=Math.min(b*f,v);M=t,A=t}else M=b*f,A=v;break;case e.GradientExtent.farthestSide:if(b=S[1]/c,v=x[1]/d,n===e.GradientShape.circle){const t=Math.max(b*f,v);M=t,A=t}else M=b*f,A=v;break;case e.GradientExtent.closestCorner:if(v=x[0]/d,n===e.GradientShape.circle){b=S[0]/c*f;const t=Math.sqrt(b*b+v*v);M=t,A=t}else{b=S[0]/c;const t=Math.sqrt(b*b+v*v);M=t*f,A=t}break;case e.GradientExtent.farthestCorner:if(v=x[1]/d,n===e.GradientShape.circle){b=S[1]/c*f;const t=Math.sqrt(b*b+v*v);M=t,A=t}else{b=S[1]/c;const t=Math.sqrt(b*b+v*v);M=t*f,A=t}}return{bounds:[a*o,u*o,c*o,d*o],center:[s.x*f,s.y],distance:[Math.max(M,1e-4),Math.max(A,1e-4)],aspectRatio:f}}function Hg(t,e,i,s){const r=e.x.ut(t.max.x),n=e.x.ut(t.min.x),o=e.y.ut(t.max.y),h=e.y.ut(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]}}const Ug=(t,e,i)=>((t,e,i,s)=>{const r=[];let n=0;const o=si(e,i/2);let h,a,l,c,d=t[t.length-1],f=0;for(let i=0;i0&&(d=t[i-1]),bt(h,d)&&(d=ri(h,ti(si(ni(a,h),-1)))),bt(h,a)&&(a=ri(h,ti(si(ni(d,h),-1))));const s=hi(d,e),g=hi(h,e),y=hi(a,e),m=ti(ni(g,s)),p=ti(ni(y,g)),S=ri(m,p),x=u(-S.y,S.x),b=u(-m.y,m.x),v=1/li(x,b),M=ii(x),A=ti(ni(m,p)),T=Math.sign(li(x,A))||1,w=oi(x,si(o,v)),E=oi(x,si(o,-v));if(M<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(li(m,x))||T,g=oi(b,si(o,c)),y=oi(l,si(o,c));1===T?(t=g,e=E,i=y,s=E):(t=w,e=g,i=w,s=y);const S=4*Ne(d,h),M=4*Ne(h,a);(v>S||v>M)&&(1===T?(t=g,e=y,i=y,s=g):(t=y,e=g,i=g,s=y));const A=ri(h,t),I=ri(h,e),C=ri(h,i),k=ri(h,s);r[n]=A,n+=1,r[n]=I,n+=1,r[n]=C,n+=1,r[n]=k,n+=1,f=4}else{const t=ri(h,w),e=ri(h,E);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 Wg extends en{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dO=new zg,this.aE=Fe,this.lE=Fe,this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE()}dE(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?zu(this.jo.M(),this.Al.M(),this.ci.M(),this.wl.M()*l/100,this.kl.M()*l/100,a)[0]:[this.jo.M()],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.Fl=u(t,e)}else{const t=Math.floor(d/2);this.Fl=u(h[t].x,h[t].y)}this.Il=h[1];const f=h.length-1;this.Pl=h[f],this.Cl.M()&&(h.shift(),c.shift());let g=!1;(this.jo.o||this.Al.o||this.ci.o||this.wl.o||this.kl.o||this.Cl.o||this.Tl.o||s)&&(this.lE=y(u(this.ca().x-n,this.ca().y-o),u(this.ca().x+n,this.ca().y+o)),g=!0,this.jo.o=!1,this.Al.o=!1,this.ci.o=!1,this.wl.o=!1,this.kl.o=!1,this.Cl.o=!1,this.Tl.o=!1);const m=this.Ro();(g||m)&&this.Se!==z&&(this.Cl.M()?(this.gE&&this.yB.fL(this.gE),[this.pE,this.gE,this.mE,this.yE]=this.dE(h,c)):(this.gE&&this.yB.fL(this.gE),[this.pE,this.gE,this.mE,this.yE]=this.dE(h,void 0)),Z(this.Se)?this.SE=Gg(this.lE,this.ct,this.Se.getPosition(),this.Se.getExtent(),this.Se.getShape(),this.yB.oO()):et(this.Se)?this.xE=Hg(this.lE,this.ct,this.Se.getAngle(!0),this.yB.oO()):(this.SE=void 0,this.xE=void 0));const p=N(this.Se)&&this.Se,S=et(this.Se)&&this.Se,x=Z(this.Se)&&this.Se,b=p||S||x;m&&(this.bE=b?this.yB.sL(Bg["2D"],Bg.Color({dataType:Z(this.Se)||et(this.Se)?["gradient",this.Se]:"uniform"}),Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})):void 0,this.No(this.Se));const v=this.xe;if(qi(v)&&(g||this.Ho(v.getThickness())||s)){this.Cl.M()?360===i?(h.pop(),c.pop(),[this.vE,this.ME]=this.fE(h,void 0,v.getThickness(),r),this._E&&this.vE?this.yB.RL(this._E,this.vE,!0):!this._E&&this.vE?this._E=this.yB.tL(this.vE,!0):this._E&&!this.vE&&(this.yB.fL(this._E),this._E=void 0),[this.AE,this.wE]=this.fE(c,void 0,v.getThickness(),r),this.kE&&this.AE?this.yB.RL(this.kE,this.AE,!0):!this.kE&&this.AE?this.kE=this.yB.tL(this.AE,!0):this.kE&&!this.AE&&(this.yB.fL(this.kE),this.kE=void 0)):([this.vE,this.ME]=this.fE(h,c,v.getThickness(),r),this._E&&this.vE?this.yB.RL(this._E,this.vE,!0):!this._E&&this.vE?this._E=this.yB.tL(this.vE,!0):this._E&&!this.vE&&(this.yB.fL(this._E),this._E=void 0),this.AE&&(this.kE&&this.yB.fL(this.kE),this.kE=void 0,this.wE=0)):(360===i&&(h.shift(),h.pop()),[this.vE,this.ME]=this.fE(h,void 0,v.getThickness(),r),this._E&&this.vE?this.yB.RL(this._E,this.vE,!0):!this._E&&this.vE?this._E=this.yB.tL(this.vE,!0):this._E&&!this.vE&&(this.yB.fL(this._E),this._E=void 0));const t=v.getFillStyle();Z(t)?this.CE=Gg(this.lE,this.ct,t.getPosition(),t.getExtent(),t.getShape(),this.yB.oO()):et(t)?this.TE=Hg(this.lE,this.ct,t.getAngle(!0),this.yB.oO()):(this.CE=void 0,this.TE=void 0),this.FE=t===z?void 0:this.yB.sL(Bg["2D"],Bg.Color({dataType:Z(t)||et(t)?["gradient",t]:"uniform"}),Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})),this.Uo(v)}if(g){let t=1,e=1;qi(v)&&(t=v.getThickness()*r.x,e=v.getThickness()*r.y),this.aE=y(u(this.lE.min.x-t,this.lE.min.y-e),u(this.lE.max.x+t,this.lE.max.y+e))}this.IE=e&&b?this.IE||this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})):void 0,this.PE=e&&this.xe!==st?this.PE||this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})):void 0}return this}mB(t){if(this.Vo()){const e=1===t?this.IE:this.bE,i=this.Se,s=this.gE;e&&s&&this.yB.sO(e).eL(e,((e,r,n,o)=>{if(this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(o("uScaleStart_highpart"),this.dO.UR()).rL(o("uScaleStart_lowpart"),this.dO.$R()).MR(n,s,this.ct.ni(),void 0).oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),1===t)this.yB.aL(e("uColor"),this.cE);else if(N(i))this.yB.aL(e("uColor"),i.getColor());else if(Z(i)){if(!this.SE)return!1;this.yB.SR(n,this.SE,i)}else if(et(i)){if(!this.xE)return!1;this.yB.xR(n,this.xE,i)}return this.yB.Xp(this.yE,this.mE),!0}));const r=this.xe;qi(r)&&(void 0!==this._E&&this.DE(t,this._E,this.ME,r),void 0!==this.kE&&this.DE(t,this.kE,this.wE,r))}return this}DE(t,e,i,s){const r=1===t?this.PE:this.FE,n=s.getFillStyle();r&&this.yB.sO(r).eL(r,((r,o,h,a)=>{if(this.yB.rL(r("uScale"),this.dO.lL()).rL(r("uDisp"),this.dO.uL()).MR(h,e,this.ct.ni(),void 0).oL(r("uIsHighlighted"),1===t||2===t?0:this.xo).aL(r("uHighlightColorOffset"),this._o).oL(r("uRenderEffectMask"),2===t?1:0),1===t)this.yB.aL(r("uColor"),this.cE);else if(N(n))this.yB.aL(r("uColor"),n.getColor());else if(Z(n)){if(!this.CE)return!1;this.yB.SR(h,this.CE,n)}else if(et(n)){if(!this.TE)return!1;this.yB.xR(h,this.TE,n)}const l=s.getThickness(),u=-1===l||1===l;return this.yB.Xp(u?this.yB.gl.LINE_LOOP:this.yB.gl.TRIANGLE_STRIP,i),!0}))}rE(t){return this.uE===t&&{}}jB(){return this.BE&&(this.yB.fL(this.BE),this.BE=void 0),this.OE&&(this.yB.fL(this.OE),this.OE=void 0),this.gE&&(this.yB.fL(this.gE),this.gE=void 0),this._E&&(this.yB.fL(this._E),this._E=void 0),this.kE&&(this.yB.fL(this.kE),this.kE=void 0),this.bE=void 0,this.FE=void 0,this.IE=void 0,this.PE=void 0,this}_t(){return this.lE.max.x}Mt(){return this.lE.min.x}wt(){return this.lE.max.y}At(){return this.lE.min.y}sl(){return we(this.xe)}el(){return we(this.xe)}}class Xg{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}LE(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}RE(){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}EE(){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}zE(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.RE(),this}VE(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.EE(),this}NE(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new Xg).LE(t))(),jg=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||Yg.RE(),n.push(t,e),r.push(Yg.first,Yg.second,Yg.third),h=void 0,o=void 0,r.push(Yg.third,Yg.fourth,Yg.second),a=Yg.third,Yg.EE(),l&&n.push(i,s),[o,h,a]),Jg=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||Yg.RE(),o.push(t,e),r.push(Yg.first,Yg.second,Yg.third);const c=pi(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(Yg.third,Yg.fourth,Yg.fifth),l=Yg.fourth),Yg.EE(),u&&o.push(i,s),[h,a,l]},$g=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||Yg.RE(),r.push(t,e),s.push(Yg.first,Yg.second,Yg.third),n=i,o=void 0,h=Yg.third,l?r.push(i):a=!0,[n,o,h,a]),qg=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||Yg.RE(),Yg.RE()):a>0&&(Yg.RE(),u>0&&(u-=1)),n.push(t),r.push(Yg.first,Yg.second,Yg.third),a=Yg.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),Kg=(t,e=0)=>{Yg.LE(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]=jg(g,y,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=Jg(g,y,d,f,o,n,h,a,l,u,t):[a,l,u,m]=$g(g,y,d,o,h,a,l,u,m,t):d.y===f.y?(a=g,m&&(h.push(g),m=!1,Yg.RE()),0===h.length&&u>0&&p>0&&(p-=1)):d.y>f.y?[a,l,u,p]=qg(g,0,d,f,n,h,a,l,u,t,p):[a,l,u,p]=qg(g,0,d,f,o,h,a,l,u,t,p)}return[h,new Uint16Array(n),new Uint16Array(o),u,p]};class Zg extends tn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dO=new zg,this.WE=0,this._a=Array(),this.HE=0,this.UE=new Uint16Array(0),this.$E=new Uint16Array(0),this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE()}Ts(){const t=this.zo(),e=this.po.M(),i=this.Oa;if(this.Vo()){this.dO.dL(this.ct);const s=this.ct instanceof Li==0,r=s?this.ct.Ai():void 0,n=this.pl(),o=this.ct.Mi()||t,h=i||this.nl.o||o&&"disabled"!==n.type;if(h){if(this.WE=0,this.UE=new Uint16Array(0),this.$E=new Uint16Array(0),this._a.length=0,this.HE=0,this.ol>1){const[t,e,i,o]=Kg([s?n.packager(this.hl,r,.5):this.hl,s?n.packager(this.rl,r,.5):this.rl]);this.WE=o,this.UE=e,this.$E=i,this._a=t,this.HE=t.length}this.nl.o=!1}if(this.ll&&this.Ia[0].length>1){const[t,e]=this.Ia,i=t.length,[o,h,a,l,u]=Kg([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.WE);this.WE=l;const c=o.length;for(let t=u;t0||this.ol>0?1:u;s{if(this.yB.MR(o,e,this.ct.ni(),void 0).$L(r).oL(s("uIsHighlighted"),1===t||2===t?0:this.xo).aL(s("uHighlightColorOffset"),this._o).oL(s("uRenderEffectMask"),2===t?1:0),this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(s("uScale"),this.dO.lL()).rL(s("uDisp"),this.dO.uL()).rL(h("uScaleStart_highpart"),this.dO.UR()).rL(h("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(h("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(h("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(h("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(h("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(s("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(s("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),1===t)this.yB.aL(s("uColor"),this.cE);else if(N(i))this.yB.aL(s("uColor"),i.getColor());else if(Z(i)){if(!this.JE)return!1;this.yB.SR(o,this.JE,i)}else if(et(i)){if(!this.QE)return!1;this.yB.xR(o,this.QE,i)}else W(i)&&this.qE&&this.yB.LR(o,i.lut,this.qE,0);return this.yB.jL(this.hz),!0}))}const r=1===t?this.IE:this.jE;if(r&&this.tz&&this.iz){const i=this.tz,s=this.iz;this.yB.sO(r).eL(r,((r,n,o,h)=>{if(this.yB.MR(o,i,this.ct.ni(),void 0).$L(s).oL(r("uIsHighlighted"),1===t||2===t?0:this.xo).aL(r("uHighlightColorOffset"),this._o).oL(r("uRenderEffectMask"),2===t?1:0),this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(r("uScale"),this.dO.lL()).rL(r("uDisp"),this.dO.uL()).rL(h("uScaleStart_highpart"),this.dO.UR()).rL(h("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(h("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(h("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(h("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(h("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(r("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(r("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),1===t)this.yB.aL(r("uColor"),this.cE);else if(N(e))this.yB.aL(r("uColor"),e.getColor());else if(Z(e)){if(!this.SE)return!1;this.yB.SR(o,this.SE,e)}else if(et(e)){if(!this.xE)return!1;this.yB.xR(o,this.xE,e)}else W(e)&&this.YE&&this.yB.LR(o,e.lut,this.YE,0);return this.yB.jL(this.sz),!0}))}return this}rE(t){return this.uE===t&&{}}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return 0}el(){return 0}ov(t){this.$a()>0&&this.Ts();const[e,i]=this.Ea(),s=e.length>2&&e[1].x0&&this.Ts();const[e,i]=this.Ea(),s=e.length;if(0===s)return;const r=this.cl?1:0,n=s-(this.dl?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.rz;s+=1){const r=i-s*Math.PI/this.rz;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.bL.vB.get(e);return i||(i=new Qg(t,e),t.bL.vB.set(e,i),i)})(t,e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2),ey={cz:(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.GL(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.GL(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.GL(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.GL(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.GL(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.GL(i,1),h.enableVertexAttribArray(i)}},dz:(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.GL(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.GL(r,1),h.enableVertexAttribArray(r)},fz:(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.GL(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.GL(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.GL(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.GL(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.GL(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.GL(i,1),h.enableVertexAttribArray(i)}},gz:(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.GL(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.GL(r,1),h.enableVertexAttribArray(r)},mB:(t,e,i,s,r,n,o)=>{const h=t.eE(),{uniform:a,uniformOptional:l}=i,u=1/t._n.Dn,c=(r?Math.max(n,u):Math.max(n,0))+1;h.oL(a("uThicknessPixels"),c).oL(l("uAALimit"),1-(c-1)/c).rL(a("uRatioPxClip"),[2/t.Ht().x,2/t.Ht().y]),e.sO(i,s).Xp(o)}},iy={cz:(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)}},dz:(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)},fz:(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)}},pz:(t,e)=>{const i=t.eE();i.Xp(i.gl.LINE_STRIP,e,0)},mz:(t,e)=>{const i=t.eE();i.Xp(i.gl.LINES,2*e,0)}};class sy extends nn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dO=new zg,this.Ta=Fe,this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE(),this.yz=this.yB.sR}Ts(){const t=this.Go(),e=this.jl,i=qi(e)&&e,s=No(e)&&e,r=i||s,n=r&&r.getFillStyle(),o=N(n)&&n,h=et(n)&&n,a=Z(n)&&n,l=W(n)&&n,c=o||h||a||l&&["x","y"].includes(l.getLookUpProperty())&&l,d=this.di(),f=this.ui(),g=this.po.M(),m=this.po.o,p=e.L();if(s&&this.ct instanceof Li)return xt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.dO.dL(this.ct),this.ql&&(this.Sz=this.yB.tL(Qt([d,f],this.ct.ni()),!1,this.Sz),this.Ta=y(u(d.x,d.y),u(f.x,f.y))),t||m){const t=this.Vo()&&r&&c&&p>0,e=h?["gradient",h]:a?["gradient",a]:l?["lookup",l.getLookUpProperty()]:"uniform";this.xz=t?{type:"triangulated",shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:e}),Bg.LineInstanced2D({axisWorldTranslation:Zf(this.ct),normalSource:void 0}),this.yz?Bg.AliasedEdge:void 0,s&&Bg.StippleTextureInstanced),mousePickingShader:g?this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.LineInstanced2D({axisWorldTranslation:Zf(this.ct),normalSource:void 0}),s&&Bg.StippleTextureInstanced):void 0,geometry:ty(this.yB,p),thickness:p,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:o,fillStyleLinearGradient:h,fillStyleRadialGradient:a,fillStylePaletted:l}:void 0,l?this.bz=this.iE.XE(l.lut,this.bz):this.bz&&(this.iE.ZE(this.bz),this.bz=void 0)}if(Z(n)?this.CE=Gg(Gr(this.Ta,{x:this.sl(),y:this.el()},this.ct),this.ct,n.getPosition(),n.getExtent(),n.getShape(),this.yB.oO()):et(n)?this.TE=Hg(Gr(this.Ta,{x:this.sl(),y:this.el()},this.ct),this.ct,n.getAngle(!0),this.yB.oO()):(this.CE=void 0,this.TE=void 0),s){if(t||this.ql){const t=[0,0,Math.abs(f.x-d.x),Math.abs(f.y-d.y)];this.vz=this.yB.tL(t,!1,this.vz)}this.Mz=this.yB.DR(s.getPattern())}else this.vz&&(this.yB.fL(this.vz),this.vz=void 0),this.Mz=void 0;return this.Kl(e),this.ql=!1,this.po.o=!1,this}mB(t){var e,i;const s=this.Sz;if(!s)return this;const r=this.xz;if(!r)return this;const{fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a,lineStyleDashed:l,thickness:u}=r,c=1===t?null===(e=this.xz)||void 0===e?void 0:e.mousePickingShader:null===(i=this.xz)||void 0===i?void 0:i.shader;return c?(this.yB.sO(c).eL(c,((e,i,c,d)=>{if(this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(d("uScaleStart_highpart"),this.dO.UR()).rL(d("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(d("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(d("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(d("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(d("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(e("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(e("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),1===t)this.yB.aL(e("uColor"),this.cE);else if(n)this.yB.aL(e("uColor"),n.getColor());else if(h){if(!this.CE)return!1;this.yB.SR(c,this.CE,h)}else if(o){if(!this.TE)return!1;this.yB.xR(c,this.TE,o)}else if(a){if(!this.bz)return!1;this.yB.LR(c,a.lut,this.bz,0)}if(l){if(!this.vz||!this.Mz)return!1;ey.dz(this.yB,c,this.vz,i("aLengthSoFarA"),i("aLengthSoFarB"),2,0),this.yB.rL(e("uStippleCount"),[this.ls.Ht().x/this.Mz.uw,this.ls.Ht().y/this.Mz.uw]).oL(d("uStippleTextureWidthLimiter"),this.Mz.OR/this.Mz.uw).oL(e("uStippleScale"),l.getPatternScale()).nL(e("uStippleTexture"),this.Mz.BR,1)}return ey.cz(this.ct.ni(),this.yB,s,c,this.ct.ni()?4:2,0),ey.mB(this.iE,r.geometry,c,this.yz&&1!==t,1===t,u,1),!0})),this):this}rE(t){return this.uE===t&&{}}dispose(){return super.dispose(),this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this.xz=void 0,this.Sz&&(this.yB.fL(this.Sz),this.Sz=void 0),this.vz&&(this.yB.fL(this.vz),this.vz=void 0),this.Mz=void 0,this}jB(){return this}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return we(this.jl)}el(){return we(this.jl)}}class ry extends on{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this._z=[],this.Az=!1,this.wz=!1,this.kz=!1,this.Cz=!1,this.dO=new zg,this.Ta=Fe,this.iE=t,this.sE=e,this.Tz=n,this.yB=t.eE(),this.yz=this.yB.sR,this.Fz=t._n.On}kr(){const t=this.Tz(),e={ps:t=>this.Iz(e,t),us:t=>this.Pz(e,t),Ig:(t,i)=>this.Dz(e,t,i),aL:t=>this.Bz(e,t),fi:{x:0,y:0},ci:{x:0,y:0},xo:0,Oz:void 0,uE:t.id,cE:t.color};return this._z.push(e),e}Ha(){var t;return this._z.length=0,this.Az=!0,this.Ii&&this.un&&(null===(t=this.ls.an)||void 0===t?void 0:t.entity)===this&&this.un(this,void 0,this.ls.an.collectionMember),this}Iz(t,e){if(e&&!this._z.includes(t))this._z.push(t);else if(!e){const e=this._z.indexOf(t);this._z.splice(e,1)}return this.kz=!0,t}Pz(t,e){return t.xo=e,this.wz=!0,t}Dz(t,e,i){return t.fi=e,t.ci=i,this.Az=!0,t}Bz(t,e){return t.Oz=e,this.Cz=!0,t}Ts(){const t=this.po.M(),e=this.po.o,i=this.Go(),s=this.jl,r=this._z,n=this.wz,o=this.Az,h=this.kz,a=this.Cz,l=qi(s)&&s,u=No(s)&&s,c=l||u,d=c&&c.getFillStyle(),f=N(d)&&d,g=H(d)&&d,y=Z(d)&&d,m=et(d)&&d,p=f||g||m||y,S=s.L(),x=u?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(u&&this.ct instanceof Li)return xt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this.dO.dL(this.ct);const b=o||h;if(b){const t=[];for(let e=0;e0&&c&&p&&S>0&&e;this.xz=i?"triangulated"===x?{type:"triangulated",shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:e}),Bg.LineInstanced2D({axisWorldTranslation:Zf(this.ct),normalSource:void 0,snapToNearestPixel:this.Fz}),this.yz?Bg.AliasedEdge:void 0,u&&Bg.StippleTextureInstanced,Bg.AttributeHighlight),mousePicking:t?{shader:this.yB.sL(Bg["2D"],Bg.MousePickingAttribute,Bg.LineInstanced2D({axisWorldTranslation:Zf(this.ct),normalSource:void 0,snapToNearestPixel:this.Fz}),u&&Bg.StippleTextureInstanced,Bg.AttributeHighlight)}:void 0,geometry:ty(this.yB,S),thickness:S,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:f,fillStyleIndividual:g,fillStyleLinearGradient:m,fillStyleRadialGradient:y}:{type:"primitive",shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:e}),Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0,snapToNearestPixel:this.Fz}),Bg.AttributeHighlight),mousePicking:t?{shader:this.yB.sL(Bg["2D"],Bg.MousePickingAttribute,Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0,snapToNearestPixel:this.Fz}),Bg.AttributeHighlight)}:void 0,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:f,fillStyleIndividual:g,fillStyleLinearGradient:m,fillStyleRadialGradient:y}:void 0}if(u){if(i||b){const t=new Float32Array(4*r.length);let e=0;for(let i=0;i{t[e]=i.xo,e+=1})),this.Lz=this.yB.tL(t,!0,this.Lz)}else{const t=new Float32Array(2*r.length);let e=0;r.forEach((i=>{for(let s=e;s{const s=i.Oz||g.color;t[e]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=s.a,e+=4})),this.Rz=this.yB.tL(t,!1,this.Rz)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{const s=i.Oz||g.color;for(let i=e;i{t[e+0]=i.cE.r,t[e+1]=i.cE.g,t[e+2]=i.cE.b,t[e+3]=i.cE.a,e+=4})),this.Ez=this.yB.tL(t,!0,this.Ez)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{for(let s=e;s{if(this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(g("uScaleStart_highpart"),this.dO.UR()).rL(g("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(g("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(g("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(g("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(g("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(e("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(e("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),this.Fz&&this.yB.rL(g("uViewportSizePx"),[this.ls.Ht().x*this.yB.oO(),this.ls.Ht().y*this.yB.oO()]),this.yB.aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),1===t){if(!r)return!1;"triangulated"===o?this.yB.hL(r,1,{location:d("aColor"),size:4}):this.yB.HL(d("aColor"),r)}else if(h)this.yB.aL(e("uColor"),h.getColor());else if(a){if(!this.Rz)return!1;this.yB.hL(this.Rz,"triangulated"===o?1:void 0,{location:d("aColor"),size:4})}else if(u){if(!this.SE)return!1;this.yB.SR(f,this.SE,u)}else if(l){if(!this.xE)return!1;this.yB.xR(f,this.xE,l)}if(c){if(!this.vz||!this.Mz)return!1;ey.gz(this.yB,f,this.vz,d("aLengthSoFarA"),d("aLengthSoFarB"),2,0),this.yB.rL(e("uStippleCount"),[this.ls.Ht().x/this.Mz.uw,this.ls.Ht().y/this.Mz.uw]).oL(g("uStippleTextureWidthLimiter"),this.Mz.OR/this.Mz.uw).oL(e("uStippleScale"),c.getPatternScale()).nL(e("uStippleTexture"),this.Mz.BR,0)}if("triangulated"===o){const{geometry:e,thickness:r}=n;ey.fz(this.ct.ni(),this.yB,i,f,this.ct.ni()?4:2,0),this.yB.hL(1===t||2===t?this.yB.dR:s,1,{location:d("aIsHighlighted"),size:1}),ey.mB(this.iE,e,f,this.yz&&1!==t,1===t,r,this._z.length)}else iy.fz(this.ct.ni(),this.yB,i,f,this.ct.ni()?4:2,0),this.yB.UL(d("aIsHighlighted"),1===t||2===t?this.yB.dR:s),iy.mz(this.iE,this._z.length);return!0})),this):this}rE(t){const e=this._z.find((e=>e.uE===t));return!!e&&{collectionMember:e}}dispose(){return super.dispose(),this.xz=void 0,this.Sz&&(this.yB.fL(this.Sz),this.Sz=void 0),this.vz&&(this.yB.fL(this.vz),this.vz=void 0),this.Lz&&(this.yB.fL(this.Lz),this.Lz=void 0),this.Ez&&(this.yB.fL(this.Ez),this.Ez=void 0),this.Rz&&(this.yB.fL(this.Rz),this.Rz=void 0),this.Mz=void 0,this}jB(){return this}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return we(this.jl)}el(){return we(this.jl)}}class ny{constructor(t,e){this.zz=!1,this.Vz=!1,this.Nz=!1,this.ct=t,this.Gz=e,this.Gz.wo("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.zz="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.zz="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.Vz=!0),!0===t.regularProgressiveStep&&(this.Nz=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.zz?t[0].x:t[0].y,end:"x"===this.zz?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.zz?"x"===this.zz?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.Wz=!0)}))}Yz(t,e=!1){if(this.Wz||!this.zz||"linear"!==this.jz.type)return!1;!1===e&&this.Xz&&(clearTimeout(this.Xz),this.Xz=void 0);const i="x"===this.zz?this.jz.scale.x.eg:this.jz.scale.y.eg;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.zz?r.x:r.y,"x"===this.zz?n.x:n.y,s),h=this.jz.scale,a=Math.abs("x"===this.zz?h.Ai().x:h.Ai().y),l=a/o,u=Math.floor(l*oy),c=u*o,d=xt.performance.now(),f=!(d-i.sh<500)&&(i.Ke?d-i.ih<1e3:d-i.qe<2e3||i.Qe),g=s>2*this.Uz.totalDataPointsAtTime;if(f&&!g)return this.Xz=setTimeout((()=>this.Zz(t)),1e3),!1;const y=u>=10,m=this.Uz.enabled?this.Uz.columnWidthAxis/a<1.5:void 0,p=this.Uz.enabled&&u>this.Uz.dataPointsPerColumn?u/this.Uz.dataPointsPerColumn>=2:void 0;let S;!0===this.Uz.enabled?m?p&&(S={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):S=y?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:y&&(S={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const x=!1===e;return S?(x&&(this.Uz=S),!0):(x&&(this.Uz={...this.Uz,totalDataPointsAtTime:s}),!1)}gx(){this.Kz=void 0,this.$z.length=0,this.Xz&&(clearTimeout(this.Xz),this.Xz=void 0)}qz(t){if(0===t.length)return t;if(this.Wz||!this.zz||"linear"!==this.jz.type||!this.Uz.enabled)return t;let e;e=this.$z.length>0?he(this.$z,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.Kz,h=-1,a=-1,l=0,u=0;if("x"!==this.zz||this.Vz)if("x"===this.zz&&this.Vz){const t=this.Uz.columnWidthAxis;let c=this.Kz?this.Kz.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.Kz=s[c-1]),s}Jz(t){if(this.zz&&"linear"===this.jz.type){const e="x"===this.zz?this.jz.scale.x.eg:this.jz.scale.y.eg;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.je===zs.progressive||e.je===zs.regressive){const e=Math.abs("x"===this.zz?this.jz.scale.x.getInnerInterval():this.jz.scale.y.getInnerInterval());if(this.Uz.enabled)return 2*e/this.Uz.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.zz?s.x:s.y,"x"===this.zz?r.x:r.y,i)}}}Qz(t,e,i){if(!this.zz)return e;const s=i.length;let r=Lr(i,t.min,this.zz,this.Vz,0,s-1);void 0===r&&(r=this.Vz?s-1:0);let n=Lr(i,t.max,this.zz,this.Vz,0,s-1);return void 0===n&&(n=this.Vz?0:s-1),1+Math.abs(n-r)}tV(){this.Xz&&(clearTimeout(this.Xz),this.Xz=void 0)}Zz(t){this.Yz(t,!0)&&this.Ss()}}class ay extends ny{renderVisibleOnly(t,e){const i=this.ct.x.getInnerStart(),s=this.ct.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.ct.y.getInnerStart(),h=this.ct.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 ly{constructor(t,e,i){this.iV=e,this.sV=i,this.eV=t,this.hV=[]}rV(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.eV[this.eV.length-1];do{const t=this.eV.length;let r;h||(h=this.nV(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.sV&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.eV[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.eV.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.oV()}aV(t){const e=t,i=this.eV.indexOf(e);i>=0&&this.eV.splice(i,1),e.droppedTimestamp=xt.performance.now(),this.hV.push(e)}lV(){this.eV.slice().forEach((t=>this.aV(t)))}uV(){this.eV.forEach((t=>this.iV(t))),this.hV.forEach((t=>this.iV(t))),this.eV.length=0,this.hV.length=0}nV(t,e){const i=2*t/3,s=4*t/3,r=this.hV.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.hV[r];return this.hV.splice(r,1),this.eV.push(t),t}}oV(){if(this.hV.length>5){const t=xt.performance.now();for(let e=0;e=1e4)&&(this.iV(i),this.hV.splice(e,1),e-=1)}}}}class uy extends ny{cV(t,e){if(!e||"object"!=typeof e)return 0;const i=this.ct.x.getInnerStart(),s=this.ct.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.ct.y.getInnerStart(),h=this.ct.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);if("maxDataPointCount"in e)return this.dV(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.fV(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.gV(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}dV(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}gV(t,e,i,s,r,n){if(void 0===e||!this.zz)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.zz?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.zz?a.boundaries.max.x2))break;o+=1}return o}fV(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.zz){if(this.Vz?"x"===this.zz?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.zz?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}pV(t,e){const i=t.reduce(((t,e)=>je(t,e.boundaries)),Fe);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.zz||this.Vz?"x"===this.zz&&this.Vz?i.max.x=Math.min(i.max.x,t):"y"!==this.zz||this.Vz?"y"===this.zz&&this.Vz&&(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 cy extends hn{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r),this.dO=new zg,this.nM=[],this.mV=new ay(this.ct,this),this.yV=new hy(this.ct,this,(()=>this.ls.Ss())),this.SV=new ly(this.nM,(t=>{t.coordsBuffer&&this.yB.fL(t.coordsBuffer),t.vz&&this.yB.fL(t.vz)}),!0),this.xV=new uy(this.ct,this),this.bV=0,this.vV=0,this.MV=!1,this.sE=e,this.uE=n,this.cE=o,this._n=h,this.xz={type:"none"},this.yB=t.eE(),this.iE=t,this.yz=this.yB.sR;const a=this.ct.ni(),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;sQt(e,t))(a,l);this._V={individualLookupValuesEnabled:l,attributesPerVertex:f,attributeOffsetCoordinateLowPrecision:u,attributeOffsetCoordinateHighPrecision:c,attributeOffsetLookUpValue:d,prepareRenderData:(t,e)=>g(t,this.jl.getFillStyle())}}AV(t,e,i){const s=new Float32Array(2*e);let r=0,n=i||t[0];for(let i=0;i0,o=this.po.M(),h=this.po.o,a=qi(e)&&e,l=No(e)&&e,u=a||l,c=u&&u.getThickness(),d=u&&u.getFillStyle(),f=N(d)&&d,g=et(d)&&d,y=Z(d)&&d,m=W(d)&&d,p=f||g||y||m,S=this._V.individualLookupValuesEnabled;if(l&&this.ct instanceof Li)return xt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;n&&(this.Jl=he(this.Jl,s,{canReturnB:!0}),this.Fa+=r);let x=this.Ql.o;const b=this.xV.cV(this.nM,this.Ql.M());if(b>0){let t=0;for(let e=0;e{t.vz&&(this.yB.fL(t.vz),t.vz=void 0)})),this.MV=!1),M&&(this.yV.gx(),this.nM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=Fe,t.lastDataPoint=void 0})),this.SV.lV(),v=this.Jl,this.bV=0,this.vV=0);const A=this.yV.qz(v),T=A.length;if(T>0){let t=this.yV.Jz(this.Jl)||(this.wo("ApplicationType",(t=>"InternalUI"===t.type))?this.Fa:1e5);T/t>10&&(t=T/10),this.SV.rV(A,t,((t,e,i,s)=>{const r=this.mV.calculateUserDataPointsBoundaries(e),n=this.yV.Qz(r,i,this.Jl)-s;return this.wV=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:n,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.yB.OL(t*this._V.attributesPerVertex,this._V.prepareRenderData(e,i)),lastDataPoint:e[i-1],vz:this.MV?this.yB.OL(2*t,this.AV(e,i,this.wV)):void 0}}),((t,e,i,s)=>{const r=je(t.boundaries,this.mV.calculateUserDataPointsBoundaries(e)),n=this.yV.Qz(r,t.existingCoordinatesCount+i,this.Jl)-(t.jointPointsCount+s);this.yB.LL(t.coordsBuffer,t.existingCoordinatesCount*this._V.attributesPerVertex,this._V.prepareRenderData(e,i)),this.MV&&t.vz&&this.yB.LL(t.vz,2*t.existingCoordinatesCount,this.AV(e,i,this.wV)),this.wV=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}if(x&&(this.Ta=this.xV.pV(this.nM,this.Ql.M())),this.dO.dL(this.ct),y?this.CE=Gg(this.Co(),this.ct,y.getPosition(),y.getExtent(),y.getShape(),this.yB.oO()):g?this.TE=Hg(this.Co(),this.ct,g.getAngle(!0),this.yB.oO()):(this.CE=void 0,this.TE=void 0),i||h){if(m&&"value"===m.getLookUpProperty()&&!S){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw xt.alert(t),new Error(t)}if(p&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=g?["gradient",g]:y?["gradient",y]:m?["lookup",m.getLookUpProperty()]:"uniform";this.xz="primitive"===t?{type:t,shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:e}),Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0}),l&&Bg.StippleTexture),mousePickingShader:o?this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0}),l&&Bg.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:f,fillStyleLinearGradient:g,fillStyleRadialGradient:y,fillStylePaletted:m}:"triangulated"===t?{type:t,shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:e}),Bg.LineInstanced2D({axisWorldTranslation:Zf(this.ct),normalSource:void 0}),this.yz?Bg.AliasedEdge:void 0,l&&Bg.StippleTextureInstanced),mousePickingShader:o?this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.LineInstanced2D({axisWorldTranslation:Zf(this.ct),normalSource:void 0}),l&&Bg.StippleTextureInstanced):void 0,geometry:ty(this.yB,c),thickness:c,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:f,fillStyleLinearGradient:g,fillStyleRadialGradient:y,fillStylePaletted:m}:{type:"none"}}else this.xz={type:"none"};m?this.bz=this.iE.XE(m.lut,this.bz):this.bz&&(this.iE.ZE(this.bz),this.bz=void 0)}return this.Mz=l?this.yB.DR(l.getPattern()):void 0,this.Kl(e),this.Oa=!1,this.Ia=[],this.po.o=!1,this.Ql.o=!1,this}mB(t){const e=this.yB.gl,i=this.xz;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.yB.sO(s).eL(s,((s,l,u,c)=>{let d=!1;if(this.yB.oL(s("uIsHighlighted"),1===t||2===t?0:this.xo).aL(s("uHighlightColorOffset"),this._o).oL(s("uRenderEffectMask"),2===t?1:0),this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(s("uScale"),this.dO.lL()).rL(s("uDisp"),this.dO.uL()).rL(c("uScaleStart_highpart"),this.dO.UR()).rL(c("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(c("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(c("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(c("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(c("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(s("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(s("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),1===t)this.yB.aL(s("uColor"),this.cE);else if(n)this.yB.aL(s("uColor"),n.getColor());else if(h){if(!this.CE)return!1;this.yB.SR(u,this.CE,h)}else if(o){if(!this.TE)return!1;this.yB.xR(u,this.TE,o)}else if(a){if(!this.bz)return!1;this.yB.LR(u,a.lut,this.bz,0)}return this.mV.renderVisibleOnly(this.nM,(n=>{const{coordsBuffer:o}=n;if(!o)return;e.bindBuffer(e.ARRAY_BUFFER,o);const h="triangulated"===i.type?ey.cz:iy.cz;if(this.ct.ni()||void 0===this._V.attributeOffsetCoordinateLowPrecision?this.ct.ni()&&void 0!==this._V.attributeOffsetCoordinateHighPrecision&&h(!0,this.yB,o,u,this._V.attributesPerVertex,this._V.attributeOffsetCoordinateHighPrecision):h(!1,this.yB,o,u,this._V.attributesPerVertex,this._V.attributeOffsetCoordinateLowPrecision),r){if(!n.vz||!this.Mz)return;"triangulated"===i.type?ey.dz(this.yB,u,n.vz,l("aLengthSoFarA"),l("aLengthSoFarB"),2,0):iy.dz(this.yB,u,n.vz,l("aLengthSoFar"),2,0),this.yB.rL(s("uStippleCount"),[this.ls.Ht().x/this.Mz.uw,this.ls.Ht().y/this.Mz.uw]).oL(c("uStippleTextureWidthLimiter"),this.Mz.OR/this.Mz.uw).oL(s("uStippleScale"),r.getPatternScale()).nL(s("uStippleTexture"),this.Mz.BR,1)}if(a&&"value"===a.lookUpProperty&&void 0!==this._V.attributeOffsetLookUpValue&&1!==t)if("triangulated"===i.type){const t=l("aLookupValueA");e.vertexAttribPointer(t,1,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.yB.GL(t,1),e.enableVertexAttribArray(t);const i=l("aLookupValueB");e.vertexAttribPointer(i,1,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this._V.attributeOffsetLookUpValue+this._V.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.yB.GL(i,1),e.enableVertexAttribArray(i)}else{const t=l("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}if("triangulated"===i.type){const{thickness:e}=i;ey.mB(this.iE,i.geometry,u,this.yz&&1!==t,1===t,e,n.existingCoordinatesCount-1)}else iy.pz(this.iE,n.existingCoordinatesCount);d=!0})),e.bindBuffer(e.ARRAY_BUFFER,null),d})),this}rE(t){return this.uE===t&&{}}Wa(t,e){return Array.isArray(t)||(t=[t]),this.Ia=he(this.Ia,t,{canReturnB:!0}),this.Ta=je(this.Ta,e||this.mV.calculateUserDataPointsBoundaries(t)),this}Ha(){return super.Ha(),this.bV=0,this.vV=0,this.wV=void 0,this}dispose(){return super.dispose(),this.SV.uV(),this.yV.tV(),this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this.xz={type:"none"},this.Mz=void 0,this}jB(){return this}ov(t){this.$a()>0&&this.Ts();const e=this.Ea(),i=Pr(e,t,this.Ba,this.cl,this.dl,this.ct,this.engine.ct,this.Ta,this.mV.zz,this.mV.Vz);return void 0!==i?e[i]:void 0}Pw(t){this.$a()>0&&this.Ts();const e=this.Ea(),i=e.length;if(0===i)return;const s=this.cl?1:0,r=i-(this.dl?2:1);if(this.Ba===Cr.Nearest){let s,r,n=ke;for(let o=0;o{const e=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 dy(t,e)},gy=t=>{const e=[u(-.5,-.5),u(-.5,.5),u(.5,-.5),u(.5,-.5),u(-.5,.5),u(.5,.5)];return new dy(t,e)},yy=(t,e,i)=>{let s=e.bL.bB.get(t);return s||(s=i(e),e.bL.bB.set(t,s)),s};class my extends qr{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dO=new zg,this.aE=y(c(Pe,Pe),c(ke,ke)),this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE()}Ts(){const t=this.po.M(),i=this.po.o,s=this.Ia,r=s.length,n=r>0,o=this.Aa.M(),h=this.Se,a=this.size.M(),l=this.ct.Mi(),c=this.size.o||this.Aa.o,d=this.Oa||s&&s.length>0,f=l||c;if(n&&(this._a=he(this._a,s,{canReturnB:!0}),this.Fa+=r),n||this.Oa){this.Ta=this.Da?je(this.Ta,this.Da):je(this.Ta,Xe(this._a));const t=Qt(this._a,this.ct.ni());this.FV=this.Fa,this.IV=this.yB.tL(t,!1,this.IV)}if(this.dO.dL(this.ct),c||this.Ro()||i){const e=this.wa.M()?"attribute":"uniform",i=a<=1&&Bg.PointSize(e),s=Bg.VertexLocation({offset:a>1?{dataType:e,sizeUnit:"px",symmetric:!0,rotation:(this.ka.M()||this.Ko.M()%360!=0)&&{dataType:this.ka.M()?"attribute":"uniform"}}:void 0,axisWorldTranslation:Zf(this.ct),normalSource:void 0}),r=N(this.Se)&&this.Se,n=Z(this.Se)&&this.Se,o=et(this.Se)&&this.Se,h=W(this.Se)&&this.Se,l=H(this.Se)&&this.Se,u=r||n||o||h||l;this.gO=u?this.yB.sL(Bg["2D"],i,s,r?Bg.Color({dataType:"uniform"}):l?Bg.Color({dataType:"attribute"}):h?Bg.Color({dataType:["lookup",h.getLookUpProperty()]}):n?Bg.Color({dataType:["gradient",n]}):o?Bg.Color({dataType:["gradient",o]}):void 0):void 0,this.IE=t&&u?this.yB.sL(Bg["2D"],i,s,Bg.MousePicking):void 0}if(h!==z?f&&(this.PV&&(this.PV=void 0),a>1||H(h)?a<=1?this.uz=this.yB.gl.POINTS:o===e.PointShape.Triangle?(this.PV=yy(e.PointShape.Triangle,this.yB,fy),this.uz=this.yB.gl.TRIANGLES):o===e.PointShape.Circle?(this.PV=yy(e.PointShape.Circle,this.yB,(t=>((t,e)=>{const i=function(t=25){return zu(u(0,0),0,360,.5,.5,t)[0]}(24);return new dy(t,i)})(t))),this.uz=this.yB.gl.TRIANGLE_FAN):o===e.PointShape.Square?(this.PV=yy(e.PointShape.Square,this.yB,gy),this.uz=this.yB.gl.TRIANGLES):this.uz=this.yB.gl.POINTS:this.uz=this.yB.gl.POINTS):this.PV&&(this.PV=void 0),d||this.Ro()){const t=this._a.length;if(H(h)&&this.FV&&this.FV>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=di(this.Ko.M()),s=Math.sin(i),r=Math.cos(i);for(let i=0;i0){const e=new Float32Array(t);for(let i=0;i{if(this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(o("uScaleStart_highpart"),this.dO.UR()).rL(o("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(o("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(o("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(o("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(o("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(e("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(e("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),this.yB.MR(n,i,this.ct.ni(),this.PV?1:void 0).oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).oL(o("uDevicePixelRatio"),this.yB.oO()),this.PV){const t=r("aInstanceGeo");this.yB.VL(t,this.PV.OB).GL(t,0)}if(1===t)this.yB.aL(e("uColor"),this.cE);else if(N(this.Se))this.yB.aL(e("uColor"),this.Se.getColor());else if(H(this.Se)&&this.DV){const t=r("aColor");this.yB.HL(t,this.DV),this.uz!==this.yB.gl.POINTS&&this.yB.GL(t,1)}else if(W(this.Se)&&this.bz){if("value"===this.Se.getLookUpProperty()&&this.LV){const t=r("aLookupValue");this.yB.UL(t,this.LV),this.uz!==this.yB.gl.POINTS&&this.yB.GL(t,1)}this.yB.LR(n,this.Se.lut,this.bz,0)}else if(Z(this.Se)){if(!this.SE)return!1;this.yB.SR(n,this.SE,this.Se)}else if(et(this.Se)){if(!this.xE)return!1;this.yB.xR(n,this.xE,this.Se)}if(this.BV&&this.uz!==this.yB.gl.POINTS){const t=r("aOffsetPixels");this.yB.UL(t,this.BV),this.uz!==this.yB.gl.POINTS&&this.yB.GL(t,1)}else if(this.uz!==this.yB.gl.POINTS){const t=e("uOffsetPixels");this.yB.oL(t,this.size.M())}if(this.OV&&this.uz!==this.yB.gl.POINTS){const t=r("aRot");this.yB.VL(t,this.OV),this.uz!==this.yB.gl.POINTS&&this.yB.GL(t,1)}else if(this.uz!==this.yB.gl.POINTS&&this.Ko.M()%360!=0){const t=di(this.Ko.M()),i=Math.sin(t),s=Math.cos(t);this.yB.rL(e("uRot"),[i,s])}if(this.uz===this.yB.gl.POINTS)this.yB.oL(e("uPointSize"),this.size.M());else{const t={x:2/this.ls.Ht().x,y:2/this.ls.Ht().y};this.yB.rL(e("uRatioPxClip"),[t.x,t.y])}let h=!1;return this.uz===this.yB.gl.POINTS?(this.yB.Xp(this.uz,s),h=!0):this.PV&&(this.yB.YL(this.uz,0,this.PV.TV,s),h=!0),h}))),this}rE(t){return this.uE===t&&{}}zx(t){this.$a()>0&&this.Ts();const e=this.Ea(),i=Pr(e,t,this.Ba,!1,!1,this.ct,this.ls.ct,this.Ta,void 0,void 0);return void 0!==i?e[i]:void 0}Me(t){return super.Me(t)}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return.5*this.size.M()}el(){return.5*this.size.M()}jB(){return this.IV&&(this.yB.fL(this.IV),this.IV=void 0),this.PV&&(this.PV=void 0),this.DV&&(this.yB.fL(this.DV),this.DV=void 0),this.OV&&(this.yB.fL(this.OV),this.OV=void 0),this.LV&&(this.yB.fL(this.LV),this.LV=void 0),this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this}}class py extends jr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.xz={fill:void 0,border:void 0},this.dO=new zg,this.Ta=Fe,this.RV=!1,this.EV=!1,this.zV=!1,this.VV=!1,this.Gc=[],this.iE=t,this.sE=e,this.Tz=n,this.yB=t.eE(),this.yz=this.yB.sR}kr(){const t=this.Tz(),e={ps:t=>this.Iz(e,t),us:t=>this.Pz(e,t),tl:t=>this.NV(e,t),gb:t=>this.GV(e,t),_a:[],u:void 0,xo:0,WV:!0,uE:t.id,cE:t.color};return this.Gc.push(e),e}Ha(){var t;return this.Gc.length=0,this.RV=!0,this.Ii&&this.un&&(null===(t=this.ls.an)||void 0===t?void 0:t.entity)===this&&this.un(this,void 0,this.ls.an.collectionMember),this}Iz(t,e){var i;return t.WV=e,this.VV=!0,this.Ii&&this.un&&(null===(i=this.ls.an)||void 0===i?void 0:i.entity)===this&&this.ls.an.collectionMember===t&&this.un(this,void 0,this.ls.an.collectionMember),t}Pz(t,e){return t.xo=e,this.zV=!0,t}NV(t,e){return t._a=e,this.RV=!0,t}GV(t,e){return t.u=e,this.EV=!0,t}Ts(){const t=this.po.M(),e=this.po.o,i=this.Ro(),s=this.zV,r=this.RV,n=this.EV,o=this.VV,a=this.xe,l=this.Go(),u=this.Gc.filter((t=>t.WV));if(this.dO.dL(this.ct),(r||o)&&(this.Ta=je(...u.map((t=>Xe(t._a))))),r||o){const t=Qt(u.map((t=>[...t._a,t._a[0],{x:Number.NaN,y:Number.NaN}])).flat(),this.ct.ni()),e=this.ct.ni()?4:2;this.Sz=this.yB.tL(t,!1,this.Sz);let i=[];u.reduce(((s,r)=>{const n=s,o=(r._a.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._a.length+2),0),e=new Float32Array(t);let i=0;u.forEach((t=>{const s=t._a.length+2;for(let r=i;rt+e._a.length+2),0),e=new Float32Array(4*t);let i=0;u.forEach((t=>{const s=t._a.length+2;for(let r=i;rt+e._a.length+2),0),e=new Float32Array(t);let i=0;u.forEach((t=>{const s=void 0!==t.u?t.u:-34028234663852886e22,r=t._a.length+2;for(let t=i;t{if(this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(f("uScaleStart_highpart"),this.dO.UR()).rL(f("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(f("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(f("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(f("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(f("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(e("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(e("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),this.yB.MR(d,n,this.ct.ni(),void 0).$L(u).UL(s("aIsHighlighted"),1===t||2===t?this.yB.dR:o).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.yB.HL(s("aColor"),h)}else if(i)this.yB.aL(e("uColor"),i.getColor());else if(a){if(!this.SE)return!1;this.yB.SR(d,this.SE,a)}else if(r){if(!this.xE)return!1;this.yB.xR(d,this.xE,r)}else if(l){if(!this.bz)return!1;if(this.yB.LR(d,l.lut,this.bz,0),"value"===l.getLookUpProperty()){if(!this.XV)return!1;this.yB.UL(s("aLookupValue"),this.XV)}}return this.yB.jL(c),!0}))}if(r){const{geometry:e,fillStyleSolid:s,thickness:a}=r,l=this.$V,u=1===t?null===(i=r.mousePicking)||void 0===i?void 0:i.shader:r.shader;if(!u||!n||!l)return this;this.yB.sO(u).eL(u,((i,r,u,c)=>{if(this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(i("uScale"),this.dO.lL()).rL(i("uDisp"),this.dO.uL()).rL(c("uScaleStart_highpart"),this.dO.UR()).rL(c("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(c("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(c("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(c("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(c("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(i("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(i("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),this.yB.hL(1===t||2===t?this.yB.dR:o,1,{location:r("aIsHighlighted"),size:1}).aL(i("uHighlightColorOffset"),this._o).oL(i("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.yB.hL(h,1,{location:r("aColor"),size:4})}else s&&this.yB.aL(i("uColor"),s.getColor());return ey.cz(this.ct.ni(),this.yB,n,u,this.ct.ni()?4:2,0),ey.mB(this.iE,e,u,this.yz&&1!==t,1===t,a,l),!0}))}return this}rE(t){const e=this.Gc.find((e=>e.uE===t));return!!e&&{collectionMember:e}}jB(){return this.HV&&(this.yB.fL(this.HV),this.HV=void 0),this.Sz&&(this.yB.fL(this.Sz),this.Sz=void 0),this.jV&&(this.yB.fL(this.jV),this.jV=void 0),this.YV&&(this.yB.fL(this.YV),this.YV=void 0),this.XV&&(this.yB.fL(this.XV),this.XV=void 0),this.xz={fill:void 0,border:void 0},this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return we(this.xe)}el(){return we(this.xe)}}class Sy extends Kr{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dO=new zg,this.ZV=Fe,this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE(),this.sE=e}Ts(){super.Ts();const t=this.po.M(),e=this.Ro(),i=this.jo.o||this.j.o||this.Ko.o||this.Jo.o,s=this.xe,r=this.Go(),n=s.getThickness(),o=this.Ho(n),h=this.Ko.M();this.dO.dL(this.ct);const a=this.ct.Mi();if(i||a){const t=this.j.M();this._a=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]=Ze(n[0],r,t),n[1]=Ze(n[1],r,t),n[2]=Ze(n[2],r,t),n[3]=Ze(n[3],r,t)}return n}(this.jo.M(),t.x,t.y,h,this.Jo.M());const e=Qt(this._a,this.ct.ni());this.gE=this.yB.tL(e,!1,this.gE),this.mE=this._a.length}this.ZV=Xe(this._a);const l=N(this.Se)&&this.Se,c=Z(this.Se)&&this.Se,d=et(this.Se)&&this.Se,f=Oo(this.Se)&&this.Se,g=l||c||d||f;if(e&&(this.bE=g?this.yB.sL(Bg["2D"],l&&Bg.Color({dataType:"uniform"}),d&&Bg.Color({dataType:["gradient",d]}),c&&Bg.Color({dataType:["gradient",c]}),f&&Bg.Color({dataType:["image",f.getFitMode()]}),Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})):void 0),c?this.SE=Gg(this.So||this.ZV,this.ct,c.getPosition(),c.getExtent(),c.getShape(),this.yB.oO()):d?this.xE=Hg(this.So||this.ZV,this.ct,d.getAngle(!0),this.yB.oO()):(this.SE=void 0,this.xE=void 0),f){const t=f.getSource();if((!this.KV||e)&&t){this.KV&&(this.KV.texture.eO(this),this.yB.fL(this.KV.texCoordsBuffer));const e=this.yB.bR(t);e.sO(this),this.KV={texture:e,texCoordsBuffer:this.yB.tL([]),sourceMissingTexture:this.yB.pR(new Uint8Array(Object.values(f.getSourceMissingColor().toJS()).map((t=>255*t))),this.yB.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{this.KV&&f&&(this.qV(),this.ls.Ss())}},e.BO(this.KV.textureReadyCallback),this.qV()}this.KV&&this.KV.texture.kO&&this.KV.texture.wO&&this.KV.texture.MO&&(this.KV.texture.Ts(),this.ls.Ss()),(a||i)&&this.KV&&this.KV.texture.kO&&this.qV()}else this.KV&&(this.KV.texture.eO(this),this.yB.fL(this.KV.texCoordsBuffer),this.KV=void 0);if(i||o||a&&1!==n){if(1===n||-1===n)[this.vE,this.JV]=[this._a,void 0];else{const t=this.ct;[this.vE,this.JV]=t instanceof Li?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.wi(s,r,h,-h),i.wi(r,s,-h,-h),i.wi(o,n,-h,-h),i.wi(n,o,h,-h),i.wi(s,r,-h,h),i.wi(r,s,h,h),i.wi(o,n,h,h),i.wi(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._a,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=ti(Qe(r,s)),l=ti(Qe(o,s)),c=ai(a),d=ai(l);return[[ri(s,ri(si(c,h.x),si(d,h.y))),ri(r,ri(si(a,h.x),si(d,h.y))),ri(o,ri(si(c,h.x),si(l,h.y))),ri(n,ri(si(a,h.x),si(l,h.y))),ri(s,ri(si(a,h.x),si(l,h.y))),ri(r,ri(si(c,h.x),si(l,h.y))),ri(o,ri(si(a,h.x),si(d,h.y))),ri(n,ri(si(c,h.x),si(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._a,t.Ai(),n)}this._E=this.yB.tL(Qt(this.vE,this.ct.ni()),!1,this._E),this.JV?(this.az=this.yB.EL(new Uint16Array(this.JV),this.az),this.ME=this.JV.length):(this.az&&this.yB.fL(this.az),this.az=void 0,this.ME=this.vE.length)}const y=qi(s)&&s,m=y&&y.getFillStyle(),p=m&&N(m)&&m,S=m&&et(m)&&m,x=m&&Z(m)&&m,b=y,v=p||S||x;return r&&(this.FE=b&&v?this.yB.sL(Bg["2D"],Bg.Color({dataType:x?["gradient",x]:S?["gradient",S]:"uniform"}),Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})):void 0),x?this.CE=Gg(this.ZV,this.ct,x.getPosition(),x.getExtent(),x.getShape(),this.yB.oO()):S?this.TE=Hg(this.ZV,this.ct,S.getAngle(!0),this.yB.oO()):(this.CE=void 0,this.TE=void 0),this.IE=t&&g?this.IE||this.yB.sL(Bg["2D"],Bg.Color({dataType:"uniform"}),Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})):void 0,this.PE=t&&this.xe!==st?this.PE||this.yB.sL(Bg["2D"],Bg.Color({dataType:"uniform"}),Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})):void 0,this.No(this.Se),this.Uo(s),this.jo.o=!1,this.Ko.o=!1,this.j.o=!1,this.Jo.o=!1,this}rE(t){return this.uE===t&&{}}qV(){if(this.KV&&Oo(this.Se)){const t=at(this.ca(),this.ct,this.ls.ct),i=ni(at(ri(this.ca(),this.Ht()),this.ct,this.ls.ct),t);this.KV.texCoordsBuffer=this.yB.tL(((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{if(this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(h("uScaleStart_highpart"),this.dO.UR()).rL(h("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(h("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(h("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(h("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(h("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(e("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(e("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),1===t)this.yB.aL(e("uColor"),this.cE);else if(N(r))this.yB.aL(e("uColor"),r.getColor());else if(Z(r)){if(!this.SE)return!1;this.yB.SR(o,this.SE,r)}else if(et(r)){if(!this.xE)return!1;this.yB.xR(o,this.xE,r)}else if(Oo(r)){if(!this.KV)return!1;const t=this.KV&&this.KV.texture.LO();this.yB.aL(h("uColor"),r.getSurroundingColor()).nL(e("uColorTexture"),t||this.KV.sourceMissingTexture,0).hL(this.KV.texCoordsBuffer,void 0,{location:n("aTextureCoord"),size:2}).DL(r.fitMode)}return this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).MR(o,i,this.ct.ni(),void 0).Xp(this.yB.gl.TRIANGLE_FAN,s),!0})));const n=1===t?this.PE:this.FE,o=this.xe,h=this._E;return n&&h&&qi(o)&&(this.yB.sO(n),this.yB.eL(n,((e,i,s,r)=>{this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(r("uScaleStart_highpart"),this.dO.UR()).rL(r("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(r("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(r("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(r("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(r("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(e("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(e("uViewportSize"),this.dO.MixedScaleXY.uViewportSize);const n=o.getFillStyle();if(1===t)this.yB.aL(e("uColor"),this.cE);else if(N(n))this.yB.aL(e("uColor"),n.getColor());else if(Z(n)){if(!this.CE)return!1;this.yB.SR(s,this.CE,n)}else if(et(n)){if(!this.TE)return!1;this.yB.xR(s,this.TE,n)}return this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).MR(s,h,this.ct.ni(),void 0),this.az?this.yB.$L(this.az).jL(this.ME):this.yB.Xp(this.yB.gl.LINE_LOOP,this.ME),!0}))),this}jB(){return this.az&&(this.yB.fL(this.az),this.az=void 0),this.gE&&(this.yB.fL(this.gE),this.gE=void 0),this._E&&(this.yB.fL(this._E),this._E=void 0),this.KV&&(this.KV.texture.eO(this),this.KV.texture.OO(this.KV.textureReadyCallback),this.yB.YB(this.KV.sourceMissingTexture),this.yB.fL(this.KV.texCoordsBuffer),this.KV=void 0),this.bE=void 0,this.FE=void 0,this.IE=void 0,this.PE=void 0,this}_t(){return Math.max(this.jo.M().x,this.jo.M().x+this.j.M().x)}Mt(){return Math.min(this.jo.M().x,this.jo.M().x+this.j.M().x)}wt(){return Math.max(this.jo.M().y,this.jo.M().y+this.j.M().y)}At(){return Math.min(this.jo.M().y,this.jo.M().y+this.j.M().y)}sl(){return we(this.xe)}el(){return we(this.xe)}}class xy extends Qr{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dO=new zg,this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE(),this.sE=e}zx(t){let e,i=Number.MAX_VALUE;for(const s of this._a){const r=Ne(at(s,this.ct,this.ls.ct),t);r=3,r=this.xe,n=this.Go(),o=r.getThickness(),a=this.Ho(o);this.dO.dL(this.ct),this.RM=this.ct.Ai();const l=this.ct.Mi();if(i&&(this.Ta=Xe(this._a)),i&&s){const t=Qt(this._a,this.ct.ni());this.gE=this.yB.tL(t,!1,this.gE),this.QV=new Uint16Array(h.default(t)),this.tN=this.yB.EL(this.QV,this.tN),this.mE=this.QV.length}const u=N(this.Se)&&this.Se,c=W(this.Se)&&this.Se,d=Z(this.Se)&&this.Se,f=et(this.Se)&&this.Se,g=u||c&&"value"!==c.getLookUpProperty()&&c||f||d;if(e&&(c?this.bz=this.iE.XE(c.lut,this.bz):this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this.bE=g?this.yB.sL(Bg["2D"],u&&Bg.Color({dataType:"uniform"}),f&&Bg.Color({dataType:["gradient",f]}),d&&Bg.Color({dataType:["gradient",d]}),c&&Bg.Color({dataType:["lookup",c.getLookUpProperty()]}),Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})):void 0),d?this.SE=Gg(this.So||this.Ta,this.ct,d.getPosition(),d.getExtent(),d.getShape(),this.yB.oO()):f?this.xE=Hg(this.So||this.Ta,this.ct,f.getAngle(!0),this.yB.oO()):(this.SE=void 0,this.xE=void 0),(i||a||l&&1!==o)&&s){const t=1===o||-1===o?this._a:Ug(this._a,this.RM,o);this.vE=Qt(t,this.ct.ni()),this._E=this.yB.tL(this.vE,!0,this._E),this.ME=t.length}const y=qi(r)&&r,m=y&&y.getFillStyle(),p=m&&N(m)&&m,S=m&&et(m)&&m,x=m&&Z(m)&&m,b=y,v=p||S||x;return n&&(this.FE=b&&v?this.yB.sL(Bg["2D"],Bg.Color({dataType:x?["gradient",x]:S?["gradient",S]:"uniform"}),Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})):void 0),x?this.CE=Gg(this.So||this.Ta,this.ct,x.getPosition(),x.getExtent(),x.getShape(),this.yB.oO()):S?this.TE=Hg(this.So||this.Ta,this.ct,S.getAngle(!0),this.yB.oO()):(this.CE=void 0,this.TE=void 0),this.IE=t&&g?this.IE||this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})):void 0,this.PE=t&&this.xe!==st?this.IE||this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})):void 0,this.Qa=!1,this.No(this.Se),this.Uo(r),this}mB(t){const e=this.Se,i=1===t?this.IE:this.bE,s=this.gE,r=this.mE;i&&s&&r&&this.yB.sO(i).eL(i,((i,r,n,o)=>{if(this.yB.rL(i("uScale"),this.dO.lL()).rL(i("uDisp"),this.dO.uL()).rL(o("uScaleStart_highpart"),this.dO.UR()).rL(o("uScaleStart_lowpart"),this.dO.$R()).MR(n,s,this.ct.ni(),void 0).$L(this.tN).oL(i("uIsHighlighted"),1===t||2===t?0:this.xo).aL(i("uHighlightColorOffset"),this._o).oL(i("uRenderEffectMask"),2===t?1:0),1===t)this.yB.aL(i("uColor"),this.cE);else if(N(e))this.yB.aL(i("uColor"),e.getColor());else if(Z(e)){if(!this.SE)return!1;this.yB.SR(n,this.SE,e)}else if(et(e)){if(!this.xE)return!1;this.yB.xR(n,this.xE,e)}else W(e)&&this.bz&&this.yB.LR(n,e.lut,this.bz,0);return this.yB.jL(this.mE),!0}));const n=1===t?this.PE:this.FE,o=this.xe,h=this._E,a=this.ME;return n&&h&&a&&this.yB.sO(n).eL(n,((e,i,s,r)=>{this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).MR(s,h,this.ct.ni(),void 0);const n=o.getFillStyle();if(1===t)this.yB.aL(e("uColor"),this.cE);else if(N(n))this.yB.aL(e("uColor"),n.getColor());else if(Z(n)){if(!this.CE)return!1;this.yB.SR(s,this.CE,n)}else if(et(n)){if(!this.TE)return!1;this.yB.xR(s,this.TE,n)}const a=o.getThickness(),l=-1===a||1===a;return this.yB.Xp(l?this.yB.gl.LINE_LOOP:this.yB.gl.TRIANGLE_STRIP,this.ME),!0})),this}rE(t){return this.uE===t&&{}}jB(){return this.tN&&(this.yB.fL(this.tN),this.tN=void 0),this.gE&&(this.yB.fL(this.gE),this.gE=void 0),this._E&&(this.yB.fL(this._E),this._E=void 0),this.bE=void 0,this.FE=void 0,this.IE=void 0,this.PE=void 0,this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this}}const by=(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},My=(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(!De(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const u=ze(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.pR(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.pR(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.pR(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},wy=(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 Ey extends Yr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.iN=p("bilinear"),this.lu=vr.lineStyle,this.engine=t,this.Ta=y({x:Math.min(n.start.x,n.start.x+n.columns*n.step.x),y:Math.min(n.start.y,n.start.y+n.rows*n.step.y)},{x:Math.max(n.start.x,n.start.x+n.columns*n.step.x),y:Math.max(n.start.y,n.start.y+n.rows*n.step.y)});const o="columns"===n.dataOrder?n.columns:n.rows,h="columns"===n.dataOrder?n.rows:n.columns;this._n={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}uS(t){return this.iN.S(t),this}cS(){return this.iN.M()}uu(t){return this.lu="function"==typeof t?t(this.lu):t,this}cu(){return this.lu}}class Iy extends Ey{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.dO=new zg,this.xz={},this.sN=[],this.eN=!1,this.Oa=!1,this.hN=by,this.iE=t,this.sE=e,this.uE=o,this.cE=h,this.yB=t.eE(),this.sE=e;const a=Math.min(this.yB.$B,void 0!==n.rN?n.rN:2048),l={x:Math.min(a,this._n.primaryDimensionVectorsCount),y:Math.min(a,this._n.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._n,l,this.hN),c=u.gridTiles.map((t=>{const e="columns"===this._n.dataOrder?{x:this._n.start.x+this._n.step.x*t.iFirstVector.primary,y:this._n.start.y+this._n.step.y*t.iFirstVector.secondary}:{x:this._n.start.x+this._n.step.x*t.iFirstVector.secondary,y:this._n.start.y+this._n.step.y*t.iFirstVector.primary},i="columns"===this._n.dataOrder?{x:this._n.step.x*t.sizeHeatmapDataVectors.primary,y:this._n.step.y*t.sizeHeatmapDataVectors.secondary}:{x:this._n.step.x*t.sizeHeatmapDataVectors.secondary,y:this._n.step.y*t.sizeHeatmapDataVectors.primary},s="columns"===this._n.dataOrder?{x:this._n.start.x+this._n.step.x*t.iFirstUniqueVector.primary,y:this._n.start.y+this._n.step.y*t.iFirstUniqueVector.secondary}:{x:this._n.start.x+this._n.step.x*t.iFirstUniqueVector.secondary,y:this._n.start.y+this._n.step.y*t.iFirstUniqueVector.primary},r="columns"===this._n.dataOrder?{x:this._n.step.x*t.sizeUniqueHeatmapDataVectors.primary,y:this._n.step.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this._n.step.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this._n.step.y*t.sizeUniqueHeatmapDataVectors.primary},n=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary);return{...t,startLocationAxis:e,startRenderLocationAxis:s,sizeAxis:i,renderSizeAxis:r,intensityData:n,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.nN={gridTiles:c,gridTileSizes:d}}Ts(){const t=this.sN,e=this.Se,i=this.Ro(),s=this.lu,r=s!==this.Iu,n=W(e)&&e,o=N(e)&&e,h=n&&n.getPalette(),a=this.iN.o,l=this.iN.M(),u=this.Oa,c=this.po.M();this.oN=this.oN||this.aN();const d=this.oN,f=My(t,d,u?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));f.size>0&&(wy(this.yB,f,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.eN=!0),this.dO.dL(this.ct);const g=this.xz;if((i||a)&&(h?this.lN=this.iE.XE(h,this.lN):this.lN&&(this.iE.ZE(this.lN),this.lN=void 0),g.tile=n&&this.lN?{renderMode:"paletted",fillStylePaletted:n,colorLookupTexture:this.lN,shader:this.yB.sL(Bg["2D"],Bg.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===l&&"bilinear",flipXY:"rows"===this._n.dataOrder,intensityTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN}),Bg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Zf(this.ct),flipXY:"rows"===this._n.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:"uniform"}),Bg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Zf(this.ct),flipXY:"rows"===this._n.dataOrder,normalSource:void 0}))}:void 0),r){const t=qi(s)&&s,e=t&&t.getFillStyle(),i=N(e)&&e;g.wireframe=t&&i?-1===t.getThickness()?{renderMode:"primitive",shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:"uniform"}),Bg.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this._n.dataOrder,axisWorldTranslation:Zf(this.ct),normalSource:void 0})),fillStyleSolid:i}:{renderMode:"triangulated",shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:"uniform"}),Bg.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this._n.dataOrder,axisWorldTranslation:Zf(this.ct),normalSource:void 0})),geometry:ty(this.yB,1),solidLine:t,fillStyleSolid:i}:void 0,g.wireframe?this.uN=this.uN||this.cN():this.uN&&(this.yB.fL(this.uN.wireframeCoordinatesBuffer),this.uN=void 0)}return g.mousePicking=c?this.xz.mousePicking||{shader:this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Zf(this.ct),flipXY:"rows"===this._n.dataOrder,normalSource:void 0}))}:void 0,this.xz=g,this.Oa=!1,this.sN.length=0,this.No(e),this.Iu=s,this.iN.o=!1,this}aN(){const t=this.nN.gridTiles.map((t=>{const e=Ty(this.yB,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e}})),e=this.nN.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.yB.tL([0,0,1,0,0,1,1,1]),s=this.yB.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}cN(){const t=this._n.primaryDimensionVectorsCount+1+this._n.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{if(1===t)this.yB.aL(e("uColor"),this.cE);else if("solid"===i.renderMode){const{fillStyleSolid:t}=i;this.yB.aL(e("uColor"),t.getColor())}return this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).hL(s.rectangleLocationsBuffer,void 0,{location:r("aPos"),size:2}).rL(e("uScaling"),[this._n.step.x*this._n.columns,this._n.step.y*this._n.rows]).rL(e("uTranslationAxis"),[this._n.start.x,this._n.start.y]).Xp(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),!0}));else if("paletted"===i.renderMode){const{colorLookupTexture:r,fillStylePaletted:n}=i;this.yB.eL(e,((i,o,h)=>{let l=!1;var u,c;return this.yB.sO(e).rL(i("uScale"),this.dO.lL()).rL(i("uDisp"),this.dO.uL()).LR(h,n.lut,r,0).hL(s.rectangleLocationsBuffer,void 0,{location:o("aPos"),size:2}).oL(i("uIsHighlighted"),this.xo).aL(i("uHighlightColorOffset"),this._o).oL(i("uRenderEffectMask"),2===t?1:0),u=t=>{this.yB.rL(i("uTileDimensions"),["columns"===this._n.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this._n.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},c=(t,e)=>{let r;const n=this.yB.oO();if("bilinear"===this.iN.M()){const e=(this.ct.x.ut(t.startLocationAxis.x)+a.x/2)*n,i=(this.ct.y.ut(t.startLocationAxis.y)+a.y/2)*n;r=[e,i,(this.ct.x.ut(t.startLocationAxis.x+t.sizeAxis.x)-a.x/2)*n-e,(this.ct.y.ut(t.startLocationAxis.y+t.sizeAxis.y)-a.y/2)*n-i]}else{const e=this.ct.x.ut(t.startLocationAxis.x)*n,i=this.ct.y.ut(t.startLocationAxis.y)*n;r=[e,i,this.ct.x.ut(t.startLocationAxis.x+t.sizeAxis.x)*n-e,this.ct.y.ut(t.startLocationAxis.y+t.sizeAxis.y)*n-i]}this.yB.CL(i("uTileBounds"),r).rL(i("uScaling"),[t.renderSizeAxis.x,t.renderSizeAxis.y]).rL(i("uTranslationAxis"),[t.startRenderLocationAxis.x,t.startRenderLocationAxis.y]).nL(i("uTileIntensityValues"),t.intensityDataTexture,1).Xp(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),l=!0},s.gridTileSizes.forEach((t=>{u(t),t.tiles.forEach((t=>{c(t)}))})),l}))}}const n=this.uN,o=this.xz.wireframe,h=1===t||null==o?void 0:o.shader;if(n&&o&&h&&"primitive"===o.renderMode){const e=h,{fillStyleSolid:i}=o;this.yB.sO(e).eL(e,((e,s,r)=>((this.ct instanceof _i||this.ct instanceof yu)&&this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()),this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).aL(e("uColor"),i.getColor()).hL(n.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).rL(e("uScaling"),[this._n.step.x,this._n.step.y]).rL(e("uTranslationAxis"),[this._n.start.x,this._n.start.y]).Xp(this.yB.gl.LINES,2*n.wireframeSegmentsLength),!0)))}else if(n&&o&&"triangulated"===o.renderMode){const{shader:e,geometry:i,solidLine:s,fillStyleSolid:r}=o;this.yB.sO(e).eL(e,((e,o,h)=>((this.ct instanceof _i||this.ct instanceof yu)&&this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()),this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).aL(e("uColor"),r.getColor()).oL(e("uThicknessPixels"),s.getThickness()).rL(e("uRatioPxClip"),[2/this.ls.Ht().x,2/this.ls.Ht().y]).hL(n.wireframeCoordinatesBuffer,1,{location:o("aLocationA"),size:2},{location:o("aLocationB"),size:2}).rL(e("uScaling"),[this._n.step.x,this._n.step.y]).rL(e("uTranslationAxis"),[this._n.start.x,this._n.start.y]),i.sO(h,!1).Xp(n.wireframeSegmentsLength),!0)))}return this}dS(t){return this.sN.push(t),Ay(this.nN.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this}Ha(){return this.eN&&(this.nN.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.Oa=!0,this.eN=!1),this}dispose(){super.dispose(),this.lN&&(this.iE.ZE(this.lN),this.lN=void 0);const t=this.oN;t&&(t.gridTiles.forEach((t=>{this.yB.YB(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.yB.fL(t.rectangleLocationsBuffer)),this.oN=void 0;const e=this.uN;return e&&this.yB.fL(e.wireframeCoordinatesBuffer),this.uN=void 0,this.xz={},this}jB(){return this.dispose(),this}rE(t){return this.uE===t&&{}}zx(t){const e=t,i="columns"===this._n.dataOrder?e.x:e.y,s="columns"===this._n.dataOrder?e.y:e.x,r="columns"===this._n.dataOrder?this._n.start.x:this._n.start.y,n="columns"===this._n.dataOrder?this._n.start.y:this._n.start.x;let o=(i-r)/("columns"===this._n.dataOrder?this._n.step.x:this._n.step.y),h=(s-n)/("columns"===this._n.dataOrder?this._n.step.y:this._n.step.x);o=Math.floor(Ct(o,0,this._n.primaryDimensionVectorsCount-1)),h=Math.floor(Ct(h,0,this._n.secondaryDimensionVectorsCount-1));const a=this.dN(o,h),l="columns"===this._n.dataOrder?{x:this._n.start.x+(o+.5)*this._n.step.x,y:this._n.start.y+(h+.5)*this._n.step.y}:{x:this._n.start.x+(h+.5)*this._n.step.x,y:this._n.start.y+(o+.5)*this._n.step.y},u="columns"===this._n.dataOrder?o:h,c="columns"===this._n.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}tv(t){if(t.xthis.Ta.max.x||t.ythis.Ta.max.y)return;const e=t,i="columns"===this._n.dataOrder?e.x:e.y,s="columns"===this._n.dataOrder?e.y:e.x,r="columns"===this._n.dataOrder?this._n.start.x:this._n.start.y,n="columns"===this._n.dataOrder?this._n.start.y:this._n.start.x,o="columns"===this._n.dataOrder?this._n.step.x:this._n.step.y,h="columns"===this._n.dataOrder?this._n.step.y:this._n.step.x,a=Ct((i-r)/o-.5,0,this._n.primaryDimensionVectorsCount-1),l=Ct((s-n)/h-.5,0,this._n.secondaryDimensionVectorsCount-1),u=Ct(Math.ceil(a)-1,0,this._n.primaryDimensionVectorsCount-1),c=Ct(Math.ceil(l)-1,0,this._n.secondaryDimensionVectorsCount-1),d={point:{x:u,y:c},value:this.dN(u,c)},f={point:{x:u,y:c+1},value:this.dN(u,c+1)},g={point:{x:u+1,y:c},value:this.dN(u+1,c)},y={point:{x:u+1,y:c+1},value:this.dN(u+1,c+1)},m=Ao({x:a,y:l},d,f,g,y);if(void 0===m)return;const p=Ct(Math.floor(a+.5),0,this._n.primaryDimensionVectorsCount-1),S=Ct(Math.floor(l+.5),0,this._n.secondaryDimensionVectorsCount-1),x="columns"===this._n.dataOrder?p:S,b="columns"===this._n.dataOrder?S:p,v=t;return{x:v.x,y:v.y,column:x,row:b,cellValue:m}}dN(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}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return 0}el(){return 0}jC(){const t=[];return this.nN.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){for(let e=0;e0?this.nM[0].boundaries.min.x:ke:this.Ta.min.y=this.nM.length>0?this.nM[0].boundaries.min.y:ke}return this.nM.forEach((t=>t.shape.Ts())),this.Ql.o=!1,this}mB(t){return this.nM.forEach((e=>e.shape.mB(t))),this}yS(t){if(0===t.length)return this;let e=0;const i=this.gN.dataPerSegment,s=t.length;do{let r=this.nM[this.nM.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this._n.scrollDimension?i:this._n.resolution,rows:"rows"===this._n.scrollDimension?i:this._n.resolution,heatmapDataType:this._n.heatmapDataType,dataOrder:this._n.scrollDimension,step:this._n.step,start:"columns"===this._n.scrollDimension?{x:this._n.start.x+this._n.step.x*this.fN,y:this._n.start.y}:{x:this._n.start.x,y:this._n.start.y+this._n.step.y*this.fN}};this.nM.length>0&&(t.start="columns"===this._n.scrollDimension?{x:t.start.x-1*this._n.step.x,y:t.start.y}:{x:t.start.x,y:t.start.y-1*this._n.step.y},o=!0);const e=new Iy(this.iE,this.sE,this.ct,Et,[],t,this.uE,this.cE).uS(this.iN.M()).Me(this.Se).uu(this.lu);r={shape:e,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.fN,hasJoint:!1,boundaries:e.Ta},this.nM.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._n.resolution};o&&(u.values.unshift(this.pN),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.dS(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),r.boundaries=r.shape.Ta,this.pN=l[l.length-1],this.fN+=a,e+=a}while(e{t.shape.dispose().jB()})),this.nM.length=0,this.Ta=this._n.initialBoundaries,this.fN=0,this.pN=void 0,this}Me(t){return super.Me(t),this.nM.forEach((t=>t.shape.Me(this.Se))),this}uu(t){return super.uu(t),this.nM.forEach((t=>t.shape.uu(this.lu))),this}uS(t){return super.uS(t),this.nM.forEach((e=>e.shape.uS(t))),this}dispose(){return super.dispose(),this.nM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.nM.forEach((e=>e.shape.setVisible(t))),this}jB(){return this.nM.forEach((t=>t.shape.jB())),this}rE(t){return this.uE===t&&{}}zx(t){const e=at(t,this.ct,this.engine.ct),i=this.nM.reduce(((i,s)=>{const r=s.shape.zx(t);if(r){const t=Ge(at(r,this.ct,this.engine.ct),e);if(void 0===i||t=this.fN||"rows"===this._n.scrollDimension&&e>=this.fN)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}tv(t){const e=at(t,this.ct,this.engine.ct),i=this.nM.reduce(((i,s)=>{const r=s.shape.tv(t);if(r){const t=Ge(at(r,this.ct,this.engine.ct),e);if(void 0===i||t=this.fN||"rows"===this._n.scrollDimension&&e>=this.fN)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return 0}el(){return 0}us(t){return super.us(t),this.nM.forEach((e=>e.shape.us(t))),this}}class Py extends Yr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.iN=p("bilinear"),this.lu=vr.lineStyle,this._n=n}uS(t){return this.iN.S(t),this}cS(){return this.iN.M()}uu(t){return this.lu="function"==typeof t?t(this.lu):t,this}cu(){return this.lu}}class Fy extends Py{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.dO=new zg,this.xz={},this.iE=t,this.sE=e,this.uE=o,this.cE=h,this.yB=t.eE(),this.sE=e,this.UC=new Iy(this.iE,t.mN,t.ct,Et,[],{start:{x:0,y:0},step:{x:1,y:1},columns:n.sectors,rows:n.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===n.dataOrder?"rows":"columns",rN:this.yB.$B},-1,C).uu(st);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.yN={vertexBuffer:this.yB.tL(l),drawMode:this.yB.gl.TRIANGLE_FAN,drawLength:362}}Ts(){const t=this.Se,e=N(t)&&t,i=W(t)&&t,s=e||i,r=this.Ro(),n=i&&i.getPalette(),o=this.iN.M(),h=this.iN.o,a=this.po.M(),l=this.po.o;return this.dO.dL(this.ct),this.UC.Ts(),this.UC.oN?((r||h)&&(this.xz.fill=s?{shader:this.yB.sL(Bg["2D"],Bg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Zf(this.ct),normalSource:void 0}),i&&Bg.PolarHeatmap({interpolation:"bilinear"===o&&"bilinear",intensityTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this._n.dataOrder}),e&&Bg.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:i,fillStyleSolid:e}:void 0,n?this.lN=this.iE.XE(n,this.lN):this.lN&&(this.iE.ZE(this.lN),this.lN=void 0)),l&&(this.xz.mousePicking=a?{shader:this.yB.sL(Bg["2D"],Bg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Zf(this.ct),normalSource:void 0}),Bg.Color({dataType:"uniform"}))}:void 0),this.No(t),this.iN.o=!1,this.po.o=!1,this):this}mB(t){var e;const{vertexBuffer:i,drawLength:s,drawMode:r}=this.yN,n=this.UC.oN,o=this.lN;if(!this.xz.fill||!n)return this;const{fillStylePaletted:h,fillStyleSolid:a}=this.xz.fill,l=1===t?null===(e=this.xz.mousePicking)||void 0===e?void 0:e.shader:this.xz.fill.shader;if(!l)return this;const u=this.ct.Ob(),c=Math.min(u.start,u.end),d=Math.max(u.start,u.end),f=Math.min(this._n.amplitudeStart,this._n.amplitudeStart+(this._n.annuli-1)*this._n.amplitudeStep),g=Math.max(this._n.amplitudeStart,this._n.amplitudeStart+(this._n.annuli-1)*this._n.amplitudeStep);let y;return y=u.end>u.start?Math.min(g,d)-u.start:Math.max(f,c)-u.start,this.yB.sO(l).eL(l,((e,l,u,c)=>{if(this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).rL(c("uViewportSize"),[this.iE.Ht().x*this.yB.oO(),this.iE.Ht().y*this.yB.oO()]).rL(e("uScaling"),[y,y]).rL(e("uTranslationAxis"),[0,0]).hL(i,void 0,{location:l("aPos"),size:2}).oL(c("uAngleOffset"),this.ct.Vb()%(2*Math.PI)).oL(c("uAngleDirection"),this.ct.Ub()?1:-1).oL(c("uSectors"),this._n.sectors).oL(c("uAnnuli"),this._n.annuli),1===t)this.yB.aL(e("uColor"),this.cE);else{if(this.yB.oL(e("uAmplitudeStart"),this._n.amplitudeStart).oL(e("uAmplitudeStep"),this._n.amplitudeStep).oL(e("uAmplitudeAxisStart"),this.ct.Ob().start).oL(e("uAmplitudeAxisEnd"),this.ct.Ob().end),h){if(!o)return!1;this.yB.LR(u,h.lut,o,1).nL(e("uTileIntensityValues"),n.gridTiles[0].intensityDataTexture,0)}a&&this.yB.aL(e("uColor"),a.getColor())}return this.yB.Xp(r,s),!0})),this}dS(t){return this.UC.dS(t),this}Ha(){return this.UC.Ha(),this}dispose(){return super.dispose(),this.lN&&(this.iE.ZE(this.lN),this.lN=void 0),this.UC.dispose(),this.xz={},this.yB.fL(this.yN.vertexBuffer),this}jB(){return this.dispose(),this}rE(t){return this.uE===t&&{}}zx(t){const e=this._n.amplitudeStart,i=this._n.amplitudeStart+(this._n.annuli-1)*this._n.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._n.sectors);n>=this._n.sectors&&(n=0);const o=Math.round((t.amplitude-e)/(i-e)*(this._n.annuli-1));return{iAnnulus:o,iSector:n,cellValue:this.dN(o,n),angle:n*(360/this._n.sectors),amplitude:e+o*(i-e)/(this._n.annuli-1)}}tv(t){const e=this._n.amplitudeStart,i=this._n.amplitudeStart+(this._n.annuli-1)*this._n.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._n.sectors,o=(t.amplitude-e)/(i-e)*(this._n.annuli-1),h=Math.floor(n),a=Math.floor(o),l={point:{x:a,y:h},value:this.dN(a,h)},u={point:{x:a,y:h+1},value:this.dN(a,h+1)},c={point:{x:a+1,y:h},value:this.dN(a+1,h)},d={point:{x:a+1,y:h+1},value:this.dN(a+1,h+1)},f=Ao({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}dN(t,e){const i="annuli"===this._n.dataOrder?t:e,s="annuli"===this._n.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}_t(){return 0}Mt(){return 0}wt(){return 0}At(){return 0}sl(){return 0}el(){return 0}}const By={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)=>By.multiply(t,By.translation(e,i)),rotate:(t,e)=>By.multiply(t,By.rotation(e)),scale:(t,e,i)=>By.multiply(t,By.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],S=e[7],x=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+S*n+x*a,p*s+S*o+x*l,p*r+S*h+x*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class _y extends $r{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.SN=[],this.dO=new zg,this.xN=[u(0,0),u(0,0),u(0,0),u(0,0)],this.bN=y(u(0,0),u(0,0)),this.vN=y(u(0,0),u(0,0)),this.MN=u(0,0),this._N=u(0,0),this.RM=u(0,0),this.AN=u(0,0),this.wN=0,this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE(),this.sE=e,this.Fz=t._n.On}Ts(){const t=this.Vo(),e=this.zo(),i=this.po.M();if(t){const t=this.yB,s=this.yB.oO();if(this.dO.dL(this.ct),this.qo.o){this.kN&&this.kN.eO(this),this.font.S(fr(this.qo.M()));const t=this.font.M();this.kN=this.yB.Fh(t.properties.family),this.kN.sO(this)}const r=this.font.o,n=r||this.$o.o;if(n&&this.kN){const e=this.font.M();[this.CN,this.vN]=this.kN.rO(this.$o.M(),e.properties),this.SN.forEach((e=>{e.texCoordBuff&&t.fL(e.texCoordBuff),e.vertexBuff&&t.fL(e.vertexBuff)})),this.SN=this.CN.map((e=>({texCoordBuff:t.tL(e.texCoords,!1),texture:e.texture,info:e}))),this.qo.o=!1,this.font.o=!1,this.$o.o=!1}const o=this.ct.Mi()||e,h=this.jo.o||this.Xo.o||this.Yo.o||this.Zo.o||this.Qo.o||this.Ft.o||n||o,a=this.Qo.M(),l=si(u(this.Xo.M()+1,this.Yo.M()+1),.5);if(h&&this.CN&&(this.MN=u(-(a.left*s+this.vN.max.x-this.vN.min.x+a.right*s)*l.x-this.vN.min.x+a.right*s,-(a.bottom*s+this.vN.max.y-this.vN.min.y+a.top*s)*l.y-this.vN.min.y+a.top*s)),(h||o||this.Ko.o||this.Ro())&&this.Se!==z){if(this.CN){const e=ri(this.jo.M(),this.Zo.M()),i=at(e,this.ct,this.ls.ct),r=si(i,s);this.AN=r;const o=di(this.Ko.M());this.wN=o,n&&this.SN.forEach((e=>{const i=e.info;i&&(e.vertexBuffLen=i.vertices.length/2,e.vertexBuff=t.tL(i.vertices,!0,e.vertexBuff))}));const h=this.Ft.M(),c=[ri(Ze(u((this.vN.min.x+(-h.left-a.left)*s+this.MN.x)/s,(this.vN.max.y+(h.top+a.top)*s+this.MN.y)/s),this.Jo,o),i),ri(Ze(u((this.vN.max.x+(h.right+a.right)*s+this.MN.x)/s,(this.vN.max.y+(h.top+a.top)*s+this.MN.y)/s),this.Jo,o),i),ri(Ze(u((this.vN.max.x+(h.right+a.right)*s+this.MN.x)/s,(this.vN.min.y+(-h.bottom-a.bottom)*s+this.MN.y)/s),this.Jo,o),i),ri(Ze(u((this.vN.min.x+(-h.left-a.left)*s+this.MN.x)/s,(this.vN.min.y+(-h.bottom-a.bottom)*s+this.MN.y)/s),this.Jo,o),i)];this.xN=[at(c[0],this.ls.ct,this.ct),at(c[1],this.ls.ct,this.ct),at(c[2],this.ls.ct,this.ct),at(c[3],this.ls.ct,this.ct)];const d=Xe(c);this._N=u(-(d.max.x-d.min.x)*s*l.x-d.min.x*s+this.AN.x,-(d.max.y-d.min.y)*s*l.y-d.min.y*s+this.AN.y),this.AD=ni(d.max,d.min);const f=Xe(this.xN),g=this.ct.Jt(f.min,this._N),y=this.ct.Jt(f.max,this._N);this.bN=Xe([g,y])}Z(this.Se)?this.SE=Gg(this.bN,this.ct,this.Se.getPosition(),this.Se.getExtent(),this.Se.getShape(),this.yB.oO()):et(this.Se)?this.xE=Hg(this.bN,this.ct,this.Se.getAngle(!0),this.yB.oO()):(this.SE=void 0,this.xE=void 0)}const c=N(this.Se)&&this.Se,d=Z(this.Se)&&this.Se,f=et(this.Se)&&this.Se,g=c||d||f;(this.Ro()||r)&&(this.gO=g?this.yB.sL(Bg["2D"],Bg.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.Fz}),Bg.Color({dataType:d?["gradient",d]:f?["gradient",f]:"uniform",maskTexture:!0})):void 0),this.TN=i&&g?this.TN||this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.Fz})):void 0,this.jo.o=!1,this.Xo.o=!1,this.Yo.o=!1,this.Zo.o=!1,this.Ko.o=!1,this.No(this.Se)}return this.ta=t,this}mB(t){if(this.Vo()){const e=1===t?this.TN:this.gO;if(!e||0===this.SN.length)return this;const i=this.yB.gl.drawingBufferWidth,s=this.yB.gl.drawingBufferHeight;let r=By.projection(i,s,-1);const n=By.translation(this.MN.x,this.MN.y),o=By.translation(this._N.x,this._N.y);r=By.translate(r,this.AN.x,this.AN.y),r=By.multiply(r,o),r=By.rotate(r,this.wN),r=By.multiply(r,n),1===t&&(r=By.scale(r,this.vN.max.x,this.vN.max.y)),this.yB.sO(e).eL(e,((e,i,s,n)=>{if(this.yB.FL(e("uMatrix"),r).oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),this.Fz&&this.yB.rL(n("uViewportSizePx"),[this.ls.Ht().x*this.yB.oO(),this.ls.Ht().y*this.yB.oO()]),1===t)this.yB.aL(e("uColor"),this.cE);else if(N(this.Se))this.yB.aL(e("uColor"),this.Se.getColor());else if(Z(this.Se)&&this.SE){this.yB.rL(e("uCenter"),this.SE.center).rL(e("uDistance"),this.SE.distance).CL(e("uBounds"),this.SE.bounds).oL(e("uAspect"),this.SE.aspectRatio);const t=this.Se.getColorStops();for(let i=0;i{this.yB.VL(i("aPos"),t.vertexBuff).VL(i("aMaskTextureCoord"),t.texCoordBuff).nL(e("uMaskTexture"),t.texture,0).Xp(this.yB.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return this}rE(t){return this.uE===t&&{}}ze(){return this.Vo()?this.xN:[]}Ic(){return this.Vo()&&this.AD?this.AD:u(0,0)}Ht(){if(this.Vo()&&this.bN){const t=this.bN;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}jB(){return this.SN.forEach((t=>{t.texCoordBuff&&this.yB.fL(t.texCoordBuff),t.vertexBuff&&this.yB.fL(t.vertexBuff)})),this.SN=[],this.kN&&this.kN.eO(this),this}_t(){return this.bN.max.x}Mt(){return this.bN.min.x}wt(){return this.bN.max.y}At(){return this.bN.min.y}sl(){return 0}el(){return 0}}class Ly{constructor(t,e,i){this.FN=new Set,this.IN=t=>(this.FN.add(t),t),this.PN=t=>(this.FN.delete(t),t.jB(),this),this.ls=t,this.Po=e,this.DN=i}pB(t){this.FN.delete(t)&&this.FN.add(t)}G(){for(const t of this.FN)t.jB().dispose();this.ls.en(this.Po)}Ss(){return this.ls.Ss(),this}sn(){return this.Po}}class Dy extends Ly{constructor(){super(...arguments),this.ON=p(void 0),this.Do=!1}kS(t){return this.ON.S(t),this}cp(){return this.ON.M()}}class zy extends Dy{constructor(t,e,i){super(t,e,i),this.iE=t,this.gl=t.eE(),this.LN=this.FN}QO(t){const e=t instanceof Nr&&t;if(!e)return Fe;const i=e.Mt(),s=e._t(),r=e.At(),n=e.wt();if(i===ke||s===Pe||r===ke||n===Pe)return Fe;const o=e.sl(),h=e.el(),a=Gr({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.ct),l={min:at(a.min,e.ct,t.ls.ct),max:at(a.max,e.ct,t.ls.ct)},u=this.ON.M();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.iE.EN();return{id:t,color:this.iE.zN(t)}})))}tm(t,e,i){const s=this.iE.EN();return this.IN(new cy(this.iE,this,t,this.PN,i,s,this.iE.zN(s),e))}Sr(t){const e=this.iE.EN();return this.IN(new _y(this.iE,this,t,this.PN,[],e,this.iE.zN(e)))}vy(t){const e=this.iE.EN();return this.IN(new my(this.iE,this,t,this.PN,[],e,this.iE.zN(e)))}Cc(t,e=sn.Simple){const i=this.iE.EN();if(e===sn.Simple)return this.IN(new xy(this.iE,this,t,this.PN,[],i,this.iE.zN(i)));throw new Error("GlEngine.addPolygon | No such polygon type!")}ab(t){return this.IN(new py(this.iE,this,t,this.PN,[],(()=>{const t=this.iE.EN();return{id:t,color:this.iE.zN(t)}})))}_e(t){const e=this.iE.EN();return this.IN(new Sy(this.iE,this,t,this.PN,[],e,this.iE.zN(e)))}nC(t){const e=this.iE.EN();return this.IN(new Zg(this.iE,this,t,this.PN,[],e,this.iE.zN(e)))}Dc(t){const e=this.iE.EN();return this.IN(new Wg(this.iE,this,t,this.PN,[],e,this.iE.zN(e)))}JC(t,e,i){if("intensity"===i.heatmapDataType){const s=this.iE.EN();return this.IN(new ky(this.iE,this,t,this.PN,e,s,this.iE.zN(s),i))}throw new ft("Unimplemented Heatmap Grid Static type")}$C(t,e,i){const s=this.iE.EN();return this.IN(new Iy(this.iE,this,t,this.PN,e,i,s,this.iE.zN(s)))}Qb(t,e,i){const s=this.iE.EN();return this.IN(new Fy(this.iE,this,t,this.PN,e,i,s,this.iE.zN(s)))}VN(t){return this.IN(new Ng(this.iE,this,this.PN,[],t))}Ts(){if(this.Do){this.Do=!1;const t=Array.from(this.FN).sort(((t,e)=>t.Oo()-e.Oo()));this.FN.clear();for(const e of t)this.FN.add(e)}for(const t of this.FN)t.Ts();return this}mB(t,e){const i=this.ON.M();if(i&&this.gl.JO(i.x*this.gl.oO()*e,i.y*this.gl.oO()*e,i.width*this.gl.oO()*e,i.height*this.gl.oO()*e),1!==t)for(const e of this.FN)e.getVisible()&&e.mB(t);else for(const e of this.FN)e.getMouseInteractions()&&e.getVisible()&&e.mB(t);return this.gl.ZO(!1),this}}class Oy extends Wf{constructor(t){super(t)}}class Ry extends Oy{constructor(t){super(t),this.NN="attribute";const{vertices:e,drawSize:i,drawMode:s}=Vy(t.gl);this.OB=t.tL(e),this.lz=i,this.uz=s}Xp(t,e,i,s){return this.yB.hL(this.OB,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}).YL(this.uz,0,this.lz,e),this}wB(){this.yB.fL(this.OB)}}const Vy=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 Ny extends Oy{constructor(t,e){super(t),this.NN="attribute",this.GN=e;const{vertices:i,indices:s}=Gy();this.OB=t.tL(i),this.az=t.EL(s),this.lz=s.length,this.uz=t.gl.TRIANGLES}Xp(t,e,i,s){return this.yB.hL(this.OB,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).$L(this.az).oL(t.uniform("uEdgeRoundness"),this.GN/2).ZL(this.uz,this.lz,0,e),this}wB(){this.yB.fL(this.OB),this.yB.fL(this.az)}WN(t){return this.GN=t,this}HN(){return this.GN}}const Gy=()=>{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=Ce.multiply(o,-1),l=Ce.multiply(h,-1),u=i;e[i]={thicknessDirection:Ce.addVec(t,o,h),edge:Ce.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:Ce.addVec(t,a,h),edge:Ce.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:Ce.addVec(t,a,l),edge:Ce.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:Ce.addVec(t,o,l),edge:Ce.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=Ce.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=Ce.normalize(Ce.lerp(t,n.direction,o)),a=Math.PI/2-Ce.angle(h,t),l=Ce.addVec(Ce.multiply(Ce.multiply(n.direction,-1),1-Math.cos(a)),Ce.multiply(Ce.multiply(t,-1),1-Math.sin(a)),Ce.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.bL.AB.get(e);return i||(i=void 0!==e&&e>0?new Ny(t,Ct(e,0,1)):new Ry(t),t.bL.AB.set(e,i),i)};class Uy extends Ag{iy(t){return this.EO=this.Zm.M(),this.Zm.S(t),this}gS(t){return this.UN=t,this}pS(){return this.UN}}class Wy extends Uy{constructor(t,e,i,s,r){super(t,e,i),this.$N=t,this.uE=s,this.cE=r,this.iE=t.iE,this.yB=this.iE.eE()}rE(t){return t===this.uE&&{}}}class Xy extends Wy{constructor(t,e,i,s,r){super(t,e,i,s,r),this.UN="cull-back",this.Ta=Be,this.jN={},this.YN=[],this.Se=vr.fillStyle,this.Zm.S(Bo)}Ts(t){const e=this.YN,i=this.Se,s=i!==z,r=this.XN,n=this.Ro()||this.ZN!==r,o=this.RO(),h=this.po.M(),a=this.po.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.KN||0;let r=s;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.jN[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.CV&&i.set(this.CV),this.CV=i,this.qN=e,this.JN=s*t}const d=H(i)?i.getFallbackColor():void 0;for(const i of e){const e=i.id,s=void 0!==e&&this.jN[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=y({x:ke,y:ke,z:ke},{x:Pe,y:Pe,z:Pe});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.Ta=e}this.KN=r,this.YN.length=0}return this.No(i),this.ZN=r,this.Zm.o=!1,this.po.o=!1,this}mB(t){const e=1===t?this.TN:this.gO,i=this.QN,s=this.oz,r=this.Se,n=this.KN,o=this.Zm.M();return e&&s&&void 0!==n&&this.yB.eL(e,((h,a,l)=>{let u=!1;const c=a("aPos"),d=a("aOffsetAxis");this.yB.sO(e).TL(h("uScale"),this.$N.dO.lL()).TL(h("uDisp"),this.$N.dO.uL()).IL(h("uViewProjectionMatrix"),this.iG).oL(h("uIsHighlighted"),1===t||2===t?0:this.xo).aL(h("uHighlightColorOffset"),this._o).oL(h("uRenderEffectMask"),2===t?1:0);const f={location:c,size:3},g={location:d,size:3},y={location:void 0,size:4},m={location:void 0,size:1};if(1!==t&&"phong"===o.type&&this.yB.TL(h("uCameraLoc"),this.sG).TL(h("uLightLoc"),this.eG).oL(h("uAmbientReflection"),o.ambientReflection).oL(h("uSpecularReflection"),o.specularReflection).oL(h("uDiffuseReflection"),o.diffuseReflection).oL(h("uShininess"),o.shininess).aL(h("uLightColor"),o.specularColor).aL(h("uAmbientColor"),o.ambientColor),1===t)this.yB.aL(h("uColor"),this.cE);else if(N(r))this.yB.aL(h("uColorDiffuse"),r.getColor());else if(H(r)){const t=a("aColor");y.location=t}else if(W(r)){const t=r.getLookUpProperty(),e=r.getPalette();"value"===t&&(m.location=a("aLookupValue")),this.yB.LR(l,e,this.bz,0)}return s&&(this.yB.hL(s,1,f,g,y,m),i.Xp(l,n,"phong"===o.type&&1!==t,!1),u=!0),u})),this}dispose(){return super.dispose(),this.oz&&(this.yB.fL(this.oz),this.oz=void 0),this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this.gO=void 0,this}jB(){return this.dispose(),this}py(t){this.YN=he(this.YN,t,{canReturnB:!0})}Me(t){return this.Se=Hr(this.Se,t),this}Th(){return this.Se}uy(t){return this.XN=void 0!==t&&t>0?Ct(t,0,1):void 0,this}tG(){return this.XN}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}hy(){return this.Ta.max.z}ny(){return this.Ta.min.z}sl(){return 0}el(){return 0}oy(){return 0}Ro(){return Ur(this.Eo,this.Se)}No(t){this.Eo=t}}class Yy extends Wf{constructor(t,e){super(t),this.NN="custom",this.rz=e;const{vertices:i,drawSize:s}=this.nz();this.oz=t.tL(i),this.lz=s}sO(t){return this.yB.hL(this.oz,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Xp(t){return this.yB.YL(this.yB.gl.TRIANGLE_STRIP,0,this.lz,t),this}nz(){const t=this.rz,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}}wB(){this.yB.fL(this.oz)}}const jy=(t,e=16)=>{let i=t.bL.MB.get(e);return i||(i=new Yy(t,e),t.bL.MB.set(e,i),i)};class Jy extends Wy{constructor(t,e,i,s,r){super(t,e,i,s,r),this.UN="cull-back",this.hG=Be,this.rG=[],this.nG=!1,this.jl=vr.lineStyle,this.Zm.S(Po)}Ts(t){const e=this.nG,i=this.jl,s=this.Xl!==i,r=this.RO(),n=e;if(e){const t=te(this.rG);this.oG=this.yB.tL(t,!1,this.oG)}if(n&&(this.hG=Ye(this.rG)),s||r){const t=8,e=qi(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.xz=void 0,N(e)&&("primitive"===s?this.xz={type:s,shader:this.yB.sL(Bg["3D"],Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0}),Bg.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.xz={type:s,shader:this.yB.sL(Bg["3D"],Bg.ColorShaded3D({dataType:"uniform",shadingStyle:this.Zm.M().type}),Bg.LineInstanced3D({axisWorldTranslation:Zf(this.ct)})),geometry:jy(this.yB,t),fillStyle:e}))}return this.nG=!1,this.Xl=i,this.Zm.o=!1,this}mB(t){if(1===t)return this;const e=this.yB.gl,i=this.xz,s=this.oG,r=this.jl,n=this.Zm.M();if(i&&s&&qi(r))switch(i.type){case"instanced":{const o=.5*this.As.zm(r.thickness),h=i.fillStyle.getColor(),a=i.shader,l=i.geometry;this.yB.eL(a,((i,r,u)=>{this.yB.sO(a).TL(i("uScale"),this.$N.dO.lL()).TL(i("uDisp"),this.$N.dO.uL()).IL(i("uViewProjectionMatrix"),this.iG).aL(i("uColorDiffuse"),h).oL(i("uOffsetWU"),o).oL(i("uIsHighlighted"),this.xo).aL(i("uHighlightColorOffset"),this._o).oL(i("uRenderEffectMask"),2===t?1:0),"phong"===n.type&&this.yB.TL(i("uCameraLoc"),this.sG).TL(i("uLightLoc"),this.eG).oL(i("uAmbientReflection"),n.ambientReflection).oL(i("uSpecularReflection"),n.specularReflection).oL(i("uDiffuseReflection"),n.diffuseReflection).oL(i("uShininess"),n.shininess).aL(i("uLightColor"),n.specularColor).aL(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.yB.GL(c,1),e.enableVertexAttribArray(c),e.vertexAttribPointer(d,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.yB.GL(d,1),e.enableVertexAttribArray(d),l.sO(u).Xp(this.rG.length/2),!0}));break}case"primitive":{const n=qi(r)?r.getFillStyle():void 0,o=n&&N(n)?n.getColor():void 0;if(o){const r=i.shader;this.yB.eL(r,((i,n)=>(this.yB.sO(r).TL(i("uScale"),this.$N.dO.lL()).TL(i("uDisp"),this.$N.dO.uL()).IL(i("uViewProjectionMatrix"),this.iG).aL(i("uColor"),o).oL(i("uIsHighlighted"),this.xo).aL(i("uHighlightColorOffset"),this._o).oL(i("uRenderEffectMask"),2===t?1:0).hL(s,void 0,{location:n("aPos"),size:3}).Xp(e.LINES,this.rG.length),!0)))}break}}return this}Wa(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.yB.ff.Pn&&s>i.length&&xt.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}}wB(){this.yB.fL(this.oz)}}const qy=(t,e)=>{const i=Math.round(e);i<3&&pe(0,Et);const s=i;let r=t.bL._B.get(Array.from(t.bL._B.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new $y(t,i,s),t.bL._B.set({sectors:i,stacks:s},r),r)};class Ky extends Wy{constructor(t,e,i,s,r){super(t,e,i,s,r),this.UN="cull-back",this.nM=[],this.xz={},this.SV=new ly(this.nM,(t=>t.vertexBuffer&&this.yB.fL(t.vertexBuffer)),!0),this.Jl=[],this.Fa=0,this.Ia=[],this.Pa=0,this.Ta=Be,this.Da=Be,this.Oa=!1,this.jl=vr.lineStyle,this.my=vr.pointStyle3D,this.Zm.S(Bo),this._V={attributesPerVertex:3,prepareRenderData:(t,e)=>te(t)}}Ts(t){const e=this.Oa,i=this.Ia,s=this.Pa,r=s>0,n=this.jl,o=n!==this.Xl,h=this.my,a=h!==this.uG,l=this.RO(),u=this.po.o,c=this.po.M();this.Da&&(this.Ta=Je(this.Ta,this.Da),this.Da=void 0),r&&(this.Jl=he(this.Jl,i,{canReturnB:!0}),this.Fa+=s);let d=i,f=s;if(e&&(this.nM.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=Be})),this.SV.lV(),d=this.Jl,f=this.Fa),f>0){const t=1e5,e=Math.floor(this.iE.cG/(this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.wo("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=Ct(i,t,e);this.SV.rV(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:Be,vertexBuffer:this.yB.OL(t*this._V.attributesPerVertex,this._V.prepareRenderData(e,i))})),((t,e,i,s)=>{this.yB.LL(t.vertexBuffer,t.existingCoordinatesCount*this._V.attributesPerVertex,this._V.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=qi(n)&&n,i=e&&e.getFillStyle(),s=N(i)&&i,r=W(i)&&i,o=s||r,a=or(h)&&h.getSize(),l=or(h)&&h.getFillStyle(),u=N(l)&&l,d=W(l)&&l,f=u||d,g=or(h)&&h.getWireframeStyle(),y=g&&qi(g)&&g,m=y&&y.getFillStyle(),p=m&&N(m)&&m,S=n.getThickness()<0||1===n.getThickness()&&this.wo("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",x=r?["lookup",r.getLookUpProperty()]:"uniform";if("primitive"===S&&o?t.lines={type:"primitive",fillStyleSolid:s,fillStylePaletted:r,shader:this.yB.sL(Bg["3D"],Bg.Color({dataType:x}),Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})),mousePicking:c?{shader:this.yB.sL(Bg["3D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0}))}:void 0}:"instanced"===S&&e&&o&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:s,fillStylePaletted:r,shader:this.yB.sL(Bg["3D"],Bg.ColorShaded3D({dataType:x,shadingStyle:this.Zm.M().type}),Bg.LineInstanced3D({axisWorldTranslation:Zf(this.ct)})),geometry:Zy(this.yB,e.getThickness()),mousePicking:c?{shader:this.yB.sL(Bg["3D"],Bg.MousePicking,Bg.LineInstanced3D({axisWorldTranslation:Zf(this.ct)}))}:void 0}),t.markers=void 0,f){const e=ne(h.getShape(),{cube:()=>Hy(this.yB),sphere:()=>Qy(this.yB,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof a&&a,pointSizeAxis:"object"==typeof a&&a,fillStyleSolid:u,fillStylePaletted:d,shader:this.yB.sL(Bg["3D"],Bg.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty()]:"uniform",shadingStyle:this.Zm.M().type,wireframe:!1!==p}),Bg.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof a?"nwu":"axis",symmetric:"number"==typeof a,halved:!0},axisWorldTranslation:Zf(this.ct),normalSource:e.NN})),mousePicking:c?{shader:this.yB.sL(Bg["3D"],Bg.MousePicking,Bg.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof a?"nwu":"axis",symmetric:"number"==typeof a,halved:!0},axisWorldTranslation:Zf(this.ct),normalSource:void 0}))}:void 0,wireframe:y&&p&&{thickness:y.getThickness(),fillStyleSolid:p}}}this.xz=t,r?this.dG=this.iE.XE(r.lut,this.dG):this.dG&&(this.iE.ZE(this.dG),this.dG=void 0),d?this.fG=this.iE.XE(d.lut,this.fG):this.fG&&(this.iE.ZE(this.fG),this.fG=void 0)}return this.Oa=!1,this.Ia=[],this.Pa=0,this.Xl=n,this.uG=h,this.Zm.o=!1,this.po.o=!1,this}mB(t){var e,i;const s=this.yB.gl,{lines:r,markers:n}=this.xz,o=this.Zm.M(),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.yB.eL(e,((r,h,u)=>{let c=!1;return this.yB.sO(e).TL(r("uScale"),this.$N.dO.lL()).TL(r("uDisp"),this.$N.dO.uL()).IL(r("uViewProjectionMatrix"),this.iG).oL(r("uOffsetWU"),this.As.zm(n.getThickness())).oL(r("uIsHighlighted"),1===t||2===t?0:this.xo).aL(r("uHighlightColorOffset"),this._o).oL(r("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.yB.TL(r("uCameraLoc"),this.sG).TL(r("uLightLoc"),this.eG).oL(r("uAmbientReflection"),o.ambientReflection).oL(r("uSpecularReflection"),o.specularReflection).oL(r("uDiffuseReflection"),o.diffuseReflection).oL(r("uShininess"),o.shininess).aL(r("uLightColor"),o.specularColor).aL(r("uAmbientColor"),o.ambientColor),1===t?this.yB.aL(r("uColor"),this.cE):a?this.yB.aL(r("uColorDiffuse"),a.getColor()):l&&this.dG&&this.yB.LR(u,l.lut,this.dG,0),this.nM.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.yB.GL(e,1),s.enableVertexAttribArray(e),s.vertexAttribPointer(r,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.yB.GL(r,1),s.enableVertexAttribArray(r),i.sO(u).Xp(t.existingCoordinatesCount-1),c=!0})),c}))}if(r&&h&&"primitive"===r.type){const e=h,{fillStyleSolid:i,fillStylePaletted:n}=r;this.yB.eL(e,((r,o,h)=>{let a=!1;return this.yB.sO(e).TL(r("uScale"),this.$N.dO.lL()).TL(r("uDisp"),this.$N.dO.uL()).IL(r("uViewProjectionMatrix"),this.iG).oL(r("uIsHighlighted"),1===t||2===t?0:this.xo).aL(r("uHighlightColorOffset"),this._o).oL(r("uRenderEffectMask"),2===t?1:0),1===t?this.yB.aL(r("uColor"),this.cE):i?this.yB.aL(r("uColor"),i.getColor()):n&&this.dG&&this.yB.LR(h,n.lut,this.dG,0),this.nM.forEach((t=>{this.yB.hL(t.vertexBuffer,void 0,{location:o("aPos"),size:3}).Xp(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.yB.eL(e,((n,a,c,d)=>{let f=!1;return this.yB.sO(e).TL(n("uScale"),this.$N.dO.lL()).TL(n("uDisp"),this.$N.dO.uL()).IL(n("uViewProjectionMatrix"),this.iG).oL(d("uRatioNwuWu"),this.$N.gG()).oL(n("uIsHighlighted"),1===t||2===t?0:this.xo).aL(n("uHighlightColorOffset"),this._o).oL(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.yB.TL(n("uCameraLoc"),this.sG).TL(n("uLightLoc"),this.eG).oL(n("uAmbientReflection"),o.ambientReflection).oL(n("uSpecularReflection"),o.specularReflection).oL(n("uDiffuseReflection"),o.diffuseReflection).oL(n("uShininess"),o.shininess).aL(n("uLightColor"),o.specularColor).aL(n("uAmbientColor"),o.ambientColor),1===t?this.yB.aL(n("uColor"),this.cE):s?this.yB.aL(n("uColorDiffuse"),s.getColor()):r&&this.fG&&this.yB.LR(c,r.lut,this.fG,0),u&&1!==t&&this.yB.oL(n("uWireframeThickness"),u.thickness).aL(n("uWireframeColor"),u.fillStyleSolid.getColor()),!1!==h&&this.yB.TL(n("uOffsetAxis"),[h.x,h.y,h.z]),!1!==l&&this.yB.oL(n("uOffsetNWU"),l),this.nM.forEach((e=>{this.yB.hL(e.vertexBuffer,1,{location:a("aPos"),size:3}),i.Xp(c,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(u)&&1!==t),f=!0})),f}))}return this}Wa(t,e){Array.isArray(t)||(t=[t]),this.Ia=he(this.Ia,t,{canReturnB:!0}),this.Pa+=t.length;const i=e||Ye(t);return this.Da=this.Da?Je(this.Da,i):i,this}Pe(t){return this.jl="function"==typeof t?t(this.jl):t,this}Yl(){return this.jl}Om(t){return this.my="function"==typeof t?t(this.my):t,this}pG(){return this.my}_t(){return this.Da?Math.max(this.Da.max.x,this.Ta.max.x):this.Ta.max.x}Mt(){return this.Da?Math.min(this.Da.min.x,this.Ta.min.x):this.Ta.min.x}wt(){return this.Da?Math.max(this.Da.max.y,this.Ta.max.y):this.Ta.max.y}At(){return this.Da?Math.min(this.Da.min.y,this.Ta.min.y):this.Ta.min.y}hy(){return this.Da?Math.max(this.Da.max.z,this.Ta.max.z):this.Ta.max.z}ny(){return this.Da?Math.min(this.Da.min.z,this.Ta.min.z):this.Ta.min.z}sl(){return we(this.jl)}el(){return we(this.jl)}oy(){return we(this.jl)}Ea(){return this.Jl}Ra(){return this.Ia}Ua(){return this.Fa}$a(){return this.Pa}Ha(){return this.Oa=!0,this.Jl.length=0,this.Fa=0,this.Ia=[],this.Pa=0,this.Ta=Be,this.Da=void 0,this}dispose(){return super.dispose(),this.SV.uV(),this.xz={},this.dG&&(this.iE.ZE(this.dG),this.dG=void 0),this.fG&&(this.iE.ZE(this.fG),this.fG=void 0),this}jB(){return this.dispose(),this}}const Zy=(t,e)=>jy(t,e>50?20:e>20?16:e>10?12:e>5?8:6),Qy=(t,e)=>{const i=e.getSize();return qy(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class tm extends Wy{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.UN="cull-back",this.nM=[],this.SV=new ly(this.nM,(t=>t.vertexBuffer&&this.yB.fL(t.vertexBuffer)),!1),this.Jl=[],this.Fa=0,this.Ia=[],this.Pa=0,this.Ta=Be,this.Da=Be,this.Oa=!1,this._n=n,this.xy=vr.pointStyle3D,this.Zm.S(Bo);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 y=((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&&H(e)&&e.getFallbackColor()||C,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;ete(t))(o,h,a,l);this._V={individualPointColorEnabled:o,individualPointSizeEnabled:h,individualLookupValuesEnabled:a,individualPointSizeAxisEnabled:l,attributesPerVertex:g,attributeOffsetCoordinate:0,attributeOffsetColor:u,attributeOffsetSize:c,attributeOffsetLookUpValue:d,attributeOffsetPointSize3D:f,prepareRenderData:(t,e)=>y(t,this.xy,this.xy.fillStyle)}}Ts(t){const e=this.Oa,i=this.Ia,s=this.Pa,r=s>0,n=this.xy,o=this.xy!==this.mG,h=this.po.M(),a=this.po.o,l=this.RO();this.Da&&(this.Ta=Je(this.Ta,this.Da),this.Da=void 0),r&&(this.Jl=he(this.Jl,i,{canReturnB:!0}),this.Fa+=s);let u=i,c=s;if(e&&(this.nM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=Be})),this.SV.lV(),u=this.Jl,c=this.Fa),c>0){const t=Math.floor(this.iE.cG/(this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=Ct(c,1e5,t);this.SV.rV(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:Be,vertexBuffer:this.yB.OL(t*this._V.attributesPerVertex,this._V.prepareRenderData(e,i))})),((t,e,i)=>{this.yB.LL(t.vertexBuffer,t.existingCoordinatesCount*this._V.attributesPerVertex,this._V.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}if(o||l||a){let t;const e=n.getSize(),i=n.getFillStyle(),s=this._V.individualPointColorEnabled,r=this._V.individualPointSizeEnabled,o=this._V.individualPointSizeAxisEnabled,a=this._V.individualLookupValuesEnabled,l=N(i)&&i,u=H(i)&&i,c=W(i)&&i,d=i===z&&z;if(u&&!s){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw xt.alert(t),new Error(t)}if(c&&"value"===c.getLookUpProperty()&&!a){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw xt.alert(t),new Error(t)}const f=or(n)&&n,g=f&&f.getWireframeStyle(),y=g&&qi(g)&&g,m=y&&y.getFillStyle(),p=m&&N(m)&&m;if(l||u||c||p){const i=u?"attribute":c?["lookup",c.getLookUpProperty()]:"uniform",s=r&&"number"==typeof e,a=o&&"object"==typeof e,f=s||a?"attribute":"uniform";if(or(n)){const o=ne(n.getShape(),{cube:()=>Hy(this.yB),sphere:()=>em(this.yB,n,r)});t={type:"instanced",shader:this.yB.sL(Bg["3D"],Bg.ColorShaded3D({dataType:i,shadingStyle:this.Zm.M().type,wireframe:!1!==p}),Bg.VertexLocation({offset:{dataType:f,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:Zf(this.ct),normalSource:o.NN})),pointStyle:n,useIndividualPointSize:s,useIndividualPointSize3D:a,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:l,fillStyleIndividual:u,fillStylePalette:c,fillStyleEmpty:d,mousePickingShader:h&&this.yB.sL(Bg["3D"],Bg.MousePicking,Bg.VertexLocation({offset:{dataType:f,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:Zf(this.ct),normalSource:void 0})),geometry:o,wireframe:y&&p&&{thickness:y.getThickness()<0?1:y.getThickness(),fillStyleSolid:p}}}else lr(n)&&"number"==typeof e&&(t={type:"primitive",shader:this.yB.sL(Bg["3D"],Bg.PointSize(f),Bg.Color({dataType:i}),Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:s,fillStyleSolid:l,fillStyleIndividual:u,fillStylePalette:c,mousePickingShader:h&&this.yB.sL(Bg["3D"],Bg.PointSize(f),Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Zf(this.ct),normalSource:void 0}))})}this.xz=t,W(i)?this.lN=this.iE.XE(i.lut,this.lN):this.lN&&(this.iE.ZE(this.lN),this.lN=void 0)}return this.Oa=!1,this.Ia=[],this.Pa=0,this.mG=n,this.Zm.o=!1,this}mB(t){const e=this.yB.gl,i=this.xz;if(!i)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const r=this.Zm.M(),{fillStyleSolid:n,fillStylePalette:o,useIndividualPointSize:h}=i,a="instanced"===i.type&&i.useIndividualPointSize3D,l="instanced"===i.type&&i.wireframe;return this.yB.eL(s,((u,c,d,f)=>{let g=!1;if(this.yB.sO(s).TL(u("uScale"),this.$N.dO.lL()).TL(u("uDisp"),this.$N.dO.uL()).IL(u("uViewProjectionMatrix"),this.iG).oL(u("uIsHighlighted"),1===t||2===t?0:this.xo).aL(u("uHighlightColorOffset"),this._o).oL(u("uRenderEffectMask"),2===t?1:0),"instanced"===i.type){const{pointSizeAxis:t,pointSizeNWU:e}=i;!1!==t&&!1===a&&this.yB.TL(u("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===h&&this.yB.oL(u("uOffsetNWU"),e).oL(f("uRatioNwuWu"),this.$N.gG())}else if("primitive"===i.type){const{pointSizePixels:t}=i;h||this.yB.oL(u("uPointSize"),t).oL(u("uDevicePixelRatio"),this.yB.oO())}return 1===t?this.yB.aL(u("uColor"),this.cE):("instanced"===i.type?("phong"===r.type&&this.yB.TL(u("uCameraLoc"),this.sG).TL(u("uLightLoc"),this.eG).oL(u("uAmbientReflection"),r.ambientReflection).oL(u("uSpecularReflection"),r.specularReflection).oL(u("uDiffuseReflection"),r.diffuseReflection).oL(u("uShininess"),r.shininess).aL(u("uLightColor"),r.specularColor).aL(u("uAmbientColor"),r.ambientColor),l&&this.yB.oL(u("uWireframeThickness"),l.thickness).aL(u("uWireframeColor"),l.fillStyleSolid.getColor()),n&&this.yB.aL(u("uColorDiffuse"),n.getColor()),i.fillStyleEmpty&&this.yB.aL(u("uColorDiffuse"),k)):"primitive"===i.type&&n&&this.yB.aL(u("uColor"),n.getColor()),o&&this.lN&&this.yB.LR(d,o.lut,this.lN,0)),this.nM.forEach(((s,n)=>{e.bindBuffer(e.ARRAY_BUFFER,s.vertexBuffer);const o=c("aPos");if(e.vertexAttribPointer(o,3,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.yB.GL(o,1),e.enableVertexAttribArray(o),i.fillStyleIndividual&&void 0!==this._V.attributeOffsetColor&&1!==t){const t=c("aColor");e.vertexAttribPointer(t,4,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.yB.GL(t,1),e.enableVertexAttribArray(t)}if(h&&void 0!==this._V.attributeOffsetSize){"instanced"===i.type?this.yB.oL(f("uRatioNwuWu"),this.$N.gG()):"primitive"===i.type&&this.yB.oL(u("uDevicePixelRatio"),this.yB.oO());const t=c("instanced"===i.type?"aOffsetNWU":"aPointSize");e.vertexAttribPointer(t,1,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.yB.GL(t,1),e.enableVertexAttribArray(t)}if(a&&void 0!==this._V.attributeOffsetPointSize3D&&"instanced"===i.type){const t=c("aOffsetAxis");e.vertexAttribPointer(t,3,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.yB.GL(t,1),e.enableVertexAttribArray(t)}if(i.fillStylePalette&&"value"===i.fillStylePalette.getLookUpProperty()&&void 0!==this._V.attributeOffsetLookUpValue&&1!==t){const t=c("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.yB.GL(t,1),e.enableVertexAttribArray(t)}"instanced"===i.type?(i.geometry.Xp(d,s.existingCoordinatesCount,"phong"===r.type&&1!==t,Boolean(l)&&1!==t),g=!0):"primitive"===i.type&&(this.yB.Xp(e.POINTS,s.existingCoordinatesCount),g=!0)})),g})),this}Wa(t,e){Array.isArray(t)||(t=[t]),this.Ia=he(this.Ia,t,{canReturnB:!0}),this.Pa+=t.length;const i=e||Ye(t);return this.Da=this.Da?Je(this.Da,i):i,this}by(t){return this.xy="function"==typeof t?t(this.xy):t,this}yG(){return this.xy}_t(){return this.Da?Math.max(this.Da.max.x,this.Ta.max.x):this.Ta.max.x}Mt(){return this.Da?Math.min(this.Da.min.x,this.Ta.min.x):this.Ta.min.x}wt(){return this.Da?Math.max(this.Da.max.y,this.Ta.max.y):this.Ta.max.y}At(){return this.Da?Math.min(this.Da.min.y,this.Ta.min.y):this.Ta.min.y}hy(){return this.Da?Math.max(this.Da.max.z,this.Ta.max.z):this.Ta.max.z}ny(){return this.Da?Math.min(this.Da.min.z,this.Ta.min.z):this.Ta.min.z}sl(){const t=this.xy,e=t.getSize();return"number"==typeof e?or(t)?e/2:lr(t)?5:0:0}el(){return this.sl()}oy(){return this.sl()}Ea(){return this.Jl}Ra(){return this.Ia}Ua(){return this.Fa}$a(){return this.Pa}Ha(){return this.Oa=!0,this.Jl.length=0,this.Fa=0,this.Ia=[],this.Pa=0,this.Ta=Be,this.Da=void 0,this}dispose(){return super.dispose(),this.SV.uV(),this.lN&&(this.iE.ZE(this.lN),this.lN=void 0),this.xz=void 0,this}jB(){return this.dispose(),this}}const em=(t,e,i)=>{const s=e.getSize();return qy(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class im extends Wy{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.UN="disabled",this.Se=vr.fillStyle,this.lu=vr.lineStyle,this.iN=p("bilinear"),this.SG=[],this.xG=Be,this.bG=void 0,this.xz={},this.vG=!1,this.Zm.S(Po);const o="columns"===s.dataOrder?s.columns:s.rows,h="columns"===s.dataOrder?s.rows:s.columns;this._n={...s,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h},this.xG={min:{x:Math.min(s.start.x,s.start.x+(s.columns-1)*s.step.x),z:Math.min(s.start.z,s.start.z+(s.rows-1)*s.step.z)},max:{x:Math.max(s.start.x,s.start.x+(s.columns-1)*s.step.x),z:Math.max(s.start.z,s.start.z+(s.rows-1)*s.step.z)}},this.MG=new Array(this._n.primaryDimensionVectorsCount).fill(void 0),this.UC=new Iy(this.iE,t.iE.mN,t.ls.ct,Et,[],{...this._n,start:{x:0,y:0},step:{x:1,y:1}},-1,C).uu(st),this.UC.hN=vy;const a=this.UC.nN.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,r=t.iFirstUniqueVector,n="columns"===this._n.dataOrder?{x:this._n.step.x*(t.sizeHeatmapDataVectors.primary-1),z:this._n.step.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this._n.step.x*(t.sizeHeatmapDataVectors.secondary-1),z:this._n.step.z*(t.sizeHeatmapDataVectors.primary-1)},o="columns"===this._n.dataOrder?{x:this._n.start.x+this._n.step.x*t.iFirstVector.primary,z:this._n.start.z+this._n.step.z*t.iFirstVector.secondary}:{x:this._n.start.x+this._n.step.x*t.iFirstVector.secondary,z:this._n.start.z+this._n.step.z*t.iFirstVector.primary},h=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary),a={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,startLocationAxis:o,sizeAxis:n,heightmapData:h,normalmapSize:a}})),l=this.UC.nN.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._G={gridTiles:a,gridTileSizes:l,largestGridTileSize:u}}AG(t){this.wG=t,this.bG=void 0}kG(t){"columns"===this._n.dataOrder?(this.xG.min.x=Math.min(this._n.start.x,this._n.start.x+(this._n.columns-1)*this._n.step.x)+t,this.xG.max.x=Math.max(this._n.start.x,this._n.start.x+(this._n.columns-1)*this._n.step.x)+t):(this.xG.min.z=Math.min(this._n.start.z,this._n.start.z+(this._n.rows-1)*this._n.step.z)+t,this.xG.max.z=Math.max(this._n.start.z,this._n.start.z+(this._n.rows-1)*this._n.step.z)+t),this.CG=t}Ts(t){const e=this.SG,i=this.Se,s=N(i)&&i,r=W(i)&&i,n=Ur(this.Eo,i),o=r&&r.getPalette(),h=this.lu,a=qi(h)&&h,l=a&&a.getFillStyle(),u=l&&N(l)&&l,c=!1!==u,d=h!==this.Iu,f=this.iN.o,g=this.iN.M(),y=this.Zm.M(),m=this.RO(),p=this.po.M();this.UC.Ts();const S=this.UC.oN;if(!S)return this;this.TG=this.TG||this.FG(S);const x=this.TG;this.IG(x);const b=My(e,x,void 0,(t=>t.sizeGeometryDataVectors));if(b.size>0&&(wy(this.yB,b,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.vG=!0),"phong"===y.type&&(b.size>0||m)){const t=this.yB.gl,e=this.yB.sL(Bg["2D"],Bg.DrawToNormalTexture({flipXZ:"rows"===this._n.dataOrder,vertexIdSource:this.yB.kR(),normalTextureType:this.yB.gl2?"uint":"ubyte",heightmapTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN}));x.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{const r=s.normalmapTexture;if(!r)return;const n={x:s.normalmapSize.secondary,y:s.normalmapSize.primary},o=n.x*n.y;this.yB.aR.mB((()=>{this.yB.eL(e,((r,n,h,a)=>(this.yB.sO(e).CR(h,o).rL(r("uTileDimensionsXZ"),["columns"===this._n.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this._n.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).kL(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).rL(r("uTileStartLocationAxisXZ"),[s.startLocationAxis.x+("columns"===this._n.dataOrder&&this.CG||0),s.startLocationAxis.z+("rows"===this._n.dataOrder&&this.CG||0)]).rL(r("uTileSizeAxisXZ"),[s.sizeAxis.x,s.sizeAxis.z]).nL(r("uHeightmapTexture"),s.heightmapDataTexture,1).Xp(t.POINTS,o),!0)))}),r,n,void 0,this.ls.Kr(),0)}))}))}const v=this.xz;if(n||d||f){o?this.lN=this.iE.XE(o,this.lN):this.lN&&(this.iE.ZE(this.lN),this.lN=void 0);const t=a&&u?{wireframeSolid:a,wireframeFillSolid:u}:void 0;s?v.surface={shader:this.yB.sL(Bg["3D"],Bg.SurfaceGrid({axisWorldTranslation:Zf(this.ct),fillColor:"uniform",interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this._n.dataOrder,shadingStyle:y.type,wireframe:c,instanceIdSource:this.yB.TR(),normalTextureType:this.yB.gl2?"uint":"ubyte",intensityTextureType:this.yB.rR?"float":"ubyte",heightmapTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:this.lN&&r&&"value"===r.getLookUpProperty()?v.surface={shader:this.yB.sL(Bg["3D"],Bg.SurfaceGrid({axisWorldTranslation:Zf(this.ct),fillColor:["lookup","value"],interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this._n.dataOrder,shadingStyle:y.type,wireframe:c,instanceIdSource:this.yB.TR(),normalTextureType:this.yB.gl2?"uint":"ubyte",intensityTextureType:this.yB.rR?"float":"ubyte",heightmapTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r,colorLookupTexture:this.lN},wireframe:t}:this.lN&&r?v.surface={shader:this.yB.sL(Bg["3D"],Bg.SurfaceGrid({axisWorldTranslation:Zf(this.ct),fillColor:["lookup",r.getLookUpProperty()],interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this._n.dataOrder,shadingStyle:y.type,wireframe:c,instanceIdSource:this.yB.TR(),normalTextureType:this.yB.gl2?"uint":"ubyte",intensityTextureType:this.yB.rR?"float":"ubyte",heightmapTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r,colorLookupTexture:this.lN},wireframe:t}:c&&(v.surface={shader:this.yB.sL(Bg["3D"],Bg.SurfaceGrid({axisWorldTranslation:Zf(this.ct),fillColor:void 0,interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this._n.dataOrder,shadingStyle:y.type,wireframe:c,instanceIdSource:this.yB.TR(),normalTextureType:this.yB.gl2?"uint":"ubyte",intensityTextureType:this.yB.rR?"float":"ubyte",heightmapTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return v.mousePicking=p?this.xz.mousePicking||{shader:this.yB.sL(Bg["3D"],Bg.SurfaceGrid({axisWorldTranslation:Zf(this.ct),fillColor:"uniform",interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this._n.dataOrder,shadingStyle:"simple",wireframe:!1,instanceIdSource:this.yB.TR(),normalTextureType:this.yB.gl2?"uint":"ubyte",intensityTextureType:this.yB.rR?"float":"ubyte",heightmapTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.xz=v,this.SG.length=0,this.Eo=i,this.Iu=h,this.Zm.o=!1,this}FG(t){const e=this._G.gridTiles.map((e=>{const i=Ty(this.yB,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}})),i=this._G.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.yB.tL([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.yB.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}IG(t){var e;if("phong"===this.Zm.M().type)for(let i=0;i{t.normalmapTexture&&(this.yB.YB(t.normalmapTexture),t.normalmapTexture=void 0)}))}mB(t){var e,i,s,r;const n=this.yB.gl,o=this.TG;if(!o)return this;const h=this.Zm.M(),a=this.xz,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.yB.eL(l,((e,i,s,r)=>{let a=!1;if(this.yB.sO(l).FR(s,this._G.largestGridTileSize.cells).TL(e("uScale"),this.$N.dO.lL()).TL(e("uDisp"),this.$N.dO.uL()).IL(e("uViewProjectionMatrix"),this.iG).oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===h.type&&this.yB.TL(e("uCameraLoc"),this.sG).TL(e("uLightLoc"),this.eG).oL(e("uAmbientReflection"),h.ambientReflection).oL(e("uSpecularReflection"),h.specularReflection).oL(e("uDiffuseReflection"),h.diffuseReflection).oL(e("uShininess"),h.shininess).aL(e("uLightColor"),h.specularColor).aL(e("uAmbientColor"),h.ambientColor),u)){const{wireframeFillSolid:t,wireframeSolid:i}=u,s=i.getThickness()<0?1:i.getThickness();this.yB.aL(e("uWireframeColor"),t.getColor()).oL(e("uWireframeThickness"),s)}return 1===t?this.yB.aL(e("uColorDiffuse"),this.cE):"solid"===(null==c?void 0:c.fillMode)&&this.yB.aL(e("uColorDiffuse"),c.fillStyleSolid.getColor()),o.gridTileSizes.forEach((r=>{this.yB.rL(e("uTileDimensionsXZ"),["columns"===this._n.dataOrder?r.sizeHeatmapData.primary:r.sizeHeatmapData.secondary,"columns"===this._n.dataOrder?r.sizeHeatmapData.secondary:r.sizeHeatmapData.primary]).kL(e("uTileDimensions"),[r.sizeHeatmapData.primary,r.sizeHeatmapData.secondary]),r.tiles.forEach((h=>{let l=0,d=(h.sizeHeatmapDataVectors.primary-1)*(h.sizeHeatmapDataVectors.secondary-1);if(this.wG){const t=this.wG.fill.iFirstPrimary,e=this.wG.fill.iFirstPrimary+this.wG.fill.amountPrimary-1,i=h.iFirstVector.primary,s=h.iFirstVector.primary+h.sizeHeatmapDataVectors.primary-1;if(i>e||sy(Math.max(t,i),Math.min(e,s)))(t,e,i,s);l=(n.min-h.iFirstVector.primary)*(r.sizeGeometryData.secondary-1),d=(n.max-n.min)*(r.sizeGeometryData.secondary-1)}if(!(l<0||d<=0)){if("intensity"===(null==c?void 0:c.fillMode)){const{colorLookupTexture:t,fillStylePaletted:i}=c;this.yB.LR(s,i.lut,t,1).nL(e("uTileIntensityValues"),h.intensityDataTexture,2).CL(e("uTileBoundsAxisXZ"),[h.startLocationAxis.x+("columns"===this._n.dataOrder&&this.CG||0),h.startLocationAxis.z+("rows"===this._n.dataOrder&&this.CG||0),h.sizeAxis.x,h.sizeAxis.z])}if("xyz"===(null==c?void 0:c.fillMode)){const{colorLookupTexture:t,fillStylePaletted:e}=c;this.yB.LR(s,e.lut,t,1)}1!==t&&"phong"===this.Zm.M().type&&h.normalmapTexture&&this.yB.nL(e("uNormalmapTexture"),h.normalmapTexture,3),this.yB.hL(o.rectangleLocationsBuffer,0,{location:i("aGeoCellOffset"),size:2},{location:u?i("aTriangleBary"):void 0,size:3}).PL(e("uBaseInstance"),l).rL(e("uTileStartLocationAxisXZ"),[h.startLocationAxis.x+("columns"===this._n.dataOrder&&this.CG||0),h.startLocationAxis.z+("rows"===this._n.dataOrder&&this.CG||0)]).rL(e("uTileSizeAxisXZ"),[h.sizeAxis.x,h.sizeAxis.z]).nL(e("uHeightmapTexture"),h.heightmapDataTexture,0).YL(o.rectangleLocationsDrawMode,0,o.rectangleLocationsDrawLength,d),a=!0,n.bindBuffer(n.ARRAY_BUFFER,null)}}))})),a})),this}dispose(){return super.dispose(),this.UC.dispose(),this.lN&&(this.iE.ZE(this.lN),this.lN=void 0),this.TG&&(this.TG.gridTileSizes.forEach((t=>{})),this.TG.gridTiles.forEach((t=>{this.yB.YB(t.heightmapDataTexture),t.normalmapTexture&&this.yB.YB(t.normalmapTexture)})),this.yB.fL(this.TG.rectangleLocationsBuffer),this.TG=void 0),this.xz={},this}jB(){return this.dispose(),this.UC.jB(),this}dS(t){return this.UC.dS(t),this}fS(t){this.SG.push(t),Ay(this._G.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.MG[n];if(e)i=ie.max?s:e.max;else{e={min:ke,max:Pe},this.MG[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.bG={min:i,max:s},this.bG}}class sm extends Wy{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.UN="disabled",this.fN=0,this.pN={};const o={min:{x:s.start.x,z:s.start.z},max:{x:"rows"===s.scrollDimension?s.start.x+(s.columns-1)*s.step.x:s.start.x,z:"columns"===s.scrollDimension?s.start.z+(s.rows-1)*s.step.z:s.start.z}};this._n={...s,initialBoundaries:o,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.xG=o;const h=()=>({shape:new im(this.$N,Et,this.vo,{columns:s.columns+("columns"===s.scrollDimension?1:0),rows:s.rows+("rows"===s.scrollDimension?1:0),start:{x:0,z:0},step:s.step,dataOrder:s.scrollDimension,heatmapDataType:"intensity"},this.uE,this.cE).dispose(),hasData:!1});this.nM=[h(),h()]}Ts(t){return this.nM.forEach((e=>{e.shape.Ts(t)})),this}mB(t){return this.nM.forEach((e=>{e.hasData&&(e.shape.iG=this.iG,e.shape.sG=this.sG,e.shape.eG=this.eG,e.shape.mB(t))})),this}Ha(){return this.fN=0,this.pN={},this.xG=this._n.initialBoundaries,this.nM.forEach((t=>{t.shape.dispose(),t.shape.vG=!1,t.hasData=!1})),this}yS(t){var e;const i=this.nM[0],s=this.nM[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.fN/this._n.scrollDimensionSize)%this.nM.length,o=this.nM[e],h=this.fN%this._n.scrollDimensionSize,a=this._n.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.fN>=this._n.scrollDimensionSize&&c<=this._n.scrollDimensionSize-1,p=l;if(l){const t="columns"===this._n.scrollDimension?this._n.start.x+(this.fN-1)*this._n.step.x:this._n.start.z+(this.fN-1)*this._n.step.z;o.shape.kG(t)}const S=m?0:1,x=c+(m?1:0);o.shape.AG({fill:{iFirstPrimary:S,amountPrimary:x},wireframe:{iFirstPrimary:S,amountPrimary:x,connectNext:!1}});const b=o===i?s:i,v=c+1,M=1+this._n.scrollDimensionSize-v;b.shape.AG({fill:{iFirstPrimary:v,amountPrimary:M},wireframe:{iFirstPrimary:v,amountPrimary:M-1,connectNext:!0}});const A={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,y);let i=!1;p&&this.pN.yValues&&(i=!0,e.splice(0,0,this.pN.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this._n.staticDimensionSize,values:e,type:"y"};o.shape.fS(s),o.hasData=!0,A.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,y);let i=!1;p&&this.pN.intensityValues&&(i=!0,e.splice(0,0,this.pN.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this._n.staticDimensionSize,values:e,type:"intensity"};o.shape.dS(s),o.hasData=!0,A.intensityValues=e[u-1]}this.fN+=u,n+=u,this.pN=A}while(ne.shape.uS(t))),this}cS(){return this.nM[0].shape.cS()}Me(t){return this.nM.forEach((e=>e.shape.Me(t))),this}Th(){return this.nM[0].shape.Th()}uu(t){return this.nM.forEach((e=>e.shape.uu(t))),this}cu(){return this.nM[0].shape.cu()}jB(){return this.dispose(),this.nM.forEach((t=>t.shape.jB())),this}dispose(){return super.dispose(),this.nM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.nM.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}iy(t){return super.iy(t),this.nM.forEach((e=>e.shape.iy(t))),this}_t(){return this.xG.max.x}Mt(){return this.xG.min.x}wt(){return Math.max(this.nM[0].shape.wt(),this.nM[1].shape.wt())}At(){return Math.min(this.nM[0].shape.At(),this.nM[1].shape.At())}hy(){return this.xG.max.z}ny(){return this.xG.min.z}sl(){return 0}el(){return 0}oy(){return 0}us(t){return super.us(t),this.nM.forEach((e=>e.shape.us(t))),this}}class rm extends Ly{constructor(t,e,i,s){super(t,e,i),this.DG=45,this.BG=.1,this.OG=100,this.sG=f(0,0,1),this.LG=f(0,0,-1),this.EG=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.Zm=new ko,this.ct=s}wS(){const{cellIndex:t,cellSpan:e,cellsAmount:i}=this.ct,s=e.x/i.x,r=e.y/i.y,n=t.x/i.x,o=t.y/i.y,h=this.ls.Ht();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.sG=t,this}getCameraLocation(){return this.sG}setCameraDirection(t){return this.LG=Ce.normalize(t),this}getCameraDirection(){return this.LG}setLightLocation(t){return this.eG=t,this}getLightLocation(){return this.eG}zG(){return f(this.EG[0],this.EG[1],this.EG[2])}VG(){return f(this.EG[4],this.EG[5],this.EG[6])}}class nm extends rm{constructor(t,e,i,s){super(t,e,i,s),this.dO=new Og,this.NG=!0,this.iE=t,this.gl=t.eE(),this.LN=this.FN,this.GG=this.ls.lo((()=>{this.NG=!0})),this.WG=s.W((()=>{this.NG=!0}))}QO(t){const e=t.Mt(),i=t.At(),s=t.ny(),r=t._t(),n=t.wt(),o=t.hy();if(e===ke||r===Pe||i===ke||n===Pe||s===ke||o===Pe)return Fe;const h=t.sl(),a=t.el(),l=t.oy(),u=Math.abs(t.As.zm(h)*t.ct.x.st()),c=Math.abs(t.As.zm(a)*t.ct.y.st()),d=Math.abs(t.As.zm(l)*t.ct.z.st()),f=e-u,g=r+u,y=i-c,m=n+c,p=s-d,S=o+d;let x;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:S},{x:g,y,z:S},{x:f,y:m,z:S},{x:g,y:m,z:S}].map((e=>t.As.Nm(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};x=x?je(x,{min:t,max:t}):e})),x||Fe}RN(t){const e=Array.from(this.LN.values());for(let i=0;iSe()));const{viewProjectionMatrix:s}=this.HG();this.UG();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.FN.forEach((t=>{t.iG=s,t.sG=r,t.eG=n,t.Ts(i)})),this}HG(){if(!this.NG&&this.iG)return{viewProjectionMatrix:this.iG};const t=this.wS(),e=t.width/t.height;this.$G=Uf.projectionPerspective(this.DG,e,this.BG,this.OG);const i=this.sG;this.EG[12]=i.x,this.EG[13]=i.y,this.EG[14]=i.z;const s=this.LG,r=f(0,1,0),n=Ce.multiply(s,-1),o=Ce.normalize(Ce.cross(r,n)),h=Ce.normalize(Ce.cross(n,o));this.EG[0]=o.x,this.EG[1]=o.y,this.EG[2]=o.z,this.EG[4]=h.x,this.EG[5]=h.y,this.EG[6]=h.z,this.EG[8]=n.x,this.EG[9]=n.y,this.EG[10]=n.z,this.jG=Uf.inverse(this.EG);const{cellIndex:a,cellSpan:l,cellsAmount:u}=this.ct,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=Uf.multiply(Uf.translation(Mo(-1,1,g),Mo(-1,1,y),0),Uf.scaling(c,d,1));return this.iG=Uf.multiply(m,Uf.multiply(this.$G,this.jG)),this.YG=Uf.inverse(this.iG),this.NG=!1,{viewProjectionMatrix:this.iG}}UG(){this.dO.XR(this.ct.x),this.dO.ZR(this.ct.y),this.dO.KR(this.ct.z)}mB(t,e){const i=this.gl.oO(),s=this.wS(),r={x:s.x*i*e,y:s.y*i*e,width:s.width*i*e,height:s.height*i*e};return this.gl.JO(r.x,r.y,r.width,r.height),this.FN.forEach((e=>{e.getVisible()&&(this.gl.XO(e.UN),1!==t&&this.gl.sy(e.qm),(1!==t||e.getMouseInteractions())&&e.mB(t))})),this.gl.XO("disabled"),this.gl.sy(!1),this.gl.ZO(!1),this}setCameraLocation(t){return this.sG.x===t.x&&this.sG.y===t.y&&this.sG.z===t.z||(this.NG=!0),super.setCameraLocation(t),this}setCameraDirection(t){return this.LG.x===t.x&&this.LG.y===t.y&&this.LG.z===t.z||(this.NG=!0),super.setCameraDirection(t),this}G(){super.G(),this.ls.uo(this.GG),this.ct.H(this.WG)}vy(t){const e=this.iE.EN();return this.IN(new tm(this,this.PN,[],e,this.iE.zN(e),t))}tm(t){const e=this.iE.EN();return this.IN(new Ky(this,this.PN,t,e,this.iE.zN(e)))}gy(){const t=this.iE.EN();return this.IN(new Xy(this,this.PN,[],t,this.iE.zN(t)))}Tg(){const t=this.iE.EN();return this.IN(new Jy(this,this.PN,[],t,this.iE.zN(t)))}lS(t){const e=this.iE.EN();return this.IN(new im(this,this.PN,[],t,e,this.iE.zN(e)))}mS(t){const e=this.iE.EN();return this.IN(new sm(this,this.PN,[],t,e,this.iE.zN(e)))}}const om=(t,e,i,s,r)=>{const{range:n}=i,o={row:{...n.row},column:{...n.column}};if(o.row.end+=1,o.column.end+=1,e){o.row.end+=1,o.column.end+=1;const e=Pt(t,o),[n,h,a,l,u]=s.pixelated(e.sliced,e.rows*e.columns,r);i.vbo=n,i.ibo=h,i.length=a,i.lengthWireframe=l,i.boundary=u}else{const e=Pt(t,o),[n,h,a,l,u]=s.nonPixelated(e.sliced,e.rows*e.columns,r);i.vbo=n,i.ibo=h,i.length=a,i.lengthWireframe=l,i.boundary=u}},hm={pixelated:(t,e)=>{const i=t.length,s=e/i,r=i-1,n=s-1,o=r*n*6,h=Array(r*n*4*2),a=Array(o),l=y(c(ke,ke),c(Pe,Pe));let u=0,d=1,f=2,g=3,m=0,p=0;for(let e=0;e{const i=t.length,s=e/i,r=i-1,n=s-1,o=Array(2*e),h=Array(r*n*6),a=y(c(ke,ke),c(Pe,Pe));let l=0;for(let e=0;e{const{range:r}=i,n={row:{...r.row},column:{...r.column}};n.row.end+=1,n.column.end+=1;const o=Pt(t,n);i.intensities=e?((t,e,i)=>{const s=t.length,r=e/s,n=new Float32Array(e*i);for(let e=0,o=0;e{const i=new Float32Array(e),s=t.length,r=e/s;for(let e=0,n=0;e{const{range:n}=s,o={row:{...n.row},column:{...n.column}};o.row.end+=1,o.column.end+=1;const h=Pt(t,o);s.colors=i?((t,e,i,s)=>{const r=t.length,n=e/r,o=new Float32Array(4*e*s);for(let e=0,h=0;e{const s=new Float32Array(4*e),r=t.length,n=e/r;for(let e=0,o=0;e{const s=i-1;t<=1&&(t+=1),e<=1&&(e+=1);const r=Math.ceil((t-1)/s),n=Math.ceil((e-1)/s),o=Array.from(Array(r)).map((()=>Array(n)));for(let i=0,h=0,a=0,l=t-1;i{const s=Array(i*e);for(let r=0,n=0;r({vbo:void 0,ibo:void 0,colors:void 0,intensities:void 0,length:0}))),this.eu.o=!1,this.hu.o=!1}const t=this.qG,e=this.ZG,s=this._u;if(o){this.Ta=Fe;for(const e of t)om(s,this.au,e,hm,void 0);let r=0;for(const s of e){s.vbo&&i.fL(s.vbo),s.ibo&&i.fL(s.ibo);const e=t[r];r+=1,s.vbo=i.tL(e.vbo),s.ibo=i.EL(e.ibo),s.length=e.length,s.lengthWireframe=e.lengthWireframe,this.Ta=je(this.Ta,e.boundary)}this.ou=!1}}if(this.Ro()){!W(s)&&this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this.gO=s===z?void 0:i.sL(Bg["2D"],Bg.VertexLocation({translation:"grid"===this.XG?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:Zf(this.ct),normalSource:void 0}),N(s)?Bg.Color({dataType:"uniform"}):H(s)?Bg.Color({dataType:"attribute"}):W(s)?Bg.Color({dataType:["lookup",s.getLookUpProperty()]}):Z(s)||et(s)?Bg.Color({dataType:["gradient",s]}):void 0);const t=this.lu;N(t)?this.QG=i.sL(Bg["2D"],Bg.Color({dataType:"uniform"}),Bg.VertexLocation({translation:"grid"===this.XG?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:Zf(this.ct),normalSource:void 0})):this.QG=void 0,this.No(s),this.Iu=this.lu}const h=this.qG,a=this.ZG,l=this.wu;if(W(s)&&s.lut.isValid){if(this.nu){for(const t of h)am(l,this.au,t,hm);let t=0;for(const e of a){e&&e.intensities&&i.fL(e.intensities);const s=h[t];t+=1,e.intensities=i.zL(s.intensities)}this.nu=!1}const t=s.getPalette();this.bz=this.iE.XE(t,this.bz),this.tW=t}else if(H(s)&&(this.iW&&i.xL(this.iW),this.ru)){for(const t of h)lm(l,s.color,this.au,t,hm);let t=0;for(const e of a){e.colors&&i.fL(e.colors);const s=h[t];t+=1,e.colors=i.zL(s.colors)}this.ru=!1}Z(s)?this.SE=Gg(this.Co(),this.ct,s.getPosition(),s.getExtent(),s.getShape(),this.yB.oO()):et(s)?this.xE=Hg(this.Co(),this.ct,s.getAngle(!0),this.yB.oO()):(this.SE=void 0,this.xE=void 0),this.IE=e?this.IE||this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({translation:"grid"===this.XG?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:Zf(this.ct),normalSource:void 0})):void 0}return this}mB(t){const e=this.wu&&this._u;if(this.Vo()&&e){const e=1===t?this.IE:this.gO;if(e){const i=this.Se,s=N(i)&&i,r=W(i)&&i,n=H(i)&&i,o=Z(i)&&i,h=et(i)&&i;this.yB.eL(e,((i,a,l)=>{let u=!1;this.yB.sO(e).rL(i("uScale"),this.dO.lL()).rL(i("uDisp"),this.dO.uL()).oL(i("uIsHighlighted"),1===t||2===t?0:this.xo).aL(i("uHighlightColorOffset"),this._o).oL(i("uRenderEffectMask"),2===t?1:0),"grid"===this.XG&&this.yB.rL(i("uTranslationAxis"),[this.fi.x,this.fi.y]),1===t?this.yB.aL(i("uColor"),this.cE):s?this.yB.aL(i("uColor"),s.getColor()):r&&r.lut.isValid&&this.bz?this.yB.LR(l,r.lut,this.bz,0):o?this.yB.SR(l,this.SE,o):h&&this.yB.xR(l,this.xE,h);for(const{vbo:e,ibo:i,colors:s,intensities:o,length:h}of this.ZG)this.yB.VL(a("aPos"),e).$L(i),1!==t&&(r&&"value"===r.getLookUpProperty()&&this.yB.UL(a("aLookupValue"),o),n&&this.yB.HL(a("aColor"),s)),this.yB.jL(h),u=!0;return u}))}const i=1===t?void 0:this.QG;if(i){const e=this.lu,s=N(e)&&e;this.yB.eL(i,((e,r,n)=>{let o=!1;this.yB.sO(i).rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),"grid"===this.XG&&this.yB.rL(e("uTranslationAxis"),[this.fi.x,this.fi.y]),s&&this.yB.aL(e("uColor"),s.getColor());for(const{vbo:t,ibo:e,lengthWireframe:i}of this.ZG)this.yB.VL(r("aPos"),t).$L(e).jL(i,this.yB.gl.LINES),o=!0;return o}))}}return this}rE(t){return this.uE===t&&{}}sW(t,e){if(this.po.M()&&this.Ta&&this._u){const n="grid"===this.XG?this.fi:{x:0,y:0},o=ni(at({x:t,y:e},this.ls.ct,this.ct),n);if(i=o,s=this.Ta.min,r=this.Ta.max,!(i.x>r.x||i.y>r.y||i.x0){for(const e of this.ZG){const{vbo:i,ibo:s,colors:r,intensities:n}=e||{};i&&(t.fL(i),e.vbo=void 0),s&&(t.fL(s),e.ibo=void 0),r&&(t.fL(r),e.colors=void 0),n&&(t.fL(n),e.intensities=void 0)}this.ZG.length=0}}jB(){return this.JG(),this.iW&&(this.yB.xL(this.iW),this.iW=void 0),this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this}Su(t,e){return this.XG="mesh",super.Su(t,e)}_t(){return"grid"===this.XG?this.Ta.max.x+this.fi.x:this.Ta.max.x}Mt(){return"grid"===this.XG?this.Ta.min.x+this.fi.x:this.Ta.min.x}wt(){return"grid"===this.XG?this.Ta.max.y+this.fi.y:this.Ta.max.y}At(){return"grid"===this.XG?this.Ta.min.y+this.fi.y:this.Ta.min.y}sl(){return 0}el(){return 0}}class cm extends Mr{constructor(t,e,i=Lg){var s,r,n;super(t,e),this.j=c(1,1),this.eW=!1,this.hW=0,this.rW=!0,this.nW=0,this.cG=8388608,this.Ss=(t=!1)=>(this.Ti||this.oW()||(t&&(this.eW=!0),void 0===this.Vr&&(this.Vr=xt.requestAnimationFrame(this.aW))),this),this.aW=t=>{if(this.Ti)return;const e=t-this.hW;if(e>=this.Rn||-1===this.Rn){this.hW=t,this.eW=!1;const i=e>50?1e3/60:e;this.Nr&&this.Nr(i),this.Vr=void 0,-1!==this.Rn&&(this.Vr=this.eW?xt.requestAnimationFrame(this.aW):void 0),this.os.Ts(e),this.Jr(),this.Qr(),this.Gr&&this.Gr()}else this.Vr=xt.requestAnimationFrame(this.aW)},this.lW=new Map,this.eE=()=>this.yB,this.uW=()=>{var t,e,i;const s=this.vn(),r=this.rW,n=xt.performance.now(),o=null===(t=this.cW)||void 0===t?void 0:t.dW.reduce(((t,e)=>t?e.fW&&t.fW&&e.fW>t.fW?e:t:e),void 0),h=null==o?void 0:o.fW,a=null===(e=this.gn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.ho)||void 0===i?void 0:i.timeStamp;return r?(this.Ss(!0),!1):void 0===o||(void 0===o||!o.gW)&&(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.pW=()=>{var t,e;this.mW=void 0;const i=null===(e=null===(t=this.cW)||void 0===t?void 0:t.yW)||void 0===e?void 0:e.SW;void 0===i||i>=this.nW||this.xW()},this.Qr=()=>{const t=this.yB.gl,e=xt.performance.now(),i=this.j,s=i.x>0&&i.y>0;if(this.Zr.o&&this.yB.JL(this.Zr.M()),this.yB.Ha(),t.resize&&s&&t.resize(i.x*this.yB.oO(),i.y*this.yB.oO()),this.yB.qO(0,0,i.x*this.yB.oO(),i.y*this.yB.oO()),this.bW.width=i.x*this.yB.oO(),this.bW.height=i.y*this.yB.oO(),s)for(const t of this.Rr.values())t.mB(0,1);return this._n.Bn&&s&&(this.mW&&(xt.clearTimeout(this.mW),this.mW=void 0),this.uW()?this.xW():this.mW=xt.setTimeout(this.pW,500)),this.Y(),this.Or(),this.rn&&this.hn(this.rn),this.rW=!1,this.nW=e,this},this.Jr=()=>{const t=this.j;if(0===t.x||0===t.y)return this;this.Hn.q(t);for(const t of this.Rr.values())t.Ts();return this.Y(),this},this.vW=0,this.MW=1,this.bW=xt.document.createElement("canvas");const o={preserveDrawingBuffer:!0,antialias:t?t.antialias:void 0,alpha:!0,lineAntialias:!t||(!0===t.lineAntiAlias||!1===t.lineAntiAlias?t.lineAntiAlias:!1!==t.antialias)};let h;if("webgl1"!==(null===(s=null==t?void 0:t.webgl)||void 0===s?void 0:s.version)){const t=this.bW.getContext("webgl2",o);t&&(h=new i(this,this._n,{type:"webgl2",ctx:t,antialias:o.antialias,lineAntialias:o.lineAntialias},this.Ji.isDark))}if(!h&&"webgl2"!==(null===(r=null==t?void 0:t.webgl)||void 0===r?void 0:r.version)){const t=this.bW.getContext("webgl",o)||this.bW.getContext("experimental-webgl",o);h=new i(this,this._n,{type:"webgl1",ctx:t,antialias:o.antialias,lineAntialias:o.lineAntialias},this.Ji.isDark)}if(!h)throw new ft("No WebGL context available."+((null===(n=null==t?void 0:t.webgl)||void 0===n?void 0:n.version)?`\nSelected explicit target: ${t.webgl.version}`:""));this.yB=h,this.oR=ct(this.yB.gl);const a=this.yB.AL;if(a.length>0){const t=xt.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=xt.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),this.Cr.appendChild(t),t.appendChild(e),!1!==this._n.Pn&&xt.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",a.join(", "))}let l=1;if(t&&t.devicePixelRatio)l=!0===t.devicePixelRatio?xt.devicePixelRatio||1:t.devicePixelRatio||1;else{const t=xt.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(l=xt.devicePixelRatio||1)}this.yB.gR(l),this.bW.style.position="absolute",this.bW.style.top="0",this.bW.style.left="0",this.bW.style.right="0",this.bW.style.bottom="0",this.bW.style.width="100%",this.bW.style.height="100%",this.bW.style.boxSizing="content-box",this.Cr.appendChild(this.bW);const u=t?t.width:void 0,d=t?t.height:void 0;this.Nn=this._W(u),this.Wn=this._W(d),this.AW(this.Nn,this.Wn),this.mN=this.rF("engine offscreen",1e6),this.wW=this.rF("engine bg",0);const f="function"==typeof this.Ji.lcjsBackgroundFillStyle?this.Ji.lcjsBackgroundFillStyle(this._n.Hs):this.Ji.lcjsBackgroundFillStyle;this.Hn=this.wW._e(this.ct).Me(f).ve(this.Ji.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).we({x:0,y:0});const g=this.rF("engine effects",200001).VN(this.Ji.effect);this.ss=g,this.Yr(),this.Or(),this.$g=mr(this),this.jg={Ji:this.Ji,os:this.os,ct:this.ct,Ss:t=>this.Ss(t),vn:()=>this.vn(),NP:t=>this.NP(t),_n:this._n,Mn:t=>this.Mn(t),ss:this.ss,do:t=>this.do(t),fo:t=>this.fo(t),wD:{AD:(t,e,i)=>this.yB.Fh(e.family).hO(t,e,i)}};const y=()=>{this.G()};xt.addEventListener("unload",y),this.Wr.push((()=>{xt.removeEventListener("unload",y)}))}get kW(){return this.Rr}Lr(t,e){let i=this.lW.get(t);if(!i){const e=this.yB.bR(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.lW.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{GP:()=>e.kO,WP:t=>{e.kO?t():o.push(t)}}},this.lW.set(t,i),e.sO(this),e.BO((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new Ho(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}NP(t){const e=Array.from(this.lW.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}nn(t,e){var i;const s=null===(i=this.cW)||void 0===i?void 0:i.yW;if(!s)return;const r=this.Ce(e.x,e.y),n=Math.round(r.x*this.yB.oO()),o=Math.round(r.y*this.yB.oO());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.TW(s,n+t[0]/s.FW,o+t[1]/s.FW))).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)}TW(t,e,i){const s=Math.round(e*t.FW),r=Math.round(i*t.FW);if(s<0||s>=t.j.x||r<0||r>=t.j.y)return;const n=4*(s+r*t.j.x),o=t.IW[n+0],h=t.IW[n+1],a=t.IW[n+2],l=t.IW[n+3];return void 0!==o&&void 0!==h&&void 0!==a&&void 0!==l?this.PW(o,h,a,l):void 0}Pr(t,e){return(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=xt.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.tn(new zy(this,e,t))}aF(t,e,i){const s=this.Yn(e);if(s){if(pe(0,(()=>{})),!(s instanceof nm))throw new Error("Unexpected Engine Layer error");return s}return this.tn(new nm(this,e,t,i))}Ht(){return this.j}_W(t){return t instanceof Array||(t=[t,t]),t}jr(){return this.bW}oW(){const t=this.yB.gl;return t&&"resize"in t}xW(){var t;const e=this.yB.gl,i=xt.performance.now(),s=this.vn(),r=this._n.Dn,n={x:Math.ceil(this.j.x*this.yB.oO()*r),y:Math.ceil(this.j.y*this.yB.oO()*r)};this.cW||(this.cW={FW:r,DW:n,dW:[],yW:void 0});let o=this.cW.dW.find((t=>!t.gW)),h=!1;o||(h=!0,o={gW:!1,j:n,BR:e.createTexture(),BW:this.yB.mL(),OW:this.yB.yL(),LW:new Uint8Array,fW:void 0},this.cW.dW.push(o));const a=o;(h||a.j.x!==n.x||a.j.y!==n.y)&&(e.bindTexture(e.TEXTURE_2D,a.BR),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),e.bindFramebuffer(e.FRAMEBUFFER,a.BW),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a.BR,0),e.bindRenderbuffer(e.RENDERBUFFER,a.OW),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.x,n.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,a.OW),a.LW=new Uint8Array(n.x*n.y*4),a.j=n),a.gW=!0,a.fW=i,e.bindFramebuffer(e.FRAMEBUFFER,a.BW),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.clear(e.DEPTH_BUFFER_BIT),e.disable(e.BLEND),e.resize&&e.resize(n.x,n.y),this.yB.qO(0,0,n.x,n.y);for(const t of this.Rr.values())t.mB(1,r);e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.yB.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.cW){const t=this.cW.yW;if(t&&t.SW>i)return;this.cW.yW={SW:i,FW:r,j:n,IW:a.LW,RW:s}}};l?this.yB.IR(l,a.BW,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.LW).then((()=>{this.Ti||(a.gW=!1,u())})).catch((t=>{this.Ti||(a.gW=!1,xt.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.yB.PR(a.BW,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.LW),a.gW=!1,u())}Yr(t){const e=this.j.x,i=this.j.y,s=t||{x:this.Cr.offsetWidth,y:this.Cr.offsetHeight};0!==s.x&&0!==s.y&&(s.x===e&&s.y===i||(this.j=s,this.ct.x.Z(0,s.x).q(s.x),this.ct.y.Z(0,s.y).q(s.y),this.P.emit("resize",[this.j.x,this.j.y])))}G(){super.G(),this.mW&&(xt.clearTimeout(this.mW),this.mW=void 0),this.bW.width=1,this.bW.height=1,this.bW&&(this.Cr.removeChild(this.bW),this.bW=void 0,this.Cr=void 0),this.oR.vt(),Array.from(this.yB.vL.values()).forEach((t=>{t.jB()})),Array.from(this.yB.ML.values()).forEach((t=>{t.unbindResources()})),this.yB.ML.clear(),this.yB.bL.wB(),this.yB.lR.G(),this.yB.fL(this.yB.uR),this.yB.fL(this.yB.cR),this.yB.fL(this.yB.dR),this.yB.eR.forEach(((t,e)=>{this.yB.gl.deleteBuffer(e)})),this.yB.eR.clear(),this.yB.wR&&(this.yB.fL(this.yB.wR.buffer),this.yB.wR=void 0),this.cW&&(this.cW.dW.forEach((t=>{this.yB.SL(t.OW),this.yB.xL(t.BW),this.yB.YB(t.BR)})),this.cW=void 0),this.yB.tR.forEach((t=>this.yB.fL(t))),this.lW.clear(),this.yB._R(),this.yB.gl=void 0}XE(t,e){if((null==e?void 0:e.lut)===t)return e;e&&this.oR.bt(e);const i=this.vW;this.vW+=1;const s=this.oR.St(t);if(s){const t={Mo:i,lut:s.lut,texture:s.texture,textureHeight:s.textureHeight};return this.oR.xt(t),t}const r={x:1,y:this.yB.$B},n=r.y,o=ot.d2({scaleXYConstructor:_i}).q(r);o.x.Z(0,1),o.y.Z(t.min,t.max);const h=new um(this,this.mN,o,(()=>{}),[],-1,C);h.Me(new G({color:t.color})),t.interpolate?h.S({columns:2,rows:t.length,start:{x:0,y:t.min},end:{x:1,y:t.max},pixelate:!1}).Su(((e,i,s)=>({x:s.x,y:t.steps[e].value}))).mu((e=>t.steps[e].color)):h.S({columns:1,rows:t.length,start:{x:0,y:t.min},end:{x:1,y:t.max},pixelate:!0}).Su(((e,i,s)=>({x:s.x,y:et.steps[e].color));const a=this.yB.pR(null,this.yB.gl.RGBA,!1,!t.interpolate,r,!1);this.yB.aR.mB((()=>{h.Ts(),h.mB(0)}),a,r,void 0,this.Zr.M()),h.dispose().jB();const l={Mo:i,texture:a,textureHeight:n,lut:t};return this.oR.xt(l),l}ZE(t){this.oR.bt(t)}EN(){const t=this.MW;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.MW=1),this.MW+=1,t}zN(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,T(i,s,r,e)}PW(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.kW.values()){const e=t.RN(r);if(e)return{entity:e.entity,collectionMember:e.collectionMember,entityIndex:e.index,layerIndex:t.sn()}}}}var dm="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},fm={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.DO(t||0,e||10,i||"be"))}var n;"object"==typeof fm?fm.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.DO=function(t,e,s){if("number"==typeof t)return this.EW(t,e,s);if("object"==typeof t)return this.zW(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.VW(t,r):this.NW(t,e,r),"-"===t[0]&&(this.negative=1),this.GW(),"le"===s&&this.zW(this.toArray(),e,s)},r.prototype.EW=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.zW(this.toArray(),e,s)},r.prototype.zW=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.GW()},r.prototype.VW=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.GW()},r.prototype.NW=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.$W()},r.prototype.$W=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.GW()}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.GW();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.jW=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.XW=function(t){return 32-Math.clz32(t)}:r.prototype.XW=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.ZW=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.XW(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.UW(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.GW()},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.UW(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.$W()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.$W();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,S=m>>>13,x=0|o[3],b=8191&x,v=x>>>13,M=0|o[4],A=8191&M,T=M>>>13,w=0|o[5],E=8191&w,I=w>>>13,C=0|o[6],k=8191&C,P=C>>>13,F=0|o[7],B=8191&F,_=F>>>13,L=0|o[8],D=8191&L,z=L>>>13,O=0|o[9],R=8191&O,V=O>>>13,N=0|h[0],G=8191&N,H=N>>>13,U=0|h[1],W=8191&U,X=U>>>13,Y=0|h[2],j=8191&Y,J=Y>>>13,$=0|h[3],q=8191&$,K=$>>>13,Z=0|h[4],Q=8191&Z,tt=Z>>>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,G))|0)+((8191&(r=(r=Math.imul(c,H))+Math.imul(d,G)|0))<<13)|0;l=((n=Math.imul(d,H))+(r>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(g,G),r=(r=Math.imul(g,H))+Math.imul(y,G)|0,n=Math.imul(y,H);var pt=(l+(s=s+Math.imul(c,W)|0)|0)+((8191&(r=(r=r+Math.imul(c,X)|0)+Math.imul(d,W)|0))<<13)|0;l=((n=n+Math.imul(d,X)|0)+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(p,G),r=(r=Math.imul(p,H))+Math.imul(S,G)|0,n=Math.imul(S,H),s=s+Math.imul(g,W)|0,r=(r=r+Math.imul(g,X)|0)+Math.imul(y,W)|0,n=n+Math.imul(y,X)|0;var St=(l+(s=s+Math.imul(c,j)|0)|0)+((8191&(r=(r=r+Math.imul(c,J)|0)+Math.imul(d,j)|0))<<13)|0;l=((n=n+Math.imul(d,J)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(b,G),r=(r=Math.imul(b,H))+Math.imul(v,G)|0,n=Math.imul(v,H),s=s+Math.imul(p,W)|0,r=(r=r+Math.imul(p,X)|0)+Math.imul(S,W)|0,n=n+Math.imul(S,X)|0,s=s+Math.imul(g,j)|0,r=(r=r+Math.imul(g,J)|0)+Math.imul(y,j)|0,n=n+Math.imul(y,J)|0;var xt=(l+(s=s+Math.imul(c,q)|0)|0)+((8191&(r=(r=r+Math.imul(c,K)|0)+Math.imul(d,q)|0))<<13)|0;l=((n=n+Math.imul(d,K)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(A,G),r=(r=Math.imul(A,H))+Math.imul(T,G)|0,n=Math.imul(T,H),s=s+Math.imul(b,W)|0,r=(r=r+Math.imul(b,X)|0)+Math.imul(v,W)|0,n=n+Math.imul(v,X)|0,s=s+Math.imul(p,j)|0,r=(r=r+Math.imul(p,J)|0)+Math.imul(S,j)|0,n=n+Math.imul(S,J)|0,s=s+Math.imul(g,q)|0,r=(r=r+Math.imul(g,K)|0)+Math.imul(y,q)|0,n=n+Math.imul(y,K)|0;var bt=(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)+(bt>>>26)|0,bt&=67108863,s=Math.imul(E,G),r=(r=Math.imul(E,H))+Math.imul(I,G)|0,n=Math.imul(I,H),s=s+Math.imul(A,W)|0,r=(r=r+Math.imul(A,X)|0)+Math.imul(T,W)|0,n=n+Math.imul(T,X)|0,s=s+Math.imul(b,j)|0,r=(r=r+Math.imul(b,J)|0)+Math.imul(v,j)|0,n=n+Math.imul(v,J)|0,s=s+Math.imul(p,q)|0,r=(r=r+Math.imul(p,K)|0)+Math.imul(S,q)|0,n=n+Math.imul(S,K)|0,s=s+Math.imul(g,Q)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(y,Q)|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,G),r=(r=Math.imul(k,H))+Math.imul(P,G)|0,n=Math.imul(P,H),s=s+Math.imul(E,W)|0,r=(r=r+Math.imul(E,X)|0)+Math.imul(I,W)|0,n=n+Math.imul(I,X)|0,s=s+Math.imul(A,j)|0,r=(r=r+Math.imul(A,J)|0)+Math.imul(T,j)|0,n=n+Math.imul(T,J)|0,s=s+Math.imul(b,q)|0,r=(r=r+Math.imul(b,K)|0)+Math.imul(v,q)|0,n=n+Math.imul(v,K)|0,s=s+Math.imul(p,Q)|0,r=(r=r+Math.imul(p,tt)|0)+Math.imul(S,Q)|0,n=n+Math.imul(S,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 Mt=(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)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(B,G),r=(r=Math.imul(B,H))+Math.imul(_,G)|0,n=Math.imul(_,H),s=s+Math.imul(k,W)|0,r=(r=r+Math.imul(k,X)|0)+Math.imul(P,W)|0,n=n+Math.imul(P,X)|0,s=s+Math.imul(E,j)|0,r=(r=r+Math.imul(E,J)|0)+Math.imul(I,j)|0,n=n+Math.imul(I,J)|0,s=s+Math.imul(A,q)|0,r=(r=r+Math.imul(A,K)|0)+Math.imul(T,q)|0,n=n+Math.imul(T,K)|0,s=s+Math.imul(b,Q)|0,r=(r=r+Math.imul(b,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(S,it)|0,n=n+Math.imul(S,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 At=(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)+(At>>>26)|0,At&=67108863,s=Math.imul(D,G),r=(r=Math.imul(D,H))+Math.imul(z,G)|0,n=Math.imul(z,H),s=s+Math.imul(B,W)|0,r=(r=r+Math.imul(B,X)|0)+Math.imul(_,W)|0,n=n+Math.imul(_,X)|0,s=s+Math.imul(k,j)|0,r=(r=r+Math.imul(k,J)|0)+Math.imul(P,j)|0,n=n+Math.imul(P,J)|0,s=s+Math.imul(E,q)|0,r=(r=r+Math.imul(E,K)|0)+Math.imul(I,q)|0,n=n+Math.imul(I,K)|0,s=s+Math.imul(A,Q)|0,r=(r=r+Math.imul(A,tt)|0)+Math.imul(T,Q)|0,n=n+Math.imul(T,tt)|0,s=s+Math.imul(b,it)|0,r=(r=r+Math.imul(b,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(S,nt)|0,n=n+Math.imul(S,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 Tt=(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)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(R,G),r=(r=Math.imul(R,H))+Math.imul(V,G)|0,n=Math.imul(V,H),s=s+Math.imul(D,W)|0,r=(r=r+Math.imul(D,X)|0)+Math.imul(z,W)|0,n=n+Math.imul(z,X)|0,s=s+Math.imul(B,j)|0,r=(r=r+Math.imul(B,J)|0)+Math.imul(_,j)|0,n=n+Math.imul(_,J)|0,s=s+Math.imul(k,q)|0,r=(r=r+Math.imul(k,K)|0)+Math.imul(P,q)|0,n=n+Math.imul(P,K)|0,s=s+Math.imul(E,Q)|0,r=(r=r+Math.imul(E,tt)|0)+Math.imul(I,Q)|0,n=n+Math.imul(I,tt)|0,s=s+Math.imul(A,it)|0,r=(r=r+Math.imul(A,st)|0)+Math.imul(T,it)|0,n=n+Math.imul(T,st)|0,s=s+Math.imul(b,nt)|0,r=(r=r+Math.imul(b,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(S,at)|0,n=n+Math.imul(S,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 wt=(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)+(wt>>>26)|0,wt&=67108863,s=Math.imul(R,W),r=(r=Math.imul(R,X))+Math.imul(V,W)|0,n=Math.imul(V,X),s=s+Math.imul(D,j)|0,r=(r=r+Math.imul(D,J)|0)+Math.imul(z,j)|0,n=n+Math.imul(z,J)|0,s=s+Math.imul(B,q)|0,r=(r=r+Math.imul(B,K)|0)+Math.imul(_,q)|0,n=n+Math.imul(_,K)|0,s=s+Math.imul(k,Q)|0,r=(r=r+Math.imul(k,tt)|0)+Math.imul(P,Q)|0,n=n+Math.imul(P,tt)|0,s=s+Math.imul(E,it)|0,r=(r=r+Math.imul(E,st)|0)+Math.imul(I,it)|0,n=n+Math.imul(I,st)|0,s=s+Math.imul(A,nt)|0,r=(r=r+Math.imul(A,ot)|0)+Math.imul(T,nt)|0,n=n+Math.imul(T,ot)|0,s=s+Math.imul(b,at)|0,r=(r=r+Math.imul(b,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(S,ct)|0,n=n+Math.imul(S,dt)|0;var Et=(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)+(Et>>>26)|0,Et&=67108863,s=Math.imul(R,j),r=(r=Math.imul(R,J))+Math.imul(V,j)|0,n=Math.imul(V,J),s=s+Math.imul(D,q)|0,r=(r=r+Math.imul(D,K)|0)+Math.imul(z,q)|0,n=n+Math.imul(z,K)|0,s=s+Math.imul(B,Q)|0,r=(r=r+Math.imul(B,tt)|0)+Math.imul(_,Q)|0,n=n+Math.imul(_,tt)|0,s=s+Math.imul(k,it)|0,r=(r=r+Math.imul(k,st)|0)+Math.imul(P,it)|0,n=n+Math.imul(P,st)|0,s=s+Math.imul(E,nt)|0,r=(r=r+Math.imul(E,ot)|0)+Math.imul(I,nt)|0,n=n+Math.imul(I,ot)|0,s=s+Math.imul(A,at)|0,r=(r=r+Math.imul(A,lt)|0)+Math.imul(T,at)|0,n=n+Math.imul(T,lt)|0,s=s+Math.imul(b,ct)|0,r=(r=r+Math.imul(b,dt)|0)+Math.imul(v,ct)|0,n=n+Math.imul(v,dt)|0;var It=(l+(s=s+Math.imul(p,gt)|0)|0)+((8191&(r=(r=r+Math.imul(p,yt)|0)+Math.imul(S,gt)|0))<<13)|0;l=((n=n+Math.imul(S,yt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(R,q),r=(r=Math.imul(R,K))+Math.imul(V,q)|0,n=Math.imul(V,K),s=s+Math.imul(D,Q)|0,r=(r=r+Math.imul(D,tt)|0)+Math.imul(z,Q)|0,n=n+Math.imul(z,tt)|0,s=s+Math.imul(B,it)|0,r=(r=r+Math.imul(B,st)|0)+Math.imul(_,it)|0,n=n+Math.imul(_,st)|0,s=s+Math.imul(k,nt)|0,r=(r=r+Math.imul(k,ot)|0)+Math.imul(P,nt)|0,n=n+Math.imul(P,ot)|0,s=s+Math.imul(E,at)|0,r=(r=r+Math.imul(E,lt)|0)+Math.imul(I,at)|0,n=n+Math.imul(I,lt)|0,s=s+Math.imul(A,ct)|0,r=(r=r+Math.imul(A,dt)|0)+Math.imul(T,ct)|0,n=n+Math.imul(T,dt)|0;var Ct=(l+(s=s+Math.imul(b,gt)|0)|0)+((8191&(r=(r=r+Math.imul(b,yt)|0)+Math.imul(v,gt)|0))<<13)|0;l=((n=n+Math.imul(v,yt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(R,Q),r=(r=Math.imul(R,tt))+Math.imul(V,Q)|0,n=Math.imul(V,tt),s=s+Math.imul(D,it)|0,r=(r=r+Math.imul(D,st)|0)+Math.imul(z,it)|0,n=n+Math.imul(z,st)|0,s=s+Math.imul(B,nt)|0,r=(r=r+Math.imul(B,ot)|0)+Math.imul(_,nt)|0,n=n+Math.imul(_,ot)|0,s=s+Math.imul(k,at)|0,r=(r=r+Math.imul(k,lt)|0)+Math.imul(P,at)|0,n=n+Math.imul(P,lt)|0,s=s+Math.imul(E,ct)|0,r=(r=r+Math.imul(E,dt)|0)+Math.imul(I,ct)|0,n=n+Math.imul(I,dt)|0;var kt=(l+(s=s+Math.imul(A,gt)|0)|0)+((8191&(r=(r=r+Math.imul(A,yt)|0)+Math.imul(T,gt)|0))<<13)|0;l=((n=n+Math.imul(T,yt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(R,it),r=(r=Math.imul(R,st))+Math.imul(V,it)|0,n=Math.imul(V,st),s=s+Math.imul(D,nt)|0,r=(r=r+Math.imul(D,ot)|0)+Math.imul(z,nt)|0,n=n+Math.imul(z,ot)|0,s=s+Math.imul(B,at)|0,r=(r=r+Math.imul(B,lt)|0)+Math.imul(_,at)|0,n=n+Math.imul(_,lt)|0,s=s+Math.imul(k,ct)|0,r=(r=r+Math.imul(k,dt)|0)+Math.imul(P,ct)|0,n=n+Math.imul(P,dt)|0;var Pt=(l+(s=s+Math.imul(E,gt)|0)|0)+((8191&(r=(r=r+Math.imul(E,yt)|0)+Math.imul(I,gt)|0))<<13)|0;l=((n=n+Math.imul(I,yt)|0)+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,s=Math.imul(R,nt),r=(r=Math.imul(R,ot))+Math.imul(V,nt)|0,n=Math.imul(V,ot),s=s+Math.imul(D,at)|0,r=(r=r+Math.imul(D,lt)|0)+Math.imul(z,at)|0,n=n+Math.imul(z,lt)|0,s=s+Math.imul(B,ct)|0,r=(r=r+Math.imul(B,dt)|0)+Math.imul(_,ct)|0,n=n+Math.imul(_,dt)|0;var Ft=(l+(s=s+Math.imul(k,gt)|0)|0)+((8191&(r=(r=r+Math.imul(k,yt)|0)+Math.imul(P,gt)|0))<<13)|0;l=((n=n+Math.imul(P,yt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(R,at),r=(r=Math.imul(R,lt))+Math.imul(V,at)|0,n=Math.imul(V,lt),s=s+Math.imul(D,ct)|0,r=(r=r+Math.imul(D,dt)|0)+Math.imul(z,ct)|0,n=n+Math.imul(z,dt)|0;var Bt=(l+(s=s+Math.imul(B,gt)|0)|0)+((8191&(r=(r=r+Math.imul(B,yt)|0)+Math.imul(_,gt)|0))<<13)|0;l=((n=n+Math.imul(_,yt)|0)+(r>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,s=Math.imul(R,ct),r=(r=Math.imul(R,dt))+Math.imul(V,ct)|0,n=Math.imul(V,dt);var _t=(l+(s=s+Math.imul(D,gt)|0)|0)+((8191&(r=(r=r+Math.imul(D,yt)|0)+Math.imul(z,gt)|0))<<13)|0;l=((n=n+Math.imul(z,yt)|0)+(r>>>13)|0)+(_t>>>26)|0,_t&=67108863;var Lt=(l+(s=Math.imul(R,gt))|0)+((8191&(r=(r=Math.imul(R,yt))+Math.imul(V,gt)|0))<<13)|0;return l=((n=Math.imul(V,yt))+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,a[0]=mt,a[1]=pt,a[2]=St,a[3]=xt,a[4]=bt,a[5]=vt,a[6]=Mt,a[7]=At,a[8]=Tt,a[9]=wt,a[10]=Et,a[11]=It,a[12]=Ct,a[13]=kt,a[14]=Pt,a[15]=Ft,a[16]=Bt,a[17]=_t,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.GW()}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.GW()},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.GW();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.GW()},r.prototype.qW=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.XW(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.KW(n,d,c);0!==s.negative;)d--,s.negative=0,s.KW(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.GW(),s.GW(),"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.qW(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.GW(),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.JW=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.GW(),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 A(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).QW(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.QW=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.QW(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.tH(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.tH(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.iH(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.iH(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.iH(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.iH(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.iH(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.iH(this),this.red.pow(this,t)};var p={k256:null,p224:null,p192:null,p25519:null};function S(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.sH()}function x(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=r.eH(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 T(t){A.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.JW(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)}S.prototype.sH=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},S.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.GW(),i},S.prototype.split=function(t,e){t.iushrn(this.n,0,e)},S.prototype.imulK=function(t){return t.imul(this.k)},s(x,S),x.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},x.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.eH=function(t){if(p[t])return p[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new b;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return p[t]=e,e},A.prototype.iH=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},A.prototype.tH=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")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t).QW(this):(a(t,t.umod(this.m).QW(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).QW(this)},A.prototype.add=function(t,e){this.tH(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.QW(this)},A.prototype.iadd=function(t,e){this.tH(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},A.prototype.sub=function(t,e){this.tH(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.QW(this)},A.prototype.isub=function(t,e){this.tH(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},A.prototype.shl=function(t,e){return this.iH(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this.tH(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this.tH(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.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},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new T(t)},s(T,A),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.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.QW(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).QW(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.QW(this)},T.prototype.invm=function(t){return this.imod(t.JW(this.m).mul(this.r2)).QW(this)}}(0,dm);var gm=fm.exports;function ym(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 mm=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},pm=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 Sm{constructor(t,e){this.type=t,this.p=new gm(e.p,16),this.red=e.prime?gm.red(e.prime):gm.mont(this.p),this.zero=new gm(0).toRed(this.red),this.one=new gm(1).toRed(this.red),this.two=new gm(2).toRed(this.red),this.n=e.n&&new gm(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.hH=new Array(4),this.rH=new Array(4),this.nH=new Array(4),this.oH=new Array(4),this.aH=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.lH=!0,this.redN=this.n.toRed(this.red))}uH(t,e){const i=t.cH(),s=mm(e,1,this.aH);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}gH(t,e,i,s,r){const n=this.hH,o=this.rH,h=this.nH;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]=mm(i[s],n[s],this.aH),h[r]=mm(i[r],n[r],this.aH),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=pm(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)}cH(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 gm(t.a,16),b:new gm(t.b,16)}))):this.MH(i),{beta:e,lambda:i,basis:s}}vH(t){const e=t===this.p?this.red:gm.mont(t),i=new gm(2).toRed(e).redInvm(),s=i.redNeg(),r=new gm(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}MH(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 gm(1),g=new gm(0),y=new gm(0),m=new gm(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 S=r.sqr().add(n.sqr());return o.sqr().add(h.sqr()).cmp(S)>=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}]}_H(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 vm(this,t,e,i)}pointFromX(t,e){(t=new gm(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)}AH(t,e,i){const s=this.xH,r=this.bH;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 gm(t,16),this.isInfinity()?this:this.yH(t)?this.curve.uH(this,t):this.curve.endo?this.curve.AH([this],[t]):this.curve.dH(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.AH(s,r):this.curve.gH(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.AH(s,r,!0):this.curve.gH(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 Mm extends xm{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 gm(0)):(this.x=new gm(e,16),this.y=new gm(i,16),this.z=new gm(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 Mm(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 Am{constructor(t){this.curve=new bm(t),this.g=this.curve.g,this.n=this.curve.n}}const Tm={};var wm;Tm.PresetCurve=Am,wm={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(Tm,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new Am(wm);return Object.defineProperty(Tm,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class Em{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.TH(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof Em?e:new Em(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}TH(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 Im(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 Cm{constructor(){this.place=0}}class km{constructor(t,e){if(t instanceof km)return t;this.FH(t,e)||(this.r=new gm(t.r,16),this.s=new gm(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}FH(t,e){t=ym(t,e);const i=new Cm;if(48!==t[i.place++])return!1;const s=Im(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=Im(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=Im(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 gm(n),this.s=new gm(h),this.recoveryParam=null,!0}}class Pm{constructor(t){if(!(this instanceof Pm))return new Pm(t);"string"==typeof t&&(t=Tm[t]),t instanceof Tm.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 Em.fromPublic(this,t,e)}IH(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.IH(new gm(t,16)),i=this.keyFromPublic(i,s);const r=(e=new km(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.lH){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 Fm,Bm={exports:{}};Bm.exports=(Fm=Fm||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!==dm&&dm.crypto&&(i=dm.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.fk=new a.init,this.PH=0},DH:function(t){"string"==typeof t&&(t=d.parse(t)),this.fk.concat(t),this.PH+=t.sigBytes},BH:function(e){var i,s=this.fk,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this.OH,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 S=s&r^s&n^r&n,x=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),b=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+b|0,o=n,n=r,r=s,s=b+(x+S)|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},EH:function(){var t=this.fk,i=t.words,s=8*this.PH,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.BH(),this.NH},clone:function(){var t=n.clone.call(this);return t.NH=this.NH.clone(),t}});i.SHA256=n.zH(u),i.HmacSHA256=n.VH(u)}(Math),t.SHA256}(Bm.exports),Om={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({RH:function(){this.NH=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},EH:function(){var t=r.EH.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.zH(n),e.HmacSHA224=r.VH(n),t.SHA224;var e,i,s,r,n}(Bm.exports),Rm={exports:{}}.exports=Bm.exports.enc.Hex,Vm={exports:{}}.exports=Bm.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.GH;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.GH,r=this.WH;if(!r){r=this.WH=[];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)},GH:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(Bm.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({RH:function(){this.NH=new r.init([1732584193,4023233417,2562383102,271733878])},LH: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.NH.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],S=t[e+7],x=t[e+8],b=t[e+9],v=t[e+10],M=t[e+11],A=t[e+12],T=t[e+13],w=t[e+14],E=t[e+15],I=n[0],C=n[1],k=n[2],P=n[3];I=l(I,C,k,P,o,7,h[0]),P=l(P,I,C,k,a,12,h[1]),k=l(k,P,I,C,f,17,h[2]),C=l(C,k,P,I,g,22,h[3]),I=l(I,C,k,P,y,7,h[4]),P=l(P,I,C,k,m,12,h[5]),k=l(k,P,I,C,p,17,h[6]),C=l(C,k,P,I,S,22,h[7]),I=l(I,C,k,P,x,7,h[8]),P=l(P,I,C,k,b,12,h[9]),k=l(k,P,I,C,v,17,h[10]),C=l(C,k,P,I,M,22,h[11]),I=l(I,C,k,P,A,7,h[12]),P=l(P,I,C,k,T,12,h[13]),k=l(k,P,I,C,w,17,h[14]),I=u(I,C=l(C,k,P,I,E,22,h[15]),k,P,a,5,h[16]),P=u(P,I,C,k,p,9,h[17]),k=u(k,P,I,C,M,14,h[18]),C=u(C,k,P,I,o,20,h[19]),I=u(I,C,k,P,m,5,h[20]),P=u(P,I,C,k,v,9,h[21]),k=u(k,P,I,C,E,14,h[22]),C=u(C,k,P,I,y,20,h[23]),I=u(I,C,k,P,b,5,h[24]),P=u(P,I,C,k,w,9,h[25]),k=u(k,P,I,C,g,14,h[26]),C=u(C,k,P,I,x,20,h[27]),I=u(I,C,k,P,T,5,h[28]),P=u(P,I,C,k,f,9,h[29]),k=u(k,P,I,C,S,14,h[30]),I=c(I,C=u(C,k,P,I,A,20,h[31]),k,P,m,4,h[32]),P=c(P,I,C,k,x,11,h[33]),k=c(k,P,I,C,M,16,h[34]),C=c(C,k,P,I,w,23,h[35]),I=c(I,C,k,P,a,4,h[36]),P=c(P,I,C,k,y,11,h[37]),k=c(k,P,I,C,S,16,h[38]),C=c(C,k,P,I,v,23,h[39]),I=c(I,C,k,P,T,4,h[40]),P=c(P,I,C,k,o,11,h[41]),k=c(k,P,I,C,g,16,h[42]),C=c(C,k,P,I,p,23,h[43]),I=c(I,C,k,P,b,4,h[44]),P=c(P,I,C,k,A,11,h[45]),k=c(k,P,I,C,E,16,h[46]),I=d(I,C=c(C,k,P,I,f,23,h[47]),k,P,o,6,h[48]),P=d(P,I,C,k,S,10,h[49]),k=d(k,P,I,C,w,15,h[50]),C=d(C,k,P,I,m,21,h[51]),I=d(I,C,k,P,A,6,h[52]),P=d(P,I,C,k,g,10,h[53]),k=d(k,P,I,C,v,15,h[54]),C=d(C,k,P,I,a,21,h[55]),I=d(I,C,k,P,x,6,h[56]),P=d(P,I,C,k,E,10,h[57]),k=d(k,P,I,C,p,15,h[58]),C=d(C,k,P,I,T,21,h[59]),I=d(I,C,k,P,y,6,h[60]),P=d(P,I,C,k,M,10,h[61]),k=d(k,P,I,C,f,15,h[62]),C=d(C,k,P,I,b,21,h[63]),n[0]=n[0]+I|0,n[1]=n[1]+C|0,n[2]=n[2]+k|0,n[3]=n[3]+P|0},EH:function(){var t=this.fk,i=t.words,s=8*this.PH,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.BH();for(var h=this.NH,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.NH=this.NH.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.zH(a),i.HmacMD5=n.VH(a)})(Math),t.MD5}(Bm.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({RH:function(){this.NH=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},LH:function(t,e){for(var i=this.NH.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},EH:function(){var t=this.fk,e=t.words,i=8*this.PH,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.BH(),this.NH},clone:function(){var t=r.clone.call(this);return t.NH=this.NH.clone(),t}}),e.SHA1=r.zH(h),e.HmacSHA1=r.VH(h),t.SHA1;var e,i,s,r,n,o,h}(Bm.exports),Lm=(_m=Bm.exports).lib.Base,Dm=_m.enc.Utf8,_m.algo.HMAC=Lm.extend({init:function(t,e){t=this.HH=new t.init,"string"==typeof e&&(e=Dm.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.UH=e.clone(),n=this.$H=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.XH==this.jH?t=s.createEncryptor:(t=s.createDecryptor,this.OH=1),this.QH&&this.QH.tU==t?this.QH.init(this,i&&i.words):(this.QH=t.call(s,this,i&&i.words),this.QH.tU=t)},LH:function(t,e){this.QH.processBlock(t,e)},EH:function(){var t,e=this.cfg.padding;return this.XH==this.jH?(e.pad(this.fk,this.blockSize),t=this.BH(!0)):(t=this.BH(!0),e.unpad(t)),t},blockSize:4});var y=s.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),m=(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),y.create({ciphertext:i,salt:e})}},p=s.SerializableCipher=r.extend({cfg:r.extend({format:m}),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 y.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.iU(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},iU:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),S=(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,y.create({key:r,iv:o,salt:s})}},x=s.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:S}),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.iU(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)}})}()}(Bm.exports);var Nm={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],S=257*t[g]^16843008*g;o[i]=S<<24|S>>>8,h[i]=S<<16|S>>>16,a[i]=S<<8|S>>>24,l[i]=S,S=16843009*p^65537*m^257*y^16843008*i,u[g]=S<<24|S>>>8,c[g]=S<<16|S>>>16,d[g]=S<<8|S>>>24,f[g]=S,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({RH:function(){if(!this.sU||this.eU!==this.ZH){for(var t=this.eU=this.ZH,e=t.words,i=t.sigBytes/4,s=4*((this.sU=i+6)+1),n=this.hU=[],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.rU=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.nU(t,e,this.hU,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.nU(t,e,this.rU,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},nU:function(t,e,i,s,r,n,o,h){for(var a=this.sU,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++],S=s[d>>>24]^r[l>>>16&255]^n[u>>>8&255]^o[255&c]^i[f++];l=y,u=m,c=p,d=S}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++],S=(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]=S},keySize:8});e.AES=i.zH(y)}(),t.AES}(Bm.exports),Gm={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.KH,s=i.blockSize,r=this.qH,n=this.oU;r&&(n=this.oU=r.slice(0),this.qH=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}(Bm.exports),Um={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(Bm.exports);const Wm={"-4":["MDQxMmQ1MWU5MjFhYTMzODUwMWE4ZGYzN2ViZTE4NTU3ZDViYmRlZDg1Yzk0OGI3YTJkMDBmZTNhZGVlMjdjY2VmNzBiMWVlOWI3MDZjMTIwYTAzZDZlZTNkNmYyOTc5Y2E2NGEzN2Y3YjY4N2E1ZjljZWY2ODYxN2I1NWU5ZmJjMA=="],"-3":["MjAxODAxMjA="],"-2":["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2Vzc2lvbg=="],"-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=="]},Xm=xt,Ym=(...t)=>t.slice(1).reduce(((e,i)=>e+Xm.atob(Wm[t[0]][i].toString())),"");let jm,Jm,$m=!1,qm=new Uint8Array([34]);class Km{set e(t){jm=t}get e(){Jm={An:!1,wn:!1,kn:!1,Cn:!1,Tn:!1,Fn:!1};const t=qm.length>=1?qm[0]:void 0;return void 0!==t&&(Jm.An=!!(1&t),Jm.wn=!!(2&t),Jm.kn=!!(4&t),Jm.Cn=!!(8&t),Jm.Tn=!!(16&t),Jm.Fn=!!(32&t)),Jm.Fn}}let Zm=!1;const Qm=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},tp=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")}`},ep=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),ip=t=>{const e={},i=t.split("-");if(3!==i.length)throw new Error(Ym(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 np(d,f)?e:null},sp=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(Qm(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(ep(h)s[e]===t)))return;break}case"0002":if(!ip(t))throw new Error(Ym(0,0,1,7,1,12,5));return;default:throw new Error(Ym(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}throw new Error(Ym(0,0,1,2,1,7,1,12,5))},rp=t=>{if(!t)throw new Error(Ym(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5));const e=(t[Ym(-1,9)]||t[Ym(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(Xm[Ym(-1,6)][Ym(-1,7)])>-1)return!0;const i=e.filter((t=>t.indexOf("*")>-1));if(up(Xm[Ym(-1,6)][Ym(-1,7)],i))return!0;const s=t[Ym(-1,8)]||t[Ym(-1,38)];if(""!==s&&null!=s){if(up(Xm[Ym(-1,6)][Ym(-1,7)],[s]))return!1;if(s===Xm[Ym(-1,6)][Ym(-1,7)])return!1}throw new Error(Ym(0,14,1,20,5))},np=(t,e)=>{const i=new Pm("secp256k1").keyFromPublic(Ym(-4,0),"hex"),s=Om(t).toString();return i.verify(s,e)},op=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(!np(r,n))throw new Error(Ym(0,21,1,2,1,7,1,12,5));const o=Rm.parse(r);i=Nm.decrypt({ciphertext:Rm.parse(s)},o,{mode:Gm,padding:Um,iv:Rm.parse("00000000000000000000000000000001")}).toString(Vm)}catch(t){throw new Error(Ym(0,21,1,2,1,7,1,12,5))}try{e=JSON.parse(i)}catch(t){throw new Error(Ym(0,21,1,2,1,7,1,12,5))}if(void 0===e[Ym(-1,5)]||null===e[Ym(-1,4)]||!e[Ym(-1,9)])throw new Error(Ym(0,21,1,2,1,7,1,12,5));const s=parseInt(Ym(-3,0),10)||Number(parseInt(Ym(-3,0),10));if(e[Ym(-1,5)]{const e=ip(t);if(!e)throw new Error(Ym(0,0,1,7,1,12,5));let i,s="";try{const t=e.aU.slice(e.lU,e.lU+16),i=new DataView(t.buffer),r=new Int32Array(4);for(let t=0;t{switch(t.slice(0,4)){case"0001":((t,e)=>{if(!e)throw new Error(Ym(0,39,1,40,1,41,5));const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!np(`${s}-${r}`,n))throw new Error(Ym(0,21,1,2,1,7,1,12,5));const o=Uint8Array.from(Qm(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(Ym(-3,0),10)||Number(parseInt(Ym(-3,0),10))))throw new Error(Ym(0,21,1,2,1,3,1,4,5));const a=Int32Array.from(Qm(s,8)),l=zm(e[Ym(-1,31)]).toString(Rm),u=Int32Array.from(Qm(l,8)),c=zm(e[Ym(-1,32)]).toString(Rm),d=Int32Array.from(Qm(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t)))throw new Error(Ym(0,21,1,2,1,7,1,12,5))})(t,e);break;case"0002":((t,e)=>{if(!e)throw new Error(Ym(0,39,1,40,1,41,5));const i=ip(t);if(!i)throw new Error(Ym(0,0,1,7,1,12,5));const s=i.aU.slice(i.lU,i.aU.length),r=new DataView(s.buffer),n=new Int32Array(8);for(let t=0;tu[e]===t)))throw new Error(Ym(0,21,1,2,1,7,1,12,5))})(t,e);break;default:throw new Error(Ym(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}},ap=(t,e,i=!0)=>{let s;Zm=!1,e instanceof Mr?(s=e.Cr,e.G()):"container"in e&&(s="string"==typeof e.container?xt.document.getElementById(e.container):e.container);const r=!!s&&(s===xt.document.body||xt.document.body.contains(s)),n=s&&r?s:document.body,o=xt.document.createElement("div");o.id="lcjs-error",n.append(o),o.style.width="100%",o.style.height="100%",o.style.backgroundColor="black",o.style.boxSizing="border-box",o.style.padding="20px",o.style.font="Arial",o.style.fontSize="20px";let h=(t||"LICENSE_ERROR").toLowerCase().split("_").join(" ");h=(i?Ym(0,0,1,2,1,23,1,24,25,1):"")+h.charAt(0).toUpperCase()+h.substr(1);const a=xt.document.createElement("p1");o.append(a),a.innerHTML=h,a.style.color="red"},lp=(t,e,i)=>{e?(t[Ym(-1,17)](Ym(-1,19),i),t[Ym(-1,17)](Ym(-1,20),i),t[Ym(-1,17)](Ym(-1,21),i),t[Ym(-1,17)](Ym(-1,22),i)):(t[Ym(-1,18)](Ym(-1,19),i),t[Ym(-1,18)](Ym(-1,20),i),t[Ym(-1,18)](Ym(-1,21),i),t[Ym(-1,18)](Ym(-1,22),i))},up=(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)}))},cp=t=>{const i=()=>{};let s,r,n;if(new xt.Image instanceof xt.HTMLImageElement){const t=new xt.Image;t.src=Hf,r=new zo({source:t,fitMode:e.ImageFitMode.Stretch});const i=new xt.Image;i.src=Gf,n=new zo({source:i,fitMode:e.ImageFitMode.Stretch})}else if(xt.lcjs_setup){const t=new xt.Image;t.src=Hf;const i=xt.lcjs_setup(t.naturalWidth,t.naturalHeight);i.getContext("2d").drawImage(t,0,0),r=new zo({source:i,fitMode:e.ImageFitMode.Stretch}),n=r}else r=new V({color:w("#f00")}),n=r;const o=e=>{if(e.ed&&(e.uU&&(n?e.ed.Me(n):xt.requestAnimationFrame((()=>o(e)))),e.uU||(r?e.ed.Me(r):xt.requestAnimationFrame((()=>o(e))))),e.ed){const t=(e.uU,150),i=(e.uU,32),s=e.ct.Jt({x:e.ct.x.getInnerEnd(),y:e.ct.y.getInnerStart()},{x:-(3+t),y:3}),r=e.ct.Jt({x:e.ct.x.getInnerEnd(),y:e.ct.y.getInnerStart()},{x:-3,y:3+i}),n={x:r.x-s.x,y:r.y-s.y};e.ed.we(s).q(n)}!1===e.uU&&"W"!==Hf[3361]&&ap(Ym(0,36,1,38,5),t,!1),!0===e.uU&&"2"!==Gf[571]&&ap(Ym(0,36,1,38,5),t,!1),s&&s.Ss()};return s=t.rF("logo",Number.MAX_SAFE_INTEGER),n=>{const h={ct:n,uU:!1};let a,l;return h.cU=()=>{a=xt.setTimeout((()=>{l=t.Tr(e.MouseStyles.Point),void 0!==h.ed&&(h.ed.setMouseClickEventHandler(dp),h.ed.setTouchEndEventHandler(dp)),h.uU=!0,o(h)}),3e3)},h.dU=()=>{xt.clearTimeout(a),t.Fr(l),void 0!==h.ed&&(h.ed.setMouseClickEventHandler(i),h.ed.setTouchEndEventHandler(i)),h.uU=!1,o(h)},(t=>{t.ed&&t.ed.dispose(),s&&(t.ed=s._e(t.ct).Me(r).setMouseInteractions(!0).setMouseClickEventHandler(i).setTouchEndEventHandler(i).ve(st),t.cU&&t.ed.setMouseEnterEventHandler(t.cU),t.dU&&t.ed.setMouseLeaveEventHandler(t.dU),o(t))})(h),{Ts:()=>o(h),G:()=>(t=>{t.ed&&(t.ed.dispose(),t.ed=void 0,t.cU=()=>{},t.dU=()=>{})})(h)}}},dp=()=>xt.open("https://lightningchart.com/lightningchart-js/"),fp={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"}},gp={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"}},yp={"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"}},mp={"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"}},pp={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"}},Sp={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"}},xp={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"}},bp={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"}},vp={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"}},Mp={World:Sp,USA:xp,NorthAmerica:bp,SouthAmerica:vp,Canada:mp,Europe:pp,Asia:gp,Africa:fp,Australia:yp},Ap={Solid:Ou},Tp=(t,e)=>{const i=(t=>{const e=new V({color:t.uiStrokeColorContrastHigh}),i=new V({color:t.uiStrokeColorContrastMedium}),s=new V({color:t.uiStrokeColorContrastLow}),r=new tr({family:t.fontFamily,weight:"normal",style:"normal"}),n=r.setSize(18*t.fontScaler),o=r.setSize(16*t.fontScaler),h=r.setSize(14*t.fontScaler),a=r.setSize(10*t.fontScaler),l=r.withMutations((e=>e.set("size",14*t.fontScaler).set("weight","bold"))),u=r.setSize(13*t.fontScaler),c=new $i({thickness:2,fillStyle:s}),d=new V({color:t.dataHighlightOverlayColor}),f=new $i({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),g=t.dataColorPalette.map((t=>new V({color:t.stroke}))),y=t=>g[t%g.length],m=g.map((t=>new $i({thickness:2,fillStyle:t}))),p=t=>m[t%m.length],S=t.dataColorPalette.map((t=>new V({color:t.border}))).map((t=>new $i({thickness:2,fillStyle:t}))),x=t=>S[t%S.length],b=t.dataColorPalette.map((t=>{const e=t.area;return new tt({angle:180,stops:[{color:ae(e,T(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ae(e,T(0,0,0,e.getA()),.3),offset:1}]})})),v=t=>b[t%b.length],M=t.dataColorPaletteInverted.map((t=>{const e=t.area;return new tt({angle:180,stops:[{color:ae(e,T(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ae(e,T(0,0,0,e.getA()),.3),offset:1}]})})),A=t=>M[t%M.length],w=t.dataColorPaletteInverted.map((t=>new V({color:t.border}))).map((t=>new $i({thickness:2,fillStyle:t}))),E=t=>w[t%w.length],I=new V({color:t.dataColorPositive}),C=new V({color:t.dataColorNegative}),k=new $i({thickness:1,fillStyle:new V({color:t.dataStrokeColorContrastHigh.setA(50)})}),P=new $i({thickness:2,fillStyle:t.axisLineFillStyle}),F=st,B=new V({color:T(0,0,0,1)}),_=new $i({thickness:1,fillStyle:t.axisGridMajorFillStyle}),L=new $i({thickness:1,fillStyle:t.axisTickMajorFillStyle}),D=h,O=t.axisLabelMajorFillStyle,R=new $i({thickness:1,fillStyle:t.axisGridMajorFillStyle}),N=new $i({thickness:1,fillStyle:t.axisTickMajorFillStyle}),G=h,H=t.axisLabelMajorFillStyle,U=new $i({thickness:1,fillStyle:t.axisGridMinorFillStyle}),W=new $i({thickness:1,fillStyle:t.axisTickMinorFillStyle}),X=a,Y=t.axisLabelMinorFillStyle,j=nh,J=new sh({gridStrokeStyle:_,tickStyle:L,tickLength:50,tickPadding:-14,labelFont:D,labelPadding:0,labelFillStyle:O}),$=new sh({gridStrokeStyle:R,tickStyle:N,tickLength:7,tickPadding:0,labelFont:G,labelPadding:0,labelFillStyle:H}),q=new sh({gridStrokeStyle:U,tickStyle:W,tickLength:4,tickPadding:5,labelFont:X,labelPadding:0,labelFillStyle:Y}),K=new wh({extremeTickStyle:j,majorTickStyle:$,minorTickStyle:q}),Z=new Sh({greatTickStyle:J,majorTickStyle:$,minorTickStyle:q}),Q=new Ph({majorTickStyle:$,minorTickStyle:q}),et=new V({color:t.dataHighlightOverlayColor}),it=new $i({thickness:1,fillStyle:i}),rt=new $i({thickness:2,fillStyle:i}),nt=t=>new ur.Triangulated({shape:"sphere",size:10,fillStyle:g[t%g.length]}),ot=g[0],ht=t.uiTextFillStyle,at=t.legendBackgroundFillStyle,lt=new $i({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),ut=ue(t.legendButtonDefaultColor),ct=new $i({thickness:1,fillStyle:e}),dt=new $i({thickness:1,fillStyle:t.cursorGridFillStyle});let ft={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:st,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new $i({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:st,chartXYTitleFont:n,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:c,chartXYZoomingRectangleFillStyle:d,chartXYZoomingRectangleStrokeStyle:f,chartXYFittingRectangleFillStyle:d,chartXYFittingRectangleStrokeStyle:f,lineSeriesStrokeStyle:p,pointLineSeriesStrokeStyle:p,pointLineSeriesFillStyle:y,pointSeriesFillStyle:y,ellipseSeriesFillStyle:y,ellipseSeriesStrokeStyle:p,polygonSeriesFillStyle:y,polygonSeriesStrokeStyle:p,rectangleSeriesFillStyle:y,rectangleSeriesStrokeStyle:st,segmentSeriesStrokeStyle:p,boxSeriesBodyFillStyle:y(0),boxSeriesBodyStrokeStyle:st,boxSeriesStrokeStyle:new $i({thickness:1,fillStyle:g[0]}),boxSeriesMedianStrokeStyle:new $i({thickness:1,fillStyle:new V({color:T(0,0,0)})}),ohlcCandleBodyFillStylePositive:I,ohlcCandleBodyFillStyleNegative:C,ohlcCandleBodyStrokeStylePositive:st,ohlcCandleBodyStrokeStyleNegative:st,ohlcCandleStrokeStyle:new $i({thickness:1,fillStyle:new V({color:t.uiStrokeColorContrastHigh})}),ohlcBarStrokeStylePositive:new $i({thickness:2,fillStyle:I}),ohlcBarStrokeStyleNegative:new $i({thickness:2,fillStyle:C}),heatmapGridSeriesFillStyle:y,heatmapGridSeriesWireframeStyle:k,heatmapScrollingGridSeriesFillStyle:y,heatmapScrollingGridSeriesWireframeStyle:k,areaRangeSeriesFillStyle:v,areaRangeSeriesStrokeStyle:x,areaRangeSeriesFillStyleInverted:A,areaRangeSeriesStrokeStyleInverted:E,areaSeriesBipolarHighFillStyle:v,areaSeriesBipolarHighStrokeStyle:x,areaSeriesBipolarLowFillStyle:A,areaSeriesBipolarLowStrokeStyle:E,areaSeriesPositiveFillStyle:v,areaSeriesPositiveStrokeStyle:x,areaSeriesNegativeFillStyle:A,areaSeriesNegativeStrokeStyle:E,xAxisTitleFont:o,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:P,xAxisNibStyle:F,xAxisOverlayStyle:B,xAxisZoomingBandFillStyle:d,xAxisZoomingBandStrokeStyle:st,xAxisNumericTicks:K,xAxisDateTimeTicks:Z,xAxisTimeTicks:Q,yAxisTitleFont:o,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:P,yAxisNibStyle:F,yAxisOverlayStyle:B,yAxisZoomingBandFillStyle:d,yAxisZoomingBandStrokeStyle:st,yAxisNumericTicks:K,yAxisDateTimeTicks:Z,yAxisTimeTicks:Q,bandFillStyle:et,bandStrokeStyle:it,constantLineStrokeStyle:rt,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:st,barChartTitleFont:n,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:z,barChartSeriesBackgroundStrokeStyle:st,barChartBarFillStyle:y,barChartBarStrokeStyle:st,barChartValueAxisTitleFont:o,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:P,barChartValueAxisTicks:K.setMajorTickStyle((t=>t.setGridStrokeStyle(st))).setMinorTickStyle((t=>rh(t)?t.setGridStrokeStyle(st):t)),barChartCategoryAxisTitleFont:o,barChartCategoryAxisTitleFillStyle:t.axisTitleFillStyle,barChartCategoryAxisStrokeStyle:P,barChartCategoryLabels:{formatter:(t,e,i)=>e,labelFillStyle:K.majorTickStyle.labelFillStyle,labelFont:K.majorTickStyle.labelFont,labelMargin:8,labelRotation:0,tickStyle:K.majorTickStyle.tickStyle,tickLength:0},barChartValueLabelsAfterBars:{position:"after-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:K.majorTickStyle.labelFillStyle,labelFont:K.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},barChartValueLabelsInsideBars:{position:"inside-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:K.majorTickStyle.labelFillStyle,labelFont:K.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:st,chart3DTitleFont:n,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:c,chart3DBoundingBoxStrokeStyle:st,xAxis3DTitleFont:o,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:P,xAxis3DNumericTicks:K,xAxis3DDateTimeTicks:Z,xAxis3DTimeTicks:Q,yAxis3DTitleFont:o,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:P,yAxis3DNumericTicks:K,yAxis3DDateTimeTicks:Z,yAxis3DTimeTicks:Q,zAxis3DTitleFont:o,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:P,zAxis3DNumericTicks:K,zAxis3DDateTimeTicks:Z,zAxis3DTimeTicks:Q,lineSeries3DStrokeStyle:p,pointLineSeries3DStrokeStyle:p,pointLineSeries3DPointStyle:nt,pointSeries3DPointStyle:nt,pointCloudSeries3DPointStyle:t=>new ur.Pixelated({size:5,fillStyle:g[t%g.length]}),surfaceGridSeries3DFillStyle:y,surfaceGridSeries3DWireframeStyle:k,surfaceScrollingGridSeries3DFillStyle:y,surfaceScrollingGridSeries3DWireframeStyle:k,boxSeries3DFillStyle:y,polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:st,polarChartTitleFont:n,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:c,polarSectorFillStyle:et,polarSectorStrokeStyle:it,polarAmplitudeAxisTitleFont:o,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:P,polarAmplitudeAxisNumericTicks:K,polarAmplitudeAxisDateTimeTicks:Z,polarAmplitudeAxisTimeTicks:Q,polarRadialAxisTitleFont:o,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:P,polarRadialAxisTickStyle:$,polarLineSeriesStrokeStyle:p,polarPointLineSeriesFillStyle:y,polarPointLineSeriesStrokeStyle:p,polarPointSeriesFillStyle:y,polarPolygonSeriesFillStyle:v,polarPolygonSeriesStrokeStyle:x,polarAreaSeriesFillStyle:v,polarAreaSeriesStrokeStyle:x,polarHeatmapSeriesFillStyle:y,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:st,mapChartTitleFont:n,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:ot,mapChartStrokeStyle:new $i({thickness:1,fillStyle:new V({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:z,mapChartOutlierRegionStrokeStyle:new $i({thickness:1,fillStyle:s}),mapChartSeparateRegionFillStyle:at,mapChartSeparateRegionStrokeStyle:lt,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:st,dataGridTitleFont:n,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:h,dataGridTextFillStyle:ot,dataGridCellBackgroundFillStyle:new V({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new $i({thickness:.4,fillStyle:new V({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:st,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:lt,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:lt,dataGridScrollBarButtonArrowFillStyle:ut,dataGridScrollBarButtonArrowStrokeStyle:lt,sparkLineChartStrokeStyle:p(0),sparkPointChartFillStyle:y(0),sparkBarChartFillStyle:y(0),sparkBarChartStrokeStyle:x(0),sparkAreaChartFillStyle:v(0),sparkAreaChartStrokeStyle:x(0),sparkPieChartFillStyle:y,sparkPieChartStrokeStyle:lt,sparkChartBandFillStyle:et,sparkChartBandStrokeStyle:it,sparkChartConstantLineStrokeStyle:rt,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:st,spiderChartTitleFont:n,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:c,spiderChartWebStyle:new $i({thickness:2,fillStyle:s}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:h,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:o,spiderChartAxisStrokeStyle:new $i({thickness:2,fillStyle:i}),spiderChartAxisNibStrokeStyle:new $i({thickness:2,fillStyle:e}),spiderSeriesFillStyle:v,spiderSeriesStrokeStyle:x,spiderSeriesPointFillStyle:y,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:st,pieChartTitleFont:n,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:y,pieChartSliceStrokeStyle:lt,pieChartSliceLabelFont:u,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:ct,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:st,funnelChartTitleFont:n,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:y,funnelChartSliceStrokeStyle:lt,funnelChartSliceLabelFont:u,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:ct,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:st,pyramidChartTitleFont:n,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:y,pyramidChartSliceStrokeStyle:lt,pyramidChartSliceLabelFont:u,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:ct,gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:st,gaugeChartTitleFont:n,gaugeChartTitleFillStyle:t.titleFillStyle,gaugeChartEmptyGaugeFillStyle:new V({color:t.uiBackgroundColor}),gaugeChartEmptyGaugeStrokeStyle:lt,gaugeChartGaugeFillStyle:ot,gaugeChartIntervalLabelsFillStyle:ht,gaugeChartIntervalLabelsFont:u,gaugeChartValueLabelFillStyle:ht,gaugeChartValueLabelFont:u,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:st,onScreenMenuBackgroundColor:T(254,204,0,.7),uiButtonFillStyle:ut,uiButtonStrokeStyle:lt,uiButtonSize:10,uiBackgroundFillStyle:at,uiBackgroundStrokeStyle:lt,uiTextFillStyle:ht,uiTextFont:u,legendTitleFillStyle:ht,legendTitleFont:l,cursorTickMarkerXBackgroundFillStyle:at,cursorTickMarkerXBackgroundStrokeStyle:lt,cursorTickMarkerXTextFillStyle:ht,cursorTickMarkerXTextFont:u,cursorTickMarkerYBackgroundFillStyle:at,cursorTickMarkerYBackgroundStrokeStyle:lt,cursorTickMarkerYTextFillStyle:ht,cursorTickMarkerYTextFont:u,cursorPointMarkerFillStyle:z,cursorPointMarkerStrokeStyle:st,cursorResultTableFillStyle:at,cursorResultTableStrokeStyle:lt,cursorResultTableTextFillStyle:ht,cursorResultTableTextFont:u,cursorGridStrokeStyleX:dt,cursorGridStrokeStyleY:dt,chartMarkerPointMarkerFillStyle:t.legendBackgroundBorderFillStyle,chartMarkerPointMarkerStrokeStyle:st};return t.overrideThemeProperties&&(ft={...ft,...t.overrideThemeProperties}),ft})(t),s={...e,header1Font:i.xAxisTitleFont,header2Font:i.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:i.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...i,examples:s}},wp=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/themes/${e}`;return i.addEventListener("error",(e=>{Ee(t,s,"Theme with asset",{shouldCrash:!1})})),i.src=s,i},Ep=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,T(255,255,255),.5);return new K({stops:[{color:ae(r,T(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:ae(r,T(30,30,30),.5*i).setA(100),offset:1}]})},Ip=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,T(255,255,255),.2);return new K({stops:[{color:ae(r,T(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:ae(r,T(0,0,0),.2*i),offset:1}]})},Cp=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,T(255,255,255),.2);return new tt({angle:90,stops:[{color:ae(r,T(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:ae(r,T(30,30,30),.5*i),offset:1}]})},kp=(t,e,i)=>i=>{const s=!0===t?e[i%e.length].stroke:ae(e[i%e.length].stroke,T(255,255,255),.3);return new tt({angle:90,stops:[{color:ae(s,T(255,255,255),.5),offset:0},{color:s,offset:.35},{color:ae(s,T(30,30,30),.5),offset:1}]})},Pp=(t,i,s)=>{const r=i[0].stroke;return new K({shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner,position:{x:.5,y:.5},stops:[{color:!0===t?r:ae(r,T(255,255,255),.5*s),offset:0},{color:r,offset:.5},{color:!0===t?r:ae(r,T(0,0,0),.5*s),offset:1}]})},Fp=Te((()=>{const t=T(255,255,255),i=new V({color:t}),s=!0,r=new Xo({spread:1,blur:9,offset:{x:0,y:0},color:T(0,0,0,150)}),n=new K({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:T(50,51,52)},{offset:.5,color:T(14,15,16)},{offset:1,color:T(0,0,0)}]}),o=new V({color:T(45,45,45)}),h=new K({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(120,120,120,100)},{offset:1,color:T(0,0,0,50)}]}),a=new K({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(30,30,30,200)},{offset:1,color:T(0,0,0,255)}]}),l=new V({color:T(255,255,220)}),u=new V({color:T(255,255,166)}),c=new V({color:T(255,255,220)}),d=new V({color:T(255,255,220,130)}),f=new V({color:T(255,255,200)}),g=f,y=g,m=new tt({angle:45,stops:[{offset:0,color:T(230,230,230)},{offset:1,color:T(150,150,150)}]}),p=new V({color:T(220,220,220)}),S=new V({color:T(200,200,200,50)}),x=new V({color:T(200,200,200,150)}),b=new V({color:T(200,200,200,20)}),v=new V({color:T(150,150,150)}),M=new tt({angle:0,stops:[{offset:0,color:T(10,10,10,220)},{offset:1,color:T(30,30,30,220)}]}),A=i,w=T(255,255,200),E=M,I=A,C=T(20,20,20),k=T(0,0,0),P=t,F=T(150,150,150),B=T(50,50,50),_=T(50,50,50),L=T(100,100,100),D=T(200,200,200),z=[T(255,255,91,255),T(255,205,91,255),T(255,155,91,255),T(255,196,188,255),T(255,148,184,255),T(219,148,198,255),T(235,196,224,255),T(169,148,198,255),T(148,226,198,255),T(148,255,176,255),T(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),O=t.setA(20),R=T(176,255,157,255),N=T(255,112,76,255),G={mapChartFillStyle:new tt({angle:135,stops:[{color:T(255,255,91,255),offset:0},{color:T(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:Ep(s,z,.5),pieChartSliceFillStylePalette:Ip(s,z,1),funnelChartSliceFillStylePalette:Cp(s,z,1),pyramidChartSliceFillStylePalette:Cp(s,z,1),rectangleSeriesFillStyle:kp(s,z),gaugeChartGaugeFillStyle:Pp(s,z,1),barChartBarFillStyle:kp(s,z)},H=new V({color:T(176,255,157,255)}),U=new V({color:T(255,146,146,255)}),W=new V({color:T(176,255,157,255)}),X=new V({color:T(230,63,63,255)}),Y=new V({color:T(176,255,157,120)}),j=new V({color:T(229,63,63,180)}),J=new V({color:T(27,37,36,255)}),$=new V({color:T(62,27,27,255)}),q=[T(255,0,0),T(255,255,0),T(0,255,0)],Z=[T(10,10,255),T(10,190,255),T(251,255,0),T(255,38,0)],Q=[T(255,255,0),T(255,204,0),T(255,128,0),T(255,0,0)],et=[T(0,0,0),T(167,4,69,255),T(255,0,0),T(252,252,168,255)],it=new K({stops:[{color:T(61,61,80,100),offset:0},{color:T(44,44,55,30),offset:1}]}),st=new V({color:T(148,148,198,255)}),rt=Y.getColor().setA(255),nt=T(100,100,100);return Tp({isDark:s,highlightColorOffset:T(60,60,60,60),highlightColorOffsetAxisOverlay:T(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:S,axisTickMinorFillStyle:x,axisGridMinorFillStyle:b,cursorGridFillStyle:v,legendBackgroundFillStyle:M,legendBackgroundBorderFillStyle:A,legendButtonDefaultColor:w,resultTableBackgroundFillStyle:E,resultTableBackgroundBorderFillStyle:I,uiBackgroundColor:C,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:P,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:B,dataStrokeColorContrastHigh:_,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:D,dataColorPalette:z,dataColorPaletteInverted:[{area:T(190,50,50,100),border:T(210,80,80)}],dataHighlightOverlayColor:O,dataColorPositive:R,dataColorNegative:N,overrideThemeProperties:G},{positiveTextFillStyle:H,negativeTextFillStyle:U,positiveFillStyle:W,negativeFillStyle:X,positiveAreaFillStyle:Y,negativeAreaFillStyle:j,positiveBackgroundFillStyle:J,negativeBackgroundFillStyle:$,badGoodColorPalette:q,coldHotColorPalette:Z,intensityColorPalette:Q,spectrogramColorPalette:et,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),Bp=Te((()=>{const t=T(255,255,255),i=new V({color:t}),s=!0,r=new Xo({spread:0,blur:9,offset:{x:0,y:0},color:T(105,255,236,40)}),n=new V({color:T(2,21,30)}),o=new K({stops:[{color:T(19,40,66,150),offset:0},{color:T(0,0,0,150),offset:1}]}),h=new V({color:T(0,5,8,150)}),a=i,l=i,u=i,c=new V({color:T(255,255,220,130)}),d=i,f=i,g=f,y=new V({color:T(20,224,250,255)}),m=i,p=new V({color:T(61,94,110,100)}),S=new V({color:T(61,94,110,255)}),x=new V({color:T(61,94,110,40)}),b=i,v=new V({color:T(0,18,23,255)}),M=i,A=t,w=new V({color:T(0,17,22,240)}),E=i,I=T(0,38,48,220),C=T(0,0,0),k=t,P=T(150,150,150),F=T(19,78,93),B=T(50,50,50),_=T(0,36,48),L=T(200,200,200),D=[T(45,253,253,255),T(44,172,247,255),T(46,100,248,255),T(96,84,199,255),T(184,104,245,255),T(98,160,218,255),T(43,238,245,255),T(38,140,206,255),T(112,96,224,255),T(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),z=t.setA(50),O=T(3,217,194,255),R=T(230,63,63,255),N={mapChartFillStyle:new tt({angle:135,stops:[{color:T(118,248,231,255),offset:0},{color:T(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Ep(s,D,1),pieChartSliceFillStylePalette:Ip(s,D,1),funnelChartSliceFillStylePalette:Cp(s,D,1),pyramidChartSliceFillStylePalette:Cp(s,D,1),rectangleSeriesFillStyle:kp(s,D),gaugeChartGaugeFillStyle:Pp(s,D,1),barChartBarFillStyle:kp(s,D)},G=new V({color:T(45,253,253,255)}),H=new V({color:T(255,146,146,255)}),U=new V({color:T(45,253,253,255)}),W=new V({color:T(230,63,63,255)}),X=new V({color:T(1,190,164,120)}),Y=new V({color:T(229,63,63,180)}),j=new V({color:T(1,53,57,255)}),J=new V({color:T(62,27,27,255)}),$=[T(1,104,119,255),T(0,165,144,255),T(0,246,214,255)],q=[T(0,87,95,255),T(0,125,124,255),T(1,209,182,255),T(0,255,221,255),T(218,112,112,255),T(172,47,47,255)],Z=[T(126,255,253,255),T(50,233,230,255),T(0,196,193,255),T(62,138,178,255),T(139,88,191,255),T(162,55,143,255)],Q=[T(13,31,52,255),T(101,50,118,255),T(1,142,172,255),T(2,196,170,255),T(0,255,221,255)],et=new K({stops:[{color:T(122,103,254,70),offset:0},{color:T(178,168,255,10),offset:1}]}),it=new V({color:T(122,103,254,255)}),st=X.getColor().setA(255),rt=T(15,83,83);return Tp({isDark:s,highlightColorOffset:T(60,60,60,60),highlightColorOffsetAxisOverlay:T(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new zo({source:wp(t,"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:S,axisGridMinorFillStyle:x,cursorGridFillStyle:b,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:A,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:I,uiBackgroundBorderColor:C,uiStrokeColorContrastHigh:k,uiStrokeColorContrastMedium:P,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:B,dataStrokeColorContrastMedium:_,dataStrokeColorContrastLow:L,dataColorPalette:D,dataColorPaletteInverted:[{area:T(170,60,210,100),border:T(210,100,250)}],dataHighlightOverlayColor:z,dataColorPositive:O,dataColorNegative:R,overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:H,positiveFillStyle:U,negativeFillStyle:W,positiveAreaFillStyle:X,negativeAreaFillStyle:Y,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:J,badGoodColorPalette:$,coldHotColorPalette:q,intensityColorPalette:Z,spectrogramColorPalette:Q,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:rt})})),_p=Te((()=>{const t=!1,i=new Xo({spread:0,blur:6,offset:{x:2,y:-2},color:T(0,0,0,30)}),s=new K({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:T(255,255,255)},{offset:1,color:T(255,255,255)}]}),r=new V({color:T(219,227,233,255)}),n=new K({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(255,255,255,200)},{offset:1,color:T(240,244,246,200)}]}),o=new K({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(255,255,255,255)},{offset:1,color:T(255,255,255,255)}]}),h=new V({color:T(33,43,49)}),a=new V({color:T(33,43,49)}),l=new V({color:T(33,43,49)}),u=new V({color:T(33,43,49,150)}),c=new V({color:T(33,43,49)}),d=c,f=d,g=new tt({angle:45,stops:[{offset:0,color:T(225,225,225)},{offset:1,color:T(225,225,225)}]}),y=new V({color:T(168,186,199,255)}),m=new V({color:T(168,186,199,120)}),p=new V({color:T(168,186,199,40)}),S=new V({color:T(168,186,199,40)}),x=new V({color:T(128,146,159,255)}),b=new tt({angle:0,stops:[{offset:0,color:T(255,255,255,240)},{offset:1,color:T(255,255,255,240)}]}),v=new V({color:T(168,186,199)}),M=T(255,255,200),A=new V({color:T(255,255,255,240)}),w=new V({color:T(128,146,159,255)}),E=T(255,255,255,255),I=T(168,168,199,255),C=T(168,186,199,255),k=T(168,186,199,255),P=T(168,186,199,255),F=T(168,186,199,255),B=T(100,100,100),_=T(200,200,200),L=[T(28,181,140,255),T(255,132,0,255),T(240,39,39,255),T(86,121,251,255),T(2,181,213,255),T(13,212,158,255),T(22,167,3,255),T(234,103,232,255),T(62,183,179,255),T(140,93,3,255),T(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),D=T(150,150,150,80),z=T(46,182,120,255),O=T(255,66,66,255),R=new $i({thickness:2,fillStyle:new V({color:T(168,186,199,255)})}),N={mapChartFillStyle:new tt({angle:-45,stops:[{color:T(2,181,213,255),offset:0},{color:T(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:Ep(t,L,.8),pieChartSliceFillStylePalette:Ip(t,L,.8),funnelChartSliceFillStylePalette:Cp(t,L,.5),pyramidChartSliceFillStylePalette:Cp(t,L,.5),rectangleSeriesFillStyle:kp(t,L),gaugeChartGaugeFillStyle:Pp(t,L,.8),barChartBarFillStyle:kp(t,L),chartXYSeriesBackgroundStrokeStyle:R,chart3DSeriesBackgroundStrokeStyle:R,polarChartSeriesBackgroundStrokeStyle:R,spiderChartSeriesBackgroundStrokeStyle:R,dataGridTextFillStyle:new V({color:T(0,88,64,255)})},G=new V({color:T(4,146,108,255)}),H=new V({color:T(240,39,39,255)}),U=new V({color:T(28,181,140,255)}),W=new V({color:T(230,88,88,255)}),X=new V({color:T(28,181,140,180)}),Y=new V({color:T(230,88,88,180)}),j=new V({color:T(229,243,228)}),J=new V({color:T(232,225,216)}),$=[T(193,48,48,255),T(240,234,60,255),T(45,191,55,255)],q=[T(10,19,255,255),T(15,191,250,255),T(249,255,2,255),T(253,133,0,255),T(255,24,0,255)],Z=[T(50,99,213),T(8,179,77),T(255,246,0),T(255,126,0),T(189,36,30)],Q=[T(16,64,176),T(8,179,77),T(255,246,0),T(255,126,0),T(168,6,0)],et=new V({color:T(185,198,207,255)}),it=new K({stops:[{color:T(151,190,220,10),offset:0},{color:T(151,190,220,50),offset:1}]}),st=X.getColor().setA(255),rt=T(150,150,150);return Tp({isDark:t,highlightColorOffset:T(-60,-60,-60,60),highlightColorOffsetAxisOverlay:T(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:S,cursorGridFillStyle:x,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:A,resultTableBackgroundBorderFillStyle:w,uiBackgroundColor:E,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:C,uiStrokeColorContrastMedium:k,uiStrokeColorContrastLow:P,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:B,dataStrokeColorContrastLow:_,dataColorPalette:L,dataColorPaletteInverted:[{area:T(190,50,50,100),border:T(210,80,80)}],dataHighlightOverlayColor:D,dataColorPositive:z,dataColorNegative:O,overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:H,positiveFillStyle:U,negativeFillStyle:W,positiveAreaFillStyle:X,negativeAreaFillStyle:Y,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:J,badGoodColorPalette:$,coldHotColorPalette:q,intensityColorPalette:Z,spectrogramColorPalette:Q,bollingerFillStyle:it,bollingerBorderFillStyle:et,highlightPointColor:T(0,0,0),highlightDataGridColor:st,unfocusedDataColor:rt})})),Lp=Te((()=>{const t=!1,i=new K({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:T(255,255,255)},{offset:1,color:T(255,255,255)}]}),s=new V({color:T(214,236,216,255)}),r=new K({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(233,244,231,70)},{offset:1,color:T(233,244,231,200)}]}),n=new K({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(255,255,255,255)},{offset:1,color:T(255,255,255,255)}]}),o=new V({color:T(1,61,53)}),h=new V({color:T(1,61,53)}),a=new V({color:T(1,61,53)}),l=new V({color:T(1,61,53,150)}),u=new V({color:T(1,61,53)}),c=u,d=c,f=new tt({angle:45,stops:[{offset:0,color:T(225,225,225)},{offset:1,color:T(225,225,225)}]}),g=new V({color:T(188,211,186,255)}),y=new V({color:T(188,211,186,150)}),m=new V({color:T(188,211,186,50)}),p=new V({color:T(188,211,186,50)}),S=new V({color:T(104,148,111,255)}),x=new tt({angle:0,stops:[{offset:0,color:T(255,255,255,240)},{offset:1,color:T(255,255,255,240)}]}),b=new V({color:T(104,148,111)}),v=T(255,255,200),M=new V({color:T(255,255,255,240)}),A=new V({color:T(104,148,111,255)}),w=T(255,255,255,255),E=T(179,201,183,255),I=T(188,211,186,255),C=T(188,211,186,255),k=T(188,211,186,255),P=T(188,211,186,255),F=T(100,100,100),B=T(200,200,200),_=[T(138,195,142,255),T(193,161,114,255),T(178,99,99,255),T(142,156,210,255),T(154,209,219,255),T(164,212,199,255),T(104,156,97,255),T(196,147,195,255),T(92,190,187,255),T(126,100,51,255),T(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),L=T(150,150,150,80),D=T(46,182,84,255),z=T(232,96,96,255),O=new $i({thickness:2,fillStyle:new V({color:T(188,211,186,255)})}),R={mapChartFillStyle:new tt({angle:-45,stops:[{color:T(118,160,121,255),offset:0},{color:T(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:Ep(t,_,.8),pieChartSliceFillStylePalette:Ip(t,_,.8),pyramidChartSliceFillStylePalette:Cp(t,_,.5),funnelChartSliceFillStylePalette:Cp(t,_,.5),rectangleSeriesFillStyle:kp(t,_),gaugeChartGaugeFillStyle:Pp(t,_,.8),barChartBarFillStyle:kp(t,_),chartXYSeriesBackgroundStrokeStyle:O,chart3DSeriesBackgroundStrokeStyle:O,polarChartSeriesBackgroundStrokeStyle:O,spiderChartSeriesBackgroundStrokeStyle:O,dataGridTextFillStyle:new V({color:T(77,66,21,255)})},N=new V({color:T(93,151,97,255)}),G=new V({color:T(178,99,99,255)}),H=new V({color:T(138,195,142,255)}),U=new V({color:T(178,99,99,255)}),W=new V({color:T(138,195,142,180)}),X=new V({color:T(178,99,99,180)}),Y=new V({color:T(224,240,237)}),j=new V({color:T(251,227,227)}),J=[T(178,99,99,255),T(215,224,111,255),T(80,186,88,255)],$=[T(62,64,142,255),T(66,131,77,255),T(250,250,135,255),T(202,161,78,255),T(179,53,53,255)],q=[T(64,86,138),T(123,192,205),T(255,252,149),T(220,155,92),T(184,78,74)],Z=[T(64,86,138),T(123,192,205),T(255,252,149),T(220,155,92),T(132,60,57)],Q=new V({color:T(185,198,207,255)}),et=new K({stops:[{color:T(151,190,220,10),offset:0},{color:T(151,190,220,50),offset:1}]}),it=W.getColor().setA(255),st=T(150,150,150);return Tp({isDark:t,highlightColorOffset:T(-60,-60,-60,60),highlightColorOffsetAxisOverlay:T(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:S,legendBackgroundFillStyle:x,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:A,uiBackgroundColor:w,uiBackgroundBorderColor:E,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:C,uiStrokeColorContrastLow:k,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:F,dataStrokeColorContrastLow:B,dataColorPalette:_,dataColorPaletteInverted:[{area:T(210,70,70,100),border:T(200,110,110)}],dataHighlightOverlayColor:L,dataColorPositive:D,dataColorNegative:z,overrideThemeProperties:R},{positiveTextFillStyle:N,negativeTextFillStyle:G,positiveFillStyle:H,negativeFillStyle:U,positiveAreaFillStyle:W,negativeAreaFillStyle:X,positiveBackgroundFillStyle:Y,negativeBackgroundFillStyle:j,badGoodColorPalette:J,coldHotColorPalette:$,intensityColorPalette:q,spectrogramColorPalette:Z,bollingerFillStyle:et,bollingerBorderFillStyle:Q,highlightPointColor:T(0,0,0),highlightDataGridColor:it,unfocusedDataColor:st})})),Dp=Te((()=>{const t=T(255,255,255),i=new V({color:t}),s=!0,r=new Xo({spread:1,blur:9,offset:{x:0,y:0},color:T(255,255,255,30)}),n=new V({color:T(6,15,36)}),o=new K({stops:[{color:T(46,13,87,50),offset:0},{color:T(0,0,0,150),offset:1}]}),h=new V({color:T(0,5,8,150)}),a=i,l=i,u=i,c=new V({color:T(255,255,220,130)}),d=i,f=i,g=f,y=new tt({angle:45,stops:[{offset:0,color:T(241,133,255,255)},{offset:1,color:T(115,207,238,255)}]}),m=i,p=new V({color:T(61,94,110,100)}),S=new V({color:T(61,94,110,255)}),x=new V({color:T(61,94,110,40)}),b=i,v=new V({color:T(0,18,23,255)}),M=i,A=T(115,207,238,255),w=new V({color:T(0,17,22,240)}),E=i,I=T(0,38,48,255),C=T(0,0,0),k=t,P=T(150,150,150),F=T(19,57,93),B=T(50,50,50),_=T(0,17,48),L=T(200,200,200),D=[T(20,211,237,255),T(98,147,252,255),T(164,73,250,255),T(129,117,253,255),T(95,134,252,255),T(22,133,212,255),T(35,200,242,255),T(104,121,233,255),T(137,69,232,255),T(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),z=t.setA(50),O=T(3,217,194,255),R=T(243,21,110,255),N={mapChartFillStyle:new tt({angle:135,stops:[{color:T(118,248,231,255),offset:0},{color:T(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Ep(s,D,.5),pieChartSliceFillStylePalette:Ip(s,D,2),funnelChartSliceFillStylePalette:Cp(s,D,1),pyramidChartSliceFillStylePalette:Cp(s,D,1),rectangleSeriesFillStyle:kp(s,D),gaugeChartGaugeFillStyle:Pp(s,D,1),barChartBarFillStyle:kp(s,D)},G=new V({color:T(20,211,237,255)}),H=new V({color:T(253,145,178,255)}),U=new V({color:T(20,211,237,255)}),W=new V({color:T(239,68,121,255)}),X=new V({color:T(20,211,237,120)}),Y=new V({color:T(239,68,121,180)}),j=new V({color:T(1,53,57,255)}),J=new V({color:T(94,19,42,255)}),$=[T(174,51,132,255),T(204,107,218,255),T(189,215,253,255)],q=[T(0,63,95,255),T(0,149,255,255),T(0,225,255,255),T(255,154,254,255),T(204,98,170,255),T(139,39,84,255)],Z=[T(197,241,255,255),T(70,210,255,255),T(0,164,217,255),T(90,99,222,255),T(138,75,192,255),T(151,27,162,255)],Q=[T(13,31,52,255),T(129,54,130,255),T(131,108,176,255),T(7,162,213,255),T(26,247,255,255)],et=new K({stops:[{color:T(219,42,235,60),offset:0},{color:T(237,73,252,10),offset:1}]}),it=new V({color:T(237,73,252,255)}),st=X.getColor().setA(255),rt=T(8,70,100);return Tp({isDark:s,highlightColorOffset:T(60,60,60,60),highlightColorOffsetAxisOverlay:T(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new zo({source:wp(t,"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:S,axisGridMinorFillStyle:x,cursorGridFillStyle:b,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:A,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:I,uiBackgroundBorderColor:C,uiStrokeColorContrastHigh:k,uiStrokeColorContrastMedium:P,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:B,dataStrokeColorContrastMedium:_,dataStrokeColorContrastLow:L,dataColorPalette:D,dataColorPaletteInverted:[{area:T(41,130,255,100),border:T(45,110,240)}],dataHighlightOverlayColor:z,dataColorPositive:O,dataColorNegative:R,overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:H,positiveFillStyle:U,negativeFillStyle:W,positiveAreaFillStyle:X,negativeAreaFillStyle:Y,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:J,badGoodColorPalette:$,coldHotColorPalette:q,intensityColorPalette:Z,spectrogramColorPalette:Q,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:rt})})),zp={};Object.defineProperty(zp,"darkGold",{get:Fp,enumerable:!0}),Object.defineProperty(zp,"turquoiseHexagon",{get:Bp,enumerable:!0}),Object.defineProperty(zp,"light",{get:_p,enumerable:!0}),Object.defineProperty(zp,"lightNature",{get:Lp,enumerable:!0}),Object.defineProperty(zp,"cyberSpace",{get:Dp,enumerable:!0});const Op=zp,Rp=Op.darkGold,Vp=(t,e,i)=>s=>{const r={theme:Rp,...i,...s},n=t(r),o=e?cp(n):void 0,h=new Vf(n._n,s,n,n.G.bind(n),o);return n.jn((t=>h.mB(t))).$n((()=>h.Y())).Ss(),h},Np=(t,e)=>{t.jn((t=>{e.Ae(t)})).$n((()=>e.Y())).Ss()},Gp=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rp},n=t(r),o=e?cp(n):void 0,h=new Oh(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o);return Np(n,h),h},Hp=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rp},n=t(r),o=e?cp(n):void 0,h=new Wd(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,s);return Np(n,h),h},Up=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rp},n=t(r),o=e?cp(n):void 0,h=new ac(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,s);return Np(n,h),h},Wp=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rp},n=t(r),o=e?cp(n):void 0,h=new mu(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,s);return Np(n,h),h},Xp=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rp},n=t(r),o=e?cp(n):void 0,h=new(s&&s.type?s.type:aa)(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0,s&&s.disableAnimations);return Np(n,h),h},Yp=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rp},n=t(r),o=e?cp(n):void 0,h=new(s&&s.type?s.type:Ou)(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0,s&&s.disableAnimations);return Np(n,h),h},jp=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rp},n=t(r),o=e?cp(n):void 0,h=new(s&&s.type?s.type:Eu)(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0,s&&s.disableAnimations);return Np(n,h),h},Jp=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rp},n=t(r),o=e?cp(n):void 0,h=new(s&&s.type?s.type:Xu)(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0,!(!s||!s.disableAnimations));return Np(n,h),h},$p=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rp},n=t(r),o=e?cp(n):void 0,h=new xl(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,s,void 0);return Np(n,h),h},qp=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rp},n=t(r),o=e?cp(n):void 0,h=new Va(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0,s);return Np(n,h),h},Kp=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rp},n=t(r),o=e?cp(n):void 0,h=new vf(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0);return Np(n,h),h},Zp=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rp},n=t(r),o=e?cp(n):void 0,h=new Bf(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0,s);return Np(n,h),h};let Qp;const tS={None:Cn,Rectangle:Dn,Circle:zn,Diamond:On,Pointer:Rn},eS={Rectangle:Dn,Circle:zn,Diamond:On},iS={XY:Zl},sS={XY:Kl,Spider:nl,BarChart:ol,Map:al,Polar:nl},rS={None:kn,UIRectangle:Dn,UICircle:zn,UIDiamond:On};e.Animation=Y,e.AnimationEasings=X,e.Animator=j,e.AreaRangeSeries=Td,e.AreaSeries=pd,e.AreaSeriesBipolar=vd,e.AreaSeriesMonopolar=Sd,e.AreaSeriesNegative=bd,e.AreaSeriesPositive=xd,e.AreaSeriesTypes=Md,e.AutoCursor2DBuilder=tl,e.AutoCursorBuilders=sS,e.AutoCursorXYBuilder=$l,e.AutoFitStrategies=Ya,e.AutoFitStrategy=Ua,e.Axis=Ko,e.Axis3D=ya,e.AxisScrollStrategies=zs,e.AxisTickStrategies=Os,e.Band=Ls,e.BarChart=Bf,e.BarChartBar=kf,e.BarChartCategoryAxis=If,e.BarChartSorting=_f,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=Cf,e.BasicSeries=uu,e.BorderedPicture=Fn,e.BoxAndWhiskers=mc,e.BoxFigure=yc,e.BoxSeries=gd,e.BoxSeries3D=Ma,e.Button=eo,e.Chart=Vh,e.Chart3D=Va,e.ChartComponent=Gi,e.ChartMarker=eu,e.ChartMarker2D=class extends eu{constructor(t,e,i,s,r,n){super(t,e,i,s.Fx(t,e,i,n),r,n)}},e.ChartMarkerXY=su,e.ChartWithCursor=Sl,e.ChartWithSeries=Pa,e.ChartXY=Wd,e.Color=M,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return T(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 T(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 T(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?w(t):w((t=>{const e=I[t.toLowerCase()];if(e)return e;throw new Error(`Unknown color code: ${t}`)})(t))}catch(t){}return console.warn(`ColorCSS parsing error: ${t}`),w("#fff")},e.ColorHEX=w,e.ColorHSV=E,e.ColorPalettes=To,e.ColorRGBA=T,e.ColorShadingStyles=_o,e.ConstantLine=Ds,e.CursorBuilder=Qa,e.CursorBuilderXY=Jl,e.CustomTick=Sn,e.CustomizableFigure=fc,e.Dashboard=Vf,e.DashedLine=class extends Vo{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 this.set("thickness",t)}getThickness(){return this.get("thickness")}L(){const t=this.getThickness();return t<0?1:t}setPattern(t){return this.set("pattern",t)}getPattern(){return this.get("pattern")}setPatternScale(t){return this.set("patternScale",t)}getPatternScale(){return this.get("patternScale")}},e.DataGrid=vf,e.DateTimeTickStrategy=Sh,e.EllipseFigure=Jc,e.EllipseSeries=$c,e.EmptyFill=D,e.EmptyPointMarker=kn,e.EmptyUIElement=In,e.Figure=cc,e.FigureSeries=dc,e.FontSettings=tr,e.FormattingFunctions=Ci,e.FunnelChart=Au,e.FunnelChartTypes=Cu,e.FunnelChartWithLabelsInsideSlices=Iu,e.FunnelChartWithLabelsOnSides=Eu,e.FunnelSlice=Su,e.GaugeChart=Fu,e.GaugeChartTypes=Ap,e.GaugeSlice=_u,e.GenericAxis=$s,e.GlowEffect=Xo,e.HeatmapGridSeries=Cd,e.HeatmapGridSeriesIntensityValues=kd,e.HeatmapScrollingGridSeries=Pd,e.HeatmapScrollingGridSeriesIntensityValues=Fd,e.Highlighter=Hi,e.Icon=Ho,e.ImageFill=zo,e.IndividualPointFill=G,e.LUT=_,e.LegendBoxBuilders=vo,e.LineAndPointSeries3D=Aa,e.LineSeries=Gc,e.LineSeries3D=Ta,e.LinearGradientFill=tt,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new tt({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=xl,e.MapRegions=Mp,e.MapRegionsAfrica=fp,e.MapRegionsAsia=gp,e.MapRegionsAustralia=yp,e.MapRegionsCanada=mp,e.MapRegionsEurope=pp,e.MapRegionsNorthAmerica=bp,e.MapRegionsSouthAmerica=vp,e.MapRegionsUSA=xp,e.MapRegionsWorld=Sp,e.MapTypes=ul,e.MarkerBuilders=iS,e.NumericTickStrategy=wh,e.OHLCBar=xc,e.OHLCCandleStick=Sc,e.OHLCFigure=pc,e.OHLCFigures=bc,e.OHLCSeries=ld,e.OHLCSeriesTraditional=ud,e.OHLCSeriesTypes=dd,e.OHLCSeriesWithAutomaticPacking=cd,e.OnScreenMenu=Ed,e.OnScreenMenuAnimationsButton=xs,e.OnScreenMenuButton=cs,e.OnScreenMenuControlBase=Ki,e.OnScreenMenuCustomButton=vs,e.OnScreenMenuOsmToggleButton=Ms,e.OnScreenMenuToggleButton=ds,e.OnScreenMenuZoomInButton=fs,e.OnScreenMenuZoomInXButton=gs,e.OnScreenMenuZoomInYButton=ys,e.OnScreenMenuZoomOutButton=ms,e.OnScreenMenuZoomOutXButton=ps,e.OnScreenMenuZoomOutYButton=Ss,e.OnScreenMenuZoomToFitButton=bs,e.PalettedFill=class extends U{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=Dh,e.PhongShadingStyle=Fo,e.Picture=Pn,e.PieChart=Kh,e.PieChartTypes=ua,e.PieChartWithLabelsInsideSlices=la,e.PieChartWithLabelsOnSides=aa,e.PieSlice=Yh,e.PixelatedPoints3D=ar,e.PointCloudSeries3D=Ca,e.PointLineSeries=wc,e.PointLineSeries3D=wa,e.PointMarkers=rS,e.PointSeries=wd,e.PointSeries3D=Ia,e.PointSeriesTypes3D=ka,e.PointStyle3D=ur,e.PolarAreaSeries=fu,e.PolarAreaSeriesInterior=gu,e.PolarAxis=Ml,e.PolarAxisAmplitude=Tl,e.PolarAxisTick=Al,e.PolarChart=mu,e.PolarHeatmapSeries=Vl,e.PolarLineSeries=Gl,e.PolarPointLineSeries=Hl,e.PolarPointSeries=Ul,e.PolarPolygon=Wl,e.PolarPolygonSeries=du,e.PolarSector=Fl,e.PolarSeries=_l,e.PolygonFigure=Wc,e.PolygonSeries=Xc,e.PyramidChart=Hu,e.PyramidChartTypes=ju,e.PyramidChartWithLabelsInsideSlices=Yu,e.PyramidChartWithLabelsOnSides=Xu,e.PyramidSlice=Ru,e.RadialGauge=Bu,e.RadialGradientFill=K,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new K({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=yd,e.RectangleFigure=Hc,e.RectangleSeries=Uc,e.SegmentFigure=Yc,e.SegmentSeries=jc,e.Series2D=Bl,e.Series3D=va,e.SeriesMarkerXY=ru,e.SeriesXY=nu,e.SimpleFigureSeries=gc,e.SimpleShadingStyle=ko,e.Slice=Wh,e.SliceLabelFormatters=Uh,e.SliceSorters=Hh,e.SolidFill=V,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new V({color:s(t)})},e.SolidGauge=Ou,e.SolidGaugeSlice=Lu,e.SolidLine=$i,e.SpiderAxis=Zu,e.SpiderChart=ac,e.SpiderSeries=tc,e.SplineSeries=Cc,e.StaticCursor2DBuilder=el,e.StaticCursorXYBuilder=ql,e.StepSeries=Nc,e.StipplePatterns=Ro,e.SurfaceGridSeries3D=Da,e.SurfaceScrollingGridSeries3D=za,e.TableContentBuilder=ja,e.Themes=Op,e.Tick=qo,e.TickStyle=ih,e.TimeFormattingFunctions=Ch,e.TimeTickStrategy=Ph,e.TriangulatedPoints3D=nr,e.UIBackgrounds=tS,e.UIButtonPictures=eS,e.UICircle=zn,e.UIColumnGrid=class extends Gn{constructor(){super(...arguments),this.Gc=[]}addColumn(){return this.addElement(Yn,void 0)}getColumn(t,e=!1){return e&&this.Gc.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.Gc[t]}},e.UIDiamond=On,e.UIElementBuilders=bo,e.UIElementColumn=Hn,e.UIElementLine=Nn,e.UIElementRow=Gn,e.UIElementWithBackground=mn,e.UIEmptyBackground=Cn,e.UILabel=_n,e.UILayoutBuilders=Na,e.UILayoutGap=Vn,e.UILegendBoxPanel=Ga,e.UIObject=cn,e.UIOrigins=Ts,e.UIPanel=Oh,e.UIPointer=Rn,e.UIPolygon=Bn,e.UIRectangle=Dn,e.UIRowGrid=Wn,e.VisibleFill=R,e.VisibleTicks=sh,e.ZoomBandChart=$d,e.defaultOsmBackgroundColor=Bs,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=z,e.emptyLine=st,e.emptyPoints3D=sr,e.emptyTick=nh,e.formatLongitudeLatitude=vl,e.isColor=A,e.isCoordinate3D=Ra,e.isCoordinateBarChart=Pf,e.isCoordinateClient=Oi,e.isCoordinatePolar=Pl,e.isCoordinateXY=Vi,e.isDashedLine=No,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),e.isEmptyTick=t=>!(!t||"object"!=typeof t||!("type"in t)||"empty-ticks"!==t.type),e.isFontSettings=er,e.isGlowEffect=t=>!(!t||"object"!=typeof t||!("type"in t)||"glow"!==t.type),e.isIcon=Uo,e.isIndividualPointFill=H,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=et,e.isNumericTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"numeric-ticks"!==t.type),e.isPalettedFill=W,e.isPhongShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"phong"!==t.type),e.isPixelatedPoints3D=lr,e.isRadialGradientFill=Z,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=N,e.isSolidLine=qi,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=or,e.isVisibleTicks=rh,e.lightningChart=(t,e)=>{const i="object"==typeof t?t.license:t,s="object"==typeof t?t.licenseInformation:e,r="object"==typeof t?t:void 0,n=new Km;return n.e=i||"",Qp||(Qp=(t=>{let e,i,s=!1,r=!1,n=!1,o=!1,h="";try{if(jm){const e=(t=>{if(!jm)return;const e=jm.split("-");if(e.length>0)switch(e[0]){case"0001":return"0001";case"0002":return"0002";default:return}})();if("0001"===e){qm=new Uint8Array([2]);const e=(t=>{if(!jm)return;const e=jm.split("-");return 4===e.length?e[1].startsWith("m")?2:1:0})();1===e?(n=!op(jm),s=!0):2===e?(hp(jm,t),r=!0):(Zm=!0,sp(jm),o=!0)}else{if("0002"!==e)throw new Error(Ym(0,0,1,7,1,12,5));{const e=(t=>{if(!jm)return;const e=jm.split("-");return e.length>=2?Uint8Array.from(atob(e[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)Zm=!0,sp(jm),o=!0;else if(189===e)n=!op(jm),s=!0;else{if(159!==e)throw new Error(Ym(0,0,1,7,1,12,5));hp(jm,t),r=!0}}}}else $m=!0}catch(t){t instanceof Error&&(e=t)}try{o&&(i=Xm[Ym(-1,34)][Ym(-1,35)](Ym(-1,39))||void 0)}catch(t){Xm.console.error(t)}let a=!1;if(i){const t=i.split("-");if(2===t.length&&np(t[0],t[1])){const[e,i]=t[0].split(":").map((t=>Number(t)));Date.now()-i<.95*e*1e3&&(a=!0)}}const l=!(e||$m||s||r||a),u=(()=>{const t=new(Xm[Ym(-1,0)]);return t.open(Ym(0,26),Ym(-2,0)),t.setRequestHeader(Ym(-1,24),Ym(-1,25)),t.withCredentials=!0,t})();if(l){let t;try{t=parseInt(jm?jm.split("-")[1]:Math.floor(1e6*Math.random()).toString(),16)}catch(e){t=Math.floor(1e6*Math.random())}const i=Math.floor(1e6*Math.random());h=(t^i).toString();const s={};let r="",n="",o="";jm=jm||"";const a=Ym(-4,0);for(let t=0;t{if(e)throw ap(e.message,t),e;const s={Mn:t=>{const e=`${Ym(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${(t=>{switch(t){case 1:return Ym(0,48,49);case 0:return Ym(0,48,50);case 2:return Ym(0,51);case 3:return Ym(0,52,48);case 4:return Ym(0,53,48);case 5:return Ym(0,54,48);case 6:return Ym(0,55,48);case 7:return Ym(0,56,48);case 8:return Ym(0,57,48);case 9:return Ym(0,58,48)}return Me(0,"")})(t)}`;throw ap(e,r,!1),new Error(e)},...Jm},r=new cm(t,s),o=t=>{if("error"===(null==t?void 0:t.type)&&i){const t=i.split("-");if(2===t.length&&np(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return Zm=!1,void lp(u,!1,a)}}if(u.readyState===Xm[Ym(-1,0)].DONE){if(200!==u.status){let e="";try{e=t&&"loadend"!==t.type?Ym(0,0,1,23,1,32,1,24,5):JSON.parse(u[Ym(-1,23)]).message,lp(u,!1,a)}catch(t){console.error(t)}throw ap(e,r),new Error(Ym(0,0,1,2,1,7,1,12,5)+e)}{const t=JSON.parse(u[Ym(-1,23)]);if(!np(h+Ym(-3,0),t.h)){const t=Ym(0,0,1,27,1,28,1,29,1,30,1,31,5);throw ap(t,r),new Error(t)}Xm[Ym(-1,34)][Ym(-1,36)](Ym(-1,39),t.t),Xm[Ym(-1,34)][Ym(-1,36)](Ym(-1,33),t.s),Zm=!1}}},a=t=>{o(t)};return lp(u,!0,a),l?setTimeout((()=>{if(Zm){let t=!0;if(i){const e=i.split("-");if(2===e.length&&np(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&ap(Ym(0,25,1,23,1,32,1,24,5),r)}}),1e4):lp(u,!1,a),n?(t=>{let e;Zm=!1;const i=t.Ht(),s=()=>{e&&(t.en(e.sn()),e=void 0),e=t.rF("deployment test"),e.Sr(t.ct).Ch(Ym(0,34,1,33)).we({x:i.x/2,y:i.y/2}).ea(50).Ph(13).Me(new V({color:T(128,128,128,100)})).ia("Arial").ra(500).setMouseInteractions(!1),t.Jr().Qr()};t.lo((()=>{s()})),setTimeout(s,0),setInterval((()=>{e&&e.sn()({Dashboard:Vp(t,e,i),ChartXY:Hp(t,e,i),Spider:Up(t,e,i),Polar:Wp(t,e,i),Pie:Xp(t,e,i),UIPanel:Gp(t,e,i),Gauge:Yp(t,e,i),Funnel:jp(t,e,i),Pyramid:Jp(t,e,i),Chart3D:qp(t,e,i),Map:$p(t,e,i),DataGrid:Kp(t,e,i),BarChart:Zp(t,e,i)}))(Qp,n.e,r)},e.onScreenMenuControlBaseHeight=Is,e.onScreenMenuControlBaseWidth=Cs,e.onScreenMenuControlOpacity=ks,e.onScreenMenuDefaultButtonShape=Fs,e.onScreenMenuSpriteURL=Ps,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=Fh,e.synchronizeAxisIntervals=lt,e.translatePoint=at,e.translatePoint3D=(t,e,i)=>{if("axes"===e.id&&"world"===i.id)return e.chart.Fm.GS(t);if("world"===e.id&&"axes"===i.id)return e.chart.Fm.WS(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")},e.transparentFill=ws,e.transparentLine=Es,e.vec3Utils=Ce,e.xDimensionStrategy=Zo,e.yDimensionStrategy=Qo}}]); \ No newline at end of file diff --git a/js/vendor.accf70b827d2d6ced06f.bundle.js b/js/vendor.accf70b827d2d6ced06f.bundle.js deleted file mode 100644 index 06cabe7..0000000 --- a/js/vendor.accf70b827d2d6ced06f.bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendor.accf70b827d2d6ced06f.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,y=e&&e.length,m=y?e[0]*s:t.length,p=i(t,0,m,s,!0),A=[];if(!p||p.next===p.prev)return A;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 x=s;xh&&(h=c),d>a&&(a=d);g=0!==(g=Math.max(h-n,a-o))?32767/g:0}return r(p,A,s,n,o,g,0),A}function i(t,e,i,s,r){var n,o;if(r===E(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)&&(T(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(T(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),T(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,x=u>c?u>f?u:f:c>f?c:f,S=d(y,p,e,i,s),b=d(A,x,e,i,s),v=t.prevZ,M=t.nextZ;v&&v.z>=S&&M&&M.z<=b;){if(v.x>=y&&v.x<=A&&v.y>=p&&v.y<=x&&v!==r&&v!==o&&g(h,u,a,c,l,f,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,M.x>=y&&M.x<=A&&M.y>=p&&M.y<=x&&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(;v&&v.z>=S;){if(v.x>=y&&v.x<=A&&v.y>=p&&v.y<=x&&v!==r&&v!==o&&g(h,u,a,c,l,f,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;M&&M.z<=b;){if(M.x>=y&&M.x<=A&&M.y>=p&&M.y<=x&&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)&&A(n,r,r.next,o)&&b(n,o)&&b(o,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),T(r),T(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=v(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=v(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&&A(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(b(t,e)&&b(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 A(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||!x(t,i,e))||!(0!==n||!x(t,s,e))||!(0!==o||!x(i,t,s))||!(0!==h||!x(i,e,s))}function x(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 b(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 v(t,e){var i=new w(t.i,t.x,t.y),s=new w(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 w(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 T(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 w(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 E(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:()=>w,Iterable:()=>ks,List:()=>ai,Map:()=>_e,OrderedMap:()=>vi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>Xi,Record:()=>ys,Repeat:()=>vs,Seq:()=>Z,Set:()=>Oi,Stack:()=>Ci,default:()=>Cs,fromJS:()=>Ms,get:()=>ae,getIn:()=>$i,has:()=>he,hasIn:()=>qi,hash:()=>pt,is:()=>ft,isAssociative:()=>T,isCollection:()=>x,isImmutable:()=>z,isIndexed:()=>M,isKeyed:()=>b,isList:()=>hi,isMap:()=>ut,isOrdered:()=>P,isOrderedMap:()=>ct,isOrderedSet:()=>Pi,isPlainObject:()=>re,isRecord:()=>L,isSeq:()=>F,isSet:()=>Vi,isStack:()=>ki,isValueObject:()=>dt,merge:()=>Te,mergeDeep:()=>Ee,mergeDeepWith:()=>ke,mergeWith:()=>we,remove:()=>ue,removeIn:()=>me,set:()=>ce,setIn:()=>ge,update:()=>Ae,updateIn:()=>de,version:()=>Es});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 A="@@__IMMUTABLE_ITERABLE__@@";function x(t){return Boolean(t&&t[A])}var S="@@__IMMUTABLE_KEYED__@@";function b(t){return Boolean(t&&t[S])}var v="@@__IMMUTABLE_INDEXED__@@";function M(t){return Boolean(t&&t[v])}function T(t){return b(t)||M(t)}var w=function(t){return x(t)?t:Z(t)},E=function(t){function e(t){return b(t)?t:K(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),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}(w),C=function(t){function e(t){return x(t)&&!T(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w);w.Keyed=E,w.Indexed=k,w.Set=C;var D="@@__IMMUTABLE_SEQ__@@";function F(t){return Boolean(t&&t[D])}var I="@@__IMMUTABLE_RECORD__@@";function L(t){return Boolean(t&&t[I])}function z(t){return x(t)||L(t)}var V="@@__IMMUTABLE_ORDERED__@@";function P(t){return Boolean(t&&t[V])}var R=0,B=1,_=2,O="function"==typeof Symbol&&Symbol.iterator,N="@@iterator",U=O||N,G=function(t){this.next=t};function W(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 Y(){return{value:void 0,done:!0}}function H(t){return!!Array.isArray(t)||!!j(t)}function X(t){return t&&"function"==typeof t.next}function $(t){var e=j(t);return e&&e.call(t)}function j(t){var e=t&&(O&&t[O]||t[N]);if("function"==typeof e)return e}G.prototype.toString=function(){return"[Iterator]"},G.KEYS=R,G.VALUES=B,G.ENTRIES=_,G.prototype.inspect=G.prototype.toSource=function(){return this.toString()},G.prototype[U]=function(){return this};var q=Object.prototype.hasOwnProperty;function J(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 Z=function(t){function e(t){return null==t?nt():z(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 G((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return W(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(w),K=function(t){function e(t){return null==t?nt().toKeyedSeq():x(t)?b(t)?t.toSeq():t.fromEntrySeq():L(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}(Z),Q=function(t){function e(t){return null==t?nt():x(t)?b(t)?t.entrySeq():t.toIndexedSeq():L(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}(Z),tt=function(t){function e(t){return(x(t)&&!T(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}(Z);Z.isSeq=F,Z.Keyed=K,Z.Set=tt,Z.Indexed=Q,Z.prototype[D]=!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 W(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 q.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 W(t,o,i[o])}))},e}(K);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=$(this._collection),s=0;if(X(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=$(this._collection);if(!X(i))return new G(Y);var s=0;return new G((function(){var e=i.next();return e.done?e:W(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 J(t)?new et(t):H(t)?new rt(t):void 0}var lt="@@__IMMUTABLE_MAP__@@";function ut(t){return Boolean(t&&t[lt])}function ct(t){return ut(t)&&P(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 At(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 At(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>Ct?(void 0===(s=It[i=r])&&(s=xt(i),Ft===Dt&&(Ft=0,It={}),Ft++,It[i]=s),s):xt(r);case"object":case"function":return function(t){var e;if(Tt&&void 0!==(e=Mt.get(t)))return e;if(void 0!==(e=t[kt]))return e;if(!bt){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=vt(),Tt)Mt.set(t,e);else{if(void 0!==St&&!1===St(t))throw new Error("Non-extensible objects are not allowed as keys.");if(bt)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=wt[t];return void 0!==e||(e=vt(),wt[t]=e),e}(r);default:if("function"==typeof r.toString)return xt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function At(t){return null===t?1108378658:1108378659}function xt(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:W(e,a-1,e===R?void 0:t.value[1],t)}))},l}function Ut(t,e,i,s){var r=Jt(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(_,n),a=!0,l=0;return new G((function(){var t,n,u;do{if((t=h.next()).done)return s||r===B?t:W(r,l++,r===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===_?t:W(r,n,u,t)}))},r}function Gt(t,e,i){var s=Jt(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 Xt(t,e,i,s){var r=Jt(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=w(t),$(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}:W(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function $t(t,e){return t===e?t:F(t)?e:t.constructor(e)}function jt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function qt(t){return b(t)?E:M(t)?k:C}function Jt(t){return Object.create((b(t)?K:M(t)?Q:tt).prototype)}function Zt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Z.prototype.cacheResult.call(this)}function Kt(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 De(t,e)}function we(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return De(e,i,t)}function Ee(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 De(t,e,function(t){return function e(i,s,r){return ne(i)&&ne(s)&&(n=s,o=Z(i),h=Z(n),M(o)===M(h)&&b(o)===b(h))?De(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function De(t,e,i){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(z(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:E,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=q.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 Le(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Je(),(function(t){return De(t,e)}))}function ze(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Je(),(function(t){return Ce(t,e)}))}function Ve(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Pe(){return this.__ownerID?this:this.__ensureOwner(new l)}function Re(){return this.__ensureOwner()}function Be(){return this.__altered}var _e=function(t){function e(e){return null==e?Je():ut(e)&&!P(e)?e:Je().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 Je().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 Ze(this,t,e)},e.prototype.remove=function(t){return Ze(this,t,h)},e.prototype.deleteAll=function(t){var e=w(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):Je()},e.prototype.sort=function(t){return vi(Wt(this,t))},e.prototype.sortBy=function(t,e){return vi(Wt(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 Xe(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?qe(this.size,this._root,t,this.__hash):0===this.size?Je():(this.__ownerID=t,this.__altered=!1,this)},e}(E);_e.isMap=ut;var Oe=_e.prototype;Oe[lt]=!0,Oe[s]=Oe.remove,Oe.removeAll=Oe.deleteAll,Oe.setIn=ye,Oe.removeIn=Oe.deleteIn=pe,Oe.update=xe,Oe.updateIn=Se,Oe.merge=Oe.concat=be,Oe.mergeWith=ve,Oe.mergeDeep=Fe,Oe.mergeDeepWith=Ie,Oe.mergeIn=Le,Oe.mergeDeepIn=ze,Oe.withMutations=Ve,Oe.wasAltered=Be,Oe.asImmutable=Re,Oe["@@transducer/init"]=Oe.asMutable=Pe,Oe["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Oe["@@transducer/result"]=function(t){return t.asImmutable()};var Ne=function(t,e){this.ownerID=t,this.entries=e};Ne.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 Ye(t,pt(i),[i,s]),n=0;n>>t)&o),h=this.bitmap;return 0==(h&n)?s:this.nodes[ei(h&n-1)].get(t+r,e,i,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 Ge(t,o+1,h)}(t,m,f,c,A);if(g&&!A&&2===m.length&&Qe(m[1^y]))return m[1^y];if(g&&A&&1===m.length&&Qe(A))return A;var x=t&&t===this.ownerID,S=g?A?f:f^d:f|d,b=g?A?ii(m,y,A,x):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=Ke(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 Ye(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=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?xi(t,e).set(0,i):xi(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){xi(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 Ai(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 xi(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;x-=r){var S=g>>>x&o;A=A.array[S]=pi(A.array[S],s)}A.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(b!==y>>>c&o)break;b&&(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)}vi.isOrderedMap=ct,vi.prototype[V]=!0,vi.prototype[s]=vi.prototype.remove;var Ei="@@__IMMUTABLE_STACK__@@";function ki(t){return Boolean(t&&t[Ei])}var Ci=function(t){function e(t){return null==t?Li():ki(t)?t:Li().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):Ii(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):Ii(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):Li()},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):Ii(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ii(this.size,this._head,t,this.__hash):0===this.size?Li():(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,W(t,i++,e)}return{value:void 0,done:!0}}))},e}(k);Ci.isStack=ki;var Di,Fi=Ci.prototype;function Ii(t,e,i,s){var r=Object.create(Fi);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Li(){return Di||(Di=Ii(0))}Fi[Ei]=!0,Fi.shift=Fi.pop,Fi.unshift=Fi.push,Fi.unshiftAll=Fi.pushAll,Fi.withMutations=Ve,Fi.wasAltered=Be,Fi.asImmutable=Re,Fi["@@transducer/init"]=Fi.asMutable=Pe,Fi["@@transducer/step"]=function(t,e){return t.unshift(e)},Fi["@@transducer/result"]=function(t){return t.asImmutable()};var zi="@@__IMMUTABLE_SET__@@";function Vi(t){return Boolean(t&&t[zi])}function Pi(t){return Vi(t)&&P(t)}function Ri(t,e){if(t===e)return!0;if(!x(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||b(t)!==b(e)||M(t)!==M(e)||P(t)!==P(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!T(t);if(P(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 _i(t){if(!t||"object"!=typeof t)return t;if(!x(t)){if(!ne(t))return t;t=Z(t)}if(b(t)){var e={};return t.__iterate((function(t,i){e[i]=_i(t)})),e}var i=[];return t.__iterate((function(t){i.push(_i(t))})),i}var Oi=function(t){function e(e){return null==e?Yi():Vi(e)&&!P(e)?e:Yi().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(E(t).keySeq())},e.intersect=function(t){return(t=w(t).toArray()).length?Ui.intersect.apply(e(t.pop()),t):Yi()},e.union=function(t){return(t=w(t).toArray()).length?Ui.union.apply(e(t.pop()),t):Yi()},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|0)^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 Zi=w.prototype;Zi[A]=!0,Zi[U]=Zi.values,Zi.toJSON=Zi.toArray,Zi.__toStringMapper=oe,Zi.inspect=Zi.toSource=function(){return this.toString()},Zi.chain=Zi.flatMap,Zi.contains=Zi.includes,Bi(E,{flip:function(){return $t(this,Rt(this))},mapEntries:function(t,e){var i=this,s=0;return $t(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return $t(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var Ki=E.prototype;Ki[S]=!0,Ki[U]=Zi.entries,Ki.toJSON=Ji,Ki.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Bi(k,{toKeyedSeq:function(){return new Lt(this,!1)},filter:function(t,e){return $t(this,Ot(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 $t(this,_t(this,!1))},slice:function(t,e){return $t(this,Nt(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 $t(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 $t(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)|0}ts.has=Zi.includes,ts.contains=ts.includes,ts.keys=ts.values,Bi(K,Ki),Bi(Q,Qi),Bi(tt,ts);var ls=function(t){function e(t){return null==t?fs():Pi(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(E(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Oi);ls.isOrderedSet=Pi;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(Ti()))}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},ys=function(t,e){var i;!function(t){if(L(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(z(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 Ts(t,e,i,s,r,n){if("string"!=typeof i&&!z(i)&&(J(i)||H(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,Z(i).map((function(s,n){return Ts(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function ws(t,e){return M(e)?e.toList():b(e)?e.toMap():e.toSet()}var Es="4.3.5",ks=w;const Cs={version:Es,Collection:w,Iterable:w,Seq:Z,Map:_e,OrderedMap:vi,List:ai,Stack:Ci,Set:Oi,OrderedSet:ls,PairSorting:gs,Record:ys,Range:Xi,Repeat:vs,is:ft,fromJS:Ms,hash:pt,isImmutable:z,isCollection:x,isKeyed:b,isIndexed:M,isAssociative:T,isOrdered:P,isValueObject:dt,isPlainObject:re,isSeq:F,isList:hi,isMap:ut,isOrderedMap:ct,isStack:ki,isSet:Vi,isOrderedSet:Pi,isRecord:L,get:ae,getIn:$i,has:he,hasIn:qi,merge:Te,mergeDeep:Ee,mergeWith:we,mergeDeepWith:ke,remove:ue,removeIn:me,set:ce,setIn:ge,update:Ae,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]},y=(t,e)=>({min:t,max:e}),m=(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),A=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),x=A,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}),b=s.Record({type:"color",r:1,g:1,b:1,a:1});class v extends b{constructor(t){super(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.C||(this.C=new v({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.C}getLighter(){return this.T||(this.T=new v({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.T}getDarker(){return this.F||(this.F=new v({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}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),T=(t,e,i,s=255)=>new v({r:t/255,g:e/255,b:i/255,a:s/255}),w=t=>{const e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new v({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 v({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 v({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 v({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}`)}},E=(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 v({r:s,g:r,b:n})},k={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"},C=new v({}),D=T(0,0,0,0),F=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,I=(t,e)=>t.value-e.value,L=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:T(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1}),z=t=>{const{steps:e}=t,i=e.length;e.sort(I);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 V 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,z(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(z({...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 v({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 R extends P{toString(){return"emptyFill"}}const B=new R,_=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),O=s.Record({type:"fillstyle",fillType:"solid",color:T(255,255,255)});class N extends O{}class U extends N{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 G=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType),W=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),Y=s.Record({type:"fillstyle",fillType:"palette",lut:new V({steps:[]}),lookUpProperty:"value"}),H=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),X={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=Qt(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.P)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.L=n,this.eases=t.map((([t,e])=>s(t,e,i)))}R(){this.D.emit("start")}start(){return this.L.includes(this)||this.L.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 $(t,e,i,s,this.L);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.D.on("start",t,e)}onAnimationEnd(t,e){return this.D.on("end",t,e)}onEveryAnimationEnd(t,e){return this.D.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.D.on("allEnd",t,e)}allOffAnimationEnd(){return this.D.topicOff("end"),this}allOffEveryAnimationEnd(){return this.D.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.D.topicOff("allEnd"),this}offAnimationEnd(t){return this.D.off(t,"end")}offEveryAnimationEnd(t){return this.D.off(t,"everyEnd")}offAllAnimationEnd(t){return this.D.off(t,"allEnd")}finish(t=!0){if(this.P=!0,this.L.splice(this.L.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.D.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.D.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.D.emit("end",e),this.D.emit("everyEnd",e)),e}t&&(this.D.emit("end",void 0),this.D.emit("everyEnd",void 0),this.D.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(Mt):this.values.map(Mt)}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.R(),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=St.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=X.linear)=>(r,n,h=t)=>{const a=new $(r,n,h,e,i).start();return s||(s=St.requestAnimationFrame(o)),a}};var q,J;e.GradientShape=void 0,(q=e.GradientShape||(e.GradientShape={})).circle="circle",q.ellipse="ellipse",e.GradientExtent=void 0,(J=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",J.closestCorner="closest-corner",J.farthestSide="farthest-side",J.farthestCorner="farthest-corner";const Z=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class K extends Z{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 Q=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),tt=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],angle:0});class et extends tt{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?fi(t):t)}getAngle(t){return t?di(this.get("angle")):this.get("angle")}}const it=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),st=s.Record({type:"linestyle",lineType:"empty"}),rt=new class extends st{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}V(){return 0}setFillStyle(t){return this}getFillStyle(){return B}},nt=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class ot{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new ht,this.y=new ht,this.z=new ht,this.D=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Ne,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(Ne,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.G(e),s.y.G(r)}}}W(){return this.N&&(this.N(),this.N=void 0),this}U(t){return this.D.on("cell-resize",t)}Y(t){return this.D.off(t,"cell-resize")}}class ht extends a{constructor(){super(...arguments),this.H=0,this.$=10,this.X=1}j(){return this.o=!1,this}Z(){return this.o=!0,this}getInnerStart(){return this.H}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}J(t,e){return this.H=t,this.$=e,this.K(),this}q(t){return this.X=t,this.K(),this}tt(t){return t/this.X}K(){const t=this.tt(this.$-this.H),e=this.X;void 0!==this.it&&!1!==Et(t,this.it)||(this.o=!0,this.st=e,this.it=t)}et(){return this.it}ht(){return this.st}rt(){return this.$new t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).ot({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new ot({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},lt=(t,e,i)=>e===i?t:i.ut(e.ct(t)),ut=(t,e,i)=>{if(e===i)return t;const s=e instanceof Li?e.x:e.x instanceof Li?e.x.x:e.x.dt,r=e instanceof Li?e.y:e.y instanceof Li?e.y.y:e.y.dt,n=i instanceof Li?i.x:i.x instanceof Li?i.x.x:i.x.dt,o=i instanceof Li?i.y:i.y instanceof Li?i.y.y:i.y.dt;return{...t,x:lt(t.x,s,n),y:lt(t.y,r,o)}},ct=(t,e,i)=>{if("axes"===e.id&&"world"===i.id)return e.chart.At.ft(t);if("world"===e.id&&"axes"===i.id)return e.chart.At.yt(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")},dt=(...t)=>{if(0===t.length)return{remove:wt};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.St(s,r,!1,!1,"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 ft extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,ft.prototype)}}class gt extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&St.alert(s),Object.setPrototypeOf(this,gt.prototype)}}class yt extends gt{constructor(t){super(t),Object.setPrototypeOf(this,yt.prototype)}}var mt,pt,At,xt;e.UISpace=void 0,(mt=e.UISpace||(e.UISpace={}))[mt.Content=0]="Content",mt[mt.PaddedContent=1]="PaddedContent",mt[mt.PaddedBackground=2]="PaddedBackground",mt[mt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(pt=e.UIVisibilityModes||(e.UIVisibilityModes={}))[pt.never=0]="never",pt[pt.always=1]="always",pt[pt.whenHovered=2]="whenHovered",pt[pt.whenDragged=3]="whenDragged",pt[pt.whenNotDragged=4]="whenNotDragged",pt[pt.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,(xt=e.UIDirections||(e.UIDirections={}))[xt.Up=0]="Up",xt[xt.Right=1]="Right",xt[xt.Down=2]="Down",xt[xt.Left=3]="Left";const St="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},bt=(t,e)=>t.x===e.x&&t.y===e.y,vt=t=>t!==Ie&&t!==Le&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Mt=t=>t[1],Tt=t=>t.dispose(),wt=()=>{},Et=(t,e)=>t===e,kt=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Ct=t=>Array.prototype.concat.apply([],t),Dt=(t,e)=>void 0!==t?t:e,Ft=t=>t.vt(),It=t=>t.xt(),Lt=t=>t.bt(),zt=t=>t.Mt(),Vt=t=>t.min.x,Pt=t=>t.max.x,Rt=t=>t.min.y,Bt=t=>t.max.y,_t=(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,Nt=u(0,1),Ut=u(1,0),Gt=u(0,-1),Wt=u(-1,0),Yt=u(0,0),Ht=t=>{switch(t){case e.UIDirections.Up:return Nt;case e.UIDirections.Right:return Ut;case e.UIDirections.Down:return Gt;case e.UIDirections.Left:return Wt;default:return Yt}},Xt=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,$t=t=>{t.stopPropagation(),t.preventDefault()},jt=(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)},Kt=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},te=Qt(Math.E),ee=(t,e)=>{const i=e[t];return i?i():void 0},ie=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;igi(ni(t,i))-gi(ni(e,i))))},se=(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:T(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())),ne=t=>255===t.getA()?t:t.setA(255),oe=(()=>{const t=T(0,0,0);return i=>(i=ne(i),new K({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:re(i,t,.5)}]}))})(),he=(()=>{const t=t=>{var e;if(t){if(G(t)){if(0===t.getColor().getA())return;return t.getColor()}if(Q(t)||it(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)=>{const n=[];if(r.fill&&n.push(r.fill),r.fill2&&n.push(r.fill2),r.stroke){const t=r.stroke.getFillStyle();t!==B&&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()?oe(h):(h=ne(h),a=ne(a),new et({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 U({color:e}):oe(e):i.uiButtonFillStyle}var h,a;e.setButtonOnFillStyle(o)}})(),ae=t=>{const e=t;if(H(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},le=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},ue=(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,de=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),fe=(t,e)=>e(),ge=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new U({color:T(255,255,255,1)});const ye=t=>t===ze||t.min.x===ze.min.x&&t.max.x===ze.max.x&&t.min.y===ze.min.y&&t.max.y===ze.max.y,me=t=>Array.from(new Set(t)),pe=t=>t.filter((t=>void 0!==t)),Ae=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,xe=(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))))))},Se=(t,e)=>{throw new Error(e)},be=()=>{const t=j((()=>{}));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)||X.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)}},ve=t=>{let e;return()=>e||(e=t(),e)},Me=t=>{if(t===rt)return 0;const e=t.getThickness();return e<0?1:1*e},Te=(t,e,i,s)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please find the FAQ from API documentation at below link:\nhttps://lightningchart.com/js-charts/api-documentation/\nand read section "What is LightningChart JS Resources not found error?"`;if(s.shouldCrash)throw St.alert(r),new Error(r);St.console.warn(r)},we=(t,e,i,s=0)=>{if(t{const t=new Map;return{_t:e=>(e.setMouseEnterEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.wt(e,i,s)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ct(e,i,s)})),e.setMouseClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.kt(e,i,s)})),e.setMouseDoubleClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Tt(e,i,s)})),e.setMouseDownEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ft(e,i,s)})),e.setMouseUpEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.It(e,i,s)})),e.setMouseMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Pt(e,i,s)})),e.setMouseDragEventHandler(((e,i,s,r,n,o)=>{const h=o&&t.get(o);h&&h.Dt(e,i,s,r,n,o)})),e.setMouseDragStartEventHandler(((e,i,s,r)=>{const n=r&&t.get(r);n&&n.Bt(e,i,s,r)})),e.setMouseDragStopEventHandler(((e,i,s,r,n)=>{const o=n&&t.get(n);o&&o.Lt(e,i,s,r,n)})),e.setMouseWheelEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Rt(e,i,s)})),e.setTouchStartEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Et(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.zt(e,i,s)})),e),Ot:(e,i)=>{t.set(e,i)},Nt:()=>{t.clear()}}},ke={left:0,right:0,top:0,bottom:0},Ce=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),De=(t,e,i)=>{e&&e.Gt();const s=i();return{Wt:t,Gt:()=>{s.forEach((e=>t.Ut(e)))}}},Fe={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=>Fe.divide(t,Fe.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(Fe.dot(t,e)/(Fe.length(t)*Fe.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=Fe.dot(e,t),o=Fe.cross(e,t);return Fe.addVec(Fe.multiply(t,s),Fe.addVec(Fe.multiply(e,(1-s)*n),Fe.multiply(o,r)))},lerp:(t,e,i)=>(i=kt(i,0,1),Fe.addVec(Fe.multiply(t,1-i),Fe.multiply(e,i))),equals:(t,e)=>Et(t.x,e.x)&&Et(t.y,e.y)&&Et(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)})},Ie=Number.MAX_SAFE_INTEGER,Le=-Number.MAX_SAFE_INTEGER,ze=y(u(Ie,Ie),u(Le,Le)),Ve=y(f(Ie,Ie,Ie),f(Le,Le,Le)),Pe=(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))},Re=(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),_e=(t,e)=>y(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,Ue=(t,e,i)=>{const s=ni(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=ni(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)},Ge=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,We=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},Ye=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},He=(t,e,i)=>ri(t,si(ni(e,t),i)),Xe=(t,e,i)=>Fe.addVec(t,Fe.multiply(Fe.subtractVec(e,t),i));function $e(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:Ie,y:Ie},max:{x:Le,y:Le}};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},Je=(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 Ze(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 Ke(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 Qe(t,e){return u(t.x-e.x,t.y-e.y)}function ti(t){const e=ii(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function ei(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=ti(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 ii(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function si(t,e){return u(t.x*e,t.y*e)}function ri(t,e){return u(t.x+e.x,t.y+e.y)}function ni(t,e){return u(t.x-e.x,t.y-e.y)}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){return si(t,-1)}function li(t,e){return t.x*e.x+t.y*e.y}const ui=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},ci=(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 di(t){return t*Math.PI/180}function fi(t){return 180*t/Math.PI}function gi(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function yi(t){return u(Math.cos(t),Math.sin(t))}function mi(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 pi=(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 xi{constructor(){this.Yt=!0}getInnerStart(){return this.H}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.$-this.H)}J(t,e){return this.Yt=t!==this.H||e!==this.$,this.H=t,this.$=e,this}j(){return this.Yt=!1,this}Z(){return this.Yt=!0,this}}class Si extends xi{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.O(this.ti.bind(this));this.ti(s._()),this.ii=()=>s.G(t)}}q(t){return this.X=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.X+this.Xt[0]}hi(){return(this.Zt+this.Qt)/this.Jt*this.X-this.Xt[1]}ri(){return this.getCellSize()-this.ni()}oi(){return this.X}getCellSize(){return this.ai(this.X)}ni(){return this.Xt[0]+this.Xt[1]}li(){return this.Xt}ti(t){this.Jt=t.reduce(Ne,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&&iwi;return!n&&!o||!!r&&(e>t?{start:n?Ti:t,end:o?wi:e}:{start:o?wi:t,end:n?Ti:e})}ct(t){const e=this.ei(),i=this.hi(),s=Math.max(t,Ti);return e+(this.ci.function(s)-this.di.scaleStartLog)/this.di.scaleIntervalLog*(i-e)}ut(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()}J(t,e){return super.J(t,e),this.ci&&this.fi(),this}si(t){return super.si(t),this.ci&&this.fi(),this}q(t){return super.q(t),this.ci&&this.fi(),this}Ai(t){return this.ci={internal:t,function:vi(t),number:Mi(t)},this}gi(){return this.ci.internal}pi(t,e){const i=this.ct(t)+e;return this.ut(i)}mi(){return this.$t||this.Yt||this.jt||this.Ht}fi(){const t=this.ci.function(this.H),e=this.ci.function(this.$)-t,i=2*this.ei()/this.X-1,s=2*this.hi()/this.X-1-i;return this.di={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.di}yi(){return this.di}}const vi=t=>"e"===t?te:Qt(t),Mi=t=>"e"===t?Math.E:t,Ti=.9*10**-4,wi=1.1*10**25,Ei=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],ki=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Pe(s,10),0);return t.toFixed(r)},Ci={Numeric:(t,e)=>ki(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 Ei){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=Pe(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-Pe(i,10)):"")}return r+=n,r},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const r=vi(s)(t);return`${s}${Di(r)}`},LogarithmicExponents:(t,e,i,s=10)=>{const r=vi(s),n=Math.floor(r(t)),o=t/Mi(s)**n;return`${Math.round(o)}×${s}${Di(n)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const r=vi(s),n=Math.floor(r(t));return`${(t/Mi(s)**n).toFixed(2)}×${s}${Di(n)}`},LogarithmicNoExponents:(t,e,i,s=10)=>{const r=vi(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))}},Di=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 Fi extends Si{constructor(t,e,i,s){super(t,e,i,s),this.Si=!1,this.vi=!1,this.xi=0,this.X=1e3,this.J(0,10),this.K()}mi(){return this.vi}nt(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.Si){const i=((t,e,i)=>{const s=((t,e)=>{if(eLe&&tLe){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.K()}ct(t){return this.ei()+(t-this.H)/(this.$-this.H)*(this.hi()-this.ei())}ut(t){return this.H+(t-this.ei())/(this.hi()-this.ei())*(this.$-this.H)}J(t,e){return super.J(t,e),this.K(),this}si(t){return super.si(t),this.K(),this}q(t){return super.q(t),this.bi=Ii(this.$-this.H,this.Xt,this.X,this.Qt,this.Jt),this.K(),this}Mi(){return this.Si=!0,this}_i(){return this.Si}wi(){return Math.abs(this.Ci)}ki(){return this.wi()/this.bi}Ti(){return this.Fi}Ii(){return this.Pi}getPixelSize(){return this.bi}yi(){return this.di}Z(){return super.Z(),this.vi=!0,this}j(){return super.j(),this.vi=!1,this}Di(t,e=Ci.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 Ii(t,this.Xt,this.X,this.Qt,this.Jt)}K(){let t=this.H,e=this.$,i=0;this.Si&&(t=0,e=this.$-this.H,i=this.H);const s=e-t,r=Ii(s,this.Xt,this.X,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.vi=!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.X-1,f=2*this.hi()/this.X-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 Ii=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Li{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}Z(){return this.x.Z(),this.y.Z(),this}q(t,e){return"object"==typeof t?(this.x.q(t.x),this.y.q(t.y)):(this.x.q(t),this.y.q(e)),this}oi(){return u(this.x.oi(),this.y.oi())}Ei(t){return this.x.si(t),this}Vi(t){return this.y.si(t),this}ni(){return u(this.x.ni(),this.y.ni())}zi(t,e){return this.x.J(t,e),this}Oi(t,e){return this.y.J(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.mi()||this.y.mi()}}class zi extends Li{constructor(){super(...arguments),this.Gi="LinearScaleXY"}ot(t,e,i,s){return this.x=new Fi(t.x,e.x,i.x,s?s.x:void 0),this.y=new Fi(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())}yi(){return{x:this.x.yi(),y:this.y.yi()}}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=ei(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 Vi extends Li{constructor(){super(...arguments),this.Gi="MixedScaleXY"}_i(){return!1}pi(t,e){const i=this.x.ct(t.x),s=this.y.ct(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.ut(r.x),y:this.y.ut(r.y)}}Ui(t,e,i,s){const r={x:this.x.ct(t.x),y:this.y.ct(t.y)},n={x:this.x.ct(e.x),y:this.y.ct(e.y)},o=ti(ni(n,r)),h=ei(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.ut(a.x),y:this.y.ut(a.y)}}yi(){const t=this.x.yi(),e=this.y.yi();return{uScaleStart:[this.x.H,this.y.H],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 Pi=(t,e)=>t instanceof bi||e instanceof bi?(new Vi).Ri(t,e):(new zi).Ri(t,e),Ri=t=>"client"===t,Bi=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),_i=t=>"relative"===t,Oi=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y);var Ni;e.HighlightModes=void 0,(Ni=e.HighlightModes||(e.HighlightModes={}))[Ni.noHighlighting=0]="noHighlighting",Ni[Ni.onHover=1]="onHover";class Ui{constructor(t,i,s,n){this.Yi=!0,this.Hi=e.HighlightModes.onHover,this.$i=!1,this.Xi=!0,this.ji=!1,this.D=new r.Eventer,this.Zi=[],this.Qi=[],this.onMouseEnter=t=>this.D.on("mouseEnter",t),this.onMouseLeave=t=>this.D.on("mouseLeave",t),this.onMouseClick=t=>this.D.on("mouseClick",t),this.onMouseDoubleClick=t=>this.D.on("mouseDoubleClick",t),this.onMouseDown=t=>this.D.on("mouseDown",t),this.onMouseUp=t=>this.D.on("mouseUp",t),this.onMouseMove=t=>this.D.on("mouseMove",t),this.offMouseEnter=t=>this.D.off(t,"mouseEnter"),this.offMouseLeave=t=>this.D.off(t,"mouseLeave"),this.offMouseClick=t=>this.D.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.D.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.D.off(t,"mouseDown"),this.offMouseUp=t=>this.D.off(t,"mouseUp"),this.offMouseMove=t=>this.D.off(t,"mouseMove"),this.offMouseDragStart=t=>this.D.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.D.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.D.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.D.off(t,"mouseWheel"),this.wt=(t,i,s)=>{this.D.emit("mouseEnter",this,i),this.ji=!0,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Ct=(t,i,s)=>{this.D.emit("mouseLeave",this,i),this.ji=!1,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Pt=(t,e,i)=>{this.D.emit("mouseMove",this,e)},this.kt=(t,e,i)=>this.D.emit("mouseClick",this,e),this.Tt=(t,e,i)=>this.D.emit("mouseDoubleClick",this,e),this.Ft=(t,e,i)=>this.D.emit("mouseDown",this,e),this.It=(t,e,i)=>this.D.emit("mouseUp",this,e),this.Bt=(t,e,i,s)=>{this.D.emit("mouseDragStart",this,e,i)},this.Dt=(t,e,i,s,r,n)=>{this.D.emit("mouseDrag",this,e,i,s,r)},this.Lt=(t,e,i,s,r)=>{this.D.emit("mouseDragStop",this,e,i,s)},this.Rt=(t,e,i)=>{this.D.emit("mouseWheel",this,e)},this.Et=(t,i,s)=>{this.D.emit("touchStart",this,i),this.ji=!0,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Vt=(t,e,i)=>{this.D.emit("touchMove",this,e)},this.zt=(t,i,s)=>{this.D.emit("touchEnd",this,i),this.ji=!1,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Ji=t,this.Ki=i,this.qi=s,this.ts=new Map,this.ss=n,this.es=this.ss.hs(this,{rs:{themeEffectEnabled:this.qi.effectsText},ns:{}}),this.Ji.us.ls.os(this,(t=>{this.ts.forEach(((e,i)=>i.cs(t))),this.Qi.forEach((e=>e.setHighlight(t))),this.Zi.forEach((e=>e.cs(t)))}),{animationEnabled:this.Ji.getAnimationsEnabled()})}ds(t){const e=t(this.Ji.fs);e&&this.Ji.us.As(e)}gs(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.ts.set(t,{isText:s});const r=Array.from(this.ts);this.es.rs.ps(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.es.ns.ps(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Yi).setVisible(this.Xi).cs(this.Ji.us.ls.ys(this,!0)),i&&t.setMouseEnterEventHandler(this.wt).setMouseLeaveEventHandler(this.Ct).setMouseClickEventHandler(this.kt).setMouseDoubleClickEventHandler(this.Tt).setMouseDownEventHandler(this.Ft).setMouseUpEventHandler(this.It).setMouseMoveEventHandler(this.Pt).setMouseDragStartEventHandler(this.Bt).setMouseDragEventHandler(this.Dt).setMouseDragStopEventHandler(this.Lt).setMouseWheelEventHandler(this.Rt).setTouchStartEventHandler(this.Et).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.zt);const n=t.onDispose((()=>{t.offDispose(n),this.ts.delete(t)}))}Ss(t){this.Zi=t;const e=this.Ji.us.ls.ys(this,!0);t.forEach((t=>{t.cs(e).vs(this.Xi)}))}setEffect(t){return this.es.rs.xs(t&&this.qi.effectsText),this.es.ns.xs(t),this.Ji.us.bs(),this}getEffect(){return this.es.rs.Ms()||this.es.ns.Ms()}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}setName(t){return this._s=t,this.Qi.forEach((t=>t.setText(this._s))),this}getName(){return this._s}dispose(){return this.$i||(this.$i=!0,this.ts.forEach(((t,e)=>e.dispose())),this.Ki(this),this.Qi.forEach((t=>{t.dispose()})),this.Qi.length=0,this.D.emit("dispose",this),this.Ji.us.bs()),this}setVisible(t){return t===this.Xi||(this.Xi=t,this.ts.forEach(((e,i)=>i.setVisible(t))),this.Zi.forEach((e=>e.vs(t))),this.Qi.forEach((e=>e.setOn(t))),this.D.emit("visibleStateChanged",this,this.Xi),this.Ji.us.bs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}setHighlight(t){return this.Ji.us.ls.ws(this,t),this.D.emit("highlight",this,t),this}getHighlight(){return this.Ji.us.ls.ys(this)}setAnimationHighlight(t){return this.Ji.us.ls.Cs(this,t),this}getAnimationHighlight(){return this.Ji.us.ls.ks(this)}setMouseInteractions(t){return this.Yi=t,this.ts.forEach(((e,i)=>i.setMouseInteractions(t))),this.Ji.us.bs(),this}getMouseInteractions(){return this.Yi}getIsUnderMouse(){return this.ji}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 xe(t,[this],{toggleVisibilityOnClick:e,label:this._s,style:void 0}),this.Qi.push(t),t.onDispose((()=>{const e=this.Qi.indexOf(t);e>=0&&this.Qi.splice(e,1)})),this}onMouseDragStart(t){return this.D.on("mouseDragStart",t)}onMouseDrag(t){return this.D.on("mouseDrag",t)}onMouseDragStop(t){return this.D.on("mouseDragStop",t)}onMouseWheel(t){return this.D.on("mouseWheel",t)}onTouchStart(t){return this.D.on("touchStart",t)}onTouchMove(t){return this.D.on("touchMove",t)}onTouchEnd(t){return this.D.on("touchEnd",t)}onDispose(t){return this.D.on("dispose",t)}offTouchStart(t){return this.D.off(t,"touchStart")}offTouchMove(t){return this.D.off(t,"touchMove")}offTouchEnd(t){return this.D.off(t,"touchEnd")}offDispose(t){return this.D.off(t,"dispose")}}class Gi extends Ui{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Ts=t,this.axis=s,this.dt=r,this.Fs=n,this.Is()}}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.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)}}},Xi=class{constructor(t,e,i,s=1,r=100){this.Vs=t,this.zs=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=Wi(t);let s=0;for(let r=0;r!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class Zi{constructor(t,e){this.Xs=t,this.js=e,this.Zs=e.rows*ks,this.Qs=e.columns*Cs}}var Ki,Qi;e.OnScreenMenuButtonType=void 0,(Ki=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[Ki.ZoomIn=0]="ZoomIn",Ki[Ki.ZoomInX=1]="ZoomInX",Ki[Ki.ZoomInY=2]="ZoomInY",Ki[Ki.ZoomOut=3]="ZoomOut",Ki[Ki.ZoomOutX=4]="ZoomOutX",Ki[Ki.ZoomOutY=5]="ZoomOutY",Ki[Ki.ZoomToFit=6]="ZoomToFit",Ki[Ki.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(Qi=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[Qi.Circle=0]="Circle",Qi[Qi.Rectangle=1]="Rectangle",Qi[Qi.RoundedRectangle=2]="RoundedRectangle";const ts={x:-43,y:0},es={x:-65,y:0},is={x:-86,y:0},ss={x:-107,y:-1},rs={x:-128,y:-3},ns={x:-150,y:0},os={x:-171,y:0},hs={x:-276,y:0},as={x:-298,y:0},ls={x:0,y:0},us={x:-21,y:0};class cs extends Zi{constructor(t,e,i,s){super(t,i),this.Js=St.document.createElement("button"),this.Ks=St.document.createElement("div"),this.qs=St.document.createElement("label"),this.js=i,this.te=e,this.Ji=s}ie(t,e,i,s){this.se(t,s),this.ee(),this.he(e),this.re(),this.qs.textContent=i||"";const r=St.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||Ds,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}/${Fs})`,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 ds extends cs{constructor(t,e,i,s){super(t,e,i,s),this.le="",this.ue="",this.ce=!1,this.Ji=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}/${Fs})`,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 fs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ts)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:-1,y:-1})}}class gs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ss)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:-1,y:0})}}class ys extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ns)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:0,y:-1})}}class ms extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),es)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:1,y:1})}}class ps extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),rs)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:1,y:0})}}class As extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),os)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:0,y:1})}}class xs extends ds{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.le=hs,this.ue=as,this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),this.le)}onToggledStateAction(){this.Ji.setAnimationsEnabled(!1)}onInitialStateAction(){this.Ji.setAnimationsEnabled(!0)}}class Ss extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),is)}onClick(){this.Ji.forEachAxis((t=>{t.fit(!0)}))}}class bs extends cs{constructor(t,e,i){super(t,e.shape||Is,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.Ji)}}class vs extends ds{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.Ji=i,this.Se=s,this.le=us,this.ue=ls,this.ie(Ls,this.le)}ge(){this.pe(this.le),this.Js.style.backgroundColor=Ls,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 Ms;e.MouseStyles=void 0,(Ms=e.MouseStyles||(e.MouseStyles={})).Move="move",Ms.ResizeColumn="col-resize",Ms.ResizeRow="row-resize",Ms.Horizontal="ew-resize",Ms.Vertical="ns-resize",Ms.NorthWest="nw-resize",Ms.NorthEast="ne-resize",Ms.Copy="copy",Ms.CrossHair="crosshair",Ms.Default="default",Ms.Help="help",Ms.Restricted="not-allowed",Ms.None="none",Ms.Point="pointer",Ms.Text="text",Ms.Wait="wait",Ms.ZoomIn="zoom-in",Ms.ZoomOut="zoom-out";const Ts={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)},ws=new U({color:T(255,255,255,0)}),Es=new qi({thickness:1,fillStyle:ws}),ks=60,Cs=60,Ds="1.0",Fs="osm/osm-sprite-transparent.png",Is=e.OnScreenMenuButtonShape.Circle,Ls="#363636";var zs;e.OSMPosition=void 0,(zs=e.OSMPosition||(e.OSMPosition={}))[zs.TopRight=0]="TopRight",zs[zs.TopLeft=1]="TopLeft",zs[zs.BottomLeft=2]="BottomLeft",zs[zs.BottomRight=3]="BottomRight";class Vs extends Gi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this._s="Band",this.ve=0,this.xe=0,this.be=this.qi.bandFillStyle,this.Me=this.qi.bandStrokeStyle,this._e=!0,this.we=this.Ts.Te(this.dt).ke(this.be).Ce(this.Me).cs(this.getHighlight()),this.gs(this.we)}setValueStart(t){return this.ve=t,this.D.emit("valueChange",this,this.ve,this.xe),this.Ts.bs(),this}getValueStart(){return this.ve}setValueEnd(t){return this.xe=t,this.D.emit("valueChange",this,this.ve,this.xe),this.Ts.bs(),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.bs(),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.bs(),this}getStrokeStyle(){return this.Me}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}Fe(){return this.we.Ie(this.Fs.toVec2(this.ve,this.Fs.getHeight(this.dt).getInnerStart())).q(this.Fs.toVec2(this.xe-this.ve,this.Fs.getHeight(this.dt).getInnerInterval())),this}attach(t,e=!0,i=!1){return super.attach(t,e),he(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}Pe(t,e){t.cs(e),this.Ts.bs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){let t,i;const s=(e,s)=>{if(!this._e)return;const r=ut(this.Ts.us.De(s.x,s.y),this.Ts.us.dt,this.dt),n=this.Fs.getWidth(r),o=this.axis.dt.ct(this.ve),h=this.axis.dt.ct(this.xe),a=(this.axis.dt.ct(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.dt.pi(this.ve,h),this.xe=this.axis.dt.pi(this.xe,h)):i?this.ve=this.axis.dt.pi(this.ve,h):this.xe=this.axis.dt.pi(this.xe,h),$t(o),this.D.emit("valueChange",this,this.ve,this.xe),this.Ts.bs()};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.Ji.engine.setMouseStyle(n,this.Be)})),this.onMouseLeave((()=>{this._e&&(this.Ji.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=Yi(new Xi(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Ps extends Gi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this._s="Constant Line",this.S=0,this.Me=this.qi.constantLineStrokeStyle,this.Le=!0,this._e=!0,this.Re=this.Ts.Ve(this.dt).Ee(this.Me).cs(this.getHighlight()),this.gs(this.Re)}setValue(t){return this.S=t,this.D.emit("valueChange",this,this.S),this.Ts.bs(),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.bs(),this}getStrokeStyle(){return this.Me}setInteractionMoveByDragging(t){return this.Le=t,this}getInteractionMoveByDragging(){return this.Le}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}Fe(){return this.Re.Oe(this.Fs.toVec2(this.S,this.Fs.getHeight(this.dt).getInnerStart())).ze(this.Fs.toVec2(this.S,this.Fs.getHeight(this.dt).getInnerEnd())),this}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{stroke:this.Me}),this}Pe(t,e){t.cs(e),this.Ts.bs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){const t=(t,e)=>{this._e&&this.Le&&(this.S=this.axis.dt.pi(this.S,this.Fs.getWidth(e)),this.D.emit("valueChange",this,this.S),this.Ts.bs(),$t(t))};this.onMouseMove((()=>{if(this._e&&this.Le){const t=this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ji.engine.setMouseStyle(t,this.Be)}})),this.onMouseLeave((()=>{this._e&&this.Le&&(this.Ji.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=Yi(new Xi(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const Rs={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?Rs.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Rs.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?Rs.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Ne,Os=t=>void 0!==t.Ge,Ns={We:Ci.Numeric},Us=(t,e)=>[t,e],Gs=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{Et(t,0)&&(t=0),Et(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},Hs=(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)}},Xs=(...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=(t,e)=>{if(e.has(t))return e.get(t);const i=$e(t.Ye.Ue());return e.set(t,i),i},js=t=>{const e=new Map;if(t!==Ns){for(const i of t.He)e.set(i,new Map);for(const i of t.$e)e.set(i,new Map)}return e};class qs{constructor(t,e,i,s,n,o,h){this.D=new r.Eventer,this.Xe=Ns,this.je=Bs.Empty,this.Ze=new Map,this.Qe=new Map,this.Je=Rs.fitting,this.Ke=!0,this.qe=j((()=>this.chart.us.bs()))(300,X.linear),this.th=!0,this.Xi=!0,this.ih=!1,this.sh=Le,this.eh=!1,this.hh=!1,this.rh=Le,this.oh=Le,this.ah=Le,this.lh=!1,this.uh=()=>{this.ih||void 0===this.Je||this.chart.us.bs(!0)},this.dh={},this.fh=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.Ze.get(e),l=(t?t.get(a):void 0)||this.Ah(a,e);l.gh=!1;const u=this.ph(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.mh=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.Sh!==i||!!t.find((t=>t===e)))).map((t=>Re(e,$s(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=>_s(t.Sh)))&&(t=!1),t&&i.xh&&i.xh.bh&&!1===i.xh.bh(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.Xe.We(t,this.dt),this.chart=t,this.Mh=e,this.qi=s,this._h=o,this.dt=i,this.wh=h,"logarithmic"===h.type&&this.setAnimationZoom(X.logarithmic(Mi(h.base))),this.Ch=o.numeric,this.kh("Numeric"),this.Th=i.getInnerStart(),this.Fh=i.getInnerEnd(),this.setAnimationsEnabled(n)}setDefaultInterval(t,e){return this.Ih=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.lh=!0,this.chart.us.bs()),this}getDefaultInterval(){return this.Ih}getTitle(){return this.Dh.Ph()}setTitle(t){return this.Dh.Bh(t),this.chart.us.bs(),this}getTitleFillStyle(){return this.Dh.Lh()}setIntervalRestrictions(t){return this.Rh=t,this.chart.us.bs(),this}getIntervalRestrictions(){return this.Rh}setTitleFillStyle(t){return this.Dh.ke(t),this.chart.us.bs(),this}getTitleFont(){return this.Dh.Eh()}setTitleFont(t){return this.Dh.Vh(t),this.chart.us.bs(),this}setTitleRotation(t){return this.Dh.zh(t),this.chart.us.bs(),this}getTitleRotation(){return this.Dh.Oh()}setTitleEffect(t){return this.Nh.xs(t),this.chart.us.bs(),this}getTitleEffect(){return this.Nh.Ms()}kh(t,e){if(this.Ze.size>0&&this.Gh(),"Empty"===t)this.Xe=Ns,this.je=t;else if("Numeric"===t){"Numeric"!==this.je&&(this.Ch=this._h.numeric);const i=e||(t=>t);this.Ch=i(this.Ch),this.Xe=this.Ch.Wh(this.wh),this.je=t}else if("DateTime"===t){"DateTime"!==this.je&&(this.Ch=this._h.datetime);const i=e||(t=>t);this.Ch=i(this.Ch),this.Xe=this.Ch.Wh(this.wh),this.je=t}else if("Time"===t){"Time"!==this.je&&(this.Ch=this._h.time);const i=e||(t=>t);this.Ch=i(this.Ch),this.Xe=this.Ch.Wh(this.wh),this.je=t}return this.Qe.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Qe=js(this.Xe),this.chart.us.bs(),this}Uh(){return this.Xe}Yh(t){this.Xe=t,this.Qe.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Qe=js(this.Xe),this.chart.us.bs()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.St(void 0!==e?e:this.Th,void 0!==i?i:this.Fh,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}St(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.Fh-this.Th),void 0!==this.Xe.Hh&&this.Xe.Hh>h){const i=(e+t)/2,s=this.Xe.Hh/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.Xe.$h&&this.Xe.$he?-1:1);n={start:i-s,end:i+s}}const a=this.dt.nt(n.start,n.end,this.Th,this.Fh,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 Se(0,""),this}if(this.Xh&&this.Xh.finishAll(!1),this.qe&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.Xh||this.Xh.isOver()?this.qe:this.Xh.NextAnimation.bind(this);this.Xh=e([[this.Th,n.start],[this.Fh,n.end]],(([t,e])=>{this.jh(t,e,o)}),t),this.Xh.onAnimationEnd((()=>{this.Xh=void 0,l&&(this.ah=St.performance.now())})),this.Xh.onAnimationEnd((()=>this.setStopped(s)))}else this.jh(n.start,n.end,o),this.setStopped(s),l&&(this.ah=St.performance.now());return this}getInterval(){return{start:this.Th,end:this.Fh}}setStopped(t){return t===this.ih||(t&&(this.Xh&&this.Xh.finishAll(!1),this.Xh=void 0),this.ih=t,this.D.emit("stoppedStateChanged",this,this.ih),this.sh=St.performance.now(),this.chart.us.bs()),this}getStopped(){return this.ih}onStoppedStateChanged(t){return this.D.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.D.off(t,"stoppedStateChanged")}fit(t,e){const i=this.Zh(),s=this.Ih||tr,r="function"==typeof s?s({curStart:this.Th,curEnd:this.Fh,dataMin:null==i?void 0:i.min,dataMax:null==i?void 0:i.max}):s;return this.St(void 0!==r.start?r.start:this.Th,void 0!==r.end?r.end:this.Fh,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.Je=t,this.chart.us.bs(),this}getScrollStrategy(){return this.Je}setAnimationScroll(t){return this.Ke=Boolean(t),this.chart.us.bs(),this}setAnimationZoom(t,e=300){return this.Xh&&(this.Xh.finishAll(!1),this.Xh=void 0),this.qe=t?j((()=>this.chart.us.bs()))(e,t):void 0,this}setAnimationsEnabled(t){return this.th=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(X.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.th}setVisible(t){const e=this.Xi!==t;return this.Xi=t,this.Dh.setVisible(t),this.Qh((e=>{e.Ye.setVisible(t)})),e&&this.D.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onIntervalChange(t){return this.D.on("scaleChange",t)}offIntervalChange(t){return this.D.off(t,"scaleChange")}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}Jh(t,e){const i=new Map;if(this.Xe===Ns||!this.Xi)return this.Gh(),i;e=e||new Map;const s=this.Kh(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.dh.physicalAxisSize=h;const a=Zs(this.Xe,r,n,this.Th,this.Fh,h),l=[];if(this.qh(),l.push(...this.tr(this.Xe,r,n,a,e,t,i)),this.ir(this.Xe,r,n,a,e,t,l,i),this.sr(),a)for(const[t,e]of this.Qe){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.dh.min=r,this.dh.max=n,this.dh.scaleInterval=o,this.dh.physicalAxisSize=h,i}er(t){const e=t.Sh.hr;t.Ye.Bh(e(t.S,this.dt)).Ds()}rr(t,e){const i=e.nr;t.Ye.ke(i.getLabelFillStyle()).Vh(i.getLabelFont()).zh(i.getLabelRotation())}Ah(t,e){const i=this.Qe.get(e);let s=i.get(t);s?(i.delete(t),s.Sh=e,s.vs(!0)):s=this.ar(t,e);const r=this.Ze.get(e)||new Map;return r.set(t,s),this.Ze.set(e,r),this.rr(s,e),s}ph(t,e){const i=this.lr(t,e);return this.er(t),i}tr(t,e,i,s,r,n,o){const h=[];for(const a of t.He){const t=s.get(a);for(const s of t){if(si)continue;const t=this.Ze.get(a),l=(t?t.get(s):void 0)||this.Ah(s,a),u=this.ph(l,n),c=$s(l,r);h.find((t=>Re(c,$s(t,r))))&&l.Ye.setVisible(!1),l.gh=!1,o.set(l,u),h.push(l)}}return h}ir(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.$e){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.xh){p=!1;break}const t=u.xh.ur;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const m=this.mh(y.filter((t=>a.some((e=>Et(t.S,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.cr(e)}))}if(l=m,!p)break}}cr(t){const e=this.Ze.get(t.Sh);null==e||e.delete(t.S);const i=this.Qe.get(t.Sh);i&&i.has(t.S)?t.dispose():i&&(t.vs(!1),i.set(t.S,t))}Qh(t){for(const e of this.Ze.values())for(const i of e.values())t(i)}dr(t,e){for(const i of this.Ze.values())for(const s of i.values())e=t(e,s);return e}Gh(){this.Ze.forEach(((t,e)=>{t.forEach((t=>this.cr(t)))})),this.Ze.clear()}qh(){for(const t of this.Ze.values())for(const e of t.values())e.gh=!0}sr(){for(const t of this.Ze.values())for(const[e,i]of t.entries())i.gh&&(i.dispose(),t.delete(e))}Kh(){const t=this.dt.getInnerStart()this.dt.getInnerStart()?this.dt.getInnerEnd():this.dt.getInnerStart();return y(t,e)}yh(t,e){return!(t.gh||0===t.Ye.Ph().length||_s(e)&&!0!==e.Ar)}gr(t,e){return this.Xe===Ns||(this.Xe.He.forEach((i=>{e=t(e,i.nr)})),this.Xe.$e.forEach((i=>{(t=>void 0!==t.hr)(i)&&(e=t(e,i.nr))}))),e}Zh(){let t=this.Mh.pr();const e=this.Mh.mr();let i;if(void 0!==t&&vt(t)&&void 0!==e&&vt(e)&&("logarithmic"===this.wh.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&&vt(i.min)&&vt(i.max))return Et(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}yr(){let t=0;const e=this.Mh.Sr();return e&&(t=Math.max(t,e)),t}vr(){var t;const e=this.eh;let i=!1;if(this.lh&&this.Ih){const t=this.Zh(),e="function"==typeof this.Ih?this.Ih({curStart:this.Th,curEnd:this.Fh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.Ih;this.setInterval(e),this.lh=!1}if(this.Je&&!this.ih){const e=this.Zh();if(e){const s=this.Th,r=this.Fh;let n=this.Je.start(s,r,e.min,e.max),o=this.Je.end(s,r,e.min,e.max);const h=null===(t=this.Je.allowIntervalLengthChange)||void 0===t||t,a=Qs(this.Rh,e,{start:n,end:o},{start:s,end:r},h);n=a.start,o=a.end;const l=!1===Et(s,n),u=!1===Et(r,o);if(n=l?n:s,o=u?o:r,l||u){let t=!1;if(this.Ke)if(this.Ke){t=!0;const e=l?this.br(s,n):s,a=u?this.br(r,o):r;if(!0===this.jh(e,a,h)&&(l&&!1===Et(e,n)||u&&!1===Et(a,o))){this.chart.us.bs(!0),i=!0;let t=Math.abs(o-n)/Math.abs(e-a);t<1&&(t=1/t),this.hh=t>=1.4}}else t=!1;t||this.jh(n,o,h)}}}i?(this.eh!==i&&(this.eh=i,this.rh=St.performance.now()),this.Mr&&(clearTimeout(this.Mr),this.Mr=void 0)):!0===e&&void 0===this.Mr&&(this.hh=!1,this.Mr=setTimeout((()=>{!1!==this.eh&&(this.eh=!1,this.rh=St.performance.now()),this.Mr=void 0,this.chart.us.bs()}),200))}jh(t,e,i){let s={start:t,end:e},r=!0;if(this.Rh){const t=this.Zh();s=Qs(this.Rh,t,s,{start:this.Th,end:this.Fh},i)}const n=Math.abs(e-t),o=Math.abs(this.Fh-this.Th);if(void 0!==this.Xe.Hh&&this.Xe.Hh>n){const n=(e+t)/2,h=(i?this.Xe.Hh/2:o/2)*(t>e?-1:1);s={start:n-h,end:n+h},r=!1}if(void 0!==this.Xe.$h&&this.Xe.$he?-1:1);s={start:n-h,end:n+h},r=!1}let h=this.dt.nt(s.start,s.end,this.Th,this.Fh,i);if(!1===h)return!1;!0!==h&&(s=h);const a=this.yr(),l=this._r(Math.min(s.start,s.end),Math.max(s.start,s.end),a);return h=this.dt.nt(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min,this.Th,this.Fh,!1),!!h&&(!0===h?this.dt.J(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min):this.dt.J(s.start,s.end),this.Th=s.start,this.Fh=s.end,this.D.emit("scaleChange",this,s.start,s.end),this.oh=St.performance.now(),this.chart.us.bs(),r)}wr(){return this.eh}Cr(){return void 0!==this.Xh}}class Js{constructor(t,e,i,s,r=i.kr(s).setMouseInteractions(!1)){this.gh=!1,this.$i=!1,this.ts=[],this.Sh=t,this.S=e,this.Tr=i,this.Fr=s,this.Ye=r,this.ts.push(r)}vs(t){this.ts.forEach((e=>e.setVisible(t)))}dispose(){return this.$i||(this.$i=!0,this.ts.forEach((t=>t.dispose()))),this}}const Zs=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.He){let t=n.Ir(e,i,s,r);t=Ks(t),o.set(n,t)}let h;for(const s of t.$e){let t;if(void 0===h)t=s.Ir(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.Pr&&s.Pr>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),Qs=(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||Et(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||Et(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||Et(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||Et(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),o},tr=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}},er=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class ir extends er{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 sr=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),rr=new ir,nr=new class{getFillStyle(){return B}},or=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new U,wireframeStyle:rt});class hr extends or{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 ar=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),lr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new U});class ur extends lr{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 cr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),dr={Triangulated:hr,Pixelated:ur};class fr{constructor(t){this.Dr=new Map,this.us=t}os(t,e,i){const s=i.animationEnabled;this.Dr.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.Dr.delete(t),t.offDispose(r)}))}Br(t,e){const i=e.animationEnabled,s=[],r=t.onDispose((()=>{s.forEach((t=>{this.Dr.delete(t)})),t.offDispose(r)}));return{Lr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Dr.set(t,r)}}}ws(t,e){const i=this.Dr.get(t);i&&(i.curUnanimatedHighlightValue=Ae(e),this.us.bs())}ys(t,e=!1){const i=this.Dr.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}Cs(t,e){const i=this.Dr.get(t);i&&(i.animationEnabled=e)}ks(t){const e=this.Dr.get(t);return!!e&&e.animationEnabled}Ds(t){let e=!1;this.Dr.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.us.bs(!0)}}const gr=new Map,yr=t=>{const e=t.getSize(),i=t.getFamily(),s=t.getWeight(),r=t.getStyle(),n=t.getVariant(),o=`${r} ${n?"small-caps":"normal"} ${s} ${e}px ${i}`;let h=gr.get(o);return h||(h=((t,e)=>({font:t,properties:e}))(o,{type:"font",size:e,family:i,style:r,variant:n,weight:s}),gr.set(o,h)),h};var mr,pr;!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"}(pr||(pr={}));const Ar=t=>({container:t.Rr,scale:t.dt,setMouseStyle:(e,i)=>t.Er(e,i),restoreMouseStyle:e=>t.Vr(e),clientLocation2Engine:(e,i)=>t.De(e,i),engineLocation2Client:(e,i)=>t.zr(e,i),captureFrame:(e,i,s)=>t.Or(e,i,s),renderFrame:(e,i,s=!1)=>t.Nr(e,i,s),layout:()=>{t.Gr(),t.Wr(),t.Yr.Ur(),t.bs()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.Hr(e,i),onRenderFrame:e=>t.$r(e),offRenderFrame:e=>t.Xr(e)}),xr=[];let Sr;const br=()=>{if(void 0!==Sr){const t=St.getComputedStyle(St.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));Sr.style.height=St.innerHeight-e+"px",(()=>{for(let t=0;tthis.bs()),60),this.Qr=u(0,0),this.Jr=!1,this.Kr=wt,this.qr=()=>{},this.tn=[],this.sn=-1,this.en=[],this.hn=!0,this.$i=!1,this.rn=!1,this.Wr=()=>{const{bottom:t,left:e}=this.Rr.getBoundingClientRect();return this.Qr=u(Math.floor(e),Math.floor(t)),this},this.Gr=()=>{this.nn&&this.nn()},this.Er=(t,e)=>{if(!e){this.Rr.style.cursor=t;const e=this.sn;return this.sn+=1,this.en.push([e,t]),e}return this.Vr(e),this.Er(t)},this.Vr=t=>{const e=t?this.en.findIndex((e=>e[0]===t)):-1;e>=0?(this.en.splice(e,1),this.en.length>0?this.Rr.style.cursor=this.en[this.en.length-1][1]:this.Rr.style.cursor="default"):(this.en.push([0,"default"]),this.Rr.style.cursor="default")},this.an=t=>(this.ln.M(t),this),this.un=()=>this.ln._(),this.cn=()=>{this.Kr&&this.Kr(1e3/60),this.dn(),this.fn(),this.qr&&this.qr()},this.An=t=>(this.jr.set(t.gn(),t),this.jr=new Map([...this.jr.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.pn=t=>(this.jr.delete(t),this),this.j=()=>(this.ln.o=!1,this),this.Z=()=>(this.ln.o=!0,this),this.mn=t=>{if(!this.hn)return;const e=this.yn,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.De(t.clientX,t.clientY),r=this.Sn(t,{x:t.clientX,y:t.clientY});if(this.vn&&((null==r?void 0:r.entity)!==this.vn.entity||r.collectionMember!==this.vn.collectionMember)&&!this.xn){this.vn.entity.ji=!1;const e=this.vn.entity.bn;e&&e(this.vn.entity,t,this.vn.collectionMember)}if(r&&r.entity.getMouseInteractions()&&!this.xn)if(r.entity.ji){if(!i){const e=r.entity.Mn;e&&e(r.entity,t,r.collectionMember)}}else{r.entity.ji=!0;const e=r.entity._n;e&&e(r.entity,t,r.collectionMember)}if(this.xn){const i=this.xn.entity.wn,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.Cn=t,this.yn=t,this.kn=s,this.vn=r},this.Tn=t=>{if(this.hn=!1,this.kn=void 0,this.Cn=t,this.vn&&!this.Fn&&!this.xn){this.vn.entity.ji=!1;const e=this.vn.entity.bn;e&&e(this.vn.entity,t,this.vn.collectionMember),this.vn=void 0}},this.In=t=>{if(this.hn=!0,this.Cn=t,this.xn&&t.buttons<=0){const e=this.xn.entity.Pn;e&&e(this.xn.entity,t,this.xn.button,this.xn.startLocation,this.xn.collectionMember),this.xn=void 0}if(this.Fn&&t.buttons<=0){const e=this.Fn.entity.Dn;e&&e(this.Fn.entity,t,this.Fn.collectionMember),this.Fn=void 0}},this.Bn=()=>this.kn,this.Yr=t,this.qi=e.theme,this.As=i.As,this.Ln=i.Ln,this.Rn=i.Rn,this.En={Vn:i.Vn,zn:i.zn,On:i.On,Nn:i.Nn,Gn:i.Gn,Wn:i.Wn,Un:i.Un,Yn:i.Yn,Hn:i.Hn,$n:i.$n,Xn:i.Xn,jn:i.jn,Zn:i.Zn,Qn:i.Qn,Jn:i.Jn,Kn:i.Kn,qn:i.qn,io:i.io,so:i.so,eo:i.eo,ho:i.ho,ro:i.ro,no:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,Xs:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:`${St.location.origin}/resources`,oo:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,ao:(()=>{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})(),lo:void 0===(null==e?void 0:e.interactable)||e.interactable,uo:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=St.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.Rr=t}else this.Rr=s;St.addEventListener("resize",this.Gr),this.tn.push((()=>{St.removeEventListener("resize",this.Gr)}))}else{if(void 0===Sr){const t=St.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",St.document.body.appendChild(t),Sr=t,St.addEventListener("resize",br)}let t=1;for(;null!==St.document.getElementById(`chart-${t}`);)t+=1;this.Rr=St.document.createElement("div"),this.Rr.id=`chart-${t}`,this.Rr.style.flex="1",this.Rr.style.height="100%",Sr.appendChild(this.Rr),br(),xr.push(this.Gr),this.tn.push((()=>{Sr&&Sr.removeChild(this.Rr),xr.includes(this.Gr)&&xr.splice(xr.indexOf(this.Gr),1),0===xr.length&&Sr&&(St.document.body.removeChild(Sr),Sr=void 0,St.removeEventListener("resize",br))}))}if(St.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Rr&&this.Gr()};this.co=new St.ResizeObserver(t.bind(this)),this.co.observe(this.Rr)}""===this.Rr.style.position&&(this.Rr.style.position="relative"),this.Rr.style.boxSizing="content-box",this.Rr.addEventListener("fullscreenchange",this.Gr),this.Rr.addEventListener("webkitfullscreenchange",this.Gr);const n=e?e.maxFps:void 0;this.do=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.Rr.onwheel=this.fo(mr.wheel),this.Rr.oncontextmenu=this.fo(mr.contextmenu),this.Rr.onclick=this.fo(mr.click),this.Rr.ondblclick=this.fo(mr.dbclick),this.Rr.onlostpointercapture=()=>{h=!1},this.Rr.ontouchmove=t=>{h&&t.preventDefault()},this.Rr.onpointerover=a(),this.Rr.onpointerenter=a(this.In),this.Rr.onpointerdown=a(this.fo(mr.mouseDown),this.Ao(pr.touchStart)),this.Rr.onpointermove=a(this.mn,this.Ao(pr.touchMove)),this.Rr.onpointerup=a(this.fo(mr.mouseUp),this.Ao(pr.touchEnd)),this.Rr.onpointercancel=a(),this.Rr.onpointerout=a(),this.Rr.onpointerleave=a(this.Tn,this.Ao(pr.touchEnd)),St.addEventListener("scroll",this.Wr,{passive:!0}),this.ln=p(new v({r:0,g:0,b:0,a:0})),this.ls=new fr(this)}po(t,e){var i,s,r,n;(null===(i=this.vn)||void 0===i?void 0:i.entity)===t.entity&&this.vn.collectionMember===t.collectionMember&&(this.vn=e),(null===(s=this.mo)||void 0===s?void 0:s.entity)===t.entity&&this.mo.collectionMember===t.collectionMember&&(this.mo=e),(null===(r=this.Fn)||void 0===r?void 0:r.entity)===t.entity&&this.Fn.collectionMember===t.collectionMember&&(this.Fn={...e,event:this.Fn.event}),(null===(n=this.xn)||void 0===n?void 0:n.entity)===t.entity&&this.xn.collectionMember===t.collectionMember&&(this.xn={...e,button:this.xn.button,startLocation:this.xn.startLocation})}yo(){this.rn=!0,this.Kr=void 0,this.qr=void 0}$r(t){return this.D.on("render",t)}Xr(t){return this.D.off(t)}So(){return this.vo}xo(){return this.bo}setBackgroundFillStyle(t){return this.Mo.ke(t),this}getBackgroundFillStyle(){return this.Mo.Lh()}setBackgroundStrokeStyle(t){return this.Mo.Ce(t),this}getBackgroundStrokeStyle(){return this.Mo._o()}wo(t){return this.qr=t,this}Co(t){return this.Kr=t,this}ko(t){return this.jr.get(t)}To(){return Array.from(this.jr.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}fo(t){return e=>this.Fo(t,e)}Fo(t,e){if(!this.hn)return;t===mr.contextmenu&&$t(e);const i=this.De(e.clientX,e.clientY),s=this.Sn(e,{x:e.clientX,y:e.clientY});if(t===mr.mouseUp){if(this.xn){const t=this.xn.entity.Pn;if(t&&t(this.xn.entity,e,this.xn.button,this.xn.startLocation,this.xn.collectionMember),(null==s?void 0:s.entity)!==this.xn.entity||s.collectionMember!==this.xn.collectionMember){this.xn.entity.ji=!1;const t=this.xn.entity.bn;t&&t(this.xn.entity,e,this.xn.collectionMember)}this.xn=void 0}if(this.Fn){const t=this.Fn.entity.getMouseInteractions()&&this.Fn.entity.Dn;t&&t(this.Fn.entity,e,this.Fn.collectionMember),this.Fn=void 0}}else if(s&&s.entity.getMouseInteractions()){const i=t===mr.click?s.entity.Io:t===mr.dbclick?s.entity.Po:t===mr.mouseDown?s.entity.Do:t===mr.wheel?s.entity.Bo:t===mr.contextmenu?s.entity.Lo:void 0;if(i&&i(s.entity,e,s.collectionMember),t===mr.mouseDown){this.Fn={entity:s.entity,collectionMember:s.collectionMember,event:e};const t=this.Fn.event.button,i=s.entity.Ro;i&&i(s.entity,e,t,s.collectionMember),this.xn={entity:s.entity,collectionMember:s.collectionMember,button:t,startLocation:u(e.clientX,e.clientY)}}}this.Cn=e,this.kn=i,this.vn=s}Ao(t){return e=>this.Eo(t,e)}Eo(t,e){const i=e.interactions.length;if(this.Vo=e,this.mo){const s=t===pr.touchMove?this.mo.entity.zo:t===pr.touchEnd?this.mo.entity.Oo:t===pr.touchStart?this.mo.entity.No:void 0;s&&s(this.mo.entity,e,this.mo.collectionMember),t===pr.touchEnd&&0===i&&(this.mo.entity.ji=!1,this.mo=void 0)}else if(t===pr.touchStart){for(let t=0;t{t()})),this.tn.length=0}De(t,e){return u(t-this.Qr.x,this.Qr.y-e)}zr(t,e){return u(t+this.Qr.x,this.Qr.y-e)}$o(t){const e=this.De(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Xo(t){const e=this.zr(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const wr=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=si(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=si(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=si(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=si(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?Ir.Nearest:"nearest-x"===t?Ir.NearestX:"nearest-y"===t?Ir.NearestY:void 0;return void 0!==e?e:Ir.NearestX},zr=(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===Ir.Nearest)return Vr(t,e,n,o,c,d);if(i===Ir.NearestX||i===Ir.NearestY){if("boolean"==typeof l&&("x"===a&&i===Ir.NearestX||"y"===a&&i===Ir.NearestY))return Br(t,ut(e,o,n),a,l,c,d);if(i===Ir.NearestX)return Pr(t,ut(e,o,n),h,c,d);if(i===Ir.NearestY)return Rr(t,ut(e,o,n),h,c,d)}},Vr=(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=ut(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)):Ie,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.D.on("dispose",t),this.offDispose=t=>this.D.off(t,"dispose"),this.us=t,this.qo=e,this.ta=i,this.ia=Or,Or+=1,this.sa=t.qi.highlightColorOffset}ea(t){return void 0!==this.ta.find((e=>e.type===t))}ha(t,e){var i;return!!this.ea(t)&&!0===e(null===(i=this.ta.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.$i||(this.ji&&this.bn&&this.bn(this,void 0,void 0),this.$i=!0,this.qo(this),this.D.emit("dispose",this)),this}setVisible(t){const e=this.Xi;return this.Xi=t,!t&&e&&(this.ji&&this.bn&&this.bn(this,void 0,void 0),this.ji=!1),this}getVisible(){return this.Xi}setMouseInteractions(t){const e=this.jo._();return this.jo.M(t),t||(e&&this.ji&&this.bn&&this.bn(this,void 0,void 0),this.ji=!1),this}getMouseInteractions(){return this.jo._()}getIsUnderMouse(){return this.ji}getIsGrabbed(){return this.Qo}setMouseMoveEventHandler(t){return this.Mn=t,this}setMouseEnterEventHandler(t){return this._n=t,this}setMouseLeaveEventHandler(t){return this.bn=t,this}setMouseClickEventHandler(t){return this.Io=t,this}setMouseDoubleClickEventHandler(t){return this.Po=t,this}setMouseDownEventHandler(t){return this.Do=t,this}setMouseUpEventHandler(t){return this.Dn=t,this}setMouseWheelEventHandler(t){return this.Bo=t,this}setMouseContextMenuEventHandler(t){return this.Lo=t,this}setMouseDragEventHandler(t){return this.wn=t,this}setMouseDragStartEventHandler(t){return this.Ro=t,this}setMouseDragStopEventHandler(t){return this.Pn=t,this}setTouchStartEventHandler(t){return this.No=t,this}setTouchMoveEventHandler(t){return this.zo=t,this}setTouchEndEventHandler(t){return this.Oo=t,this}ra(t){return this.Jo=t,this}na(){return this.Jo?this.Jo:Ur}cs(t){return this.Ko=t,this}oa(){return this.Ko}aa(t){return this.sa=t,this}la(){return this.sa}}const Ur=y(u(0,0),u(0,0));class Gr extends Nr{constructor(t,e,i,s){super(t,i,s),this.ua=0,this.Ts=e,this.Ts.ca=!0}da(t){return this.ua===t||(this.ua=t,this.Ts.ca=!0),this}fa(){return this.ua}}class Wr extends Gr{constructor(t,e,i,s,r){super(t,e,s,r),this.Aa=!0,this.dt=i}}const Yr=(t,e,i)=>{if(i instanceof zi){const s=i.Wi(),r=oi(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),si(e,-1)),i.pi(u(t.max.x,t.max.y),e))},Hr=(t,e)=>"function"==typeof e?e(t):e,Xr=(t,e)=>!t||t!==e,$r=t=>t!==B;class jr extends Wr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.be=Mr.fillStyle,this.us=t}ke(t){return this.be=Hr(this.be,t),this}Lh(){return this.be}ga(){return Xr(this.pa,this.be)}ma(){return((t,e)=>t===B&&e!==B)(this.pa,this.be)}ya(){return $r(this.be)}Sa(t){this.pa=t}}class qr extends jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Me=Mr.lineStyle,this.us=t}Ce(t){return this.Me="function"==typeof t?t(this.Me):t,this}_o(){return this.Me}va(){return!this.xa||this.xa!==this.Me}ba(t){return!this.xa||this.xa.getThickness()!==t}ya(){return this.Me!==rt||super.ya()}ma(){return(this.Me!==rt||this.be!==B)&&this.xa===rt&&this.pa===B}Ma(t){this.xa=t}}class Jr extends jr{constructor(t,e,i,s,r,n=p(5)){super(t,e,i,s,r),this.size=p(5),this.size=n}q(t){return this.size.M(t),this}}class Zr extends jr{constructor(t,e,i,s,r,n=p(Mr.font)){super(t,e,i,s,r),this._a=p(""),this.wa=p(u(0,0)),this.Ca=p(0),this.ka=p(0),this.Ta=p(u(0,0)),this.Fa=p(0),this.Ia=p(rr),this.Pa=u(0,0),this.Xt=p(A(1,1,1,1)),this.Da=p(x(4,4,4,4)),this.font=p(Mr.font),this.Ba=!1,this.font=n}ya(){return $r(this.be)&&this._a._().length>0}ma(){return!1===this.Ba&&this.ya()}Bh(t){return this._a.M(t),this}Ph(){return this._a._()}Vh(t){return sr(t)?this.Ia.M(t):this.Ia.M(t(this.Ia._())),this}Eh(){return this.Ia._()}La(t){return this.Ia.M(this.Ia._().setFamily(t)),this}Ra(){return this.Ia._().getFamily()}Ea(t){return this.Ia.M(this.Ia._().setSize(t)),this}Va(){return this.Ia._().getSize()}za(t){return this.Ia.M(this.Ia._().setWeight(t)),this}Oa(){return this.Ia._().getWeight()}Na(t){return this.Ia.M(this.Ia._().setStyle(t)),this}Ga(){return this.Ia._().getStyle()}Wa(t){return this.Ia.M(this.Ia._().setVariant(t)),this}Ua(){return this.Ia._().getVariant()}Ie(t){return this.wa.M(t),this}Ya(){return this.wa._()}zh(t){return this.Fa.M(t),this}Oh(){return this.Fa._()}Ha(t,e){return this.Ta.M(u(t,e)),this}$a(){return this.Ta._()}Xa(t){return this.ka.M(t),this}ja(){return this.ka._()}Za(t){return this.Ca.M(t),this}Qa(){return this.Ca._()}Ja(t){return this.ka.M(t.x),this.Ca.M(t.y),this}Ka(t){return this.Xt.M(t),this}qa(){return this.Xt._()}tl(t){return this.Da.M(t),this}il(){return this.Da._()}}class Kr extends Jr{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,p(o)),this.sl=[],this.el=p(e.PointShape.Square),this.Fa=p(0),this.hl=p(!1),this.rl=p(!1),this.nl=p(!1),this.ol=ze,this.al=0,this.ll=[],this.ul=0,this.cl=ze,this.dl=Ir.Nearest,this.fl=!1,this.Al=void 0}pl(t){return this.dl=t,this}ml(){return this.ll}yl(){return this.sl}Sl(t){return this.el.M(t),this}vl(){return this.el._()}zh(t){return this.Fa.M(t),this}Oh(){return this.Fa._()}xl(t){return this.hl.M(t),this}bl(t){return this.rl.M(t),this}Ml(t){return this.nl.M(t),this}_l(t,e){return Array.isArray(t)||(t=[t]),this.ul+=t.length,this.ll=se(this.ll,t,{canReturnB:!0}),this.cl&&(this.cl=e?qe(this.cl,e):void 0),this.Al=void 0,this}Nt(){return this.fl=!0,this.sl.length=0,this.al=0,this.ol=ze,this.ll=[],this.ul=0,this.Al=void 0,this}wl(){return this.al}Cl(){return this.ul}}class Qr extends qr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.wa=p(u(0,0)),this.X=p(u(100,100)),this.Fa=p(0),this.Pa=p(u(0,0)),this.kl=!1}Ds(){return this.Tl(),this}Ie(t){const e=this.wa._();return t.x===e.x&&t.y===e.y||(this.wa.M(t),this.Tl()),this}Ya(){return this.wa._()}Fl(t){const e=this.wa._();return t!==e.x&&(this.wa.M(u(t,e.y)),this.Tl()),this}Il(t){const e=this.wa._();return t!==e.y&&(this.wa.M(u(e.x,t)),this.Tl()),this}q(t){const e=this.X._();return t.x===e.x&&t.y===e.y||(this.X.M(u(t.x,t.y)),this.Tl()),this}oi(){return this.X._()}Pl(t){const e=this.X._();return t!==e.x&&(this.X.M(u(t,e.y)),this.Tl()),this}Dl(t){const e=this.X._();return t!==e.x&&(this.X.M(u(e.x,t)),this.Tl()),this}zh(t){return this.Fa.M(t),this}Oh(){return this.Fa._()}Bl(t){const e=this.Pa._();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.kl=!1,this.Tl()):(this.kl=!0,this.Pa.M(t))),this}Tl(){if(!this.kl){const t=this.wa._(),e=this.X._(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.Pa._();i.x===s.x&&i.y===s.y||this.Pa.M(i)}}}class tn extends qr{constructor(){super(...arguments),this.sl=[],this.wa=p(u(0,0)),this.ol=ze,this.Ll=!1}Rl(t){return t=Kt(t),this.sl=t,this.Ll=!0,this}El(){return this.sl}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return 0}zl(){return 0}}class en extends tn{}class sn extends jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ol=new Array,this.Nl=new Array,this.Gl=p({type:"disabled",packager:(t,e,i)=>t.slice()}),this.ol=ze,this.Wl=0,this.Ul=!1,this.ll=[Array(),Array()],this.Yl=!1,this.Hl=(new U).setColor(T(42,171,240)),this.fl=!1,this.$l=!1,this.Xl=!1}_l(t,e){const i=this.Wl-1,s=i>0&&!this.Yl;let[r,n]=s?[[this.Ol[i]],[this.Nl[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=se(r,e,{canReturnB:!0}),n=se(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Yl?(this.ll[0]=se(this.ll[0],r,{canReturnB:!0}),this.ll[1]=se(this.ll[1],n,{canReturnB:!0})):(this.ll=[r,n],this.Yl=!0),this.ol=qe(this.ol,e||qe($e(r),$e(n))),this}Nt(){return this.fl=!0,this.Ol.length=0,this.Nl.length=0,this.Wl=0,this.ol=ze,this}yl(){return[this.Ol,this.Nl]}ml(){return[this.ll[0],this.ll[1]]}jl(t){return this.Gl.M(t),this}Zl(){return this.Gl._()}Ql(t){return this.Hl="function"==typeof t?t(this.Hl):t,this}Jl(){return this.Hl}wl(){return this.Wl-(Number(this.$l)+Number(this.Xl))}Cl(){return this.ll.length}Kl(t){return this.$l=t,this}ql(){return this.$l}tu(t){return this.Xl=t,this}iu(){return this.Xl}ma(){return this.pa===B&&this.su===B&&(this.be!==B||this.Hl!==B)}eu(t){this.su=t}ya(){return this.Hl!==B||super.ya()}ga(){return super.ga()||!this.su||this.su!==this.Hl}}class rn extends qr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.wa=p(u(0,0)),this.hu=p(0),this.Fi=p(360),this.ru=p(100),this.nu=p(100),this.ou=p(0),this.au=p(void 0),this.lu=u(0,0),this.uu=u(0,0),this.cu=u(0,0)}du(){return this.ru._()}fu(){return this.nu._()}Ya(){return this.wa._()}Au(){return this.hu._()}Ti(){return this.Fi._()}gu(){return this.ou._()}pu(){return this.au._()}mu(){return this.lu}yu(){return this.uu}Su(){return this.cu}Ie(t){return this.wa.M(t),this}vu(t){return this.hu.M(t),this}ze(t){return this.Fi.M(t),this}xu(t){return this.nu.M(t),this.ru.M(t),this}bu(t){return this.ru.M(t),this}Mu(t){return this.nu.M(t),this}_u(t){return this.ou.M(t<0?0:t),this}wu(t){return this.au.M(void 0!==t&&t<=0?void 0:t),this}}var nn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(nn||(nn={}));class on extends Wr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Cu=Mr.lineStyle,this.engine=t}Ee(t){return this.Cu=((t,e)=>"function"==typeof e?e(t):e)(this.Cu,t),this}ku(){return this.Cu}va(){return((t,e)=>!t||t!==e)(this.Tu,this.Cu)}Fu(t){return((t,e)=>!t||t.getThickness()!==e)(this.Tu,t)}ma(){return((t,e)=>t===rt&&e!==rt)(this.Tu,this.Cu)}ya(){return(t=>t!==rt&&t.getFillStyle()!==B)(this.Cu)}Iu(t){this.Tu=t}}class hn extends on{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Pi=u(0,0),this.Fi=u(0,0),this.Pu=!1}M({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.Pu=!0,this.Pi=t,this.Fi=e),this}Ii(){return this.Pi}Ti(){return this.Fi}Oe(t){return t.x===this.Pi.x&&t.y===this.Pi.y||(this.Pu=!0,this.Pi=t),this}ze(t){return t.x===this.Fi.x&&t.y===this.Fi.y||(this.Pu=!0,this.Fi=t),this}}class an extends on{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Du=void 0,this.Bu=!1}}class ln extends on{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Lu=[],this.ol=ze,this.ll=new Array,this.al=0,this.dl=Ir.NearestX,this.fl=!1,this.Ru=p(void 0),this.$l=!1,this.Xl=!1}Eu(t){return this.Ru.M(t),this}Vu(){return this.Ru._()}ml(){return this.ll}yl(){return this.Lu}pl(t){return this.dl=t,this}Nt(){return this.fl=!0,this.Lu.length=0,this.al=0,this.ll=[],this.ol=ze,this}wl(){return this.al-(Number(this.$l)+Number(this.Xl))}Cl(){return this.ll.length}Kl(t){return this.$l=t,this}ql(){return this.$l}tu(t){return this.Xl=t,this}iu(){return this.Xl}}const un=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 cn{constructor(){this.Xi=!0,this.D=new r.Eventer,this.zu=0,this.wt=(t,e,i)=>{0===this.zu&&this.D.emit("mouseEnter",this,e),this.zu+=1},this.Ct=(t,e,i)=>{this.zu-=1,this.zu<1&&(this.D.emit("mouseLeave",this,e),this.zu=0)},this.kt=(t,e,i)=>{this.D.emit("mouseClick",this,e)},this.Tt=(t,e,i)=>{this.D.emit("mouseDoubleClick",this,e)},this.Ft=(t,e,i)=>{this.D.emit("mouseDown",this,e)},this.It=(t,e,i)=>{this.D.emit("mouseUp",this,e)},this.Pt=(t,e,i)=>{this.D.emit("mouseMove",this,e)},this.Bt=(t,e,i,s)=>{this.D.emit("mouseDragStart",this,e,i)},this.Dt=(t,e,i,s,r,n)=>{this.D.emit("mouseDrag",this,e,i,s,r)},this.Lt=(t,e,i,s,r)=>{this.D.emit("mouseDragStop",this,e,i,s)},this.Rt=(t,e,i)=>{this.D.emit("mouseWheel",this,e)},this.Et=(t,e)=>{this.zu+=1,this.D.emit("touchStart",this,e)},this.Vt=(t,e)=>{this.D.emit("touchMove",this,e)},this.zt=(t,e)=>{this.zu-=1,this.D.emit("touchEnd",this,e)},this.Ou=t=>(t instanceof Wr?t.setMouseEnterEventHandler(this.wt).setMouseLeaveEventHandler(this.Ct).setMouseClickEventHandler(this.kt).setMouseDoubleClickEventHandler(this.Tt).setMouseDownEventHandler(this.Ft).setMouseUpEventHandler(this.It).setMouseMoveEventHandler(this.Pt).setMouseDragEventHandler(this.Dt).setMouseDragStartEventHandler(this.Bt).setMouseDragStopEventHandler(this.Lt).setMouseWheelEventHandler(this.Rt).setTouchStartEventHandler(this.Et).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.zt):(t.onMouseEnter(this.wt),t.onMouseLeave(this.Ct),t.onMouseClick(this.kt),t.onMouseDoubleClick(this.Tt),t.onMouseDown(this.Ft),t.onMouseUp(this.It),t.onMouseMove(this.Pt),t.onMouseDrag(this.Dt),t.onMouseDragStart(this.Bt),t.onMouseDragStop(this.Lt),t.onMouseWheel(this.Rt),t.onTouchStart(this.Et),t.onTouchMove(this.Vt),t.onTouchEnd(this.zt)),t)}onMouseEnter(t){return this.D.on("mouseEnter",t)}onMouseLeave(t){return this.D.on("mouseLeave",t)}onMouseClick(t){return this.D.on("mouseClick",t)}onMouseDoubleClick(t){return this.D.on("mouseDoubleClick",t)}onMouseDown(t){return this.D.on("mouseDown",t)}onMouseUp(t){return this.D.on("mouseUp",t)}onMouseMove(t){return this.D.on("mouseMove",t)}onMouseDragStart(t){return this.D.on("mouseDragStart",t)}onMouseDrag(t){return this.D.on("mouseDrag",t)}onMouseDragStop(t){return this.D.on("mouseDragStop",t)}onMouseWheel(t){return this.D.on("mouseWheel",t)}onTouchStart(t){return this.D.on("touchStart",t)}onTouchMove(t){return this.D.on("touchMove",t)}onTouchEnd(t){return this.D.on("touchEnd",t)}offMouseEnter(t){return this.D.off(t,"mouseEnter")}offMouseLeave(t){return this.D.off(t,"mouseLeave")}offMouseClick(t){return this.D.off(t,"mouseClick")}offMouseDoubleClick(t){return this.D.off(t,"mouseDoubleClick")}offMouseDown(t){return this.D.off(t,"mouseDown")}offMouseUp(t){return this.D.off(t,"mouseUp")}offMouseMove(t){return this.D.off(t,"mouseMove")}offMouseDragStart(t){return this.D.off(t,"mouseDragStart")}offMouseDrag(t){return this.D.off(t,"mouseDrag")}offMouseDragStop(t){return this.D.off(t,"mouseDragStop")}offMouseWheel(t){return this.D.off(t,"mouseWheel")}offTouchStart(t){return this.D.off(t,"touchStart")}offTouchMove(t){return this.D.off(t,"touchMove")}offTouchEnd(t){return this.D.off(t,"touchEnd")}getIsUnderMouse(){return this.zu>0}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&this.D.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}}const dn=(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()},oi({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.pi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},oi({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),$t(s)}},fn=(t,e,i,s,r)=>{dn(t,r,e)},gn=(t,e,i,s,r)=>{dn(t,s,r)};class yn extends cn{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.Nu=void 0,this.Gu=void 0,this.Wu=un,this.Uu=void 0,this.jo=!0,this.Yu=()=>{const t="function"==typeof this.Wu?this.Wu(this):this.Wu;t&&(this.Gu=this.Ts.us.Er(t))},this.Hu=()=>{this.Ts.us.Vr(this.Gu)},this.Xt=A(0,0,0,0),this.Ts=t,this.renderingScale=e,this.scale=i,this.qo=s,this.qi=r,this.Ts.bs(),this.onMouseEnter(this.Yu),this.onMouseLeave(this.Hu),this.onMouseDrag(fn);const n=Yi(new Xi(wt,gn,wt));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.qi=r}setMouseInteractions(t){return this.$u().forEach((e=>e.setMouseInteractions(t))),this.jo=t,this}getMouseInteractions(){return this.jo}setEffect(t){return this.es=this.es||this.Ts.us.es.hs(this,{Xu:{shapes:this.$u()}}),this.es.Xu.xs(t),this}getEffect(){return!!this.es&&this.es.Xu.Ms()}setAutoDispose(t){return this.Uu=t,this.Ts.bs(),this}getAutoDispose(){return this.Uu}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.Ts.bs(),this}getMargin(){return this.Xt}Fe(){if(this.Uu){const t=this.size,e=this.renderingScale.oi(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.Uu.type&&i.x>=this.Uu.maxWidth||"max-height"===this.Uu.type&&i.y>=this.Uu.maxHeight)&&this.dispose()}return this}Ds(){return this}dispose(){return this.$i||(this.Ts.bs(),this.$i=!0,this.qo(this),this.D.emit("dispose",this),this.$u().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.$u().forEach((e=>e.setVisible(t))),this.Ts.bs(),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setPosition(t){return this.position=t,this.Ts.bs(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.pi(this.position,oi({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.pi(r,oi({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,oi({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Ts.bs(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Nu=t,this.Ts.bs(),this}getDraggingMode(){return void 0!==this.Nu?this.Nu:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Wu=t,this}getMouseStyle(){return this.Wu}}class mn extends yn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Da=A(),this.ju=0,this.Ts=t,this.Zu=s,this.backgroundElement=new this.Zu(this.Ts,this.renderingScale,this.scale,wt,n),this.Ou(this.backgroundElement)}$u(){return this.backgroundElement.$u()}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}Fe(){return super.Fe(),this.$i||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.Qu(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.Da="object"==typeof t?S(this.Da,t):{left:t,top:t,right:t,bottom:t},this.Ts.bs(),this}getPadding(){return this.Da}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.Da.left+this.Da.right,i.y+this.Da.bottom+this.Da.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Ju()+this.backgroundElement.Ku(),i.y+this.backgroundElement.qu()+this.backgroundElement.tc())),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,oi({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.pi(n,{x:this.backgroundElement.Ju(),y:this.backgroundElement.qu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.pi(o,oi({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,oi({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.ju}setHighlight(t){return this.ju=Ae(t),this.backgroundElement.setHighlight(t),this.D.emit("highlight",this,t),this}}const pn=t=>"setBackground"in t;class An extends cn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.S=0,this.ic=1,this.sc=!0,this.hc=new ir,this.rc=!0,this.$i=!1,this.axisScale=s,this.renderingScale=r,this.nc=o,this.oc=h,this.ac=a,this.qo=l,this.lc=e,this.uc=i,this.cc=this.Ou(this.lc.Ve(this.renderingScale)),this.qi=u,this.dc=this.Ou(this.ac.fc(this.uc,this.renderingScale,n,wt,this.qi,!1).setOrigin(Ht(this.oc)).setDirection(this.oc)),this.axis=t,this.setMouseInteractions(!1),"major"===this.dc.Ac?this.cc.Ee(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.dc.Ac?this.cc.Ee(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.dc.Ac&&this.cc.Ee(u.cursorGridStrokeStyleX)}setValue(t){return this.S=t,this.uc.bs(),this.D.emit("valueChange",this,this.S),this}getValue(){return this.S}setTextFormatter(t){return this.gc=t,this.uc.bs(),this}setTickLength(t){return this.dc.setPointerLength(t),this.lc.bs(),this}getTickLength(){return this.dc.getPointerLength()}setTickLabelPadding(t){return this.dc.setTickLabelPadding(t),this.lc.bs(),this}setTickLabelRotation(t){return this.dc.setTextRotation(t),this.lc.bs(),this}getTickLabelRotation(){return this.dc.getTextRotation()}getTickLabelPadding(){return this.dc.getTickLabelPadding()}setGridStrokeLength(t){return this.ic=t,this.lc.bs(),this}getGridStrokeLength(){return this.ic}setGridStrokeStyle(t){return this.cc.Ee(t),this.lc.bs(),this}getGridStrokeStyle(){return this.cc.ku()}dispose(){return this.$i||(this.$i=!0,this.cc.dispose(),this.dc.dispose(),this.qo(this),this.lc.us.bs(),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setMarkerVisible(t){return this.sc=t,this.uc.bs(),this}getMarkerVisible(){return this.sc}setMarker(t){return t(this.dc),this.uc.bs(),this}getMarker(){return this.dc}setMouseInteractions(t){return this.dc.setMouseInteractions(t),this.cc.setMouseInteractions(t),this}getMouseInteractions(){return this.cc.getMouseInteractions()}setAllocatesAxisSpace(t){return this.rc=t,this.uc.bs(),this}getAllocatesAxisSpace(){return this.rc}isInScale(){return Ge(this.S,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}}class xn 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.mc=!1,this.qo=a,this.lc=e,this.uc=i}dispose(){return this.mc=!1,super.dispose()}update(){return this}plot(t,e,i,s){if(this.isInScale()&&this.getVisible()){this.mc=!1;const r=lt(this.S,this.axisScale,this.nc.getWidth(this.renderingScale));this.cc.setVisible(!0).Oe(this.nc.toPoint(r,t)).ze(this.nc.toPoint(r,t-(i+e*this.ic))),this.sc?(this.gc&&this.dc.setText(this.gc(this.S,this)),this.dc.setVisible(!0).setPosition(this.nc.toPoint(r,s))):this.dc.setVisible(!1)}else this.cc.setVisible(!1),this.dc.setVisible(!1);return this.dc.Ds().Fe(),this}yc(){const t=this.dc.Ds().getSize();return this.nc.getHeight(t)}}const Sn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),bn=(t,e)=>(he(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),vn=(t,e,i)=>{i&&pn(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},Mn={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}},Tn={background:void 0,setBackground(t){return{...this,background:t}}},wn={fc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return vn(o,r,n),o}},En={fc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return vn(o,r,n),o}};class kn extends yn{constructor(){super(...arguments),this.Sc=!0}Fe(){return super.Fe(),this}setMouseInteractions(t){return this.Sc=t,this}getMouseInteractions(){return this.Sc}$u(){return[]}}class Cn extends kn{onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}Qu(t){return this.size=t,this}Ju(){return 0}Ku(){return 0}tc(){return 0}qu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return B}setStrokeStyle(){return this}getStrokeStyle(){return rt}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Dn extends yn{constructor(){super(...arguments),this.D=new r.Eventer,this.ju=0}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}getHighlight(){return this.ju}setHighlight(t){return this.ju=t,this.$u().forEach((e=>e.cs(t))),this.D.emit("highlight",this,t),this.Ts.bs(),this}}class Fn extends Dn{}class In extends Fn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Ts=t,this.el=this.Ts.vc(this.renderingScale,nn.Simple).setVisible(!1).ke(B).Ce(rt),this.Ou(this.el)}xc(){const t=this.bc();if(t.length>2){const e=$e(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=ri(t,si(e.min,-1));return this.scale.pi(this.position,ri(s,oi(si(ri(this.origin,u(1,1)),-.5),i)))})).map((t=>ut(t,this.scale,this.renderingScale)));this.el.Rl(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.el&&this.el.setVisible(!1),this.setContentSize(u(0,0))}Fe(){return super.Fe(),this.$i||this.xc(),this}Ds(){return this.xc(),super.Ds()}setVisible(t){return super.setVisible(t),this.el.setVisible(t),this}}const Ln=(t,e,i)=>t*(1-i)+e*i,zn=(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=Ln(i.value,r.value,n),c=Ln(e.value,s.value,h);return Ln(c,u,l)},Vn={warm:t=>e=>E(60/(t-1)*e,.8,.8),cold:t=>e=>E(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>E(360/t*e,.8,.8),reverseSpectrum:t=>e=>E(360/t*(t-e),.8,.8),flatUI:t=>e=>E(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return E(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return E(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return E(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return E(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return E(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>E(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return E(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return E(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),E(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return E(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=>E(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>Pn([{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=>Pn([{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=>Pn([{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=>Pn([{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=>Pn([{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=>Pn([{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)},Pn=(t,e,i)=>{const s=Bn(e,i),[r,n]=_n(s,t),o=Rn(t[r]),h=Rn(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:Ln(o.h,h.h,a),s:Ln(o.s,h.s,a),v:Ln(o.v,h.v,a)};return E(l.h,l.s,l.v)},Rn=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},_n=(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),jn={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},qn=s.Record({type:"linestyle",lineType:"dashed",pattern:jn.DashedEqual,fillStyle:new U({color:T(255,255,255)}),thickness:1,patternScale:3});class Jn extends qn{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")}V(){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 Zn=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),Kn=s.Record({type:"icon",width:void 0,height:void 0,Mc:void 0,_c:wt,wc:wt});class Qn extends Kn{constructor(t,e,i,s){super({...s,Mc:t,_c:e,wc:i})}dispose(){return this.wc(this),this}setWidth(t){const e=this.set("width",t);return this._c(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this._c(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this._c(i),i}oi(){if(!this.Mc)return{x:0,y:0};const t=this.Mc.width,e=this.Mc.height,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 to=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),eo=s.Record({type:"glow",color:T(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class io extends eo{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 so extends Dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this._a="label",this.el=this.Ts.kr(this.renderingScale).Bh(this._a).ke(B),this.Ou(this.el)}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}Fe(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=ut(t,this.scale,this.renderingScale);return this.el.Ie(i),this}Ds(){this.el.Ds();const t=0===this._a.length?u(0,0):this.el.Cc();return this.setContentSize(t),super.Ds()}setText(t){return this._a=t,this.el.Bh(this._a),this.Ts.bs(),this}getText(){return this._a}setFont(t){return this.el.Vh(t),this.Ts.bs(),this}getFont(){return this.el.Eh()}setTextRotation(t){return this.el.zh(t),this.Ts.bs(),this}getTextRotation(){return this.el.Oh()}}const ro={...Mn,...wn,uiElement:so};class no extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.kc=!1,this.fitTo=this.Qu.bind(this),this.setSize=this.fitTo,this.el=this.Ts.vc(e).ke(B).Ce(rt),this.Ou(this.el)}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}Fe(){const t=$e([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>ut(t,this.scale,this.renderingScale))));return this.kc?this.el.Rl([{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.el.Rl([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Qu(t){return this.setContentSize(t),this.Ts.bs(),this}Ju(){return 0}Ku(){return 0}tc(){return 0}qu(){return 0}}class oo extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Tc=u(0,0),this.el=t.Fc(e).vu(0).ze(360).ke(B).Ce(rt),this.Ou(this.el)}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}Fe(){const t=this.getSize(e.UISpace.Content).x/2;return this.el.bu(t*this.renderingScale.Wi().x).Mu(t*this.renderingScale.Wi().y).Ie(ut(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).wu(255).Ds(),this}Qu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.Tc=t,this.Ts.bs(),this}Ju(){return(this.getSize(e.UISpace.Content).x-this.Tc.x)/2}Ku(){return(this.getSize(e.UISpace.Content).x-this.Tc.x)/2}tc(){return(this.getSize(e.UISpace.Content).y-this.Tc.y)/2}qu(){return(this.getSize(e.UISpace.Content).y-this.Tc.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.Tc=t,this}}class ho extends In{constructor(t,e,i,s,r){super(t,e,i,nn.Simple,s,r),this.Ic=p(u(0,0)),this.Pc=!1,this.Ts=t,this.xc()}bc(){const t=this.Ic._();if(this.Pc){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.Ic._().x*this.Ic._().x/4+this.Ic._().y*this.Ic._().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=ri(r,ri(i,s)),o=ri(n,ri(s,si(i,-1)));return[r,n,o,ni(o,ri(i,s))]}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}Qu(t){return this.Ic.M(t),this.Pc=!1,this.Ts.bs(),this}Ju(){return this.Pc?0:(this.getSize(e.UISpace.Content).x-this.Ic._().x)/2}Ku(){return this.Pc?0:(this.getSize(e.UISpace.Content).x-this.Ic._().x)/2}tc(){return this.Pc?0:(this.getSize(e.UISpace.Content).y-this.Ic._().y)/2}qu(){return this.Pc?0:(this.getSize(e.UISpace.Content).y-this.Ic._().y)/2}fitTo(t){return this.Ic.M(t),this.Pc=!0,this.Ts.bs(),this}}class ao extends In{constructor(t,i,s,r,n){super(t,i,s,nn.Simple,r,n),this.Dc=p(u(0,0)),this.Bc=p(10),this.Lc=p(void 0),this.oc=p(e.UIDirections.Right),this.xc()}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}setDirection(t){return this.oc.M(t),this.Ts.bs(),this}getDirection(){return this.oc._()}setPointerLength(t){return this.Bc.M(t),this.Ts.bs(),this}getPointerLength(){return this.Bc._()}setPointerAngle(t){return this.Lc.M(t),this.Ts.bs(),this}getPointerAngle(){let t=this.Lc._();if(void 0===t){const e=this.Rc();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)}Qu(t){return this.Dc.M(t),this.Ts.bs(),this}Ec(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}Vc(){return Xt(this.oc._())?this.Dc._().x:this.Dc._().y}Rc(){return Xt(this.oc._())?this.Dc._().y:this.Dc._().x}Ju(){switch(this.oc._()){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.Ec()-this.Rc());default:return 0}}Ku(){switch(this.oc._()){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.Ec()-this.Rc());default:return 0}}tc(){switch(this.oc._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Ec()-this.Rc());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}qu(){switch(this.oc._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Ec()-this.Rc());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}bc(){const t=Ht(this.oc._()),e=ei(u(0,0),t),i=this.getPointerLength(),s=this.Ec(),r=this.Vc(),n=this.Rc();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=ri(ri(o,si(t,-i)),si(e,s/2)),a=ri(h,si(e,(n-s)/2)),l=ri(a,si(t,-r)),c=ri(ri(o,si(t,-i)),si(e,-s/2)),d=ri(c,si(e,-(n-s)/2)),f=ri(d,si(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:Et(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class lo extends Dn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.fitTo=this.Qu.bind(this),this.setSize=this.fitTo,this.zc=this.Ts.Oc(i).Sl(e.PointShape.Plus).ke(B),this.Ou(this.zc)}$u(){return[this.zc]}setShape(t){return this.zc.Sl(t),this}getShape(){return this.zc.vl()}setRotation(t){return this.zc.zh(t),this}getRotation(){return this.zc.Oh()}setFillStyle(t){return this.zc.ke(t),this.Ts.bs(),this}getFillStyle(){return this.zc.Lh()}Fe(){const t=ut(this.getPosition({x:0,y:0},e.UISpace.Content),this.scale,this.renderingScale),i=Math.max(this.size.x,this.size.y);return this.zc.Nt(),i>0&&this.zc.q(i)._l(t),this}Qu(t){return this.setContentSize(t),this.Ts.bs(),this}Ju(){return 0}Ku(){return 0}tc(){return 0}qu(){return 0}}class uo extends kn{setSize(t){return this.setContentSize(t),this.Ts.bs(),this}}class co extends mn{constructor(){super(...arguments),this.Nc=[],this.Gc=0,this.Wc=t=>{const e=this.Nc.indexOf(t);e>=0&&this.Nc.splice(e,1)}}getMembers(){return this.Nc}getMemberCount(){return this.Nc.length}setMinimumSize(t){return this.Uc=t,this.Ts.bs(),this}getMinimumSize(){return this.Uc}addElement(t,e=-1){const i=t.fc(this.Ts,this.renderingScale,this.scale,this.Wc,this.qi,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.Nc.splice(e,0,i):this.Nc.push(i),i.setVisible(this.getVisible()),this.Ou(i),this.$i&&(fe(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.Nc.slice().forEach(Tt),this}setVisible(t){return super.setVisible(t),this.Nc.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof uo)),0),s=i>0?(this.size.x-this.Gc)/i:0;return this.Nc.reduce(((e,i)=>i instanceof uo?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)).Fe().getPosition(u(1,0)).x),t.x),this}Ds(){for(let t=0;tt+ +(e instanceof uo)),0),s=i>0?(this.size.y-this.Gc)/i:0;return this.Nc.reduce(((e,i)=>i instanceof uo?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)).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},vo=bo("Text",[]),Mo={button:void 0,isLocked:!1,setOn(t){if(!this.isLocked){const e=this.button.getOn()!==t;this.button.setOn(t),e&&this.D.emit("switch",t)}return this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.D.on("switch",(e=>t(this,e)))},offSwitch(t){return this.D.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()}},To={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},wo={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()}},Eo={...Mn,...Tn,background:no,fc(t,e,i,s,r,n){const o=new fo(t,e,i,this.background,s,r),h=o.addElement(ro,void 0),a=Object.assign(o,So,{setTextLabel:h},vo,{stylableTexts:[h]});return vn(a,r,n),this.applyStylers(a,r)}}.addStyler(Sn),ko={...Mn,...Tn,background:ao,fc(t,i,s,r,n,o){const h=new fo(t,i,s,this.background,r,n),a=h.addElement(ro,void 0),l=h.getBackground(),u=Object.assign(h,So,{setTextLabel:a},vo,{stylableTexts:[a]},wo,{pointable:l},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?this.setPadding({top:t}):this.getDirection()===e.UIDirections.Down?this.setPadding({bottom:t}):this.getDirection()===e.UIDirections.Right?this.setPadding({right:t}):this.getDirection()===e.UIDirections.Left&&this.setPadding({left:t}),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.Ac="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))),vn(u,n,o),this.applyStylers(u,n)}};class Co extends yn{constructor(t,e,i,s,n,o){super(t,e,i,n,o),this.Bs=!1,this.D=new r.Eventer,this.Hc=B,this.$c=B,this.getOn=()=>this.Bs,this.Xc=this.Ou(new lo(this.Ts,this.renderingScale,this.scale,wt,o).setShape(s)),this.$c=o.uiButtonFillStyleHidden||o.uiButtonFillStyle}$u(){return[...this.Xc.$u()]}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}setOn(t){return t===this.Bs||(this.Bs=t,this.Xc.setFillStyle(t?this.Hc:this.$c),this.Ts.bs()),this}setOffFillStyle(t){return this.$c="function"==typeof t?t(this.$c):t,this.Bs||this.Xc.setFillStyle(this.$c),this}getOffFillStyle(){return this.$c}setSize(t){return this.Xc.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.Xc.getSize()}setOnFillStyle(t){return this.Hc="function"==typeof t?t(this.Hc):t,this.Bs&&this.Xc.setFillStyle(this.Hc),this}getOnFillStyle(){return this.Hc}setButtonShape(t){return this.Xc.setShape(t),this.Ts.bs(),this}getButtonShape(){return this.Xc.getShape()}Fe(){return super.Fe(),this.Xc.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).Fe(),this}Ds(){const t=this.Xc.Ds().getSize();return this.setContentSize(t),super.Ds()}dispose(){return super.dispose(),this.Xc.dispose(),this}setMouseInteractions(t){return this.Xc.setMouseInteractions(t),this}getMouseInteractions(){return this.Xc.getMouseInteractions()}setHighlight(t){const e=Ae(t);return this.Xc.setHighlight(e),this.D.emit("highlight",this,t),this.Ts.bs(),this}getHighlight(){return this.Xc.getHighlight()}}const Do={...Mn,uiElement:Co,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},fc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.buttonShape,s,r),r);return vn(o,r,n),o}},Fo={...Mn,...Tn,background:no,buttonBuilder:Do,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},fc(t,i,s,r,n,o){const h=new fo(t,i,s,this.background,r,n),a=h.addElement(Ao);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Ao);u.addGap();const c=u.addElement(ro);u.addGap(),h.addGap();const d=Object.assign(h,So,{setTextLabel:c},vo,{stylableTexts:[c]},Mo,{button:l},To);let f;return d.onMouseClick(((t,e)=>{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:6}),vn(d,n,o),this.applyStylers(d,n)}}.addStyler(Sn).addStyler(bn);class Io extends yn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.jc=[],this.Zc=2,this.Qc="",this.Jc=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:ki(t.value,e.min,e.max),this.Kc=0,this.qc=0,this.td=!1,this.Ts=t,this.sd=n,this.ed=this.Ou(t.Te(e).Ce(rt)),this.hd=this.Ou(t.kr(e).ke(r.uiTextFillStyle).Vh(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.rd=140,this.nd=25):(this.rd=160,this.nd=15)}$u(){return[this.ed,this.hd]}od(t){this.ad=t;const e=Vo(t,"vertical"===this.sd?0:90,this.td);return this.ed.ke(e),this.Ts.bs(),this}ld(){return this.ad}ud(t){return this.rd=t,this.Ts.bs(),this}dd(){return this.rd}fd(t){return this.nd=t,this.Ts.bs(),this}Ad(){return this.nd}gd(t){return this.Qc=t,this.Ts.bs(),this}pd(){return this.Qc}md(t){return this.Jc=t,this.Ts.bs(),this}setLUTDisplayProportionalSteps(t){if(this.td=t,this.ad){const t=Vo(this.ad,"vertical"===this.sd?0:90,this.td);this.ed.ke(t)}return this.Ts.bs(),this}getLUTDisplayProportionalSteps(){return this.td}setFillStyle(t){return this.hd.ke(t),this.Ts.bs(),this}getFillStyle(){return this.hd.Lh()}setFont(t){return this.hd.Vh(t),this.Ts.bs(),this}getFont(){return this.hd.Eh()}setTextRotation(t){return this.qc=t,this.hd.zh(t),this.Ts.bs(),this}getTextRotation(){return this.hd.Oh()}Fe(){var t,i,s,r;if(super.Fe(),this.$i||!this.getVisible())return this;const n=this.ad;if(n){const o=this.renderingScale.Wi(),h=n.min,a=n.max;if("vertical"===this.sd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=ri(s,{x:this.ed.oi().x+this.Zc*o.x,y:0}),l={x:r.x,y:r.y+(this.Qc.length>0?this.Kc*o.y+this.hd.oi().y:0)+.5*((null===(t=this.jc[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.jc[this.jc.length-1])||void 0===i?void 0:i.oi().y)||0)};this.ed.Ie({x:s.x,y:l.y}),this.hd.Ja({x:-1,y:-1}).Ie(r),n.getSteps().forEach(((t,e)=>{const i=He(l,u,this.td?!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.jc[e].Ja({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.jc.reduce(((t,e)=>Math.max(t,e.oi().y)),0),u=ri(t,{x:.5*((null===(s=this.jc[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.jc[this.jc.length-1])||void 0===r?void 0:r.oi().x)||0)+(this.Qc.length>0?this.Kc*o.x+this.hd.oi().x:0)),y:u.y},f={x:u.x,y:u.y+this.Zc*o.y};this.ed.Ie(f),this.hd.Ja({x:1,y:1}).Ie(c),n.getSteps().forEach(((t,e)=>{const i=He(u,d,this.td?!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.jc[e].Ja({x:0,y:1}).Ie(i)}))}}return this}Ds(){if(this.ad&&this.getVisible()){const t=this.ad.getSteps();for(let e=this.jc.length;eMath.max(t,e.Ds().Cc().x)),0),this.hd.Ds().Cc().x),s=(this.Qc.length>0?this.Kc+this.hd.Ds().Cc().y:0)+e+.5*this.jc[0].Ds().Cc().y+.5*this.jc[this.jc.length-1].Ds().Cc().y;this.setContentSize({x:i,y:s})}else{const t=this.rd,e=this.nd;this.ed.q({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Qc.length>0?this.Kc+this.hd.Ds().Cc().x:0,.5*this.jc[this.jc.length-1].Ds().Cc().x),s=t+.5*this.jc[0].Ds().Cc().x+i,r=e+this.Zc+this.jc.reduce(((t,e)=>Math.max(t,e.Ds().Cc().y)),0);this.setContentSize({x:s,y:r})}}else this.jc.forEach((t=>t.dispose())),this.jc.length=0,this.hd.setVisible(!1),this.ed.setVisible(!1),this.setContentSize({x:0,y:0});return super.Ds()}dispose(){return super.dispose(),this.ed.dispose(),this.jc.forEach(Tt),this.hd.dispose(),this}setMouseInteractions(t){return this.ed.setMouseInteractions(t),this}getMouseInteractions(){return this.ed.getMouseInteractions()}}const Lo={lutElement:{},setLUT(t){return this.lutElement.od(t),this},getLUT(){return this.lutElement.ld()},setLUTLength(t){return this.lutElement.ud(t),this},getLUTLength(){return this.lutElement.dd()},setLUTThickness(t){return this.lutElement.fd(t),this},getLUTThickness(){return this.lutElement.Ad()},setLookUpUnit(t){return this.lutElement.gd(t),this},getLookUpUnit(){return this.lutElement.pd()},setLUTStepValueFormatter(t){return this.lutElement.md(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},zo={...Mn,...Tn,background:no,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},fc(t,e,i,s,r,n){const o=new go(t,e,i,this.background,s,r),h=o.addElement({fc:()=>new Io(t,e,i,wt,r,this.alignment)}),a=Object.assign(o,vo,{stylableTexts:[h]},Lo,{lutElement:h});return vn(a,r,n),this.applyStylers(a,r)}}.addStyler(Sn),Vo=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new et({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 Io(t,i,s,wt,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,So,{setTextLabel:c},vo,{stylableTexts:[c,d]},bo("LUTText",[d]),Mo,{button:l},Lo,{lutElement:d},To);let g;return f.onMouseClick((()=>{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:6}),this.applyStylers(f,n)}}.addStyler(Sn).addStyler(bn),Ro={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 Gh?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.ld&&t.ld(),n=t.yd&&t.yd(),o=void 0!==s&&s;let h=i;if(!h){let t=r?Po.setAlignment(this.alignment):Fo;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),this},addChart(t,e,i,s){return t.Sd().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof Gh)).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}},Bo={alignment:"vertical",layoutBuilder:Ao,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?xo:Ao}},getAlignment(){return this.alignment},titleBuilder:Eo,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},_o={...Mn,...Tn,...Bo,background:no,fc(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).fc(t,e,i,s,r,!1);let h=Object.assign(o,Ro,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.$i});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Ao:xo),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}),vn(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class Oo extends yn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.vd=10,this.xd=e.UIDirections.Up,this.bd=0,this.Ac="major",this._a=this.Ou(t.kr(this.renderingScale)),this.Re=this.Ou(t.Ve(this.renderingScale))}$u(){return[this._a]}Fe(){if(super.Fe(),this.$i)return this;const t=ut(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.pi(t,{x:this.xd===e.UIDirections.Right?-this.vd:this.xd===e.UIDirections.Left?this.vd:0,y:this.xd===e.UIDirections.Up?-this.vd:this.xd===e.UIDirections.Down?this.vd:0}),s=this.renderingScale.pi(i,{x:this.xd===e.UIDirections.Right?-this.bd:this.xd===e.UIDirections.Left?this.bd:0,y:this.xd===e.UIDirections.Up?-this.bd:this.xd===e.UIDirections.Down?this.bd:0});return this.Re.Oe(t).ze(i),this._a.Ie(s).Ja(this.xd===e.UIDirections.Up?{x:0,y:1}:this.xd===e.UIDirections.Down?{x:0,y:-1}:this.xd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Ds(){const t=this.Re.ku().getThickness();return this.size=this.xd===e.UIDirections.Left||this.xd===e.UIDirections.Right?{x:this.vd+this.bd+this._a.Ds().Cc().x,y:t}:{y:this.vd+this.bd+this._a.Ds().Cc().y,x:t},super.Ds()}dispose(){return super.dispose(),this._a.dispose(),this.Re.dispose(),this}setVisible(t){return super.setVisible(t),this._a.setVisible(t),this.Re.setVisible(t),this}setMouseInteractions(t){return this._a.setMouseInteractions(t),this.Re.setMouseInteractions(t),this}getMouseInteractions(){return this._a.getMouseInteractions()}getText(){return this._a.Ph()}setTextFillStyle(t){return this._a.ke(t),this.Ts.bs(),this}getTextFillStyle(){return this._a.Lh()}setTextFont(t){return this._a.Vh(t),this}setTextRotation(t){return this._a.zh(t),this}getTextRotation(){return this._a.Oh()}getTextFont(){return this._a.Eh()}setText(t){return this._a.Bh(t),this.Ts.bs(),this}setDirection(t){return this.xd=t,this.Ts.bs(),this}getDirection(){return this.xd}setPointerLength(t){return this.vd=t,this.Ts.bs(),this}getPointerLength(){return this.vd}setTickLabelPadding(t){return this.bd=t,this.Ts.bs(),this}getTickLabelPadding(){return this.bd}setTickStyle(t){return this.Re.Ee(t),this.Ts.bs(),this}getTickStyle(){return this.Re.ku()}}const No={...Mn,fc(t,e,i,s,r,n){const o=new Oo(t,e,i,s,r);return vn(o,r,n),this.applyStylers(o,r)}}.addStyler(Sn),Uo=No.addStyler(((t,e)=>(t.Ac="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)))),Go=No.addStyler(((t,e)=>(t.Ac="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)))),Wo=Fo.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),Yo=_o.setAlignment("horizontal"),Ho=_o.setAlignment("vertical"),Xo={TextBox:Eo,CheckBox:Fo,ButtonBox:Wo,PointableTextBox:ko,AxisTickMajor:Uo,AxisTickMinor:Go,LUTRange:zo},$o={HorizontalLegendBox:Yo,VerticalLegendBox:Ho},jo=(t,e)=>{if(Bi(t)){const i=e.$o(t);return{x:i.engineX,y:i.engineY}}return t},qo=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}},Jo=(t,e,i,s=1)=>kt(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),Zo=(t,e,i,s=1)=>{const r=i.ct(t),n=i.ct(e);return kt(i.ut(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)};class Ko extends Js{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this.Md=r,this._d=n}}class Qo extends qs{constructor(t,i,s,n,o,h,a,l,c,d,f,g,y,m,p,A,x){var S;super(f,d,l,p,A,{numeric:d.getWidth({x:p.xAxisNumericTicks,y:p.yAxisNumericTicks}),datetime:d.getWidth({x:p.xAxisDateTimeTicks,y:p.yAxisDateTimeTicks}),time:d.getWidth({x:p.xAxisTimeTicks,y:p.yAxisTimeTicks})},x),this.wd=new Map,this.Cd=void 0,this.kd=0,this.Td=[],this.Fd=[],this.Je=Rs.fitting,this.Id=!0,this.Pd=0,this.Dd=8,this.Bd=void 0,this.Ld=void 0,this.Rd=20,this.Ed=1,this.Vd=!0,this.zd=!0,this.Od=!0,this.Nd=!0,this.Gd=!0,this.Wd=!0,this.Ud=!0,this.Yd=!0,this.Hd=!0,this.$d=!0,this.Xd=this.Mh.defaultDragMouseStyle,this.jd=this.Mh.defaultDragMouseStyle,this.Zd=this.Mh.defaultDragMouseStyle,this.Qd=this.Mh.defaultDragMouseStyle,this.Jd=this.Mh.defaultDragMouseStyle,this.D=new r.Eventer,this.Kd=[],this.qd=t=>{const e=this.Fd.indexOf(t);e>=0&&this.Fd.splice(e,1)},this.tf=t=>(this.Fd.indexOf(t)<0&&this.Fd.push(t),this.qd),this.Et=(t,e)=>this.D.emit("axisAreaTouch",this,e),this.if=Zt(this.Kd),this.onAxisInteractionAreaMouseClick=t=>this.D.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.D.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.D.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.D.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.D.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.D.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.D.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.D.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.D.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.D.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.D.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.D.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.D.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.D.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.D.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.D.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.D.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.D.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.D.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.D.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.D.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.D.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.D.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.D.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.D.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.D.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.D.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.D.off(t,"axisAreaTouchEnd"),this.sf=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().yc()):t,this.ef=t=>{const e=this.Td.indexOf(t);-1!==e&&this.Td.splice(e,1)},this.hf=(t,e)=>{this.D.emit("axisAreaDoubleClick",this,e),this.Nd&&(this.setStopped(!1),$t(e))},this.rf=t=>{this.D.emit("axisAreaMouseEnter",this),(this.zd||this.Vd||this.Od||this.Nd)&&this.nf(t)},this.af=t=>{this.lf(t),this.D.emit("axisAreaMouseLeave",this)},this.uf=(t,e,i)=>{var s,r;this.D.emit("axisAreaMouseDragStart",this,e,i);const n=Dt(null===(s=this.chart.fs.no)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Dt(null===(r=this.chart.fs.no)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.zd?(this.cf(t),$t(e)):i===n&&this.Vd&&(this.df(t,h),$t(e))},this.ff=(t,e,i,s,r)=>{var n,o;this.D.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Dt(null===(n=this.chart.fs.no)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Dt(null===(o=this.chart.fs.no)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.zd?(this.Af(t,r),$t(e)):i===h&&this.Vd&&(this.gf(t,s,l,r),$t(e))},this.pf=(t,e,i,s)=>{var r,n;this.D.emit("axisAreaMouseDragStop",this,e,i,s);const o=Dt(null===(r=this.chart.fs.no)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Dt(null===(n=this.chart.fs.no)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.zd?(this.mf(t),$t(e)):i===o&&this.Vd&&(this.yf(t,s,a),$t(e)),t.getIsUnderMouse()&&(this.zd||this.Vd||this.Od||this.Nd)&&this.nf(t)},this.Sf=(t,e)=>{if(this.D.emit("axisAreaMouseWheel",this,e),this.Od){this.setStopped(!0);const t=this.Mh.getWidth(this.vf.us.De(e.clientX,e.clientY)),i=this.dt.ut(t);this.zoom(i,de(e)),$t(e)}},this.xf=(t,e)=>this.D.emit("axisAreaMouseClick",this,e),this.bf=(t,e)=>this.D.emit("axisAreaMouseDown",this,e),this.Mf=(t,e)=>this.D.emit("axisAreaMouseUp",this,e),this._f=(t,e)=>this.D.emit("axisAreaMouseMove",this,e),this.wf=(t,e,i)=>{this.D.emit("axisAreaTouchStart",this,i),this.Vd&&(this.nf(t),this.df(t,e),$t(i))},this.Cf=(t,e,i,s,r)=>{this.D.emit("axisAreaTouch",this,r),this.Vd&&(this.gf(t,e,i,s),$t(r))},this.kf=(t,e,i,s)=>{this.D.emit("axisAreaTouchEnd",this,s),this.Vd&&(this.yf(t,e,i),this.lf(t),$t(s))},this.Tf=(t,e,i,s)=>{(this.zd||this.Od)&&(this.nf(t),this.cf(t),$t(s))},this.Ff=(t,e,i,s,r,n)=>{if(this.zd){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.Af(t,e),$t(n)}if(this.Od){const t=this.vf.us.De(e.x,e.y),o=this.vf.us.De(i.x,i.y),h=Math.abs(this.Mh.getWidth(ni(t,s))-this.Mh.getWidth(ni(o,r)))-Math.abs(this.Mh.getWidth(t)-this.Mh.getWidth(o)),a=this.dt.pi(this.Th,-h),l=this.dt.pi(this.Fh,h);this.jh(a,l,!0),$t(n)}},this.If=(t,e,i,s)=>{(this.zd||this.Od)&&(this.mf(t),this.lf(t),$t(s))},this.Pf=(t,e)=>{(this.Gd||this.Wd)&&this.Df(t)},this.Bf=(t,e)=>{this.Lf(t)},this.Rf=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Gd&&this.Ef(t,s)},this.Vf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gd&&this.zf(t,n,s,r)},this.Of=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gd&&this.Nf(t,n,s,r)},this.Gf=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.Gd||this.Wd)&&this.Wf(t,r,s),(this.Gd||this.Wd)&&this.Df(t)},this.Uf=(t,e)=>{this.Wd&&(this.setStopped(!0),this.zoom(this.Th,de(e)),$t(e))},this.Yf=(t,e)=>{this.Wd&&(this.setStopped(!0),this.zoom(this.Fh,de(e)),$t(e))},this.Hf=(t,e,i)=>{this.Gd&&(this.Df(t),this.Ef(t,e),$t(i))},this.$f=(t,e,i,s,r)=>{this.Gd&&(this.zf(t,e,i,s),$t(r))},this.Xf=(t,e,i,s,r)=>{this.Gd&&(this.Nf(t,e,i,s),$t(r))},this.jf=(t,e,i,s)=>{this.Gd&&(this.Wf(t,e,i),this.Lf(t),$t(s))},this.Md=t,this.Zf=i,this.vf=s,this.Qf=o,this.Jf=h,this.chart=f,this.Kf=y,this.qf=n,this.ss=a,"logarithmic"!==x.type||this.chart.fs.Vn||this.chart.fs.zn||this.chart.fs.eo||this.chart.us.As(St.atob("bG9nIGF4aXM=")),m(this,this.tf),l.tA=this,this.iA=g,this.sA=this.iA>50?1:-1,this.eA=(S=this.Mh.toPoint(0,-this.sA),Math.abs(S.x)>=Math.abs(S.y)?S.x>=0?e.UIDirections.Right:e.UIDirections.Left:S.y>=0?e.UIDirections.Up:e.UIDirections.Down),this.hA=c,this.rA=this.dt instanceof Fi?(new zi).Ri(this.Mh.toVec2(this.dt,this.hA)):(new Vi).Ri(this.Mh.toVec2(this.dt,this.hA)),this.nA=this.chart.pixelScale,this.oA=(new zi).Ri(this.Mh.toVec2(this.Mh.getWidth(this.nA),this.hA)),this.aA=this.vf.Ve(this.rA).setMouseInteractions(!1),this.lA=this.vf.Ve(this.rA).setMouseInteractions(!1),this.uA=this.vf.Ve(this.rA).setMouseInteractions(!1),this.cA=this.qf.Te(this.nA).ke(d.getWidth({x:p.xAxisOverlayStyle,y:p.yAxisOverlayStyle})).Ce(rt).aa(p.highlightColorOffsetAxisOverlay||p.highlightColorOffset),this.dA=this.qf.Te(this.nA).ke(d.getWidth({x:p.xAxisZoomingBandFillStyle,y:p.yAxisZoomingBandFillStyle})).Ce(d.getWidth({x:p.xAxisZoomingBandStrokeStyle,y:p.yAxisZoomingBandStrokeStyle})),this.fA=this.qf.Te(this.nA).ke(d.getWidth({x:p.xAxisOverlayStyle,y:p.yAxisOverlayStyle})).Ce(rt).aa(p.highlightColorOffsetAxisOverlay||p.highlightColorOffset),this.AA=this.qf.Te(this.nA).ke(d.getWidth({x:p.xAxisOverlayStyle,y:p.yAxisOverlayStyle})).Ce(rt).aa(p.highlightColorOffsetAxisOverlay||p.highlightColorOffset),this.Dh=this.qf.kr(this.rA).setMouseInteractions(!1).zh(this.Mh.getTitleTextRotation(this.sA)),this.chart.us.ls.os(this.cA,(t=>this.cA.cs(t)),{animationEnabled:this.th}),this.chart.us.ls.os(this.fA,(t=>this.fA.cs(t)),{animationEnabled:this.th}),this.chart.us.ls.os(this.AA,(t=>this.AA.cs(t)),{animationEnabled:this.th});const b=Yi(new Xi(this.wf,this.Cf,this.kf,1),new $i(this.Tf,this.Ff,this.If),new Hi(this.hf)),v=Yi(new Xi(this.Hf,this.$f,this.jf)),M=Yi(new Xi(this.Hf,this.Xf,this.jf));this.cA.setMouseEnterEventHandler(this.rf).setMouseLeaveEventHandler(this.af).setMouseDragStartEventHandler(this.uf).setMouseDragEventHandler(this.ff).setMouseDragStopEventHandler(this.pf).setMouseWheelEventHandler(this.Sf).setMouseDoubleClickEventHandler(this.hf).setMouseClickEventHandler(this.xf).setMouseDownEventHandler(this.bf).setMouseUpEventHandler(this.Mf).setMouseMoveEventHandler(this._f).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.fA.setMouseEnterEventHandler(this.Pf).setMouseLeaveEventHandler(this.Bf).setMouseDragStartEventHandler(this.Rf).setMouseDragEventHandler(this.Vf).setMouseDragStopEventHandler(this.Gf).setMouseWheelEventHandler(this.Uf).setTouchStartEventHandler(v.onTouchStart).setTouchMoveEventHandler(v.onTouchMove).setTouchEndEventHandler(v.onTouchEnd),this.AA.setMouseEnterEventHandler(this.Pf).setMouseLeaveEventHandler(this.Bf).setMouseDragStartEventHandler(this.Rf).setMouseDragEventHandler(this.Of).setMouseDragStopEventHandler(this.Gf).setMouseWheelEventHandler(this.Yf).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.aA.Ee(d.getWidth({x:p.xAxisStrokeStyle,y:p.yAxisStrokeStyle})),this.lA.Ee(d.getWidth({x:p.xAxisNibStyle,y:p.yAxisNibStyle})),this.uA.Ee(d.getWidth({x:p.xAxisNibStyle,y:p.yAxisNibStyle})),this.Dh.ke(d.getWidth({x:p.xAxisTitleFillStyle,y:p.yAxisTitleFillStyle})).Vh(d.getWidth({x:p.xAxisTitleFont,y:p.yAxisTitleFont})),this.es=a.hs(this,{}),this.Nh=this.es.gA([this.Dh]).xs(p.effectsText)}wr(){return this.eh}Cr(){return void 0!==this.Xh}setTickStrategy(t,e){return super.kh(t,e)}getTickStrategy(){return this.je}addBand(t=!0){const e=t?this.Jf:this.Qf,i=new Vs(e,this.chart,this.if,this,this.rA,this.Mh,this.qi,this.ss);return this.Kd.push(i),i}addConstantLine(t=!0){const e=t?this.Jf:this.Qf,i=new Ps(e,this.chart,this.if,this,this.rA,this.Mh,this.qi,this.ss);return this.Kd.push(i),i}pA(t){this.Kd.forEach(t)}mA(t){return this.Kd.map(t)}getHighlighters(){return this.Kd}setThickness(t){return"number"==typeof t?(this.yA=t,this.SA=t):"object"==typeof t&&(this.yA=t.min,this.SA=t.max),this.Md.bs(),this}getThickness(){return{min:this.yA,max:this.SA}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}vA(){return this.Fd}ar(t,e){return new Ko(e,t,this.vf,this.rA,this.Md,this.rA)}Gh(){if(this.wd){for(const t of this.wd)t[1].grid.dispose(),t[1].tick.dispose();this.wd.clear()}super.Gh()}lr(t,e){const{tickStart:i}=e,s=t.Sh.nr,r=i+s.getTickLength()*this.sA+s.getTickPadding()*this.sA;t.Ye.Ie(this.Mh.toPoint(t.S,r)).Ja(this.Mh.toPoint(s.getLabelAlignment(),-this.sA)).zh(s.labelRotation).setVisible(this.getVisible())}xA(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.Sh.nr,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.sA;return{gridStroke:{start:this.Mh.toPoint(t.S,r),end:this.Mh.toPoint(t.S,h)},tickStroke:{start:this.Mh.toPoint(t.S,n),end:this.Mh.toPoint(t.S,a)}}}bA(t,e,i,s){return this.Md.Ve(this.rA).Ee(new qi({fillStyle:new U({color:E(360*(1-s))}),thickness:5})).Oe(this.Mh.toVec2(t,0)).ze(this.Mh.toVec2(t,this.sA*(50*s)))}br(t,e){return"linear"===this.wh.type?Jo(t,e,this.dt):Zo(t,e,this.dt)}MA(t,e){return e instanceof Fi?Jo:Zo}_r(t,e,i){if("logarithmic"!==this.wh.type){const s=this.dt.Li(e-t);return{min:t-i*s,max:e+i*s}}const s=this.dt;return{min:s.pi(t,-i),max:s.pi(e,i)}}Fe(t,e,i){const s=this.aA.ku(),r=this.dt.getInnerStart()this.dt.getInnerStart()?this.dt.getInnerEnd():this.dt.getInnerStart(),o=this.dt.ri(),h=this.hA.getInnerInterval(),a=s.getThickness()*this.sA/2,l=this.iA/100*h,u=l+t,c=h*this.sA,d=u+a,f=this.Td.reduce(this.sf,0);let g,y=0;if(this.Xi||this.Gh(),this.Xe!==Ns&&this.Xi){const t=this.dt.ri();this.Jh({physicalAxisSize:t,startPosition:l,gridStrokeLen:c,gridStrokeStart:u,tickStart:d});for(const[e,i]of this.Ze){let s=this.wd.get(e);if(!s)if(e.Ne)s={grid:this.Md._A(this.rA).setMouseInteractions(!1),tick:this.Md._A(this.rA).setMouseInteractions(!1)};else if("wA"in e){const t=Array.from(this.Ze.keys()).filter((t=>"wA"in t)).reverse().indexOf(e),i=this.Zf[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._A(this.rA).setMouseInteractions(!1),tick:i._A(this.rA).setMouseInteractions(!1)}}if(s){s.grid.Nt(),s.tick.Nt();for(const[e,r]of i){const e=this.xA(r,{physicalAxisSize:t,startPosition:l,gridStrokeLen:c,gridStrokeStart:u,tickStart:d});s.grid.Lr().CA(e.gridStroke.start,e.gridStroke.end),s.tick.Lr().CA(e.tickStroke.start,e.tickStroke.end)}s.grid.Ee(e.nr.getGridStrokeStyle()),s.tick.Ee(e.nr.getTickStyle()),this.wd.set(e,s)}}for(const t of this.Ze.values()){let e=Le;for(const i of t.values()){const t=i.Sh.nr,s=this.Mh.getHeight(i.Ye.oi()),r=t.getTickLength()+t.getTickPadding()+s+t.getLabelPadding();e=Math.max(e,r)}y=Math.max(y,e)}g=d+Math.max(y,f)*this.sA}else y=0,g=d+f*this.sA;this.aA.Oe(this.Mh.toPoint(r,u)).ze(this.Mh.toPoint(n,u)),this.lA.Oe(this.Mh.toPoint(this.dt.pi(this.dt.getInnerStart(),this.Dd),u)).ze(this.Mh.toPoint(this.dt.getInnerStart(),u)),this.uA.Oe(this.Mh.toPoint(this.dt.pi(this.dt.getInnerEnd(),-this.Dd),u)).ze(this.Mh.toPoint(this.dt.getInnerEnd(),u));const m=this.Dh&&this.Dh.Ph().length>0?this.Mh.getHeight(this.Dh.Ds().oi()):0,p=g+.5*m*this.sA;this.Dh.Ie(this.Mh.toPoint(this.dt.pi(this.dt.getInnerStart(),o/2),p));const A=d,x=A+this.sA*this.kd,S=this.Gd||this.Wd?Math.min(this.Rd,.25*o):0,b={start:this.Mh.toVec2(this.dt.pi(this.dt.getInnerStart(),S),A),end:this.Mh.toVec2(this.dt.pi(this.dt.getInnerEnd(),-S),x)};if(this.Cd){const e=this.iA/100*h+t,i=-this.sA*h-t,s={start:this.Mh.toVec2(this.Cd.min,d+this.sA*this.kd),end:this.Mh.toVec2(this.Cd.max,e+i)},r=ut(s.start,this.rA,this.nA),n=ut(s.end,this.rA,this.nA);this.dA.Ie(r).q(ni(n,r)).setVisible(!0)}else this.dA.setVisible(!1);const v=ut(this.Mh.toVec2(this.dt.getInnerStart(),x),this.rA,this.nA),M=ut(b.start,this.rA,this.nA),T=ut(b.end,this.rA,this.nA),w=ut(this.Mh.toVec2(this.dt.getInnerEnd(),A),this.rA,this.nA);this.cA.Ie(M).q(ni(T,M)),this.fA.Ie(v).q(ni(M,v)),this.AA.Ie(T).q(ni(w,T));for(const e of this.Td)e.update().plot(u,c,t,d);for(const t of this.Kd)t.Fe();const E=s.getThickness()+Math.max(y,f)+(this.Dh&&this.Dh.Ph().length>0?m+this.Pd:0);return this.kd=this.Xi?kt(E,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:Ie):0,this}kA(t){const e=this.aA.ku().getThickness()*this.sA/2,i=this.hA.getInnerInterval(),s=this.iA/100*i+t,r=s+e,n=i*this.sA,o=r+e;for(const e of this.Td)e.update().plot(s,n,t,o);for(const t of this.Kd)t.Fe()}TA(){return this.kd}FA(t,e){e=e||Xo.AxisTickMajor;const i=new xn(this,t?this.Md:this.qf,this.qf,this.dt,this.oA,this.oA,this.Mh,this.eA,this.ef,this.qi,e).setTextFormatter(this.formatValue);return this.Td.push(i),i}nf(t){this.chart.us.ls.ws(t,1),this.Bd=t.us.Er(this.Xd,this.Bd)}lf(t){this.chart.us.ls.ws(t,0),t.us.Vr(this.Bd)}cf(t){this.setStopped(!0),t.us.Vr(this.Bd)}Af(t,e){const i=-this.Mh.getWidth(e);this.pan(i),this.Bd=t.us.Er(this.jd,this.Bd)}pan(t){const e=this.Th,i=this.Fh,s=this.dt.pi(e,t),r=this.dt.pi(i,t);this.jh(s,r,!1)}zoom(t,e){const i=this.dt.ct(this.Th),s=this.dt.ct(this.Fh),r=this.dt.ct(t),n=kt((r-i)/(s-i),0,1),o=.2*this.dt.ri(),h=n*this.Ed*o*-e,a=(1-n)*this.Ed*o*e,l=this.dt.pi(this.Th,h),u=this.dt.pi(this.Fh,a);this.jh(l,u,!0)}mf(t){this.Cd=void 0,t.us.Vr(this.Bd)}df(t,e){this.setStopped(!0),t.us.Vr(this.Bd),this.chart.us.ls.ws(this.cA,0)}gf(t,e,i,s){const r=ut(this.vf.us.De(i.x,i.y),this.vf.us.dt,this.rA),n=kt(this.Mh.getWidth(r),this.Th,this.Fh),o=this.Mh.getWidth(ut(this.vf.us.De(e.x,e.y),this.vf.us.dt,this.rA));Math.abs(this.dt.ct(n)-this.dt.ct(o))>10?(this.Cd=y(Math.min(n,o),Math.max(n,o)),this.Bd=t.us.Er(this.Zd,this.Bd)):(this.Cd=void 0,this.Bd=t.us.Er(this.Xd,this.Bd)),this.vf.bs()}yf(t,e,i){if(this.Cd){const t=this.Cd.min,e=this.Cd.max,i=this.Fh{e.vs(t)}));for(const e of this.wd.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.Md.bs(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.th),this}}const th={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},eh={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},ih=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof Qo&&"y"in t&&t.y instanceof Qo),sh=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new qi,tickLength:7,tickStyle:new qi,tickPadding:0,labelFont:new ir,labelFillStyle:new U,labelPadding:0,labelAlignment:0,labelRotation:0});class rh extends sh{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 nh=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),oh=new rh({labelFillStyle:B,gridStrokeStyle:rt,tickStyle:rt}),hh=t=>nh(t)&&_(t.labelFillStyle)&&nt(t.gridStrokeStyle)&&nt(t.tickStyle),ah=(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},lh=(t,e,i,...s)=>ah(-1,t,e,i,s),uh=(t,e,i,...s)=>ah(-1,t,e,i,s),ch=(t,e,i,...s)=>ah(0,t,e,i,s),dh=(t,e,...i)=>ah(1,t,e,void 0,i),fh=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},gh=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:Hs({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:Hs(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:lh("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Xs(5,10,15,30)},minorTicks:{amount:4,fitFunction:Hs(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:lh("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Xs(5,10,15,30)},minorTicks:{amount:12,fitFunction:Hs(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:lh("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Xs(3,6,12)},minorTicks:{amount:8,fitFunction:Hs(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:lh("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:Hs({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:Hs({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:fh(-1),getNextKeyValueIncludingRef:fh(0),getNextKeyValue:fh(1),greatTicks:!0,majorTicks:{fitFunction:Hs(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:uh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:ch("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:dh("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Hs(void 0,2,3)},minorTicks:{fitFunction:Hs(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:uh("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:ch("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:dh("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Hs({ignore:"first"},2,5)},minorTicks:{fitFunction:Hs(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:uh("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:ch("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:dh("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Hs(void 0,2,4)},minorTicks:{fitFunction:Hs(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:uh("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:ch("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:dh("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:uh("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:ch("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:dh("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],yh=(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=yh("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(gh.indexOf(h)<=gh.findIndex((t=>"Hour"===t.label)))return"left"===i?[a]:[];let c;if(!0===h.irregular)c=Ys(s,r,h.getPrevKeyValue(t,e),h.getNextKeyValue(t,e));else{const i=h.greatTicks.getReferenceKeyValue(t,e)(s);c=Ws(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||Ge(d,l,u)?[a]:[d]:void 0!==d&&Ge(d,l,u)?[d]:[u]},ph=(t,e,i)=>(s,r,n,o)=>{const h=yh(t,n,o);let a;if(void 0===h)return[];if("great"===t&&void 0!==h.greatTicks)if(!0===h.irregular)a=Ys(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i));else{const t=h.greatTicks.getReferenceKeyValue(e,i)(s);a=Ws(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 gh[gh.indexOf(t)+1]})(h);if(void 0===t)return[];a=Gs(s,r,t.unit/h.minorTicks.amount,1)}}return a},Ah=t=>(e,i,s,r,n,o)=>{const h=yh(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},xh=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new rh,majorTickStyle:new rh,minorTickStyle:new rh,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 Sh extends xh{Wh(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>gh.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]},`;St.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=yh(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){const t=Et(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[gh.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{Ye:"Great ticks (directive)",wA:0,Ge:!0,Ir:ph("great",e,this.utc),Pr:void 0},{Ye:"Major ticks",wA:1,nr:this.majorTickStyle,hr:n("major"),Ir:ph("major",e,this.utc),xh:{ur:Ah("major")},Pr:void 0}];hh(this.greatTickStyle)||(o.push({Ye:"Great ticks (left)",nr:this.greatTickStyle.setLabelAlignment(-1),hr:n("great","left"),Ir:mh(e,this.utc,"left"),Ne:!0,Ar:!1}),o.push({Ye:"Great ticks (right)",nr:this.greatTickStyle.setLabelAlignment(1),hr:n("great","right"),Ir:mh(e,this.utc,"right"),Ne:!0,Ar:!1})),hh(this.minorTickStyle)||h.push({Ye:"Minor ticks",wA:2,nr:this.minorTickStyle,hr:n("minor"),Ir:ph("minor",e,this.utc),xh:{ur:Ah("minor"),bh:(t,e,i,s,r,n)=>{const o=yh("minor",r,n);return!o||"Week"!==o.label}},Pr:void 0});const a=this.cursorFormatter;return{He:o,$e: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)} `},Hh:1e3,$h:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}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 bh=(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 Ws(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,Gs(i,s,o,h)},vh=(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,Mh=(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,Th=Hs(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,Eh=(t,e)=>{const i=vi(t),s=Mi(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&&sCi.LogarithmicNoExponents(e,i,void 0,t.base):Ci.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ci.LogarithmicNoExponents(e,i,void 0,t.base):Ci.Numeric),r=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ci.LogarithmicNoExponents(e,i,void 0,t.base):Ci.Numeric),n=[],o=[];hh(this.extremeTickStyle)||n.push({Ye:"Extreme ticks",nr:this.extremeTickStyle,hr:void 0===e?i:(t,s,r)=>i(e+t,s,r),Ir:Us,Ne:!0,Ar:!0}),o.push({Ye:"Major ticks",wA:0,nr:this.majorTickStyle,hr:void 0===e?s:(t,i,r)=>s(e+t,i,r),Ir:"logarithmic"===t.type?Eh(t.base,!0):bh(0,!0),xh:"logarithmic"===t.type?{ur:Mh}:{ur:vh},Pr:void 0}),hh(this.minorTickStyle)||o.push({Ye:"Minor ticks",wA:1,nr:this.minorTickStyle,hr:void 0===e?r:(t,i,s)=>r(e+t,i,s),Ir:"logarithmic"===t.type?Eh(t.base,!1):bh(1,!1),xh:"logarithmic"===t.type?{ur:wh}:{ur:Th},Pr:50});const h=this.cursorFormatter?this.cursorFormatter:Ci.Numeric;return{He:n,$e:o,We:void 0===e?h:(t,i,s)=>h(e+t,i,s),Hh:1e-9,$h: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")}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 Dh=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new rh,minorTickStyle:new rh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Fh=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=6e4?"MajorMinutes":i>=1e4?"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"},Ih={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}${ue(s,2)}:${ue(r,2)}:${ue(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}${ue(s,2)}:${ue(r,2)}:${ue(n,2)}.${ue(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}${ue(s,2)}:${ue(r,2)}:${ue(n,2)}.${ue(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}${ue(s,2)}:${ue(r,2)}:${ue(n,2)}.${ue(o,3)}${h}`}},Lh={MajorHours12:{major:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Ws(t,e,r,void 0,1e6)},fitKeyValues:Hs({ignore:"first"},2,4)},minor:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,36e5,1e6),fitKeyValues:Hs({},2,3,4,6)},defaultValueFormatter:Ih.hhmmss},MajorHours:{major:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Ws(t,e,r,void 0,1e6)},fitKeyValues:Hs({ignore:"first"},2,6,12)},minor:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,3e5,1e6),fitKeyValues:Hs({},2,4,6)},defaultValueFormatter:Ih.hhmmss},MajorMinutes15:{major:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Ws(t,e,9e5,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2)},minor:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,6e4,1e6),fitKeyValues:Hs({},3,5)},defaultValueFormatter:Ih.hhmmss},MajorMinutes:{major:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Ws(t,e,6e4,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,5e3,1e6),fitKeyValues:Hs({},2,3,4,6)},defaultValueFormatter:Ih.hhmmss},MajorSeconds15:{major:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Ws(t,e,15e3,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,4)},minor:{format:Ih.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,1e3,1e6),fitKeyValues:Hs({},3,5)},defaultValueFormatter:Ih.hhmmss},MajorSeconds:{major:{format:Ih.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Ws(t,e,1e3,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmm,getKeyValues:(t,e,i,s)=>Gs(t,e,100,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.hhmmssmmm},MajorMilliseconds100:{major:{format:Ih.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Ws(t,e,100,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmm,getKeyValues:(t,e,i,s)=>Gs(t,e,10,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.hhmmssmmm},MajorMilliseconds10:{major:{format:Ih.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Ws(t,e,10,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmm,getKeyValues:(t,e,i,s)=>Gs(t,e,1,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.hhmmssmmm},MajorMilliseconds:{major:{format:Ih.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Ws(t,e,1,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Gs(t,e,.1,1e6),fitKeyValues:Hs({},2)},defaultValueFormatter:Ih.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Ih.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Ws(t,e,.1,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Gs(t,e,.01,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Ih.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Ws(t,e,.01,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Gs(t,e,.001,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Ih.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Ws(t,e,.001,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Gs(t,e,100*1e-6,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Ih.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Ws(t,e,r,void 0,1e6)},fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:Ih.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Gs(t,e,10*1e-6,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:Ih.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 zh extends Dh{Wh(t){const e=this.timeOrigin||0,i=[{Ye:"Major ticks",wA:0,nr:this.majorTickStyle,hr:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Fh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Lh[r].major.format)(t+e,i,s)},Ir:(t,e,i,s)=>{const r=Fh(i,s);return(0,Lh[r].major.getKeyValues)(t,e,i,s)},xh:{ur:(t,e,i,s,r,n)=>{const o=Fh(r,n),h=Lh[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Pr:void 0}];return nh(this.minorTickStyle)&&i.push({Ye:"Minor ticks",wA:1,nr:this.minorTickStyle,hr:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Fh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Lh[r].minor.format)(t+e,i,s)},Ir:(t,e,i,s)=>{const r=Fh(i,s);return(0,Lh[r].minor.getKeyValues)(t,e,i,s)},xh:{ur:(t,e,i,s,r,n)=>{const o=Fh(r,n),h=Lh[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Pr:void 0}),{He:[],$e:i,We:this.cursorFormatter||((t,i,s)=>{const r=Fh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Lh[r].defaultValueFormatter(t+e,i,s)}),Hh:1e-4,$h:864e6}}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 Vh=(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(St.navigator.msSaveBlob)St.navigator.msSaveBlob(r,e);else{const t=St.document.createElement("a");St.document.body.appendChild(t);const i=St.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{St.URL.revokeObjectURL(i),St.document.body.removeChild(t)}),0)}},Ph=(t,i,s,r,n,o)=>{const h=t.fc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},Rh=(t,e)=>{if("relative"===t)return e;if(t instanceof Li)return t;const i=t.x instanceof qs?t.x.dt:t.x.x,s=t.y instanceof qs?t.y.dt:t.y.y;return Pi(i,s)},Bh=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=ih(o)?o:_i(o)?s:void 0;if(h&&Ri(i)){const t=ut(n,h,r.dt);return r.Xo({engineX:t.x,engineY:t.y})}if(h&&_i(i))return ut(n,h,s);if(h&&ih(i))return ut(n,h,i)}else{const i=t;if(_i(e)){const t=r.$o(i);return ut({x:t.engineX,y:t.engineY},r.dt,s)}if(ih(e)){const t=e,s=r.$o(i);return ut({x:s.engineX,y:s.engineY},r.dt,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class _h{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.IA=[],this.PA=[],this.D=new r.Eventer,this.DA=void 0,this.BA=void 0,this.LA=void 0,this.Xt=A(0,0,0,0),this.RA=!1,this.$i=!1,this.EA=()=>{this.VA=!0,this.zA.bs()},this.OA=t=>e=>{const i=this.IA.indexOf(e);-1!==i&&this.IA.splice(i,1),this.us.bs(),t.W()},this.NA=t=>{const e=this.PA.indexOf(t);-1!==e&&this.PA.splice(e,1),this.us.bs()},this.VA=!0,this.onInViewChange=t=>this.D.on("inViewChange",t),this.offInViewChange=t=>this.D.off(t,"inViewChange"),this.fs=t,this.GA=i,this.zA=s,this.removePanel=n,this.qi=e.us.qi;const l=e.us.oi();if(this.uiScale=i.d2({scaleXYConstructor:zi}).zi(0,100).Oi(0,100).q(l),this.pixelScale=i.d2({scaleXYConstructor:zi}).zi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).q(l),this.engine=e.us.WA,this.us=e.us.UA,this.es=this.us.es.hs(this,{}),this.YA=()=>e.HA("unidentified ui"),this.$A=e.XA(),this.jA=this.zA.Te(this.uiScale).Ie(u(0,0)).q(u(100,100)).ke(o).Ce(h).setMouseMoveEventHandler(((t,e)=>this.D.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.D.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.D.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.D.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.D.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.D.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.D.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.D.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.D.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.D.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.D.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.D.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.D.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.D.emit("touchEndPanelBackground",this,e))),a){const t=a.on(this.EA);this.ZA=()=>a.off(t)}else{const t=e.us.Go(this.EA);this.QA=e.us.Wo.bind(e.us,t)}const c=e.us.Yo((t=>{this.RA=t,this.D.emit("inViewChange",this,t)}));this.JA=e.us.Ho.bind(e.us,c),this.DA=n}getTheme(){return this.qi}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.jA.ke(t),this.zA.bs(),this}getBackgroundFillStyle(){return this.jA.Lh()}setBackgroundStrokeStyle(t){return this.jA.Ce(t),this.zA.bs(),this}getBackgroundStrokeStyle(){return this.jA._o()}translateCoordinate(t,e,i){return Bh(t,e,i,this.pixelScale,this.us)}KA(t){return this.IA.push(t),this.us.bs(),t}qA(t){return this.PA.push(t),this.us.bs(),t}addUIElement(t=Eo,e=this.uiScale){e=Rh(e,this.pixelScale);const i=this.YA();return this.KA(Ph(t,i,this.uiScale,e,this.OA(i),this.qi))}addLegendBox(t=_o,i=this.uiScale){i=Rh(i,this.pixelScale);const s=this.qA(Ph(t,this.$A,this.uiScale,i,this.NA,this.qi));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Ts.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Ts.CenterBottom).setPosition(this.uiScale.pi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.PA}dispose(){return this.$i||(this.$i=!0,this.QA&&this.QA(),this.ZA&&this.ZA(),Oh(this.uiScale),Oh(this.pixelScale),this.JA&&this.JA(),this.BA&&this.BA(),this.zA.W(),this.$A.W(),this.IA.slice().forEach((t=>{t.dispose()})),this.PA.slice().forEach((t=>{t.dispose()})),this.us.bs(),this.DA&&this.DA(this),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}saveToFile(t,e,i){return Vh(this.engine,t,e,i),this}Ka(t){this.Xt=t,this.EA()}j(){return this.pixelScale.j(),this.uiScale.j(),this}Z(){return this.pixelScale.Z(),this.uiScale.Z(),this}Fe(t){if(this.VA){const t=this.zA.us.oi(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=[this.Xt.left,this.Xt.right],r=[this.Xt.bottom,this.Xt.top];this.uiScale.Ei(s),this.uiScale.Vi(r);const n=this.uiScale.getInnerIntervalPixels();this.pixelScale.zi(0,n.x).Ei(s).Oi(0,n.y).Vi(r),this.D.emit("resize",this,n.x,n.y,e,i)}this.VA=!1}tg(){for(let t=0;t{t.ii&&t.ii()};class Nh extends _h{constructor(t,e,i,s,r,n){super(t,e,i,e.sg("uipanel bg",0),s,e.us.qi.uiPanelBackgroundFillStyle,e.us.qi.uiPanelBackgroundStrokeStyle,n),this.ig(r,this.pixelScale)}setMinimumSize(t){return this.Uc=t,this.us.bs(),this}getMinimumSize(){return this.Uc}Fe(t){super.Fe(t),super.tg()}}const Uh=A(10,10,10,10);class Gh extends _h{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.eg={},this.Da=Uh,this.th=!0,this.hg=e.rg("chart internal ui",0),this.ng=this.hg.kr(this.uiScale).Bh("Chart").Ie(u(50,100)).Ja(u(0,1)).Vh(h).ke(a).setMouseInteractions(!1),this.og=this.es.gA([this.ng]).xs(this.qi.effectsText)}setAnimationsEnabled(t){return this.th=t,this}getAnimationsEnabled(){return this.th}setTitle(t){return this.ng.Bh(t),this.us.bs(),this}getTitle(){return this.ng.Ph()}getTitleSize(){return this.ng.Ds().Cc()}setTitleFillStyle(t){return this.ng.ke(t),this.EA(),this}getTitleFillStyle(){return this.ng.Lh()}setTitleFont(t){return this.ng.Vh(t),this.EA(),this}getTitleFont(){return this.ng.Eh()}setTitleRotation(t){return this.ng.zh(t),this.us.bs(),this}getTitleRotation(){return this.ng.Oh()}setTitleEffect(t){return this.og.xs(t),this.us.bs(),this}getTitleEffect(){return this.og.Ms()}setTitleMargin(t){var e,i;return this.eg="object"==typeof t?this.eg?(e=this.eg,{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.EA(),this}getTitleMargin(){return this.eg}setPadding(t){return this.Da="object"==typeof t?S(this.Da,t):{left:t,top:t,right:t,bottom:t},this.EA(),this}getPadding(){return this.Da}ag(t){const e=t.lg(),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.hg.W(),this}}const Wh={ug:(t,e)=>t.Lh()!==B&&0!==t.Ph().length&&t.getVisible()?t.Ds().Cc().y:0,cg(t,e){t.Ie(u(50,100)).Ka({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var Yh;e.AutoCursorModes=void 0,(Yh=e.AutoCursorModes||(e.AutoCursorModes={}))[Yh.disabled=0]="disabled",Yh[Yh.snapToClosest=1]="snapToClosest",Yh[Yh.onHover=2]="onHover";const Hh={dg(t,i,s,r,n,o){let h;const a=t.getAutoCursorMode();if(!s&&a!==e.AutoCursorModes.disabled){const s=t.us.Bn(),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.Ag.pointAt(h).setVisible(!0):t.Ag.setVisible(!1),t.Ag.Ds().Fe()},gg(t,e,i){if(e.xt.uiScale.x.hi()||e.yt.uiScale.y.hi())return;let s,r=Number.MAX_VALUE;for(const n of i)if(n.getCursorEnabled()&&n.getVisible()){const i=n.gg(e);if(i){const n=ut(i.location,i.scale,t.engine.scale),o=We(e,n);Number.isNaN(o)||s&&!(o{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundMouseMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundTouchStart((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundTouchMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundTouchEnd((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()}))},mg(t,i){i.onMouseEnter(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),i.onMouseMove(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),i.onMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()}))}};class Xh{constructor(t,e){this.yg=t,this.Sg=e}alter(t){this.vg=void 0!==this.vg?this.vg:this.Sg(),this.xg=t,this.yg(t)}resetValue(){void 0!==this.xg&&(void 0!==this.vg&&this.isAltered()&&this.yg(this.vg),this.vg=void 0,this.xg=void 0)}getNormalValue(){return void 0!==this.vg?this.vg:this.Sg()}isAltered(){return void 0!==this.xg&&this.Sg()===this.xg}}class $h{constructor(t,e){this.bg=[],this.Mg=t,this.dt=e}update(){return this.Mg.getVisible()?!(this._g()&&(!this.wg()||(this.resetTable(),this.Mg.Ds(),this._g()))&&(this.Cg(),this.Mg.Ds(),this._g()&&(this.resetTable(),this.Mg.Ds(),1))):(this.wg()&&this.resetTable(),!0)}wg(){for(let t=0;t{const s=ut(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ut(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.Mg,this.dt)}kg(){return((t,i)=>{const s=ut(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ut(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.Mg,this.dt)}Tg(){return((t,i)=>{const s=ut(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ut(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.Mg,this.dt)}Fg(t){return this.bg.push(t),t}}class jh extends $h{constructor(){super(...arguments),this.Pa=this.Fg(new Xh((t=>this.Mg.setOrigin(t)),(()=>this.Mg.getOrigin())))}Cg(){const t=this.Pa.getNormalValue(),e=u(this.kg()?-t.x:t.x,this.Tg()?-t.y:t.y);this.Pa.alter(e)}}class qh extends $h{constructor(t,e,i,s){super(t,e),this.Ig=this.Fg(new Xh((t=>this.Mg.setTextFont((e=>e.setSize(t)))),(()=>this.Mg.getTextFont().getSize()))),this.Pg=i,this.Dg=s}Cg(){const t=this.Ig.getNormalValue(),e=this.Pg;if(enew jh(t,e),FontSize:(t=5,e=5)=>(i,s)=>new qh(i,s,t,e)};class Zh{constructor(){this.Bg=[]}addRow(...t){return this.Bg.push(t),this}}class Kh extends Zh{fc(){const t=this.Bg;return this.Bg=[],t}Lg(){return this.Bg.length=0,this}}class Qh extends mo{constructor(){super(...arguments),this.hc=this.qi.cursorResultTableTextFont,this.qc=0,this.Rg=this.qi.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){for(let t=u.length;t=u.length)t=r.addElement(ro,void 0);else{const e=u[n];e instanceof uo?(r.getMembers()[n].dispose(),t=r.addElement(ro,n)):t=e}const e=h?this.hc.withMutations((t=>{for(const e of Object.keys(h)){const i=h[e];t.set(e,i)}return t})):this.hc,i=a||this.Rg;t.setFont(e).setFillStyle(i).setText(l).setTextRotation(this.qc)}else{for(let t=u.length;t=u.length?r.addGap(void 0,void 0):u[n]instanceof so&&(r.getMembers()[n].dispose(),r.addGap(void 0,n))}}}}return this.Ts.bs(),this}setTextFillStyle(t){this.Rg="function"==typeof t?t(this.Rg):t;for(let t=0;tt.setFillStyle(r.cursorResultTableFillStyle).setStrokeStyle(r.cursorResultTableStrokeStyle))).setTextFillStyle(r.cursorResultTableTextFillStyle).setTextFont(r.cursorResultTableTextFont),this.Gg=Jh.Flip(this.Mg,this.scale)}dispose(){return this.Ng.dispose(),this.Mg.dispose(),this}pointAt(t){return this.wa=t.scale===this.scale?t.location:ut(t.location,t.scale,this.scale),this.Ng.setPosition(this.wa),this.Mg.setPosition(this.wa).setContent(t.resultTableContent),this.Ts.bs(),this}getPosition(){return this.wa}setVisible(t){return this.Xi=t,this.Ts.bs(),this}getVisible(){return this.Xi}setPointMarkerVisible(t){return this.Vg=t,this.Ts.bs(),this}getPointMarkerVisible(){return this.Vg}setPointMarker(t){return t(this.Ng),this.Ts.bs(),this}getPointMarker(){return this.Ng}setResultTableVisible(t){return this.zg=t,this.Ts.bs(),this}getResultTableVisible(){return this.zg}setResultTable(t){return t(this.Mg),this.Ts.bs(),this}getResultTable(){return this.Mg}setAutoFitStrategy(t){return this.Gg&&this.Gg.resetTable(),this.Gg=t?t(this.Mg,this.Ts.us.dt):void 0,this.Ts.bs(),this}getAutoFitStrategy(){return void 0!==this.Gg}Fe(){return this.Gg&&this.Gg.update(),this.Mg.setVisible(this.RA&&this.Xi&&this.zg),this.Ng.setVisible(this.RA&&this.Xi&&this.Vg),this.Ng.Fe(),this.Mg.Fe(),this}Ds(){return this.Ng.Ds(),this.Mg.Ds(),this.RA=((t,e,i=e)=>{const s=e!==i?ut(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.wa,this.scale),this}}class ea extends ta{constructor(){super(...arguments),this.Wg=!1}pointAt(t){return this.Ug(t.fillStyle),super.pointAt(t)}Ug(t){t&&this.Wg&&this.Mg.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.Wg=t,this.Ts.bs(),this}getResultTableAutoTextStyle(){return this.Wg}}class ia extends ta{setPosition(t){return this.wa=t,this.Ng.setPosition(t),this.Mg.setPosition(t),this.Ts.bs(),this}}class sa{constructor(t,e=[]){this.Yg=[],this.Hg=(t,e)=>(this.Yg.forEach((i=>i(t,e))),t),this.Og=t,this.Yg=e}}class ra extends sa{constructor(){super(...arguments),this.$g=(t,e,i,s)=>this.Hg(new ea(t,e,i,this.Og,s),s),this.addStyler=t=>new ra(this.Og,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ra(t,this.Yg.map((t=>t)))}}class na extends sa{constructor(){super(...arguments),this.Xg=(t,e,i,s)=>this.Hg(new ia(t,e,i,this.Og,s),s),this.addStyler=t=>new na(this.Og,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new na(t,this.Yg.map((t=>t)))}}const oa=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),ha=(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))),aa=new ra(no,[oa]),la=new ra(ao,[oa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof ao&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),ua=aa,ca=aa,da=la,fa=new na(no,[ha,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(Ts.LeftBottom)))]),ga=(t,e,i,s,r)=>({location:t,scale:e,resultTableContent:i,owner:s,fillStyle:r});var ya;e.SliceLabelIndices=void 0,(ya=e.SliceLabelIndices||(e.SliceLabelIndices={}))[ya.LabelsInsideSlices=0]="LabelsInsideSlices",ya[ya.LabelsOnSides=1]="LabelsOnSides";const ma={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},pa={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`},Aa=(t,e,i,s)=>t.addRow(i.getName()).addRow(i.getAnimatedValue().toString());class xa extends Ui{constructor(){super(...arguments),this._s="Slice",this.S=0}}const Sa=(t,e)=>{$t(e),t.setExploded(!t.getExploded())};class ba extends xa{}class va extends ba{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.jg=!1,this.Zg=B,this.Qg=B,this.Jg=this.S,this.Kg=this.jg?1:0,this.qg=this.getVisible(),this.tp=j((()=>this.Ji.us.bs())),this.ip=j((()=>this.Ji.us.bs())),this.sp=()=>{this.ep=void 0},this.hp=()=>{this.rp=void 0},this.index=t,this.Ji=s,this.scale=r,this.Ki=n,this.np=e.Fc(r).cs(this.getHighlight()),this.gs(this.np),this.Ye=i.kr(r).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0}),this.onMouseClick(Sa),this.onTouchEnd(Sa)}setValue(t){return this.Ji.getAnimationsEnabled()?this.qg&&this.op(this.Jg,t):this.Jg=t,this.S=t,this.Ji.us.bs(),this}getValue(){return this.S}setExploded(t){if(t&&!1===this.Ji.getMultipleSliceExplosion()){const t=this.Ji.getSlices();for(let e=0;e{this.Kg=t,this.Ji.us.bs()})),this.rp.onEveryAnimationEnd(this.hp),this.jg=!this.jg):!1!==this.Ji.getMultipleSliceExplosion()||t?(this.Kg=this.jg?0:1,this.jg=!this.jg):(this.Kg=0,this.jg=!this.jg),this.Ji.us.bs(),this}getExploded(){return this.jg}setVisible(t){return this.qg=t,!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?(this.ep&&(this.ep.finish(!1),this.ep=void 0),this.op(this.Jg,0,(()=>super.setVisible(!1)))):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(this.ep&&(this.ep.finish(!1),this.ep=void 0),super.setVisible(!0),this.op(this.Jg,this.S)):(this.Jg=this.S,super.setVisible(!0)),this}op(t,e,i){this.ep=this.tp(300,X.ease)([[t,e]],(([t])=>{this.Jg=t,this.Ji.us.bs()})),this.ep.onEveryAnimationEnd(this.sp),i&&this.ep.onAnimationEnd(i)}setStyle(t,e,i,s){this.Zg=t,this.Qg=i,this.np.ke(this.Zg).Ce(e),this.Ye.ke(this.Qg).Vh(s);for(let t=0;tri(e,si(yi(.5*(t.Au()+t.Ti())*Math.PI/180),i)),Ta=(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.ap.indexOf(t);e>=0&&(this.ap.splice(e,1),this.Mp())},this.fs.zn||this.fs.Vn||this.fs.Hn||this.us.As(7),this._p=i.wp("pieChart bottom",0),this.Cp=i.wp("pieChart top",1),this.ng.Bh("Pie Chart"),this.ig(n,this.pixelScale),this.onBackgroundMouseDoubleClick(wa);const a=Yi(new Hi(wa));this.onBackgroundTouchStart(a.onTouchStart),this.onBackgroundTouchMove(a.onTouchMove),this.onBackgroundTouchEnd(a.onTouchEnd),this.kp=i.Tp();const l=Dt(h?h.autoCursorBuilder:void 0,ca);this.Ag=l.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled))}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}addSlice(t,e){const i=new va(this.gp,this._p,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);this.gp+=1,i.setName(t);const s=this.th;return this.th=!1,i.setValue(e),this.th=s,i.setEffect(this.yp),this.Fp(i),this.ap.push(i),this.Mp(),i.setHighlightOnHover(this.dp),i}addSlices(t){const e=[];for(let i=0;ie.es.ns.xs(t))),this.us.bs(),this}getSliceEffect(){return this.yp}setSliceSorter(t){return this.lp=t,this.ap=this.ap.sort(this.lp),this.us.bs(),this}getSliceSorter(){return this.lp}setLabelFillStyle(t){this.Ap="function"==typeof t?t(this.Ap):t;for(let t=0;te.es.rs.xs(t))),this.us.bs(),this}getLabelEffect(){return this.Sp}setLabelFormatter(t){return this.Ip=t,this.us.bs(),this}getLabelFormatter(){return this.Ip}setSliceHighlightOnHover(t){return this.dp=t,this.ap.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),Wh.cg(this.ng,this.eg),super.tg();const e=Wh.ug(this.ng,this.eg),i=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+e)),s=u(this.Da.left+i.x/2,this.Da.bottom+i.y/2);if(this.ad){const t=this.ad;this.ap.forEach((e=>{this.Fp(e,new U({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.ap[t].np.setVisible(e),this.ap[t].Ye.setVisible(e)}this.ap=this.ap.sort(this.lp);const r=this.ap.filter((t=>t.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tga(e,this.engine.scale,this.xp(new Kh,this,t,o[r.indexOf(t)]||0).fc(),t,void 0))),this.Pp(r,o,s,i)}Fp(t,e=this.up(t.index)){t.setStyle(e,this.cp,this.Ap,this.fp)}Mp(){this.ap=this.ap.sort(this.lp),this.us.bs()}Sd(){return this.ap}dispose(){return super.dispose(),this.ap.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this.Cp.W(),this._p.W(),this.kp.W(),this}}const ka={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Ca=(...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 Da extends Ea{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Ip=pa.NamePlusValue,this.Dp=[],this.Bp=40,this.Lp=5,this.Rp=10,this.Ep=this.qi.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.Ep=t;for(let t=0;t{const r=360*e[s],h=c-r,a=yi(di(.5*(c+h))),l=a.x>=0?-1:1,d=ri(ri(i,si(a,u+n)),{x:l*-o,y:0});c=h;const f={x:l,y:0};t.Ye.Ie(d).Ja(f),t.Ye.Ds();const g=$e(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.np,r=Ma(s,i,u+h+a*t.slice.getAnimatedExplosion()),n=ci(t.position.y,r,i),o=t.position;this.Vp([r,n,o])}))}getMinimumSize(){return u(500,300)}Vp(t){let e;for(let t=0;t{if(Ji(t)){const e=t.getThickness(),i=t.getFillStyle();if(G(i))return 1===e?nr:new hr({size:e,fillStyle:i,shape:"sphere"})}return nr};class za{constructor(t,e,i,s){this.Np=[],this.Gp=new Map,this.Wp=t,this.Yp=e,this.Hp=i,this.$p=s}Xp(){this.Hp&&this.Hp();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.Np.slice(),r=[];e.forEach((t=>{let e=s.pop();e||(e=this.Wp(),this.Np.push(e));const n=[],o=e.jp().slice();t.instances.forEach(((t,e)=>{const i=o.shift();n.push({...t,existingMember:i})}));const h=this.Yp(e,n,t.sharedProperties);i=se(i,h,{canReturnB:!0});for(let i=0;i{null==e||e.Wc(t)}))})),s.forEach((t=>{t.dispose();const e=this.Np.indexOf(t);e<0?fe(0,(()=>{})):this.Np.splice(e,1)})),r.forEach((t=>{const e=this.Gp.get(t.ia);e&&t.collection.us.po({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.Gp.clear(),r.forEach((t=>{this.Gp.set(t.ia,t)})),this.$p&&this.$p(this.Np,i)}}}Zp(){this.Np.forEach((t=>{t.dispose()})),this.Np.length=0}}class Va{constructor(t){this.Qp=[],this.Jp=t}Xp(){return this.Kp(),{add:()=>this.vl(),finishPlot:()=>{this.qp()}}}vl(){let t=this.Qp.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.Jp()},this.Qp.push(t)),t.isFree=!1,t.shape}Kp(){this.Qp.forEach((t=>{t.isFree=!0}))}qp(){this.Qp.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.Qp.splice(this.Qp.indexOf(t),1)}))}Zp(){this.Qp.forEach((t=>t.shape.dispose())),this.Qp.length=0}}class Pa{constructor(t,e,i,s,n,o,h,a,l,u){this.D=new r.Eventer,this.S=0,this.Xi=!0,this.$i=!1,this.bs=t,this.tm=e,this.im=i,this.sm=s,this.hm=n,this.rm=o,this.qc=h,this.Rg=a,this.nm=l,this.gc=u}setValue(t){return t===this.S||(this.S=t,this.bs(),this.D.emit("valueChange",this,this.S)),this}getValue(){return this.S}setTickStyle(t){return this.im="function"==typeof t?t(this.im):t,this.bs(),this}getTickStyle(){return this.im}setTickLength(t){return this.sm=t,this.bs(),this}getTickLength(){return this.sm}setGridStrokeStyle(t){return this.hm="function"==typeof t?t(this.hm):t,this.bs(),this}getGridStrokeStyle(){return this.hm}setTextPadding(t){return this.rm=t,this.bs(),this}getTextPadding(){return this.rm}setTextRotation(t){return this.qc=t,this.bs(),this}getTextRotation(){return this.qc}setTextFillStyle(t){return this.Rg="function"==typeof t?t(this.Rg):t,this.bs(),this}getTextFillStyle(){return this.Rg}setTextFont(t){return this.nm="function"==typeof t?t(this.nm):t,this.bs(),this}getTextFont(){return this.nm}setTextFormatter(t){return this.gc=t,this.bs(),this}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}dispose(){return this.$i||(this.$i=!0,this.tm(),this.bs(),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&(this.D.emit("visibleStateChanged",this,this.Xi),this.bs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}}class Ra extends qs{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.om({x:t.us.qi.xAxis3DNumericTicks,y:t.us.qi.yAxis3DNumericTicks,z:t.us.qi.zAxis3DNumericTicks}),datetime:e.om({x:t.us.qi.xAxis3DDateTimeTicks,y:t.us.qi.yAxis3DDateTimeTicks,z:t.us.qi.zAxis3DDateTimeTicks}),time:e.om({x:t.us.qi.xAxis3DTimeTicks,y:t.us.qi.yAxis3DTimeTicks,z:t.us.qi.zAxis3DTimeTicks})},{type:"linear"}),this.Td=[],this.am=()=>{},this.lm=()=>{},this.um=()=>{},this.dm=()=>{},this.chart=t,this.At=r,this.fm=n,this.Am=o,this.gm=this.At.dt;const l=this.Mh.om({x:this.qi.xAxis3DStrokeStyle,y:this.qi.yAxis3DStrokeStyle,z:this.qi.zAxis3DStrokeStyle});this.pm=this.At.zp([ka.InternalUI]).Ee(l).ym(La(l)).setMouseInteractions(!1),this.Dh=this.fm.kr(this.Am).setMouseInteractions(!1).ke(e.om({x:t.us.qi.xAxis3DTitleFillStyle,y:t.us.qi.yAxis3DTitleFillStyle,z:t.us.qi.zAxis3DTitleFillStyle})).Vh(e.om({x:t.us.qi.xAxis3DTitleFont,y:t.us.qi.yAxis3DTitleFont,z:t.us.qi.zAxis3DTitleFont})),this.Sm=new Va((()=>this.fm.kr(this.Am))),this.vm=new za((()=>this.At._A().setMouseInteractions(!1)),((t,e,i)=>(t.Nt().Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t._l(e)))))),this.es=a,this.Nh=this.es.gA([this.Dh]).xs(s.effectsText),this.pm.setMouseEnterEventHandler(this.am).setMouseLeaveEventHandler(this.lm).setMouseDragEventHandler(this.um).setMouseDragStopEventHandler(this.dm),i.tA=this}setTickStrategy(t,e){return super.kh(t,e)}getTickStrategy(){return this.je}addCustomTick(){const t=new Pa((()=>this.chart.us.bs()),(()=>{const e=this.Td.indexOf(t);e>=0&&this.Td.splice(e,1)}),this.qi.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.qi.xAxis3DNumericTicks.majorTickStyle.tickLength,this.qi.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.qi.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.qi.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.qi.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.qi.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)));return this.Td.push(t),this.chart.us.bs(),t}setStrokeStyle(t){return this.pm.Ee(t).ym(La(this.pm.ku())),this.chart.us.bs(),this}getStrokeStyle(){return this.pm.ku()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.pm.setVisible(t),!1===t&&(this.vm.Zp(),this.Sm.Zp()),this.fm.bs(),this}vA(){return this.chart.getSeries()}xm(t){return Math.abs(this.dt.tt(t)*this.At.bm(1))}_r(t,e,i){const s=Math.abs(this.dt.tt(e-t)*this.At.bm(1));return{min:t-i*s,max:e+i*s}}ar(t,e){return new Ba(e,t,this.fm,this.Am,this.At)}lr(t,e){const i=this.Mm(e,t.S,t.Sh.nr.tickLength,t.Sh.nr.tickPadding);return t.Ye.Ie(i.labelPosition).Ja(i.labelAlignment),i}Mm(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.dt.getInnerStart())/(this.dt.getInnerEnd()-this.dt.getInnerStart()),c=Fe.addVec(Xe(n,o,l),Fe.multiplyVec(Fe.multiply(h,this.At.bm(.5*this.pm.ku().getThickness())),r)),d=Fe.addVec(c,Fe.multiplyVec(Fe.multiply(h,this.At.bm(i)),r)),f=this.At._m(d)||u(0,0);return{labelPosition:ri(ut(f,this.chart.engine.scale,this.Am),si(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}bA(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.dt.getInnerStart())/(this.dt.getInnerEnd()-this.dt.getInnerStart()),a=Fe.addVec(Xe(r,n,h),Fe.multiplyVec(Fe.multiply(o,this.At.bm(.5*this.pm.ku().getThickness())),s)),l=Fe.addVec(a,Fe.multiplyVec(Fe.multiply(o,this.At.bm(10)),s)),c=this.At._m(a)||u(0,0),d=this.At._m(l)||u(0,0);return this.fm.Ve(this.Am).Oe(c).ze(d).Ee(new qi({fillStyle:new U({color:E(120*i)}),thickness:1}))}br(t,e){return _a(t,e,this.dt)}Fe(t){if(!this.Xi)return;const e=Math.min(this.Th,this.Fh),i=Math.max(this.Th,this.Fh),s=this.gm,r=f(s.x.et(),s.y.et(),s.z.et());let n,o;this.wm()?(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.Mh.Cm(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.Mh.xd,a=this.At._m(n)||u(0,0),l=this.At._m(o)||u(0,0),c=Xe(n,o,.5),d=Fe.addVec(c,Fe.multiplyVec(Fe.multiply(h,-1),r)),g=this.At._m(c)||u(0,0),y=this.At._m(d)||u(0,0),m=ti(ni(ut(g,this.chart.engine.scale,this.Am),ut(y,this.chart.engine.scale,this.Am)));this.pm.Nt()._l([n,o]);const{gridlinePositionA:p,gridlinePositionB:A,gridlinePositionC:x}=this.Mh.km(t),S=t=>({x:-1===t.x?this.gm.x.getInnerStart():1===t.x?this.gm.x.getInnerEnd():0,y:-1===t.y?this.gm.y.getInnerStart():1===t.y?this.gm.y.getInnerEnd():0,z:-1===t.z?this.gm.z.getInnerStart():1===t.z?this.gm.z.getInnerEnd():0}),b=S(p),v=S(A),M=S(x),T={physicalAxisSize:ii(ni(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:m,gridlinePositionA:b,gridlinePositionB:v,gridlinePositionC:M},w=this.Jh(T),E=this.vm.Xp();for(const[t,e]of this.Ze)for(const[,i]of e){const e=w.get(i);if(!e)continue;const s=this.Tm(T,e);E.add({ia:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.nr.tickStyle}),s.gridStroke&&E.add({ia:0,positions:s.gridStroke},{lineStyle:t.nr.gridStrokeStyle})}const k=this.Sm.Xp(),C={x:0,y:0};this.Td.forEach((t=>{if(!t.Xi||t.Si)return;const s=this.Mm(T,t.S,t.sm,t.rm),r=this.Tm(T,s),n=k.add().Ie(s.labelPosition).Ja(s.labelAlignment).ke(t.Rg).Vh(t.nm).Bh(t.gc(t.S)).zh(t.qc).Ds().oi();C.x=Math.max(C.x,n.x),C.y=Math.max(C.y,n.y),E.add({ia:0,positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.im}),r.gridStroke&&E.add({ia:0,positions:r.gridStroke},{lineStyle:t.hm})})),k.finishPlot(),E.finishPlot();const D=this.dr(((t,e)=>{const i=e.Ye.oi();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:C.x,y:C.y}),F=Math.atan((l.y-a.y)/(l.x-a.x));this.Dh.Ja({x:0,y:0}).zh(180*-F/Math.PI);const I=Fe.addVec(c,Fe.multiplyVec(Fe.multiply(h,this.At.bm(.5*this.pm.ku().getThickness()+this.gr(((t,e)=>Math.max(t,e.tickLength)),0))),r)),L=this.At._m(I)||u(0,0),z=ri(ut(L,this.chart.engine.scale,this.Am),ri(ri(oi(D,m),si(m,this.gr(((t,e)=>Math.max(t,e.labelPadding)),0))),oi(si(this.Dh.Ds().oi(),.5),m)));this.Dh.Ie(z),this.pm.Fm={overrideFollowing:!1,skipMousePicking:!1}}Tm(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return Et(h,0)||Et(h,1)||(a=[this.Im()?{...i,x:n.x}:this.Pm()?{...i,y:n.y}:this.wm()?{...i,z:n.z}:{x:0,y:0,z:0},this.Im()?{...s,x:n.x}:this.Pm()?{...s,y:n.y}:this.wm()?{...s,z:n.z}:{x:0,y:0,z:0},this.Im()?{...r,x:n.x}:this.Pm()?{...r,y:n.y}:this.wm()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}Gh(){super.Gh(),this.vm.Zp(),this.Sm.Zp()}Im(){return this.Mh.Im()}Pm(){return this.Mh.Pm()}wm(){return this.Mh.wm()}}class Ba extends Js{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Md=r}}const _a=(t,e,i)=>kt(t+.1*(e-t)+Math.abs(i.et())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),Oa=(t,e,i,s)=>({pr:()=>{const i=t();let s;for(const t of i){if(!t.Dm())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},mr:()=>{const e=t();let s;for(const t of e){if(!t.Dm())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Sr:()=>{const e=t();let i;for(const t of e){if(!t.Dm())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),Na=t=>({...Oa(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Sr().y)),om:t=>t.y,Cm:(t,e)=>({x:e.x,y:t.y,z:e.z}),xd: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)}},Im:()=>!1,Pm:()=>!0,wm:()=>!1}),Ua=t=>({...Oa(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Sr().z)),om:t=>t.z,Cm:(t,e)=>({x:e.x,y:e.y,z:t.z}),xd: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)}},Im:()=>!1,Pm:()=>!1,wm:()=>!0});class Ga extends Ui{constructor(t,e,i,s,r){super(t,e,s,r),this.Bm=Gn,this.Lm=!0,this.Rm=!0,this.Ji=t,this.At=i,this.ts=new Map,this.onMouseWheel(this.Ji.Em),this.onMouseDrag(this.Ji.Vm),this.onTouchStart(this.Ji.zm.onTouchStart),this.onTouchMove(this.Ji.zm.onTouchMove),this.onTouchEnd(this.Ji.zm.onTouchEnd)}setAutoScrollingEnabled(t){return this.Lm=t,this.Ji.us.bs(),this}getAutoScrollingEnabled(){return this.Lm}setColorShadingStyle(t){return this.Bm=t,this.ts.forEach(((e,i)=>i.Om(t))),this.At.bs(),this}getColorShadingStyle(){return this.Bm}setDepthTestEnabled(t){return this.Rm=t,this.ts.forEach(((e,i)=>i.Nm(t))),this.At.bs(),this}getDepthTestEnabled(){return this.Rm}Gm(){}Fe(){}$p(){}getXMax(){const t=this.el;return t?t.xt():void 0}getXMin(){const t=this.el;return t?t.vt():void 0}getYMax(){const t=this.el;return t?t.Mt():void 0}getYMin(){const t=this.el;return t?t.bt():void 0}getZMax(){const t=this.el;return t?t.Wm():void 0}getZMin(){const t=this.el;return t?t.Um():void 0}Sr(){const t=this.el;return t?f(t.Vl(),t.zl(),t.Ym()):f(0,0,0)}}class Wa extends Ga{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Box Series 3D",this.Hm=.25,this.$m=!1,this.ld=()=>ae(this.be),this.be=ce(this.qi.boxSeries3DFillStyle,r),this.el=this.At.jm().Nm(this.Rm).ke(this.be).Xm(this.Hm).cs(this.getHighlight()),this.gs(this.el)}invalidateData(t){const e=t.length;if(0===e)return this;this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));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;iae(this.Cu.getFillStyle())}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;return this.el.Ee(e),this.At.bs(),this}getStrokeStyle(){return this.Cu}add(t){return this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.$m=!0,(t=Array.isArray(t)?t:[t])?(this.el._l(t.slice()),this.At.bs(),this):this}clear(){return this.el.Nt(),this}getPointAmount(){const t=this.el;return t.wl()+t.Cl()}Dm(){return this.Lm&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.cs(e),this.At.bs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{stroke:this.Cu}),this}}class Ha extends Ya{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Line Series 3D",this.Cu=ce(s.lineSeries3DStrokeStyle,r),this.Qm=Mr.pointStyle3D,this.Jm(this.Cu),this.el=this.At.zp([ka.UserSeries]).Nm(this.Rm).Ee(this.Cu).ym(this.Qm).cs(this.getHighlight()),this.gs(this.el)}setStrokeStyle(t){super.setStrokeStyle(t),this.Jm(this.Cu);const e=this.Qm;return this.el.ym(e),this}Jm(t){const e=new dr.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.Qm=e}}class Xa extends Ya{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Point Line Series 3D",this.ld=()=>ae(this.Cu.getFillStyle())||ae(this.Qm.getFillStyle()),this.Qm=ce(s.pointLineSeries3DPointStyle,r),this.Cu=ce(s.lineSeries3DStrokeStyle,r),this.Km(),this.el=this.At.zp([ka.UserSeries]).Nm(this.Rm).Ee(this.Cu).ym(this.Qm).cs(this.getHighlight()),this.gs(this.el)}setPointStyle(t){return this.Qm="function"==typeof t?t(this.Qm):t,this.Km(),this.el.ym(this.Qm),this.At.bs(),this}getPointStyle(){return this.Qm}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.Cu,i=Math.abs(e.getThickness()),s=this.Qm;i>s.getSize()&&(this.Qm=s.setSize(i)),this.Km();const r=this.Qm;return this.el.ym(r),this.At.bs(),this}Km(){const t=this.Qm,e=t.getSize();this.Qm=t.setSize(e)}Pe(t,e){t.cs(e),this.At.bs()}}class $a extends Ga{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.$m=!1,((null==n?void 0:n.individualPointSizeAxisEnabled)||(null==n?void 0:n.individualPointSizeEnabled))&&this.ds((t=>t.Vn||t.zn||t.ro?void 0:"bubble chart"))}add(t){return this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.$m=!0,(t=Array.isArray(t)?t:[t])?(this.el._l(t.slice()),this.At.bs(),this):this}clear(){return this.el.Nt(),this}getPointAmount(){const t=this.el;return t.wl()+t.Cl()}Dm(){return this.Lm&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.cs(e),this.At.bs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{point3D:this.qm}),this}}class ja extends $a{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._s="Point Series 3D",this.ld=()=>ae(this.qm.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.Ji.getSeries().length;this.qm=ce(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.el=this.At.Oc(h).Nm(this.Rm).ty(this.qm).cs(this.getHighlight()),this.gs(this.el)}setPointStyle(t){this.qm="function"==typeof t?t(this.qm):t;const e=this.qm;return this.el.ty(e),this.At.bs(),this}getPointStyle(){return this.qm}}class qa extends $a{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._s="Point Cloud Series 3D",this.ld=()=>ae(this.qm.getFillStyle());const o=this.Ji.getSeries().length;this.qm=ce(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.el=this.At.Oc(h).ty(this.qm).cs(this.getHighlight()),this.gs(this.el)}setPointStyle(t){this.qm="function"==typeof t?t(this.qm):t;const e=this.qm;return this.el.ty(e),this.At.bs(),this}getPointStyle(){return this.qm}}const Ja={Triangulated:ja,Pixelated:qa};class Za extends Gh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.iy=[],this.sy=0,this.ey=t=>{const e=this.iy.indexOf(t);e>=0&&(this.iy.splice(e,1),this.D.emit("seriesDispose",this,t))},this.hy=()=>{this.sy+=1},this.ny=()=>{this.sy-=1},this.onSeriesBackgroundMouseEnter=t=>this.D.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.D.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.D.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.D.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.D.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.D.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.D.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.D.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.D.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.D.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.D.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.D.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.D.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.D.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.D.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.D.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.D.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.D.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.D.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.D.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.D.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.D.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.D.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.D.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.D.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.D.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.D.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.D.off(t,"touchEndSeriesBackground"),this.oy=this.es.gA()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.iy.forEach((e=>e.setAnimationHighlight(t))),this}ly(t,e){this.oy.ps([e]),t.setMouseMoveEventHandler(((t,e)=>{this.D.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.D.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.D.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.D.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.D.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.D.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.D.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.D.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.D.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.D.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.D.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.D.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.D.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.D.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.uy.ke(t),this.us.bs(),this}getSeriesBackgroundFillStyle(){return this.uy.Lh()}setSeriesBackgroundStrokeStyle(t){return this.Ay.Ce(t),this.us.bs(),this}getSeriesBackgroundStrokeStyle(){return this.Ay._o()}setSeriesBackgroundEffect(t){return this.oy.xs(t),this.us.bs(),this}getSeriesBackgroundEffect(){return this.oy.Ms()}gy(t){this.iy.push(t),t.onMouseEnter(this.hy),t.onMouseLeave(this.ny),void 0!==this.py&&t.setHighlightOnHover(this.py),this.D.emit("seriesAdded",this,t)}Sd(){return this.iy}my(){return this.sy}setSeriesHighlightOnHover(t){return this.py=t,this.iy.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.iy.slice().forEach(Tt),super.dispose()}yy(t){return this.D.on("seriesAdded",t)}Sy(t){return this.D.off(t)}vy(t){return this.D.on("seriesDispose",t)}xy(t){return this.D.off(t)}}const Ka=Fe.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class Qa{constructor(t,e,i,s){this.by=!0,this.My=!0,this._y=2*-Math.PI/2160,this.wy=2*Math.PI/2160,this.Cy=.1,this.ky=1*Math.PI/180,this.Ty=t,this.Fy=e,this.Iy=i,this._m=s}getDefaultCameraConfiguration(t){const e={direction:Ka,location:Fe.multiply(Ka,-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.Py(i,t):"wheel-zoom"===t.type?i=this.Dy(i,t):"rotate+zoom"===t.type?i=this.By(i,t):"fixed-rotate"===t.type?i=this.Ly(i,t):"move"===t.type&&(i=this.Ry(i,t))})),this.by?i=this.Ey(t.boundingBox,i):this.My&&(i=this.Vy(t.boundingBox,i)),i}Py(t,e){const{rotation:i}=e,s=t.location,r=Fe.multiply(Fe.normalize(t.location),-1),{Right:n,Up:o}=this.zy(r);let h=s;const a=this.Oy(r),l=i.x*this._y*a;h=Fe.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.wy,a-this.ky);return 0!==u&&(h=Fe.rotateAroundAxis(h,n,u)),{location:h,direction:Fe.multiply(Fe.normalize(h),-1)}}Dy(t,e){const{deltaY:i}=e;this.by&&this.Ny(!1);const s=t.location,r=Fe.multiply(Fe.normalize(s),-1),n=i*this.Cy,o=Fe.length(s)*-n;return{direction:r,location:Fe.addVec(s,Fe.multiply(r,o))}}By(t,e){const{rotation:i,cameraDistance:s}=e;this.by&&this.Ny(!1);let r=this.Py(t,{type:"rotate",rotation:i});const n=r.location,o=Fe.multiply(Fe.normalize(n),-1),h=Fe.multiply(o,-s);return r={direction:Fe.multiply(Fe.normalize(h),-1),location:h},r}Ly(t,e){this.by&&this.Ny(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.zy(r),h=i.x*this._y;let a=Fe.normalize(Fe.rotateAroundAxis(r,o,h));const l=i.y*this.wy;return a=Fe.normalize(Fe.rotateAroundAxis(a,n,l)),{location:s,direction:a}}Ry(t,e){this.by&&this.Ny(!1),this.My=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.zy(n);return{location:Fe.addVec(r,Fe.multiply(n,.01*s),Fe.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:Fe.multiply(Fe.normalize(t.cameraLocation),-1)};return this.by?this.Ey(t.boundingBox,e):this.Vy(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:Fe.multiply(Fe.normalize(t.cameraLocation),-1)};return this.by?this.Ey(t.boundingBox,e):this.Vy(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:Fe.multiply(Fe.normalize(t.cameraLocation),-1)};if(this.by)return this.Ey(t.boundingBox,e)}Ey(t,e,i){let s=e;i=void 0!==i?i:0,s=this.Gy(t,s,100,20,1,i,5);const r=this.Oy(s.direction);return s=this.Wy(s,this.Uy(t,s,100,1),r),s}Gy(t,e,i,s,r,n,o){return tl(n,o,(t=>({direction:e.direction,location:Fe.multiply(e.direction,-t)})),(e=>this.Yy(t,e)),i,r,"linear",s)}Uy(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.zy(e.direction),a=this.Hy(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:Fe.normalize(Fe.lerp(l.direction,h,t))})),(e=>this.$y(t,e)),0,u,!0,i):el(0,c,(t=>({location:l.location,direction:Fe.normalize(Fe.lerp(l.direction,o,t))})),(e=>this.$y(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:Fe.normalize(Fe.lerp(l.direction,n,t))})),(e=>this.Xy(t,e)),0,u,!0,i):el(0,c,(t=>({location:l.location,direction:Fe.normalize(Fe.lerp(l.direction,r,t))})),(e=>this.Xy(t,e)),0,u,!0,i)),l}Yy(t,e){const i=this.Hy(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}Xy(t,e){const i=this.Hy(t,!1,e);return Math.abs(i.left-i.right)}$y(t,e){const i=this.Hy(t,!1,e);return Math.abs(i.top-i.bottom)}Hy(t,e,i){const s=$e(this.jy(t,e,i).map((t=>ut(t,this.Ty,this.Fy))));return{left:s.min.x,right:this.Fy.x.getInnerEnd()-s.max.x,top:this.Fy.y.getInnerEnd()-s.max.y,bottom:s.min.y}}jy(t,e,i){const s=this.Iy,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._m(t,i))).filter((t=>void 0!==t))}Vy(t,e){const i=Fe.length(e.location),s=this.Zy(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)ae(this.be),this.Bm=Nn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ji.getSeries().length;this.be=ce(this.qi.surfaceGridSeries3DFillStyle,o),this.Ky=ce(this.qi.surfaceGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.En=h,this.el=this.At.tS(h).ke(this.be).qy(this.Ky).Om(this.Bm).cs(this.getHighlight()),this.gs(this.el),s.start&&this.setStart(s.start),s.end&&this.setEnd(s.end),s.step&&this.setStep(s.step)}iS(){const t=this.Jy.start||{x:0,z:0};let e;e=this.Jy.end?{x:(this.Jy.end.x-t.x)/this.En.columns,z:(this.Jy.end.z-t.z)/this.En.rows}:this.Jy.step?this.Jy.step:{x:1,z:1},this.el.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.el.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.el.eS().step}setEnd(t){return this.Jy.end=t,this.iS(),this}getEnd(){return this.el.eS().end}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.el.ke(this.be),this.At.bs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.el.qy(this.Ky),this.At.bs(),this}getWireframeStyle(){return this.el.hS()}setIntensityInterpolation(t){return t=t||"disabled",this.el.rS(t),this.At.bs(),this}getIntensityInterpolation(){return this.el.nS()}invalidateIntensityValues(t){if(this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),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.En.dataOrder?t.length:t[0].length,rows:"rows"===this.En.dataOrder?t.length:t[0].length},i="columns"===this.En.dataOrder?this.En.columns:this.En.rows,s="columns"===this.En.dataOrder?this.En.rows:this.En.columns;if(e.x>i||e.y>s){if(!0===this.Ji.fs.oo){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.En.columns}x${this.En.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ji.fs.oo){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.En.columns}x${this.En.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.`;St.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;et.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),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.En.dataOrder?t.length:t[0].length,rows:"rows"===this.En.dataOrder?t.length:t[0].length},i="columns"===this.En.dataOrder?this.En.columns:this.En.rows,s="columns"===this.En.dataOrder?this.En.rows:this.En.columns;if(e.x>i||e.y>s){if(!0===this.Ji.fs.oo){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.En.columns}x${this.En.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ji.fs.oo){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.En.columns}x${this.En.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.`;St.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;eae(this.be),this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.Bm=Nn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ji.getSeries().length;this.be=ce(this.qi.surfaceScrollingGridSeries3DFillStyle,o),this.Ky=ce(this.qi.surfaceScrollingGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.En=h,this.el=this.At.cS(h).ke(this.be).qy(this.Ky).Om(this.Bm).cs(this.getHighlight()),this.gs(this.el),s.start&&this.setStart(s.start),s.step&&this.setStep(s.step)}iS(){const t=this.Jy.start||{x:0,z:0};let e;e=this.Jy.step?this.Jy.step:{x:1,z:1},this.el.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.el.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.el.eS().step}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.el.ke(this.be),this.At.bs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.el.qy(this.Ky),this.At.bs(),this}getWireframeStyle(){return this.el.hS()}setIntensityInterpolation(t){return t=t||"disabled",this.el.rS(t),this.At.bs(),this}getIntensityInterpolation(){return this.el.nS()}clear(){return this.el.Nt(),this.At.bs(),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.En.scrollDimension?this.En.rows:this.En.columns;if(i>s-1){if(!0===this.Ji.fs.oo){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.En.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.Ji.fs.oo){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.En.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.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.el.dS({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.At.bs(),this}setCullMode(t){return this.el.lS("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.el.uS()}Gm(){}Fe(){}$p(){}Dm(){return this.Lm&&this.getVisible()}Pe(t,e){t.cs(e),this.At.bs()}}const rl=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof al),nl=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),ol={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)=>ol.multiply(t,ol.translation(e,i,s)),xRotate:(t,e)=>ol.multiply(t,ol.xRotation(e)),yRotate:(t,e)=>ol.multiply(t,ol.yRotation(e)),zRotate:(t,e)=>ol.multiply(t,ol.zRotation(e)),rotateXYZ(t,e){let i=ol.xRotate(t,e.x);return i=ol.yRotate(i,e.y),i=ol.zRotate(i,e.z),i},scale:(t,e,i,s)=>ol.multiply(t,ol.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],A=t[0],x=t[1],S=t[2],b=t[3],v=t[4],M=t[5],T=t[6],w=t[7],E=t[8],k=t[9],C=t[10],D=t[11],F=t[12],I=t[13],L=t[14],z=t[15],V=[];return V[0]=i*A+s*v+r*E+n*F,V[1]=i*x+s*M+r*k+n*I,V[2]=i*S+s*T+r*C+n*L,V[3]=i*b+s*w+r*D+n*z,V[4]=o*A+h*v+a*E+l*F,V[5]=o*x+h*M+a*k+l*I,V[6]=o*S+h*T+a*C+l*L,V[7]=o*b+h*w+a*D+l*z,V[8]=u*A+c*v+d*E+f*F,V[9]=u*x+c*M+d*k+f*I,V[10]=u*S+c*T+d*C+f*L,V[11]=u*b+c*w+d*D+f*z,V[12]=g*A+y*v+m*E+p*F,V[13]=g*x+y*M+m*k+p*I,V[14]=g*S+y*T+m*C+p*L,V[15]=g*b+y*w+m*D+p*z,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],y=t[13],m=t[14],p=t[15],A=d*p,x=m*f,S=a*p,b=m*l,v=a*f,M=d*l,T=r*p,w=m*n,E=r*f,k=d*n,C=r*l,D=a*n,F=u*y,I=g*c,L=o*y,z=g*h,V=o*c,P=u*h,R=i*y,B=g*s,_=i*c,O=u*s,N=i*h,U=o*s,G=A*h+b*c+v*y-(x*h+S*c+M*y),W=x*s+T*c+k*y-(A*s+w*c+E*y),Y=S*s+w*h+C*y-(b*s+T*h+D*y),H=M*s+E*h+D*c-(v*s+k*h+C*c),X=1/(i*G+o*W+u*Y+g*H);return e[0]=X*G,e[1]=X*W,e[2]=X*Y,e[3]=X*H,e[4]=X*(x*o+S*u+M*g-(A*o+b*u+v*g)),e[5]=X*(A*i+w*u+E*g-(x*i+T*u+k*g)),e[6]=X*(b*i+T*o+D*g-(S*i+w*o+C*g)),e[7]=X*(v*i+k*o+C*u-(M*i+E*o+D*u)),e[8]=X*(F*l+z*f+V*p-(I*l+L*f+P*p)),e[9]=X*(I*n+R*f+O*p-(F*n+B*f+_*p)),e[10]=X*(L*n+B*l+N*p-(z*n+R*l+U*p)),e[11]=X*(P*n+_*l+U*f-(V*n+O*l+N*f)),e[12]=X*(L*d+P*m+I*a-(V*m+F*a+z*d)),e[13]=X*(_*m+F*r+B*d-(R*d+O*m+I*r)),e[14]=X*(R*a+U*m+z*r-(N*m+L*r+B*a)),e[15]=X*(N*d+V*r+O*a-(_*a+U*d+P*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 hl extends Ga{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Mesh Model 3D",this.fS=new Float32Array,this.dt={x:1,y:1,z:1},this.AS={x:0,y:0,z:0},this.gS={x:0,y:0,z:0},this.pS={x:0,y:0,z:0},this.mS={x:0,y:0,z:0},this.ol=Ve,this.ld=()=>ae(this.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.Ji.getSeries().length;this.el=this.At.yS().Nm(this.Rm).ke(ce(this.qi.meshModel3DFillStyle||this.qi.pointSeriesFillStyle,o)).cs(this.getHighlight()),this.gs(this.el)}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let r=Le,n=Ie,o=Le,h=Ie,a=Le,l=Ie;for(let t=0;t{const t=this.At.RS();this.VS.ES(t),this.zS.ES(t);const e=this.OS.viewportChanged(this.NS());e&&this.GS(e),this.us.bs()},this.Vm=(t,e,i,s,r)=>{if(this.BS){const t=r;this.FS.push({type:"rotate",rotation:t}),this.us.bs(),$t(e)}},this.Em=(t,e)=>{if(this.DS){if(this.PS)Math.sign(this.LS)!==Math.sign(e.deltaY)?this.LS=de(e):this.LS+=de(e);else{const t=de(e);this.FS.push({type:"wheel-zoom",deltaY:t})}this.us.bs(),$t(e)}},this.fs.zn||this.fs.Vn||this.fs.Zn||this.us.As(1),this.ng.Bh("Chart3D"),this.WS=i.d3(),this.WS.x.J(-1,1),this.WS.y.J(-1,1),this.WS.z.J(-1,1),this.At=e.US("chart3D layer3D",0,this.WS),this.VS=e.YS("chart3D series bg",0),this.zS=e.wp("chart3D axis ui",1),this.HS={x:new Ra(this,(h=()=>this.iy,{...Oa(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Sr().x)),om:t=>t.x,Cm:(t,e)=>({x:t.x,y:e.y,z:e.z}),xd: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)}},Im:()=>!0,Pm:()=>!1,wm:()=>!1}),this.WS.x,this.qi,this.At,this.zS,this.pixelScale,!1,this.es),y:new Ra(this,Na((()=>this.iy)),this.WS.y,this.qi,this.At,this.zS,this.pixelScale,!1,this.es),z:new Ra(this,Ua((()=>this.iy)),this.WS.z,this.qi,this.At,this.zS,this.pixelScale,!1,this.es)},this.$S=this.At.zp([ka.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.qi.chart3DBoundingBoxStrokeStyle),this.uy=this.VS.vc(this.engine.scale,nn.Simple).ke(this.qi.chart3DSeriesBackgroundFillStyle).Ce(rt).setMouseInteractions(!0),this.Ay=this.VS.vc(this.engine.scale,nn.Simple).ke(B).Ce(this.qi.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.ly(this.uy,this.Ay),this.XS({x:1,y:1,z:1},!0),this.OS=new Qa(this.engine.scale,this.pixelScale,this.WS,((t,e)=>(e&&this.GS(e),this.At._m(t)))),this.jS=this.OS.getDefaultCameraConfiguration(this.ZS(this.QS)),this.GS(this.jS),this.zm=Yi(new $i(((t,e,i)=>{a={locationOne:e,locationTwo:i,cameraLocation:this.At.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.BS&&!this.DS)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=Fe.length(a.cameraLocation),c=o/h*l,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.FS.push({type:"rotate+zoom",rotation:this.BS?d:{x:0,y:0},cameraDistance:this.DS?c:l}),this.us.bs(),$t(n)}),(t=>{})),new Xi((t=>{}),((t,e,i,s,r)=>{if(this.BS){const t=s;this.FS.push({type:"rotate",rotation:t}),this.us.bs(),$t(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.zm.onTouchStart),this.onBackgroundTouchMove(this.zm.onTouchMove),this.onBackgroundTouchEnd(this.zm.onTouchEnd),this.onSeriesBackgroundTouchStart(this.zm.onTouchStart),this.onSeriesBackgroundTouchMove(this.zm.onTouchMove),this.onSeriesBackgroundTouchEnd(this.zm.onTouchEnd),this.onBackgroundMouseDrag(this.Vm),this.onBackgroundMouseWheel(this.Em),this.onBackgroundMouseDown(((t,e)=>{$t(e)})),this.onSeriesBackgroundMouseDrag(this.Vm),this.onSeriesBackgroundMouseWheel(this.Em),this.onSeriesBackgroundMouseDown(((t,e)=>{$t(e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.nn),this.nn(),this.ig(r,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||ja)(this,this.ey,this.At,this.qi,this.us.es,t);return this.gy(e),e}addLineSeries(t){const e=new Ha(this,this.ey,this.At,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPointLineSeries(t){const e=new Xa(this,this.ey,this.At,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addSurfaceGridSeries(t){const e=new il(this,this.ey,this.At,t,this.qi,this.us.es);return this.gy(e),e}addSurfaceScrollingGridSeries(t){const e=new sl(this,this.ey,this.At,t,this.qi,this.us.es);return this.gy(e),e}addBoxSeries(t){const e=new Wa(this,this.ey,this.At,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addMeshModel(t){const e=new hl(this,this.ey,this.At,this.qi,t,this.us.es);return this.gy(e),e}translateCoordinate(t,e,i){if(rl(e)||rl(i)||nl(t)){if(rl(e)&&rl(i)&&nl(t)){if("axes"===e.id&&"world"===i.id)return this.At.ft(t);if("world"===e.id&&"axes"===i.id)return this.At.yt(t);if(e.id===i.id)return t}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return Bh(t,e,i,this.pixelScale,this.us)}getDefaultAxisX(){return this.HS.x}getDefaultAxisY(){return this.HS.y}getDefaultAxisZ(){return this.HS.z}getDefaultAxes(){return[this.HS.x,this.HS.y,this.HS.z]}setCameraLocation(t){let e={location:t,direction:Fe.normalize(Fe.multiply(t,-1))};const i=this.OS.cameraLocationChanged(this.NS(e));return i&&(e=i),this.GS(e),this.us.bs(),this}getCameraLocation(){return this.At.getCameraLocation()}getCameraDirection(){return this.At.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.OS.Ny(t);const e=this.OS.cameraLocationChanged(this.NS());return e&&this.GS(e),this}getCameraAutomaticFittingEnabled(){return this.OS.Qy()}onCameraChange(t){return this.D.on("cameraChange",t)}offCameraChange(t){return this.D.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.$S.Ee(t).ym(La(this.$S.ku())),this.At.bs(),this}getBoundingBoxStrokeStyle(){return this.$S.ku()}setBoundingBox(t){return this.XS(t,!1),this}XS(t,e){this.QS=t;const i=this.ZS(t);if(this.WS.x.q(i.x),this.WS.y.q(i.y),this.WS.z.q(-i.z),!e){const t=this.OS.boundingBoxChanged(this.NS());t&&this.GS(t)}this.us.bs()}getBoundingBox(){return this.QS}Fe(t){if(Wh.cg(this.ng,this.eg),0!==this.LS){const e=this.LS*t*.006;this.FS.push({type:"wheel-zoom",deltaY:e}),this.LS=Math.sign(this.LS)*Math.max(Math.abs(this.LS)-.01*t,0),0!==this.LS&&this.us.bs(!0)}const e=this.getCameraDirection();if(this.FS.length>0){const t=this.OS.applyCameraInteractions(this.NS(),this.FS);t&&this.GS(t),this.FS.length=0}this.JS&&Fe.equals(this.JS.location,this.jS.location)&&Fe.equals(this.JS.direction,this.jS.direction)||this.D.emit("cameraChange",this,this.getCameraLocation()),this.JS=this.jS,super.Fe(t);for(let t=0;tthis.At._m(t))),o=this.At._m(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=ie(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.tn.length=0,this.WS.W(),this.At.W(),this.zS.W(),this.VS.W(),super.dispose()}j(){return this.WS.x.j(),this.WS.y.j(),this.WS.z.j(),super.j()}Z(){return super.Z()}GS(t){this.At.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(Fe.addVec(t.location,Fe.multiply(t.direction,-this.IS))),this.jS=t,this.us.bs()}ZS(t){return Fe.divide(t,Fe.length(t)/this.TS)}NS(t=this.jS){return{boundingBox:this.ZS(this.QS),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.DS=t,this}getMouseInteractionZoom(){return this.DS}setMouseInteractionRotate(t){return this.BS=t,this}getMouseInteractionRotate(){return this.BS}forEachAxis(t){return t(this.HS.x),t(this.HS.y),t(this.HS.z),this}getSeries(){return this.iy}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.PS=!!t,this}getAnimationZoom(){return this.PS}}const ll={Column:Ao,Row:xo};class ul extends Nh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.KS=new Map,this.qS=this.addUIElement(ll.Row).setPosition({x:0,y:100}).setOrigin(Ts.LeftTop).setBackground((t=>t.setFillStyle(B).setStrokeStyle(rt)))}add(t,e){return(t instanceof Gh?[t]:t instanceof Cf?t.getCells().filter((t=>t.panel instanceof Gh)).map((t=>t.panel)):[]).forEach((t=>{const i=this.qS.addElement($o.VerticalLegendBox).setBackground((t=>t.setFillStyle(B).setStrokeStyle(rt))).add(t,e).setTitle(t.getTitle());this.KS.set(t,i)})),this.us.bs(),this}setLegendBoxes(t){return this.KS.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.qS.getSize()}}const cl={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},dl=(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(),fl=(t,e)=>{let i=e.geometry;return i=gl(t,e,i),i=yl(t,e,i),i},gl=(t,e,i)=>{if(t===cl.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===cl.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=$e(Ct(i)),h=[];for(let e=0;ethis.D.on("mouseEnter",t),this.onMouseLeave=t=>this.D.on("mouseLeave",t),this.onMouseClick=t=>this.D.on("mouseClick",t),this.onMouseDoubleClick=t=>this.D.on("mouseDoubleClick",t),this.onMouseDown=t=>this.D.on("mouseDown",t),this.onMouseUp=t=>this.D.on("mouseUp",t),this.onMouseMove=t=>this.D.on("mouseMove",t),this.offMouseEnter=t=>this.D.off(t,"mouseEnter"),this.offMouseLeave=t=>this.D.off(t,"mouseLeave"),this.offMouseClick=t=>this.D.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.D.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.D.off(t,"mouseDown"),this.offMouseUp=t=>this.D.off(t,"mouseUp"),this.offMouseMove=t=>this.D.off(t,"mouseMove"),this.offMouseDragStart=t=>this.D.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.D.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.D.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.D.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.D.on("mapDataReady",t);return this.av&&St.setTimeout((()=>t())),e},this.onViewChange=t=>this.D.on("viewChange",t),this.lv=(t,e,i,s,r)=>{this.dt.x.q(s).si([this.Xt.left+this.Da.left,this.Xt.right+this.Da.right]),this.dt.y.q(r).si([this.Xt.bottom+this.Da.bottom,this.Xt.top+this.Da.top+Wh.ug(this.ng,this.eg)]),this.uv&&this.cv(this.dv,this.dt,this.uv)},this.wt=(t,i)=>{const s=i;if(!s||!this.av)return;const{iRegion:r,region:n}=this.fv(this.av,s);this.hv!==e.AutoCursorModes.disabled&&(this.Av(n,r),$t(t)),this.nv&&this.us.ls.ws(n,!0),this.gv=n,this.D.emit("mouseEnter",this,t)},this.Ct=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:r}=this.fv(this.av,i);this.pv(r,s),this.nv&&this.us.ls.ws(r,!1),this.gv=void 0,this.D.emit("mouseLeave",this,t),t&&$t(t)},this.Pt=(t,i)=>{const s=i;if(!s||!this.av)return;const{iRegion:r,region:n}=this.fv(this.av,s);this.hv!==e.AutoCursorModes.disabled&&(this.Av(n,r),$t(t)),this.gv=n,this.D.emit("mouseMove",this,t)},this.kt=(t,e)=>this.D.emit("mouseClick",this,t),this.Tt=(t,e)=>this.D.emit("mouseDoubleClick",this,t),this.Ft=(t,e)=>this.D.emit("mouseDown",this,t),this.It=(t,e)=>this.D.emit("mouseUp",this,t),this.Bt=(t,e,i)=>{this.D.emit("mouseDragStart",this,t,e)},this.Dt=(t,e,i,s,r)=>{this.D.emit("mouseDrag",this,t,e,i,s)},this.Lt=(t,e,i,s)=>{this.D.emit("mouseDragStop",this,t,e,i)},this.Rt=(t,e)=>{this.D.emit("mouseWheel",this,t)},this.Et=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:r}=this.fv(this.av,i);this.mv=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Av(r,s),this.nv&&this.us.ls.ws(r,!0),this.gv=r,this.D.emit("touchStart",this,t),$t(t)},this.Vt=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:r}=this.fv(this.av,i);this.mv=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Av(r,s),this.gv=r,this.D.emit("touchMove",this,t),$t(t)},this.zt=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:r}=this.fv(this.av,i);this.mv=void 0,this.pv(r,s),this.nv&&this.us.ls.ws(r,!1),this.gv=void 0,this.D.emit("touchEnd",this,t),$t(t)},this.fs.zn||this.fs.Vn||this.fs.Jn||this.us.As(3),this.th=!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.yv=i.wp("mapChart plotting",0),this.onResize(this.lv),this.ng.Bh("Map Chart");const a=Dt(o?o.autoCursorBuilder:void 0,fa);this.Sv=a.Xg(i.Tp(),this.dt,this.dt,this.qi).setVisible(!1),this.vv=this.es.gA(),this.ig(n,this.uiScale),this.xv=this.yv.bv(this.dt).setMouseInteractions(this.Yi).setMouseEnterEventHandler(((t,e,i)=>this.wt(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseClickEventHandler(((t,e,i)=>this.kt(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseUpEventHandler(((t,e,i)=>this.It(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.Pt(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Bt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Dt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Lt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Rt(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Et(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Vt(e,i))).setTouchEndEventHandler(((t,e,i)=>this.zt(e,i))).ke(this.qi.mapChartFillStyle).Ce(this.qi.mapChartStrokeStyle),this.Mv=this.yv.bv(this.dt).setMouseInteractions(this.Yi).ke(this.qi.mapChartOutlierRegionFillStyle).Ce(this.qi.mapChartOutlierRegionStrokeStyle);const l=Dt(o&&o.type,cl.World);this.dv=l,this._v(l).then((()=>{this.D.emit("mapDataReady")}))}getRegionUnderMouse(){return this.gv}setFillStyle(t){return this.xv.ke(t),this.us.bs(),this}getFillStyle(){return this.xv.Lh()}setStrokeStyle(t){return this.xv.Ce(t),this.us.bs(),this}getStrokeStyle(){return this.xv._o()}setEffect(t){return this.vv.xs(t),this.us.bs(),this}getEffect(){return this.vv.Ms()}setOutlierRegionFillStyle(t){return this.Mv.ke(t),this.us.bs(),this}getOutlierRegionFillStyle(){return this.Mv.Lh()}setOutlierRegionStrokeStyle(t){return this.Mv.Ce(t),this.us.bs(),this}getOutlierRegionStrokeStyle(){return this.Mv._o()}setSeparateRegionFillStyle(t){return this.sv="function"==typeof t?t(this.sv):t,this.tv.forEach((t=>t.ke(this.sv))),this.us.bs(),this}getSeparateRegionFillStyle(){return this.sv}setSeparateRegionStrokeStyle(t){return this.ev="function"==typeof t?t(this.ev):t,this.tv.forEach((t=>t.Ce(this.ev))),this.us.bs(),this}getSeparateRegionStrokeStyle(){return this.ev}invalidateRegionValues(t){if(!this.av||!this.wv)return this.Cv=this.Cv||[],this.Cv.push(t),this;if("function"==typeof t)for(let e=0;e{t.kv(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.kv(e.value)}))}}return this.us.bs(),this}setAutoCursor(t){return this.Sv&&t(this.Sv),this.us.bs(),this}getAutoCursor(){return this.Sv}setAutoCursorMode(t){return this.hv=t,this.us.bs(),this}getAutoCursorMode(){return this.hv}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}getCursorResultTableFormatter(){return this.xp}onMouseDragStart(t){return this.D.on("mouseDragStart",t)}onMouseDrag(t){return this.D.on("mouseDrag",t)}onMouseDragStop(t){return this.D.on("mouseDragStop",t)}onMouseWheel(t){return this.D.on("mouseWheel",t)}onTouchStart(t){return this.D.on("touchStart",t)}onTouchMove(t){return this.D.on("touchMove",t)}onTouchEnd(t){return this.D.on("touchEnd",t)}offTouchStart(t){return this.D.off(t,"touchStart")}offTouchMove(t){return this.D.off(t,"touchMove")}offTouchEnd(t){return this.D.off(t,"touchEnd")}setMouseInteractions(t){return this.Yi=t,this.xv.setMouseInteractions(t),this}getMouseInteractions(){return this.Yi}setHighlight(t){var e;return t=Ae(t),this.rv=t,null===(e=this.av)||void 0===e||e.regions.forEach((e=>{this.us.ls.ws(e,t)})),this.D.emit("highlight",this,t),this}getHighlight(){return this.rv}setAnimationHighlight(t){var e;return null===(e=this.av)||void 0===e||e.regions.forEach((e=>{this.us.ls.Cs(e,t)})),this}getAnimationHighlight(){var t;return this.us.ls.ks(null===(t=this.av)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.nv=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.nv}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}offMapDataReady(t){return this.D.off(t,"mapDataReady")}offViewChange(t){return this.D.off(t,"viewChange")}async _v(t){const e=await((t,e)=>{let i;if(t===cl.World)i="countries_world.json";else if(t===cl.NorthAmerica)i="countries_northAmerica.json";else if(t===cl.SouthAmerica)i="countries_southAmerica.json";else if(t===cl.Africa)i="countries_africa.json";else if(t===cl.Europe)i="countries_europe.json";else if(t===cl.Asia)i="countries_asia.json";else if(t===cl.USA)i="states_usa.json";else if(t===cl.Canada)i="territoriesProvinces_canada.json";else{if(t!==cl.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw St.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return St.fetch(s).then((t=>t.json())).catch((t=>{Te(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.fs.Xs);this.wv=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=ml[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.Mv.Lr().Rl(e);if(t===cl.USA){const t=25.8,e=29.7;this.tv.push(this.yv.Te(this.dt).setMouseInteractions(!1).ke(this.sv).Ce(this.ev).Ie({x:-126,y:t}).q({x:10,y:e-t}),this.yv.Te(this.dt).setMouseInteractions(!1).ke(this.sv).Ce(this.ev).Ie({x:-113,y:t}).q({x:7,y:e-t}))}const s=this.us.ls.Br(this.xv,{animationEnabled:this.th});for(let i=0;i{o.forEach((e=>e.cs(t)))}))}if(this.vv.ps([this.xv]),this.uv=i,this.cv(t,this.dt,i),this.av=e,this.Cv){for(const t of this.Cv)this.invalidateRegionValues(t);this.Cv=void 0}this.us.bs()}cv(t,e,i){const s=pl[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.J(o.min.x,o.max.x),e.y.J(o.min.y,o.max.y);const h=this.dt.x.li(),a=this.dt.y.li();this.D.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]}})}Av(t,e){this.Tv={region:t,iRegion:e},this.us.bs()}pv(t,e){this.Tv&&t===this.Tv.region&&(this.Tv=void 0,this.us.bs())}fv(t,e){const i=Array.from(this.ov.entries()).findIndex((([t,i])=>i.includes(e)));return{iRegion:i,region:null==t?void 0:t.regions[i]}}setAnimationsEnabled(t){return this.th=!t,this}getAnimationsEnabled(){return this.th}getMinimumSize(){}Sd(){return[this]}Fe(t){super.Fe(t),super.tg(),Wh.cg(this.ng,this.eg);const e=m(this.dt.x.ei(),this.dt.y.ei(),this.dt.x.ri(),this.dt.y.ri());this.yv.ES(e);const i=this.us.Bn()||this.mv;if(this.Tv&&i){const t=this.wv&&this.wv[this.Tv.iRegion];let e=ut(i,this.engine.scale,this.dt);e={x:kt(e.x,this.dt.x.getInnerStart(),this.dt.x.getInnerEnd()),y:kt(e.y,this.dt.y.getInnerStart(),this.dt.y.getInnerEnd())};let s=e.x,r=e.y;const n=this.Tv.region.transform;this.Tv.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.Sv.setPosition(e).setVisible(!0).getResultTable().setContent(this.xp(new Kh,this.Tv.region,t,s,r,this).fc())}else this.Sv.setVisible(!1);return this.Sv.Ds().Fe(),this}dispose(){return this.yv.W(),this.Sv.dispose(),Oh(this.dt),super.dispose()}j(){return super.j(),this.dt.j(),this}Z(){return super.Z(),this.dt.Z(),this}ld(){return ae(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))),he(t,this.qi,i,{fill:this.getFillStyle()}),this}}const xl=(t,e,i,s,r,n)=>(t.addRow(`${e.name}`).addRow(Sl(s,r)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),Sl=(t,e)=>{const i=t>0,s=e>0;return`${[ue(Math.abs(0|t),2),"° ",ue(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[ue(Math.abs(0|e),2),"° ",ue(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`};class bl extends qs{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.Fv(i),s,r,{numeric:e.Iv({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.Iv({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.Iv({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.Pv=n,this.Dv=o,this.Bv=h,this.es=a,this.Lv=i,this.Rv=e.Iv({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.Dh=h.kr(i).setMouseInteractions(!1).Vh(e.Iv({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).ke(e.Iv({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Nh=this.es.gA([this.Dh]).xs(s.effectsText)}setTickStrategy(t,e){return super.kh(t,e)}setStrokeStyle(t){return this.Rv="function"==typeof t?t(this.Rv):t,this.Dv.bs(),this}getStrokeStyle(){return this.Rv}ar(t,e){return new vl(e,t,this.Lv,this.Bv,this.Bv,this.Ev(this.Pv,this.Lv),this.Bv.Ve(this.Lv).setMouseInteractions(!1))}lr(t,e){const i=this.Vv(this.Lv,t);this.zv&&!1===this.zv(t)?t.Ye.setVisible(!1):t.Ye.setVisible(!0).Ie(ri(this.Ov(this.Lv,t.S),i.padding)).Ja(i.alignment).zh(i.rotation).Ha(i.offset.x,i.offset.y),this.Nv(this.Lv,t.Gv,t.Wv,t)}setMouseInteractions(t){return this}Fe(){this.Jh({physicalAxisSize:0});const t=this.dr(((t,e)=>{const i=e.Sh.nr,s=.5*this.Rv.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Ye.Ds().oi().y/this.Lv.Wi().y)+i.labelPadding;return Math.max(t,s)}),0);return this.Uv(this.Lv,this.Rv,t),this.Yv(this.Lv,this.Dh,t),t}}class vl extends Ko{constructor(t,e,i,s,r,n,o,h){super(t,e,s,i,r,i,h),this.Gv=n,this.Wv=o,n.setMouseInteractions(!1),this.ts.push(n,o)}}class Ml extends bl{constructor(t,e,i,s,r,n,o,h,a){super(t,Tl((()=>this.vA())),e,i,s,r,n,o,h),this.pm=this.Dv.Ve(this.Lv).setMouseInteractions(!1),this.Hv=a,this.setScrollStrategy(Rs.expansion),this.setTickStrategy(Bs.Numeric),this.setTitle("Amplitude")}vA(){return this.Hv()}br(t,e){return Jo(t,e,this.Lv.y)}_r(t,e,i){const s=2*(e-t),r=this.Lv.x.Li(s);return{min:t-i*r,max:e+i*r}}Ov(t,e){return{x:t.$v()?e-t.Xv().start:t.Xv().start-e,y:0}}Ev(t,e){return t.Fc(e)}Nv(t,e,i,s){const r=s.Sh.nr,n=t.$v()?s.S-t.Xv().start:t.Xv().start-s.S;Et(s.S,t.Xv().start)||Et(s.S,t.Xv().end)?e.setVisible(!1):e.setVisible(!0).vu(0).ze(360).wu(void 0)._u(0).xu(n).wu(60).ke(B).Ce(r.gridStrokeStyle);const o=.5*this.Rv.getThickness();i.Oe({x:n,y:-o*t.Wi().y}).ze({x:n,y:-(o+r.tickLength)*t.Wi().y}).Ee(r.tickStyle)}Vv(t,e){const i=e.Sh.nr;return{alignment:{x:0,y:1},padding:{x:0,y:t.Wi().y*-(.5*this.Rv.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}Uv(t,e,i){const s=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;this.pm.Oe({x:0,y:0}).ze({x:s,y:0}).Ee(e)}Yv(t,e,i){const s=t.$v()?(t.Xv().start+t.Xv().end)/2-t.Xv().start:t.Xv().start-(t.Xv().start+t.Xv().end)/2;e.Ja({x:0,y:1}).Ie({x:s,y:-i*t.Wi().y})}}const Tl=t=>({...Oa(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),Fv:t=>({getInnerStart:()=>t.Xv().start,getInnerEnd:()=>t.Xv().end,J:(e,i)=>t.jv(e,i),nt:(e,i,s,r,n)=>t.y.nt(e,i,s,r,n)}),Iv:t=>t.amplitude});class wl extends bl{constructor(t,e,i,s,r,n,o,h){super(t,kl,e,i,s,r,n,o,h),this.Zv=90,this.Qv=12,this.Jv=El,this.pm=this.Dv.Fc(this.Lv).setMouseInteractions(!1),this.zv=t=>{let e=180*(t.S-this.Lv.Kv())/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.Je=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Zv)}setTickStyle(t){return this.qv="function"==typeof t?t(this.qv):t,this.tx(),this.Dv.bs(),this}getTickStyle(){return this.qv}setTickFormattingFunction(t){return this.Jv=t,this.tx(),this.Dv.bs(),this}getTickFormattingFunction(){return this.Jv}setClockwise(t){this.Lv.ix(t);const e=this.Zv*Math.PI/180;return t?this.Lv.sx(e+Math.PI/2):this.Lv.sx(e-Math.PI/2),this.Dv.bs(),this}getClockwise(){return!this.Lv.hx()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Zv=t;const e=t*Math.PI/180;return this.getClockwise()?this.Lv.sx(e+Math.PI/2):this.Lv.sx(e-Math.PI/2),this.Dv.bs(),this}getNorth(){return 180*this.Lv.Kv()/Math.PI}setDivision(t){return this.Qv=t,this.tx(),this.Dv.bs(),this}getDivision(){return this.Qv}vA(){return[]}br(t,e){return e}_r(t,e,i){return{min:t,max:e}}Ov(t,e){const i=t.hx()?1:-1,s=t.Kv(),r=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}Ev(t,e){return t.Ve(e)}Nv(t,e,i,s){const r=this.qv,n=t.hx()?1:-1,o=t.Kv(),h=(s.S-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end,c={x:a*u,y:l*u};e.Oe({x:0,y:0}).ze(c);const d={x:c.x+a*r.tickLength*t.Wi().x,y:c.y+l*r.tickLength*t.Wi().y};i.Oe(c).ze(d),e.Ee(r.gridStrokeStyle),i.Ee(r.tickStyle)}Vv(t,e){const i=this.qv,s=t.hx()?1:-1,r=t.Kv();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.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}}}Uv(t,e,i){const s=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;this.pm.vu(0).ze(360)._u(0).xu(s+.5*e.getThickness()*t.Wi().x).wu(360).ke(B).Ce(e)}Yv(t,e,i){const s=t.Kv(),r=this.Vv(t,{S:0+s}),n=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;e.Ja(r.alignment).zh(r.rotation).Ha(r.offset.x,r.offset.y).Ie(ri({x:n,y:0},r.padding))}tx(){this.Yh({He:[],$e:[{Ye:"Radial ticks",wA:0,nr:this.qv,hr:this.Jv,Ir:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Qv;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},xh:{ur:()=>{},bh:()=>!1},Pr:void 0}],We:El,Hh:void 0,$h:void 0})}}const El=(t,e,i)=>(180*t/Math.PI).toFixed(0),kl={pr:()=>{},mr:()=>{},Sr:()=>{},Fv:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,J:(t,e)=>{},nt:(e,i,s,r,n)=>t.x.nt(e,i,s,r,n)}),Iv:t=>t.radial},Cl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),Dl=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class Fl extends Ui{constructor(t,e,i,s,r,n){super(e,i,r,n),this._s="Sector",this.nx=0,this.ox=1*Math.PI/2,this.lx=void 0,this.ux=void 0,this.Ts=t,this.Lv=s,this.np=this.Ts.Fc(this.Lv).cs(this.getHighlight()),this.gs(this.np),this.be=r.polarSectorFillStyle,this.Me=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.nx=kt(t,0,360),this.Ts.bs(),this}getAngleStart(){return this.nx}setAngleEnd(t){return this.ox=kt(t,0,360),this.Ts.bs(),this}getAngleEnd(){return this.ox}setAmplitudeStart(t){return this.lx=t,this.Ts.bs(),this}getAmplitudeStart(){return this.lx}setAmplitudeEnd(t){return this.ux=t,this.Ts.bs(),this}getAmplitudeEnd(){return this.ux}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ts.bs(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ts.bs(),this}getStrokeStyle(){return this.Me}Fe(){const t=this.Lv.Xv(),e=180*this.Lv.Kv()/Math.PI,i=void 0!==this.lx?kt(this.lx,t.start,t.end):t.start,s=void 0!==this.ux?kt(this.ux,t.start,t.end):t.end,r=this.Lv.$v()?i-t.start:t.start-i,n=this.Lv.$v()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.Lv.hx()?1:-1,l=Math.abs(this.ox-this.nx);this.np.vu((this.nx-e)*a).ze((this.ox-e)*a)._u(100*o/h).xu(h).ke(this.be).Ce(this.Me).wu(Math.ceil(l/2))}Pe(t,e){t.cs(e),this.Ts.bs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}}class Il extends Ui{constructor(){super(...arguments),this.Lm=!0,this.Ax=!0}setAutoScrollingEnabled(t){return this.Lm=t,this.Ji.us.bs(),this}getAutoScrollingEnabled(){return this.Lm}Gm(){}Fe(){}$p(){}setCursorEnabled(t){return this.Ax=t,this}getCursorEnabled(){return this.Ax}}class Ll extends Il{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Ts=t,this.Ji=e,this.scale=s}getAmplitudeMin(){return this.gx?this.gx.min:void 0}getAmplitudeMax(){return this.gx?this.gx.max:void 0}}const zl=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(s)),Vl=(t,e)=>{const i=[],s=e.Xv().start,r=e.Xv().end,n=e.$v(),o=e.hx()?1:-1,h=e.Kv(),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=kt(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},Pl=t=>{const e={min:Ie,max:Le};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},Rl=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),Bl=(t,e)=>{let i=gi(t);for(e.hx()||(i*=-1),i+=180*e.Kv()/Math.PI;i<0;)i+=360;i%=360;const s=ii(t),r=e.Xv(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:Ln(r.start,r.end,s/n)}};class _l extends Ll{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this._s="Heatmap Series",this.mx=!0,this.$m=!1,this.xp=Ol,this.ld=()=>ae(this.be);const h=this.Ji.getSeries().length;this.be=ce(this.qi.polarHeatmapSeriesFillStyle||this.qi.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.En=u,this.yx=t.Sx(s,[],u).ke(this.be).cs(this.getHighlight()),this.gs(this.yx);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.gx={min:c,max:d},this.setHighlightOnHover(!1)}invalidateIntensityValues(t){if(this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),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.En.dataOrder?t[0].length:t.length,annuli:"annuli"===this.En.dataOrder?t.length:t[0].length},i="annuli"===this.En.dataOrder?this.En.annuli:this.En.sectors,s="annuli"===this.En.dataOrder?this.En.sectors:this.En.annuli;if(e.x>i||e.y>s){if(!0===this.Ji.fs.oo){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.`;St.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ji.fs.oo){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.`;St.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.yx.oS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.Ts.bs(),this.$m=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.yx.ke(this.be),this.Ts.bs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}clear(){return this.yx.Nt(),this.Ts.bs(),this}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.yx.rS(t),this.Ts.bs(),this}getIntensityInterpolation(){return this.yx.nS()}Dm(){return this.Lm&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){const i=ut(t,this.Ji.engine.scale,this.scale),s=Bl(i,this.scale),r=this.mx?this.yx.vx(s):this.yx.gg(s);if(r)return ga(Vl([r],this.scale)[0],this.scale,this.xp(new Kh,this,{angleDeg:r.angle,amplitude:r.amplitude,intensity:r.cellValue,iAnnulus:r.iAnnulus,iSector:r.iSector},this.Ji.getAmplitudeAxis().formatValue).fc(),this,this.be)}solveNearestFromScreen(t){return this.gg(jo(t,this.Ji.us),!1)}Fe(){}attach(t,e=!0,i=!1){return super.attach(t,e),he(t,this.qi,i,{fill:this.be}),this}}const Ol=(t,e,i,s)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i.angleDeg).toString()).addRow("Amplitude","",s(i.amplitude)).addRow("Intensity","",i.intensity.toFixed(1));class Nl extends Ll{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this._s="Line Series",this.xx=[],this.bx=!1,this.Mx=!1,this.xp=zl,this.Cu=ce(this.qi.polarLineSeriesStrokeStyle,n),this._x=t.zp(s,void 0,[ka.UserSeries]).Ee(this.Cu).cs(this.getHighlight()).pl(Ir.Nearest),this.gs(this._x)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){return 0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.xx=Rl(t),this.bx=!0,this.gx=Pl(this.xx),this.Ts.bs(),this}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;return this._x.Ee(e),this.Ts.bs(),this}getStrokeStyle(){return this.Cu}setConnectDataAutomaticallyEnabled(t){return this.Mx=t,this.Ts.bs(),this}getConnectDataAutomaticallyEnabled(){return this.Mx}Dm(){return this.Lm&&this.xx.length>0&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){return this.wx(t,this._x)}solveNearestFromScreen(t){return this.wx(jo(t,this.Ji.us),this._x)}wx(t,e){const i=e.Cx(t);if(!i)return;const{angle:s,amplitude:r}=Bl(i,this.scale);return ga(i,this.scale,this.xp(new Kh,this,s,r,this.Ji.getAmplitudeAxis().formatValue).fc(),this,this.Cu.getFillStyle())}Fe(){if(this.bx||this.scale.kx()){const t=Vl(this.xx,this.scale),e=$e(t);this.Mx?(t.push({...t[0]}),this._x.tu(!0)):this._x.tu(!1),this._x.Nt()._l(t).ra(e),this.bx=!1,this._x.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{stroke:this.Cu}),this}}class Ul extends Ll{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this._s="Point Line Series",this.xx=[],this.bx=!1,this.Mx=!1,this.Tx=3,this.Fa=0,this.Fx=e.PointShape.Circle,this.xp=zl,this.be=ce(this.qi.polarPointLineSeriesFillStyle,o),this.Cu=ce(this.qi.polarPointLineSeriesStrokeStyle,o),this._x=t.zp(r,void 0,[ka.UserSeries]).Ee(this.Cu).cs(this.getHighlight()).pl(Ir.Nearest),this.gs(this._x),this.zc=t.Oc(r).ke(this.be).Sl(this.Fx).q(this.Tx).cs(this.getHighlight()).pl(Ir.Nearest),this.gs(this.zc)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){return 0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.xx=Rl(t),this.bx=!0,this.gx=Pl(this.xx),this.Ts.bs(),this}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;return this._x.Ee(e),this.Ts.bs(),this}getStrokeStyle(){return this.Cu}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.zc.ke(e),this.Ts.bs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.Tx=t,this.zc.q(t),this.Ts.bs(),this}getPointSize(){return this.Tx}setPointShape(t){return this.Fx=t,this.zc.Sl(this.Fx),this}getPointShape(){return this.Fx}setPointRotation(t){return this.Fa=t,this.zc.zh(t),this.Ts.bs(),this}getPointRotation(){return this.Fa}setConnectDataAutomaticallyEnabled(t){return this.Mx=t,this.Ts.bs(),this}getConnectDataAutomaticallyEnabled(){return this.Mx}Dm(){return this.Lm&&this.xx.length>0&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){return this.wx(t,this._x)}solveNearestFromScreen(t){return this.wx(jo(t,this.Ji.us),this._x)}wx(t,e){const i=e instanceof Kr?e.gg(t):e.Cx(t);if(!i)return;const{angle:s,amplitude:r}=Bl(i,this.scale);return ga(i,this.scale,this.xp(new Kh,this,s,r,this.Ji.getAmplitudeAxis().formatValue).fc(),this,"color"in i&&W(this.be)?new U({color:i.color}):this.be)}Fe(){if(this.bx||this.scale.kx()){const t=Vl(this.xx,this.scale),e=$e(t);this.Mx?(t.push({...t[0]}),this._x.tu(!0)):this._x.tu(!1),this._x.Nt()._l(t).ra(e),this.zc.Nt()._l(t).ra(e),this.bx=!1,this._x.Ds(),this.zc.Ds()}}yd(){return this.Fx}}class Gl extends Ll{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this._s="Point Series",this.xx=[],this.bx=!1,this.Tx=3,this.Fa=0,this.Fx=e.PointShape.Circle,this.xp=zl,this.be=ce(this.qi.polarPointSeriesFillStyle,o),this.zc=t.Oc(r).ke(this.be).Sl(this.Fx).q(this.Tx).cs(this.getHighlight()).pl(Ir.Nearest),this.gs(this.zc)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){return 0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.xx=Rl(t),this.bx=!0,this.gx=Pl(this.xx),this.Ts.bs(),this}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.zc.ke(e),this.Ts.bs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.Tx=t,this.zc.q(t),this.Ts.bs(),this}getPointSize(){return this.Tx}setPointShape(t){return this.Fx=t,this.zc.Sl(this.Fx),this}getPointShape(){return this.Fx}setPointRotation(t){return this.Fa=t,this.zc.zh(t),this.Ts.bs(),this}getPointRotation(){return this.Fa}Dm(){return this.Lm&&this.xx.length>0&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){const i=this.zc.gg(t);if(!i)return;const{angle:s,amplitude:r}=Bl(i,this.scale);return ga(i,this.scale,this.xp(new Kh,this,s,r,this.Ji.getAmplitudeAxis().formatValue).fc(),this,"color"in i&&W(this.be)?new U({color:i.color}):this.be)}solveNearestFromScreen(t){return this.gg(jo(t,this.Ji.us),!1)}Fe(){if(this.bx||this.scale.kx()){const t=Vl(this.xx,this.scale),e=$e(t);this.zc.Nt()._l(t).ra(e),this.bx=!1,this.zc.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{fill:this.be}),this}yd(){return this.Fx}}class Wl{constructor(t,e,i,s){this.D=new r.Eventer,this.Ix=!1,this.Ji=t,this.Px=e,this.iy=i,this.el=s}setGeometry(t){return this.Dx=t,this.Ix=!0,this.Ji.us.bs(),this}getGeometry(){return this.Dx}setMouseInteractions(t){return this.el.setMouseInteractions(t),this}dispose(){return this.el.dispose(),this.Px(this),this.D.emit("dispose",this),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setVisible(t){const e=this.el.getVisible()!==t;return this.el.setVisible(t),e&&this.D.emit("visibleStateChanged",this,t),this.Ji.us.bs(),this}getVisible(){return this.el.getVisible()}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}}const Yl=(t,e,i)=>{const s=e.dt,r=i.dt;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.sA&&(n=1-n),1===e.sA&&(o=1-o),u(o,n)};class Hl extends ia{constructor(t,e,i,s,r,n,o,h){super(t,e,Pi(i.dt,s.dt),r,h),this.Bx=!1,this.Lx=!1,this.Rx=!0,this.Ex=!0,this.Vx=!1,this.zx=!1,this.setGridStrokeYStyle=t=>(this.Ox.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.Ox.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.Nx=n,this.Gx=o,this.Wx=this.axisX.FA(!1,this.Nx).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.Ox=this.axisY.FA(!1,this.Gx).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.Wx.dispose(),this.Ox.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(ut(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.Wx.setValue(t.x),this.Ox.setValue(t.y);const e=Yl(u(this.Wx.getValue(),this.Ox.getValue()),this.axisX,this.axisY);return this.Wx.setGridStrokeLength(this.Vx?e.x:1),this.Ox.setGridStrokeLength(this.zx?e.y:1),this}Fe(){this.Wx.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Bx),this.Ox.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Lx);const t=Yl(u(this.Wx.getValue(),this.Ox.getValue()),this.axisX,this.axisY);return this.Wx.setGridStrokeLength(this.Vx?t.x:1),this.Ox.setGridStrokeLength(this.zx?t.y:1),super.Fe()}setGridStrokeXCut(t){return this.Vx=t,this.Ts.bs(),this}getGridStrokeXCut(){return this.Vx}setGridStrokeYCut(t){return this.zx=t,this.Ts.bs(),this}getGridStrokeYCut(){return this.zx}setGridStrokeXStyle(t){return this.Wx.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.Wx.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.Bx=t,this.Ts.bs(),this}getTickMarkerXVisible(){return this.Bx}setTickMarkerYVisible(t){return this.Lx=t,this.Ts.bs(),this}getTickMarkerYVisible(){return this.Lx}setTickMarkerX(t){return this.Wx.setMarker(t),this}setTickMarkerY(t){return this.Ox.setMarker(t),this}getTickMarkerX(){return this.Wx.getMarker()}getTickMarkerY(){return this.Ox.getMarker()}}class Xl extends ea{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this.Vx=!1,this.zx=!1,this.Ux=!1,this.Yx=!1,this.Hx=new Map,this.$x=new Map,this.Bx=!0,this.Lx=!0,this.Og=s,this.Nx=r,this.Gx=n,this.Xx=o.cursorGridStrokeStyleX,this.jx=o.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.Hx.forEach((t=>t.dispose())),this.$x.forEach((t=>t.dispose())),this.Zx=void 0,this.Qx=void 0,this}Fe(){return this.Zx&&this.Zx.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Bx),this.Qx&&this.Qx.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Lx),super.Fe()}pointAt(t){const{location:e}=t,i=t.owner instanceof nu&&t.owner;if(!i)return this;const{axisX:s}=i,{axisY:r}=i,n=this.Ah(s,!0),o=this.Ah(r,!1);n!==this.Zx&&this.Zx&&this.Zx.setVisible(!1),o!==this.Qx&&this.Qx&&this.Qx.setVisible(!1),n.setValue(e.x),o.setValue(e.y);const h=Yl(u(e.x,e.y),s,r);return n.setGridStrokeLength(this.Vx?h.x:1),o.setGridStrokeLength(this.zx?h.y:1),this.Zx=n,this.Qx=o,super.pointAt(t)}Ug(t){if(super.Ug(t),t){const e=e=>e.setTextFillStyle(t);this.Zx&&this.Ux&&this.Zx.setMarker(e),this.Qx&&this.Yx&&this.Qx.setMarker(e)}}Ah(t,e){let i=(e?this.Hx:this.$x).get(t);return i||(e?(i=t.FA(!1,this.Nx),this.Hx.set(t,i)):(i=t.FA(!1,this.Gx),this.$x.set(t,i)),this.rr(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}rr(t,e){const i=e?this.Xx:this.jx;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.Bx:this.Lx)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.Vx=t,this.Ts.bs(),this}getGridStrokeXCut(){return this.Vx}setGridStrokeYCut(t){return this.zx=t,this.Ts.bs(),this}getGridStrokeYCut(){return this.zx}setGridStrokeXStyle(t){return this.Xx=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.Hx.forEach((t=>t.setGridStrokeStyle(this.Xx))),this}getGridStrokeXStyle(){return this.Xx}setGridStrokeYStyle(t){return this.jx=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.$x.forEach((t=>t.setGridStrokeStyle(this.jx))),this}getGridStrokeYStyle(){return this.jx}setTickMarkerXVisible(t){return this.Bx=t,this.Ts.bs(),this}getTickMarkerXVisible(){return this.Bx}setTickMarkerYVisible(t){return this.Lx=t,this.Ts.bs(),this}getTickMarkerYVisible(){return this.Lx}setTickMarkerX(t){return this.Hx.forEach((e=>e.setMarker(t))),this.Nx=this.Nx.addStyler(t),this.Ts.bs(),this}setTickMarkerY(t){return this.$x.forEach((e=>e.setMarker(t))),this.Gx=this.Gx.addStyler(t),this.Ts.bs(),this}setTickMarkerXAutoTextStyle(t){return this.Ux=t,this.Ts.bs(),this}getTickMarkerXAutoTextStyle(){return this.Ux}setTickMarkerYAutoTextStyle(t){return this.Yx=t,this.Ts.bs(),this}getTickMarkerYAutoTextStyle(){return this.Yx}}class $l extends sa{constructor(t,e,i,s){super(t,s),this.Og=t,this.Nx=e,this.Gx=i,this.Yg=s}}class jl extends $l{constructor(){super(...arguments),this.$g=(t,e,i,s)=>this.Hg(new Xl(t,e,i,this.Og,this.Nx,this.Gx,s),s),this.addStyler=t=>new jl(this.Og,this.Nx,this.Gx,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new jl(t,this.Nx,this.Gx,this.Yg.map((t=>t)))}}class ql extends $l{constructor(){super(...arguments),this.Xg=(t,e,i,s,r)=>this.Hg(new Hl(t,e,i,s,this.Og,this.Nx,this.Gx,r),r),this.addStyler=t=>new ql(this.Og,this.Nx,this.Gx,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ql(t,this.Nx,this.Gx,this.Yg.map((t=>t)))}}const Jl=new jl(no,Xo.PointableTextBox,Xo.PointableTextBox,[(t,e)=>{oa(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),pn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),pn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Zl=new ql(no,Xo.PointableTextBox,Xo.PointableTextBox,[(t,e)=>{ha(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),pn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),pn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Kl=new ql(no,Xo.PointableTextBox,Xo.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),pn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),pn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Ql=(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}},tu=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class eu{constructor(t,i,s,n,o,h){this.Jx=e.UIVisibilityModes.always,this.Kx=e.UIVisibilityModes.always,this.jo=!0,this.$i=!1,this.qx=!1,this.tb=!1,this.wa=u(0,0),this.Nu=e.UIDraggingModes.draggable,this.Gu=void 0,this.D=new r.Eventer,this.Xi=!0,this.ib=(t,i,s)=>{this.qx=!0,this.Ts.bs();const r=this.Nu===e.UIDraggingModes.notDraggable?this.Nu:s||this.Nu;this.Gu=this.Ts.us.Er(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.sb=()=>{this.qx=!1,this.Ts.bs(),this.Ts.us.Vr(this.Gu)},this.eb=(t,e)=>{this.tb=!0,$t(e),this.Ts.bs()},this.hb=(t,i)=>{if(this.Nu!==e.UIDraggingModes.notDraggable){const s=i||this.Nu,r=ut(this.Ts.us.De(t.x,t.y),this.Ts.us.dt,this.scale),n=u(s!==e.UIDraggingModes.onlyVertical?tu(r.x,this.scale.x):this.wa.x,s!==e.UIDraggingModes.onlyHorizontal?tu(r.y,this.scale.y):this.wa.y);return this.setPosition(n),!0}return!1},this.rb=(t,e)=>{this.tb=!1,$t(e),this.Ts.bs()},this.onDispose=t=>this.D.on("dispose",t),this.offDispose=t=>this.D.off(t,"dispose"),this.Ts=t,this.renderingScale=i,this.scale=s,this.Sv=n,this.nb=o,this.qi=h;const a=n.getPointMarker().setMouseInteractions(!0);a.onMouseEnter(((t,e)=>this.ib(t,e))),a.onMouseLeave(this.sb),a.onMouseDragStart(this.eb),a.onMouseDrag(((t,e)=>this.hb(u(e.clientX,e.clientY))&&$t(e))),a.onMouseDragStop(this.rb),a.onTouchStart(this.eb),a.onTouchMove(((t,e)=>this.hb(u(e.clientX,e.clientY))&&$t(e))),a.onTouchEnd(this.rb),n.getResultTable().setMouseInteractions(!0),this.setPosition(this.wa)}setPosition(t){return this.wa=t,this.Sv.setPosition(t),this.D.emit("positionChange",this,this.wa),this}getPosition(){return this.wa}onPositionChange(t){return this.D.on("positionChange",t)}offPositionChange(t){return this.D.off(t,"positionChange")}setPointMarkerVisibility(t){return this.Jx=t,this.Ts.bs(),this}getPointMarkerVisibility(){return this.Jx}setResultTableVisibility(t){return this.Kx=t,this.Ts.bs(),this}getResultTableVisibility(){return this.Kx}setMouseInteractions(t){return this.jo=t,this.Sv.getPointMarker().setMouseInteractions(t),this.Sv.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.jo}setAutoFitStrategy(t){return this.Sv.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.Sv.getAutoFitStrategy()}isAttached(){return!0}Fe(){const t=this.isAttached();return Ql(this.Jx,this.qx,this.tb)?this.Sv.setPointMarkerVisible(!0):this.Sv.setPointMarkerVisible(!1),t&&Ql(this.Kx,this.qx,this.tb)?this.Sv.setResultTableVisible(!0):this.Sv.setResultTableVisible(!1),this.Sv.Fe(),this}Ds(){return this.Sv.Ds(),this}pointAt(t){return this.Sv.pointAt(t),this}dispose(){return this.$i||(this.$i=!0,this.nb(this),this.Sv.dispose(),this.D.emit("dispose")),this}setVisible(t){const e=this.Xi!==t;return this.Xi=t,this.Sv.setVisible(t),e&&this.D.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}setPointMarker(t){return this.Sv.setPointMarker(t),this}getPointMarker(){return this.Sv.getPointMarker()}setResultTable(t){return this.Sv.setResultTable(t),this}getResultTable(){return this.Sv.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Nu=t,this.Ts.bs(),this}getDraggingMode(){return this.Nu}}class iu extends eu{constructor(t,i,s,r,n,o,h){super(t,i,Pi(s.dt,r.dt),n.Xg(t,i,s,r,h),o,h),this.ob=e.UIVisibilityModes.always,this.ab=e.UIVisibilityModes.always,this.lb=e.UIVisibilityModes.always,this.ub=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.Sv.getGridStrokeXStyle(),this.gridStrokeStyleY=this.Sv.getGridStrokeYStyle(),this.Ts=t,this.axisX=s,this.axisY=r,this.nb=o;const a=this.Sv.getTickMarkerX().setMouseInteractions(!0);a.onMouseEnter(((t,i)=>this.ib(t,i,e.UIDraggingModes.onlyHorizontal))),a.onMouseLeave(this.sb),a.onMouseDragStart(this.eb),a.onMouseDrag(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&$t(i))),a.onMouseDragStop(this.rb),a.onTouchStart(this.eb),a.onTouchMove(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&$t(i)));const l=this.Sv.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.ib(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.sb),l.onMouseDragStart(this.eb),l.onMouseDrag(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&$t(i))),l.onMouseDragStop(this.rb),l.onTouchStart(this.eb),l.onTouchMove(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&$t(i)))}Fe(){const t=this.isAttached();return this.Xi&&t&&Ql(this.lb,this.qx,this.tb)?this.Sv.setTickMarkerXVisible(!0):this.Sv.setTickMarkerXVisible(!1),this.Xi&&t&&Ql(this.ub,this.qx,this.tb)?this.Sv.setTickMarkerYVisible(!0):this.Sv.setTickMarkerYVisible(!1),this.Sv.setGridStrokeXStyle(this.Xi&&t&&Ql(this.ob,this.qx,this.tb)?this.gridStrokeStyleX:rt),this.Sv.setGridStrokeYStyle(this.Xi&&t&&Ql(this.ab,this.qx,this.tb)?this.gridStrokeStyleY:rt),super.Fe()}setGridStrokeXVisibility(t){return this.ob=t,this.Ts.bs(),this}getGridStrokeXVisibility(){return this.ob}setGridStrokeYVisibility(t){return this.ab=t,this.Ts.bs(),this}getGridStrokeYVisibility(){return this.ab}setTickMarkerXVisibility(t){return this.lb=t,this.Ts.bs(),this}getTickMarkerXVisibility(){return this.lb}setTickMarkerYVisibility(t){return this.ub=t,this.Ts.bs(),this}getTickMarkerYVisibility(){return this.ub}setGridStrokeXCut(t){return this.Sv.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.Sv.getGridStrokeXCut()}setGridStrokeYCut(t){return this.Sv.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.Sv.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.Sv.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.Sv.getGridStrokeYStyle()}setTickMarkerX(t){return this.Sv.setTickMarkerX(t),this}getTickMarkerX(){return this.Sv.getTickMarkerX()}setTickMarkerY(t){return this.Sv.setTickMarkerY(t),this}getTickMarkerY(){return this.Sv.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.Sv.getTickMarkerX().setMouseInteractions(t),this.Sv.getTickMarkerY().setMouseInteractions(t),this}}class su extends iu{}class ru extends su{constructor(t,e,i,s,r,n){super(t,e,i.axisX,i.axisY,s,r,n),this.cb=!1,this.Ts=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.cb=!1,this.Ts.bs(),this}Ds(){if(!this.cb){const t=this.owningSeries.solveNearestFromScreen(ut(this.wa,this.scale,this.Ts.us.dt));t?(this.wa=ut(t.location,this.owningSeries.scale,this.scale),this.Sv.pointAt(t),this.cb=!0):this.Sv.setPosition(this.wa)}return super.Ds()}isAttached(){return this.cb}}class nu extends Il{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.fb=[],this.addMarker=(t=Kl)=>{const e=new ru(this.Ab(),this.Ji.uiScale,this,t,this.removeMarker,this.qi);return this.fb.push(e),e},this.removeMarker=t=>{const e=this.fb.indexOf(t);-1!==e&&this.fb.splice(e,1)},this.ts=new Map,this.chart=t,this.Ts=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.Ab=h,this.scale=Pi(s.dt,r.dt),this.gb=t.pb,t.pb+=1,this.mb(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.yb),this.onMouseLeave(this.chart.Sb),this.onMouseWheel(this.chart.Em),this.onMouseDragStart(this.chart.vb),this.onMouseDrag(this.chart.Vm),this.onMouseDragStop(this.chart.xb),this.onTouchStart(this.chart.zm.onTouchStart),this.onTouchMove(this.chart.zm.onTouchMove),this.onTouchEnd(this.chart.zm.onTouchEnd)}attacheAxis(){this.bb=this.axisXAttachHandler(this),this.Mb=this.axisYAttachHandler(this)}Fe(){super.Fe();for(let t=0;t{e.da(this.gb)})),this.Ji.us.bs(),this}dispose(){return super.dispose(),this.fb.slice().forEach((t=>t.dispose())),this.bb(this),this.Mb(this),this}_b(){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;it.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i)).addRow("Y","",e.axisY.formatValue(s));class uu extends nu{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,i,s,r,n,o,h,a,u,c),this.wb=[],this.Lu=[],this.Cb=0,this.ji=!1,this.Hi=e.HighlightModes.onHover,this.xp=lu,this.ds((t=>t.Vn||t.zn||t.qn?void 0:"xy series")),this.kb=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.Cb=void 0!==e&&e>0?e:0,this.Ts.bs(),this}add(t){if(0!==this.wb.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),Array.isArray(t)?this.Tb(t):this.Tb([t]),this.Lu.length>0){const t=this.Lu[this.Lu.length-1];this.Fb={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.Fb?this.Fb.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.wl()+e.Cl()),this.Lu.length)}clear(){this.Ib=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.kb.getXMax(this.wb,this.Ib)||0}getXMin(){return this.kb.getXMin(this.wb,this.Ib)||0}getYMax(){return this.kb.getYMax(this.wb,this.Ib)||0}getYMin(){return this.kb.getYMin(this.wb,this.Ib)||0}Sr(){const t=u(0,0);for(const e of this.wb)t.x=Math.max(t.x,e.Vl()),t.y=Math.max(t.y,e.zl());return t}Pb(t,e,i,s){this.kb.Pb(t,e,i,s,this.scale,(t=>{}))}Gm(){super.Gm();const t=this.wb.length;this.Db&&this.Pb(this.wb,this.getPointAmount(),this.Db,this.Cb),t!==this.wb.length&&this._b()}Fe(){super.Fe();const t=this.getBoundaries();this.Lu.length>0&&(this.Bb(this.Lu),this.Lu=[]);for(const e of this.wb)e.ra(t);return super.Fe()}$p(){super.$p(),this.Ib=void 0,this.Lu.length=0}Tb(t){0!==t.length&&(this.Ib?this.Ib=qe(this.Ib,$e(t)):this.Ib=$e(t),this.D.emit("dataAdd",this,t,this.Ib),this.Lu=se(this.Lu,t,{canReturnB:!1}),this.Ts.bs())}Lb(){return hu(this.wb)}Rb(t){return this.D.on("dataAdd",t)}Eb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}zb(t){return this.D.off(t)}}const cu=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;h{const e=this.Nb.indexOf(t);e>=0&&this.Nb.splice(e,1);const i=this.Ob.findIndex((e=>e===t.el));i>=0&&this.Ob.splice(i,1),this.Ts.bs()},this.be=ce(this.qi.polarPolygonSeriesFillStyle,n),this.Me=ce(this.qi.polarPolygonSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}addPolygon(){const t=new Wl(this.Ji,this.Gb,this,this.Wb());return this.Nb.push(t),t}setFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(const t of this.Ob)t.ke(e);return this.Ts.bs(),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.Ob)t.Ce(e);return this.Ts.bs(),this}getStrokeStyle(){return this.Me}Dm(){return this.Lm&&void 0!==this.Nb.find((t=>void 0!==t.Ub))&&this.getVisible()}Fe(){this.Nb.forEach((t=>{(t.Ix||this.scale.kx())&&t.Yb&&(t.el.Rl(Vl(t.Yb,this.scale)),t.Ix=!1,t.el.Ds())}))}Gm(){super.Gm();const t=y(Ie,Le);this.Nb.forEach((e=>{if(!e.Dx)return;const i=!e.Ix&&e.Yb?e.Yb:Rl(e.Dx);e.Yb=i;const s=!e.Ix&&e.Ub?e.Ub:Pl(i);e.Ub=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.gx=t}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){const i=cu(t,this.Ob,((t,e)=>{const i=t.gg(e);if(i)return ut(i,this.scale,t.us.dt)}),We);if(!i)return;const s=ut(i[0],i[1].us.dt,this.scale),r=this.Hb(i[1]);if(!r)return;const{angle:n,amplitude:o}=Bl(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.xp(new Kh,this,n,o,this.Ji.getAmplitudeAxis().formatValue).fc(),owner:this,fillStyle:this.be,polarPolygon:r}}solveNearestFromScreen(t){return this.gg(jo(t,this.Ji.us),!1)}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}Wb(){const t=this.Ts.vc(this.scale,nn.Simple).ke(this.be).Ce(this.Me).cs(this.getHighlight());return this.Ob.push(t),this.gs(t),t}Hb(t){return this.Nb.find((e=>e.el===t))}}class fu extends Ll{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this._s="Area Series",this.xx=[],this.bx=!1,this.Mx=!1,this.$b=!1,this.xp=zl,this.be=ce(this.qi.polarAreaSeriesFillStyle,n),this.Me=ce(this.qi.polarAreaSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));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),he(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}}class gu extends fu{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Xb=this.Ts.vc(this.scale,nn.Simple).cs(this.getHighlight()),this.gs(this.Xb)}Fe(){if(this.bx||this.scale.kx()){const t=this.xx,e=!0===this.Mx?Vl(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(Et(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;!Et(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.jb.start}ix(t){this.Zb=t,this.tM=!0}hx(){return!1===this.Zb}sx(t){this.Qb=t,this.tM=!0}Kv(){return this.Qb}mi(){return this.vi}_i(){return!1}ot(t,e,i,s){return this.x=new Fi(t.x,e.x,i.x,s?s.x:void 0),this.y=new Fi(t.y,e.y,i.y,s?s.y:void 0),this}yi(){return this.di}kx(){return this.qb}eM(){return this.tM}Wi(){return this.iM}j(){return this.o=!1,this.vi=!1,this.qb=!1,this.tM=!1,this}Z(){return this.o=!0,this.vi=!0,this.qb=!0,this.tM=!0,this}q(t,e){return"object"==typeof t?(this.X.x=t.x,this.X.y=t.y):(this.X.x=t,this.X.y=e),this.sM(),this}Ei(t){return this.Jb=t,this.sM(),this}Vi(t){return this.Kb=t,this.sM(),this}ni(){return u(this.Jb[0]+this.Jb[1],this.Kb[0]+this.Kb[1])}oi(){return this.X}sM(){const t=this.jb,e=u(this.x.ai(this.X.x),this.y.ai(this.X.y)),i=this.Jb[0]+this.Jb[1],s=this.Kb[0]+this.Kb[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.Jb[0]+Math.max((r-2*o)/2,0),this.Jb[1]+Math.max((r-2*o)/2,0)],a=[this.Kb[0]+Math.max((n-2*o)/2,0),this.Kb[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.q(this.X.x).si(h).J(-l,l),this.y.q(this.X.y).si(a).J(-l,l),this.iM={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.di={x:this.x.yi(),y:this.y.yi()},this.Z()}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=ei(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 mu extends Za{constructor(t,i,s,r,n,o,h){super(t,i,s,i.sg("polarChart bg",0),r,i.us.qi.polarChartBackgroundFillStyle,i.us.qi.polarChartBackgroundStrokeStyle,i.us.qi.polarChartTitleFont,i.us.qi.polarChartTitleFillStyle,h),this.coordsClient="client",this.Kd=[],this.jo=!0,this.vp=e.AutoCursorModes.onHover,this.hM=(t,e,i,s,r)=>{this.Lv.q(s,r)},this.if=Zt(this.Kd),this.rM=t=>{this.Kd.push(t)},this.nM=()=>this.iy,this.fs.zn||this.fs.Vn||this.fs.jn||this.us.As(4),this.oM=i.YS("polarChart series bg",0),this.aM=i.wp("polarChart axis gridlines",0),this.lM=i.wp("polarChart series",1),this.uM=i.wp("polarChart axis lines",2),this.cM=i.wp("polarChart axis ticks",3),this.Lv=s.d2({scaleXYConstructor:yu}),this.onResize(this.hM),this.ng.Bh("Polar Chart"),this.uy=this.oM.Fc(this.Lv).ke(this.qi.polarChartSeriesBackgroundFillStyle).Ce(rt).vu(0).ze(360)._u(0),this.Ay=this.oM.Fc(this.Lv).ke(B).Ce(this.qi.polarChartSeriesBackgroundStrokeStyle).vu(0).ze(360)._u(0),super.ly(this.uy,this.Ay),this.ig(n,this.pixelScale),this.dM=new Ml(this,this.Lv,this.qi,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.aM,this.uM,this.cM,this.es,this.nM),this.fM=new wl(this,this.Lv,this.qi,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.aM,this.uM,this.cM,this.es),this.coordsAxis={axisAmplitude:this.dM,axisRadial:this.fM},this.kp=i.Tp();const a=Dt(o?o.autoCursorBuilder:void 0,da);this.Ag=a.$g(this.kp,this.uiScale,this.uiScale,this.qi),Hh.pg(this),this.yy(((t,e)=>{Hh.mg(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled))}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}solveNearest(t){const e=t||this.us.Bn();if(e)return Hh.gg(this,jo(e,this.us),this.iy)}translateCoordinate(t,e,i){if(i){const e=t,s=this.pixelScale,r=i;if(Ri(r)){const t=ut(e,s,this.engine.scale);return this.us.Xo({engineX:t.x,engineY:t.y})}if(_i(r))return e;if(Cl(r)){const t=ut(e,s,this.Lv);return Bl(t,this.Lv)}}else{const i=t,s=e;if(Bi(i)){if(Cl(s)){const t=this.us.$o(i),e=ut({x:t.engineX,y:t.engineY},this.engine.scale,this.Lv);return Bl(e,this.Lv)}if(Ri(s))return i;if(_i(s)){const t=this.us.$o(i);return ut({x:t.engineX,y:t.engineY},this.us.dt,this.pixelScale)}}else if(Dl(i)){if(Cl(s))return i;const t=Vl([i],this.Lv)[0];if(Ri(s)){const e=ut(t,this.Lv,this.engine.scale),i={engineX:e.x,engineY:e.y};return this.us.Xo(i)}if(_i(s))return ut(t,this.Lv,this.pixelScale)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new Nl(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPointSeries(t){const e=new Gl(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPointLineSeries(t){const e=new Ul(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addAreaSeries(t){const e=new gu(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPolygonSeries(t){const e=new du(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addHeatmapSeries(t){const e=new _l(this.lM,this,this.ey,this.Lv,this.qi,this.us.es,t);return this.gy(e),e}addSector(){const t=new Fl(this.lM,this,this.if,this.Lv,this.qi,this.us.es);return this.rM(t),t}getAmplitudeAxis(){return this.dM}getRadialAxis(){return this.fM}Fe(t){var e,i;super.Fe(t),Wh.cg(this.ng,this.eg);for(const t of this.iy)t.Gm();this.dM.vr(),this.fM.vr();for(const t of this.iy)t.Fe();for(let t=1;t<=2;t+=1){const e=this.dM.Fe(),i=this.fM.Fe(),s=Wh.ug(this.ng,this.eg),r=[this.Da.left+i,this.Da.right+i],n=[this.Da.bottom+i,this.Da.top+i+s];this.Lv.Ei(r).Vi(n);const o=4;if(!(!this.AM||Math.abs(this.AM.amplitude-e)>=o||Math.abs(this.AM.radial-i)>=o)||1!==t){this.AM={amplitude:e,radial:i};break}}const s=this.Lv.Xv().start,r=this.Lv.Xv().end,n=this.Lv.$v()?((null===(e=this.AM)||void 0===e?void 0:e.radial)||0)*this.Lv.x.getPixelSize()+r-s:((null===(i=this.AM)||void 0===i?void 0:i.radial)||0)*this.Lv.x.getPixelSize()+s-r;this.uy.xu(n).wu(360),this.Ay.xu(n).wu(360);for(const t of this.Kd)t.Fe();Hh.dg(this,this.uy.getIsUnderMouse(),!1,this.iy,(t=>Hh.gg(this,t,this.iy)),((t,e)=>t.gg(e,!0)));for(const t of this.iy)t.$p();return super.tg(),this.gM(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.dM.setAnimationsEnabled(t),this.fM.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.jo=t,this}getMouseInteractions(){return this.jo}getMinimumSize(){return u(pu,pu)}gM(){}forEachAxis(t){return t(this.dM),t(this.fM),this}dispose(){return this.Kd.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this.oM.W(),this.aM.W(),this.lM.W(),this.uM.W(),this.cM.W(),this.kp.W(),super.dispose()}Sd(){return[...this.iy,...this.Kd]}}const pu=300;class Au extends xa{}class xu extends Au{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this._s="Slice",this.S=0,this.jg=!1,this.pM=B,this.Qg=B,this.Jg=this.S,this.tp=j((()=>this.Ji.us.bs())),this.sp=()=>{this.ep=void 0},this.index=t,this.Ji=s,this.scale=r,this.Ki=n,this.Xb=e.vc(r,nn.Simple).cs(this.getHighlight()),this.gs(this.Xb),this.Ye=i.kr(r).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0})}setValue(t){return this.Ji.getAnimationsEnabled()?this.getVisible()&&this.op(this.Jg,t):this.Jg=t,this.S=t,this.Ji.us.bs(),this}getValue(){return this.S}setVisible(t){return!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?(this.ep&&(this.ep.finish(!1),this.ep=void 0),this.op(this.Jg,0,(()=>super.setVisible(!1)))):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(this.ep&&(this.ep.finish(!1),this.ep=void 0),super.setVisible(!0),this.op(this.Jg,this.S)):(this.Jg=this.S,super.setVisible(!0)),this}op(t,e,i){this.ep=this.tp(300,X.ease)([[t,e]],(([t])=>{this.Jg=t,this.Ji.us.bs()})),this.ep.onEveryAnimationEnd(this.sp),i&&this.ep.onAnimationEnd(i)}setStyle(t,e,i,s){this.pM=t,this.Qg=i,this.Xb.ke(this.pM).Ce(e),this.Ye.ke(this.Qg).Vh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},vu=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=bu(i,r.x),s=bu(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+A*o,y:g.y-o},f={x:y.x-A*o,y:y.y-o}),S=(i+c/u*(s-i))/2,g={x:a-S,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-x:x}`,10)},y={x:a+S,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&y.x>g.x&&p.Xb.Rl([g,d,f,y])}};class Mu extends Gh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.sg("funnelChart bg",0),r,i.us.qi.funnelChartBackgroundFillStyle,i.us.qi.funnelChartBackgroundStrokeStyle,i.us.qi.funnelChartTitleFont,i.us.qi.funnelChartTitleFillStyle,o),this.ap=[],this.lp=ma.None,this.dp=!0,this.gp=0,this.mM=80,this.yM=20,this.SM=0,this.vM=e.FunnelSliceModes.VariableHeight,this.yp=!0,this.vp=e.AutoCursorModes.onHover,this.xp=Aa,this.bp=t=>{const e=this.ap.indexOf(t);e>=0&&(this.ap.splice(e,1),this.Mp())},this.fs.zn||this.fs.Vn||this.fs.Hn||this.us.As(5),this.Sp=this.qi.effectsText,this._p=i.wp("funnelChart bottom",0),this.Cp=i.wp("funnelChart top",1),this.ng.Bh("Funnel Chart"),this.up=this.qi.funnelChartSliceFillStylePalette,this.cp=this.qi.funnelChartSliceStrokeStyle,this.fp=this.qi.funnelChartSliceLabelFont,this.Ap=this.qi.funnelChartSliceLabelFillStyle,this.kp=i.Tp();const a=Dt(h?h.autoCursorBuilder:void 0,ca);this.Ag=a.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled)),this.ig(n,this.pixelScale)}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}addSlice(t,e){const i=new xu(this.gp,this._p,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);return this.gp+=1,i.setName(t),i.setValue(e),i.es.rs.xs(this.Sp),i.es.ns.xs(this.yp),this.ap.push(i),this.us.bs(),i.setHighlightOnHover(this.dp),i}addSlices(t){const e=[];for(let i=0;ie.es.ns.xs(t))),this.us.bs(),this}getSliceEffect(){return this.yp}setSliceSorter(t){return this.lp=t,this.ap=this.ap.sort(this.lp),this.us.bs(),this}getSliceSorter(){return this.lp}setLabelFillStyle(t){return this.Ap="function"==typeof t?t(this.Ap):t,this.us.bs(),this}getLabelFillStyle(){return this.Ap}setLabelFont(t){return this.fp="function"==typeof t?t(this.fp):t,this.us.bs(),this}getLabelFont(){return this.fp}setLabelEffect(t){return this.Sp=t,this.ap.forEach((e=>e.es.rs.xs(t))),this.us.bs(),this}getLabelEffect(){return this.Sp}setLabelFormatter(t){return this.Ip=t,this.us.bs(),this}getLabelFormatter(){return this.Ip}setSliceHighlightOnHover(t){return this.dp=t,this.ap.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),Wh.cg(this.ng,this.eg),super.tg();const e=Wh.ug(this.ng,this.eg),i=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+e)),s=u(this.Da.left+i.x/2,this.Da.bottom+i.y/2);this.ap=this.ap.sort(this.lp);for(let t=0,{length:e}=this.ap;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tga(e,this.engine.scale,this.xp(new Kh,this,t,o[r.indexOf(t)]||0).fc(),t,void 0))),this.Pp(r,o,s,i)}Fp(t,e){t.setStyle(this.ad?new U({color:this.ad.getColors(t.getAnimatedValue())}):this.up(e),this.cp,this.Ap,this.fp)}Mp(){this.ap=this.ap.sort(this.lp),this.us.bs()}Sd(){return this.ap}dispose(){return this.ap.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this._p.W(),this.Cp.W(),this.kp.W(),super.dispose()}}const Tu=(t,i,s)=>{const r=t.El();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}}},wu=t=>{const e=t.El();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 Eu extends Mu{constructor(){super(...arguments),this.Ip=pa.NamePlusValue,this.xM=10,this.bM=e.FunnelLabelSide.Left,this.MM=e.SliceLabelIndices.LabelsOnSides,this.Dp=[],this.Ep=this.qi.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Ep=t;for(let t=0;t{const e=this.ap.indexOf(t);e>=0&&this.ap.splice(e,1)},this.fs.zn||this.fs.Vn||this.fs.$n||this.us.As(6),this.Ts=e.wp("gaugeChart layer",0),this.Cp=e.wp("gaugeChart top layer",1),this.ng.Bh("Gauge Chart"),this.ig(r,this.pixelScale);const h=Yi();this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),this.setAnimationsEnabled(void 0===o||o)}dispose(){return this.Ts.W(),this.Cp.W(),this.ap.slice().forEach((t=>t.dispose())),super.dispose()}}class Lu extends Iu{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.uu=90,this.cu=-270,this.CM={min:this.uu,max:this.cu},this.kM=j((()=>this.Ts.bs())),this.TM=()=>{this.FM=void 0},this.IM=e.wp("radialGaugeChart bg arc",2),this.PM=this.Ts.Fc(this.pixelScale).ke(this.qi.gaugeChartEmptyGaugeFillStyle).Ce(this.qi.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.uu,s=this.cu,r=this.CM;return this.getAnimationsEnabled()?this.DM(r,{min:t,max:e}):(r.min=t,r.max=e,this.uu=t,this.cu=e),this.D.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.us.bs(),this}getAngleInterval(){return{min:this.uu,max:this.cu}}setGaugeFillStyle(t){return this.PM.ke(t),this.us.bs(),this}setGaugeStrokeStyle(t){return this.PM.Ce(t),this.us.bs(),this}DM(t,e,i){this.FM=this.kM(1e3,X.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.CM={min:t,max:e},this.uu=t,this.cu=e,this.Ts.bs()})),this.FM.onEveryAnimationEnd(this.TM),i&&this.FM.onAnimationEnd(i)}onAngleIntervalChange(t){return this.D.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.D.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.IM.W(),this}}class zu extends xa{BM(t){return this.D.on("valueChange",t)}LM(t){return this.D.on("valueIntervalChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}offIntervalChange(t){return this.D.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){he(t,this.qi,i,{fill:this.RM})}}class Vu extends zu{onValueChange(t){return this.BM(t)}onIntervalChange(t){return this.LM(t)}}class Pu extends Vu{constructor(t,e,i,s,r,n,o){super(i,r,n,o),this.uu=0,this.cu=0,this.EM=0,this.VM=0,this.zM=0,this.OM=100,this.NM=!0,this.Jg=this.S,this.qg=this.getVisible(),this.tp=be(),this.GM=t=>{this.Jg=t,this.Ji.us.bs()},this.WM=t,this.Tr=e,this.Ji=i,this.scale=s,this.RM=this.qi.gaugeChartGaugeFillStyle,this.np=t.Fc(s).ke(this.RM).Ce(rt).cs(this.getHighlight()),this.gs(this.np),this.UM=e.kr(s).cs(this.getHighlight()),this.gs(this.UM,{isText:!0}),this.YM=e.kr(s).cs(this.getHighlight()),this.gs(this.YM,{isText:!0}),this.Ye=e.kr(s).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0}),this.UM.ke(n.gaugeChartIntervalLabelsFillStyle).Vh(n.gaugeChartIntervalLabelsFont),this.YM.ke(n.gaugeChartIntervalLabelsFillStyle).Vh(n.gaugeChartIntervalLabelsFont),this.Ye.ke(n.gaugeChartValueLabelFillStyle).Vh(n.gaugeChartValueLabelFont),this.setName("Gauge Slice")}Fe(){const t=this.Ji.getDataLabelFormatter(),e=this.uu/90r&&(i=r);const n=this.cu-e*this.VM,o=this.uu+e*this.EM,h=this.OM-this.zM,a=(0!==h?(n-o)/h:1/0)*(i-this.zM);this.np.vu(o).ze(o+a);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>r}):t.format(i);this.Ye.Bh(l)}HM(){const t=this.Ji.getIntervalLabelFormatter(),e="function"==typeof t?t(this.zM,{getInnerStart:()=>this.zM,getInnerEnd:()=>this.OM}):t.format(this.zM);return this.UM.Bh(e).Ds(),this.UM.oi()}$M(){const t=this.Ji.getIntervalLabelFormatter(),e="function"==typeof t?t(this.OM,{getInnerStart:()=>this.zM,getInnerEnd:()=>this.OM}):t.format(this.OM);return this.YM.Bh(e).Ds(),this.YM.oi()}setName(t){return super.setName(t),this.Ji.us.bs(),this}setValue(t){const e=this.S;return this.Ji.getAnimationsEnabled()?this.qg&&this.tp(e,t,this.GM):this.Jg=t,this.S=t,this.D.emit("valueChange",this,e,t),this.Ji.us.bs(),this}getValue(){return this.S}setVisible(t){return this.qg=t,!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?this.tp(this.Jg,0,this.GM,{onCompleted:()=>super.setVisible(!1)}):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(super.setVisible(!0),this.tp(this.Jg,this.S,this.GM)):(this.Jg=this.S,super.setVisible(!0)),this}setInterval(t,e){const i=this.zM,s=this.OM;return this.D.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.zM=t,this.OM=e,this.Ji.us.bs(),this}setIntervalLabelsFont(t){return this.UM.Vh(t),this.YM.Vh(t),this.Ji.us.bs(),this}getIntervalLabelsFont(){return this.UM.Eh()}setIntervalLabelsFillStyle(t){return this.UM.ke(t),this.YM.ke(t),this.Ji.us.bs(),this}getIntervalLabelsFillStyle(){return this.UM.Lh()}setIntervalLabelsVisible(t){return t?(this.UM.setVisible(!0),this.YM.setVisible(!0)):(this.UM.setVisible(!1),this.YM.setVisible(!1)),this.NM=t,this}getIntervalLabelsVisible(){return this.NM}setAngleInterval(t,e){return this.uu=t,this.cu=e,this.Ji.us.bs(),this}setMinAngle(t){return this.uu=t,this.Ji.us.bs(),this}setMaxAngle(t){return this.cu=t,this.Ji.us.bs(),this}setMarginInDegrees(t=this.EM,e=this.VM){return t!==this.EM&&(this.EM=t),e!==this.VM&&(this.VM=e),this.Ji.us.bs(),this}setFillStyle(t){this.RM="function"==typeof t?t(this.RM):t;const e=this.RM;this.np.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 Bu extends Lu{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.nd=20,this.ZM=new Intl.NumberFormat,this.QM=new Intl.NumberFormat,this.JM=!1,this.KM=5;const h=new Pu(this.Ts,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);this.qM=h,this.ap.push(h),this.setPadding(10)}Fe(t){super.Fe(t),Wh.cg(this.ng,this.eg),super.tg();const e=Wh.ug(this.ng,this.eg),i=$e([this.qM.HM(),this.qM.$M()]),s=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right+2*i.max.x),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+1*i.max.y+e)),r=Math.max(.5*Math.min(s.x,s.y),0),n=u(this.Da.left+i.max.x+.5*s.x,this.Da.bottom+i.max.y+.5*s.y),o=this.JM?this.t_(n,r):n,h=this.PM.Me.getThickness(),a=r-.5*h,l=r-this.nd;let c=l/r*100;c=c>100||c<0?99:c;const d=100*(1-(this.nd-h)/r);this.i_(o,l)&&(this.PM.xu(r)._u(c),this.qM.np.xu(a)._u(d));const f=.5*(g=r,(y=this.cu-this.uu)/(2*Math.PI*g*(y/360))*h);var g,y;this.PM.vu(this.uu).ze(this.cu).Ie(o),this.qM.np.Ie(o),this.qM.Ye.Ie(o),this.ad&&this.qM.setFillStyle(new U({color:this.ad.getColors(this.qM.getAnimatedValue())})),this.qM.setMinAngle(this.uu).setMaxAngle(this.cu).setMarginInDegrees(f,f).Fe();const m=this.PM.du();if(this.qM.getIntervalLabelsVisible()){this.s_(this.uu,this.cu,o,m+this.KM);const t=this.qM.UM.Ds().Ue(),e=this.qM.YM.Ds().Ue();Be(t,e)&&this.e_(t,e,o,m+this.KM)}}i_(t,e){const i=si(this.qM.Ye.Ds().oi(),.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]}t_(t,e){const[i]=Ru(t,this.uu,this.cu,e,e),s=$e(i),r=.5*(s.max.x-s.min.x),n=.5*(s.max.y-s.min.y);return ri(ni(t,u(s.min.x+r,s.min.y+n)),t)}s_(t,e,i,s){const r=di(t),n=di(e);this.qM.UM.Ie(Ke(u(i.x+s,i.y),i,-r)),this.qM.YM.Ie(Ke(u(i.x+s,i.y),i,-n)),this.qM.UM.Ja(u(-Math.cos(r),-Math.sin(r))),this.qM.YM.Ja(u(-Math.cos(n),-Math.sin(n)))}getDefaultSlice(){return this.qM}setAutoScaling(t){return this.JM=t,this.us.bs(),this}getAutoScaling(){return this.JM}setDataLabelFormatter(t){return this.QM=t,this.us.bs(),this}getDataLabelFormatter(){return this.QM}setIntervalLabelFormatter(t){return this.ZM=t,this.us.bs(),this}getIntervalLabelFormatter(){return this.ZM}setIntervalLabelPadding(t){return this.KM=t,this.us.bs(),this}getIntervalLabelPadding(){return this.KM}setThickness(t){return this.nd=t,this}setLUT(t){return this.ad=t,this.us.bs(),this}setDataLabelFont(t){return this.qM.Ye.Vh(t),this.us.bs(),this}getDataLabelFont(){return this.qM.Ye.Eh()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.qM.XM(t),this.us.bs(),this}getDataLabelFillStyle(){return this.qM.jM()}Sd(){return this.ap}dispose(){return this.qM.dispose(),super.dispose()}}class _u extends xa{}class Ou extends _u{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this._s="Slice",this.S=0,this.jg=!1,this.pM=B,this.Qg=B,this.Jg=this.S,this.tp=j((()=>this.Ji.us.bs())),this.sp=()=>{this.ep=void 0},this.index=t,this.Ji=s,this.scale=r,this.Ki=n,this.Xb=e.vc(r,nn.Simple).cs(this.getHighlight()),this.gs(this.Xb),this.Ye=i.kr(r).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0})}setValue(t){return this.Ji.getAnimationsEnabled()?this.getVisible()&&this.op(this.Jg,t):this.Jg=t,this.S=t,this.Ji.us.bs(),this}getValue(){return this.S}setVisible(t){return!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?(this.ep&&(this.ep.finish(!1),this.ep=void 0),this.op(this.Jg,0,(()=>super.setVisible(!1)))):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(this.ep&&(this.ep.finish(!1),this.ep=void 0),super.setVisible(!0),this.op(this.Jg,this.S)):(this.Jg=this.S,super.setVisible(!0)),this}op(t,e,i){this.ep=this.tp(300,X.ease)([[t,e]],(([t])=>{this.Jg=t,this.Ji.us.bs()})),this.ep.onEveryAnimationEnd(this.sp),i&&this.ep.onAnimationEnd(i)}setStyle(t,e,i,s){this.pM=t,this.Qg=i,this.Xb.ke(this.pM).Ce(e),this.Ye.ke(this.Qg).Vh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Uu=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=Nu(i,r.x),s=Nu(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+A*o,y:g.y-o},f={x:y.x-A*o,y:y.y-o}),S=(i+c/u*(s-i))/2,g={x:a-S,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-x:x}`,10)},y={x:a+S,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&y.x>=g.x&&p.Xb.Rl([g,d,f,y])}};class Gu extends Gh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.sg("pyramidChart bg",0),r,i.us.qi.pyramidChartBackgroundFillStyle,i.us.qi.pyramidChartBackgroundStrokeStyle,i.us.qi.pyramidChartTitleFont,i.us.qi.pyramidChartTitleFillStyle,o),this.ap=[],this.lp=ma.None,this.up=this.qi.pyramidChartSliceFillStylePalette,this.cp=this.qi.pyramidChartSliceStrokeStyle,this.dp=!0,this.fp=this.qi.pyramidChartSliceLabelFont,this.Ap=this.qi.pyramidChartSliceLabelFillStyle,this.gp=0,this.mM=0,this.yM=80,this.SM=0,this.vM=e.PyramidSliceModes.VariableHeight,this.yp=!0,this.vp=e.AutoCursorModes.onHover,this.xp=Aa,this.bp=t=>{const e=this.ap.indexOf(t);e>=0&&(this.ap.splice(e,1),this.Mp())},this.fs.zn||this.fs.Vn||this.fs.Hn||this.us.As(8),this.Sp=this.qi.effectsText,this._p=i.wp("pyramidChart bottom",0),this.Cp=i.wp("pyramidChart top",1),this.ng.Bh("Pyramid Chart"),this.kp=i.Tp();const a=Dt(h?h.autoCursorBuilder:void 0,ca);this.Ag=a.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.ig(n,this.pixelScale),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled))}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}addSlice(t,e){const i=new Ou(this.gp,this._p,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);return this.gp+=1,i.setName(t),i.setValue(e),i.es.rs.xs(this.Sp),i.es.ns.xs(this.yp),this.ap.push(i),this.us.bs(),i}addSlices(t){const e=[];for(let i=0;ie.es.ns.xs(t))),this.us.bs(),this}getSliceEffect(){return this.yp}setSliceSorter(t){return this.lp=t,this.ap=this.ap.sort(this.lp),this.us.bs(),this}getSliceSorter(){return this.lp}setLabelFillStyle(t){return this.Ap="function"==typeof t?t(this.Ap):t,this.us.bs(),this}getLabelFillStyle(){return this.Ap}setLabelFont(t){return this.fp="function"==typeof t?t(this.fp):t,this.us.bs(),this}getLabelFont(){return this.fp}setLabelEffect(t){return this.Sp=t,this.ap.forEach((e=>e.es.rs.xs(t))),this.us.bs(),this}getLabelEffect(){return this.Sp}setLabelFormatter(t){return this.Ip=t,this.us.bs(),this}getLabelFormatter(){return this.Ip}setSliceHighlightOnHover(t){return this.dp=t,this.ap.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),Wh.cg(this.ng,this.eg),super.tg();const e=Wh.ug(this.ng,this.eg),i=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+e)),s=u(this.Da.left+i.x/2,this.Da.bottom+i.y/2);this.ap=this.ap.sort(this.lp);for(let t=0,{length:e}=this.ap;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tga(e,this.engine.scale,this.xp(new Kh,this,t,o[r.indexOf(t)]||0).fc(),t,void 0))),this.Pp(r,o,s,i)}Fp(t,e){t.setStyle(this.ad?new U({color:this.ad.getColors(t.getAnimatedValue())}):this.up(e),this.cp,this.Ap,this.fp)}Mp(){this.ap=this.ap.sort(this.lp),this.us.bs()}Sd(){return this.ap}dispose(){return this.ap.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this._p.W(),this.Cp.W(),this.kp.W(),super.dispose()}}const Wu=(t,i,s)=>{const r=t.El();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}}},Yu=t=>{const e=t.El();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 Hu extends Gu{constructor(){super(...arguments),this.Ip=pa.NamePlusValue,this.xM=10,this.bM=e.PyramidLabelSide.Left,this.MM=e.SliceLabelIndices.LabelsOnSides,this.Dp=[],this.Ep=this.qi.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Ep=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),Ju=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Zu;e.SpiderWebMode=void 0,(Zu=e.SpiderWebMode||(e.SpiderWebMode={}))[Zu.Normal=0]="Normal",Zu[Zu.Circle=1]="Circle";class Ku{constructor(t,e,i,s,n,o,h,a){this.D=new r.Eventer,this.r_=t,this.Tr=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.n_=h,this.o_=a,this.a_=this.r_.Ve(this.scale).setMouseInteractions(!1),this.l_=this.Tr.kr(this.scale).Bh(this.tag).setMouseInteractions(!1),this.u_=this.n_(this,this.r_.zp(this.scale,void 0,[ka.InternalUI])).Ee(this.chart.getNibStyle()),this.o_.ps([this.l_])}Pp(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.l_.setVisible(!0).Ie(ri(c,u(h.paddingX,h.paddingY))).Xa(h.alignmentX).Za(h.alignmentY):this.l_.setVisible(!1)}getLabelSize(){return this.l_.Vh(this.chart.getAxisLabelFont()).ke(this.chart.getAxisLabelStyle()).Ds().oi()}dispose(){this.a_&&this.a_.dispose(),this.l_&&this.l_.dispose(),this.u_&&this.u_.dispose()}}const Qu=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Axis:","",s).addRow("Value:","",r(i));class tc extends Il{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this._s="Spider Series",this.Lu=new Map,this.Hi=e.HighlightModes.onHover,this.xp=Qu,this.Tx=8,this.Fa=0,this.c_=be(),this.d_={},this.f_={},this.qg=this.getVisible(),this.A_=1,this.g_=((t,e)=>{const i=j((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||X.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.A_=t,this.Ts.us.bs()}),(t=>{super.setVisible(t)})),this.Ji=t,this.Ts=i,this.Fx=r,this.p_=n,this.HS=o,this.m_=h,this.y_=a,this.scale=s,this.S_=ce(u.spiderSeriesFillStyle,c),this.v_=ce(u.spiderSeriesStrokeStyle,c),this.x_=ce(u.spiderSeriesPointFillStyle,c)}Dm(){return this.Lm&&this.Lu.size>0&&this.getVisible()}addPoints(...t){this.Lu.size>0&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.c_(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.Lu.set(s,r+t*(e-r)),this.Ts.us.bs()}))}),{easing:this.d_.easing,durationMs:this.d_.durationMs,onStart:()=>{i=new Map(this.Lu)}})}else for(let e=0;e=3&&(this.Xb||(this.Xb=this.Ts.vc(this.scale,nn.Simple).Ce(this.v_).ke(this.S_).cs(this.getHighlight()),this.gs(this.Xb)),this.Xb.Rl(t),this.zc||(this.zc=this.Ts.Oc(this.scale).q(this.Tx).Sl(this.Fx).zh(this.Fa).ke(this.x_).cs(this.getHighlight()),this.gs(this.zc)),this.zc.Nt()._l(t))}}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{fill:this.S_,stroke:this.v_}),this}yd(){return this.Fx}b_(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},ic=t=>$e(t.l_.Ue()),sc=t=>$e(t.Ue()),rc=(t,i,s,r)=>t._u(0).Ie(s).vu(90).ze(-270).wu(i===e.SpiderWebMode.Circle?void 0:r.length),nc={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},oc={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},hc=()=>{oc.alignmentX=0,oc.alignmentY=0,oc.paddingX=0,oc.paddingY=0};class ac extends Za{constructor(t,i,s,r,n,o,h){super(t,i,s,i.sg("spiderChart bg",0),r,i.us.qi.spiderChartBackgroundFillStyle,i.us.qi.spiderChartBackgroundStrokeStyle,i.us.qi.spiderChartTitleFont,i.us.qi.spiderChartTitleFillStyle,h),this.Da=A(20,20,20,20),this.axisScale=at.d1({scale1DConstructor:Fi,dimension:"x"}).J(0,1),this.HS=[],this.M_=[],this.__=[],this.w_=Rs.expansion,this.C_=!0,this.k_=Ju,this.T_=qu,this.jo=!0,this.F_=e.SpiderWebMode.Normal,this.I_=4,this.P_=this.qi.spiderChartWebStyle,this.D_=this.qi.spiderChartScaleLabelFillStyle,this.B_=this.qi.spiderChartScaleLabelFont,this.L_=5,this.R_=this.qi.spiderChartAxisLabelFillStyle,this.E_=this.qi.spiderChartAxisLabelFont,this.V_=5,this.z_=this.qi.spiderChartAxisStrokeStyle,this.O_=this.qi.spiderChartAxisNibStrokeStyle,this.Dd=10,this.N_=A(),this.vp=e.AutoCursorModes.onHover,this.hasAxis=t=>this.HS.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.Di(t,Ci.Numeric),this.G_=()=>{const t=this.HS.map(ic).concat(this.__.map(sc));return Oe(t)},this.W_=()=>this.U_.Fc(this.pixelScale).setMouseInteractions(!1),this.Y_=t=>t.dispose(),this.H_=()=>this.vf.kr(this.pixelScale).setMouseInteractions(!1),this.X_=t=>t.dispose(),this.j_=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.Z_=(t,e)=>{let i,s;const r=()=>{void 0!==this.Q_&&this.Q_.finish(),i=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.w_,this.w_=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.HS.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=ec(a,this.HS.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=ii(ni(t.a_.Ii(),t.a_.Ti())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.J(i.min,l),$t(o),this.us.bs()}},o=()=>{if(i=void 0,void 0!==s)if(this.th){const t=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.J_(),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.Q_=this.zA.us.Zr(300,X.ease)([[0,1]],(([e])=>{this.axisScale.J(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.Q_.onAnimationEnd((()=>{this.Q_=void 0,this.w_=i}))}else this.w_=s}else this.w_=s;s=void 0};e.setMouseEnterEventHandler(this.K_).setMouseLeaveEventHandler(this.q_).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=Yi(new Xi(((t,e,i)=>{this.K_(t),r(),$t(i)}),n,((t,e,i,s)=>{this.q_(t),o(),$t(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.tw=t=>{this.C_&&!this.hasAxis(t)&&this.addAxis(t)},this.m_=(t,e)=>{for(const i of this.HS)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return He(i.a_.Ii(),i.a_.Ti(),t)}},this.y_=t=>{if(0===this.HS.length)return;const e=ni(ut(t,this.engine.scale,this.pixelScale),this.HS[0].a_.Ii()),i=Math.atan2(e.y,e.x);let s,r=Ie;for(const t of this.HS){const e=ni(t.a_.Ti(),t.a_.Ii()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.jo&&(t.Ee(this.O_),this.us.bs())},this.q_=t=>{t.Ee(this.O_),this.us.bs()},this.fs.zn||this.fs.Vn||this.fs.Xn||this.us.As(9),this.oM=i.YS("spiderChart series bg",0),this.U_=i.wp("spiderChart web shapes",0),this.iw=i.wp("spiderChart axis bg",1),this.yv=i.wp("spiderChart plotting",2),this.vf=i.wp("spiderChart fg",3),this.o_=this.es.gA().xs(this.qi.effectsText),this.ng.Bh("Spider Chart"),this.uy=this.oM.Fc(this.pixelScale).ke(this.qi.spiderChartSeriesBackgroundFillStyle).Ce(rt).vu(90).ze(-270)._u(0),this.Ay=this.oM.Fc(this.pixelScale).ke(B).Ce(this.qi.spiderChartSeriesBackgroundStrokeStyle).vu(90).ze(-270)._u(0),super.ly(this.uy,this.Ay),this.kp=i.Tp();const a=Dt(o?o.autoCursorBuilder:void 0,la);this.Ag=a.$g(this.kp,this.uiScale,this.uiScale,this.qi),Hh.pg(this),this.yy(((t,e)=>{Hh.mg(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.ig(n,this.pixelScale)}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}solveNearest(t){const e=t||this.us.Bn();if(e)return Hh.gg(this,jo(e,this.us),this.iy)}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Ku(this.iw,this.vf,this.pixelScale,this,t,this.axisScale,this.Z_,this.o_);this.HS.push(e)}}else t&&this.HS.push(t);return this.o_.ps(this.HS.map((t=>t.l_))),this.us.bs(),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.iy.length,r=new tc(this,this.yv,this.pixelScale,i,this.tw,this.HS,this.m_,this.y_,this.ey,this.qi,s,this.us.es);return this.gy(r),r}getSeriesCount(){return this.iy.length}setWebMode(t){return this.F_=t,this.us.bs(),this}getWebMode(){return this.F_}setWebCount(t){return this.I_=t,this.us.bs(),this}getWebCount(){return this.I_}setWebStyle(t){return this.P_="function"==typeof t?t(this.P_):t,this.us.bs(),this}getWebStyle(){return this.P_}setScaleLabelStyle(t){return this.D_="function"==typeof t?t(this.D_):t,this.us.bs(),this}getScaleLabelStyle(){return this.D_}setScaleLabelFont(t){return this.B_="function"==typeof t?t(this.B_):t,this.us.bs(),this}getScaleLabelFont(){return this.B_}setScaleLabelPadding(t){return this.L_=t,this.us.bs(),this}getScaleLabelPadding(){return this.L_}setScaleLabelStrategy(t){return this.k_=t,this.us.bs(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.us.bs(),this}setAxisLabelStyle(t){return this.R_="function"==typeof t?t(this.R_):t,this.us.bs(),this}getAxisLabelStyle(){return this.R_}setAxisLabelFont(t){return this.E_="function"==typeof t?t(this.E_):t,this.us.bs(),this}getAxisLabelFont(){return this.E_}setAxisLabelEffect(t){return this.o_.xs(t),this.us.bs(),this}getAxisLabelEffect(){return this.o_.Ms()}setAxisLabelPadding(t){return this.V_=t,this.us.bs(),this}getAxisLabelPadding(){return this.V_}setAxisLabelStrategy(t){return this.T_=t,this.us.bs(),this}setAxisStyle(t){return this.z_="function"==typeof t?t(this.z_):t,this.us.bs(),this}getAxisStyle(){return this.z_}setNibStyle(t){return this.O_="function"==typeof t?t(this.O_):t,this.us.bs(),this}getNibStyle(){return this.O_}setNibLength(t){return this.Dd=t,this.us.bs(),this}getNibLength(){return this.Dd}setAutoAxis(t){return this.C_=t,this}getAutoAxis(){return this.C_}setMouseInteractions(t){return this.jo=t,this}getMouseInteractions(){return this.jo}setAxisScrollStrategy(t){return this.w_=t,this.us.bs(),this}getAxisScrollStrategy(){return this.w_}setAxisInterval(t,e=0){return this.axisScale.J(e,t),this.us.bs(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}Fe(t){super.Fe(t),Wh.cg(this.ng,this.eg);const e=this.HS.length,i=Wh.ug(this.ng,this.eg),s=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.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.T_){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.w_){const t=this.J_();if(void 0!==t){const e=this.w_.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.w_.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.J(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.N_=A(this.Xt.left+this.Da.left+r.left,this.Xt.top+this.Da.top+i+r.top,this.Xt.right+this.Da.right+r.right,this.Xt.bottom+this.Da.bottom+r.bottom),this.Pp(n,o);for(const t of this.iy)t.Gm();for(const t of this.iy)t.Fe();super.tg(),Hh.dg(this,this.uy.getIsUnderMouse(),!1,this.iy,(t=>Hh.gg(this,t,this.iy)),((t,e)=>t.gg(e,!0)));for(const t of this.iy)t.$p()}dispose(){return this.oM.W(),this.U_.W(),this.iw.W(),this.yv.W(),this.vf.W(),this.Ag.dispose(),this.kp.W(),super.dispose()}getMinimumSize(){return u(this.N_.left+this.N_.right+100,this.N_.bottom+this.N_.top+100)}Pp(t,e){const i=this.HS.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];rc(h,i,s,n);const u=r*((l+1)/e);h.xu(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=He(n,o[a],s);e.Ie(ri(c,u(m.paddingX,m.paddingY))).Xa(m.alignmentX).Za(m.alignmentY).Bh(l(s))}}}for(let e=f;e1;for(const s of this.HS)for(const r of this.iy){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 lc=t=>({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...Oa(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Sr().x))}),uc=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...Oa(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Sr().y))});var cc;e.StepOptions=void 0,(cc=e.StepOptions||(e.StepOptions={}))[cc.before=0]="before",cc[cc.middle=.5]="middle",cc[cc.after=1]="after";const dc=(t,e)=>{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)},gc=(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=ti(ni(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]=ri(si(r,l),f[1]),f[2]=ni(f[2],si(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.wb.length>0){const e=this.wb[this.wb.length-1];if(t.length>0){const i=e.yl(),s=e.ml(),r=i.length+s.length-+e.ql();if(r>=this.Db){const n=s.length>0?s[s.length-1]:i[e.ql()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e._l(o,y(u(o.x,o.y),u(o.x,o.y))).tu(!0),this.nw([o].concat(t)).Kl(!0)}else e._l(t,this.Ib)}}else t.length>0&&this.nw(t)},this.ow=t=>{if(this.hw.length>0){const e=this.hw[this.hw.length-1];t.length>0&&((e.yl().length+e.ml().length)*this.ew>=this.Db?this.aw(t):e._l(t))}else t.length>0&&this.aw(t)},this.lw=(t,e)=>{const i=t.gg(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.uw=(t,e)=>{const i=t.cw(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.En=m,this.Fx=l,this.dw=f,this.fw=ce(c.pointLineSeriesFillStyle,g),this.Cu=ce(this.qi.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}Lb(){return hu(this.hw)}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;for(let t=0;tt.Vn||t.zn||t.ro?void 0:"bubble chart"));for(let e=0;ee.setVisible(t))),this}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorSolveBasis(t){return this.sw=t,this.wb.forEach((e=>e.pl(Lr(t)))),this.hw.forEach((e=>e.pl(Lr(t)))),this.Ts.bs(),this}getCursorSolveBasis(){return this.sw}ld(){return ae(this.fw)||ae(this.Cu.getFillStyle())}yd(){return this.Fx}mb(t){}Pe(t,e){t.cs(e),this.Ts.bs()}Bb(t){const e=this.wb.length>0?this.wb[this.wb.length-1].yl().length+this.wb[this.wb.length-1].ml().length-+this.wb[this.wb.length-1].ql():void 0;ou(t,e,this.Db,this.rw),ou(t,e,this.Db,this.ow)}aw(t,e){const i=this.Ts.Oc(this.scale)._l(t,e).setMouseInteractions(this.Yi).ke(this.fw).Sl(this.Fx).q(this.Tx).zh(this.Fa).xl(this.hl).bl(this.rl).Ml(this.nl).pl(Lr(this.sw)).cs(this.getHighlight());return this.gs(i),this.hw.push(i),i}nw(t,e){const i=this.Ts.zp(this.scale,void 0,[ka.UserSeries,...this.dw])._l(t,e).setMouseInteractions(this.Yi).Ee(this.Cu).pl(Lr(this.sw)).cs(this.getHighlight());return this.gs(i),this.wb.push(i),i}attach(t,e=!0,i=!1){return he(t,this.qi,i,{stroke:this.Cu,fill:this.fw}),super.attach(t,e,i)}getPointAmount(){return this.hw.reduce(((t,e)=>t+e.wl()+e.Cl()),this.Lu.length)}clear(){super.clear();for(let t=0;t{}))}gg(t,e,i=this.mx){const s=i?cu(t,e?this.wb.filter((t=>t.getIsUnderMouse())):this.wb,this.uw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):cu(t,e?this.hw.filter((t=>t.getIsUnderMouse())):this.hw,this.lw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(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=ut(s[0],this.Ts.us.dt,this.scale),e=s[1]instanceof ln?s[1].ku():s[1].Lh(),i=s[1]instanceof Kr?s[1].Lh():void 0,r=s[1]instanceof ln?s[1].ku().getFillStyle():void 0,n=W(e)?s[0].color?new U({color:s[0].color}):new U({color:e.getFallbackColor()}):void 0;return ga(t,this.scale,this.xp(new Kh,this,t.x,t.y,t).fc(),this,r||n||i)}}solveNearestFromScreen(t,e=this.mx){return this.gg(jo(t,this.Ji.us),!1,e)}}const mc=(t,e)=>t.ml().length>=e?t.ml().slice(-e):Array.prototype.concat(t.yl(),t.ml()).slice(-e),pc=(t,e,i)=>{const s=Array.prototype.concat(t.yl(),t.ml()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Nt()._l(s).Ds()};class Ac extends yc{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._s="Spline Series",this.ew=32,this.Db=8e3,this.Aw=t=>{if(0===t.length)return;const e=this.hw.length;if(e>0){const i=e>1,s=this.hw[e-1];if(i){const i=Array.prototype.concat(s.yl(),s.ml()),r=i.length;if(32*r>=this.Db){const i=mc(s,3),r=Array.prototype.concat(i,t),n=gc(r,32);pc(this.wb[e-1],n,32),this.nw(n.slice(66))}else if(r<5){const s=this.hw[e-2],r=mc(s,3),n=Array.prototype.concat(r,i,t),o=gc(n,32),h=this.wb[e-1],a=o.slice(66);h.Nt()._l(a).Ds()}else{const i=this.wb[e-1],r=Array.prototype.concat(i.yl(),i.ml()),n=mc(s,4),o=Array.prototype.concat(n,t),h=gc(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Nt()._l(a).Ds()}}else{const i=Array.prototype.concat(s.yl(),s.ml()),r=i.length,n=this.wb[e-1];if(32*r>=this.Db){const e=mc(s,3),i=Array.prototype.concat(e,t),r=gc(i,32);pc(this.wb[0],r,32),this.nw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=gc(e,32);n.Nt()._l(s).Ds()}else n._l(t)}}else{const e=t.length>0?gc(t,32):t,i=$e(e);this.nw(e,i)}this.ow(t)}}setCursorInterpolationEnabled(t){return super.setCursorInterpolationEnabled(t)}Bb(t){const e=this.hw.length,i=this.hw.length>0?this.hw[e-1].yl().length+this.hw[e-1].ml().length:void 0;ou(t,i,Math.ceil(this.Db/this.ew),this.Aw)}solveNearestFromScreen(t,e=this.mx){if(e)return super.solveNearestFromScreen(jo(t,this.Ji.us),e);const i=cu(jo(t,this.Ji.us),this.hw,this.lw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(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=ut(i[0],this.Ts.us.dt,this.scale);return ga(t,this.scale,this.xp(new Kh,this,t.x,t.y,t).fc(),this,i[1].Lh())}}}class xc{constructor(){this.Gi="FreeformPattern",this.Gl={type:"disabled",packager:(t,e,i)=>t.slice()}}Pb(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}},bc=s.Record({Gl:{type:"disabled",packager:(t,e,i)=>t.slice()}});class vc extends bc{Pb(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.pw(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.bt();return t?Math.min(i,t):i},Tc=(t,e)=>{const i=e.Mt();return t?Math.max(i,t):i};class wc extends vc{gw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(Tc,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(Mc,e?e.min.y:void 0)}}const Ec=(t,e)=>{const i=e.vt();return t?Math.min(i,t):i},kc=(t,e)=>{const i=e.xt();return t?Math.max(i,t):i};class Cc extends vc{gw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(kc,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(Ec,e?e.min.x:void 0)}}const Dc={horizontalProgressive:new class extends wc{constructor(){super({Gl:wr()}),this.Gi="HorizontalProgressivePattern"}pw(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].xt():void 0}getXMin(t=[],e){return t.length>0&&t[0].wl()>0?t[0].vt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",wr(Sc(t)))}},horizontalRegressive:new class extends wc{constructor(){super({Gl:Er()}),this.Gi="HorizontalRegressivePattern"}pw(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].wl()>0?t[0].xt():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",Er(Sc(t)))}},verticalProgressive:new class extends Cc{constructor(){super({Gl:kr()}),this.Gi="VerticalProgressivePattern"}pw(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].Mt():void 0}getYMin(t=[],e){return t.length>0&&t[0].wl()>0?t[0].bt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",kr(Sc(t)))}},verticalRegressive:new class extends Cc{constructor(){super({Gl:Cr()}),this.Gi="VerticalRegressivePattern"}pw(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].wl()>0?t[0].Mt():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].bt():void 0}setPrecision(t){return this.set("_columnPackaging",Cr(Sc(t)))}},freeform:new xc};class Fc extends yc{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,Dc.horizontalProgressive,a,c,d,f,g,m),this._s="Step Series",this.rw=t=>{const e=this.wb.length>0?this.wb[this.wb.length-1].yl().length+this.wb[this.wb.length-1].ml().length:void 0;ou(t,e,this.Db,this.mw)},this.mw=t=>{const e=t.length;if(this.wb.length>0){const i=this.wb[this.wb.length-1];if(e>0){const e=i.yl(),s=i.ml(),r=s.length>0?s[s.length-1]:e[e.length-1],n=dc([r].concat(t),this.yw);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.Db?(i._l(o,y(u(o.x,o.y),u(o.x,o.y))).tu(!0),this.nw(h).Kl(!0),this.aw(t)):i._l(h)}}else e>0&&this.nw(dc(t,this.yw));this.ow(t)},this.yw=l,void 0===this.dw.find((t=>"DataPattern"===t.type))&&this.dw.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class Ic 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.wb=[],this._s="Line Series",this.mx=!0,this.Db=void 0,this.sw="nearest-x",this.Ru=void 0,this.ld=()=>ae(this.Cu.getFillStyle()),this.Sw=(t,e)=>{const i=t.Cx(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.uw=(t,e)=>{const i=t.cw(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.dw=c,this.En=f,this.Cu=ce(this.qi.lineSeriesStrokeStyle,d),this.xw={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.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;for(let t=0;tt.Eu(this.Ru))),this.Ts.bs(),this}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorSolveBasis(t){return this.sw=t,this.wb.forEach((e=>e.pl(Lr(t)))),this.Ts.bs(),this}getCursorSolveBasis(){return this.sw}mb(t){}Bb(t){let e=this.wb[0];e||(e=this.nw(),this.wb.push(e),this.gs(e)),e._l(t,this.Ib)}nw(){return this.Ts.zp(this.scale,this.xw,[ka.UserSeries,...this.dw]).Ee(this.Cu).Eu(this.Ru).pl(Lr(this.sw)).cs(this.getHighlight())}attach(t,e=!0,i=!1){return he(t,this.qi,i,{stroke:this.Cu}),super.attach(t,e,i)}Pe(t,e){t.cs(e),this.Ts.bs()}Pb(t,e,i,s){}gg(t,e,i=this.mx){const s=cu(t,e?this.wb.filter((t=>t.getIsUnderMouse())):this.wb,i?this.uw:this.Sw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(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=ut(s[0],this.Ts.us.dt,this.scale),e=s[1].ku();return ga(t,this.scale,this.xp(new Kh,this,t.x,t.y,t).fc(),this,e.getFillStyle())}}solveNearestFromScreen(t,e=this.mx){return this.gg(jo(t,this.Ji.us),!1,e)}}class Lc extends cn{constructor(t,e,i,s,n,o,h,a,l){super(),this.ia=Ce(),this.D=new r.Eventer,this.bw=s,this.Mw=n,this._w=o,this.ww=h,this.Cw=a,this.Ts=t,this.scale=e,this.kw=i,this.qi=l}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}dispose(){return this.kw&&this.kw(this),this.Ts.us.bs(),this.D.emit("dispose",this),this}setVisible(t){return super.setVisible(t),this._w(),this.Ts.us.bs(),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setMouseInteractions(t){return this.ww(this,t),this}getMouseInteractions(){return this.Cw(this)}}class zc extends nu{constructor(){super(...arguments),this.Tw=[],this.Fw=void 0,this.Iw=!1,this.kw=t=>{const e=this.Tw.findIndex((e=>e===t));e>=0&&this.Tw.splice(e,1),this.Iw=!0,this.Fw=void 0,this.Ts.bs()},this.bw=()=>{this.Fw=void 0,this.Iw=!0,this.Ji.us.bs()},this.Mw=()=>{this.Iw=!0,this.Ji.us.bs()},this._w=()=>{this.Fw=void 0,this.Iw=!0,this.chart.us.bs()},this.ww=(t,e)=>{this.setMouseInteractions(e)},this.Pw=t=>this.getMouseInteractions()}Fe(){super.Fe(),this.Iw&&(this.Dw(this.Tw),this.Iw=!1)}clear(){return this.Tw.slice().forEach(Tt),this.Tw.length=0,this.Iw=!0,this.Fw=void 0,this.Ts.bs(),this}Bw(t,e){void 0!==e?this.Tw.splice(e,0,t):this.Tw.push(t),this.Iw=!0,this.Lw&&this.Lw(t),t.onMouseEnter(((t,e)=>this.wt(t,e))),t.onMouseLeave(((t,e)=>this.Ct(t,e))),t.onMouseClick(((t,e)=>this.kt(t,e))),t.onMouseDoubleClick(((t,e)=>this.Tt(t,e))),t.onMouseDown(((t,e)=>this.Ft(t,e))),t.onMouseUp(((t,e)=>this.It(t,e))),t.onMouseMove(((t,e)=>this.Pt(t,e))),t.onMouseDragStart(((t,e,i)=>this.Bt(t,e,i))),t.onMouseDrag(((t,e,i,s,r)=>this.Dt(t,e,i,s,r))),t.onMouseDragStop(((t,e,i,s)=>this.Lt(t,e,i,s))),t.onMouseWheel(((t,e)=>this.Rt(t,e))),t.onTouchStart(((t,e)=>this.Et(t,e))),t.onTouchMove(((t,e)=>this.Vt(t,e))),t.onTouchEnd(((t,e)=>this.zt(t,e))),this.Ts.bs()}Dm(){return this.Lm&&this.Tw.length>0&&this.getVisible()}setDefaultStyle(t){this.Lw=t,this.Tw.forEach(t),t(this.Rw);for(let t=0;tt.getVisible()&&t.getIsUnderMouse())):this.Tw.filter((t=>t.getVisible())),this.Vw,We);if(void 0!==i)return{location:ut(i[0],this.Ts.us.dt,this.scale),scale:this.scale,resultTableContent:this.xp(new Kh,this,i[1]).fc(),owner:this,fillStyle:i[1].getDominantStyle(),figure:i[1]}}solveNearestFromScreen(t){return this.gg(jo(t,this.Ji.us),!1)}getXMax(){return this.Fw||(this.Fw=this.zw()),this.Fw.max.x}getXMin(){return this.Fw||(this.Fw=this.zw()),this.Fw.min.x}getYMax(){return this.Fw||(this.Fw=this.zw()),this.Fw.max.y}getYMin(){return this.Fw||(this.Fw=this.zw()),this.Fw.min.y}Sr(){return u(0,0)}zw(){const t=y(c(Ie,Ie),c(Le,Le));for(let e=0;e0?this.Tw[0].getDominantStyle():this.Rw.getDominantStyle()})}}class Vc extends Lc{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.Ow={x:0,y:0,width:0,height:0},this.Nw={x1:0,y1:0,x2:0,y2:0},this.ol=y(u(0,0),u(0,0)),this.be=ce(a.rectangleSeriesFillStyle,l),this.Ts=t,this.scale=e,this.Me=ce(a.rectangleSeriesStrokeStyle,l)}getBoundaries(){return this.ol}setDimensions(t){return"x"in t?(this.Ow=t,this.Nw={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.Nw=t,this.Ow={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.ol=$e([this.Ow,u(this.Ow.x+this.Ow.width,this.Ow.y+this.Ow.height)]),this.bw(),this.Ts.bs(),this}getDimensionsPositionAndSize(){return this.Ow}getDimensionsTwoPoints(){return this.Nw}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Mw(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Mw(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Pc extends zc{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.xp=(t,e,i)=>{const s=i.getDimensionsPositionAndSize();return t.addRow(e._s).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.Gw=Ee(),this.Vw=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return ut(i,this.scale,this.Ts.us.dt)},this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Ww=c,this.Rw=new Vc(this.Ts,this.scale,wt,wt,wt,wt,wt,(t=>!1),this.qi,this.Ww).dispose(),this.Uw=new za((()=>{const t=this.Gw._t(this.Ts.bv(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.figure),i})))),(()=>{this.Gw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){}Dw(t){const e=this.Uw.Xp();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({ia:t.ia,vertices:s,figure:t},{fillStyle:r,strokeStyle:n})})),e.finishPlot()}add(t){const e=new Vc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.qi,this.Ww).setDimensions(t);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Rc extends Lc{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.Yw=[],this.ol=ze,this.Ts=t,this.scale=e,this.be=ce(a.polygonSeriesFillStyle,l),this.Me=ce(a.polygonSeriesStrokeStyle,l)}getBoundaries(){return this.ol}setDimensions(t){return this.Yw=t,this.ol=$e(this.Yw),this.bw(),this.Ts.bs(),this}getDimensions(){return this.Yw}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Mw(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Mw(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Bc extends zc{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.xp=(t,e,i)=>t.addRow(e.getName()),this.Gw=Ee(),this.Vw=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return ut(i,this.scale,this.Ts.us.dt)},this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Ww=c,this.Rw=new Rc(this.Ts,this.scale,wt,wt,wt,wt,wt,(t=>!1),this.qi,this.Ww).dispose(),this.Uw=new za((()=>{const t=this.Gw._t(this.Ts.bv(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.figure),i})))),(()=>{this.Gw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){}Dw(t){const e=this.Uw.Xp();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=t.getFillStyle(),r=t.getStrokeStyle();e.add({ia:t.ia,vertices:i,figure:t},{fillStyle:s,strokeStyle:r})})),e.finishPlot()}add(t){const e=new Rc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.qi,this.Ww).setDimensions(t);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class _c extends Lc{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.ol=y(u(0,0),u(0,0)),this.qi=a,this.Ts=t,this.scale=e,this.Me=ce(a.segmentSeriesStrokeStyle,l)}getBoundaries(){return this.ol}setDimensions(t){return this.dimensions=t,this.ol=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.bw(),this.Ts.bs(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Mw(),this}getStrokeStyle(){return this.Me}getDominantStyle(){const t=this.Me;return t!==rt?t.getFillStyle():B}}class Oc extends zc{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.xp=(t,e,i)=>t.addRow(e._s).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.Hw=Ee(),this.Vw=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return ut(i,this.scale,this.Ts.us.dt)},this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Ww=c,this.Rw=new _c(this.Ts,this.scale,wt,wt,wt,wt,wt,(t=>!1),this.qi,this.Ww).dispose(),this.$w=new za((()=>{const t=this.Hw._t(this.Ts._A(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ee(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.CA(e.start,e.end),this.Hw.Ot(i,e.figure),i})))),(()=>{this.Hw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){}Dw(t){const e=this.$w.Xp();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({ia:t.ia,start:s,end:r,figure:t},{strokeStyle:n})})),e.finishPlot()}add(t){const e=new _c(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.qi,this.Ww).setDimensions(t);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Nc extends Lc{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.ol=y(u(0,0),u(0,0)),this.Ts=t,this.scale=e,this.be=ce(a.ellipseSeriesFillStyle,l),this.Me=ce(a.ellipseSeriesStrokeStyle,l)}getBoundaries(){return this.ol}setDimensions(t){return this.dimensions=t,this.ol=y(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.bw(),this.Ts.bs(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Mw(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Mw(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Uc extends zc{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.xp=(t,e,i)=>t.addRow(e._s).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.Gw=Ee(),this.Vw=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return ut(i,this.scale,this.Ts.us.dt)},this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Ww=c,this.Rw=new Nc(this.Ts,this.scale,wt,wt,wt,wt,wt,(t=>!1),this.qi,this.Ww).dispose(),this.Uw=new za((()=>{const t=this.Gw._t(this.Ts.bv(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.figure),i})))),(()=>{this.Gw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){if(!(t instanceof zi||t instanceof Vi))throw new Error("EllipseSeries only supports Linear Axes")}Dw(t){const e=this.Uw.Xp();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({ia:t.ia,vertices:s,figure:t},{fillStyle:n,strokeStyle:o})})),e.finishPlot()}add(t){const e=new Nc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.qi,this.Ww).setDimensions(t);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Gc extends Lc{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.Xw=1,this.jw=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=m,this.boundaries=y(this.dimensionStrategy.toPoint(l,c),this.dimensionStrategy.toPoint(u,m)),this.Zw=this.qi.boxSeriesBodyFillStyle,this.Qw=this.qi.boxSeriesBodyStrokeStyle,this.Cu=this.qi.boxSeriesStrokeStyle,this.Jw=this.qi.boxSeriesMedianStrokeStyle,this.Ds()}getBoundaries(){return this.boundaries}setBodyWidth(t){return this.Xw=t,this.Ds(),this}getBodyWidth(){return this.Xw}setBodyFillStyle(t){return this.Zw="function"==typeof t?t(this.Zw):t,this.Mw(),this}getBodyFillStyle(){return this.Zw}setBodyStrokeStyle(t){return this.Qw="function"==typeof t?t(this.Qw):t,this.Mw(),this}getBodyStrokeStyle(){return this.Qw}setTailWidth(t){return this.jw=t,this.Ds(),this}getTailWidth(){return this.jw}setStrokeStyle(t){return this.Cu="function"==typeof t?t(this.Cu):t,this.Mw(),this}getStrokeStyle(){return this.Cu}setMedianStrokeStyle(t){return this.Jw="function"==typeof t?t(this.Jw):t,this.Mw(),this}getMedianStrokeStyle(){return this.Jw}Ds(){this.bw()}getDominantStyle(){return this.getBodyFillStyle()}}const Wc=(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 Yc extends zc{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="Box Series",this.xp=Wc,this.Gw=Ee(),this.Vw=t=>ut(this.Fs.toPoint((t.start+t.end)/2,t.median),this.scale,this.Ts.us.dt),this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Fs=a,this.Rw=new Gc(this.Ts,this.scale,this.kw,wt,wt,wt,wt,(t=>!1),this.Fs,0,0,0,0,0,0,0,this.qi).dispose(),this.$w=new za((()=>{const t=this.Ts._A(this.scale);return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ee(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.CA(e.start,e.end),i}))))),this.Uw=new za((()=>{const t=this.Gw._t(this.Ts.bv(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.figure),i})))),(()=>{this.Gw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){if(!(t instanceof zi||t instanceof Vi))throw new Error("BoxSeries only supports Linear Axes")}Dw(t){const e=this.Uw.Xp(),i=this.$w.Xp();t.forEach((t=>{if(!t.getVisible())return;const s=this.Fs.toPoint((t.start+t.end-t.Xw*(t.end-t.start))/2,t.lowerQuartile),r=this.Fs.toPoint((t.end-t.start)*t.Xw,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.jw*(t.end-t.start))/2,t.lowerExtreme),u=this.Fs.toPoint((t.start+t.end+t.jw*(t.end-t.start))/2,t.lowerExtreme),c=this.Fs.toPoint((t.start+t.end-t.jw*(t.end-t.start))/2,t.upperExtreme),d=this.Fs.toPoint((t.start+t.end+t.jw*(t.end-t.start))/2,t.upperExtreme),f=this.Fs.toPoint((t.start+t.end-t.Xw*(t.end-t.start))/2,t.median),g=this.Fs.toPoint((t.start+t.end+t.Xw*(t.end-t.start))/2,t.median);e.add({ia:t.ia,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.Zw,strokeStyle:t.Qw}),i.add({ia:0,start:n,end:o,figure:t},{strokeStyle:t.Cu}),i.add({ia:0,start:h,end:a,figure:t},{strokeStyle:t.Cu}),i.add({ia:0,start:l,end:u,figure:t},{strokeStyle:t.Cu}),i.add({ia:0,start:c,end:d,figure:t},{strokeStyle:t.Cu}),i.add({ia:0,start:f,end:g,figure:t},{strokeStyle:t.Jw})})),e.finishPlot(),i.finishPlot()}add(t){const e=new Gc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.Fs,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.qi);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Hc extends nu{constructor(){super(...arguments),this.wb=[],this.Lu=[],this.Kw=[],this.qw=[],this.Db=1e3,this.Cb=0,this.Hi=e.HighlightModes.onHover,this.Gl={type:"disabled",packager:(t,e,i)=>t.slice()},this.mx=!0,this.tC=[],this.iC=[],this.sC=!1,this.ld=()=>ae(this.eC)||ae(this.hC),this.rC=t=>{const e=t.length;if(this.wb.length>0){const i=this.wb.length-1,s=this.wb[i];if(e>0){const[e,i]=s.yl(),[r,n]=s.ml();if((r?e.length+r.length:e.length)>=this.Db){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=ui(a,o,u(t[0].position,t[0].high)).y,c=ui(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s._l(f,y(u(a,c),u(a,l))).tu(!0),this.nC([f].concat(t)).Kl(!0)}else s._l(t)}}else e>0&&this.nC(t)},this.oC=t=>{const e=this.tC,i=t.length;if(this.tC.length>0){if(i>0){const i=e[e.length-1],s=i.yl(),r=i.ml();if(s.length+r.length>=this.Db){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=ui(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i._l(a,y(u(o,h),u(o,h))).tu(!0),e.push(this.aC([a].concat(t),this.Ib).Kl(!0))}else i._l(t)}}else i>0&&e.push(this.aC(t))},this.lC=t=>{const e=this.iC,i=t.length;if(this.iC.length>0){if(i>0){const i=e[e.length-1],s=i.yl(),r=i.ml();if(s.length+r.length>=this.Db){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=ui(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i._l(a,y(u(o,h),u(o,h))).tu(!0),e.push(this.uC([a].concat(t)).Kl(!0))}else i._l(t)}}else i>0&&e.push(this.uC(t))},this.cC=(t,e)=>{const i=t.Cx(e);if(i)return[ut(i[0],this.scale,this.Ts.us.dt),ut(i[1],this.scale,this.Ts.us.dt)]},this.dC=(t,e)=>{const i=t.cw(e);if(i)return[ut(i[0],this.scale,this.Ts.us.dt),ut(i[1],this.scale,this.Ts.us.dt)]}}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.Cb=void 0!==e&&e>0?e:0,this.Ts.bs(),this}clear(){for(let t=0;tt+e.wl()+e.Cl()),this.Lu.length)}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}setCursorEnabled(t){return super.setCursorEnabled(t)}getCursorResultTableFormatter(){return this.xp}getXMax(){return _t(this.wb,It,Math.max,Pt,this.Ib)||0}getXMin(){return _t(this.wb,Ft,Math.min,Vt,this.Ib)||0}getYMax(){return _t(this.wb,zt,Math.max,Bt,this.Ib)||0}getYMin(){return _t(this.wb,Lt,Math.min,Rt,this.Ib)||0}Sr(){const t=u(0,0);for(const e of this.wb)t.x=Math.max(t.x,e.Vl()),t.y=Math.max(t.y,e.zl());return t}Dm(){return this.Lm&&this.getPointAmount()>0&&this.getVisible()}mb(t){}Tb(t,e,i){this.Lu=se(this.Lu,t,{canReturnB:!1}),this.Kw=se(this.Kw,e,{canReturnB:!1}),this.qw=se(this.qw,i,{canReturnB:!1}),this.Ts.bs()}fC(t,e,i,s){this.AC(e,i,s),this.Tb(Array.isArray(t)?t:[t],e,i)}AC(t,e,i){const s=qe($e(t),$e(e));this.Ib?this.Ib=qe(this.Ib,s):this.Ib=s,i&&(this.Ib=qe(this.Ib,i))}pw(){const t=this.wb.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.wb[this.wb.length-1]:void 0,i=e?e.yl()[0].length+(e.ml()[0]?e.ml()[0].length:0):void 0;ou(t,i,this.Db,this.rC)}pC(t){const e=this.tC.length>0?this.tC[this.tC.length-1].yl().length+this.tC[this.tC.length-1].ml().length:void 0;ou(t,e,this.Db,this.oC)}mC(t,e){const i=this.tC.length>0?this.tC[this.tC.length-1].yl().length+this.tC[this.tC.length-1].ml().length:void 0;ou(t,i,this.Db,this.oC),ou(e,i,this.Db,this.lC)}nC(t,e){const i=this.Ts.yC(this.scale)._l(t,e).ke(this.eC).Ql(this.hC).jl(this.Gl).cs(this.getHighlight());return this.wb.push(i),this.gs(i),i}SC(t,e,i){const s=this.Ts.zp(this.scale,void 0,[ka.UserSeries])._l(t,i).setMouseInteractions(!1).Ee(e).cs(this.getHighlight());return this.gs(s),s}aC(t,e){return this.SC(t,this.vC,e)}uC(t,e){return this.SC(t,this.xC,e)}bC(t){this.eC="function"==typeof t?t(this.eC):t;const e=this.eC;for(let t=0;t0){const t=this.wb.length,e=this.pw();this.Pb(this.wb,this.Db,this.Cb,e);const i=this.wb.length;this.tC.length>0&&this.Pb(this.tC,this.Db,this.Cb,e),this.iC.length>0&&this.Pb(this.iC,this.Db,this.Cb,e),t!==i&&this._b(),this.sC=!0}}Fe(){if(super.Fe(),this.Lu.length>0&&(this.gC(this.Lu),this.IC(this.Kw,this.qw),this.sC=!0),this.sC){const t=this.getBoundaries();for(const e of this.wb)e.ra(t);for(const e of this.tC)e.ra(t);for(const e of this.iC)e.ra(t)}}$p(){this.Ib=void 0,this.Lu.length=0,this.Kw.length=0,this.qw.length=0}gg(t,e,i=this.mx){const s=((t,e,i)=>{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.getIsUnderMouse())):this.wb,i?this.dC:this.cC);if(void 0!==s&&void 0!==s[0]){const t=ut(s[0][0],this.Ts.us.dt,this.scale),e=ut(s[0][1],this.Ts.us.dt,this.scale);return ga(t,this.scale,this.xp(new Kh,this,t.x,t.y,e.y).fc(),this,s[1].Lh())}}solveNearestFromScreen(t,e=this.mx){return this.gg(jo(t,this.Ji.us),!1,e)}}const Xc=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Position","",e.axisX.formatValue(i)).addRow("Value","",e.axisY.formatValue(s)).addRow("Base","",e.axisY.formatValue(r));class $c extends Hc{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._s="Area Series",this.xp=Xc,this.ds((t=>t.Vn||t.zn||t.qn?void 0:"area series")),this.PC=a}add(t){0!==this.wb.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.DC(e),[i,s]=this.BC(t);this.fC(t,i,s,y(u(Ie,this.PC),u(Le,this.PC)));const r=this.Lu[this.Lu.length-1];this.Fb=r?{position:r.position,high:r.high,low:r.low}:void 0,this.D.emit("dataAdd",this,e,this.Ib)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.Fb?this.Fb.position+e:0),this.add(au(t,e,s)),this}Rb(t){return this.D.on("dataAdd",t)}Eb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}zb(t){return this.D.off(t)}}class jc extends $c{constructor(){super(...arguments),this.xC=rt}IC(t){return this.pC(t)}BC(t){const e=t.length,i=Array(e);for(let s=0;s=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=pi(u(Le,n),u(Ie,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}Lb(){return hu(this.wb,(t=>t[0]||[]))}setFillStyle(t){return this.bC(t),this}getFillStyle(){return this._C()}attach(t,e=!0,i=!1){return he(t,this.qi,i,{fill:this.eC,stroke:this.vC}),super.attach(t,e,i)}}class Jc extends jc{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.eC=B,this.hC=ce(this.qi.areaSeriesNegativeFillStyle,c),this.vC=ce(this.qi.areaSeriesNegativeStrokeStyle,c)}DC(t){return this.VC(t)}VC(t){const e=[];return 1===t.length?this.RC(t[0],e):this.EC(t,e),e}RC(t,e,i=0){const s=this.PC;return e[i]=t.y>s?d(t.x,s,s):d(t.x,t.y,s),i+1}EC(t,e,i=0){let s=0;const r=t.length-1,n=this.PC;for(;sn){const t=pi(u(Le,n),u(Ie,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=pi(u(Le,n),u(Ie,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}Lb(){return hu(this.wb,(t=>t[1]))}setFillStyle(t){return this.MC(t),this}getFillStyle(){return this.Jl()}attach(t,e=!0,i=!1){return he(t,this.qi,i,{fill:this.hC,stroke:this.vC}),super.attach(t,e,i)}}class Zc extends $c{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.eC=ce(this.qi.areaSeriesBipolarHighFillStyle,c),this.vC=ce(this.qi.areaSeriesBipolarHighStrokeStyle,c),this.hC=ce(this.qi.areaSeriesBipolarLowFillStyle,c),this.xC=ce(this.qi.areaSeriesBipolarLowStrokeStyle,c)}DC(t){return this.zC(t)}IC(t,e){return this.mC(t,e)}zC(t){let e=0;const i=[],s=t.length,r=this.PC;return s>0&&(this.OC&&(this.OC.y<=r&&r<=t[0].y||this.OC.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.OC.x+t[0].x),r,r),e+=1),this.OC=t[s-1],1===s?this.RC(t[0],i,e):this.EC(t,i)),i}RC(t,e,i=0){return e[i]=d(t.x,t.y,this.PC),i+1}EC(t,e){let i=0,s=0;const r=t.length-1,n=this.PC;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:Ln(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}BC(t){const e=t.length,i=Array(e),s=Array(e),r=this.PC;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.bC(t),this}setNegativeFillStyle(t){return this.MC(t),this}setPositiveStrokeStyle(t){return this.wC(t),this}setNegativeStrokeStyle(t){return this.CC(t),this}getPositiveFillStyle(){return this._C()}getNegativeFillStyle(){return this.Jl()}getPositiveStrokeStyle(){return this.kC()}getNegativeStrokeStyle(){return this.TC()}attach(t,e=!0,i=!1){return he(t,this.qi,i,{fill:this.eC,fill2:this.hC,behavior:{colorStep:!0}}),super.attach(t,e,i)}}const Kc={Positive:qc,Negative:Jc,Bipolar:Zc},Qc=(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 td extends Hc{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this._s="Area Range Series",this.xp=Qc,this.ds((t=>t.Vn||t.zn||t.qn?void 0:"area range series"));const c=u;this.eC=ce(this.qi.areaRangeSeriesFillStyle,c),this.vC=ce(this.qi.areaRangeSeriesStrokeStyle,c),this.hC=ce(this.qi.areaRangeSeriesFillStyleInverted,c),this.xC=ce(this.qi.areaRangeSeriesStrokeStyleInverted,c)}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.fC(t,i,s);const r=this.Lu[this.Lu.length-1];return this.Fb=r?{position:r.position,high:r.high,low:r.low}:void 0,this.D.emit("dataAdd",this,e,this.Ib),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.Fb?this.Fb.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=t.gg(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.En=d,this.Fx=a,this.be=ce(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}ld(){return ae(this.be)}yd(){return this.Fx}mb(t){}attach(t,e=!0,i=!1){return he(t,this.qi,i,{fill:this.be}),super.attach(t,e)}Pe(t,e){t.cs(e),this.Ts.bs()}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(let t=0;tt.Vn||t.zn||t.ro?void 0:"bubble chart"));for(let e=0;et.getIsUnderMouse())):this.wb,this.lw,We);if(void 0!==i){const t=ut(i[0],this.Ts.us.dt,this.scale),e=i[1].Lh(),s=W(e)?i[0].color?new U({color:i[0].color}):new U({color:e.getFallbackColor()}):e;return ga(t,this.scale,this.xp(new Kh,this,t.x,t.y,t).fc(),this,s)}}solveNearestFromScreen(t){return this.gg(jo(t,this.Ji.us),!1)}setCursorResultTableFormatter(t){return super.setCursorResultTableFormatter(t)}}class id{constructor(t,e,i,s){this.NC=!1,this.D=new r.Eventer,this.chart=i,this.GC=s,this.Xs=t.Xs,this.te=s||Is,this.WC=St.document.createElement("div"),this.WC.style.position="absolute",this.WC.style.pointerEvents="none",St.document.body.append(this.WC);const n=()=>{const t=i.engine.container.getBoundingClientRect();this.WC.style.left=`${t.left}px`,this.WC.style.top=`${t.top}px`,this.WC.style.width=`${t.width}px`,this.WC.style.height=`${t.height}px`};n(),i.onResize(n),this.UC(this.WC),this.YC(),this.HC(),this.$C(),this.XC(e),this.chart.jC().push(this)}UC(t){this.ZC=St.document.createElement("div"),this.ZC.style.pointerEvents="all",t.append(this.ZC),this.QC=St.document.createElement("div"),this.JC=new vs(this.Xs,this.te,this.chart,this.QC),this.KC=St.document.createElement("table"),this.KC.style.borderSpacing="0",this.ZC.appendChild(this.JC.ae()),this.ZC.appendChild(this.QC),this.QC.appendChild(this.KC)}HC(){let t=0,e=0,i=0,s=0,r=!1;this.NC=!1,this.ZC.onmousedown=n=>{n=n||St.event,i=n.clientX,s=n.clientY,r=!0,St.document.onmouseup=t=>{this.NC?this.ZC.addEventListener("click",$t,!0):this.ZC.removeEventListener("click",$t,!0),r=!1,this.NC=!1,St.document.onmouseup=null,St.document.onmousemove=null},St.document.onmousemove=n=>{n=n||St.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.NC=!0,this.ZC.style.top=this.ZC.offsetTop-e+"px",this.ZC.style.left=this.ZC.offsetLeft-t+"px",this.ZC.style.removeProperty("right"),this.ZC.style.removeProperty("bottom"))}}}$C(){let t=0,e=0,i=0,s=0,r=!1;this.ZC.ontouchstart=n=>{n=n||St.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.ZC.ontouchend=()=>{r=!1,St.document.ontouchend=null,St.document.ontouchmove=null},this.ZC.ontouchmove=n=>{r&&($t(n),n=n||St.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.ZC.style.top=this.ZC.offsetTop-e+"px",this.ZC.style.left=this.ZC.offsetLeft-t+"px",this.ZC.style.removeProperty("right"),this.ZC.style.removeProperty("bottom"))}}}YC(){this.ZC.style.setProperty("top","10px"),this.ZC.style.setProperty("left","10px"),this.ZC.style.position="absolute",this.ZC.style.display="flex",this.ZC.style.alignItems="flex-start",this.QC.style.setProperty("display","none")}removePositionProperty(){this.ZC.style.removeProperty("top"),this.ZC.style.removeProperty("left"),this.ZC.style.removeProperty("bottom"),this.ZC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.ZC.style.setProperty("bottom","10px"),this.ZC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.ZC.style.setProperty("top","10px"),this.ZC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.ZC.style.setProperty("bottom","10px"),this.ZC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.ZC.style.setProperty("top","10px"),this.ZC.style.setProperty("right","10px")}}XC(t){for(let e=0;et.addRow(e.getName()).addRow("X:","",e.axisX.formatValue(i.x)).addRow("Y:","",e.axisY.formatValue(i.y)).addRow("Intensity:","",i.intensity.toFixed(1));class rd 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.xp=sd,this.mx=!1,this.Jy={},this.ds((t=>t.Vn||t.zn||t.io?void 0:"heatmap series")),this.ik=a,this.qi=l;const d=c;this.be=ce(l.heatmapGridSeriesFillStyle,d),this.Ky=ce(this.qi.heatmapGridSeriesWireframeStyle,d);const f={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows};this.En=f,this.sk=this.Ts.ek(this.scale,[],f).ke(this.be).qy(this.Ky).cs(this.getHighlight()),this.gs(this.sk),a.start&&this.setStart(a.start),a.end&&this.setEnd(a.end),a.step&&this.setStep(a.step),this.setHighlightOnHover(!1)}iS(){const t=this.Jy.start||{x:0,y:0};let e;e=this.Jy.end?{x:(this.Jy.end.x-t.x)/this.En.columns,y:(this.Jy.end.y-t.y)/this.En.rows}:this.Jy.step?this.Jy.step:{x:1,y:1},this.sk.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.sk.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.sk.eS().step}setEnd(t){return this.Jy.end=t,this.iS(),this}getEnd(){return this.sk.eS().end}clear(){return this.sk.Nt(),this.Ts.bs(),this.D.emit("dataClear",this),this}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.sk.qy(this.Ky),this.Ts.bs(),this.D.emit("styleChange",this),this}getWireframeStyle(){return this.Ky}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.sk.rS(t),this.Ts.bs(),this.D.emit("styleChange",this),this}getIntensityInterpolation(){return this.sk.nS()}Dm(){return this.Lm&&this.getVisible()}ld(){return ae(this.be)}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{fill:this.be}),this}hk(t){this.sk.hk().forEach((e=>{t.sk.oS(e)}))}zb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}rk(t){return this.D.on("styleChange",t)}nk(t){return this.D.off(t)}gg(t,e,i=this.mx){const s=ut(t,this.Ts.us.dt,this.scale),r=e?this.sk.getIsUnderMouse()?this.sk:void 0:this.sk;if(!r)return;const n=i?r.vx(s):r.gg(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.xp(new Kh,this,t).fc(),owner:this}}}solveNearestFromScreen(t,e=this.mx){return this.gg(jo(t,this.Ji.us),!1,e)}getXMax(){const t=this.sk;return t?t.xt():void 0}getXMin(){const t=this.sk;return t?t.vt():void 0}getYMax(){const t=this.sk;return t?t.Mt():void 0}getYMin(){const t=this.sk;return t?t.bt():void 0}Sr(){const t=u(0,0);return t.x=Math.max(t.x,this.sk.Vl()),t.y=Math.max(t.y,this.sk.zl()),t}mb(t){if(!(t instanceof zi))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof zi&&t._i())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}Pe(t,e){t.cs(e),this.Ts.bs()}Fe(){return super.Fe(),this.sk.ra(this.getBoundaries()),this}}class nd extends rd{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.$m=!1,this.xp=sd}invalidateIntensityValues(t){if(this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.En.dataOrder?t.length:t[0].length,rows:"rows"===this.En.dataOrder?t.length:t[0].length},i="columns"===this.En.dataOrder?this.En.columns:this.En.rows,s="columns"===this.En.dataOrder?this.En.rows:this.En.columns;if(e.x>i||e.y>s){if(!0===this.chart.fs.oo){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.En.columns}x${this.En.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.fs.oo){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.En.columns}x${this.En.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.`;St.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.sk.oS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.D.emit("invalidateIntensity",this,t),this.Ts.bs(),this.$m=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.sk.ke(this.be),this.D.emit("styleChange",this),this.Ts.bs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}ak(t){return this.D.on("invalidateIntensity",t)}lk(t){return this.D.off(t)}}class od 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.xp=sd,this.mx=!1,this.Jy={},this.ds((t=>t.Vn||t.zn||t.io?void 0:"heatmap series")),this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const d=c;this.be=ce(l.heatmapScrollingGridSeriesFillStyle,d),this.Ky=ce(this.qi.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",...a};this.En=f,this.uk=this.Ts.ck(this.scale,[],f).ke(this.be).qy(this.Ky).cs(this.getHighlight()),this.gs(this.uk),a.start&&this.setStart(a.start),a.step&&this.setStep(a.step),this.setHighlightOnHover(!1)}iS(){const t=this.Jy.start||{x:0,y:0};let e;e=this.Jy.step?this.Jy.step:{x:1,y:1},this.uk.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.uk.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.uk.eS().step}clear(){return this.uk.Nt(),this.Ts.bs(),this}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.uk.qy(this.Ky),this.Ts.bs(),this}getWireframeStyle(){return this.Ky}setPixelInterpolationMode(t){return t=t||"disabled",this.uk.rS(t),this.Ts.bs(),this}getPixelInterpolationMode(){return this.uk.nS()}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorEnabled(t){return super.setCursorEnabled(t)}setDataCleaning(t){return this.uk.Eu(t),this.Ts.bs(),this}Dm(){return this.Lm&&this.getVisible()}ld(){return ae(this.be)}attach(t,e=!0,i=!1){return super.attach(t,e,i),he(t,this.qi,i,{fill:this.be}),this}ke(t){return this.be="function"==typeof t?t(this.be):t,this.uk.ke(this.be),this.Ts.bs(),this}gg(t,e,i=this.mx){const s=ut(t,this.Ts.us.dt,this.scale),r=e?this.uk.getIsUnderMouse()?this.uk:void 0:this.uk;if(!r)return;const n=i?r.vx(s):r.gg(s);return n?ga(n,this.scale,this.xp(new Kh,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).fc(),this):void 0}solveNearestFromScreen(t,e=this.mx){return this.gg(jo(t,this.Ji.us),!1,e)}mb(t){if(!(t instanceof zi))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof zi&&t._i())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.uk.xt()||0}getXMin(){return this.uk.vt()||0}getYMax(){return this.uk.Mt()||0}getYMin(){return this.uk.bt()||0}Sr(){const t=u(0,0);return t.x=Math.max(t.x,this.uk.Vl()),t.y=Math.max(t.y,this.uk.zl()),t}Pe(t,e){t.cs(e),this.Ts.bs()}}class hd extends od{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.xp=sd}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.En.scrollDimension?t.length:t[0].length,"rows"===this.En.scrollDimension?t.length:t[0].length,0+i-1),r=this.En.resolution-1;if(s>r){if(!0===this.chart.fs.oo){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.En.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const s=[];for(let i=0;it[4]>=t[1],this.Fw=y(c(Ie,Ie),c(Le,Le)),this.Ak=[],this.gk=!1,this.pk=-1,this.mk=[],this.yk=!0,this.Sk=!1,this.vk=4,this.xp=(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.xk=[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.fs.Vn||this.chart.fs.Un||this.chart.us.As(10)}Lb(){return this.mk}Rb(t){return this.D.on("dataAdd",t)}Eb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}zb(t){return this.D.off(t)}Dm(){return this.Lm&&this.mk.length>0&&this.getVisible()}bk(t){if(!(this.mk.length<1))return[this.mk[t][0],this.mk[t][1],this.mk[t][2],this.mk[t][3],this.mk[t][4]]}gg(t){if(0===this.mk.length)return;const e=ut(t,this.Ts.us.dt,this.scale).x,i=void 0!==this.getPackDataState();let s,r,n,o,h;if(i){const t=this.Mk;if(!t)return;const i=we(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=we(e,this.mk.length-1,(t=>this.mk[t][0])),i=void 0!==t&&this.mk[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.xp(new Kh,this,a).fc(),owner:this,isPacked:i,position:s,open:r,high:n,low:o,close:h}}mb(t){if(!(t.x instanceof Fi))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this._k=t.x}Sr(){return u(5,5)}sC(t){const e=t.length-1;if(e<0)return this;for(let i=0;i<=e;i+=1)t[i][3]0&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const e=Array.isArray(t[0])?t:[t[0]];if(e.length>0){this.gk=!0;const t=this.mk.length,i=this.Ak.length,s=e.length;this.mk.length=t+s,this.Ak.length=i+s;for(let r=0;rthis.xk[t]));return void 0===i?i=e=1){for(let e=0;e=1&&(t!==this.pk||this.gk||this.Sk)){this.Sk=!1,this.pk=t,this.gk=!1,this.Ck(),this.Mk=[];const e=this.mk.length;let i=this.mk[0][0]-this.mk[0][0]%(t/2)+t,s=0;for(;s{0!==this.iy.size&&void 0!==[...this.iy.values()].find((({series:t})=>!0===t.getVisible()))||this.Jk.St(e,i,!1,!1,"zoomBandChart"),this.Kk.us.bs()},t.zn||t.Vn||t.Qn||i.us.As(St.atob("em9vbSBiYW5kIGNoYXJ0")),this.fs=t,this.qk=(null==h?void 0:h.orientation)||"x",this.tT=void 0!==(null==h?void 0:h.useSharedValueAxis)&&h.useSharedValueAxis,this.iT=n,this.nc="x"===this.qk?th:eh;const l={...h,defaultAxisX:this.nc.getWidth({x:null==h?void 0:h.defaultAxis,y:void 0}),defaultAxisY:this.nc.getHeight({x:null==h?void 0:h.defaultAxis,y:void 0})};this.Kk=new Pd(t,i,s,wt,o,l,a).setTitle("Zoom Band Chart").setMouseInteractions(!1).setAutoCursorMode(e.AutoCursorModes.disabled),this.engine=this.Kk.engine;const u=this.Kk.getDefaultAxisX().setMouseInteractions(!1),c=this.Kk.getDefaultAxisY().setMouseInteractions(!1);this.Jk=this.nc.getWidth({x:u,y:c}).setScrollStrategy(Rs.fitting).setAnimationScroll(!1).setStrokeStyle(rt).setTickStrategy(Bs.Empty),(null==h?void 0:h.useSharedValueAxis)?this.sT=this.nc.getHeight({x:u,y:c}):this.nc.getHeight({x:u,y:c}).dispose();const d=this.getTheme().zoomBandChartDefocusOverlayFillStyle||new U({color:this.getTheme().isDark?T(0,0,0,180):T(255,255,255,180)});this.eT=[this.Kk.vf.Te(this.Jk.rA).ke(d).Ce(rt),this.Kk.vf.Te(this.Jk.rA).ke(d).Ce(rt)];const f=this.Kk.vf._A(this.Jk.rA).Ee(this.getTheme().zoomBandChartSplitterStrokeStyle||this.getTheme().chartXYSeriesBackgroundStrokeStyle);this.hT={collection:f,members:new Array(5).fill(0).map((t=>f.Lr()))};const g=this.getTheme(),y="function"==typeof g.zoomBandChartKnobFillStyle?g.zoomBandChartKnobFillStyle(this.fs.Xs):g.zoomBandChartKnobFillStyle||B;this.rT=[this.Kk.vf.Te(this.Kk.pixelScale).ke(y).Ce(rt),this.Kk.vf.Te(this.Kk.pixelScale).ke(y).Ce(rt)],this.nT=this.getTheme().zoomBandChartKnobSize||{x:0,y:0},this.oT()}add(t){var e,i,s,r,n;const o=this.jk.map((t=>t.axis)),h="x"===this.qk?t.axisX:t.axisY;if(!o.includes(h)){const t=h.onIntervalChange(this.Qk);this.jk.push({axis:h,deattach:()=>{h.offIntervalChange(t)}}),this.Jk.Yh(h.Uh()),this.aT&&this.aT.remove(),this.aT=dt(...this.jk.map((t=>t.axis)))}const a=this.nc.getHeight({x:t.axisX,y:t.axisY});let l;if(this.tT)l=this.sT;else{const t=this.Zk.get(a);t?l=t:(l=this.nc.getHeight({x:this.Kk.addAxisX.bind(this.Kk),y:this.Kk.addAxisY.bind(this.Kk)})(),this.lT(l)),this.Zk.set(a,l)}const u=this.nc.getWidth({x:this.Jk,y:l}),c=this.nc.getHeight({x:this.Jk,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.Eb(r)));const n=t.Vb((()=>e.clear()));f.push((()=>{t.zb(n)}))};if(t instanceof bd)d=this.Kk.addPointLineAreaSeries({...t.En,xAxis:u,yAxis:c}).setStrokeStyle(t.getStrokeStyle()).setAreaFillStyle(t.getAreaFillStyle()).setPointFillStyle(t.getPointFillStyle()).setCurvePreprocessing(t.getCurvePreprocessing()),d.setDataSet(t.uT());else if(t instanceof Ic||t instanceof ad){const i=this.Kk.addLineSeries({xAxis:u,yAxis:c,dataPattern:t instanceof Ic?null===(e=t.En)||void 0===e?void 0:e.dataPattern:void 0});if(t instanceof Ic)i.setStrokeStyle(t.getStrokeStyle());else{const e=fd(t);e&&i.setStrokeStyle(e)}g(t,i),d=i}else if(t instanceof jc){const e=this.Kk.addAreaSeries({xAxis:u,yAxis:c,baseline:t.PC}).setFillStyle(t.getFillStyle()).setStrokeStyle(t.getStrokeStyle());g(t,e),d=e}else if(t instanceof ed){const e=this.Kk.addPointSeries({xAxis:u,yAxis:c,pointShape:null===(i=t.En)||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 Fc){const e=this.Kk.addStepSeries({xAxis:u,yAxis:c,pointShape:null===(s=t.En)||void 0===s?void 0:s.pointShape,mode:t.yw}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof Ac){const e=this.Kk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(r=t.En)||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 yc){const e=this.Kk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(n=t.En)||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 td){const e=this.Kk.addAreaRangeSeries({xAxis:u,yAxis:c}).setLowFillStyle(t.getLowFillStyle()).setHighFillStyle(t.getHighFillStyle()).setLowStrokeStyle(t.getLowStrokeStyle()).setHighStrokeStyle(t.getHighStrokeStyle()).add(t.Lb()),i=t.Rb(((t,i)=>e.add(i)));f.push((()=>t.Eb(i))),d=e;const s=t.Vb((()=>e.clear()));f.push((()=>{t.zb(s)}))}else{if(!(t instanceof rd))throw new Error("LightningChart JS Zoom Band Chart unsupported series type");{const e=this.Kk.addHeatmapGridSeries({xAxis:u,yAxis:c,...t.ik}),i=()=>{e.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};i(),d=e,t.hk(d);const s=t.ak(((t,i)=>e.invalidateIntensityValues(i))),r=t.rk(i);f.push((()=>{t.lk(s),t.nk(r)}));const n=t.Vb((()=>e.clear()));f.push((()=>{t.zb(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.iy.set(t,{series:d,clearReferences:()=>f.forEach((t=>t()))}),d}disposeSeries(t){const e=this.iy.get(t);if(e){const{clearReferences:i}=e;i(),this.iy.delete(t),e.series.dispose();const s=this.nc.getHeight({x:t.axisX,y:t.axisY}),r=this.Zk.get(s);r&&0===r.vA().length&&(this.Zk.delete(s),r.dispose())}const i="x"===this.qk?t.axisX:t.axisY;if(!Array.from(this.iy.keys()).find((t=>i===("x"===this.qk?t.axisX:t.axisY)))){const t=this.jk.findIndex((t=>t.axis===i));this.jk[t].deattach(),this.jk.splice(t,1)}return this}setDefocusOverlayFillStyle(t){return this.eT.forEach((e=>e.ke(t))),this.Kk.us.bs(),this}getDefocusOverlayFillStyle(){return this.eT[0].Lh()}setSplitterStrokeStyle(t){return this.hT.collection.Ee(t),this.Kk.us.bs(),this}getSplitterStrokeStyle(){return this.hT.collection.ku()}setKnobFillStyle(t){return this.rT.forEach((e=>e.ke(t))),this.Kk.us.bs(),this}getKnobFillStyle(){return this.rT[0].Lh()}setKnobStrokeStyle(t){return this.rT.forEach((e=>e.Ce(t))),this.Kk.us.bs(),this}getKnobStrokeStyle(){return this.rT[0]._o()}setKnobSize(t){return this.nT=t,this.Kk.us.bs(),this}getKnobSize(){return this.nT}getDefaultAxisX(){return this.Kk.getDefaultAxisX()}getDefaultAxisY(){return this.Kk.getDefaultAxisY()}lT(t){t.setTickStrategy(Bs.Empty).setMouseInteractions(!1).setNibStyle(rt).setStrokeStyle(rt)}oT(){let t;const i=(t,e,i)=>{var s,r;const n="x"===this.qk?null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.iy.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Jk.getInterval();Math.abs(this.Jk.dt.ct(t)-this.Jk.dt.ct(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.nc.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.qk?null===(e=Array.from(this.iy.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisY;if(!n)return;const o=this.nc.getWidth(this.Kk.translateCoordinate(t,this.Kk.coordsAxis)),h=n.getInterval(),a=0===r?o:h.start,l=1===r?o:h.end;i(a,l,!1),$t(t)};s.setMouseDragEventHandler(((t,e,i,s,r)=>n(e)));const o=Yi(new Xi(void 0,((t,e,i,s,r)=>n(r))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)})),this.Kk.onSeriesBackgroundMouseEnter((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Move,t)})),this.Kk.onSeriesBackgroundMouseLeave((()=>{this.engine.restoreMouseStyle(t)}));const s=(t,e)=>{var s,r;const n="x"===this.qk?null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.iy.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Jk.dt.pi(o.start,this.nc.getWidth(t)),a=this.Jk.dt.pi(o.end,this.nc.getWidth(t));i(h,a,!1),$t(e)};this.Kk.onSeriesBackgroundMouseDrag(((t,e,i,r,n)=>s(n,e)));const r=Yi(new Xi(void 0,((t,e,i,r,n)=>s(r,n))));this.Kk.onSeriesBackgroundMouseWheel(((t,e)=>{var s,r;const n="x"===this.qk?null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.iy.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Jk.getInterval(),a=this.nc.getWidth(this.Kk.translateCoordinate(e,this.Kk.coordsAxis)),l=this.Jk.dt.ct(o.start),u=this.Jk.dt.ct(o.end),c=this.Jk.dt.ct(a),d=kt((c-l)/(u-l),0,1),f=.2*Math.abs(u-l)*n.Ed,g=d*f*-Math.sign(e.deltaY),y=(1-d)*f*Math.sign(e.deltaY),m=kt(this.Jk.dt.pi(o.start,g),h.start,h.end),p=kt(this.Jk.dt.pi(o.end,y),h.start,h.end);i(m,p,!1),$t(e)})),this.Kk.onSeriesBackgroundTouchStart(r.onTouchStart),this.Kk.onSeriesBackgroundTouchMove(r.onTouchMove),this.Kk.onSeriesBackgroundTouchEnd(r.onTouchEnd),this.eT.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.qk?null===(e=Array.from(this.iy.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisY;if(!r)return;const n=this.nc.getWidth(this.Kk.translateCoordinate(t,this.Kk.coordsAxis)),o=r.getInterval(),h=this.Jk.getInterval(),a=kt(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),$t(t)};s.setMouseClickEventHandler(((t,e)=>n(e)));const o=Yi(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=St.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.Kk.getSizePixels()}onResize(t){return this.Kk.onResize(((e,i,s,r,n)=>t(this,i,s,r,n)))}offResize(t){return this.Kk.offResize(t)}Ka(t){this.Kk.Ka(t)}getMinimumSize(){return this.Kk.getMinimumSize()}j(){return this.Kk.j()}Z(){return this.Kk.Z()}Fe(t){var e,i,s,r;const n=me(Array.from(this.iy.keys()).map((t=>t.chart))),o="x"===this.qk?null===(e=Array.from(this.iy.keys())[0])||void 0===e?void 0:e.axisX:null===(i=Array.from(this.iy.keys())[0])||void 0===i?void 0:i.axisY;if("x"===this.qk){const t=n.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=0===t.iA?t.TA():0})),Math.max(t,i)}),0),e=n.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=100===t.iA?t.TA():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.Kk.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.iA?t.TA():0})),Math.max(t,i)}),0),e=n.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=100===t.iA?t.TA():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.Kk.setPadding({bottom:i+(0===n.length?10:0),top:s+e+(0===n.length?10:0)})}this.Kk.Fe(t);const h=this.Jk.getInterval().start,a=this.Jk.getInterval().end,l=kt(o?o.getInterval().start:h,h,a),u=kt(o?o.getInterval().end:a,h,a),c=this.nc.getHeight(this.Kk.cT.getInnerIntervalPixels());this.eT[0].Ie(this.nc.toPoint(h,0)).q(this.nc.toPoint(l-h,c)),this.eT[1].Ie(this.nc.toPoint(u,0)).q(this.nc.toPoint(a-u,c)),this.hT.members[0].CA(this.nc.toPoint(h,c),this.nc.toPoint(l,c)),this.hT.members[1].CA(this.nc.toPoint(l,c),this.nc.toPoint(l,0)),this.hT.members[2].CA(this.nc.toPoint(l,0),this.nc.toPoint(u,0)),this.hT.members[3].CA(this.nc.toPoint(u,0),this.nc.toPoint(u,c)),this.hT.members[4].CA(this.nc.toPoint(u,c),this.nc.toPoint(a,c));const d=ut(this.nc.toPoint(l,c/2),this.Jk.rA,this.Kk.pixelScale),f=ut(this.nc.toPoint(u,c/2),this.Jk.rA,this.Kk.pixelScale),g=this.nT;this.rT[0].Ie({x:d.x-g.x/2,y:d.y-g.y/2}).q({x:g.x,y:g.y}).zh(this.nc.getWidth({x:0,y:90})),this.rT[1].Ie({x:f.x-g.x/2,y:f.y-g.y/2}).q({x:g.x,y:g.y}).zh(this.nc.getWidth({x:0,y:90}))}setSeriesBackgroundFillStyle(t){return this.Kk.setSeriesBackgroundFillStyle(t),this.Kk.us.bs(),this}getSeriesBackgroundFillStyle(){return this.Kk.getSeriesBackgroundFillStyle()}setSeriesBackgroundStrokeStyle(t){return this.Kk.setSeriesBackgroundStrokeStyle(t),this.Kk.us.bs(),this}getSeriesBackgroundStrokeStyle(){return this.Kk.getSeriesBackgroundStrokeStyle()}setSeriesBackgroundEffect(t){return this.Kk.setSeriesBackgroundEffect(t),this.Kk.us.bs(),this}getSeriesBackgroundEffect(){return this.Kk.getSeriesBackgroundEffect()}getTheme(){return this.Kk.getTheme()}setTitle(t){return this.Kk.setTitle(t),this}getTitle(){return this.Kk.getTitle()}setTitleFillStyle(t){return this.Kk.setTitleFillStyle(t),this}getTitleFillStyle(){return this.Kk.getTitleFillStyle()}setTitleFont(t){return this.Kk.setTitleFont(t),this}getTitleFont(){return this.Kk.getTitleFont()}setTitleMargin(t){return this.Kk.setTitleMargin(t),this}getTitleMargin(){return this.Kk.getTitleMargin()}setPadding(t){return this.Kk.setPadding(t),this}getPadding(){return this.Kk.getPadding()}setBackgroundFillStyle(t){return this.Kk.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.Kk.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.Kk.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.Kk.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return Bh(t,e,i,this.Kk.pixelScale,this.Kk.us)}addUIElement(t,e){return this.Kk.addUIElement(t,e)}addLegendBox(t,e){return this.Kk.addLegendBox(t,e)}getLegendBoxes(){return this.Kk.getLegendBoxes()}saveToFile(t,e,i){return this.Kk.saveToFile(t,e,i),this}dispose(){return this.Kk.dispose(),this.Zk.clear(),this.iy.clear(),this.iT(this),this}onDispose(t){return this.Kk.onDispose((()=>t(this)))}offDispose(t){return this.Kk.offDispose(t)}}const fd=t=>{if("getStrokeStyle"in t)return t.getStrokeStyle();const e=(t=>t instanceof Ic||t instanceof jc?t.getStrokeStyle().getFillStyle():t instanceof ed||t instanceof yc?t.getPointFillStyle():void 0)(t);return e?new qi({thickness:2,fillStyle:e}):void 0};class gd{constructor(t){this.dT=0,this.fT=0,this.AT=0,this.gT=!1,this.pT=!0,this.mT=!1,this.yT={warningDisplayed:!1,expandEvents:[]},this.D=new r.Eventer,this.pT=!t||void 0===t.autoSortingEnabled||t.autoSortingEnabled,void 0!==(null==t?void 0:t.dataPattern)&&(this.ST={userSpecified:null===t.dataPattern?void 0:t.dataPattern}),this.vT=void 0!==(null==t?void 0:t.lookupValues)&&t.lookupValues,this.xT=void 0!==(null==t?void 0:t.colors)&&t.colors,this.bT=void 0!==(null==t?void 0:t.ids)&&t.ids,this.MT=void 0!==(null==t?void 0:t.sizes)&&t.sizes,this._T=void 0!==(null==t?void 0:t.rotations)&&t.rotations,this.wT=(null==t?void 0:t.dataStorage)?t.dataStorage:Float64Array,this.CT=!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.wT(i);for(let e=0;ea-1&&(this.dT=0,this.gT=!0),this.fT=Math.min(this.fT+1,a),this.AT+=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,A]=this.RT(l,t.xValues,"x",o,h,a),[x,S]=this.RT(l,t.yValues,"y",o,h,a),b=this.BT(i),{samplesCacheX:v,samplesCacheY:M,samplesCacheLookup:T,samplesCacheColors:w,samplesCacheIDs:E,samplesCacheSize:k,samplesCacheRotation:C,maxSampleCount:D,dataPattern:F,incomingDataReplacedCache:I}=this.kT({appendCount:l,...0===A&&0===S&&0===a&&0===d&&0===f&&0===g&&0===y&&0===m?{incomingDataX:p,incomingDataY:x,incomingDataLookup:e,incomingDataIDs:s,incomingDataColors:b,incomingDataSize:r,incomingDataRotation:n}:{}});if(!I&&F&&this.pT&&this.FT&&this.IT){const t=p[A],i=x[S];if(!this.PT(F,t,i)&&!this.mT)return this.DT(this.FT,this.IT,Sd(p,A,A+l),Sd(x,S,S+l),Sd(e,d,d+l),Sd(b,f,f+l),Sd(s,g,g+l),Sd(r,y,y+l),Sd(n,m,m+l),F),this}const L=D-this.dT,z=Math.min(l,L);if(z>0&&(I||(Ad(v,p,A,z,this.dT),Ad(M,x,S,z,this.dT),e&&T&&Ad(T,e,d,z,this.dT),s&&E&&Ad(E,s,g,z,this.dT),b&&w&&Ad(w,b,f,z,this.dT),r&&k&&Ad(k,r,y,z,this.dT),n&&C&&Ad(C,n,m,z,this.dT)),this.LT(this.dT,this.dT+z-1),this.dT+=z,this.dT>D-1&&(this.dT=0,this.gT=!0)),this.fT=Math.min(this.fT+z,D),this.AT+=z,this.ET(),l-z>0){const t={xValues:p?Sd(p,A+z,void 0):void 0,yValues:x?Sd(x,S+z,void 0):void 0,lookupValues:e?Sd(e,d+z,void 0):void 0,ids:s?Sd(s,g+z,void 0):void 0,colors:b?Sd(b,f+z,void 0):void 0,sizes:r?Sd(r,y+z,void 0):void 0,rotations:n?Sd(n,m+z,void 0):void 0};this.appendSamples(t)}return this}setSamples(t){return this.clear().appendSamples(t)}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;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,y=void 0!==e.offsetIds?e.offsetIds:l,m=void 0!==e.offsetSizes?e.offsetSizes:l,p=void 0!==e.offsetRotations?e.offsetRotations:l,A=this.BT(n),x=this.AT-1,S=void 0!==this.VT?Math.max(this.AT-this.VT,0):0,b=t+u-1,v=Math.max(t,S),M=Math.min(b,x),T=M-v+1;if(this.AT>0&&T>0){const{samplesCacheX:e,samplesCacheY:n,samplesCacheColors:u,samplesCacheIDs:c,samplesCacheLookup:d,samplesCacheSize:x,samplesCacheRotation:b}=this.kT({appendCount:0}),w=e.length;if(void 0!==this.VT&&this.gT&&this.AT%this.VT!=0){const S=this.AT-this.AT%this.VT,T=this.AT-1,E=this.AT-this.fT,k=S-1,C=Math.max(v,E),D=Math.min(M,k)-C+1;if(D>0){const S=C-t,v=yd(C,this.AT,w,this.dT);i&&Ad(e,i,l+S,D,v),s&&Ad(n,s,l+S,D,v),r&&d&&Ad(d,r,f+S,D,v),o&&c&&Ad(c,o,y+S,D,v),A&&u&&Ad(u,A,g+S,D,v),h&&x&&Ad(x,h,m+S,D,v),a&&b&&Ad(b,a,p+S,D,v)}const F=Math.max(v,S),I=Math.min(M,T)-F+1;if(I>0){const S=F-t,v=yd(F,this.AT,w,this.dT);i&&Ad(e,i,l+S,I,v),s&&Ad(n,s,l+S,I,v),r&&d&&Ad(d,r,f+S,I,v),o&&c&&Ad(c,o,y+S,I,v),A&&u&&Ad(u,A,g+S,I,v),h&&x&&Ad(x,h,m+S,I,v),a&&b&&Ad(b,a,p+S,I,v)}}else{const t=v-S;i&&Ad(e,i,l,T,t),s&&Ad(n,s,l,T,t),r&&d&&Ad(d,r,f,T,t),o&&c&&Ad(c,o,y,T,t),A&&u&&Ad(u,A,g,T,t),h&&x&&Ad(x,h,m,T,t),a&&b&&Ad(b,a,p,T,t)}this.D.emit("cleared")}const w=t+u-1-x;if(w>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:y+e,offsetSizes:m+e,offsetRotations:p+e,count:w})}return this}alterSamplesByID(t,e){if(!this.bT)throw new Error("LightningChart JS attempted to use alterSamplesByID on DataSetXY that doesn't have IDs enabled.");const i=t.length,s=this.zT;if(i<=0||!s)return this;const r=Array.isArray(e.xValues)?new this.wT(e.xValues):e.xValues,n=Array.isArray(e.yValues)?new this.wT(e.yValues):e.yValues,o=Array.isArray(e.yValues)?new Float32Array(e.yValues):e.yValues,h=this.BT(e.colors),a=Array.isArray(e.sizes)?new Float32Array(e.sizes):e.sizes,l=Array.isArray(e.rotations)?new Float32Array(e.rotations):e.rotations,u=s.length,c=this.fT,d=this.AT-1,f=Math.max(d-c+1,0);for(let e=0;es[yd(t,this.AT,u,this.dT)])),g=yd(c,this.AT,u,this.dT);s[g]===i&&(r&&this.FT&&(this.FT[g]=r[e]),n&&this.IT&&(this.IT[g]=n[e]),o&&this.OT&&(this.OT[g]=o[e]),h&&this.NT&&(this.NT[g]=h[e]),a&&this.GT&&(this.GT[g]=a[e]),l&&this.WT&&(this.WT[g]=l[e]))}return this.D.emit("cleared"),this}clear(){return this.dT=0,this.fT=0,this.AT=0,this.gT=!1,this.D.emit("cleared"),this}getSampleCount(){return this.fT}getNextSampleIndex(){return this.AT}setMaxSampleCount(t){if("object"==typeof t){this.UT&&this.offMaxSampleCountExceeded(this.UT);const e=t.max;this.UT=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.VT&&this.setMaxSampleCount(1e5)}else if("number"==typeof t){const e=t;if(void 0!==this.VT&&this.VT>e)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to shrink data set. This is currently not supported.");if(!this.FT||!this.IT)return this.VT=e,this;if(e===this.VT)return this;if(this.gT&&0!==this.dT)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.VT=e,this.fTt+e.count),0),r=new this.wT(s),n=new this.wT(s),o=this.xT?new Uint32Array(s):void 0,h=this.vT?new Float32Array(s):void 0,a=this.bT?new Uint32Array(s):void 0,l=this.MT?new Float32Array(s):void 0,u=this._T?new Float32Array(s):void 0;let c=0;for(const t of i)r.set(this.FT.subarray(t.offset,t.offset+t.count),c),n.set(this.IT.subarray(t.offset,t.offset+t.count),c),this.xT&&o&&this.NT&&o.set(this.NT.subarray(t.offset,t.offset+t.count),c),this.vT&&h&&this.OT&&h.set(this.OT.subarray(t.offset,t.offset+t.count),c),this.bT&&a&&this.zT&&a.set(this.zT.subarray(t.offset,t.offset+t.count),c),this.MT&&l&&this.GT&&l.set(this.GT.subarray(t.offset,t.offset+t.count),c),this._T&&u&&this.WT&&u.set(this.WT.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.D.on("maxSampleCountExceeded",t)}offMaxSampleCountExceeded(t){return this.D.off(t)}RT(t,e,i,s,r,n){if(void 0===e){const e=this.TT();r=void 0!==r?r:1,s=void 0!==s?s:e?e[i]+r:0;const n=new this.wT(t);for(let e=0;et[yd(e,this.AT,d,this.dT)])),p=m-1,A=m+1,x=t[yd(m,this.AT,d,this.dT)],S=A<=this.AT-1?t[yd(A,this.AT,d,this.dT)]:void 0,b=void 0!==S&&S0){const e=void 0!==this.VT&&this.gT?this.dT:0,i=this.fT-1,s=void 0!==this.VT&&this.gT?0:void 0,r=void 0!==this.VT&&this.gT?this.dT-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.FT[n],r=this.IT[n];for(let t=n+1;t<=o;t+=1){if(!1!==e){const i=this.FT[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.IT[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?Fr.ProgressiveX:e&&e.direction<0?Fr.RegressiveX:i&&i.direction>0?Fr.ProgressiveY:i&&i.direction<0?Fr.RegressiveY:void 0,this.ST={autoDetectResult:t},t&&St.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}PT(t,e,i){const s=this.TT();return!s||("ProgressiveX"===t?e>=s.x:"RegressiveX"===t?e<=s.x:"ProgressiveY"===t?i>=s.y:"RegressiveY"!==t||i<=s.y)}kT(t){if(t.incomingDataX&&t.incomingDataY&&0===this.fT&&!this.FT&&!this.IT&&(void 0===this.VT||this.VT===t.appendCount)&&this.CT)return this.FT=xd(t.incomingDataX,this.wT),this.IT=xd(t.incomingDataY,this.wT),this.OT=this.vT?xd(t.incomingDataLookup,Float32Array):void 0,this.zT=this.bT?xd(t.incomingDataIDs,Uint32Array):void 0,this.NT=this.xT?xd(t.incomingDataColors,Uint32Array):void 0,this.GT=this.MT?xd(t.incomingDataSize,Float32Array):void 0,this.WT=this._T?xd(t.incomingDataRotation,Float32Array):void 0,{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:t.appendCount,incomingDataReplacedCache:!0};if(void 0===this.VT){const e=this.fT+t.appendCount;if(!this.FT||!this.IT)return this.FT=new this.wT(e),this.IT=new this.wT(e),this.OT=this.vT?new Float32Array(e):void 0,this.zT=this.bT?new Uint32Array(e):void 0,this.NT=this.xT?new Uint32Array(e):void 0,this.GT=this.MT?new Float32Array(e):void 0,this.WT=this._T?new Float32Array(e):void 0,{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:e};const i=this.FT.length;if(ii-t.timestamp<5e3)),e>1e3&&this.yT.expandEvents.push({timestamp:i}),this.yT.expandEvents.length>5)return St.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.yT.warningDisplayed=!0,this.setMaxSampleCount({mode:"auto"}),this.kT(t)}const i=new this.wT(e);i.set(this.FT),this.FT=i;const s=new this.wT(e);if(s.set(this.IT),this.IT=s,this.vT){const t=new Float32Array(e);this.OT&&t.set(this.OT),this.OT=t}if(this.bT){const t=new Uint32Array(e);this.zT&&t.set(this.zT),this.zT=t}if(this.xT){const t=new Uint32Array(e);this.NT&&t.set(this.NT),this.NT=t}if(this.MT){const t=new Float32Array(e);this.GT&&t.set(this.GT),this.GT=t}if(this._T){const t=new Float32Array(e);this.WT&&t.set(this.WT),this.WT=t}return this.dT=this.fT,{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:e}}if(i>4*e){const t=new this.wT(e);t.set(this.FT.subarray(0,this.fT)),this.FT=t;const i=new this.wT(e);if(i.set(this.IT.subarray(0,this.fT)),this.IT=i,this.vT){const t=new Float32Array(e);this.OT&&t.set(this.OT.subarray(0,this.fT)),this.OT=t}if(this.bT){const t=new Uint32Array(e);this.zT&&t.set(this.zT.subarray(0,this.fT)),this.zT=t}if(this.xT){const t=new Uint32Array(e);this.NT&&t.set(this.NT.subarray(0,this.fT)),this.NT=t}if(this.MT){const t=new Float32Array(e);this.GT&&t.set(this.GT.subarray(0,this.fT)),this.GT=t}if(this._T){const t=new Float32Array(e);this.WT&&t.set(this.WT.subarray(0,this.fT)),this.WT=t}return{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:e}}return{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:i}}return t.appendCount+this.fT>this.VT&&this.D.emit("maxSampleCountExceeded",this,this.fT,this.VT,this.fT+t.appendCount),this.FT=this.FT||new this.wT(this.VT),this.IT=this.IT||new this.wT(this.VT),this.OT=this.OT||(this.vT?new Float32Array(this.VT):void 0),this.zT=this.zT||(this.bT?new Uint32Array(this.VT):void 0),this.NT=this.NT||(this.xT?new Uint32Array(this.VT):void 0),this.GT=this.GT||(this.MT?new Float32Array(this.VT):void 0),this.WT=this.WT||(this._T?new Float32Array(this.VT):void 0),{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:this.VT}}XT(){if(!this.FT||!this.IT||0===this.fT)return;if(void 0===this.VT)return this.AT>0?{x:this.FT[0],y:this.IT[0]}:void 0;if(!this.gT)return{x:this.FT[0],y:this.IT[0]};let t=this.dT-this.fT;return t<0&&(t+=this.VT),{x:this.FT[t],y:this.IT[t]}}TT(){if(!this.FT||!this.IT||0===this.fT)return;if(void 0===this.VT){const t=this.fT-1;return t>=0?{x:this.FT[t],y:this.IT[t]}:void 0}let t=this.dT-1;return t<0&&(t+=this.VT),{x:this.FT[t],y:this.IT[t]}}gg(t,e,i,s){const r=this.ET(),n=this.FT,o=this.IT;if(!n||!o)return;const h=t=>({x:n[t],y:o[t],lookupValue:this.vT&&this.OT?this.OT[t]:void 0,id:this.bT&&this.zT?this.zT[t]:void 0,color:this.xT&&this.NT?this.NT[t]:void 0,size:this.MT&&this.GT?this.GT[t]:void 0,rotation:this._T&&this.WT?this.WT[t]:void 0}),a=n.length,l=this.fT,u=this.AT-1,c=Math.max(u-l+1,0);if(r){const i=this.XT(),s=this.TT();if(!(i&&s&&this.FT&&this.IT))return;const n="ProgressiveX"===r||"RegressiveX"===r?"x":"y",o="x"===n?"y":"x",l="x"===n?this.FT:this.IT,d="x"===o?this.FT:this.IT,f=t[n],g=Math.min(i[n],s[n]),y=Math.max(i[n],s[n]);if(fy)return;const m=pd(f,c,u,(t=>l[yd(t,this.AT,a,this.dT)])),p=yd(m,this.AT,a,this.dT);if(!e)return h(p);const A=m-1,x=m+1,S=f>=l[p]&&("ProgressiveX"===r||"ProgressiveY"===r)?x<=u?yd(x,this.AT,a,this.dT):void 0:A>=c?yd(A,this.AT,a,this.dT):void 0;if(void 0===S)return;const b=l[p],v=d[p],M=l[S],T=d[S],w=Math.min(b,M),E=w===b?v:T,k=Math.max(b,M),C=Ln(E,k===b?v:T,(f-w)/(k-w));return"ProgressiveX"===r||"RegressiveX"===r?{x:f,y:C}:{x:C,y:f}}let d,f=Number.MAX_VALUE;const g=ut(t,i,s),y=this.fT-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=lt(e,i.x,s.x),o=lt(r,i.y,s.y),h=(n-g.x)**2+(o-g.y)**2;ht%i,md=(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=pd(t,u,l,(t=>i[yd(t,s,a)])),d=pd(e,u,l,(t=>i[yd(t,s,a)])),f=Math.max(c-h,u),g=Math.min(d+h,l),y=yd(f,s,a),m=yd(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}]}},pd=(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?new e:Array.isArray(t)?new e(t):t instanceof e?t:new e(t),Sd=(t,e,i)=>{if(void 0!==t)return Array.isArray(t)?t.slice(e,i):t.subarray(e,i)};class bd extends nu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){var d;super(t,e,i,s,r,n,o,h,a,l),this._s="Point Line Area Series",this.xp=vd,this.mx=!1,this.En=c,this.el=this.Ts.tF(this.scale).Ee(ce(this.qi.lineSeriesStrokeStyle,u)).qT(ce(this.qi.pointSeriesFillStyle,u)).KT(ce(this.qi.areaSeriesPositiveFillStyle,u)).JT(void 0).QT(7),this.el.iF=!1!==(null===(d=this.En)||void 0===d?void 0:d.allowDataGrouping),this.gs(this.el)}setDataSet(t){var e;return t===(null===(e=this.sF)||void 0===e?void 0:e.Wt)||(this.sF=De(t,this.sF,(()=>[t.jT((()=>this.Ji.us.bs())),t.ZT((()=>this.Ji.us.bs()))])),this.el.eF(t),this.chart.us.bs()),this}getDataSet(){return this.hF()}setStrokeStyle(t){return this.el.Ee(t),this.Ts.bs(),this}getStrokeStyle(){return this.el.ku()}setAreaFillStyle(t){return this.el.KT(t),this.Ts.bs(),this}getAreaFillStyle(){return this.el.rF()}setPointFillStyle(t){return this.el.qT(t),this.Ts.bs(),this}getPointFillStyle(){return this.el.nF()}setPointSize(t){return this.el.QT(t),this.Ts.bs(),this}getPointSize(){return this.el.oF()}setPointShape(t){return this.el.aF(t),this.Ts.bs(),this}getPointShape(){return this.el.lF()}setPointRotation(t){return this.el.uF(t),this.Ts.bs(),this}getPointRotation(){return this.el.cF()}setCurvePreprocessing(t){return this.el.JT(t),this.Ts.bs(),this}getCurvePreprocessing(){return this.el.dF()}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}add(t){return this.hF().add(t),this.Ts.bs(),this}addArraysXY(t,e){return this.hF().addArraysXY(t,e),this.Ts.bs(),this}appendJSON(t,e){return this.hF().appendJSON(t,e),this.Ts.bs(),this}appendSample(t){return this.hF().appendSample(t),this.Ts.bs(),this}appendSamples(t){return this.hF().appendSamples(t),this.Ts.bs(),this}setSamples(t){return this.hF().setSamples(t),this.Ts.bs(),this}alterSamples(t,e){return this.hF().alterSamples(t,e),this.Ts.bs(),this}alterSamplesByID(t,e){return this.hF().alterSamplesByID(t,e),this.Ts.bs(),this}getSampleCount(){return this.hF().getSampleCount()}getNextSampleIndex(){return this.hF().getNextSampleIndex()}clear(){return this.hF().clear(),this.Ts.bs(),this}setMaxSampleCount(t){return this.hF().setMaxSampleCount(t),this.Ts.bs(),this}getMaxSampleCount(){return this.hF().getMaxSampleCount()}readBack(t){return this.hF().readBack(t)}onMaxSampleCountExceeded(t){return this.hF().onMaxSampleCountExceeded(t)}offMaxSampleCountExceeded(t){return this.hF().offMaxSampleCountExceeded(t)}uT(){return this.hF()}ld(){return ae(this.getPointFillStyle())||ae(this.getStrokeStyle().getFillStyle())||ae(this.getAreaFillStyle())}Dm(){var t;const e=null===(t=this.sF)||void 0===t?void 0:t.Wt;return this.getAutoScrollingEnabled()&&void 0!==e&&e.AT>0}mb(t){}getXMax(){return this.el.xt()}getXMin(){return this.el.vt()}getYMax(){return this.el.Mt()}getYMin(){return this.el.bt()}Sr(){return{x:this.el.Vl(),y:this.el.zl()}}hF(){if(!this.sF){const t=new gd(this.En);this.sF=De(t,this.sF,(()=>[t.jT((()=>this.Ji.us.bs())),t.ZT((()=>this.Ji.us.bs()))])),this.el.eF(t)}return this.sF.Wt}attach(t,e=!0,i=!1){super.attach(t,e,i);const s=this.getPointFillStyle(),r=this.getAreaFillStyle();return he(t,this.qi,i,{stroke:this.getStrokeStyle(),fill:s!==B?s:r}),super.attach(t,e)}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e,i=this.mx){void 0!==this.getCurvePreprocessing()&&(i=!1);const s=this.uT(),r=ut(t,this.Ji.us.dt,this.scale),n=!e||this.el.getIsUnderMouse()?s.gg(r,i,this.scale,this.Ji.pixelScale):void 0;if(void 0!==n){const t=[this.getStrokeStyle().getFillStyle(),this.getPointFillStyle(),this.getAreaFillStyle()];return ga(n,this.scale,this.xp(new Kh,this,n).fc(),this,t.filter((t=>!_(t)))[0])}}solveNearestFromScreen(t,e=!1){return this.gg(jo(t,this.Ji.us),!1,e)}}const vd=(t,e,i)=>(t.addRow(e.getName()).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),Md=(...t)=>(e,i)=>t.forEach((t=>t.forEach((t=>{t.dt.q(e),t.hA.q(i)})))),Td=(t,e)=>{const i=t.indexOf(e);-1!==i&&t.splice(i,1)},wd=u(10,10);var Ed;e.AxisPosition=void 0,(Ed=e.AxisPosition||(e.AxisPosition={}))[Ed.Top=0]="Top",Ed[Ed.Bottom=1]="Bottom",Ed[Ed.Left=2]="Left",Ed[Ed.Right=3]="Right";const kd=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),Cd=t=>t.vr(),Dd=t=>t.setStopped(!0),Fd=t=>t.getChartInteractionFitByDrag()?t.fit(!0):void 0,Id=(t,e)=>{const i="linear-highPrecision"===t.wh.type||"linear-highPrecision"===e.wh.type,s="logarithmic"===t.wh.type||"logarithmic"===e.wh.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.wh.type}, y: ${e.wh.type})`;throw new Error(i)}};var Ld,zd,Vd;!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"}(Ld||(Ld={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(zd||(zd={}));class Pd extends Za{constructor(t,i,s,r,n,o,h){super(t,i,s,i.sg("chartXY bg",0),r,i.us.qi.chartXYBackgroundFillStyle,i.us.qi.chartXYBackgroundStrokeStyle,i.us.qi.chartXYTitleFont,i.us.qi.chartXYTitleFillStyle,h),this.cT=this.GA.d2({scaleXYConstructor:zi}),this.fF=[],this.AF=[],this.gF=[],this.pF=[],this.mF=new Map,this.yF=!0,this.SF=!0,this.vF=!0,this.Ed=2,this.xF=!0,this.bF=!0,this.MF=[],this._F=this.hg.Te(this.cT).ke(B).Ce(rt).setMouseInteractions(!1),this.wF=this.hg.Ve(this.cT).Ee(rt).setMouseInteractions(!1),this.CF=this.hg.Ve(this.cT).Ee(rt).setMouseInteractions(!1),this.kF=this.qi.chartXYZoomingRectangleFillStyle,this.TF=this.qi.chartXYZoomingRectangleStrokeStyle,this.FF=this.qi.chartXYFittingRectangleFillStyle,this.IF=this.qi.chartXYFittingRectangleStrokeStyle,this.PF=e.MouseStyles.Default,this.DF=e.MouseStyles.Move,this.BF=e.MouseStyles.ZoomIn,this.LF=e.MouseStyles.Default,this.RF=void 0,this.EF=Rd,this.pb=0,this.vp=e.AutoCursorModes.snapToClosest,this.VF=Md(this.AF,this.fF),this.zF=Md(this.gF,this.pF),this.OF=(t,e,i,s,r)=>{this.VF(s,r),this.zF(r,s),this.cT.q(s,r);const n=this.AF.map((t=>t.TA())),o=this.fF.map((t=>t.TA())),h=this.gF.map((t=>t.TA())),a=this.pF.map((t=>t.TA())),l=n.reduce(Ne,0),c=o.reduce(Ne,0),d=h.reduce(Ne,0),f=a.reduce(Ne,0),g=this.NF(d,f,c,l),y=this.cT.x.getCellSize()-(g.left+g.right),m=this.cT.y.getCellSize()-(g.bottom+g.top),p=[g.left,g.right],A=[g.bottom,g.top];this.cT.x.J(0,y),this.cT.y.J(0,m),this.cT.Ei(p),this.cT.Vi(A),this.uy.q(u(y,m));for(let t=0;t{this.mF.set(t,e)},this.Kf=t=>{this.AF.includes(t)?Td(this.AF,t):this.fF.includes(t)?Td(this.fF,t):this.gF.includes(t)?Td(this.gF,t):this.pF.includes(t)&&Td(this.pF,t),this.mF.delete(t),this.us.bs()},this.WF=(t=!1)=>{const e=t=>(e,i,s,r)=>(i.Fe(e,s,r.length),e+i.TA()*t),i=this.AF.reduce(e(-1),0),s=this.fF.reduce(e(1),0),r=this.gF.reduce(e(-1),0),n=this.pF.reduce(e(1),0),o=this.NF(r,n,s,i),h=this.cT.x.getCellSize()-(o.left+o.right),a=this.cT.y.getCellSize()-(o.bottom+o.top),l=[o.left,o.right],c=[o.bottom,o.top];this.cT.x.J(0,h),this.cT.y.J(0,a),this.cT.x.si(l),this.cT.y.si(c);for(const t of this.AF)t.dt.si(l);for(const t of this.fF)t.dt.si(l);for(const t of this.gF)t.dt.si(c);for(const t of this.pF)t.dt.si(c);if((!this.AM||Math.abs(this.AM.bottom-i)>=4||Math.abs(this.AM.left-r)>=4||Math.abs(this.AM.right-n)>=4||Math.abs(this.AM.top-s)>=4)&&!t)return void this.WF(!0);this.AM={bottom:i,left:r,top:s,right:n},this.uy.Ie(u(0,0)).q(u(h,a)),this.Ay.Ie(u(0,0)).q(u(h,a));const d=this.getDefaultAxisX(),f=this.getDefaultAxisY();if(!d||!f)return;const g=m(d.dt.ei(),f.dt.ei(),d.dt.ri(),f.dt.ri());this.yv.ES(g),this.Qf.ES(g),this.Jf.ES(g),this.LA&&this.LA();const y=t=>(e,i,s,r)=>(i.kA(e),e+i.TA()*t);return this.AF.reduce(y(-1),0),this.fF.reduce(y(1),0),this.gF.reduce(y(-1),0),this.pF.reduce(y(1),0),g},this.addAreaSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();Id(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Kc.Positive)(this,this.ey,this.yv,e,i,this.UF(e),this.UF(i),this.YA,s,this.qi,this.us.es,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length);return this.gy(r),r},this.addAreaRangeSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();Id(e,i);const s=new td(this,this.ey,this.yv,e,i,this.UF(e),this.UF(i),this.YA,this.qi,this.us.es,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length);return this.gy(s),s},this.YF=!1,this.HF=!1,this.yb=()=>{(this.yF||this.SF)&&(this.RF=this.engine.setMouseStyle(this.PF))},this.Sb=()=>{this.YF=!1,this.engine.restoreMouseStyle(this.RF)},this.vb=(t,e,i)=>{var s,r;const n=Dt(null===(s=this.fs.no)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Dt(null===(r=this.fs.no)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.RF);const h=this.hg.us.De(e.clientX,e.clientY);i===n&&(this.yF||this.SF)?(this.$F(t,h),$t(e)):i===o&&this.xF&&(this.RF=this.engine.setMouseStyle(this.DF),this.HF=!0,$t(e))},this.Vm=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=Dt(null===(n=this.fs.no)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=Dt(null===(o=this.fs.no)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.yF||this.SF)?(this.XF(t,s,h),$t(e)):i===l&&this.xF&&(this.jF(si(r,-1)),$t(e)),this.us.bs()},this.xb=(t,e,i,s)=>{var r,n;const o=Dt(null===(r=this.fs.no)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=Dt(null===(n=this.fs.no)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.yF||this.SF)){const i=u(e.clientX,e.clientY);this.ZF(t,s,i),$t(e)}else i===h&&this.xF&&$t(e);this.engine.restoreMouseStyle(this.RF),this.uy.getIsUnderMouse()&&(this.RF=this.engine.setMouseStyle(this.PF)),this.YF=!1,this.HF=!1},this.Em=(t,e)=>{if(this.vF){const t=this.hg.us.De(e.clientX,e.clientY);this.QF(t,u(de(e),de(e))),$t(e)}},this.JF=(t,e,i,s)=>{},this.KF=(t,e,i,s,r,n)=>{if(this.xF){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.jF(t),$t(n),this.HF=!0}if(this.vF){const t=this.engine.clientLocation2Engine(e.x,e.y),o=this.engine.clientLocation2Engine(i.x,i.y),h=ni(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.St(t.dt.pi(t.getInterval().start,-h.x),t.dt.pi(t.getInterval().end,h.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.St(t.dt.pi(t.getInterval().start,-h.y),t.dt.pi(t.getInterval().end,h.y),!1,!0,"interactionZoom")})),$t(n),this.YF=!0}},this.qF=(t,e,i,s)=>{this.HF=!1,this.YF=!1},this.tI=(t,e,i)=>{(this.SF||this.yF)&&(this.$F(t,e),$t(i))},this.iI=(t,e,i,s,r)=>{(this.SF||this.yF)&&(this.XF(t,e,i),$t(r))},this.sI=(t,e,i,s)=>{(this.SF||this.yF)&&(this.ZF(t,e,i),$t(s))},this.fs.zn||this.fs.Vn||this.fs.Kn||this.us.As(0),this.setPadding({right:24}),this.oM=i.YS("chartXY series bg",Ld.seriesBackground),this.eI=[Ld.gridLine0,Ld.gridLine1,Ld.gridLine2].map((t=>i.YS(`chartXY gridline #${t}`,t))),this.Qf=i.YS("chartXY highlighters below",Ld.highlightersBelow),this.yv=i.wp("chartXY plotting",zd.plotting),this.Jf=i.wp("chartXY highlighters above",zd.highlightersAbove),this.vf=i.wp("chartXY fg",zd.fg),this.cT.x.J(0,this.uiScale.x.getCellSize()-(this.Xt.left+this.Xt.right+this.Da.left+this.Da.right)),this.cT.y.J(0,this.uiScale.y.getCellSize()-(this.Xt.bottom+this.Xt.top+this.Da.bottom+this.Da.top)),this.cT.q(this.uiScale.oi().x,this.uiScale.oi().y),this.uy=this.oM.Te(this.cT).ke(this.qi.chartXYSeriesBackgroundFillStyle).Ce(rt),this.Ay=this.vf.Te(this.cT).ke(B).Ce(this.qi.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.ly(this.uy,this.Ay),this.setSeriesBackgroundEffect(!1),this.kp=i.Tp();const a=Dt(o?o.autoCursorBuilder:void 0,Jl);this.Ag=a.$g(this.kp,this.cT,this.cT,this.qi),Hh.pg(this),this.yy(((t,e)=>{Hh.mg(this,e)})),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.OF),this.ng.Bh("ChartXY"),this.zm=Yi(new Xi(this.tI,this.iI,this.sI,1),new $i(this.JF,this.KF,this.qF)),this.onSeriesBackgroundMouseEnter(this.yb),this.onSeriesBackgroundMouseLeave(this.Sb),this.onSeriesBackgroundMouseWheel(this.Em),this.onSeriesBackgroundMouseDragStart(this.vb),this.onSeriesBackgroundMouseDrag(this.Vm),this.onSeriesBackgroundMouseDragStop(this.xb),this.onSeriesBackgroundTouchStart(this.zm.onTouchStart),this.onSeriesBackgroundTouchMove(this.zm.onTouchMove),this.onSeriesBackgroundTouchEnd(this.zm.onTouchEnd),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.ig(n,this.cT)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}solveNearest(t){const e=t||this.us.Bn();if(e)return Hh.gg(this,jo(e,this.us),this.iy)}getMinimumSize(){const t={x:0,y:0};t.x+=this.Xt.left+this.Xt.right+this.Da.left+this.Da.right,t.y+=this.Xt.top+this.Xt.bottom+this.Da.top+this.Da.bottom;const e=this.ng.Ds().Cc(),i=S(Bd(this.EF||Rd),this.eg);t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom;const s={x:0,y:0};return this.forEachAxisX((t=>{s.x=Math.max(s.x,t.TA())})),this.forEachAxisY((t=>{s.y=Math.max(s.y,t.TA())})),t.x+=s.x,t.y+=s.y,t.x+=wd.x,t.y+=wd.y,t}addChartMarkerXY(t=Zl,e,i){const s=this.YA(),r=new su(s,this.uiScale,e||this.getDefaultAxisX(),i||this.getDefaultAxisY(),t,this.OA(s),this.qi);return this.KA(r),r}addAxisX(t){const{opposite:e,type:i}=qo(t);let s;s="linear"===i.type?this.GA.d1({dimension:"x",scale1DConstructor:Fi}):"linear-highPrecision"===i.type?this.GA.d1({dimension:"x",scale1DConstructor:Fi}).Mi():this.GA.d1({dimension:"x",scale1DConstructor:bi}).Ai(i.base),s.q(this.cT.x.oi());const r=e?this.fF:this.AF,n=new Qo(this.Qf,this.eI,this.vf,this.hg,this.Qf,this.Jf,this.us.es,s,this.cT.y,(o=()=>n.vA(),{...th,...lc(o)}),this,e?100:0,this.Kf,this.GF,this.qi,this.th,i);var o;return r.push(n),this.us.bs(),n}addAxisY(t){const{opposite:e,type:i}=qo(t);let s;s="linear"===i.type?this.GA.d1({dimension:"y",scale1DConstructor:Fi}):"linear-highPrecision"===i.type?this.GA.d1({dimension:"y",scale1DConstructor:Fi}).Mi():this.GA.d1({dimension:"y",scale1DConstructor:bi}).Ai(i.base),s.q(this.cT.y.oi());const r=e?this.pF:this.gF,n=new Qo(this.Qf,this.eI,this.vf,this.hg,this.Qf,this.Jf,this.us.es,s,this.cT.x,(o=()=>n.vA(),{...eh,...uc(o)}),this,e?100:0,this.Kf,this.GF,this.qi,this.th,i);var o;return r.push(n),this.us.bs(),n}dispose(){return this.Ag.dispose(),this.oM.W(),this.yv.W(),this.vf.W(),this.eI.forEach((t=>t.W())),this.Jf.W(),this.Qf.W(),this.kp.W(),this.jC().forEach((t=>t.dispose())),Oh(this.cT),this.forEachAxis((t=>{t.dispose()})),this.iy.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){return[...this.AF,...this.fF].find((t=>t.getVisible()))}getDefaultAxisY(){return[...this.gF,...this.pF].find((t=>t.getVisible()))}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):kd;return Ct(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.fF;case e.AxisPosition.Bottom:return this.AF;case e.AxisPosition.Left:return this.gF;case e.AxisPosition.Right:return this.pF}})))}hI(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.AF.slice().forEach(t),this.fF.slice().forEach(t)}forEachAxisY(t){this.gF.slice().forEach(t),this.pF.slice().forEach(t)}setTitlePosition(t){return this.EF=t,this.us.bs(),this}getTitlePosition(){return this.EF}NF(t,e,i,s){const r=this.EF||Rd;let n,o=S(Bd(r),this.eg);this.getTitleFillStyle()===B||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.ng.Ds().Cc();const h=Math.abs(s)+this.Da.bottom+this.Xt.bottom,a=Math.abs(i)+this.Da.top+this.Xt.top,l={left:Math.abs(t)+this.Da.left+this.Xt.left,right:Math.abs(e)+this.Da.right+this.Xt.right,top:a,bottom:h},u=this.uiScale.Wi(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=_d(r,u,l,n,o,this.Da);return this.ng.Ie(f).Xa(c).Za(d),g}Fe(t){super.Fe(t);for(const t of this.iy)t.Gm();for(const t of this.iy)t.Fe();this.forEachAxis(Cd);let e=!1;this.forEachAxis((t=>{(t.wr()||t.Cr())&&(e=!0)}));const i=this.YF||this.HF||!this.bF&&e;Hh.dg(this,this.uy.getIsUnderMouse(),i,this.iy,(t=>Hh.gg(this,t,this.iy)),((t,e)=>t.gg(e,!0))),this.WF(),super.tg();for(const t of this.iy)t.$p()}j(){for(let t=0;t=10;n&&a&&h.x===s.x&&this.SF?(this.YF=!0,this._F.ke(this.FF).Ce(this.IF),this.wF.Ee(this.IF).Oe(s).ze(r),this.CF.Ee(this.IF).Oe(u(s.x,r.y)).ze(u(r.x,s.y)),this.RF=this.engine.setMouseStyle(this.LF,this.RF)):n&&a&&(this.yF||this.SF)?(this.YF=!0,this._F.ke(this.kF).Ce(this.TF),this.wF.Ee(rt),this.CF.Ee(rt),this.RF=this.engine.setMouseStyle(this.BF,this.RF)):(this.YF=!1,this._F.Ce(rt).ke(B),this.wF.Ee(rt),this.CF.Ee(rt),this.engine.restoreMouseStyle(this.RF)),this.us.bs()}ZF(t,e,i){if(this.YF){const t=ut(this.engine.clientLocation2Engine(i.x,i.y),this.hg.us.dt,this.cT),s=Ge(t.x,this.cT.x.getInnerStart(),this.cT.x.getInnerEnd())&&Ge(t.y,this.cT.y.getInnerStart(),this.cT.y.getInnerEnd()),r=i.x>=e.x||!this.SF?"zoom":"fit",n=this._F.Ya(),o=ri(n,this._F.oi()),h=Math.min(this._F.oi().x,this._F.oi().y)>=10;s&&h&&"zoom"===r&&this.yF?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=ut(n,this.cT,t.rA).x,i=ut(o,this.cT,t.rA).x;t.St(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=ut(n,this.cT,t.rA).y,i=ut(o,this.cT,t.rA).y;t.St(e,i,!0,!0,"interactionSetInterval")}}))):s&&h&&"fit"===r&&this.SF&&this.forEachAxis(Fd)}this._F.Ce(rt).ke(B),this.wF.Ee(rt),this.CF.Ee(rt),this.us.bs()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}jF(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(Dd),this.forEachAxisX((i=>{i.zoom(i.dt.ut(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.dt.ut(t.y),e.y)}))}QF(t,e){this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&(Dd(i),i.zoom(i.dt.ut(t.x),e.x))})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&(Dd(i),i.zoom(i.dt.ut(t.y),e.y))}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}Sd(){const t=[];return this.forEachAxis((e=>e.pA((e=>t.push(e))))),super.Sd().concat(t)}jC(){return this.MF}me(){return this.ag(this.yv)}setAutoCursorEnabledDuringAxisAnimation(t){return this.bF=t,this}getAutoCursorEnabledDuringAxisAnimation(){return this.bF}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,r=e,n=ih(r)?r:_i(r)?this.pixelScale:void 0;if(n&&Ri(i)){const t=ut(s,n,this.engine.scale);return this.us.Xo({engineX:t.x,engineY:t.y})}if(n&&_i(i))return ut(s,n,this.pixelScale);if(n&&ih(i))return ut(s,n,i)}else{const i=t;if(_i(e)){const t=this.us.$o(i);return ut({x:t.engineX,y:t.engineY},this.engine.scale,this.pixelScale)}if(ih(e)){const t=e,s=this.us.$o(i);return ut({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,(Vd=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",Vd.RightTop="right-top",Vd.LeftTop="left-top",Vd.CenterBottom="center-bottom",Vd.RightBottom="right-bottom",Vd.LeftBottom="left-bottom",Vd.SeriesCenterTop="series-center-top",Vd.SeriesRightTop="series-right-top",Vd.SeriesLeftTop="series-left-top",Vd.SeriesCenterBottom="series-center-bottom",Vd.SeriesRightBottom="series-right-bottom",Vd.SeriesLeftBottom="series-left-bottom";const Rd=e.ChartXYTitlePositionOptions.CenterTop,Bd=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 Se(0,`Unexpected ChartXY title position selection ${t}`)},_d=(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 Se(0,`Unexpected ChartXY title position selection ${t}`)},Od=(t,e)=>{const i=Math.floor(99999/e),s=Math.floor(99999/e),r=Math.floor(99998/e),n=Math.floor(99999/(e+1)),o=Math.floor(89999/(e+1)),h=410001+e*o;let a=0;return{rI:()=>{const e=t.nI("dashboard ui",h+a);return a+=1,e},oI:()=>t.nI("dashboard legend",41e4),aI:e=>{const h=1+e*i,a=100001+e*s,l=200002+e*r,u=300001+e*n,c=410001+e*o;let d=0;return{us:t,sg:(e,i)=>{const s=h+i;return t.nI(e,s)},YS:(e,i)=>{const s=a+i;return t.nI(e,s)},wp:(e,i)=>{const s=l+i;return t.nI(e,s)},US:(e,i,s)=>{const r=l+i;return t.lI(e,r,s)},rg:(e,i)=>{const s=u+i;return t.nI(e,s)},HA:e=>{const i=c+d,s=t.nI(e,i);return d+=1,s},XA:()=>t.nI("panel legend",400002+e),Tp:()=>t.nI("panel cursor",500001+e)}}}};class Nd{constructor(t){this.D=new r.Eventer,this.S=t}M(t){return this.S=t,this.D.emit("set",t),this}_(){return this.S}O(t){return this.D.on("set",t)}G(t){return this.D.off(t,"set")}}const Ud={uh:()=>{},ih:!1,sh:0,eh:!1,rh:0,hh:!1,oh:0,ah:0,Je:Rs.fitting},Gd=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&&Kd(t,e,u,n,o,h),"spark-bar"===a&&Qd({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&Qd({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&tf(t,e,u,n,o,h),"spark-pie"===a&&ef(t,e,u,n,o,h)},Yd=(t,e,i,s)=>({x:Xd(t.x,e.x,i.x,s),y:$d(t.y,e.y,i.y,s)}),Hd=(t,e,i,s)=>({position:Xd(t.position,e.x,i.x,s),high:$d(t.high,e.y,i.y,s),low:$d(t.low,e.y,i.y,s)}),Xd=(t,e,i,s)=>{const r=kt(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},$d=(t,e,i,s)=>{const r=kt(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&&Jd(a,i,r,n,o,h),"constant-line"===a.type&&Zd(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=Yd(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().Nt().Sl(void 0!==u?u:e.PointShape.Circle).zh(d||0).q(c||5).ke(l||h.sparkPointChartFillStyle)._l(f)},Jd=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(Le,Ie),f=u(Le,Ie);"x"===o&&(d=Yd({x:h,y:Le},e,i,s),f=Yd({x:a,y:Ie},e,i,s)),"y"===o&&(d=Yd({x:Le,y:h},e,i,s),f=Yd({x:Ie,y:a},e,i,s));const g=s[0],y=s[1],m=kt(d.x,g.x,g.x+y.x),p=kt(d.y,g.y,g.y+y.y),A=kt(f.x,g.x,g.x+y.x),x=kt(f.y,g.y,g.y+y.y);r.rect.add().Fl(m).Il(p).q(u(A-m,x-p)).ke(l||n.sparkChartBandFillStyle).Ce(c||n.sparkChartBandStrokeStyle).Ce(rt)},Zd=(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=Yd(u(g,c),{x:g,y:d},s,r),e=Yd(u(y,c),{x:g,y:d},s,r);m.push([t,e])}if("x"===h&&g<=c&&c<=y){const t=Yd(u(c,d),{x:g,y:d},s,r),e=Yd(u(c,f),{x:g,y:d},s,r);m.push([t,e])}m.length>0&&n.line.add().Ee(l||o.sparkChartConstantLineStrokeStyle).Oe(m[0][0]).ze(m[0][1])},Kd=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.oo&&St.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=Ie,c=Le,d=Ie,f=Le;for(let t=0;tYd(t,{x:u,y:d},g,i)));e.lineSet.add().cs(n).Ee(o||s.sparkLineChartStrokeStyle).Nt()._l(y),a&&jd(a,y,{x:u,y:d},{x:c,y:f},g,i,e,s)},Qd=(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=Ie,A=Le;if(g)p=-1,A=1;else for(const t of o)p=Math.min(p,t),A=Math.max(A,t);const x={x:0,y:g?-1:Math.min(0,p)},S={x:1*o.length+(o.length-1)*m,y:g?2:Math.max(A,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*m,y:g?t>=y?1:0:t},r=Yd({x:1*e+e*m,y:g?t>=y?0:-1:0},x,S,i),n=Yd(s,x,S,i);return{value:t,position:r,width:n.x-r.x,height:n.y-r.y}})).forEach((t=>{var i;e.rect.add().cs(n).Ie(t.position).Dl(t.height).Pl(t.width).ke((i=t.value,g?(i>=y?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).Ce(a||s.sparkBarChartStrokeStyle)}))},tf=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.oo&&St.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=Ie,f=Le,g=Ie,y=Le;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=Yd(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().cs(n).Ie(d).xu(g)._u(0).vu(y).ze(y+r).ke(l[i]||ce(s.sparkPieChartFillStyle,i)).Ce(h||s.sparkPieChartStrokeStyle),y+=r}))};var sf,rf,nf;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(sf||(sf={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(rf||(rf={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(nf||(nf={}));class of extends cn{constructor(t,e,i,s,r){super(),this.Bs=!1,this.Ow={x:0,y:0,height:20,width:20},this.uI={x:10,y:10},this.Ts=t,this.cI=r,this.dI=new no(t,e,i,wt,s).setMouseInteractions(!0),this.fI=t.vc(e,nn.Simple).ke(s.dataGridScrollBarButtonArrowFillStyle).Ce(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.Ou(this),this.dI.onMouseEnter((t=>t.setHighlight(1))),this.dI.onMouseLeave((t=>t.setHighlight(0)))}AI(){switch(this.cI){case nf.Up:this.fI.Rl([{x:this.Ow.x,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y-this.uI.y/2},{x:this.Ow.x-this.uI.x/2,y:this.Ow.y-this.uI.y/2}]);break;case nf.Down:this.fI.Rl([{x:this.Ow.x-this.uI.x/2,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x,y:this.Ow.y-this.uI.y/2}]);break;case nf.Left:this.fI.Rl([{x:this.Ow.x-this.uI.x/2,y:this.Ow.y},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y-this.uI.y/2}]);break;case nf.Right:this.fI.Rl([{x:this.Ow.x-this.uI.x/2,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y},{x:this.Ow.x-this.uI.x/2,y:this.Ow.y-this.uI.y/2}])}}Ie(t){return this.Ow.x=t.x,this.Ow.y=t.y,this}Ya(){return u(this.Ow.x,this.Ow.y)}q(t){return this.Ow.height=t.x,this.Ow.width=t.y,this}oi(){return{x:this.Ow.height,y:this.Ow.width}}onMouseDown(t){return this.dI.onMouseDown(t)}onMouseUp(t){return this.dI.onMouseUp(t)}setFillStyle(t){return this.dI.setFillStyle(t),this}getFillStyle(){return this.dI.getFillStyle()}setStrokeStyle(t){return this.dI.setStrokeStyle(t),this}getStrokeStyle(){return this.dI.getStrokeStyle()}Fe(){return this.dI.Fe(),this.AI(),this}Ds(){return this.dI.setSize(u(this.Ow.height,this.Ow.width)).setPosition(u(this.Ow.x,this.Ow.y)),this}setVisible(t){return this.dI.setVisible(t),this.fI.setVisible(t),this}dispose(){return this.dI.dispose(),this.fI.dispose(),this}setMouseInteractions(t){return this.dI.setMouseInteractions(t),this}getMouseInteractions(){return this.dI.getMouseInteractions()}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}getHighlight(){return this.dI.getHighlight()}setHighlight(t){return this.dI.setHighlight(Ae(t)),this.D.emit("highlight",this,Boolean(t)),this.Ts.bs(),this}}const hf=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class af{constructor(t,i,s,n,o,h,a){this.Ic={x:0,y:0},this.Ow={x:0,y:0,height:0,width:0},this.D=new r.Eventer,this.gI={min:u(0,0),max:u(0,0)},this.qx=!1,this.tb=!1,this.pI={x:0,y:0},this.Gu=void 0,this.mI=u(0,0),this.yI={x:0,y:0},this.SI=0,this.vI=15,this.ib=(t,i)=>{this.qx=!0,this.vf.bs();const s=this.xI.getDraggingMode();this.Gu=this.vf.us.Er(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.bI&&clearInterval(this.bI)},this.sb=()=>{this.qx=!1,this.vf.bs(),this.vf.us.Vr(this.Gu)},this.eb=t=>(this.tb=!0,this.pI=ut(this.vf.us.De(t.x,t.y),this.vf.us.dt,this.scale),!0),this.MI=(t,e)=>(this._I(e),this.bI=setInterval((()=>this._I(e)),300),!0),this.wI=()=>(clearInterval(this.bI),!0),this.hb=(t,i)=>{const s=this.xI.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=ut(this.vf.us.De(t.x,t.y),this.vf.us.dt,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?hf(n.x,this.scale.x):this.Ow.x,r!==e.UIDraggingModes.onlyHorizontal?hf(n.y,this.scale.y):this.Ow.y),h=u(o.x-this.pI.x,o.y-this.pI.y),a=u(this.xI.getPosition().x+h.x,this.xI.getPosition().y+h.y),l=this.CI(a),c={x:Math.abs(this.mI.x-l.x),y:Math.abs(this.mI.y-l.y)};return this.kI(c),this.yI.y>h.y&&(this.pI=n),this.Fe(),!0}return!1},this.rb=(t,e)=>{this.tb=!1,$t(e),this.vf.bs()},this.vf=t,this.zA=i,this.scale=n,this.contentScale=o,this.TI=a,this.FI=new of(t,s,n,h,a===sf.UpToDown?nf.Up:nf.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.II=new of(t,s,n,h,a===sf.UpToDown?nf.Down:nf.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.xI=new no(t,s,n,wt,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===sf.UpToDown?e.UIDraggingModes.onlyVertical:a===sf.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.DI=new no(i,s,n,wt,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.xI.onMouseEnter(this.ib),this.xI.onMouseLeave(this.sb),this.xI.onMouseDragStart(((t,e)=>this.eb(u(e.clientX,e.clientY))&&$t(e))),this.xI.onMouseDrag(((t,e)=>this.hb(u(e.clientX,e.clientY))&&$t(e))),this.xI.onMouseDragStop(this.rb),this.xI.onTouchStart(((t,e)=>this.eb(u(e.clientX,e.clientY))&&$t(e))),this.xI.onTouchMove(((t,e)=>this.hb(u(e.clientX,e.clientY))&&$t(e))),this.xI.onTouchEnd(this.rb),this.FI.onMouseDown(((t,e)=>this.MI(t,e)&&$t(e))),this.II.onMouseDown(((t,e)=>this.MI(t,e)&&$t(e))),this.FI.onMouseUp(((t,e)=>this.wI()&&$t(e))),this.II.onMouseUp(((t,e)=>this.wI()&&$t(e))),this.DI.onMouseWheel(((t,e)=>this.BI(e))),this.xI.onMouseWheel(((t,e)=>this.BI(e))),this.DI.onMouseDown(((t,e)=>this.MI(t,e)&&$t(e))),this.DI.onMouseUp(((t,e)=>this.wI()&&$t(e)))}LI(t){return this.Ow=t,this}Pl(t){return this.Ow.width=t,this}RI(){return this.Ow.width}EI(t){return this.mI=t,this}VI(t){return this.Ic=t,this}zI(){return this.Ic}OI(t){return this.vI=t,this}NI(){return this.TI}GI(t){let e;switch(this.TI){case sf.UpToDown:return e=t>0?Math.min(this.mI.y-this.gI.max.y,this.yI.y+t):Math.max(0,this.yI.y+t),e!==this.yI.y&&(this.kI({x:0,y:e}),this.Fe(),!0);case sf.LeftToRight:return e=Math.min(this.gI.max.x-this.mI.x,this.yI.x+t),e!==this.yI.x&&(this.kI({y:0,x:e}),this.Fe(),!0);default:return!1}}WI(t){let e;switch(this.TI){case sf.UpToDown:return e=Math.max(0,this.yI.y-t),e!==this.yI.y&&(this.kI({x:0,y:e}),this.Fe(),!0);case sf.LeftToRight:return e=t>0?Math.max(0,this.yI.x-t):Math.min(this.gI.max.x-this.mI.x,this.yI.x-t),e!==this.yI.x&&(this.kI({x:e,y:0}),this.Fe(),!0);default:return!0}}UI(t){switch(this.TI){case sf.UpToDown:return this.D.on("scrollY",t);case sf.LeftToRight:return this.D.on("scrollX",t)}return this.D.on("scrollY",t)}CI(t){switch(this.TI){case sf.UpToDown:if(t.y>this.gI.min.y)return u(t.x,this.gI.min.y);if(t.ythis.gI.max.x)return u(this.gI.max.x,t.y)}return t}BI(t){t.deltaY>0&&this.YI()&&$t(t),t.deltaY<0&&this.HI()&&$t(t)}_I(t){const e=ut(this.vf.us.De(t.clientX,t.clientY),this.vf.us.dt,this.scale);let i;const s=this.xI.getPosition(),r=this.xI.getSize();this.$I(e,s,r)?clearInterval(this.bI):(i=this.TI===sf.UpToDown?u(0,e.y-s.y>0?this.vI:-this.vI):u(s.x-e.x>0?this.vI:-this.vI,0),(i.x>0||i.y>0)&&this.XI(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.jI(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}$I(t,e,i){return this.TI===sf.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.Ow.height?Math.min(this.mI.y-this.gI.max.y,this.yI.y+t):0,e!==this.yI.y&&(this.kI({x:0,y:e}),this.Fe(),!0)}case sf.LeftToRight:{const e=Math.min(this.gI.max.x-this.mI.x,this.yI.x+t);return e!==this.yI.x&&(this.kI({y:0,x:e}),this.Fe(),!0)}default:return!1}}HI(){return this.XI(this.vI)}YI(){return this.jI(this.vI)}kI(t){if(t.x===this.yI.x&&t.y===this.yI.y)return;let e;switch(this.yI=t,this.TI){case sf.UpToDown:e=this.yI.y*this.SI*this.contentScale.Wi().y,this.D.emit("scrollY",rf.Vertical,e),this.vf.us.bs();break;case sf.LeftToRight:e=this.yI.x*this.SI*this.contentScale.Wi().x,this.D.emit("scrollX",rf.Horizontal,e)}}setVisible(t){return this.FI.setVisible(t),this.II.setVisible(t),this.DI.setVisible(t),this.xI.setVisible(t),this}dispose(){return this.FI.dispose(),this.II.dispose(),this.DI.dispose(),this.xI.dispose(),this.bI&&clearInterval(this.bI),this}Ds(){switch(this.QI(),this.JI(),this.TI){case sf.UpToDown:this.FI.Ie({x:this.Ow.x,y:this.Ow.y+this.Ow.height-this.FI.oi().x/2}).q(u(this.Ow.width,this.Ow.width)).Ds(),this.II.Ie({x:this.Ow.x,y:this.Ow.y+10}).q(u(this.Ow.width,this.Ow.width)).Ds(),this.DI.setSize({x:this.Ow.width,y:this.Ow.height-2*this.FI.oi().x}).setPosition({x:this.Ow.x,y:this.Ow.y+this.II.oi().y+this.DI.getSize().y/2}),this.xI.setSize(u(this.Ow.width,this.KI())),this.mI={x:this.Ow.x,y:this.FI.Ya().y-this.FI.oi().y/2-this.xI.getSize().y/2},this.ZI({min:{x:this.Ow.x,y:this.FI.Ya().y-this.FI.oi().y/2-this.xI.getSize().y/2},max:{x:this.Ow.x,y:this.II.Ya().y+this.II.oi().x/2+this.xI.getSize().y/2}});break;case sf.LeftToRight:this.FI.Ie({x:this.Ow.x,y:this.Ow.y}).q(u(this.Ow.height,this.Ow.height)).Ds(),this.II.Ie({x:this.Ow.x+this.Ow.width-this.II.oi().x,y:this.Ow.y}).q(u(this.Ow.height,this.Ow.height)).Ds(),this.DI.setSize({y:this.Ow.height,x:this.Ow.width-2*this.FI.oi().y}).setPosition({x:this.Ow.x+this.FI.oi().x/2+this.DI.getSize().x/2,y:this.Ow.y}),this.xI.setSize(u(this.KI(),this.Ow.height)),this.mI={x:this.FI.Ya().x+this.FI.oi().x/2+this.xI.getSize().x/2,y:this.Ow.y},this.ZI({min:{x:this.FI.Ya().x+this.FI.oi().x/2+this.xI.getSize().x/2,y:this.Ow.y},max:{x:this.II.Ya().x-this.II.oi().x/2-this.xI.getSize().x/2,y:this.Ow.y}})}return this.qI(),this}QI(){switch(this.TI){case sf.UpToDown:this.tP()||this.setVisible(!1),this.tP()&&this.setVisible(!0);break;case sf.LeftToRight:this.iP()||this.setVisible(!1),this.iP()&&this.setVisible(!0)}}JI(){switch(this.TI){case sf.UpToDown:this.tP()||this.kI({x:0,y:0});break;case sf.LeftToRight:this.iP()||this.kI({x:0,y:0})}}tP(){return this.Ic.x>this.Ow.height}iP(){return this.Ic.y>this.Ow.width}KI(){switch(this.TI){case sf.UpToDown:return this.Ow.height*(this.Ow.height-2*this.FI.oi().x)/this.Ic.x;case sf.LeftToRight:return this.Ow.width*(this.Ow.width-2*this.FI.oi().y)/this.Ic.y;default:return 0}}qI(){switch(this.TI){case sf.UpToDown:this.SI=(this.Ic.x-this.Ow.height)/(this.gI.min.y-this.gI.max.y);break;case sf.LeftToRight:this.SI=(this.Ic.y-this.Ow.width)/(this.gI.max.x-this.gI.min.x)}}Fe(){switch(this.FI.Fe(),this.II.Fe(),this.DI.Fe(),this.TI){case sf.UpToDown:this.xI.setPosition({x:this.Ow.x,y:this.FI.Ya().y-this.FI.oi().y/2-this.xI.getSize().y/2-this.yI.y}).Fe();break;case sf.LeftToRight:this.xI.setPosition({y:this.Ow.y,x:this.FI.Ya().x+this.FI.oi().x/2+this.xI.getSize().x/2+this.yI.x}).Fe()}return this}}class lf{constructor(t,e,i,s,r,n,o){switch(this.vf=t,this.zA=e,this.scale=s,this.contentScale=r,o){case rf.Vertical:this.sP=this.eP(i,n,sf.UpToDown);break;case rf.Horizontal:this.hP=this.eP(i,n,sf.LeftToRight);break;case rf.Both:this.sP=this.eP(i,n,sf.UpToDown),this.hP=this.eP(i,n,sf.LeftToRight)}this.rP=Yi(new Xi(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.hP)||void 0===n?void 0:n.WI(s.x))&&$t(r),0!==s.y&&(null===(o=this.sP)||void 0===o?void 0:o.GI(s.y))&&$t(r)})))}eP(t,e,i){return new af(this.vf,this.zA,t,this.scale,this.contentScale,e,i)}RI(){return 20}VI(t){var e,i;return null===(e=this.sP)||void 0===e||e.VI(t),null===(i=this.hP)||void 0===i||i.VI(t),this}nP(t){var e;return null===(e=this.hP)||void 0===e||e.OI(t),this}oP(t){var e;return null===(e=this.sP)||void 0===e||e.OI(t),this}aP(t){const e=this.sP;return e&&e.BI(t),this}lP(t){return this.rP.onTouchStart(this,t),this}uP(t){return this.rP.onTouchMove(this,t),this}cP(t){return this.rP.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.hP)||void 0===e||e.UI(t),null===(i=this.sP)||void 0===i||i.UI(t),this}dispose(){var t,e;return null===(t=this.sP)||void 0===t||t.dispose(),null===(e=this.hP)||void 0===e||e.dispose(),this}Fe(){var t,e;return null===(t=this.sP)||void 0===t||t.Fe(),null===(e=this.hP)||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.sP)||void 0===t||t.LI({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.hP)||void 0===e||e.LI({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.sP)||void 0===i||i.Ds(),null===(s=this.hP)||void 0===s||s.Ds(),this}}class uf extends Gh{constructor(t,e,i,s,r,n){super(t,e,i,e.sg("dataGrid bg",0),s,e.us.qi.dataGridBackgroundFillStyle,e.us.qi.dataGridBackgroundStrokeStyle,e.us.qi.dataGridTitleFont,e.us.qi.dataGridTitleFillStyle,n),this.dP=[],this.fP=[],this.AP=[],this.gP=new Map,this.pP=!0,this.mP=!0,this.yP=!0,this.SP=!0,this.vP=!0,this.xP=!0,this.bP=!0,this.MP=!0,this._P=!0,this.wP=!0,this.CP=!0,this.kP=!0,this.TP=!0,this.FP=!0,this.IP=!0,this.PP=!0,this.DP=new Set,this.BP=new Set,this.LP=!0,this.RP=!0,this.EP=(t,e)=>{t.borders=void 0===e?yf:{...t.borders,...e},this.VP(t),this.kP=!0,this.us.bs()},this.VP=t=>{t.borders&&(!1===t.borders.top&&this.zP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.OP,bottom:!1}})),!1===t.borders.bottom&&this.zP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.OP,top:!1}})),!1===t.borders.left&&this.zP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.OP,right:!1}})),!1===t.borders.right&&this.zP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.OP,left:!1}})),!0===t.borders.top&&this.zP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.OP,bottom:!0}})),!0===t.borders.bottom&&this.zP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.OP,top:!0}})),!0===t.borders.left&&this.zP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.OP,right:!0}})),!0===t.borders.right&&this.zP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.OP,left:!0}})))},this.NP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseEnter,i,e)},this.GP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseLeave,i,e)},this.WP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseClick,i,e)},this.UP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDoubleClick,i,e)},this.YP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDown,i,e)},this.HP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseUp,i,e)},this.$P=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseMove,i,e)},this.XP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDrag,i,e)},this.jP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDragStart,i,e)},this.ZP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDragStop,i,e)},this.QP=(t,e)=>{const i=this.gP.get(t);i&&(this.D.emit(cf.cellMouseWheel,i,e),!e.defaultPrevented&&this.LP&&this.JP.aP(e))},this.KP=(t,e)=>{const i=this.gP.get(t);i&&(this.D.emit(cf.cellTouchStart,i,e),!e.defaultPrevented&&this.RP&&this.JP.lP(e))},this.qP=(t,e)=>{const i=this.gP.get(t);i&&(this.D.emit(cf.cellTouchMove,i,e),!e.defaultPrevented&&this.RP&&this.JP.uP(e))},this.tD=(t,e)=>{const i=this.gP.get(t);i&&(this.D.emit(cf.cellTouchEnd,i,e),!e.defaultPrevented&&this.RP&&this.JP.cP(e))},this.fs.Vn||this.fs.On||this.us.As(2),this.ng.Bh("Data Grid"),this.iD=i.d2({scaleXYConstructor:zi}),this.iD.x.tA=Ud,this.sD=i.d2({scaleXYConstructor:zi}),this.eD={x:0,y:0},this.hD=this.qi.dataGridTextFont,this.rD=this.qi.dataGridTextFillStyle,this.OP={top:!0,bottom:!0,left:!0,right:!0},this.nD=this.qi.dataGridCellBackgroundFillStyle,this.oD=this.qi.dataGridBorderStrokeStyle,this.aD="left-center",this.lD={left:5,right:5,bottom:5,top:5},this.uD=e.YS("dataGrid grid bg",0),this.cD=e.YS("dataGrid cell bg",1),this.dD=e.wp("dataGrid cell content",0),this.fD=e.wp("dataGrid scrollbar bg",1),this.AD=e.wp("dataGrid scrollbar fg",2),this.JP=this.gD(),this.onBackgroundMouseWheel(((t,e)=>{this.LP&&this.JP.aP(e)})),this.onBackgroundTouchStart(((t,e)=>{this.RP&&this.JP.lP(e)})),this.onBackgroundTouchMove(((t,e)=>{this.RP&&this.JP.uP(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.RP&&this.JP.cP(e)})),this.pD=this.uD.Te(this.iD).ke(this.qi.dataGridBackgroundFillStyle).Ce(rt).setMouseInteractions(!1),this.mD=this.dD._A(this.iD).setMouseInteractions(!1),this.yD=new Va((()=>this.cD.Te(this.iD).setMouseInteractions(!0).setMouseEnterEventHandler(this.NP).setMouseLeaveEventHandler(this.GP).setMouseClickEventHandler(this.WP).setMouseDoubleClickEventHandler(this.UP).setMouseDownEventHandler(this.YP).setMouseUpEventHandler(this.HP).setMouseMoveEventHandler(this.$P).setMouseDragEventHandler(this.XP).setMouseDragStartEventHandler(this.jP).setMouseDragStopEventHandler(this.ZP).setMouseWheelEventHandler(this.QP).setTouchStartEventHandler(this.KP).setTouchMoveEventHandler(this.qP).setTouchEndEventHandler(this.tD))),this.SD=new Va((()=>this.dD.Te(this.iD).setMouseInteractions(!1))),this.vD=new Va((()=>this.dD.kr(this.iD).setMouseInteractions(!1))),this.xD=new Va((()=>this.dD.zp(this.iD,{},[ka.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.bD=new Va((()=>this.dD.Ve(this.iD).setMouseInteractions(!1))),this.MD=new Va((()=>this.dD.Oc(this.iD).setMouseInteractions(!1))),this._D=new Va((()=>this.dD.Te(this.iD).setMouseInteractions(!1))),this.wD=new Va((()=>this.dD.yC(this.iD).setMouseInteractions(!1))),this.CD=new Va((()=>this.dD.Fc(this.iD).setMouseInteractions(!1))),this.ig(r,this.uiScale),this.onResize((()=>{this.pP=!0,this.us.bs(),this.iD.q(this.pixelScale.oi()),this.sD.q(this.pixelScale.oi())})),this.kD=this.es.gA([this.pD])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}Sd(){return[]}dispose(){return super.dispose(),this.uD.W(),this.cD.W(),this.dD.W(),this.fD.W(),this.AD.W(),Oh(this.iD),Oh(this.sD),this.JP.dispose(),this.vD.Zp(),this.yD.Zp(),this.SD.Zp(),this.xD.Zp(),this.bD.Zp(),this.MD.Zp(),this._D.Zp(),this.wD.Zp(),this.CD.Zp(),this}j(){return super.j(),this.iD.j(),this.sD.j(),this}Z(){return super.Z(),this.iD.Z(),this.sD.Z(),this}setBackgroundEffect(t){return this.kD.xs(t),this.us.bs(),this}getBackgroundEffect(){return this.kD.Ms()}setInteractionScrollOnWheel(t){return this.LP=t,this}getInteractionScrollOnWheel(){return this.LP}setInteractionPanOnTouch(t){return this.RP=t,this}getInteractionPanOnTouch(){return this.RP}onCellMouseEnter(t){return this.D.on(cf.cellMouseEnter,t)}offCellMouseEnter(t){return this.D.off(t)}onCellMouseLeave(t){return this.D.on(cf.cellMouseLeave,t)}offCellMouseLeave(t){return this.D.off(t)}onCellMouseClick(t){return this.D.on(cf.cellMouseClick,t)}offCellMouseClick(t){return this.D.off(t)}onCellMouseDoubleClick(t){return this.D.on(cf.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.D.off(t)}onCellMouseDown(t){return this.D.on(cf.cellMouseDown,t)}offCellMouseDown(t){return this.D.off(t)}onCellMouseUp(t){return this.D.on(cf.cellMouseUp,t)}offCellMouseUp(t){return this.D.off(t)}onCellMouseMove(t){return this.D.on(cf.cellMouseMove,t)}offCellMouseMove(t){return this.D.off(t)}onCellMouseDrag(t){return this.D.on(cf.cellMouseDrag,t)}offCellMouseDrag(t){return this.D.off(t)}onCellMouseDragStart(t){return this.D.on(cf.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.D.off(t)}onCellMouseDragStop(t){return this.D.on(cf.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.D.off(t)}onCellMouseWheel(t){return this.D.on(cf.cellMouseWheel,t)}offCellMouseWheel(t){return this.D.off(t)}onCellTouchStart(t){return this.D.on(cf.cellTouchStart,t)}offCellTouchStart(t){return this.D.off(t)}onCellTouchMove(t){return this.D.on(cf.cellTouchMove,t)}offCellTouchMove(t){return this.D.off(t)}onCellTouchEnd(t){return this.D.on(cf.cellTouchEnd,t)}offCellTouchEnd(t){return this.D.off(t)}setGridBackgroundFillStyle(t){return this.pD.ke(t),this.us.bs(),this}getGridBackgroundFillStyle(){return this.pD.Lh()}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.fP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.fP.splice(this.fP.indexOf(i),1):(i.min=e,i.max=e),this.xP=!0,this.us.bs(),this}setRowHeight(t,e){let i=this.AP.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.AP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.AP.splice(this.AP.indexOf(i),1):(i.min=e,i.max=e),this.xP=!0,this.us.bs(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.FD(t,(t=>this.ID(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.PD(t,(t=>this.ID(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=x(i,i,i,i)),this.zP(t,e,(t=>this.ID(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=x(t,t,t,t)),this.lD={...this.lD,...t},this.DD((t=>this.ID(t,this.lD))),this}setCellBorders(t,e,i){return this.zP(t,e,(t=>this.EP(t,i))),this}setRowBorders(t,e){return this.PD(t,(t=>this.EP(t,e))),this}setColumnBorders(t,e){return this.FD(t,(t=>this.EP(t,e))),this}setCellsBorders(t){return this.OP=void 0===t?yf:t,this.DD((t=>this.EP(t,this.OP))),this}setCellsBorderStrokeStyle(t){return this.oD="function"==typeof t?t(this.oD):t,this.FP=!0,this.us.bs(),this}setColumnTextFillStyle(t,e){return this.FD(t,(t=>this.BD(t,e))),this}setRowTextFillStyle(t,e){return this.PD(t,(t=>this.BD(t,e))),this}setCellTextFillStyle(t,e,i){return this.zP(t,e,(t=>this.BD(t,i))),this}setCellsTextFillStyle(t){return this.rD="function"==typeof t?t(this.rD):t,this.DD((t=>this.BD(t,this.rD))),this}setColumnTextFont(t,e){return this.FD(t,(t=>this.LD(t,e))),this}setRowTextFont(t,e){return this.PD(t,(t=>this.LD(t,e))),this}setCellTextFont(t,e,i){return this.zP(t,e,(t=>this.LD(t,i))),this}setCellsTextFont(t){return this.hD="function"==typeof t?t(this.hD):t,this.DD((t=>this.LD(t,this.hD))),this}setColumnContentAlignment(t,e){return this.FD(t,(t=>this.RD(t,e))),this}setRowContentAlignment(t,e){return this.PD(t,(t=>this.RD(t,e))),this}setCellContentAlignment(t,e,i){return this.zP(t,e,(t=>this.RD(t,i))),this}setCellsContentAlignment(t){return this.aD=t,this.DD((t=>this.RD(t,this.aD))),this}setCellBackgroundFillStyle(t,e,i){return this.zP(t,e,(t=>this.ED(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.FD(t,(t=>this.ED(t,e))),this}setRowBackgroundFillStyle(t,e){return this.PD(t,(t=>this.ED(t,e))),this}setCellsBackgroundFillStyle(t){return this.nD="function"==typeof t?t(this.nD):t,this.DD((t=>this.ED(t,this.nD))),this}setCellHighlight(t,e,i){return this.zP(t,e,(t=>{t.highlight=Ae(i)})),this.TP=!0,this.us.bs(),this}setColumnHighlight(t,e){const i=Ae(e);return this.FD(t,(t=>{t.highlight=i})),this.TP=!0,this.us.bs(),this}setRowHighlight(t,e){const i=Ae(e);return this.PD(t,(t=>{t.highlight=i})),this.TP=!0,this.us.bs(),this}removeCell(t,e){return this.zP(t,e,(t=>this.dP.splice(this.dP.indexOf(t),1))),this.vP=!0,this.us.bs(),this}removeRow(t){return this.PD(t,(t=>this.dP.splice(this.dP.indexOf(t),1))),this.dP.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.vP=!0,this.us.bs(),this}removeColumn(t){return this.FD(t,(t=>this.dP.splice(this.dP.indexOf(t),1))),this.dP.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.vP=!0,this.us.bs(),this}removeCells(){return this.dP.splice(0),this.vP=!0,this.us.bs(),this}getColumnMax(){return 0===this.dP.length?0:this.dP.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.dP.length?0:this.dP.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}Fe(t){super.Fe(t),Wh.cg(this.ng,this.eg),super.tg();const e=Math.round(this.oD.V()),i=e/2;let s=this.mP||this.yP||this.SP||this.vP||this.xP||this.bP||this.CP||this.kP||this.FP||this.PP;if(s){this.dP.forEach((t=>{this.BP.add(t.column)})),this.dP.forEach((t=>{this.DP.add(t.row)}));const t=this.vD.Xp(),r=this.VD(i,t);t.finishPlot();const n=this.zD(this.BP.size,r),o=this.OD(this.DP.size,r),h=n.reduce(Ne,0)+e,a=o.reduce(Ne,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.ND.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.ND={columnWidths:n,rowHeights:o,dataGridWidth:h,dataGridHeight:a,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:r}}const r=s||this.yP||this.SP||this.vP||this.MP||this._P||this.wP||this.kP||this.TP||this.FP||this.pP||this.PP;if((r||this.IP)&&this.ND){const t=this.pixelScale.getInnerIntervalPixels(),s=Wh.ug(this.ng,this.eg),n=[this.Da.left+i,this.Da.right+i],o=[this.Da.bottom+i,this.Da.top+s+i],h={x:t.x-n[0]-n[1],y:t.y-o[0]-o[1]},a=[this.Da.left,this.Da.right],l=[this.Da.bottom,this.Da.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.sD.Ei(n).Vi(o).zi(0,h.x).Oi(0,h.y),this.JP.VI({x:this.ND.dataGridHeight,y:this.ND.dataGridWidth}).Ds().Fe();const d={x:Math.round(this.eD.x),y:Math.round(Math.min(0,this.eD.y))};this.iD.Ei(a).Vi(l).zi(d.x,u.x+d.x).Oi(d.y,u.y+d.y),this.pD.Ie({x:c.x,y:c.y});const f={x:this.iD.x.ei(),y:this.iD.y.ei()+this.JP.RI(),width:this.iD.x.ri()+e-this.JP.RI(),height:this.iD.y.ri()+e};this.dD.ES(f),this.cD.ES(f),this.uD.ES(f);const g=this.ND,y=[{x:this.iD.x.getInnerStart(),y:this.iD.y.getInnerStart()},{x:this.iD.x.getInnerEnd(),y:this.iD.y.getInnerStart()},{x:this.iD.x.getInnerEnd(),y:this.iD.y.getInnerEnd()},{x:this.iD.x.getInnerStart(),y:this.iD.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=Be([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.GD(c,this.ND,e)}this.pP=!1,this.mP=!1,this.yP=!1,this.SP=!1,this.vP=!1,this.xP=!1,this.bP=!1,this.MP=!1,this._P=!1,this.wP=!1,this.CP=!1,this.kP=!1,this.TP=!1,this.FP=!1,this.IP=!1,this.PP=!1}VD(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.dP){const{content:r}=t,n={...this.lD,...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.Bh(i).Vh(t.textFont||this.hD).Ds().Cc()}if(Gd(r)&&(h=r,l={x:200,y:50}),to(r)){const t=this.us.WD(r);t.UD()?(a=r,l=a.oi()):t.YD((()=>{this.PP=!0,this.us.bs()}))}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}GD(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.pD.q(c),this.mD.Ee(this.oD),this.gP.clear();const d={cellBackground:this.yD.Xp(),cellIconRect:this.SD.Xp(),lineSet:this.xD.Xp(),line:this.bD.Xp(),pointSet:this.MD.Xp(),rect:this._D.Xp(),junction:this.wD.Xp(),arc:this.CD.Xp()},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]},A={x:p.x+y.left,y:p.y+y.bottom},x={x:A.x+g.left,y:A.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)},b={x:S.x-y.left-y.right,y:S.y-y.top-y.bottom},v={x:b.x-g.left-g.right,y:b.y-g.top-g.bottom};if(n){const t=gf(x,v,r.contentAlignment||this.aD);n.Ie(t[0]).Ja({x:t[1],y:t[2]}).ke(this.HD(r.textFillStyle||this.rD,r.content,this.rD)).cs(r.highlight)}const M=this.HD(r.backgroundFillStyle||this.nD,r.content);if(M!==B){const t=d.cellBackground.add();t.Ie(p).q(S).ke(M).Ce(rt).cs(r.highlight),this.gP.set(t,m)}const T=r.borders||this.OP;if(T&&ff(p,S,T,s,f),o){const t=x,e=v;Wd(o,d,this.iD,t,e,this.qi,this.fs,r.highlight)}if(c){const t=c.oi(),i=gf(x,v,r.contentAlignment||this.aD);d.cellIconRect.add().Ie({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).q(t).ke(new Xn({source:c.Mc,fitMode:e.ImageFitMode.Stretch})).Ce(rt).cs(r.highlight)}}this.mD.Nt();for(const t of f)this.mD.Lr().CA(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()}zD(t,e){const i=new Array(t).fill(0);for(const t of this.BP.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.fP.find((e=>e.column===t)),n=r?kt(s,void 0!==r.min?r.min:Le,void 0!==r.max?r.max:Ie):s;i[t]=n}return i}OD(t,e){const i=new Array(t).fill(0);for(const t of this.DP.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.AP.find((e=>e.row===t)),n=r?kt(s,void 0!==r.min?r.min:Le,void 0!==r.max?r.max:Ie):s;i[t]=n}return i}HD(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}BD(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.rD):e,this.wP=!0,this.us.bs()}LD(t,e){t.textFont="function"==typeof e?e(t.textFont||this.hD):e,this.CP=!0,this.us.bs()}ED(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.nD):e,this._P=!0,this.us.bs()}RD(t,e){t.contentAlignment=e,this.MP=!0,this.us.bs()}ID(t,e){t.padding={...t.padding,...e},this.bP=!0,this.us.bs()}TD(t,e,i){let s=this.zP(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.dP.push(s),this.SP=!0),"string"==typeof s.content||"number"==typeof s.content?this.mP=!0:this.yP=!0,this.us.bs()}DD(t){this.dP.forEach((e=>t(e)))}zP(t,e,i){const s=this.dP.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}FD(t,e){const i=this.dP.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}PD(t,e){const i=this.dP.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}gD(){return new lf(this.AD,this.fD,this.sD,this.sD,this.iD,this.qi,rf.Both).onScroll(((t,e)=>{this.ND&&(t===rf.Vertical&&(this.eD.y=-e),t===rf.Horizontal&&(this.eD.x=e),this.IP=!0,this.us.bs())})).nP(50).oP(12)}}const cf={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 df;e.DataGridCellContentAlignmentOptions=void 0,(df=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",df.RightCenter="right-center",df.LeftCenter="left-center",df.RightTop="right-top",df.LeftTop="left-top",df.RightBottom="right-bottom",df.LeftBottom="left-bottom",df.CenterTop="center-top",df.CenterBottom="center-bottom";const ff=(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])},gf=(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 Se(0,`Unidentified DataGrid cell content alignment option: ${i}`)},yf={top:!1,bottom:!1,left:!1,right:!1};class mf extends qs{constructor(t,e,i,s,r,n){super(t,{mr(){},pr(){},Sr(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.es=n,this.Ts=r,this.Dh=r.kr(t.$D).Vh(this.qi.barChartCategoryAxisTitleFont||this.qi.xAxisTitleFont).ke(this.qi.barChartCategoryAxisTitleFillStyle||this.qi.xAxisTitleFillStyle),this.setTitleRotation(this.chart.Fs.getWidth({x:0,y:-90})),this.Nh=this.es.gA([this.Dh]).xs(e.effectsText),this.XD=r.Ve(t.$D).Ee(e.barChartCategoryAxisStrokeStyle||e.xAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.yA=t,this.SA=t):"object"==typeof t&&(this.yA=t.min,this.SA=t.max),this.chart.us.bs(),this}getThickness(){return{min:this.yA,max:this.SA}}setStrokeStyle(t){return this.XD.Ee(t),this.chart.us.bs(),this}getStrokeStyle(){return this.XD.ku()}Ds(){if(!this.Xi)return{jD:0,ZD:0,nd:kt(0,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:Ie)};const t=this.XD.ku().V()/2,e=this.chart.Fs.getHeight(this.Dh.Ds().Cc());return{jD:t,ZD:e,nd:t+e}}Fe(t,e,i,s){const r=this.getInterval(),n=this.chart.valueAxis.getInterval();this.XD.Oe(this.chart.Fs.toPoint(r.start,n.start)).ze(this.chart.Fs.toPoint(r.end,n.start)).setVisible(this.Xi),this.Dh.Ie(this.chart.Fs.toPoint(.5*(r.start+r.end),this.chart.valueAxis.dt.pi(n.start,-(t.jD+s.labelMarginBeforeCategoryAxisPixels)))).Ja(this.chart.Fs.toPoint(0,1)).setVisible(this.Xi)}setMouseInteractions(t){return this}ar(t,e){return new Js(e,t,this.Ts,this.chart.$D)}lr(t,e){return{}}br(t,e){return e}_r(t,e,i){return{min:t,max:e}}}class pf extends qs{constructor(t,e,i,s,r,n,o){super(t,{mr:()=>{var e;if(t.QD){if("positive"===t.JD||"bipolar"===t.JD){if("after-bar"===(null===(e=t.KD)||void 0===e?void 0:e.position)){const e=this.dt.ri();return this.dt.pi(t.QD.max,Math.min(this.chart.Fs.getHeight(this.chart.qD())+t.KD.labelMargin,.3*e))}return t.QD.max}return t.tB?kt(-1,-1e-6,t.QD.max):0}},pr:()=>{var e;if(t.QD){if("negative"===t.JD||"bipolar"===t.JD){if("after-bar"===(null===(e=t.KD)||void 0===e?void 0:e.position)){const e=this.dt.ri();return this.dt.pi(t.QD.min,-Math.min(this.chart.Fs.getHeight(this.chart.qD())+t.KD.labelMargin,.3*e))}return t.QD.min}return t.tB?kt(1,1e-6,t.QD.min):0}},Sr:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.es=n,this.Ts=r,this.Dh=r.kr(t.$D).Vh(this.qi.barChartValueAxisTitleFont||this.qi.yAxisTitleFont).ke(this.qi.barChartValueAxisTitleFillStyle||this.qi.yAxisTitleFillStyle),this.setTitleRotation(this.chart.Fs.getHeight({x:0,y:-90})),this.Nh=this.es.gA([this.Dh]).xs(e.effectsText),this.XD=r.Ve(t.$D).Ee(e.barChartValueAxisStrokeStyle||this.qi.yAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.yA=t,this.SA=t):"object"==typeof t&&(this.yA=t.min,this.SA=t.max),this.chart.us.bs(),this}getThickness(){return{min:this.yA,max:this.SA}}setStrokeStyle(t){return this.XD.Ee(t),this.chart.us.bs(),this}getStrokeStyle(){return this.XD.ku()}setTickStrategy(t,e){return super.kh(t,e)}Ds(t){if(!this.Xi)return this.Gh(),{jD:0,ZD:0,nd:kt(0,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:Ie)};const e=this.chart.Fs.getWidth(this.chart.$D).ri(),i=this.dt.ri();this.Jh({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.Ze.values())for(const e of t.values()){const t=e.Sh.nr,i=this.chart.Fs.getWidth(e.Ye.Cc()),r=t.getTickLength()+t.getTickPadding()+i+t.getLabelPadding();s=Math.max(s,r)}const r=s+this.XD.ku().V()/2,n=this.chart.Fs.getWidth(this.Dh.Ds().Cc());return{jD:r,ZD:n,nd:kt(r+n,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:Ie)}}Fe(t){const e=this.getInterval();this.XD.Oe(this.chart.Fs.toPoint(-.5,this.Th)).ze(this.chart.Fs.toPoint(-.5,this.Fh)).setVisible(this.Xi);const i="logarithmic"===this.wh.type?Math.sqrt(e.start+e.end):.5*(e.start+e.end),s=this.chart.Fs.toPoint(this.chart.categoryAxis.dt.pi(-.5,t.jD*this.chart.Fs.iB),i),r=this.chart.Fs.toPoint(this.chart.Fs.sB,0);this.Dh.Ie(s).Ja(r).setVisible(this.Xi)}setMouseInteractions(t){return this}ar(t,e){return new Js(e,t,this.Ts,this.chart.$D)}lr(t,e){const i=t.Sh.nr,s=this.chart.Fs.toPoint(-.5,t.S),r=this.chart.$D.pi(s,this.chart.Fs.toPoint(i.getTickLength()*this.chart.Fs.iB,0)),n=this.chart.$D.pi(s,this.chart.Fs.toPoint(i.gridStrokeLength*e.oppositeAxisSize*-this.chart.Fs.iB,0)),o=this.chart.$D.pi(r,this.chart.Fs.toPoint(i.getTickPadding()*this.chart.Fs.iB,0));t.Ye.Ie(o).Ja(this.chart.Fs.toPoint(this.chart.Fs.sB,i.getLabelAlignment())).zh(i.getLabelRotation()),i.tickStyle!==rt&&0!==i.tickLength&&e.plotLines.add({positions:[s,r]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==rt&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,n]},{lineStyle:i.gridStrokeStyle})}br(t,e){return"linear"===this.wh.type?Jo(t,e,this.dt):Zo(t,e,this.dt)}_r(t,e,i){return{min:t,max:e}}}class Af extends Il{constructor(t,e,i,s,r,n,o){super(t,e,i,s),this.ia=Ce(),this.S=0,this.eB=!1,this.chart=t,this.Ji=t,this.category=r,this.subCategory=n,this._s=r,this.be=ce(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,o),this.Me=ce(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,o),this.onVisibleStateChanged((()=>{this.Ji.hB()})),this.onDispose((()=>{this.Ji.hB(),this.Ji.rB.delete(this)}))}setValue(t){return this.eB=!0,this.S=t,this.Ji.hB(),this.Ji.us.bs(),this.Ji.rB.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.Ji.hB(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ji.hB(),this}getStrokeStyle(){return this.Me}Dm(){return this.Lm}gg(t,e){return ga(t,this.Ji.engine.scale,this.Ji.xp(new Kh,this.category,this.S,this).fc(),this,void 0)}solveNearestFromScreen(t){}setEffect(t){return this.Ji.setBarsEffect(t),this}}const xf=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),Sf=(t,e,i)=>{const s=t.jc.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 bf extends Za{constructor(t,i,s,r,n,o,h){var a;let l;super(t,i,s,i.sg("barChart bg",0),r,i.us.qi.barChartBackgroundFillStyle||i.us.qi.chartXYBackgroundFillStyle,i.us.qi.barChartBackgroundStrokeStyle||i.us.qi.chartXYBackgroundStrokeStyle,i.us.qi.barChartTitleFont||i.us.qi.chartXYTitleFont,i.us.qi.barChartTitleFillStyle||i.us.qi.chartXYTitleFillStyle,o),this.coordsBars="barChart",this.nB=vf.Descending,this.oB=this.qi.barChartCategoryLabels,this.KD=this.qi.barChartValueLabelsAfterBars,this.aB=!1,this.Gw=Ee(),this.lB=new Map,this.rB=new Map,this.JD="positive",this.uB="columns",this.cB=!0,this.dB=new Map,this.fB={speed:1},this.ep={speed:1},this.AB=.08,this.vp=e.AutoCursorModes.snapToClosest,this.xp=(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.nn=(t,e,i,s,r)=>{this.$D.q(s,r)},this.fs.zn||this.fs.Vn||this.fs.Yn||this.us.As(St.atob("YmFyIGNoYXJ0")),this.Fs="horizontal"===(null==h?void 0:h.type)?Tf:Mf,this.ng.Bh("Bar Chart"),this.gB=i.wp("barChart plotting 1",0),this.pB=i.wp("barChart plotting 2",1),this.tB="logarithmic"===(null===(a=null==h?void 0:h.valueAxis)||void 0===a?void 0:a.type),this.tB?"horizontal"===this.Fs.mB?(l=s.d1({scale1DConstructor:Fi,dimension:"y"}),this.$D=(new Vi).Ri(s.d1({scale1DConstructor:bi,dimension:"x"}),l)):(l=s.d1({scale1DConstructor:Fi,dimension:"x"}),this.$D=(new Vi).Ri(l,s.d1({scale1DConstructor:bi,dimension:"y"}))):(this.$D=s.d2({scaleXYConstructor:zi}),l=this.Fs.getWidth(this.$D)),this.yB=this.es.gA(),this.Uw=new za((()=>this.Gw._t(this.gB.bv(this.$D).da(0))),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.bar),e.bar.Ss([i]),i})))),(()=>{this.Gw.Nt()}),(t=>{this.yB.ps(t)})),this.uy=this.zA.Te(this.$D).ke(this.qi.barChartSeriesBackgroundFillStyle||B).Ce(rt),this.Ay=this.zA.Te(this.$D).ke(B).Ce(this.qi.barChartSeriesBackgroundStrokeStyle||rt).setMouseInteractions(!1),super.ly(this.uy,this.Ay),this.categoryAxis=new mf(this,this.qi,!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled),l,this.pB,this.es);const u=qo(null==h?void 0:h.valueAxis);this.valueAxis=new pf(this,this.qi,!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled),this.Fs.getHeight(this.$D),this.pB,this.es,u.type),this.SB=new Va((()=>this.pB.kr(this.$D).tl(ke).Ka(ke).da(1))),this.vB=new za((()=>this.zA._A(this.$D).setMouseInteractions(!1)),((t,e,i)=>(t.Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>(i||t.Lr()).CA(e[0],e[1])))))),this.kp=i.Tp();const c=Dt(h?h.autoCursorBuilder:void 0,ua);this.Ag=c.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.onResize(this.nn),this.ig(n,this.$D),this.setAutoCursorMode(e.AutoCursorModes.onHover),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled)),this.yy(((t,e)=>{Hh.mg(this,e)}))}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}setBarsMargin(t){return this.AB=kt(t,0,.49),this.aB=!0,this.us.bs(),this}getBarsMargin(){return this.AB}setBarsEffect(t){return this.yB.xs(t),this.us.bs(),this}getBarsEffect(){return this.yB.Ms()}setData(t){let e;if(this.iy.length>0&&(this.fs.Vn||this.fs.zn||this.fs.ho||this.us.As(St.atob("cmVhbC10aW1lIGRhdGE="))),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.xB("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.xB("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.xB("groups",i),this}xB(t,e){this.uB=t,this.bB(e);const i=me(e.map((t=>t.category))),s=i.length,r=me(e.map((t=>t.subCategory))).filter((t=>void 0!==t));if(e.forEach((t=>{let e=this.iy.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 Af(this,this.ey,this.qi,this.us.es,t.category,t.subCategory,Dt(n,s)),this.gy(e),this.dB.set(e,{category:s,valueStart:this.tB?1e-6:0,valueEnd:void 0!==t.value?t.value:0})}void 0!==t.value&&e.setValue(t.value)})),this.iy.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category&&e.subCategory===t.subCategory))&&(t.dispose(),this.dB.delete(t))})),this.categoryAxis.setInterval(this.Fs.getWidth({x:{start:-.5,end:s-.5},y:{start:s-.5,end:-.5}})),this.QD=0===this.iy.length?void 0:"stacks"!==t?this.iy.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:Ie,max:Le}):{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.QD&&(this.JD=this.QD.min>=0?"positive":this.QD.max<=0?"negative":"bipolar",("bipolar"===this.JD||"negative"===this.JD)&&this.tB))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");this.bB(this.iy),this.lB.clear(),this.rB.clear(),this.aB=!0,this.us.bs()}setCategoryLabels(t){const e="function"==typeof t?this.oB?t(this.oB):this.oB:t;return this.oB=e?{...this.qi.barChartCategoryLabels,...e}:void 0,this.lB.clear(),this.us.bs(),this}getCategoryLabels(){return this.oB}setValueLabels(t){var e;const i="function"==typeof t?this.KD?t(this.KD):this.KD:t,s=(null==i?void 0:i.position)||(null===(e=this.KD)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.KD={...this.qi.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.KD={...this.qi.barChartValueLabelsInsideBars,...i}):this.KD=void 0,this.rB.clear(),this.us.bs(),this}getValueLabels(){return this.KD}setLabelFittingEnabled(t){return this.cB=t,this.us.bs(),this}getLabelFittingEnabled(){return this.cB}getBar(t,e){if(("groups"===this.uB||"stacks"===this.uB)&&void 0===e)throw new Error("LightningChart JS BarChart.getBar() | `subCategory` parameter is required for grouped and stacked bar charts!");const i=this.iy.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.iy}setSorting(t){return this.nB=t,this.bB(this.iy),this.us.bs(),this}getSorting(){return this.nB}setAnimationCategoryPosition(t,e=1){return this.fB=t?{speed:e}:void 0,this.us.bs(),this}setAnimationValues(t,e=1){return this.ep=t?{speed:e}:void 0,this.us.bs(),this}translateCoordinate(t,e,i){if(i&&Oi(t)&&_i(e))return super.translateCoordinate(t,e,i);const s=e;let r;if(Bi(t))r=this.us.$o(t);else if(Oi(t)){const e=ut(t,this.pixelScale,this.us.dt);r={engineX:e.x,engineY:e.y}}else{if(!xf(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=ut(this.Fs.toPoint(t.iCategory,t.value),this.$D,this.us.dt);r={engineX:e.x,engineY:e.y}}}if(Ri(s))return this.us.Xo(r);if("barChart"===s){const t=ut({x:r.engineX,y:r.engineY},this.us.dt,this.$D);return{iCategory:this.Fs.getWidth(t),value:this.Fs.getHeight(t)}}if(_i(s))return ut({x:r.engineX,y:r.engineY},this.us.dt,this.pixelScale);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}Sd(){if("columns"===this.uB)return this.iy;const t=me(pe(this.iy.map((t=>t.subCategory))));return pe(t.map((t=>{const e=this.iy.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 xe(s,e,{toggleVisibilityOnClick:!0,label:t,style:i.getFillStyle()}),this}}})))}Fe(t){var e,i;super.Fe(t);const s=this.SB.Xp(),r=this.vB.Xp(),n=this.iy.filter((t=>t.getVisible()&&t.eB)),o=me(n.map((t=>t.category))),h=me(pe(n.map((t=>t.subCategory)))),a=5e-4*t*((null===(e=this.fB)||void 0===e?void 0:e.speed)||0),l=.003*t*((null===(i=this.fB)||void 0===i?void 0:i.speed)||0),u=this.valueAxis.dt,c=u instanceof Fi?(t,e)=>{var i;return Jo(t,e,u,(null===(i=this.ep)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return Zo(t,e,u,(null===(i=this.ep)||void 0===i?void 0:i.speed)||0)};let d;"columns"===this.uB?d=n.map((t=>({bar:t,position:{category:o.indexOf(t.category),valueStart:this.tB?1e-6:0,valueEnd:t.value}}))):"groups"===this.uB?d=n.map((t=>{const e=o.indexOf(t.category),i=h.indexOf(t.subCategory),s=1/(h.length+2*(h.length+1)*this.AB),r=this.AB*s;return{bar:t,position:{category:e+(i-(h.length-1)/2)*(s+r),valueStart:this.tB?1e-6:0,valueEnd:t.value}}})):(d=[],o.forEach(((t,e)=>{const i=n.filter((e=>e.category===t));let s=this.tB?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.dB.get(e);void 0===n&&(n=i);const o=i.valueStart;if(this.fB&&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.ep&&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.dB.set(e,{category:s,valueStart:o,valueEnd:r}),s===i.category&&r===i.valueEnd||this.us.bs(!0),s===n.category&&r===n.valueEnd||(this.aB=!0)})),Wh.cg(this.ng,this.eg);const f=n.length>0;this.categoryAxis.vr(),this.valueAxis.vr();const g=this.categoryAxis.setVisible(f).Ds(),y=this.valueAxis.setVisible(f).Ds(r),{labelMarginBeforeCategoryAxisPixels:m}=f?this.MB(o,n,s,r):{labelMarginBeforeCategoryAxisPixels:0};this.categoryAxis.Fe(g,s,r,{labelMarginBeforeCategoryAxisPixels:m}),this.valueAxis.Fe(y);const p=this.categoryAxis.getThickness(),A=kt(g.nd+m,void 0!==p.min?p.min:0,void 0!==p.max?p.max:Ie),x={x:Math.min(this.$D.x.getInnerStart(),this.$D.x.getInnerEnd()),y:Math.min(this.$D.y.getInnerStart(),this.$D.y.getInnerEnd())},S=Math.max(this.$D.x.getInnerStart(),this.$D.x.getInnerEnd()),b=Math.max(this.$D.y.getInnerStart(),this.$D.y.getInnerEnd()),v={x:S-x.x,y:b-x.y};this.uy.Ie(x),this.uy.q(v),this.Ay.Ie(x),this.Ay.q(v),super.tg(),Hh.dg(this,this.uy.getIsUnderMouse(),!1,this.iy,void 0,((t,e)=>t.gg(e,!0)));const M=Wh.ug(this.ng,this.eg);if(this.$D.Vi([this.Xt.bottom+this.Da.bottom+("vertical"===this.Fs.mB?A:0),this.Xt.top+this.Da.top+M+("horizontal"===this.Fs.mB?y.nd:0)]),this.$D.Ei([this.Xt.left+this.Da.left+this.Fs.getHeight({x:A,y:y.nd}),this.Xt.right+this.Da.right]),this.gB.ES({x:this.$D.x.ei(),y:this.$D.y.ei(),width:this.$D.x.ri(),height:this.$D.y.ri()}),this.LA&&this.LA(),this.aB){const t=this.Uw.Xp(),e="groups"===this.uB?1/(h.length+2*(h.length+1)*this.AB):1-2*this.AB;n.forEach((i=>{const s=this.dB.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({ia:i.ia,vertices:o,bar:i},{fillStyle:i.be,strokeStyle:i.Me})})),t.finishPlot()}s.finishPlot(),r.finishPlot(),this.aB=!1}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationCategoryPosition(!1),this.setAnimationValues(!1),this.valueAxis.setAnimationsEnabled(!1),this.categoryAxis.setAnimationsEnabled(!1),this}solveNearest(t){}dispose(){return this.pB.W(),this.gB.W(),this.Ag.dispose(),this.kp.W(),super.dispose()}bB(t){const e=this.nB;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)})))}MB(t,e,i,s){let r=0;const n=this.oB,o=this.KD,h=this.valueAxis.getInterval(),a=this.Fs.getWidth({x:this.$D.x.ri(),y:this.$D.y.ri()});if(n&&n.labelFillStyle!==B){const o=n.tickLength+n.labelMargin,l=this.Fs.toPoint(0,1),u={jc: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.dt.pi(h.start,-o)),alignment:l,rotation:n.labelRotation,sizePixels:this._B(t,s)}:void 0})),hc:n.labelFont,dt:this.$D},c=u?this.cB?Sf(u,a,this.Fs.getWidth):u.jc:[];c.forEach((t=>{t&&i.add().Bh(t.text).Ie(t.position).Ja(t.alignment).zh(t.rotation).ke(n.labelFillStyle).Vh(n.labelFont)})),n.tickStyle!==rt&&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.dt.getInnerStart()),this.Fs.toPoint(e,this.valueAxis.dt.pi(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!==B){let t;"after-bar"===o.position?t={jc:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.dB.get(t);return void 0!==s?{text:i,position:this.Fs.toPoint(s.category,this.valueAxis.dt.pi(s.valueEnd,o.labelMargin*Math.sign(s.valueEnd))),alignment:this.Fs.toPoint(0,-1*Math.sign(s.valueEnd)),rotation:o.labelRotation,sizePixels:this.wB(t)}:void 0})),hc:o.labelFont,dt:this.$D}:"inside-bar"!==o.position&&"inside-bar-start"!==o.position&&"inside-bar-centered"!==o.position&&"inside-bar-end"!==o.position||(t={jc:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.dB.get(t);if(void 0===s)return;const r="bipolar"===this.JD?Math.sign(s.valueEnd):"negative"===this.JD?-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.dt.pi(s.valueEnd,-o.labelMargin*r):"inside-bar-centered"===o.position?(s.valueStart+s.valueEnd)/2:this.valueAxis.dt.pi(s.valueStart,o.labelMargin*r)),alignment:n,rotation:o.labelRotation,sizePixels:this.wB(t)}})),hc:o.labelFont,dt:this.$D}),t&&(t?this.cB?Sf(t,a,this.Fs.getWidth):t.jc:[]).forEach((t=>{t&&i.add().Bh(t.text).Ie(t.position).Ja(t.alignment).zh(t.rotation).ke(o.labelFillStyle).Vh(o.labelFont).setMouseInteractions(!1)}))}return{labelMarginBeforeCategoryAxisPixels:r}}_B(t,e){if(!this.oB||this.oB.labelFillStyle===B)return{x:0,y:0};const i=this.lB.get(t);if(i)return i;const s=this.oB.formatter(t,e),r=this.us.kB.CB(s,this.oB.labelFont,this.oB.labelRotation);return r.isEstimate?this.us.bs(!0):this.lB.set(t,r),r}wB(t){if(!this.KD||this.KD.labelFillStyle===B)return{x:0,y:0};const e=this.rB.get(t);if(e)return e;const i=this.us.kB.CB(this.KD.formatter(t,t.category,t.value),this.KD.labelFont,this.KD.labelRotation);return i.isEstimate?this.us.bs(!0):this.rB.set(t,i),i}qD(){return this.iy.reduce(((t,e)=>{const i=this.wB(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}hB(){this.aB=!0,this.us.bs()}getMinimumSize(){return{x:200,y:200}}}const vf={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)},Mf={...th,mB:"vertical",iB:-1,sB:1},Tf={...eh,mB:"horizontal",iB:1,sB:-1},wf=(t,e)=>e?t.x:t.y,Ef=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),kf=(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(wf(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&&eEf(t,h,n,e))).reduce(((t,e)=>Math.max(t,wf(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>wf(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))/wf(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class Cf{constructor(t,e,i,s,n){this.coordsRelative="relative",this.coordsClient="client",this.$i=!1,this.dP=new Array,this.D=new r.Eventer,this.TB=[],this.PA=[],this.FB=void 0,this.IB=!0,this.PB=!0,this.DB=!0,this.RA=!1,this.BB=!0,this.LB=()=>{this.BB=!0,this.us.bs()},this.RB=[],this.onInViewChange=t=>this.D.on("inViewChange",t),this.offInViewChange=t=>this.D.off(t,"inViewChange"),this.EB=t=>{for(let e=0;e{const e=this.TB.indexOf(t);e>=0&&this.TB.splice(e,1)},this.NA=t=>{const e=this.PA.indexOf(t);e>=0&&this.PA.splice(e,1)},this.zB=(t,e,i,s,r)=>{if(this.OB(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.dP.push(n),this.NB(n),this.IB=!0,t}throw new ft("Out of dashboard range.")},this.GB=e.numberOfRows,this.WB=e.numberOfColumns,this.fs=t,this.UB=e,this.YB=s;const o=this.WB*this.GB;this.HB={x:new Nd(new Array(this.WB).fill(1)),y:new Nd(new Array(this.GB).fill(1))},this.qi=i.qi,this.$B=this.qi.dashboardSplitterStyle,this.th=!0!==(null==e?void 0:e.disableAnimations)&&!1!==(null==e?void 0:e.animationsEnabled),this.XB=Od(i,o),this.jB=i.nI("dashboard splitters",400001),this.Ab=()=>this.XB.rI(),this.$A=this.XB.oI(),this.es=i.es.hs(this,{ZB:{}}),this.es.ZB.xs(this.qi.effectsDashboardSplitters);const h=i.oi();this.uiScale=at.d2({scaleXYConstructor:zi}).zi(0,100).Oi(0,100).q(h),this.pixelScale=at.d2({scaleXYConstructor:zi}).zi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).q(h),this.QB=i.JB.bind(i),this.KB=i.qB.bind(i),this.tL=i.iL.bind(i),this.sL=i.eL.bind(i),this.So=i.So.bind(i),this.xo=i.xo.bind(i),this.engine=i.WA,this.us=i.UA,i.Go((()=>this.LB())),i.bs();const a=i.Yo((t=>{this.RA=t,this.D.emit("inViewChange",this,t)}));this.JA=i.Ho.bind(i,a),this.hL(),this.setAnimationsEnabled(this.th);const l=((t,e)=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.D);this.createChartXY=t=>{const e=Df(t,this.UB,this.th);return this.zB(new Pd(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=Df(t,this.UB,this.th);return this.zB(new ac(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=Df(t,this.UB,this.th);return this.zB(new mu(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=Df(t,this.UB,this.th),i=e&&e.type?e.type:Da;return this.zB(new i(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=Df(t,this.UB,this.th),i=e&&e.type?e.type:Bu;return this.zB(new i(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,l,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=Df(t,this.UB,this.th),i=e&&e.type?e.type:Eu;return this.zB(new i(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=Df(t,this.UB,this.th),i=t&&t.type?t.type:Hu;return this.zB(new i(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=Df(t,this.UB,this.th);return this.zB(new Nh(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=Df(t,this.UB,this.th);return this.zB(new ul(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=Df(t,this.UB,this.th);return this.zB(new dd(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=Df(t,this.UB,this.th);return this.zB(new Al(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=Df(t,this.UB,this.th),i=new al(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,l,e);return this.zB(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=Df(t,this.UB,this.th),i=new uf(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,l);return this.zB(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=Df(t,this.UB,this.th),i=new bf(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,n,l,e);return this.zB(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}rL(t,e){return t+e*this.WB}nL(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.WB:this.GB,"x"===i.dimension?e.x:e.y),d2:i=>(new i.scaleXYConstructor).ot({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.WB,y:this.GB},e),d3:()=>new ot({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.WB,y:this.GB},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.QB(t[0]),this.KB(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.tL(t[0]),this.sL(t[1]),this}getWidth(){return this.So()}getHeight(){return this.xo()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.jB.bs(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.jB.bs(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.qi}setSplitterStyle(t){const e=this.$B;return this.$B="function"==typeof t?t(this.$B):t,this.oL(e),this}getSplitterStyle(){return this.$B}setSplitterEffect(t){return this.es.ZB.xs(t),this.us.bs(),this}getSplitterEffect(){return this.es.ZB.Ms()}setAnimationHighlight(t){return this.DB=t,this.RB.forEach((e=>this.us.ls.Cs(e.line,t))),this}getAnimationHighlight(){return this.DB}oL(t){for(const t of this.RB)t.line.Ee(this.$B);this.hL()}setColumnWidth(t,e){const i=this.HB.x._();return t>=0&&t=e.length)throw new ft("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.HB.y._();return t>=0&&t=e.length)throw new ft("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}onResize(t){return this.D.on("resize",t)}offResize(t){return this.D.off(t,"resize")}aL(t,e,i){if(i&&Math.abs(t.x)>0)this.lL(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.uL(e,t.y)}for(const t of this.dP)t.panel.Z();this.LB()}uL(t,e){const i=kf(this.dP,this.HB.y._(),t,e,this.pixelScale.oi(),!1);this.HB.y.M(i),this.LB()}lL(t,e){const i=kf(this.dP,this.HB.x._(),t,e,this.pixelScale.oi(),!0);this.HB.x.M(i),this.LB()}cL(){this.RB.forEach((t=>t.line.dispose())),this.RB.length=0;for(let t=1;t<=this.WB-1;t+=1)for(let e=0;e<=this.GB-1;e+=1)if(void 0!==this.dP.find((i=>Ge(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=Yi(new Xi((()=>{this.dL(t)}),((e,i,s,r,n)=>{this.aL(r,t,!0),$t(n)}),(()=>{this.fL(t)}))),s=this.jB.Ve(this.pixelScale).Ee(this.$B).setMouseEnterEventHandler((()=>{this.dL(t)})).setMouseLeaveEventHandler((()=>{this.fL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.aL(n,t,!0),$t(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.us.ls.os(s,(t=>s.cs(t)),{animationEnabled:this.DB}),this.RB.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.GB-1;t+=1)for(let e=0;e<=this.WB-1;e+=1)if(void 0!==this.dP.find((i=>Ge(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=Yi(new Xi((()=>{this.AL(t)}),((e,i,s,r,n)=>{this.aL(r,t,!1),$t(n)}),(()=>{this.gL(t)}))),s=this.jB.Ve(this.pixelScale).Ee(this.$B).setMouseEnterEventHandler((()=>{this.AL(t)})).setMouseLeaveEventHandler((()=>{this.gL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.aL(n,t,!1),$t(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.us.ls.os(s,(t=>s.cs(t)),{animationEnabled:this.DB}),this.RB.push({row:t,column:e,line:s,alignment:"horizontal"})}this.es.ZB.ps(this.RB.map((t=>t.line)))}pL(){const t=this.pixelScale.oi(),e=this.HB.x._(),i=e.reduce(((t,e)=>t+e)),s=this.HB.y._(),r=s.reduce(((t,e)=>t+e));this.RB.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).ze(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).ze(h)}}))}dL(t){this.RB.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.us.ls.ws(e.line,1),this.jB.mL(e.line))})),this.FB=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.us.bs()}AL(t){this.RB.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.us.ls.ws(e.line,1),this.jB.mL(e.line))})),this.FB=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.us.bs()}fL(t){this.RB.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.us.ls.ws(e.line,0)})),this.engine.restoreMouseStyle(this.FB),this.us.bs()}gL(t){this.RB.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.us.ls.ws(e.line,0)})),this.engine.restoreMouseStyle(this.FB),this.us.bs()}setAnimationsEnabled(t){return this.th=t,this.getCells().filter((t=>t.panel instanceof Gh)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.th),this}getAnimationsEnabled(){return this.th}getCells(){return this.dP.slice()}dispose(){return this.$i||(this.JA&&this.JA(),this.dP.slice().forEach((t=>t.panel.dispose())),this.TB.slice().forEach((t=>t.dispose())),this.PA.slice().forEach((t=>t.dispose())),this.$i=!0,this.YB(),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}getIsInView(){return this.RA}saveToFile(t,e,i){return Vh(this.engine,t,e,i),this}yL(t){if(this.BB){const t=this.us.dt.oi(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=this.uiScale.getInnerIntervalPixels();this.pixelScale.zi(0,s.x).Oi(0,s.y),this.D.emit("resize",this,s.x,s.y,e,i),this.PB=!0}this.IB&&(this.cL(),this.IB=!1,this.PB=!0),this.PB&&(this.pL(),this.PB=!1);for(const e of this.dP)e.panel.Fe(t);return this.TB.forEach((t=>t.Ds())),this.TB.forEach((t=>t.Fe())),this.PA.forEach((t=>t.Ds())),this.PA.forEach((t=>t.Fe())),this.BB=!1,this}j(){for(const t of this.dP)t.panel.j();return this.pixelScale.x.j(),this.pixelScale.y.j(),this.uiScale.x.j(),this.uiScale.y.j(),this}Z(){for(const t of this.dP)t.panel.Z();return this.pixelScale.x.Z(),this.pixelScale.y.Z(),this.uiScale.x.Z(),this.uiScale.y.Z(),this}translateCoordinate(t,e,i){return Bh(t,e,i,this.pixelScale,this.us)}addUIElement(t=Eo,e=this.uiScale){e=Rh(e,this.pixelScale);const i=Ph(t,this.Ab(),this.uiScale,e,this.VB,this.qi);return this.TB.push(i),i}addLegendBox(t=_o,i=this.uiScale){i=Rh(i,this.pixelScale);const s=Ph(t,this.$A,this.uiScale,i,this.NA,this.qi);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.PA.push(s),s}getLegendBoxes(){return this.PA}OB(t,e,i,s){return e>=0&&t>=0&&e+s<=this.GB&&t+i<=this.WB}NB(t){const e=this.$B,i=e===rt?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Ka(s)}hL(){this.uiScale.x.si([0,0]),this.uiScale.y.si([0,0]),this.pixelScale.x.si([0,0]),this.pixelScale.y.si([0,0]);for(const t of this.dP)this.NB(t);this.us.bs()}}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},Ff={None:Cn,Rectangle:no,Circle:oo,Diamond:ho,Pointer:ao},If={ChartMarkerXY:Zl,SeriesMarkerXY:Kl},Lf={XY:Jl,Spider:la,BarChart:ua,Map:fa,Polar:la},zf={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"}},Vf={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"}},Pf={"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"}},Bf={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"}},_f={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"}},Of={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"}},Nf={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"}},Uf={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"}},Gf={World:_f,USA:Of,NorthAmerica:Nf,SouthAmerica:Uf,Canada:Rf,Europe:Bf,Asia:Vf,Africa:zf,Australia:Pf},Wf={Solid:Bu},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 ir({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 qi({thickness:2,fillStyle:r}),f=new U({color:t.dataHighlightOverlayColor}),g=new qi({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 qi({thickness:2,fillStyle:t}))),A=t=>p[t%p.length],x=t.dataColorPalette.map((t=>new U({color:t.border}))).map((t=>new qi({thickness:2,fillStyle:t}))),S=t=>x[t%x.length],b=t.dataColorPalette.map((t=>{const e=t.area;return new et({angle:180,stops:[{color:re(e,T(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:re(e,T(0,0,0,e.getA()),.3),offset:1}]})})),v=t=>b[t%b.length],M=t.dataColorPaletteInverted.map((t=>{const e=t.area;return new et({angle:180,stops:[{color:re(e,T(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:re(e,T(0,0,0,e.getA()),.3),offset:1}]})})),w=t=>M[t%M.length],E=t.dataColorPaletteInverted.map((t=>new U({color:t.border}))).map((t=>new qi({thickness:2,fillStyle:t}))),k=t=>E[t%E.length],C=new U({color:t.dataColorPositive}),D=new U({color:t.dataColorNegative}),F=new qi({thickness:1,fillStyle:new U({color:t.dataStrokeColorContrastHigh.setA(50)})}),I=new qi({thickness:2,fillStyle:t.axisLineFillStyle}),L=rt,z=new U({color:T(0,0,0,1)}),V=new qi({thickness:1,fillStyle:t.axisGridMajorFillStyle}),P=new qi({thickness:1,fillStyle:t.axisTickMajorFillStyle}),R=a,_=t.axisLabelMajorFillStyle,O=new qi({thickness:1,fillStyle:t.axisGridMajorFillStyle}),N=new qi({thickness:1,fillStyle:t.axisTickMajorFillStyle}),G=a,W=t.axisLabelMajorFillStyle,Y=new qi({thickness:1,fillStyle:t.axisGridMinorFillStyle}),H=new qi({thickness:1,fillStyle:t.axisTickMinorFillStyle}),X=l,$=t.axisLabelMinorFillStyle,j=oh,q=new rh({gridStrokeStyle:V,tickStyle:P,tickLength:50,tickPadding:-14,labelFont:R,labelPadding:0,labelFillStyle:_}),J=new rh({gridStrokeStyle:O,tickStyle:N,tickLength:7,tickPadding:0,labelFont:G,labelPadding:0,labelFillStyle:W}),Z=new rh({gridStrokeStyle:Y,tickStyle:H,tickLength:4,tickPadding:5,labelFont:X,labelPadding:0,labelFillStyle:$}),K=new Ch({extremeTickStyle:j,majorTickStyle:J,minorTickStyle:Z}),Q=new Sh({greatTickStyle:q,majorTickStyle:J,minorTickStyle:Z}),tt=new zh({majorTickStyle:J,minorTickStyle:Z}),it=new U({color:t.dataHighlightOverlayColor}),st=new qi({thickness:1,fillStyle:s}),nt=new qi({thickness:2,fillStyle:s}),ot=t=>new dr.Triangulated({shape:"sphere",size:10,fillStyle:y[t%y.length]}),ht=y[0],at=t.uiTextFillStyle,lt=t.legendBackgroundFillStyle,ut=new qi({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),ct=oe(t.legendButtonDefaultColor),dt=oe(t.isDark?T(70,70,70,255):T(170,170,170,255)),ft=new U({color:t.isDark?T(70,70,70,255):T(170,170,170,255)}),gt=new qi({thickness:1,fillStyle:i}),yt=new Jn({thickness:1,fillStyle:t.cursorGridFillStyle,pattern:jn.DashedEqual,patternScale:3}),mt=t.zoomBandChartDefocusOverlayFillStyle,pt=new qi({thickness:2,fillStyle:new U({color:t.zoomBandChartSplitterColor})});let At={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:rt,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new qi({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:rt,chartXYTitleFont:o,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:d,chartXYZoomingRectangleFillStyle:f,chartXYZoomingRectangleStrokeStyle:g,chartXYFittingRectangleFillStyle:f,chartXYFittingRectangleStrokeStyle:g,lineSeriesStrokeStyle:A,pointLineSeriesStrokeStyle:A,pointLineSeriesFillStyle:m,pointSeriesFillStyle:m,ellipseSeriesFillStyle:m,ellipseSeriesStrokeStyle:A,polygonSeriesFillStyle:m,polygonSeriesStrokeStyle:A,rectangleSeriesFillStyle:m,rectangleSeriesStrokeStyle:rt,segmentSeriesStrokeStyle:A,boxSeriesBodyFillStyle:m(0),boxSeriesBodyStrokeStyle:rt,boxSeriesStrokeStyle:new qi({thickness:1,fillStyle:y[0]}),boxSeriesMedianStrokeStyle:new qi({thickness:1,fillStyle:new U({color:T(0,0,0)})}),ohlcCandleThicknessPixels:5,ohlcCandleBodyFillStylePositive:C,ohlcCandleBodyFillStyleNegative:D,ohlcCandleTailStrokeStylePositive:new qi({thickness:1,fillStyle:new U({color:t.uiStrokeColorContrastHigh})}),ohlcCandleTailStrokeStyleNegative:new qi({thickness:1,fillStyle:new U({color:t.uiStrokeColorContrastHigh})}),ohlcBarThicknessPixels:10,ohlcBarStrokeStylePositive:new qi({thickness:2,fillStyle:C}),ohlcBarStrokeStyleNegative:new qi({thickness:2,fillStyle:D}),heatmapGridSeriesFillStyle:m,heatmapGridSeriesWireframeStyle:F,heatmapScrollingGridSeriesFillStyle:m,heatmapScrollingGridSeriesWireframeStyle:F,areaRangeSeriesFillStyle:v,areaRangeSeriesStrokeStyle:S,areaRangeSeriesFillStyleInverted:w,areaRangeSeriesStrokeStyleInverted:k,areaSeriesBipolarHighFillStyle:v,areaSeriesBipolarHighStrokeStyle:S,areaSeriesBipolarLowFillStyle:w,areaSeriesBipolarLowStrokeStyle:k,areaSeriesPositiveFillStyle:v,areaSeriesPositiveStrokeStyle:S,areaSeriesNegativeFillStyle:w,areaSeriesNegativeStrokeStyle:k,xAxisTitleFont:h,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:I,xAxisNibStyle:L,xAxisOverlayStyle:z,xAxisZoomingBandFillStyle:f,xAxisZoomingBandStrokeStyle:rt,xAxisNumericTicks:K,xAxisDateTimeTicks:Q,xAxisTimeTicks:tt,yAxisTitleFont:h,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:I,yAxisNibStyle:L,yAxisOverlayStyle:z,yAxisZoomingBandFillStyle:f,yAxisZoomingBandStrokeStyle:rt,yAxisNumericTicks:K,yAxisDateTimeTicks:Q,yAxisTimeTicks:tt,bandFillStyle:it,bandStrokeStyle:st,constantLineStrokeStyle:nt,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:rt,barChartTitleFont:o,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:B,barChartSeriesBackgroundStrokeStyle:rt,barChartBarFillStyle:m,barChartBarStrokeStyle:new qi({thickness:1,fillStyle:r}),barChartValueAxisTitleFont:h,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:I,barChartValueAxisTicks:K.setMajorTickStyle((t=>t.setGridStrokeStyle(rt))).setMinorTickStyle((t=>t.setGridStrokeStyle(rt))),barChartCategoryAxisTitleFont:h,barChartCategoryAxisTitleFillStyle:t.axisTitleFillStyle,barChartCategoryAxisStrokeStyle:I,barChartCategoryLabels:{formatter:(t,e)=>t,labelFillStyle:K.majorTickStyle.labelFillStyle,labelFont:K.majorTickStyle.labelFont,labelMargin:8,labelRotation:0,tickStyle:K.majorTickStyle.tickStyle,tickLength:0},barChartValueLabelsAfterBars:{position:"after-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:K.majorTickStyle.labelFillStyle,labelFont:K.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},barChartValueLabelsInsideBars:{position:"inside-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:K.majorTickStyle.labelFillStyle,labelFont:K.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:rt,chart3DTitleFont:o,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:d,chart3DBoundingBoxStrokeStyle:rt,xAxis3DTitleFont:h,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:I,xAxis3DNumericTicks:K,xAxis3DDateTimeTicks:Q,xAxis3DTimeTicks:tt,yAxis3DTitleFont:h,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:I,yAxis3DNumericTicks:K,yAxis3DDateTimeTicks:Q,yAxis3DTimeTicks:tt,zAxis3DTitleFont:h,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:I,zAxis3DNumericTicks:K,zAxis3DDateTimeTicks:Q,zAxis3DTimeTicks:tt,lineSeries3DStrokeStyle:A,pointLineSeries3DStrokeStyle:A,pointLineSeries3DPointStyle:ot,pointSeries3DPointStyle:ot,pointCloudSeries3DPointStyle:t=>new dr.Pixelated({size:5,fillStyle:y[t%y.length]}),surfaceGridSeries3DFillStyle:m,surfaceGridSeries3DWireframeStyle:F,surfaceScrollingGridSeries3DFillStyle:m,surfaceScrollingGridSeries3DWireframeStyle:F,boxSeries3DFillStyle:m,meshModel3DFillStyle:m(0),polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:rt,polarChartTitleFont:o,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:d,polarSectorFillStyle:it,polarSectorStrokeStyle:st,polarAmplitudeAxisTitleFont:h,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:I,polarAmplitudeAxisNumericTicks:K,polarAmplitudeAxisDateTimeTicks:Q,polarAmplitudeAxisTimeTicks:tt,polarRadialAxisTitleFont:h,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:I,polarRadialAxisTickStyle:J,polarLineSeriesStrokeStyle:A,polarPointLineSeriesFillStyle:m,polarPointLineSeriesStrokeStyle:A,polarPointSeriesFillStyle:m,polarPolygonSeriesFillStyle:v,polarPolygonSeriesStrokeStyle:S,polarAreaSeriesFillStyle:v,polarAreaSeriesStrokeStyle:S,polarHeatmapSeriesFillStyle:m,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:rt,mapChartTitleFont:o,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:ht,mapChartStrokeStyle:new qi({thickness:1,fillStyle:new U({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:B,mapChartOutlierRegionStrokeStyle:new qi({thickness:1,fillStyle:r}),mapChartSeparateRegionFillStyle:lt,mapChartSeparateRegionStrokeStyle:ut,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:rt,dataGridTitleFont:o,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:a,dataGridTextFillStyle:ht,dataGridCellBackgroundFillStyle:new U({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new qi({thickness:.4,fillStyle:new U({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:rt,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ut,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ut,dataGridScrollBarButtonArrowFillStyle:ct,dataGridScrollBarButtonArrowStrokeStyle:ut,sparkLineChartStrokeStyle:A(0),sparkPointChartFillStyle:m(0),sparkBarChartFillStyle:m(0),sparkBarChartStrokeStyle:S(0),sparkAreaChartFillStyle:v(0),sparkAreaChartStrokeStyle:S(0),sparkPieChartFillStyle:m,sparkPieChartStrokeStyle:ut,sparkChartBandFillStyle:it,sparkChartBandStrokeStyle:st,sparkChartConstantLineStrokeStyle:nt,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:rt,spiderChartTitleFont:o,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:d,spiderChartWebStyle:new qi({thickness:2,fillStyle:r}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:a,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:h,spiderChartAxisStrokeStyle:new qi({thickness:2,fillStyle:s}),spiderChartAxisNibStrokeStyle:new qi({thickness:2,fillStyle:i}),spiderSeriesFillStyle:v,spiderSeriesStrokeStyle:S,spiderSeriesPointFillStyle:m,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:rt,pieChartTitleFont:o,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:m,pieChartSliceStrokeStyle:ut,pieChartSliceLabelFont:c,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:gt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:rt,funnelChartTitleFont:o,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:m,funnelChartSliceStrokeStyle:ut,funnelChartSliceLabelFont:c,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:gt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:rt,pyramidChartTitleFont:o,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:m,pyramidChartSliceStrokeStyle:ut,pyramidChartSliceLabelFont:c,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:gt,gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:rt,gaugeChartTitleFont:o,gaugeChartTitleFillStyle:t.titleFillStyle,gaugeChartEmptyGaugeFillStyle:new U({color:t.uiBackgroundColor}),gaugeChartEmptyGaugeStrokeStyle:ut,gaugeChartGaugeFillStyle:ht,gaugeChartIntervalLabelsFillStyle:at,gaugeChartIntervalLabelsFont:c,gaugeChartValueLabelFillStyle:at,gaugeChartValueLabelFont:c,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:rt,zoomBandChartDefocusOverlayFillStyle:mt,zoomBandChartSplitterStrokeStyle:pt,zoomBandChartKnobFillStyle:t.zoomBandChartKnobFillStyle,zoomBandChartKnobSize:t.zoomBandChartKnobSize,onScreenMenuBackgroundColor:T(254,204,0,.7),uiButtonFillStyle:ct,uiButtonFillStyleHidden:dt,uiButtonStrokeStyle:ut,uiButtonSize:10,uiBackgroundFillStyle:lt,uiBackgroundStrokeStyle:ut,uiTextFillStyle:at,uiTextFillStyleHidden:ft,uiTextFont:c,legendTitleFillStyle:at,legendTitleFont:u,cursorTickMarkerXBackgroundFillStyle:lt,cursorTickMarkerXBackgroundStrokeStyle:ut,cursorTickMarkerXTextFillStyle:at,cursorTickMarkerXTextFont:c,cursorTickMarkerYBackgroundFillStyle:lt,cursorTickMarkerYBackgroundStrokeStyle:ut,cursorTickMarkerYTextFillStyle:at,cursorTickMarkerYTextFont:c,cursorPointMarkerFillStyle:yt.getFillStyle(),cursorPointMarkerSize:{x:9,y:9},cursorPointMarkerShape:e.PointShape.Cross,cursorResultTableFillStyle:lt,cursorResultTableStrokeStyle:ut,cursorResultTableTextFillStyle:at,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&&(At={...At,...t.overrideThemeProperties}),At})(t),r={...i,header1Font:s.xAxisTitleFont,header2Font:s.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:s.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...s,examples:r}},Hf=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/${e}`;return i.addEventListener("error",(e=>{Te(t,s,"Theme resource",{shouldCrash:!1})})),i.src=s,i},Xf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:re(e[s%e.length].stroke,T(255,255,255),.5);return new K({stops:[{color:re(r,T(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:re(r,T(30,30,30),.5*i).setA(100),offset:1}]})},$f=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:re(e[s%e.length].stroke,T(255,255,255),.2);return new K({stops:[{color:re(r,T(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:re(r,T(0,0,0),.2*i),offset:1}]})},jf=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:re(e[s%e.length].stroke,T(255,255,255),.2);return new et({angle:90,stops:[{color:re(r,T(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:re(r,T(30,30,30),.5*i),offset:1}]})},qf=(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:re(e[i%e.length].stroke,T(255,255,255),.3);return new et({angle:90,stops:[{color:re(s,T(255,255,255),.5),offset:0},{color:s,offset:.35},{color:re(s,T(30,30,30),.5),offset:1}]})})(i);return s.set(i,n),n}})(),Jf=(t,i,s)=>{const r=i[0].stroke;return new K({shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner,position:{x:.5,y:.5},stops:[{color:!0===t?r:re(r,T(255,255,255),.5*s),offset:0},{color:r,offset:.5},{color:!0===t?r:re(r,T(0,0,0),.5*s),offset:1}]})},Zf=ve((()=>{const t=T(255,255,255),i=new U({color:t}),s=!0,r=new io({spread:1,blur:9,offset:{x:0,y:0},color:T(0,0,0,150)}),n=new K({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:T(50,51,52)},{offset:.5,color:T(14,15,16)},{offset:1,color:T(0,0,0)}]}),o=new U({color:T(45,45,45)}),h=new K({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(120,120,120,100)},{offset:1,color:T(0,0,0,50)}]}),a=new K({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(30,30,30,200)},{offset:1,color:T(0,0,0,255)}]}),l=new U({color:T(255,255,220)}),u=new U({color:T(255,255,166)}),c=new U({color:T(255,255,220)}),d=new U({color:T(255,255,220,130)}),f=new U({color:T(255,255,200)}),g=f,y=g,m=new et({angle:45,stops:[{offset:0,color:T(230,230,230)},{offset:1,color:T(150,150,150)}]}),p=new U({color:T(220,220,220)}),A=new U({color:T(200,200,200,50)}),x=new U({color:T(200,200,200,150)}),S=new U({color:T(200,200,200,20)}),b=new U({color:T(150,150,150)}),v=new et({angle:0,stops:[{offset:0,color:T(10,10,10,220)},{offset:1,color:T(30,30,30,220)}]}),M=i,E=T(255,255,200),k=v,C=M,D=T(20,20,20),F=T(0,0,0),I=t,L=T(150,150,150),z=T(50,50,50),V=T(50,50,50),P=T(100,100,100),R=T(200,200,200),B=[T(255,255,91,255),T(255,205,91,255),T(255,155,91,255),T(255,196,188,255),T(255,148,184,255),T(219,148,198,255),T(235,196,224,255),T(169,148,198,255),T(148,226,198,255),T(148,255,176,255),T(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),_=t.setA(20),O=T(176,255,157,255),N=T(255,112,76,255),G={mapChartFillStyle:new et({angle:135,stops:[{color:T(255,255,91,255),offset:0},{color:T(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,B,.5),pieChartSliceFillStylePalette:$f(s,B,1),funnelChartSliceFillStylePalette:jf(s,B,1),pyramidChartSliceFillStylePalette:jf(s,B,1),rectangleSeriesFillStyle:qf(s,B),gaugeChartGaugeFillStyle:Jf(s,B,1)},W=new U({color:T(176,255,157,255)}),Y=new U({color:T(255,146,146,255)}),H=new U({color:T(176,255,157,255)}),X=new U({color:T(230,63,63,255)}),$=new U({color:T(176,255,157,120)}),j=new U({color:T(229,63,63,180)}),q=new U({color:T(27,37,36,255)}),J=new U({color:T(62,27,27,255)}),Z=[T(255,0,0),T(255,255,0),T(0,255,0)],Q=[T(10,10,255),T(10,190,255),T(251,255,0),T(255,38,0)],tt=[T(255,255,0),T(255,204,0),T(255,128,0),T(255,0,0)],it=[T(0,0,0),T(167,4,69,255),T(255,0,0),T(252,252,168,255)],st=new K({stops:[{color:T(61,61,80,100),offset:0},{color:T(44,44,55,30),offset:1}]}),rt=new U({color:T(148,148,198,255)}),nt=$.getColor().setA(255),ot=T(100,100,100);return Yf({isDark:s,highlightColorOffset:T(60,60,60,60),highlightColorOffsetAxisOverlay:T(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:A,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:b,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:E,resultTableBackgroundFillStyle:k,resultTableBackgroundBorderFillStyle:C,uiBackgroundColor:D,uiBackgroundBorderColor:F,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:L,uiStrokeColorContrastLow:z,dataStrokeColorContrastHigh:V,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:R,dataColorPalette:B,dataColorPaletteInverted:[{area:T(190,50,50,100),border:T(210,80,80)}],dataHighlightOverlayColor:_,dataColorPositive:O,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new U({color:T(0,0,0,180)}),zoomBandChartSplitterColor:w("#FBFB5A"),zoomBandChartKnobFillStyle:t=>new Xn({source:Hf(t,"zoomBandChart/darkgold-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:G},{positiveTextFillStyle:W,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:$,negativeAreaFillStyle:j,positiveBackgroundFillStyle:q,negativeBackgroundFillStyle:J,badGoodColorPalette:Z,coldHotColorPalette:Q,intensityColorPalette:tt,spectrogramColorPalette:it,bollingerFillStyle:st,bollingerBorderFillStyle:rt,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:ot})})),Kf=ve((()=>{const t=T(255,255,255),i=new U({color:t}),s=!0,r=new io({spread:0,blur:9,offset:{x:0,y:0},color:T(105,255,236,40)}),n=new U({color:T(2,21,30)}),o=new K({stops:[{color:T(19,40,66,150),offset:0},{color:T(0,0,0,150),offset:1}]}),h=new U({color:T(0,5,8,150)}),a=i,l=i,u=i,c=new U({color:T(255,255,220,130)}),d=i,f=i,g=f,y=new U({color:T(20,224,250,255)}),m=i,p=new U({color:T(61,94,110,100)}),A=new U({color:T(61,94,110,255)}),x=new U({color:T(61,94,110,40)}),S=i,b=new U({color:T(0,18,23,255)}),v=i,M=t,E=new U({color:T(0,17,22,240)}),k=i,C=T(0,38,48,220),D=T(0,0,0),F=t,I=T(150,150,150),L=T(19,78,93),z=T(50,50,50),V=T(0,36,48),P=T(200,200,200),R=[T(45,253,253,255),T(44,172,247,255),T(46,100,248,255),T(96,84,199,255),T(184,104,245,255),T(98,160,218,255),T(43,238,245,255),T(38,140,206,255),T(112,96,224,255),T(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),B=t.setA(50),_=T(3,217,194,255),O=T(230,63,63,255),N={mapChartFillStyle:new et({angle:135,stops:[{color:T(118,248,231,255),offset:0},{color:T(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,R,1),pieChartSliceFillStylePalette:$f(s,R,1),funnelChartSliceFillStylePalette:jf(s,R,1),pyramidChartSliceFillStylePalette:jf(s,R,1),rectangleSeriesFillStyle:qf(s,R),gaugeChartGaugeFillStyle:Jf(s,R,1)},G=new U({color:T(45,253,253,255)}),W=new U({color:T(255,146,146,255)}),Y=new U({color:T(45,253,253,255)}),H=new U({color:T(230,63,63,255)}),X=new U({color:T(1,190,164,120)}),$=new U({color:T(229,63,63,180)}),j=new U({color:T(1,53,57,255)}),q=new U({color:T(62,27,27,255)}),J=[T(1,104,119,255),T(0,165,144,255),T(0,246,214,255)],Z=[T(0,87,95,255),T(0,125,124,255),T(1,209,182,255),T(0,255,221,255),T(218,112,112,255),T(172,47,47,255)],Q=[T(126,255,253,255),T(50,233,230,255),T(0,196,193,255),T(62,138,178,255),T(139,88,191,255),T(162,55,143,255)],tt=[T(13,31,52,255),T(101,50,118,255),T(1,142,172,255),T(2,196,170,255),T(0,255,221,255)],it=new K({stops:[{color:T(122,103,254,70),offset:0},{color:T(178,168,255,10),offset:1}]}),st=new U({color:T(122,103,254,255)}),rt=X.getColor().setA(255),nt=T(15,83,83);return Yf({isDark:s,highlightColorOffset:T(60,60,60,60),highlightColorOffsetAxisOverlay:T(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new Xn({source:Hf(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:A,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:E,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:C,uiBackgroundBorderColor:D,uiStrokeColorContrastHigh:F,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:L,dataStrokeColorContrastHigh:z,dataStrokeColorContrastMedium:V,dataStrokeColorContrastLow:P,dataColorPalette:R,dataColorPaletteInverted:[{area:T(170,60,210,100),border:T(210,100,250)}],dataHighlightOverlayColor:B,dataColorPositive:_,dataColorNegative:O,zoomBandChartDefocusOverlayFillStyle:new U({color:T(0,0,0,180)}),zoomBandChartSplitterColor:w("#2BF4F4"),zoomBandChartKnobFillStyle:t=>new Xn({source:Hf(t,"zoomBandChart/turquoise-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:W,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:$,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:q,badGoodColorPalette:J,coldHotColorPalette:Z,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),Qf=ve((()=>{const t=!1,i=new io({spread:0,blur:6,offset:{x:2,y:-2},color:T(0,0,0,30)}),s=new K({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:T(255,255,255)},{offset:1,color:T(255,255,255)}]}),r=new U({color:T(219,227,233,255)}),n=new K({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(255,255,255,200)},{offset:1,color:T(240,244,246,200)}]}),o=new K({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(255,255,255,255)},{offset:1,color:T(255,255,255,255)}]}),h=new U({color:T(33,43,49)}),a=new U({color:T(33,43,49)}),l=new U({color:T(33,43,49)}),u=new U({color:T(33,43,49,150)}),c=new U({color:T(33,43,49)}),d=c,f=d,g=new et({angle:45,stops:[{offset:0,color:T(225,225,225)},{offset:1,color:T(225,225,225)}]}),y=new U({color:T(168,186,199,255)}),m=new U({color:T(168,186,199,120)}),p=new U({color:T(168,186,199,40)}),A=new U({color:T(168,186,199,40)}),x=new U({color:T(128,146,159,255)}),S=new et({angle:0,stops:[{offset:0,color:T(255,255,255,240)},{offset:1,color:T(255,255,255,240)}]}),b=new U({color:T(168,186,199)}),v=T(255,255,200),M=new U({color:T(255,255,255,240)}),E=new U({color:T(128,146,159,255)}),k=T(255,255,255,255),C=T(168,168,199,255),D=T(168,186,199,255),F=T(168,186,199,255),I=T(168,186,199,255),L=T(168,186,199,255),z=T(100,100,100),V=T(200,200,200),P=[T(28,181,140,255),T(255,132,0,255),T(240,39,39,255),T(86,121,251,255),T(2,181,213,255),T(13,212,158,255),T(22,167,3,255),T(234,103,232,255),T(62,183,179,255),T(140,93,3,255),T(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),R=T(150,150,150,80),B=T(46,182,120,255),_=T(255,66,66,255),O=new qi({thickness:2,fillStyle:new U({color:T(168,186,199,255)})}),N={mapChartFillStyle:new et({angle:-45,stops:[{color:T(2,181,213,255),offset:0},{color:T(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(t,P,.8),pieChartSliceFillStylePalette:$f(t,P,.8),funnelChartSliceFillStylePalette:jf(t,P,.5),pyramidChartSliceFillStylePalette:jf(t,P,.5),rectangleSeriesFillStyle:qf(t,P),gaugeChartGaugeFillStyle:Jf(t,P,.8),chartXYSeriesBackgroundStrokeStyle:O,chart3DSeriesBackgroundStrokeStyle:O,polarChartSeriesBackgroundStrokeStyle:O,spiderChartSeriesBackgroundStrokeStyle:O,dataGridTextFillStyle:new U({color:T(0,88,64,255)})},G=new U({color:T(4,146,108,255)}),W=new U({color:T(240,39,39,255)}),Y=new U({color:T(28,181,140,255)}),H=new U({color:T(230,88,88,255)}),X=new U({color:T(28,181,140,180)}),$=new U({color:T(230,88,88,180)}),j=new U({color:T(229,243,228)}),q=new U({color:T(232,225,216)}),J=[T(193,48,48,255),T(240,234,60,255),T(45,191,55,255)],Z=[T(10,19,255,255),T(15,191,250,255),T(249,255,2,255),T(253,133,0,255),T(255,24,0,255)],Q=[T(50,99,213),T(8,179,77),T(255,246,0),T(255,126,0),T(189,36,30)],tt=[T(16,64,176),T(8,179,77),T(255,246,0),T(255,126,0),T(168,6,0)],it=new U({color:T(185,198,207,255)}),st=new K({stops:[{color:T(151,190,220,10),offset:0},{color:T(151,190,220,50),offset:1}]}),rt=X.getColor().setA(255),nt=T(150,150,150);return Yf({isDark:t,highlightColorOffset:T(-60,-60,-60,60),highlightColorOffsetAxisOverlay:T(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:A,cursorGridFillStyle:x,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:k,uiBackgroundBorderColor:C,uiStrokeColorContrastHigh:D,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:I,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:z,dataStrokeColorContrastLow:V,dataColorPalette:P,dataColorPaletteInverted:[{area:T(190,50,50,100),border:T(210,80,80)}],dataHighlightOverlayColor:R,dataColorPositive:B,dataColorNegative:_,zoomBandChartDefocusOverlayFillStyle:new U({color:T(255,255,255,180)}),zoomBandChartSplitterColor:w("#505D65"),zoomBandChartKnobFillStyle:t=>new Xn({source:Hf(t,"zoomBandChart/light-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:W,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:$,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:q,badGoodColorPalette:J,coldHotColorPalette:Z,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:st,bollingerBorderFillStyle:it,highlightPointColor:T(0,0,0),highlightDataGridColor:rt,unfocusedDataColor:nt})})),tg=ve((()=>{const t=!1,i=new K({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:T(255,255,255)},{offset:1,color:T(255,255,255)}]}),s=new U({color:T(214,236,216,255)}),r=new K({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(233,244,231,70)},{offset:1,color:T(233,244,231,200)}]}),n=new K({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(255,255,255,255)},{offset:1,color:T(255,255,255,255)}]}),o=new U({color:T(1,61,53)}),h=new U({color:T(1,61,53)}),a=new U({color:T(1,61,53)}),l=new U({color:T(1,61,53,150)}),u=new U({color:T(1,61,53)}),c=u,d=c,f=new et({angle:45,stops:[{offset:0,color:T(225,225,225)},{offset:1,color:T(225,225,225)}]}),g=new U({color:T(188,211,186,255)}),y=new U({color:T(188,211,186,150)}),m=new U({color:T(188,211,186,50)}),p=new U({color:T(188,211,186,50)}),A=new U({color:T(104,148,111,255)}),x=new et({angle:0,stops:[{offset:0,color:T(255,255,255,240)},{offset:1,color:T(255,255,255,240)}]}),S=new U({color:T(104,148,111)}),b=T(255,255,200),v=new U({color:T(255,255,255,240)}),M=new U({color:T(104,148,111,255)}),E=T(255,255,255,255),k=T(179,201,183,255),C=T(188,211,186,255),D=T(188,211,186,255),F=T(188,211,186,255),I=T(188,211,186,255),L=T(100,100,100),z=T(200,200,200),V=[T(138,195,142,255),T(193,161,114,255),T(178,99,99,255),T(142,156,210,255),T(154,209,219,255),T(164,212,199,255),T(104,156,97,255),T(196,147,195,255),T(92,190,187,255),T(126,100,51,255),T(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),P=T(150,150,150,80),R=T(46,182,84,255),B=T(232,96,96,255),_=new qi({thickness:2,fillStyle:new U({color:T(188,211,186,255)})}),O={mapChartFillStyle:new et({angle:-45,stops:[{color:T(118,160,121,255),offset:0},{color:T(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:Xf(t,V,.8),pieChartSliceFillStylePalette:$f(t,V,.8),pyramidChartSliceFillStylePalette:jf(t,V,.5),funnelChartSliceFillStylePalette:jf(t,V,.5),rectangleSeriesFillStyle:qf(t,V),gaugeChartGaugeFillStyle:Jf(t,V,.8),chartXYSeriesBackgroundStrokeStyle:_,chart3DSeriesBackgroundStrokeStyle:_,polarChartSeriesBackgroundStrokeStyle:_,spiderChartSeriesBackgroundStrokeStyle:_,dataGridTextFillStyle:new U({color:T(77,66,21,255)})},N=new U({color:T(93,151,97,255)}),G=new U({color:T(178,99,99,255)}),W=new U({color:T(138,195,142,255)}),Y=new U({color:T(178,99,99,255)}),H=new U({color:T(138,195,142,180)}),X=new U({color:T(178,99,99,180)}),$=new U({color:T(224,240,237)}),j=new U({color:T(251,227,227)}),q=[T(178,99,99,255),T(215,224,111,255),T(80,186,88,255)],J=[T(62,64,142,255),T(66,131,77,255),T(250,250,135,255),T(202,161,78,255),T(179,53,53,255)],Z=[T(64,86,138),T(123,192,205),T(255,252,149),T(220,155,92),T(184,78,74)],Q=[T(64,86,138),T(123,192,205),T(255,252,149),T(220,155,92),T(132,60,57)],tt=new U({color:T(185,198,207,255)}),it=new K({stops:[{color:T(151,190,220,10),offset:0},{color:T(151,190,220,50),offset:1}]}),st=H.getColor().setA(255),rt=T(150,150,150);return Yf({isDark:t,highlightColorOffset:T(-60,-60,-60,60),highlightColorOffsetAxisOverlay:T(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:A,legendBackgroundFillStyle:x,legendBackgroundBorderFillStyle:S,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:v,resultTableBackgroundBorderFillStyle:M,uiBackgroundColor:E,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:C,uiStrokeColorContrastMedium:D,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:I,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:z,dataColorPalette:V,dataColorPaletteInverted:[{area:T(210,70,70,100),border:T(200,110,110)}],dataHighlightOverlayColor:P,dataColorPositive:R,dataColorNegative:B,zoomBandChartDefocusOverlayFillStyle:new U({color:T(255,255,255,180)}),zoomBandChartSplitterColor:w("#446A40"),zoomBandChartKnobFillStyle:t=>new Xn({source:Hf(t,"zoomBandChart/lightnature-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O},{positiveTextFillStyle:N,negativeTextFillStyle:G,positiveFillStyle:W,negativeFillStyle:Y,positiveAreaFillStyle:H,negativeAreaFillStyle:X,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:j,badGoodColorPalette:q,coldHotColorPalette:J,intensityColorPalette:Z,spectrogramColorPalette:Q,bollingerFillStyle:it,bollingerBorderFillStyle:tt,highlightPointColor:T(0,0,0),highlightDataGridColor:st,unfocusedDataColor:rt})})),eg=ve((()=>{const t=T(255,255,255),i=new U({color:t}),s=!0,r=new io({spread:1,blur:9,offset:{x:0,y:0},color:T(255,255,255,30)}),n=new U({color:T(6,15,36)}),o=new K({stops:[{color:T(46,13,87,50),offset:0},{color:T(0,0,0,150),offset:1}]}),h=new U({color:T(0,5,8,150)}),a=i,l=i,u=i,c=new U({color:T(255,255,220,130)}),d=i,f=i,g=f,y=new et({angle:45,stops:[{offset:0,color:T(241,133,255,255)},{offset:1,color:T(115,207,238,255)}]}),m=i,p=new U({color:T(61,94,110,100)}),A=new U({color:T(61,94,110,255)}),x=new U({color:T(61,94,110,40)}),S=i,b=new U({color:T(0,18,23,255)}),v=i,M=T(115,207,238,255),E=new U({color:T(0,17,22,240)}),k=i,C=T(0,38,48,255),D=T(0,0,0),F=t,I=T(150,150,150),L=T(19,57,93),z=T(50,50,50),V=T(0,17,48),P=T(200,200,200),R=[T(20,211,237,255),T(98,147,252,255),T(164,73,250,255),T(129,117,253,255),T(95,134,252,255),T(22,133,212,255),T(35,200,242,255),T(104,121,233,255),T(137,69,232,255),T(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),B=t.setA(50),_=T(3,217,194,255),O=T(243,21,110,255),N={mapChartFillStyle:new et({angle:135,stops:[{color:T(118,248,231,255),offset:0},{color:T(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,R,.5),pieChartSliceFillStylePalette:$f(s,R,2),funnelChartSliceFillStylePalette:jf(s,R,1),pyramidChartSliceFillStylePalette:jf(s,R,1),rectangleSeriesFillStyle:qf(s,R),gaugeChartGaugeFillStyle:Jf(s,R,1)},G=new U({color:T(20,211,237,255)}),W=new U({color:T(253,145,178,255)}),Y=new U({color:T(20,211,237,255)}),H=new U({color:T(239,68,121,255)}),X=new U({color:T(20,211,237,120)}),$=new U({color:T(239,68,121,180)}),j=new U({color:T(1,53,57,255)}),q=new U({color:T(94,19,42,255)}),J=[T(174,51,132,255),T(204,107,218,255),T(189,215,253,255)],Z=[T(0,63,95,255),T(0,149,255,255),T(0,225,255,255),T(255,154,254,255),T(204,98,170,255),T(139,39,84,255)],Q=[T(197,241,255,255),T(70,210,255,255),T(0,164,217,255),T(90,99,222,255),T(138,75,192,255),T(151,27,162,255)],tt=[T(13,31,52,255),T(129,54,130,255),T(131,108,176,255),T(7,162,213,255),T(26,247,255,255)],it=new K({stops:[{color:T(219,42,235,60),offset:0},{color:T(237,73,252,10),offset:1}]}),st=new U({color:T(237,73,252,255)}),rt=X.getColor().setA(255),nt=T(8,70,100);return Yf({isDark:s,highlightColorOffset:T(60,60,60,60),highlightColorOffsetAxisOverlay:T(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new Xn({source:Hf(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:A,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:E,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:C,uiBackgroundBorderColor:D,uiStrokeColorContrastHigh:F,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:L,dataStrokeColorContrastHigh:z,dataStrokeColorContrastMedium:V,dataStrokeColorContrastLow:P,dataColorPalette:R,dataColorPaletteInverted:[{area:T(41,130,255,100),border:T(45,110,240)}],dataHighlightOverlayColor:B,dataColorPositive:_,dataColorNegative:O,zoomBandChartDefocusOverlayFillStyle:new U({color:T(0,0,0,180)}),zoomBandChartSplitterColor:w("#DB77FF"),zoomBandChartKnobFillStyle:t=>new Xn({source:Hf(t,"zoomBandChart/cyberspace-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:W,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:$,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:q,badGoodColorPalette:J,coldHotColorPalette:Z,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),ig={};Object.defineProperty(ig,"darkGold",{get:Zf,enumerable:!0}),Object.defineProperty(ig,"turquoiseHexagon",{get:Kf,enumerable:!0}),Object.defineProperty(ig,"light",{get:Qf,enumerable:!0}),Object.defineProperty(ig,"lightNature",{get:tg,enumerable:!0}),Object.defineProperty(ig,"cyberSpace",{get:eg,enumerable:!0});const sg=ig,rg=sg.darkGold,ng=(t,i)=>{i=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=150,n=32;const o=[],h=t.Ln((t=>{const i=new St.Image;i.src=t,i.onload=()=>{o.forEach((t=>{var s;const o=new Xn({source:i,fitMode:e.ImageFitMode.Stretch});null===(s=t.ed)||void 0===s||s.ke(o),r=i.width,n=i.height,l(t)}))}}));let a;if(new St.Image instanceof St.HTMLImageElement){const t=new St.Image;t.src=i,a=new Xn({source:t,fitMode:e.ImageFitMode.Stretch})}else if(St.lcjs_setup){const t=new St.Image;t.src=i;const s=St.lcjs_setup(t.naturalWidth,t.naturalHeight);s.getContext("2d").drawImage(t,0,0),a=new Xn({source:s,fitMode:e.ImageFitMode.Stretch})}else a=new U({color:w("#f00")});const l=t=>{if(t.ed){const e=t.dt.pi({x:t.dt.x.getInnerEnd(),y:t.dt.y.getInnerStart()},{x:-(3+r),y:3}),i=t.dt.pi({x:t.dt.x.getInnerEnd(),y:t.dt.y.getInnerStart()},{x:-3,y:3+n}),s={x:i.x-e.x,y:i.y-e.y};t.ed.Ie(e).q(s)}s&&s.bs()};return s=t.nI("logo",Number.MAX_SAFE_INTEGER),i=>{const r={dt:i};return(i=>{i.ed&&i.ed.dispose(),s&&(i.ed=s.Te(i.dt).ke(a).setMouseInteractions(!0).Ce(rt).setMouseEnterEventHandler((()=>{t.Er(e.MouseStyles.Point)})).setMouseLeaveEventHandler((()=>{t.Er(e.MouseStyles.None)})).setMouseClickEventHandler(og).setTouchEndEventHandler(og),l(i))})(r),o.push(r),{Ds:()=>l(r),W:()=>(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.Rn(h)})(r)}}},og=()=>St.open("https://lightningchart.com/lightningchart-js/");class hg{constructor(){this.SL=this.UI.bind(this),St.addEventListener("scroll",this.SL,{passive:!0})}W(){this.SL&&St.removeEventListener("scroll",this.SL),this.SL=void 0}}class ag{constructor(t,e){this.Pa=t,this.X=e,this.vL=!0,this.xL=null,this.bL=null}}class lg{constructor(t){this.ML=!1,this._L=1,this.wL=t,this.CL={Pa:u(0,0),X:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),vL:!0,xL:null,bL:null},this.kL=u(64,64),this.TL=new Uint8ClampedArray(this.kL.x*this.kL.y*this._L)}FL(t,e){if(!t.vL)return null;if(t.xL&&t.bL){const i=this.FL(t.xL,e);return null!==i?i:this.FL(t.bL,e)}const i=c(t.X.x,t.X.y);if(t.Pa.x+t.X.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.kL.x-t.Pa.x-1),t.Pa.y+t.X.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.kL.y-t.Pa.y-1),t.X.x===e.x&&t.X.y===e.y)return t.vL=!1,t;if(i.xt.X.y)),h?(s=new ag(ri(t.Pa,{x:0,y:1}),u(t.X.x,e.y)),r=new ag(ri(t.Pa,{x:0,y:e.y+1}),u(t.X.x,t.X.y-1-e.y))):(s=new ag(ri(t.Pa,{x:1,y:0}),u(e.x,t.X.y)),r=new ag(ri(t.Pa,{x:e.x+1,y:0}),u(t.X.x-1-e.x,t.X.y))),t.xL=s,t.bL=r,this.FL(t.xL,e)}IL(t,e){const i={PL:!1,Pa:null};let s=this.FL(this.CL,e);if(null===s)for(;null===s&&this.kL.xthis.wL||t.y>this.wL)return!1;const e=new Uint8ClampedArray(t.x*t.y*this._L);for(let i=0;i{this.zL.WL(t)})),this.VL.clear(),this}UL(t,e){const i=this.EL.get(e);if(i)return i.get(t)}YL(t,e,i){let s=this.EL.get(e);if(s||(s=new Map,this.EL.set(e,s)),s.has(t.glyph))return cg.Success;const r=this.OL.IL(i,t.size);if(!r||!r.Pa)return cg.Fail;r.PL&&this.HL();const n=this.OL.LL(r.RL);if(!n)return cg.Fail;let o=this.VL.get(r.RL);if(!o){const t=this.zL.gl.createTexture();if(!t)throw new gt("Failed to create texture for font!");o=t,this.VL.set(r.RL,t)}const h=r.Pa,a=n.kL.x,l=n.kL.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,A=[g,y,m,y,g,p,g,p,m,y,m,p],x=[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:x,texCoords:A,packerId:r.RL,texture:o};s.set(t.glyph,S);const b=this.zL.gl;return b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),b.bindTexture(b.TEXTURE_2D,o),b.texImage2D(b.TEXTURE_2D,0,b.LUMINANCE,n.kL.x,n.kL.y,0,b.LUMINANCE,b.UNSIGNED_BYTE,this.zL.$L?n.TL:new Uint8Array(n.TL)),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),b.bindTexture(b.TEXTURE_2D,null),r.PL?cg.Resize:cg.Success}HL(){this.EL.forEach((t=>{t.forEach(((e,i)=>{const s=this.OL.LL(e.packerId);if(!s)return;const r=e.origin,n=s.kL.x,o=s.kL.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 gg=t=>{if(t instanceof zi||t instanceof yu)return t._i()?"linear-highPrecision":"linear";if(t instanceof Vi){const e={};return t.x instanceof bi&&(e.x={base:t.x.gi()}),t.y instanceof bi&&(e.y={base:t.y.gi()}),["logarithmic",e]}return"linear"},yg=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},mg=(t,e,i)=>"value"===t.getLookUpProperty()?i:"x"===t.getLookUpProperty()?{min:e.vt(),max:e.xt()}:"y"===t.getLookUpProperty()?{min:e.bt(),max:e.Mt()}:"z"===t.getLookUpProperty()?{min:e.Um(),max:e.Wm()}:void 0,pg=t=>!(!t||"value"!==t.lookUpProperty||!t.lut.percentageValues),Ag=t=>(e,i)=>i%2?e:e+t;class xg{constructor(t){this.XL=new Map,this.jL=le("font"),this.ZL=new Map,this.QL=new Set,this.zL=t}GL(t=!1){return(t||0===this.QL.size)&&(this.XL.forEach(((t,e)=>{t.GL(),this.XL.delete(e)})),this.QL.clear()),this}JL(t){this.QL.add(t)}KL(t){this.QL.delete(t)}qL(t,e,i,s){const r=`${s?"dark":"light"} - ${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let n=this.ZL.get(r);n||(n=this.jL(),this.XL.set(n,new fg(this.zL)),this.ZL.set(r,n));const o=this.XL.get(n);if(!o)throw new gt("Failed to get font texture!");let h=0,a=0,l=0;const u=t.split(""),c=e.size,d=.7*e.size,f=Math.round(1*e.size);let g=!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)}})(l,a-h+1,i);return{x:y.x,y:y.y,isEstimate:g}}tR(t,e,i){const s=`${i?"dark":"light"} - ${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let r=this.ZL.get(s);r||(r=this.jL(),this.XL.set(r,new fg(this.zL)),this.ZL.set(s,r));const n=this.XL.get(r);if(!n)throw new gt("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.size;for(let t=0;t{t._a.o=!0})),t=-1,d=0,h=0,o=0,c.clear();continue}if(l===cg.Fail)throw new gt("Failed to create glyph");if(a=n.UL(s,f),!a)throw new gt("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(Ag(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 Sg{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>bg(t)));for(const i of e)t=i(t);return`${me(this.modifiers.filter((t=>vg(t)))).map((t=>t.eR)).join("\n")}\n${t}`}}const bg=t=>"function"==typeof t,vg=t=>t&&"object"==typeof t&&"hR"in t,Mg=(...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},Tg=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),wg=(...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},kg=(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},Dg=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Mg(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Mg(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return Cg(`\t${r} = ${s};`)(i)},Fg=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e},Ig={roundUnsigned:{hR:"roundUnsigned",eR:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{hR:"linearStep",eR:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{hR:"decodeUbyteRGBAEncodedFloat",eR:"\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:{hR:"texelFetchWithFallback",eR:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{hR:"texelFetchWithFallback",eR:"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:{hR:"texelFetchUnsignedWithFallback",eR:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{hR:"texelFetchUnsignedWithFallback",eR:"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:{hR:"modulus",eR:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{hR:"computeScreenSpaceWireframe",eR:"#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}"}},Lg=(t,e)=>{const i=e.steps,s=i.length-1,r=[Mg("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(Eg("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},zg=[Mg("uniform sampler2D uMaskTexture"),Mg("varying vec2 vMaskTextureCoord"),kg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],Vg=[Mg("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;"),kg("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 Rg=(...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},Bg=t=>void 0!==t.find((t=>{var e;return null===(e=t.rR)||void 0===e?void 0:e.nR})),_g=t=>void 0!==t.find((t=>{var e;return null===(e=t.rR)||void 0===e?void 0:e.oR})),Og=(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(Mg("attribute vec3 aNormal"),wg("vec3 normal = aNormal")),"linear-highPrecision"!==n?i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&void 0!==t.variableNameAxisCoord&&(!0!==c?s.push(wg(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(wg(`${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(wg(`${r} ${e.variableNameAxisCoord}_highpart = ${e.attributeNameAxisCoord}_highpart`),wg(`${r} ${e.variableNameAxisCoord}_lowpart = ${e.attributeNameAxisCoord}_lowpart`)):s.push(wg(`${r} ${e.variableNameAxisCoord}_highpart = vec2(${e.attributeNameAxisCoord}_highpartX, ${e.attributeNameAxisCoord}_highpartY)`),wg(`${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(Mg("attribute float aRotDeg"),Mg("uniform float uBaseRotDeg"));const t="cRot",e="aInstanceGeo";s.push(wg(`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(Mg(`${t} vec2 ${i}`));const r="aInstanceGeo";s.push(wg(`vec2 rotatedGeo = vec2(${r}.x * ${i}.y + ${r}.y * ${i}.x, ${r}.y * ${i}.y - ${r}.x * ${i}.x)`))}}if(a&&s.push(Mg(`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(Mg(`${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(Mg(`${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(Mg(`${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(Mg(`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(Mg(`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(Mg("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("matrix4"===n)s.push(Mg("uniform mat4 uMatrix")),i.forEach((t=>{f.push(`vec4 ${t.variableNameWorldCoord} = uMatrix * ${t.attributeNameAxisCoord}`)}));else if("logarithmic"===n[0]){s.push(Mg(`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(${Mi(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(Mg(...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(Mg("uniform vec2 uRatioPxClip"));const t=("attribute"===a.dataType?"a":"u")+"OffsetPixels",e=!0===a.symmetric?"float":r;s.push(Mg(`${a.dataType} ${e} ${t}`));const n=a.halved?" * 0.5":"",o=`${t} * ${a.rotation?"rotatedGeo":"aInstanceGeo"}${n}`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${o} * uRatioPxClip`)}))}if(a&&"wu"===a.sizeUnit){const t=("attribute"===a.dataType?"a":"u")+"OffsetWU",n=!0===a.symmetric?"float":r;s.push(Mg(`${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(Mg("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(Mg(`${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(Mg("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(Eg("gl_Position =",...f)),s},Ng=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(kg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(kg(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(kg(i,...t))}}return r},Ug=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.rR)||void 0===e?void 0:e.aR})))(t)?[Tg("attribute vec4 aColor"),Tg("vColor = aColor"),Mg("attribute vec4 aColorA"),Mg("attribute vec4 aColorB"),Cg("vColor = mix(aColorA, aColorB, aSegmentSide)")]:[],Gg=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.rR)||void 0===e?void 0:e.lR})))(t)?[Tg("attribute float aLookupValue"),Tg("vLookupValue = aLookupValue"),Mg("attribute float aLookupValueA"),Mg("attribute float aLookupValueB"),Cg("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],Wg={"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",rR:{nR:!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:${Rg(t)}`,idFragment:void 0,vertexShaderModifiers:[Mg(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Cg(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTexture,r=t&&t.overrideOpacity;return{idFeature:"Color",rR:{oR:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,lR:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0,aR:"attribute"===t.dataType||void 0},apply:(n,o)=>{let h,a=`Color:${Rg(t)}`;const l=[];let u="FragmentShader";const c=[];if("uniform"===i)c.push(Mg("uniform vec4 uColor"),wg("vec4 colorFragment = uColor"),...s?zg:[]);else if("attribute"===i)h="colorAttribute",l.push(Dg("attribute vec4 aColor","varying vec4 vColor")),c.push(Mg("varying vec4 vColor"),wg("vec4 colorFragment = vColor"));else if("texture"===i)h="colorTexCoord",l.push(Dg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),c.push(Mg("varying vec2 vTextureCoord"),Mg("uniform sampler2D uColorTexture"),Mg("uniform vec4 uColor"),wg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.) {\n colorFragment = uColor;\n }"));else if("texture-coord-calc-gpu"===i)h="colorTexCoord",u="Empty",l.push(Mg("attribute vec2 aTextureCoord"),Mg("varying vec2 vTextureCoord"),Cg("vTextureCoord = gl_Position.xy * 0.5 + 0.5")),c.push(Mg("varying vec2 vTextureCoord"),Mg("uniform sampler2D uColorTexture"),wg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","gl_FragColor = colorFragment;"));else if(Array.isArray(i)&&"image"===i[0])h="colorTexCoord",l.push(Dg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1]===e.ImageFitMode.Tile?c.push(Mg("uniform sampler2D uColorTexture"),Mg("varying vec2 vTextureCoord"),wg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);")):c.push(Mg("uniform sampler2D uColorTexture"),Mg("varying vec2 vTextureCoord"),Mg("uniform vec4 uColor"),wg("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)h="lookup:value",l.push(Dg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;h=`lookup:${t}`,l.push(Dg(e,"varying float vLookupValue"))}c.push(Mg("varying float vLookupValue"),...Lg("vLookupValue",i[2]))}else if(Array.isArray(i)&&"gradient"===i[0]){a=`Color:${Rg(t)}`;const e=i[1],r=e.getColorStops();Q(e)?c.push(Mg("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Mg(...Ct(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Ig.linearStep,wg("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))",...r.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, mixVal));`)),"vec4 colorFragment = color"),...s?zg:[]):it(e)&&c.push(Mg("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Mg(...Ct(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Ig.linearStep,wg("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))",...r.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, magnitude))`)),"vec4 colorFragment = color"),...s?zg:[])}if(!0===s){const t="maskTexture";h=h?`${h} ${t}`:`Color:${t}`,l.push(Dg("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return r&&c.push(Mg("uniform float uOpacity"),kg("colorFragment =","colorFragment.a *= uOpacity")),{vertexShaderModifiers:l,fragmentShader:u,fragmentShaderModifiers:c,idVertex:h,idFragment:a}}}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let r;const n=`ColorShaded3D:${Rg(t)}`;return{idFeature:"ColorShaded3D",rR:{oR:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,lR:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const h=[],a=[];if(h.push("phong"===i&&Dg("normal","varying vec3 vNormal"),Dg("posWorld","varying vec3 vPosWorld")),"uniform"===e)a.push(Mg("uniform vec4 uColorDiffuse"),wg("vec4 colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",h.push(Dg("attribute vec4 aColor","varying vec4 vColor")),a.push(Mg("varying vec4 vColor"),wg("vec4 colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",h.push(Dg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,h.push(Dg(e,"varying float vLookupValue"))}a.push(Mg("varying float vLookupValue"),...Lg("vLookupValue",e[2]))}if(s){const t="wireframe";r=r?`${r},${t}`:t,h.push(Dg("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),a.push(Mg("varying vec3 vTriangleBary"),Mg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Ig.computeScreenSpaceWireframe,kg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&a.push(...Vg),{idVertex:r,idFragment:n,vertexShaderModifiers:h,fragmentShader:"FragmentShader",fragmentShaderModifiers:a}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=[],s=Bg(e),r=t.coordType?t.coordType:s?"vec3":"vec2";return"linear-highPrecision"!==t.axisWorldTranslation?!0!==t.splitPosAttribute?i.push(Mg(`attribute ${r} aPos`)):i.push(Mg("attribute float aPosX"),Mg("attribute float aPosY"),s&&Mg("attribute float aPosZ")):!0===t.splitPosAttribute?i.push(Mg("attribute float aPos_highpartX"),Mg("attribute float aPos_lowpartX"),Mg("attribute float aPos_highpartY"),Mg("attribute float aPos_lowpartY")):i.push(Mg(`attribute ${r} aPos_highpart`),Mg(`attribute ${r} aPos_lowpart`)),i.push(...Og(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"vec4"===t.coordType?void 0:"posAxis",variableNameWorldCoord:"posWorld"})),{idVertex:`VertexLocation:${Rg(t)}`,idFragment:void 0,vertexShaderModifiers:i}}}),Model3D:t=>({idFeature:"Model3D",apply:e=>{const i=[];return i.push(Mg("attribute vec3 aGeoPos"),Mg("uniform mat4 uModelRotation"),Mg("uniform mat4 uModelRotationNormals"),Mg("uniform vec3 uLocationAxis"),Mg("uniform vec3 uModelAlignment"),Mg("uniform vec3 uModelScale"),Mg("uniform vec3 uModelSize"),...Og({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,{attributeNameAxisCoord:"uLocationAxis",variableNameAxisCoord:"locationAxis",variableNameWorldCoord:"locationWorld"}),Eg("gl_Position =","vec3 posWorld = locationWorld + ((uModelRotation * vec4(aGeoPos, 1.0)).xyz - (uModelAlignment + 1.0) * uModelSize/2.0) * uModelScale;"),"attribute"===t.normalSource&&kg("vec3 normal ="," normal = (uModelRotationNormals * vec4(normal, 1.0)).xyz;"),..._g(e)?Ng({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,"posWorld","posAxis"):[]),{vertexShaderModifiers:i,idVertex:`Model3D:${Rg(t)}`,idFragment:void 0}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",apply:e=>({idVertex:`LineInstanced2D:${Rg(t)}`,idFragment:void 0,vertexShaderModifiers:[Mg("uniform float uThicknessPixels"),Mg("uniform vec2 uRatioPxClip"),..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Mg("attribute vec2 aLocationA"),Mg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Mg("attribute vec2 aLocationA_highpart"),Mg("attribute vec2 aLocationB_highpart"),Mg("attribute vec2 aLocationA_lowpart"),Mg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Mg("attribute float aLocationAX"),Mg("attribute float aLocationAY"),Mg("attribute float aLocationBX"),Mg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Mg("attribute float aLocationA_highpartX"),Mg("attribute float aLocationA_highpartY"),Mg("attribute float aLocationB_highpartX"),Mg("attribute float aLocationB_highpartY"),Mg("attribute float aLocationA_lowpartX"),Mg("attribute float aLocationA_lowpartY"),Mg("attribute float aLocationB_lowpartX"),Mg("attribute float aLocationB_lowpartY")]:[],Mg("attribute vec2 aSegmentPosition"),Mg("attribute float aSegmentSide"),...Og(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),t.ensureMinimumSegmentLength&&Mg("uniform vec2 uMinSegmentPixelVector"),kg("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"),...Gg(e),...Ug(e),..._g(e)?Ng(t,!1,"posWorld","posAxis"):[]]})}),Area2D:t=>({idFeature:"Area2D",apply:e=>({idVertex:`Area2D:${Rg(t)}`,idFragment:void 0,vertexShaderModifiers:[..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Mg("attribute vec2 aLocationA"),Mg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Mg("attribute vec2 aLocationA_highpart"),Mg("attribute vec2 aLocationB_highpart"),Mg("attribute vec2 aLocationA_lowpart"),Mg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Mg("attribute float aLocationAX"),Mg("attribute float aLocationAY"),Mg("attribute float aLocationBX"),Mg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Mg("attribute float aLocationA_highpartX"),Mg("attribute float aLocationA_highpartY"),Mg("attribute float aLocationB_highpartX"),Mg("attribute float aLocationB_highpartY"),Mg("attribute float aLocationA_lowpartX"),Mg("attribute float aLocationA_lowpartY"),Mg("attribute float aLocationB_lowpartX"),Mg("attribute float aLocationB_lowpartY")]:[],Mg("attribute float aCurveOrBaseline"),Mg("attribute float aSegmentSide"),...Og(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),kg("worldB = ","vec2 posCoord = mix(worldA, worldB, aSegmentSide)","float baseline = min(posCoord.y, -1.0)","vec2 posWorld = vec2(posCoord.x, mix(posCoord.y, baseline, aCurveOrBaseline))"),...Gg(e),...Ug(e),..._g(e)?Ng(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${Rg(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Mg("uniform float uOffsetWU"),Mg("attribute vec3 aLocationA"),Mg("attribute vec3 aLocationB"),Mg("attribute float aSegmentPosition"),Mg("attribute float aPerpendHorizontal"),Mg("attribute float aPerpendVertical"),...Og({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Bg(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),kg("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)?Ng({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[Mg("attribute vec3 aEdge"),Mg("uniform float uEdgeRoundness"),kg("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:${Rg(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[Mg("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&Ig.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?wg("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"})`):wg("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})`)),...Lg("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(Mg("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&&Ig.roundUnsigned,Ig.modulus,Ig.texelFetchWithFallback[h],"ubyte"===r&&Ig.decodeUbyteRGBAEncodedFloat,wg(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(Mg("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),wg("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${Rg(t)}`,idFragment:`DrawToNormalTexture:${Rg(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(Mg("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&&Ig.roundUnsigned,Ig.modulus,Ig.texelFetchWithFallback[d],"ubyte"===a&&Ig.decodeUbyteRGBAEncodedFloat,wg(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(...Og({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&f.push(Dg("posWorld","varying vec3 vPosWorld"),..."uint"===h?[Ig.texelFetchUnsignedWithFallback[d],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)"),Mg("varying vec3 vNormal",..."uint"===h?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),g.push(Mg("varying vec3 vTriangleBary")),"uniform"===e?g.push(Mg("uniform vec4 uColorDiffuse"),wg("vec4 colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]?"value"===e[1]?(f.push(Dg("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),g.push(Mg("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===l&&Ig.decodeUbyteRGBAEncodedFloat,"bilinear"===i?wg("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"})`):wg("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"),...Lg("intensityP",e[2]))):(f.push(Dg(`posAxis.${e[1]}`,"varying float vLookupValue")),g.push(Mg("varying float vLookupValue"),...Lg("vLookupValue",e[2]))):void 0===e&&g.push(wg("vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0)")),"phong"===r&&g.push(...Vg),n&&(f.push(Mg("attribute vec3 aTriangleBary"),Dg("aTriangleBary","varying vec3 vTriangleBary")),g.push(Mg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Ig.computeScreenSpaceWireframe,kg("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:${Rg(t)}`,idFragment:`SurfaceGrid:${Rg(t)}`,vertexShaderModifiers:f,fragmentShader:"FragmentShader",fragmentShaderModifiers:g}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${Rg(t)}`,idFragment:`DebugSurfaceGridNormals:${Rg(t)}`,vertexShaderModifiers:[Mg("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"]),Ig.roundUnsigned,Ig.modulus,Ig.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&Ig.decodeUbyteRGBAEncodedFloat,wg(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?[Ig.texelFetchUnsignedWithFallback[i]]:[],...Og({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),kg("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:[Mg("uniform vec3 uCameraLoc"),kg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[Mg("attribute float aSegmentInside"),Mg("varying float vSegmentInside"),Mg("varying float vSegmentSide"),kg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[Fg("#extension GL_OES_standard_derivatives : enable"),Mg("uniform float uAALimit"),Mg("varying float vSegmentInside"),Mg("varying float vSegmentSide"),kg("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:${Rg(t)}`,idFragment:`Glow1D:${Rg(t)}`,vertexShaderModifiers:[Dg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Mg("uniform sampler2D uTexture"),Mg("varying vec2 vTextureCoord"),Mg("uniform vec2 uTextureSize"),r&&Mg("uniform vec2 uOffsetPx"),!r&&Mg("uniform sampler2D uTextureFirstGlowPass"),!r&&Mg("uniform vec4 uGlowColor"),kg("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:[Mg("uniform vec4 uColor"),wg("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:[Dg("attribute vec4 aColor","varying vec4 vColor")],fragmentShaderModifiers:[Mg("varying vec4 vColor"),wg("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:[Dg("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:[Mg("attribute vec2 aLengthSoFar"),Mg("varying float vLengthSoFar"),Mg("uniform vec2 uStippleCount"),Cg("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Mg("uniform sampler2D uStippleTexture"),Mg("uniform float uStippleScale"),Mg("varying float vLengthSoFar"),"webgl1"===e&&Mg("uniform float uStippleTextureWidthLimiter"),kg("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:[Mg("attribute vec2 aLengthSoFarA"),Mg("attribute vec2 aLengthSoFarB"),Mg("varying float vLengthSoFar"),Mg("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:[Mg("uniform sampler2D uStippleTexture"),Mg("uniform float uStippleScale"),Mg("varying float vLengthSoFar"),"webgl1"===e&&Mg("uniform float uStippleTextureWidthLimiter"),kg("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:${Rg(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[Mg("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"),Ig.texelFetchWithFallback[i],"ubyte"===o&&Ig.decodeUbyteRGBAEncodedFloat,wg("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&&wg("vec4 colorFragment = uColor"),r&&kg("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?Lg("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"},Hg={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 Xg{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new yt(`Could not find ${this.uR()} ${this.cR()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}uR(){return this.id.toString()}cR(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class $g extends Xg{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class jg extends Xg{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class qg{constructor(t,e,i,s){this.dR=new Map,this.fR=new Map,this.AR=i,this.gR=i.createProgram(),this.pR=`${t.uR()} vertex`,this.mR=`${e.uR()} fragment`,i.attachShader(this.gR,t.shader),i.attachShader(this.gR,e.shader),i.bindAttribLocation(this.gR,0,"aPos"),i.linkProgram(this.gR),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""}yR(t){return fe(0,(()=>ge()))}SR(t){const e=this.vR(t);if(void 0===e)throw this.yR(`Could not get ${t} uniform from ${this.pR} and ${this.mR} shaders.`);return e}vR(t){const e=this.dR.get(t);if(e)return e;const i=this.AR.getUniformLocation(this.gR,t);return i?(this.dR.set(t,i),i):void 0}xR(t){const e=this.bR(t);if(void 0===e)throw this.yR(`Could not get ${t} attribute from ${this.pR} and ${this.mR} shaders.`);return e}bR(t){const e=this.fR.get(t);if(e||0===e)return e;const i=this.AR.getAttribLocation(this.gR,t);return i>=0?(this.fR.set(t,i),i):void 0}W(){this.AR.deleteProgram(this.gR)}}const Jg=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/,Zg=t=>{let e;try{e=St.getComputedStyle(t)}catch(t){return null}return e};function Kg(t){const e=Zg(t);return!!e&&("fixed"===e.position||!!("auto"!==e.zIndex&&"static"!==e.position||function(t){const e=Zg(iy(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(Kg(t[e]))return t[e];return null}function ty(t){var e;return t&&Number((null===(e=Zg(t))||void 0===e?void 0:e.zIndex)||0)||0}function ey(t){const e=[];for(;t;)e.push(t),t=iy(t);return e}function iy(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.host)||t.parentNode}class sy extends hg{constructor(t){if(super(),this.MR=new Map,this._R=new Map,this.wR=new Map,this.CR=!0,this.kR=null,this.TR=null,this.FR=null,this.IR=null,this.PR=0,this.DR=0,this.BR=0,this.LR=!1,this.RR=!0,this.$i=!1,this.ER=le(`chart-engine-${(new Date).getTime()}${Math.trunc(1e6*Math.random()).toString()}`),this.X={x:100,y:100},this.VR=()=>{this.zR&&clearTimeout(this.zR),this.zR=setTimeout((()=>this.Ur()),12)},this.OR=t=>{const e=t.intersectionRatio>0,i=t.target.getAttribute("data-lcjs-engine-id");if(i){const t=this.MR.get(i);if(t){const s=t.NR();t.GR(e),e?this._R.set(i,t):this._R.delete(i),s!==e&&t.bs()}}},this.WR=(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.TR.gR),o.clear(o.COLOR_BUFFER_BIT),n.Rr.getBoundingClientRect()){const t=n.UR();o.viewport(0,0,t.x,t.y),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.YR),o.uniform1i(this.PR,0),o.uniformMatrix4fv(this.DR,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o.bindBuffer(o.ARRAY_BUFFER,this.FR),o.enableVertexAttribArray(0),o.vertexAttribPointer(this.BR,2,o.FLOAT,!1,0,0),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),n.HR&&(n.HR.clearRect(0,0,n.HR.canvas.width,n.HR.canvas.height),n.HR.drawImage(this.$R,0,this.$R.height-t.y,t.x,t.y,0,0,n.HR.canvas.width,n.HR.canvas.height))}},this.XR=(t,e,i,s,r)=>{const n=this.gl;n.bindFramebuffer(null==n?void 0:n.FRAMEBUFFER,null),n.useProgram(this.TR.gR),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.Rr.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.jR-t*this.jR,a*this.jR+e*this.jR,i*this.jR,o*this.jR)}n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,i.YR),n.uniform1i(this.PR,0),n.uniformMatrix4fv(this.DR,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),n.bindBuffer(n.ARRAY_BUFFER,this.FR),n.enableVertexAttribArray(0),n.vertexAttribPointer(this.BR,2,n.FLOAT,!1,0,0),n.drawArrays(n.TRIANGLES,0,6)})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.ZR=(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.UR();o.bindFramebuffer(o.READ_FRAMEBUFFER,n.QR[1]),o.blitFramebuffer(0,0,h.x,h.y,0,this.$R.height-h.y,h.x,this.$R.height,o.COLOR_BUFFER_BIT,o.LINEAR),n.HR&&(n.HR.clearRect(0,0,n.HR.canvas.width,n.HR.canvas.height),n.HR.drawImage(this.$R,0,0)),o.bindFramebuffer(o.FRAMEBUFFER,null)},this.JR=(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.Rr.getBoundingClientRect();if(r){const o=r.right-r.left,h=r.bottom-r.top,a=r.left,l=s-r.bottom,u=i.UR();n.bindFramebuffer(n.READ_FRAMEBUFFER,i.QR[1]),n.blitFramebuffer(0,0,u.x,u.y,a*this.jR-t*this.jR,l*this.jR+e*this.jR,(a-t+o)*this.jR,(l+e+h)*this.jR,n.COLOR_BUFFER_BIT,n.LINEAR)}})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.zR=void 0,this.En=t,!St.requestAnimationFrame||!St.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");let e=1;if(t&&t.KR)e=!0===t.KR?St.devicePixelRatio||1:t.KR||1;else{const t=St.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(e=St.devicePixelRatio||1)}this.jR=e,t.oo=!0===t.oo,this.RR=!1!==t.qR,this.tE=!1!==t.iE,this.sE=t.sE||!1;let i=!1;if(t.$R)if("string"==typeof t.$R){const e=St.document.getElementById(t.$R);if(!e)throw new Error(`Canvas "${t.$R}" doesn't exist.`);this.$R=e,i=!0}else this.$R=t.$R,i=!0;else this.$R=St.document.createElement("canvas");const s={preserveDrawingBuffer:!0,alpha:!0,antialias:!1};if(2!==t.eE&&t.eE){const e=this.$R.getContext("webgl",{...s,antialias:!!t.qR})||this.$R.getContext("experimental-webgl",{...s,antialias:!!t.qR});this.gl=e,this.hE=!1}else{const t=this.$R.getContext("webgl2",s);this.gl2={ctx:t},this.gl=t,this.hE=!0}if(!this.gl)throw new gt("No WebGL context available."+((null==t?void 0:t.eE)?`\nSelected explicit target: WebGL ${t.eE}`:""));const r=[];if(this.rE={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.rE).forEach((t=>{null===this.rE[t]&&r.push(t)})),this.hE)this.nE=!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.CR=!1),Object.keys(t).forEach((e=>{null===t[e]&&r.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.nE=!!e.OES_texture_float,this.gl1={ctx:this.gl,rE:t,optional:e}}const n=r;if(n.length>0&&!1!==t.oo){const t=St.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=St.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),St.document.body.appendChild(t),t.appendChild(e),St.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",n.join(", "))}if(this.oE=this.sE?this.aE(this.hE?this.ZR.bind(this):this.WR.bind(this)).bind(this):this.lE(this.hE?this.JR.bind(this):this.XR.bind(this)).bind(this),St.ResizeObserver){const t=t=>{for(const e of t)e.target===this.$R&&this.uE()};this.co=new St.ResizeObserver(t.bind(this)),this.co.observe(this.$R)}if(this.cE=((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=St.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)}))})),!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 A=n.get(u.id);if(c="new",A)return c="existing",g=A.vertexShaderSrc,y=A.fragmentShaderSrc,A;const x=u.vertexShader.id;let S=s.get(x);if(S)g=S.src,d="existing";else{d="new";const t=new Sg(u.vertexShader.modifiers).build(Yg[u.vertexShader.template]),{source:e,info:r}=h(t,"vertex");g=e,m=r,S=new $g(x,e,i,r),s.set(x,S),o.vertexShaders+=1}const b=u.fragmentShader;let v;const M=b.id;if(v=r.get(M),v)y=v.src,f="existing";else{f="new";const t=Hg[b.template],e=new Sg([...b.modifiers]).build(t),{source:s,info:n}=h(e,"fragment",u.hints);y=s,p=n,v=new jg(M,s,i,n),r.set(M,v),o.fragmentShaders+=1}const T=new qg(S,v,i,u);return n.set(u.id,T),o.programs+=1,o.totalMs+=St.performance.now()-e,T}catch(t){throw fe(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 St.alert(t),new Error(t)}))}}})(this.gl,!this.hE),this.iR=(()=>{const t=St.document.createElement("canvas"),e=t.getContext("2d",{willReadFrequently:!0});if(!e)throw new gt("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))})),St.addEventListener("resize",this.VR,{passive:!0}),!this.hE){if(this.TR=this.cE(Wg["2DCompose"],Wg.Color({dataType:"texture-coord-calc-gpu"}),Wg.VertexLocation({axisWorldTranslation:"matrix4",normalSource:void 0,coordType:"vec4"})),!this.TR.gR)throw new gt("Unable to setup composition shader!");const t=this.gl,e=t.getUniformLocation(this.TR.gR,"uColorTexture");if(!e)throw new gt("Unable to setup composition shader! Failed to find uColorTexture");const i=t.getUniformLocation(this.TR.gR,"uMatrix");if(!i)throw new gt("Unable to setup composition shader! Failed to find uMatrix");this.PR=e,this.DR=i,this.BR=t.getAttribLocation(this.TR.gR,"aPos"),this.FR=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.FR),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.IR=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.IR),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)}}aE(t){return e=>{this.kR=null;const i=this.gl.canvas,s=Array.from(this._R.values());this.LR=!1,s.forEach((s=>{const r=s.UR();(this.X.x{this.kR=null,"style"in this.gl.canvas&&!this.En.pE&&(this.gl.canvas.style.transform=`translateX(${window.scrollX}px) translateY(${window.scrollY}px)`);const i=this.gl.canvas,s=this.$R.clientHeight,r=this.$R.clientWidth;let n=0,o=0;if(i instanceof HTMLCanvasElement){i.width===r*this.jR&&i.height===s*this.jR||(i.width=r*this.jR,i.height=s*this.jR);const t=i.getBoundingClientRect();n=t.x,o=t.y}const h=Array.from(this._R.values());this.LR=!1,h.sort(((t,e)=>t.mE()-e.mE())).forEach((t=>{t.Jr&&t.gE(e)})),t(n,o,r,s,h),this.LR&&this.uE()}}uE(t){return!this.LR&&t&&(this.LR=!0),this.kR||this.$i||(this.kR=St.requestAnimationFrame(this.oE)),this}yE(t){const e=this.ER();return t.Rr.setAttribute("data-lcjs-engine-id",e),this.MR.set(e,t),t.SE(this.MR.size-1),t.GR(!0),this._R.set(e,t),this.AE&&this.AE.observe(t.Rr),this.zR&&clearTimeout(this.zR),this.zR=setTimeout((()=>this.Ur()),0),this}vE(t){const e=t.Rr.getAttribute("data-lcjs-engine-id");return e?(this.MR.delete(e),this._R.delete(e),this.AE&&this.AE.unobserve(t.Rr),t.Rr.removeAttribute("data-lcjs-engine-id"),this):this}Ur(){if(this.AE){const t=this.AE.takeRecords();for(let e=0;efunction(t,e){if(t===e)throw new Error("Cannot compare node with itself");const i={a:ey(t),b:ey(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=ty(Qg(i.a)),n=ty(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.Rr,e.Rr))).forEach(((t,e)=>t.SE(e))),this.uE(!0),this}UI(){return this.uE(),this}W(){var t;if(this.$i)return;this.$i=!0,super.W(),this.kR&&(St.cancelAnimationFrame(this.kR),this.kR=null),this.LR=!1,this.co&&(this.co.disconnect(),this.co=void 0),this.AE&&(this.AE.disconnect(),this.AE=void 0),St.removeEventListener("resize",this.VR),this.VR=void 0,this.MR.forEach((t=>{t.W()})),this.MR.clear(),Array.from(this.wR.values()).forEach((t=>{t.GL(!0)})),this.wR.clear();const e=this.gl;e.deleteBuffer(this.FR),e.deleteBuffer(this.IR),this.$R&&!this.En.$R?(this.$R.width=1,this.$R.height=1,null===(t=this.$R.parentElement)||void 0===t||t.removeChild(this.$R),this.$R=void 0):this.$R=void 0,this.cE=void 0,this.iR=void 0,this.oE=()=>{},this.rE.WEBGL_lose_context&&this.rE.WEBGL_lose_context.loseContext()}}const ry=(t,e,i,s)=>r=>{const n={theme:rg,...i,...r},o=t(n),h=e||s?ng(o,s):void 0,a=new Cf(o.En,r,o,o.W.bind(o),h);return o.Co((t=>a.yL(t))).wo((()=>a.j())).bs(),a},ny=(t,e)=>{t.Co((t=>{e.Fe(t)})).wo((()=>e.j())).bs()},oy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new Nh(o.En,Od(o,1).aI(0),at,o.W.bind(o),h);return ny(o,a),a},hy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new Pd(o.En,Od(o,1).aI(0),at,o.W.bind(o),h,r);return ny(o,a),a},ay=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new ac(o.En,Od(o,1).aI(0),at,o.W.bind(o),h,r);return ny(o,a),a},ly=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new mu(o.En,Od(o,1).aI(0),at,o.W.bind(o),h,r);return ny(o,a),a},uy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new(r&&r.type?r.type:Da)(o.En,Od(o,1).aI(0),at,o.W.bind(o),h,void 0,r);return ny(o,a),a},cy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new(r&&r.type?r.type:Bu)(o.En,Od(o,1).aI(0),at,o.W.bind(o),h,void 0,!0!==(null==r?void 0:r.disableAnimations)&&!1!==(null==r?void 0:r.animationsEnabled));return ny(o,a),a},dy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new(r&&r.type?r.type:Eu)(o.En,Od(o,1).aI(0),at,o.W.bind(o),h,void 0,r);return ny(o,a),a},fy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new(r&&r.type?r.type:Hu)(o.En,Od(o,1).aI(0),at,o.W.bind(o),h,void 0,r);return ny(o,a),a},gy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new Al(o.En,Od(o,1).aI(0),at,o.W.bind(o),h,r,void 0);return ny(o,a),a},yy=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new al(o.En,Od(o,1).aI(0),at,o.W.bind(o),h,void 0,r);return ny(o,a),a},my=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new uf(o.En,Od(o,1).aI(0),at,o.W.bind(o),h,void 0);return ny(o,a),a},py=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new bf(o.En,Od(o,1).aI(0),at,o.W.bind(o),h,void 0,r);return ny(o,a),a},Ay=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||rg},o=t(n),h=e||s?ng(o,s):void 0,a=new dd(o.En,Od(o,1).aI(0),at,o.W.bind(o),h,r);return ny(o,a),a};function xy(t,i,s,r,n,o){let h=i.x.ct(t.max.x),a=i.x.ct(t.min.x),l=i.y.ct(t.max.y),u=i.y.ct(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,A=g>m?[m,g]:[g,m],x=y>p?[p,y]:[y,p];let S,b,v=1,M=1;switch(r){default:case e.GradientExtent.closestSide:if(S=A[0]/c,b=x[0]/d,n===e.GradientShape.circle){const t=Math.min(S*f,b);v=t,M=t}else v=S*f,M=b;break;case e.GradientExtent.farthestSide:if(S=A[1]/c,b=x[1]/d,n===e.GradientShape.circle){const t=Math.max(S*f,b);v=t,M=t}else v=S*f,M=b;break;case e.GradientExtent.closestCorner:if(b=x[0]/d,n===e.GradientShape.circle){S=A[0]/c*f;const t=Math.sqrt(S*S+b*b);v=t,M=t}else{S=A[0]/c;const t=Math.sqrt(S*S+b*b);v=t*f,M=t}break;case e.GradientExtent.farthestCorner:if(b=x[1]/d,n===e.GradientShape.circle){S=A[1]/c*f;const t=Math.sqrt(S*S+b*b);v=t,M=t}else{S=A[1]/c;const t=Math.sqrt(S*S+b*b);v=t*f,M=t}}return{bounds:[a*o,u*o,c*o,d*o],center:[s.x*f,s.y],distance:[Math.max(v,1e-4),Math.max(M,1e-4)],aspectRatio:f}}function Sy(t,e,i,s){const r=e.x.ct(t.max.x),n=e.x.ct(t.min.x),o=e.y.ct(t.max.y),h=e.y.ct(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.zL=t}}class vy{constructor(){this.xE=new Array,this.bE=t=>(this.xE.push(t),t),this.ME=this.bE(new Map),this._E=this.bE(new Map),this.wE=this.bE(new Map),this.CE=this.bE(new Map),this.kE=this.bE(new Map),this.TE=this.bE(new Map),this.FE=this.bE(new Map)}IE(){this.xE.forEach((t=>{t.forEach((t=>t.IE())),t.clear()}))}}const My=(t,e,i)=>()=>{t.PE=e,i&&i()},Ty=(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.EE=!0,this.GE()})),this.Mc.addEventListener("error",(()=>{this.VE=!0})),this.Mc.complete&&(this.EE=!0,this.GE());else if(this.Mc instanceof St.HTMLVideoElement){const t=this;this.Mc.addEventListener("canplay",(function(){t.BE=this.videoHeight,t.DE=this.videoWidth,t.EE=!0,t.GE()}),!0),this.Mc.addEventListener("play",My(this,!0,(()=>this.GE()))),this.Mc.addEventListener("playing",My(this,!0,(()=>this.GE()))),this.Mc.addEventListener("pause",My(this,!1)),this.Mc.addEventListener("ended",My(this,!1)),this.Mc.readyState>=1&&(this.DE=this.Mc.videoWidth,this.BE=this.Mc.videoHeight,this.PE=!this.Mc.paused,this.EE=!0,this.GE())}else this.EE=!0,this.GE()}JL(t){0===this.OE.size&&this.EE&&this.GE(),this.OE.add(t)}KL(t){this.OE.delete(t),0===this.OE.size&&this.unbindResources()}WE(t){this.zE.add(t),this.RE&&(t(),this.UE(t))}UE(t){this.zE.delete(t)}GE(){if(this.VE||this.RE||!this.EE)return;const t=this.AR.gl;if(!this.NE&&this.Mc&&t){this.NE=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.NE),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.Mc,o=this.DE>0?this.DE:n.width,h=this.BE>0?this.BE: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.DE=o,this.BE=h,t.bindTexture(t.TEXTURE_2D,null)}this.RE=!0,this.zE&&this.zE.forEach((t=>{t(),this.UE(t)}))}Ds(){const t=this.AR.gl;if(!this.VE&&this.RE&&this.NE){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.Mc;n&&(t.bindTexture(t.TEXTURE_2D,this.NE),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}YE(){return this.NE}unbindResources(){return this.RE&&(this.NE&&(this.AR.WL(this.NE),this.NE=null),this.RE=!1),this}}class Ey extends Nr{constructor(t,e,i){super(t.us,e,i),this.Rm=!0,this.Fm={},this.Bm=p(Nn),this.Ts=t,this.dt=t.dt}HE(){var t;return this.Bm.o&&this.Bm._().type!==(null===(t=this.$E)||void 0===t?void 0:t.type)}Nm(t){return this.Rm=t,this}XE(t){return this.Fm=t,this}}class ky{constructor(t){this.vV=[],this.zL=t}xV(t,e){((t,e,i,s)=>{const r=t.sR(),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.jE(),l=t.ZE(),u=t.QE(),c=t.JE(),d=t.KE();t.qE("disabled"),t.Nm(!1),t.tV(!1);const f=e.iV(),g=n+o/2;((t,e,i,s)=>{const r=t.gl,n=t.sR(),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 Gr?s=e.Ts.lg():e instanceof Ey&&(s=e.Ts.RS()),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.yL(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 y=f;const m=n+o+5,p=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;iRe(r,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),r=qe(r,s))}while(s);e.push(r)}return e})(e.map((t=>{const e=t instanceof Gr||t instanceof Ey?t.Ts.nV(t):ze;if(ye(e))return ze;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?ze:r})).filter((t=>!ye(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=hi(t.min,s),i=hi(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: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.aV()),A=e.iV(f,y),x=t.cE(Wg["2D"],Wg.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),Wg.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.JL(s),n&&n(h),t.fV(h("uIsHighlighted"),0).AV(h("uHighlightColorOffset"),C).fV(h("uRenderEffectMask"),0).dV(h("uTexture"),e.texture,0).cV(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).cV(h("uScale"),i.uniforms.gV()).cV(h("uDisp"),i.uniforms.pV()).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}).Pp(o.TRIANGLES,r.vertexCount,0),!0))),t.eV(o.FRAMEBUFFER,h),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,y,A,x,p,((e,i,s,r)=>(t.cV(e("uOffsetPx"),[h.x,h.y]),!0))),y=A,t.tV(l),t.mV(d);const S=t.cE(Wg["2D"],Wg.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),Wg.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.us.oi().x,y:t.us.oi().y};t.hV(0,0,o.x*t.sR(),o.y*t.sR());const h=at.d2({scaleXYConstructor:zi}).q(o).zi(0,o.x).Oi(0,o.y),a=new Fy;a.yV(h),t.lV(i,((h,l,u,c)=>(t.JL(i),r&&r(h),t.fV(h("uIsHighlighted"),0).AV(h("uHighlightColorOffset"),C).fV(h("uRenderEffectMask"),0).dV(h("uTexture"),e.texture,0).cV(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).cV(h("uScale"),a.gV()).cV(h("uDisp"),a.pV()).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}).Pp(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,S,p,((e,s,r,n)=>(t.dV(e("uTextureFirstGlowPass"),A.texture,1).AV(e("uGlowColor"),i.color),!0))),t.hV(a.x,a.y,a.width,a.height),t.qE(u),t.Nm(c),t.SV(p.vertexBuffer)})(this.zL,this,e,t)}aV(){const t=this.zL.us.oi();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}iV(...t){const e=this.vV,i=this.aV(),s={x:Math.ceil(i.x*this.zL.sR()),y:Math.ceil(i.y*this.zL.sR())},r=this.zL.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.q(i).zi(0,i.x).Oi(0,i.y),n.uniforms.yV(n.scale)),n;const o=r.createTexture(),h=this.zL.bV(),a=this.zL.MV();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.zL.sV();this.zL.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.zL.eV(r.FRAMEBUFFER,l),r.bindRenderbuffer(r.RENDERBUFFER,null);const u=at.d2({scaleXYConstructor:zi}).q(i).zi(0,i.x).Oi(0,i.y),c=new Fy;c.yV(u);const d={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:u,uniforms:c};return e.push(d),d}W(){[this.vV].forEach((t=>{t.forEach((t=>{this.zL._V(t.depthBuffer),this.zL.wV(t.frameBuffer),this.zL.WL(t.texture)})),t.length=0}))}}class Cy{constructor(t,i,s,r,n=!0){this.CV=new vy,this.kV=new Map,this.TV=new Map,this.FV=[],this.KR=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(St.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.Rm=!1,this.cV=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.IV=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.PV=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.DV=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.BV=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.LV=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.AV=(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.RV=(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 gt("Could not bind a texture.")},this.EV=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)=>{const s=t.length,r=this.VV(s,i);if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,r),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof Float32Array?t:new Float32Array(t),e?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),r)return r;throw new gt("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 gt("Could not create vertex buffer")},this.OV=(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.NV=(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.GV=(t,e)=>{const i=t.length,s=this.VV(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 gt("Could not create index buffer")},this.WV=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 gt("Could not create float buffer")},this.UV=(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.YV=(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.HV(s,e)}return this},this.$V=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.XV=(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.jV=(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.HV(t,i)),this),this.ZV=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.QV=null,this.Pp=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.JV=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.KV=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.rE.ANGLE_instanced_arrays)return St.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.rE.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.qV=(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.rE.ANGLE_instanced_arrays)return St.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.rE.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.HV=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.rE.ANGLE_instanced_arrays)return St.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.rE.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.tz=(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.ZE();o&&this.tV(!1),t(),o&&this.tV(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.eV(this.gl.FRAMEBUFFER,n)},this.Nt=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this),this.iz=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.JL=t=>(this.gl.useProgram(t.gR),this),this.sz=!1,this.ez=[],this.us=t,this.fs=i,this.us=t,this.gl=s.ctx,this.hz=s.antialias,this.rz=!!this.us.Yr.CR&&s.lineAntialias,this.nE=this.us.Yr.nE,this.nz=new Map,this.gl1=this.us.Yr.gl1,this.gl2=this.us.Yr.gl2,n&&(this.mV(!0),this.oz()),this.rE=this.us.Yr.rE,this.NL=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.$L=this.az(),this.cE=this.us.Yr.cE,this.lz=new Ly(this),this.iR=this.us.Yr.iR,this.uz=new ky(this),this.wR=this.us.Yr.wR,this.cz=this.oV([0,0,1,0,1,1,0,1]),this.dz=this.oV([0,0,1,0,0,1,0,1,1,0,1,1])}qE(t){return t!==this.fz&&(this.fz=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}QE(){return this.fz||"disabled"}Nm(t){return t!==this.Rm&&(this.Rm=t,t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)),this}JE(){return this.Rm}Az(t){return this.KR=t,this}sR(){return this.KR}VV(t,e){let i;if(e){const s=this.nz.get(e);s&&s.size>=t&&s.size-t<1e6?i=e:this.SV(e)}return i||(i=this.gl.createBuffer(),this.nz.set(i,{size:t})),i}gz(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 gt("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}WL(t){this.gl.deleteTexture(t)}bV(){const t=this.gl.createFramebuffer();if(!t)throw new gt("Couldn't reserve Framebuffer.");return t}eV(t,e){this.QV=e,this.gl.bindFramebuffer(t,e)}sV(){return this.QV}wV(t){this.gl.deleteFramebuffer(t)}MV(){const t=this.gl.createRenderbuffer();if(!t)throw new gt("Couldn't reserve Render buffer.");return t}_V(t){this.gl.deleteRenderbuffer(t)}hV(t,e,i,s){return this.gl.viewport(t,e,i,s),this.pz&&t===this.pz.x&&e===this.pz.y&&i===this.pz.width&&s===this.pz.height||(this.pz={x:t,y:e,width:i,height:s}),this}jE(){return this.pz||{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.mz||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.mz=t),this}mV(t){return t!==this.sz&&(this.sz=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}KE(){return this.sz}oz(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)}ZE(){return void 0!==this.mz&&this.mz}lV(t,e){const i=new zy(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}SV(t){t&&(this.gl.deleteBuffer(t),this.nz.delete(t))}yz(t,e,i){this.cV(t.uniform("uCenter"),e.center).cV(t.uniform("uDistance"),e.distance).PV(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.wz.buffer;this.wz&&(this.SV(this.wz.buffer),this.wz=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.ez.splice(this.ez.indexOf(l),1)}))}Pz(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)}Dz(t){const e=this.TV.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new gt("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}Vz(t,e,i,s){const r=t=>{t.texCoordsBuffer=this.oV(s(t.texture.DE,t.texture.BE,t.imageFill.getFitMode()),!1,t.texCoordsBuffer)};if(e){let s=t;const n=e.getSource();if((!t||e!==t.imageFill)&&n){t&&(t.texture.KL(this),this.SV(t.texCoordsBuffer));const i=this.vz(n);i.JL(this),s={texture:i,imageFill:e,texCoordsBuffer:this.oV([]),sourceMissingTexture:this.gz(new Uint8Array(Object.values(e.getSourceMissingColor().toJS()).map((t=>255*t))),this.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{s&&e&&(r(s),this.us.bs())}},i.WE(s.textureReadyCallback),r(s)}return s&&s.texture.RE&&s.texture.LE&&s.texture.PE&&(s.texture.Ds(),this.us.bs()),i&&s&&s.texture.RE&&r(s),s}t&&(t.texture.KL(this),this.SV(t.texCoordsBuffer))}zz(t){t&&(t.texture.KL(this),t.texture.UE(t.textureReadyCallback),this.WL(t.sourceMissingTexture),this.SV(t.texCoordsBuffer))}Oz(t,e,i,s){const{uniform:r,uniformOptional:n,attribute:o}=t,h=i.dt;this.fV(r("uIsHighlighted"),1===e||2===e?0:i.Ko).AV(r("uHighlightColorOffset"),1===e||2===e?D:i.sa).fV(r("uRenderEffectMask"),2===e?1:0).cV(n("uRatioPxClip"),[2/this.us.oi().x,2/this.us.oi().y]).fV(n("uDevicePixelRatio"),this.sR()),h instanceof zi?this.cV(r("uScale"),s.uniforms.gV()).cV(r("uDisp"),s.uniforms.pV()).cV(n("uScaleStart_highpart"),s.uniforms.Nz()).cV(n("uScaleStart_lowpart"),s.uniforms.Gz()):h instanceof Vi&&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 a=!0===s.coordsHighPrecision;if(s.coordsX)if(a){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.jV(o("aPosX"),s.coordsX);if(s.coordsY)if(a){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.jV(o("aPosY"),s.coordsY);if(1===e)this.AV(r("uColor"),s.mousePickingColor);else{if(s.fillStyleSolid&&this.AV(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.jV(t,s.lookupValueBuffer),void 0!==s.lookupValueAttribDivisor&&this.HV(t,s.lookupValueAttribDivisor)}this.Ez(t,s.fillStylePaletted.lut,s.lookupValueRange)}if(s.fillStyleLinearGradient){if(!s.linearGradientInfo)return!1;this.Sz(t,s.linearGradientInfo,s.fillStyleLinearGradient)}if(s.fillStyleRadialGradient){if(!s.radialGradientInfo)return!1;this.yz(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.HV(t,s.colorAttribDivisor)}}return!0}Wz(t,e,i){if(t)return Sy(i||e.na(),e.dt,t.getAngle(!0),this.sR())}Uz(t,e,i){if(t)return xy(i||e.na(),e.dt,t.getPosition(),t.getExtent(),t.getShape(),this.sR())}}const Dy=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 St.setTimeout(o,r)};St.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{yV(t){if(t instanceof zi||t instanceof yu){const e=t.yi();this.Yz=e.x.scaling,this.$z=-e.x.displacement,this.Xz=e.y.scaling,this.jz=-e.y.displacement,this.Zz=e.x.highPrecisionOffset,this.Qz=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.Jz=e.y.highPrecisionOffset,this.Kz=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof Vi&&(this.MixedScaleXY=t.yi());return this}pV(){return[this.$z,this.jz]}gV(){return[this.Yz,this.Xz]}Nz(){return[this.Zz,this.Jz]}Gz(){return[this.Qz,this.Kz]}}class Iy{constructor(){this.Yz=0,this.Xz=0,this.qz=0,this.$z=0,this.jz=0,this.tO=0}iO(t){return this.Yz=t.et(),this.$z=t.getInnerStart()+.5*this.Yz*t.ht(),this}sO(t){return this.Xz=t.et(),this.jz=t.getInnerStart()+.5*this.Xz*t.ht(),this}eO(t){return this.qz=t.et(),this.tO=t.getInnerStart()+.5*this.qz*t.ht(),this}gV(){return[this.Yz,this.Xz,this.qz]}pV(){return[this.$z,this.jz,this.tO]}hO(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=ol.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class Ly{constructor(t){this.zL=t}yL(t,e,i,s,r,n=0){const o=this.zL,h=void 0===s;if(!(s=s||o.bV()))throw new gt("Could not bind a framebuffer.");const a=o.jE(),l=o.KE();o.mV(!1),o.tz((()=>{o.hV(0,0,i.x,i.y),t()}),s,e,n),h&&o.wV(s),this.zL.iz(r),this.zL.hV(a.x,a.y,a.width,a.height),o.mV(l)}}class zy{constructor(t,e){this.rO=[],this.nO=[],this.uniform=t=>{const e=this.shader.SR(t);return this.nO.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.vR(t);return this.nO.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.xR(t);return this.rO.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.rO)this.glUtils.$V(t.location),this.glUtils.HV(t.location,0)}}class Vy extends Gr{constructor(t,e,i,s,r){super(t,e,i,s),this.oO=new Map,this.aO=t,this.lO=e,this.zL=t.uO(),this.cO=r,this.lO=e}dO(t){return!1}GL(){return this}yL(t){if(!this.cO||0!==t||0===this.oO.size)return this;const e=Array.from(this.oO.values()).map((t=>t.fO.filter((t=>t.AO)).map((t=>t.ts)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===e.length)return this;const i=this.cO;return this.zL.uz.xV(e,i),this}Ds(){return this}xt(){return 0}vt(){return 0}Mt(){return 0}bt(){return 0}Vl(){return 0}zl(){return 0}hs(t,e){const i={fO:[]},s=(t,e)=>{const s={ts:t||[],AO:void 0===e||e};i.fO.push(s);const r={ps:t=>(s.ts=t,r),xs:t=>(s.AO=t,r),Ms:()=>s.AO};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={gA:s,...r};this.oO.set(t,i);const o=t.onDispose((()=>{this.oO.delete(t),t.offDispose(o)}));return n}}const Py=(t,e,i)=>((t,e,i,s)=>{const r=[];let n=0;const o=si(e,i/2);let h,a,l,c,d=t[t.length-1],f=0;for(let i=0;i0&&(d=t[i-1]),bt(h,d)&&(d=ri(h,ti(si(ni(a,h),-1)))),bt(h,a)&&(a=ri(h,ti(si(ni(d,h),-1))));const s=hi(d,e),g=hi(h,e),y=hi(a,e),m=ti(ni(g,s)),p=ti(ni(y,g)),A=ri(m,p),x=u(-A.y,A.x),S=u(-m.y,m.x),b=1/li(x,S),v=ii(x),M=ti(ni(m,p)),T=Math.sign(li(x,M))||1,w=oi(x,si(o,b)),E=oi(x,si(o,-b));if(v<1||b===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(li(m,x))||T,g=oi(S,si(o,c)),y=oi(l,si(o,c));1===T?(t=g,e=E,i=y,s=E):(t=w,e=g,i=w,s=y);const A=4*We(d,h),v=4*We(h,a);(b>A||b>v)&&(1===T?(t=g,e=y,i=y,s=g):(t=y,e=g,i=g,s=y));const M=ri(h,t),k=ri(h,e),C=ri(h,i),D=ri(h,s);r[n]=M,n+=1,r[n]=k,n+=1,r[n]=C,n+=1,r[n]=D,n+=1,f=4}else{const t=ri(h,w),e=ri(h,E);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 Ry extends rn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dR=new Fy,this.gO=ze,this.pO=ze,this.mO=yg({arcStyleSolid:()=>G(this.be)&&this.be,arcStyleRadialGradient:()=>Q(this.be)&&this.be,arcStyleLinearGradient:()=>it(this.be)&&this.be}),this.aO=t,this.lO=e,this.yO=n,this.SO=o,this.zL=t.uO()}vO(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?Ru(this.wa._(),this.hu._(),this.Fi._(),this.ru._()*l/100,this.nu._()*l/100,a)[0]:[this.wa._()],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.lu=u(t,e)}else{const t=Math.floor(d/2);this.lu=u(h[t].x,h[t].y)}this.uu=h[1];const f=h.length-1;this.cu=h[f],this.ou._()&&(h.shift(),c.shift());let g=!1;(this.wa.o||this.hu.o||this.Fi.o||this.ru.o||this.nu.o||this.ou.o||this.au.o||s)&&(this.pO=y(u(this.Ya().x-n,this.Ya().y-o),u(this.Ya().x+n,this.Ya().y+o)),g=!0,this.wa.o=!1,this.hu.o=!1,this.Fi.o=!1,this.ru.o=!1,this.nu.o=!1,this.ou.o=!1,this.au.o=!1);const m=this.ga();(g||m)&&this.be!==B&&(this.ou._()?(this.bO&&this.zL.SV(this.bO),[this.MO,this.bO,this._O,this.wO]=this.vO(h,c)):(this.bO&&this.zL.SV(this.bO),[this.MO,this.bO,this._O,this.wO]=this.vO(h,void 0)),Q(this.be)?this.CO=xy(this.pO,this.dt,this.be.getPosition(),this.be.getExtent(),this.be.getShape(),this.zL.sR()):it(this.be)?this.kO=Sy(this.pO,this.dt,this.be.getAngle(!0),this.zL.sR()):(this.CO=void 0,this.kO=void 0));const p=this.mO.arcStyleSolid(m),A=this.mO.arcStyleLinearGradient(m),x=this.mO.arcStyleRadialGradient(m),S=p||A||x;m&&(this.TO=S?this.zL.cE(Wg["2D"],Wg.Color({dataType:Q(this.be)||it(this.be)?["gradient",this.be]:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.Sa(this.be));const b=this.Me;if(Ji(b)&&(g||this.ba(b.getThickness())||s)){this.ou._()?360===i?(h.pop(),c.pop(),[this.FO,this.IO]=this.xO(h,void 0,b.getThickness(),r),this.PO&&this.FO?this.zL.NV(this.PO,this.FO,!0):!this.PO&&this.FO?this.PO=this.zL.oV(this.FO,!0):this.PO&&!this.FO&&(this.zL.SV(this.PO),this.PO=void 0),[this.DO,this.BO]=this.xO(c,void 0,b.getThickness(),r),this.LO&&this.DO?this.zL.NV(this.LO,this.DO,!0):!this.LO&&this.DO?this.LO=this.zL.oV(this.DO,!0):this.LO&&!this.DO&&(this.zL.SV(this.LO),this.LO=void 0)):([this.FO,this.IO]=this.xO(h,c,b.getThickness(),r),this.PO&&this.FO?this.zL.NV(this.PO,this.FO,!0):!this.PO&&this.FO?this.PO=this.zL.oV(this.FO,!0):this.PO&&!this.FO&&(this.zL.SV(this.PO),this.PO=void 0),this.DO&&(this.LO&&this.zL.SV(this.LO),this.LO=void 0,this.BO=0)):(360===i&&(h.shift(),h.pop()),[this.FO,this.IO]=this.xO(h,void 0,b.getThickness(),r),this.PO&&this.FO?this.zL.NV(this.PO,this.FO,!0):!this.PO&&this.FO?this.PO=this.zL.oV(this.FO,!0):this.PO&&!this.FO&&(this.zL.SV(this.PO),this.PO=void 0));const t=b.getFillStyle();Q(t)?this.RO=xy(this.pO,this.dt,t.getPosition(),t.getExtent(),t.getShape(),this.zL.sR()):it(t)?this.EO=Sy(this.pO,this.dt,t.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),this.VO=t===B?void 0:this.zL.cE(Wg["2D"],Wg.Color({dataType:Q(t)||it(t)?["gradient",t]:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})),this.Ma(b)}if(g){let t=1,e=1;Ji(b)&&(t=b.getThickness()*r.x,e=b.getThickness()*r.y),this.gO=y(u(this.pO.min.x-t,this.pO.min.y-e),u(this.pO.max.x+t,this.pO.max.y+e))}this.zO=e&&S?this.zO||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.OO=e&&this.Me!==rt?this.OO||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0}return this}yL(t){if(this.ya()){const e=1===t?this.zO:this.TO,i=this.be,s=this.bO;e&&s&&this.zL.JL(e).lV(e,((e,r,n,o)=>{if(this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(o("uScaleStart_highpart"),this.dR.Nz()).cV(o("uScaleStart_lowpart"),this.dR.Gz()).bz(n,s,this.dt._i(),void 0).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1===t)this.zL.AV(e("uColor"),this.SO);else if(G(i))this.zL.AV(e("uColor"),i.getColor());else if(Q(i)){if(!this.CO)return!1;this.zL.yz(n,this.CO,i)}else if(it(i)){if(!this.kO)return!1;this.zL.Sz(n,this.kO,i)}return this.zL.Pp(this.wO,this._O),!0}));const r=this.Me;Ji(r)&&(void 0!==this.PO&&this.NO(t,this.PO,this.IO,r),void 0!==this.LO&&this.NO(t,this.LO,this.BO,r))}return this}NO(t,e,i,s){const r=1===t?this.OO:this.VO,n=s.getFillStyle();r&&this.zL.JL(r).lV(r,((r,o,h,a)=>{if(this.zL.cV(r("uScale"),this.dR.gV()).cV(r("uDisp"),this.dR.pV()).bz(h,e,this.dt._i(),void 0).fV(r("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(r("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(r("uRenderEffectMask"),2===t?1:0),1===t)this.zL.AV(r("uColor"),this.SO);else if(G(n))this.zL.AV(r("uColor"),n.getColor());else if(Q(n)){if(!this.RO)return!1;this.zL.yz(h,this.RO,n)}else if(it(n)){if(!this.EO)return!1;this.zL.Sz(h,this.EO,n)}const l=s.getThickness(),u=-1===l||1===l;return this.zL.Pp(u?this.zL.gl.LINE_LOOP:this.zL.gl.TRIANGLE_STRIP,i),!0}))}dO(t){return this.yO===t&&{}}GL(){return this.GO&&(this.zL.SV(this.GO),this.GO=void 0),this.WO&&(this.zL.SV(this.WO),this.WO=void 0),this.bO&&(this.zL.SV(this.bO),this.bO=void 0),this.PO&&(this.zL.SV(this.PO),this.PO=void 0),this.LO&&(this.zL.SV(this.LO),this.LO=void 0),this.TO=void 0,this.VO=void 0,this.zO=void 0,this.OO=void 0,this}xt(){return this.pO.max.x}vt(){return this.pO.min.x}Mt(){return this.pO.max.y}bt(){return this.pO.min.y}Vl(){return Me(this.Me)}zl(){return Me(this.Me)}}class By{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}UO(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}YO(){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}HO(){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}$O(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.YO(),this}XO(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.HO(),this}jO(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new By).UO(t))(),Oy=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||_y.YO(),n.push(t,e),r.push(_y.first,_y.second,_y.third),h=void 0,o=void 0,r.push(_y.third,_y.fourth,_y.second),a=_y.third,_y.HO(),l&&n.push(i,s),[o,h,a]),Ny=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||_y.YO(),o.push(t,e),r.push(_y.first,_y.second,_y.third);const c=pi(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(_y.third,_y.fourth,_y.fifth),l=_y.fourth),_y.HO(),u&&o.push(i,s),[h,a,l]},Uy=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||_y.YO(),r.push(t,e),s.push(_y.first,_y.second,_y.third),n=i,o=void 0,h=_y.third,l?r.push(i):a=!0,[n,o,h,a]),Gy=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||_y.YO(),_y.YO()):a>0&&(_y.YO(),u>0&&(u-=1)),n.push(t),r.push(_y.first,_y.second,_y.third),a=_y.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),Wy=(t,e=0)=>{_y.UO(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]=Oy(g,y,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=Ny(g,y,d,f,o,n,h,a,l,u,t):[a,l,u,m]=Uy(g,y,d,o,h,a,l,u,m,t):d.y===f.y?(a=g,m&&(h.push(g),m=!1,_y.YO()),0===h.length&&u>0&&p>0&&(p-=1)):d.y>f.y?[a,l,u,p]=Gy(g,0,d,f,n,h,a,l,u,t,p):[a,l,u,p]=Gy(g,0,d,f,o,h,a,l,u,t,p)}return[h,new Uint16Array(n),new Uint16Array(o),u,p]};class Yy extends sn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dR=new Fy,this.QO=0,this.sl=Array(),this.JO=0,this.KO=new Uint16Array(0),this.qO=new Uint16Array(0),this.mO=yg({hightFillSolid:()=>G(this.be)&&this.be,hightFillRadialGradient:()=>Q(this.be)&&this.be,hightFillLinearGradient:()=>it(this.be)&&this.be,hightFillPaletted:()=>H(this.be)&&this.be,lowFillSolid:()=>G(this.Hl)&&this.Hl,lowFillRadialGradient:()=>Q(this.Hl)&&this.Hl,lowFillLinearGradient:()=>it(this.Hl)&&this.Hl,lowFillPaletted:()=>H(this.Hl)&&this.Hl}),this.aO=t,this.lO=e,this.yO=n,this.SO=o,this.zL=t.uO()}Ds(){const t=this.ma(),e=this.jo._(),i=this.fl;if(this.ya()){this.dR.yV(this.dt);const s=this.dt instanceof Vi==0,r=s?this.dt.Wi():void 0,n=this.Zl(),o=this.dt.Ni()||t,h=i||this.Gl.o||o&&"disabled"!==n.type;if(h){if(this.QO=0,this.KO=new Uint16Array(0),this.qO=new Uint16Array(0),this.sl.length=0,this.JO=0,this.Wl>1){const[t,e,i,o]=Wy([s?n.packager(this.Ol,r,.5):this.Ol,s?n.packager(this.Nl,r,.5):this.Nl]);this.QO=o,this.KO=e,this.qO=i,this.sl=t,this.JO=t.length}this.Gl.o=!1}if(this.Yl&&this.ll[0].length>1){const[t,e]=this.ll,i=t.length,[o,h,a,l,u]=Wy([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.QO);this.QO=l;const c=o.length;for(let t=u;t0||this.Wl>0?1:u;s{if(this.zL.bz(o,e,this.dt._i(),void 0).ZV(r).fV(s("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(s("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(s("uRenderEffectMask"),2===t?1:0),this.dt instanceof zi||this.dt instanceof yu?this.zL.cV(s("uScale"),this.dR.gV()).cV(s("uDisp"),this.dR.pV()).cV(h("uScaleStart_highpart"),this.dR.Nz()).cV(h("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof Vi&&this.zL.cV(h("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(h("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(h("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(h("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(s("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(s("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(s("uColor"),this.SO);else if(G(i))this.zL.AV(s("uColor"),i.getColor());else if(Q(i)){if(!this.sN)return!1;this.zL.yz(o,this.sN,i)}else if(it(i)){if(!this.eN)return!1;this.zL.Sz(o,this.eN,i)}else if(H(i)){const t=mg(i,this,void 0);if(!t&&i.lut.percentageValues)return!1;this.zL.Ez(o,i.lut,t)}return this.zL.JV(this.aN),!0}))}const r=1===t?this.zO:this.tN;if(r&&this.hN&&this.rN){const i=this.hN,s=this.rN;this.zL.JL(r).lV(r,((r,n,o,h)=>{if(this.zL.bz(o,i,this.dt._i(),void 0).ZV(s).fV(r("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(r("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(r("uRenderEffectMask"),2===t?1:0),this.dt instanceof zi||this.dt instanceof yu?this.zL.cV(r("uScale"),this.dR.gV()).cV(r("uDisp"),this.dR.pV()).cV(h("uScaleStart_highpart"),this.dR.Nz()).cV(h("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof Vi&&this.zL.cV(h("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(h("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(h("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(h("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(r("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(r("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(r("uColor"),this.SO);else if(G(e))this.zL.AV(r("uColor"),e.getColor());else if(Q(e)){if(!this.CO)return!1;this.zL.yz(o,this.CO,e)}else if(it(e)){if(!this.kO)return!1;this.zL.Sz(o,this.kO,e)}else if(H(e)){const t=mg(e,this,void 0);if(!t&&e.lut.percentageValues)return!1;this.zL.Ez(o,e.lut,t)}return this.zL.JV(this.nN),!0}))}return this}dO(t){return this.yO===t&&{}}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return 0}zl(){return 0}Cx(t){this.Cl()>0&&this.Ds();const[e,i]=this.yl(),s=e.length>2&&e[1].x0&&this.Ds();const[e,i]=this.yl(),s=e.length;if(0===s)return;const r=this.$l?1:0,n=s-(this.Xl?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.lN;s+=1){const r=i-s*Math.PI/this.lN;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.CV.wE.get(e);return i||(i=new Hy(t,e),t.CV.wE.set(e,i),i)})(t,i?e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2:1),$y={gN:(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.HV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.HV(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.HV(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.HV(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.HV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.HV(i,1),h.enableVertexAttribArray(i)}},pN:(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.HV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.HV(r,1),h.enableVertexAttribArray(r)},mN:(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.HV(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.HV(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.HV(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.HV(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.HV(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.HV(i,1),h.enableVertexAttribArray(i)}},yN:(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.HV(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.HV(r,1),h.enableVertexAttribArray(r)},yL:(t,e,i,s,r,n,o)=>{const h=t.uO(),{uniform:a,uniformOptional:l}=i,u=1/t.En.ao,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.oi().x,2/t.oi().y]),e.JL(i,s).Pp(o)}},jy={gN:(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)}},pN:(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)},mN:(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)}},SN:(t,e)=>{const i=t.uO();i.Pp(i.gl.LINE_STRIP,e,0)},vN:(t,e)=>{const i=t.uO();i.Pp(i.gl.LINES,2*e,0)}};class qy extends hn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dR=new Fy,this.ol=ze,this.mO=yg({lineStyleSolid:()=>Ji(this.Cu)&&this.Cu,lineStyleDashed:()=>Zn(this.Cu)&&this.Cu,strokeFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},strokeFillLinearGradient:()=>{const t=this.Cu.getFillStyle();return it(t)&&t},strokeFillRadialGradient:()=>{const t=this.Cu.getFillStyle();return Q(t)&&t},strokeFillPaletted:()=>{const t=this.Cu.getFillStyle();return H(t)&&t}}),this.aO=t,this.lO=e,this.yO=n,this.SO=o,this.zL=t.uO(),this.xN=this.zL.rz}Ds(){const t=this.va(),e=this.Cu,i=this.mO.lineStyleSolid(t),s=this.mO.lineStyleDashed(t),r=i||s,n=this.mO.strokeFillSolid(t),o=this.mO.strokeFillLinearGradient(t),h=this.mO.strokeFillRadialGradient(t),a=this.mO.strokeFillPaletted(t),l=n||o||h||a&&["x","y"].includes(a.getLookUpProperty())&&a,c=this.Ii(),d=this.Ti(),f=this.jo._(),g=this.jo.o,m=e.V();if(s&&this.dt instanceof Vi)return St.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.dR.yV(this.dt),this.Pu&&(this.bN=this.zL.oV(qt([c,d],this.dt._i()),!1,this.bN),this.ol=y(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.ya()&&r&&l&&m>0,e=o?["gradient",o]:h?["gradient",h]:a?["lookup",a.getLookUpProperty(),a.lut]:"uniform";this.MN=t?{type:"triangulated",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0}),this.xN?Wg.AliasedEdge:void 0,s&&Wg.StippleTextureInstanced),mousePickingShader:f?this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0}),s&&Wg.StippleTextureInstanced):void 0,geometry:Xy(this.zL,m),thickness:m,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}:void 0}if(h?this.RO=xy(Yr(this.ol,{x:this.Vl(),y:this.zl()},this.dt),this.dt,h.getPosition(),h.getExtent(),h.getShape(),this.zL.sR()):o?this.EO=Sy(Yr(this.ol,{x:this.Vl(),y:this.zl()},this.dt),this.dt,o.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),s){if(t||this.Pu){const t=[0,0,Math.abs(d.x-c.x),Math.abs(d.y-c.y)];this._N=this.zL.oV(t,!1,this._N)}this.wN=this.zL.Dz(s.getPattern())}else this._N&&(this.zL.SV(this._N),this._N=void 0),this.wN=void 0;return this.Iu(e),this.Pu=!1,this.jo.o=!1,this}yL(t){var e,i;const s=this.bN;if(!s)return this;const r=this.MN;if(!r)return this;const{fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a,lineStyleDashed:l,thickness:u}=r,c=1===t?null===(e=this.MN)||void 0===e?void 0:e.mousePickingShader:null===(i=this.MN)||void 0===i?void 0:i.shader;return c?(this.zL.JL(c).lV(c,((e,i,c,d)=>{if(this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),this.dt instanceof zi||this.dt instanceof yu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(d("uScaleStart_highpart"),this.dR.Nz()).cV(d("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof Vi&&this.zL.cV(d("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(d("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(d("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(d("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(e("uColor"),this.SO);else if(n)this.zL.AV(e("uColor"),n.getColor());else if(h){if(!this.RO)return!1;this.zL.yz(c,this.RO,h)}else if(o){if(!this.EO)return!1;this.zL.Sz(c,this.EO,o)}else if(a){const t=mg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.zL.Ez(c,a.lut,t)}if(l){if(!this._N||!this.wN)return!1;$y.pN(this.zL,c,this._N,i("aLengthSoFarA"),i("aLengthSoFarB"),2,0),this.zL.cV(e("uStippleCount"),[this.us.oi().x/this.wN.Rz,this.us.oi().y/this.wN.Rz]).fV(d("uStippleTextureWidthLimiter"),this.wN.Lz/this.wN.Rz).fV(e("uStippleScale"),l.getPatternScale()).dV(e("uStippleTexture"),this.wN.Bz,1)}return $y.gN(this.dt._i(),this.zL,s,c,this.dt._i()?4:2,0),$y.yL(this.aO,r.geometry,c,this.xN&&1!==t,1===t,u,1),!0})),this):this}dO(t){return this.yO===t&&{}}dispose(){return super.dispose(),this.MN=void 0,this.bN&&(this.zL.SV(this.bN),this.bN=void 0),this._N&&(this.zL.SV(this._N),this._N=void 0),this.wN=void 0,this}GL(){return this}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return Me(this.Cu)}zl(){return Me(this.Cu)}}class Jy extends an{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.CN=[],this.kN=!1,this.TN=!1,this.FN=!1,this.IN=!1,this.dR=new Fy,this.ol=ze,this.mO=yg({lineStyleSolid:()=>Ji(this.Cu)&&this.Cu,lineStyleDashed:()=>Zn(this.Cu)&&this.Cu,lineFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},lineFillRadialGradient:()=>{const t=this.Cu.getFillStyle();return Q(t)&&t},lineFillLinearGradient:()=>{const t=this.Cu.getFillStyle();return it(t)&&t},lineIndividualPointFill:()=>{const t=this.Cu.getFillStyle();return W(t)&&t}}),this.aO=t,this.lO=e,this.PN=n,this.zL=t.uO(),this.xN=this.zL.rz,this.DN=t.En.uo;const{color:o,id:h}=this.PN();this.SO=o,this.yO=h}Lr(){const t=this.Bu?void 0:this.PN(),e={vs:t=>this.LN(e,t),cs:t=>this.RN(e,t),CA:(t,i)=>this.EN(e,t,i),AV:t=>this.VN(e,t),Pi:{x:0,y:0},Fi:{x:0,y:0},Ko:0,zN:void 0,yO:null==t?void 0:t.id,SO:null==t?void 0:t.color};return this.CN.push(e),e}Nt(){var t;return this.CN.length=0,this.kN=!0,this.ji&&this.bn&&(null===(t=this.us.vn)||void 0===t?void 0:t.entity)===this&&this.bn(this,void 0,this.us.vn.collectionMember),this}ON(){return this.CN.length}_(t){const e=this.CN[t];return[e.Pi,e.Fi]}jp(){return this.CN}Wc(t){var e;const i=this.CN.indexOf(t);i>=0&&(this.CN.splice(i,1),this.kN=!0,this.ji&&this.bn&&(null===(e=this.us.vn)||void 0===e?void 0:e.entity)===this&&this.bn(this,void 0,this.us.vn.collectionMember))}LN(t,e){if(e&&!this.CN.includes(t))this.CN.push(t);else if(!e){const e=this.CN.indexOf(t);this.CN.splice(e,1)}return this.FN=!0,t}RN(t,e){return t.Ko=e,this.TN=!0,t}EN(t,e,i){return t.Pi=e,t.Fi=i,this.kN=!0,t}VN(t,e){return t.zN=e,this.IN=!0,t}Ds(){const t=this.jo._(),e=this.jo.o,i=this.va(),s=this.Cu,r=this.CN,n=this.TN,o=this.kN,h=this.FN,a=this.IN,l=this.mO.lineStyleSolid(i),u=this.mO.lineStyleDashed(i),c=l||u,d=this.mO.lineFillSolid(i),f=this.mO.lineIndividualPointFill(i),g=this.mO.lineFillRadialGradient(i),y=this.mO.lineFillLinearGradient(i),m=d||f||y||g,p=s.V(),A=u?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(u&&this.dt instanceof Vi)return St.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this.dR.yV(this.dt);const x=o||h;if(x){const t=[];for(let e=0;e0&&e;this.MN=i?"triangulated"===A?{type:"triangulated",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,snapToNearestPixel:this.DN,ensureMinimumSegmentLength:void 0!==this.Du}),this.xN?Wg.AliasedEdge:void 0,u&&Wg.StippleTextureInstanced,Wg.AttributeHighlight),mousePicking:t?{shader:this.zL.cE(Wg["2D"],this.Bu?Wg.MousePicking:Wg.MousePickingAttribute,Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,snapToNearestPixel:this.DN,ensureMinimumSegmentLength:void 0!==this.Du}),u&&Wg.StippleTextureInstanced,Wg.AttributeHighlight)}:void 0,geometry:Xy(this.zL,p,!1),thickness:p,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:y,fillStyleRadialGradient:g}:{type:"primitive",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0,snapToNearestPixel:this.DN}),Wg.AttributeHighlight),mousePicking:t?{shader:this.zL.cE(Wg["2D"],this.Bu?Wg.MousePicking:Wg.MousePickingAttribute,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0,snapToNearestPixel:this.DN}),Wg.AttributeHighlight)}:void 0,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:y,fillStyleRadialGradient:g}:void 0}if(u){if(i||x){const t=new Float32Array(4*r.length);let e=0;for(let i=0;i{t[e]=i.Ko,e+=1})),this.NN=this.zL.oV(t,!0,this.NN)}else{const t=new Float32Array(2*r.length);let e=0;r.forEach((i=>{for(let s=e;s{const s=i.zN||f.color;t[e]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=s.a,e+=4})),this.GN=this.zL.oV(t,!1,this.GN)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{const s=i.zN||f.color;for(let i=e;i{var s,r,n,o;t[e+0]=(null===(s=i.SO)||void 0===s?void 0:s.r)||0,t[e+1]=(null===(r=i.SO)||void 0===r?void 0:r.g)||0,t[e+2]=(null===(n=i.SO)||void 0===n?void 0:n.b)||0,t[e+3]=(null===(o=i.SO)||void 0===o?void 0:o.a)||0,e+=4})),this.WN=this.zL.oV(t,!0,this.WN)}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.dt instanceof zi||this.dt instanceof yu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(g("uScaleStart_highpart"),this.dR.Nz()).cV(g("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof Vi&&this.zL.cV(g("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(g("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(g("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(g("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),this.DN&&this.zL.cV(g("uViewportSizePx"),[this.us.oi().x*this.zL.sR(),this.us.oi().y*this.zL.sR()]),void 0!==this.Du&&this.zL.cV(e("uMinSegmentPixelVector"),[this.Du.x,this.Du.y]),this.zL.AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1===t)if(this.Bu)this.zL.AV(e("uColor"),this.SO);else{if(!r)return!1;"triangulated"===o?this.zL.uV(r,1,{location:d("aColor"),size:4}):this.zL.XV(d("aColor"),r)}else if(h)this.zL.AV(e("uColor"),h.getColor());else if(a){if(!this.GN)return!1;this.zL.uV(this.GN,"triangulated"===o?1:void 0,{location:d("aColor"),size:4})}else if(u){if(!this.CO)return!1;this.zL.yz(f,this.CO,u)}else if(l){if(!this.kO)return!1;this.zL.Sz(f,this.kO,l)}if(c){if(!this._N||!this.wN)return!1;$y.yN(this.zL,f,this._N,d("aLengthSoFarA"),d("aLengthSoFarB"),2,0),this.zL.cV(e("uStippleCount"),[this.us.oi().x/this.wN.Rz,this.us.oi().y/this.wN.Rz]).fV(g("uStippleTextureWidthLimiter"),this.wN.Lz/this.wN.Rz).fV(e("uStippleScale"),c.getPatternScale()).dV(e("uStippleTexture"),this.wN.Bz,0)}if("triangulated"===o){const{geometry:e,thickness:r}=n;$y.mN(this.dt._i(),this.zL,i,f,this.dt._i()?4:2,0),this.zL.uV(s,1,{location:d("aIsHighlighted"),size:1}),$y.yL(this.aO,e,f,this.xN&&1!==t,1===t,r,this.CN.length)}else jy.mN(this.dt._i(),this.zL,i,f,this.dt._i()?4:2,0),this.zL.jV(d("aIsHighlighted"),s),jy.vN(this.aO,this.CN.length);return!0})),this):this}dO(t){if(t===this.yO)return{};const e=this.CN.find((e=>e.yO===t));return!!e&&{collectionMember:e}}dispose(){return super.dispose(),this.MN=void 0,this.bN&&(this.zL.SV(this.bN),this.bN=void 0),this._N&&(this.zL.SV(this._N),this._N=void 0),this.NN&&(this.zL.SV(this.NN),this.NN=void 0),this.WN&&(this.zL.SV(this.WN),this.WN=void 0),this.GN&&(this.zL.SV(this.GN),this.GN=void 0),this.wN=void 0,this}GL(){return this}cs(t){super.cs(t);for(const e of this.CN)e.cs(t);return this}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return Me(this.Cu)}zl(){return Me(this.Cu)}}class Zy{constructor(t,e){this.UN=!1,this.YN=!1,this.HN=!1,this.dt=t,this.$N=e,this.$N.ha("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.UN="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.UN="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.YN=!0),!0===t.regularProgressiveStep&&(this.HN=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.UN?t[0].x:t[0].y,end:"x"===this.UN?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.UN?"x"===this.UN?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.XN=!0)}))}JN(t,e=!1){if(this.XN||!this.UN||"linear"!==this.QN.type)return!1;!1===e&&this.KN&&(clearTimeout(this.KN),this.KN=void 0);const i="x"===this.UN?this.QN.scale.x.tA:this.QN.scale.y.tA;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.UN?r.x:r.y,"x"===this.UN?n.x:n.y,s),h=this.QN.scale,a=Math.abs("x"===this.UN?h.Wi().x:h.Wi().y),l=a/o,u=Math.floor(l*Ky),c=u*o,d=St.performance.now(),f=!(d-i.ah<500)&&(i.ih?d-i.oh<1e3:d-i.sh<2e3||i.hh),g=s>2*this.jN.totalDataPointsAtTime;if(f&&!g)return this.KN=setTimeout((()=>this.qN(t)),1e3),!1;const y=u>=10,m=this.jN.enabled?this.jN.columnWidthAxis/a<1.5:void 0,p=this.jN.enabled&&u>this.jN.dataPointsPerColumn?u/this.jN.dataPointsPerColumn>=2:void 0;let A;!0===this.jN.enabled?m?p&&(A={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):A=y?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:y&&(A={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const x=!1===e;return A?(x&&(this.jN=A),!0):(x&&(this.jN={...this.jN,totalDataPointsAtTime:s}),!1)}Lg(){this.tG=void 0,this.ZN.length=0,this.KN&&(clearTimeout(this.KN),this.KN=void 0)}iG(t){if(0===t.length)return t;if(this.XN||!this.UN||"linear"!==this.QN.type||!this.jN.enabled)return t;let e;e=this.ZN.length>0?se(this.ZN,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.tG,h=-1,a=-1,l=0,u=0;if("x"!==this.UN||this.YN)if("x"===this.UN&&this.YN){const t=this.jN.columnWidthAxis;let c=this.tG?this.tG.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.tG=s[c-1]),s}sG(t){if(this.UN&&"linear"===this.QN.type){const e="x"===this.UN?this.QN.scale.x.tA:this.QN.scale.y.tA;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Je===Rs.progressive||e.Je===Rs.regressive){const e=Math.abs("x"===this.UN?this.QN.scale.x.getInnerInterval():this.QN.scale.y.getInnerInterval());if(this.jN.enabled)return 2*e/this.jN.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.UN?s.x:s.y,"x"===this.UN?r.x:r.y,i)}}}eG(t,e,i){if(!this.UN)return e;const s=i.length;let r=Br(i,t.min,this.UN,this.YN,0,s-1);void 0===r&&(r=this.YN?s-1:0);let n=Br(i,t.max,this.UN,this.YN,0,s-1);return void 0===n&&(n=this.YN?0:s-1),1+Math.abs(n-r)}hG(){this.KN&&(clearTimeout(this.KN),this.KN=void 0)}qN(t){this.JN(t,!0)&&this.bs()}}class tm extends Zy{renderVisibleOnly(t,e){const i=this.dt.x.getInnerStart(),s=this.dt.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.dt.y.getInnerStart(),h=this.dt.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 em{constructor(t,e,i){this.rG=e,this.nG=i,this.oG=t,this.aG=[]}lG(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.oG[this.oG.length-1];do{const t=this.oG.length;let r;h||(h=this.uG(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.nG&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.oG[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.oG.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.cG()}dG(t){const e=t,i=this.oG.indexOf(e);i>=0&&this.oG.splice(i,1),e.droppedTimestamp=St.performance.now(),this.aG.push(e)}fG(){this.oG.slice().forEach((t=>this.dG(t)))}AG(){this.oG.forEach((t=>this.rG(t))),this.aG.forEach((t=>this.rG(t))),this.oG.length=0,this.aG.length=0}uG(t,e){const i=2*t/3,s=4*t/3,r=this.aG.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.aG[r];return this.aG.splice(r,1),this.oG.push(t),t}}cG(){if(this.aG.length>5){const t=St.performance.now();for(let e=0;e=1e4)&&(this.rG(i),this.aG.splice(e,1),e-=1)}}}}class im extends Zy{gG(t,e){if(!e||"object"!=typeof e)return 0;const i=this.dt.x.getInnerStart(),s=this.dt.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.dt.y.getInnerStart(),h=this.dt.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);if("maxDataPointCount"in e)return this.pG(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.mG(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.yG(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}pG(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}yG(t,e,i,s,r,n){if(void 0===e||!this.UN)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.UN?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.UN?a.boundaries.max.x2))break;o+=1}return o}mG(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.UN){if(this.YN?"x"===this.UN?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.UN?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}SG(t,e){const i=t.reduce(((t,e)=>qe(t,e.boundaries)),ze);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.UN||this.YN?"x"===this.UN&&this.YN?i.max.x=Math.min(i.max.x,t):"y"!==this.UN||this.YN?"y"===this.UN&&this.YN&&(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 sm extends ln{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r),this.dR=new Fy,this.wb=[],this.vG=new tm(this.dt,this),this.xG=new Qy(this.dt,this,(()=>this.us.bs())),this.bG=new em(this.wb,(t=>{t.coordsBuffer&&this.zL.SV(t.coordsBuffer),t._N&&this.zL.SV(t._N)}),!0),this.MG=new im(this.dt,this),this._G=0,this.wG=0,this.CG=!1,this.mO=yg({lineStyleSolid:()=>Ji(this.Cu)&&this.Cu,lineStyleDashed:()=>Zn(this.Cu)&&this.Cu,strokeFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},strokeFillLinearGradient:()=>{const t=this.Cu.getFillStyle();return it(t)&&t},strokeFillRadialGradient:()=>{const t=this.Cu.getFillStyle();return Q(t)&&t},strokeFillPaletted:()=>{const t=this.Cu.getFillStyle();return H(t)&&t}}),this.lO=e,this.yO=n,this.SO=o,this.En=h,this.MN={type:"none"},this.zL=t.uO(),this.aO=t,this.xN=this.zL.rz;const a=this.dt._i(),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;sqt(e,t))(a,l);this.kG={individualLookupValuesEnabled:l,attributesPerVertex:f,attributeOffsetCoordinateLowPrecision:u,attributeOffsetCoordinateHighPrecision:c,attributeOffsetLookUpValue:d,prepareRenderData:(t,e)=>g(t,this.Cu.getFillStyle())}}TG(t,e,i){const s=new Float32Array(2*e);let r=0,n=i||t[0];for(let i=0;i0,o=this.jo._(),h=this.jo.o,a=this.mO.lineStyleSolid(i),l=this.mO.lineStyleDashed(i),u=a||l,c=u&&u.getThickness(),d=this.mO.strokeFillSolid(i),f=this.mO.strokeFillLinearGradient(i),g=this.mO.strokeFillRadialGradient(i),y=this.mO.strokeFillPaletted(i),m=d||f||g||y,p=this.kG.individualLookupValuesEnabled;if(l&&this.dt instanceof Vi)return St.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;n&&(this.Lu=se(this.Lu,s,{canReturnB:!0}),this.al+=r);let A=this.Ru.o;const x=this.MG.gG(this.wb,this.Ru._());if(x>0){let t=0;for(let e=0;e{t._N&&(this.zL.SV(t._N),t._N=void 0)})),this.CG=!1),b&&(this.xG.Lg(),this.wb.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=ze,t.lastDataPoint=void 0})),this.bG.fG(),S=this.Lu,this._G=0,this.wG=0);const v=this.xG.iG(S),M=v.length;if(M>0){let t=this.xG.sG(this.Lu)||(this.ha("ApplicationType",(t=>"InternalUI"===t.type))?this.al:1e5);M/t>10&&(t=M/10),this.bG.lG(v,t,((t,e,i,s)=>{const r=this.vG.calculateUserDataPointsBoundaries(e),n=this.xG.eG(r,i,this.Lu)-s;return this.FG=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:n,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.zL.zV(t*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i)),lastDataPoint:e[i-1],_N:this.CG?this.zL.zV(2*t,this.TG(e,i,this.FG)):void 0}}),((t,e,i,s)=>{const r=qe(t.boundaries,this.vG.calculateUserDataPointsBoundaries(e)),n=this.xG.eG(r,t.existingCoordinatesCount+i,this.Lu)-(t.jointPointsCount+s);this.zL.OV(t.coordsBuffer,t.existingCoordinatesCount*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i)),this.CG&&t._N&&this.zL.OV(t._N,2*t.existingCoordinatesCount,this.TG(e,i,this.FG)),this.FG=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}if(A&&(this.ol=this.MG.SG(this.wb,this.Ru._())),this.dR.yV(this.dt),g?this.RO=xy(this.Jo||this.ol,this.dt,g.getPosition(),g.getExtent(),g.getShape(),this.zL.sR()):f?this.EO=Sy(this.Jo||this.ol,this.dt,f.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=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 St.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.MN="primitive"===t?{type:t,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}),l&&Wg.StippleTexture),mousePickingShader:o?this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}),l&&Wg.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:y}:"triangulated"===t?{type:t,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0}),this.xN?Wg.AliasedEdge:void 0,l&&Wg.StippleTextureInstanced),mousePickingShader:o?this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0}),l&&Wg.StippleTextureInstanced):void 0,geometry:Xy(this.zL,c),thickness:c,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:y}:{type:"none"}}else this.MN={type:"none"}}return this.wN=l?this.zL.Dz(l.getPattern()):void 0,this.Iu(e),this.fl=!1,this.ll=[],this.jo.o=!1,this.Ru.o=!1,this}yL(t){const e=this.zL.gl,i=this.MN;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.zL.JL(s).lV(s,((s,l,u,c)=>{let d=!1;if(this.zL.fV(s("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(s("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(s("uRenderEffectMask"),2===t?1:0),this.dt instanceof zi||this.dt instanceof yu?this.zL.cV(s("uScale"),this.dR.gV()).cV(s("uDisp"),this.dR.pV()).cV(c("uScaleStart_highpart"),this.dR.Nz()).cV(c("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof Vi&&this.zL.cV(c("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(c("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(c("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(c("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(s("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(s("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(s("uColor"),this.SO);else if(n)this.zL.AV(s("uColor"),n.getColor());else if(h){if(!this.RO)return!1;this.zL.yz(u,this.RO,h)}else if(o){if(!this.EO)return!1;this.zL.Sz(u,this.EO,o)}else if(a){const t=mg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.zL.Ez(u,a.lut,t)}return this.vG.renderVisibleOnly(this.wb,(n=>{const{coordsBuffer:o}=n;if(!o)return;e.bindBuffer(e.ARRAY_BUFFER,o);const h="triangulated"===i.type?$y.gN:jy.gN;if(this.dt._i()||void 0===this.kG.attributeOffsetCoordinateLowPrecision?this.dt._i()&&void 0!==this.kG.attributeOffsetCoordinateHighPrecision&&h(!0,this.zL,o,u,this.kG.attributesPerVertex,this.kG.attributeOffsetCoordinateHighPrecision):h(!1,this.zL,o,u,this.kG.attributesPerVertex,this.kG.attributeOffsetCoordinateLowPrecision),r){if(!n._N||!this.wN)return;"triangulated"===i.type?$y.pN(this.zL,u,n._N,l("aLengthSoFarA"),l("aLengthSoFarB"),2,0):jy.pN(this.zL,u,n._N,l("aLengthSoFar"),2,0),this.zL.cV(s("uStippleCount"),[this.us.oi().x/this.wN.Rz,this.us.oi().y/this.wN.Rz]).fV(c("uStippleTextureWidthLimiter"),this.wN.Lz/this.wN.Rz).fV(s("uStippleScale"),r.getPatternScale()).dV(s("uStippleTexture"),this.wN.Bz,1)}if(a&&"value"===a.lookUpProperty&&void 0!==this.kG.attributeOffsetLookUpValue&&1!==t)if("triangulated"===i.type){const t=l("aLookupValueA");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(t,1),e.enableVertexAttribArray(t);const i=l("aLookupValueB");e.vertexAttribPointer(i,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.kG.attributeOffsetLookUpValue+this.kG.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(i,1),e.enableVertexAttribArray(i)}else{const t=l("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}if("triangulated"===i.type){const{thickness:e}=i;$y.yL(this.aO,i.geometry,u,this.xN&&1!==t,1===t,e,n.existingCoordinatesCount-1)}else jy.SN(this.aO,n.existingCoordinatesCount);d=!0})),e.bindBuffer(e.ARRAY_BUFFER,null),d})),this}dO(t){return this.yO===t&&{}}_l(t,e){return Array.isArray(t)||(t=[t]),this.ll=se(this.ll,t,{canReturnB:!0}),this.ol=qe(this.ol,e||e||this.vG.calculateUserDataPointsBoundaries(t)),this}Nt(){return super.Nt(),this._G=0,this.wG=0,this.FG=void 0,this}dispose(){return super.dispose(),this.bG.AG(),this.xG.hG(),this.MN={type:"none"},this.wN=void 0,this}GL(){return this}Cx(t){this.Cl()>0&&this.Ds();const e=this.yl(),i=zr(e,t,this.dl,this.$l,this.Xl,this.dt,this.engine.dt,this.ol,this.vG.UN,this.vG.YN);return void 0!==i?e[i]:void 0}cw(t){this.Cl()>0&&this.Ds();const e=this.yl(),i=e.length;if(0===i)return;const s=this.$l?1:0,r=i-(this.Xl?2:1);if(this.dl===Ir.Nearest){let s,r,n=Ie;for(let o=0;o1}Pp(t,e,i,s){return i>1||e?(e?this.zL.jV(t.attribute("aOffsetPixels"),e,1):this.zL.fV(t.uniform("uOffsetPixels"),i),this.zL.uV(this.TL,0,{location:t.attribute("aInstanceGeo"),size:2}).KV(this.AN,0,this.DG,s)):this.zL.fV(t.uniform("uPointSize"),i).Pp(this.zL.gl.POINTS,s),this}IE(){this.zL.SV(this.TL)}}const nm=(t,e=0)=>{const i=[u(-.5,-.5),u(-.5,.5),u(.5,-.5),u(.5,-.5),u(-.5,.5),u(.5,.5)];return new rm(t,i,t.gl.TRIANGLES,e)},om=(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 rm(t,s,t.gl.TRIANGLES,e)},hm=(t,i,s)=>{let r=i.CV.ME.get(t);if(t===e.PointShape.Circle){const t=s<=3?4:s<=5?8:s<=10?16:24;return r=i.CV._E.get(t)||((t,e,i=0)=>{const s=function(t=25){return Ru(u(0,0),0,360,.5,.5,t)[0]}(e);return new rm(t,s,t.gl.TRIANGLE_FAN,i)})(i,t),i.CV._E.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 rm(t,i,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Square:r=nm(i);break;case e.PointShape.Plus:r=om(i);break;case e.PointShape.Cross:r=om(i,45);break;case e.PointShape.Diamond:r=nm(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 rm(t,s,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Star:r=((t,e=0)=>new rm(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 rm(t,s,t.gl.TRIANGLES,e)})(i);break;default:return Se(0,"LightningChart JS unidentified point shape")}i.CV.ME.set(t,r)}return r};class am extends Kr{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dR=new Fy,this.gO=y(c(Le,Le),c(Ie,Ie)),this.mO=yg({pointStyleSolid:()=>G(this.be)&&this.be,pointStyleRadialGradient:()=>Q(this.be)&&this.be,pointStyleLinearGradient:()=>it(this.be)&&this.be,pointStylePaletted:()=>H(this.be)&&this.be,pointStyleIndividual:()=>W(this.be)&&this.be}),this.aO=t,this.lO=e,this.yO=n,this.SO=o,this.zL=t.uO()}Ds(){var t;const e=this.jo._(),i=this.jo.o,s=this.ll,r=s.length,n=r>0,o=this.el._(),h=this.be,a=this.size._(),l=this.el.o||this.Fa.o,u=this.dt.Ni(),c=this.size.o||this.el.o,d=this.fl||s&&s.length>0,f=u||c,g=this.ga(),y=this.mO.pointStyleSolid(g),m=this.mO.pointStyleRadialGradient(g),p=this.mO.pointStyleLinearGradient(g),A=this.mO.pointStylePaletted(g),x=this.mO.pointStyleIndividual(g),S=y||m||p||A||x;if(n&&(this.sl=se(this.sl,s,{canReturnB:!0}),this.al+=r),n||this.fl){this.ol=this.cl?qe(this.ol,this.cl):qe(this.ol,$e(this.sl));const t=qt(this.sl,this.dt._i());this.EG=this.al,this.VG=this.zL.oV(t,!1,this.VG)}this.dR.yV(this.dt),h!==B?f&&(this.zG&&(this.zG=void 0),a>1||W(h)?a<=1?this.AN=this.zL.gl.POINTS:(this.zG=hm(o,this.zL,a),this.AN=this.zG.AN):this.AN=this.zL.gl.POINTS):this.zG&&(this.zG=void 0);const b=(null===(t=this.zG)||void 0===t?void 0:t.BG)||0,v=this.Fa._()+b;if(c||g||i||l){const t=this.hl._()?"attribute":"uniform",i=a<=1&&Wg.PointSize(t),s=Wg.VertexLocation({offset:a>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:(this.rl._()||v%360!=0)&&{dataType:this.rl._()?"attribute":"uniform"}}:void 0,axisWorldTranslation:gg(this.dt),normalSource:void 0});this.gR=S?this.zL.cE(Wg["2D"],i,s,y?Wg.Color({dataType:"uniform"}):x?Wg.Color({dataType:"attribute"}):A?Wg.Color({dataType:["lookup",A.getLookUpProperty(),A.lut]}):m?Wg.Color({dataType:["gradient",m]}):p?Wg.Color({dataType:["gradient",p]}):void 0):void 0,this.zO=e&&S?this.zL.cE(Wg["2D"],i,s,Wg.MousePicking):void 0}if(d||g){const t=this.sl.length;if(W(h)&&this.EG&&this.EG>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=di(v),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.Al={min:e,max:t}}return this.pa=h,this.el.o=!1,this.size.o=!1,this.Fa.o=!1,this.jo.o=!1,this.fl=!1,this}yL(t){const e=1===t?this.zO:this.gR,i=this.VG,s=this.EG;return e&&i&&s&&(this.zL.JL(e),this.zL.lV(e,((e,r,n,o)=>{var h;if(this.dt instanceof zi||this.dt instanceof yu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(o("uScaleStart_highpart"),this.dR.Nz()).cV(o("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof Vi&&this.zL.cV(o("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(o("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(o("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(o("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),this.zL.bz(n,i,this.dt._i(),this.zG?1:void 0).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).fV(o("uDevicePixelRatio"),this.zL.sR()),this.zG){const t=r("aInstanceGeo");this.zL.UV(t,this.zG.TL).HV(t,0)}if(1===t)this.zL.AV(e("uColor"),this.SO);else if(G(this.be))this.zL.AV(e("uColor"),this.be.getColor());else if(W(this.be)&&this.OG){const t=r("aColor");this.zL.XV(t,this.OG),this.AN!==this.zL.gl.POINTS&&this.zL.HV(t,1)}else if(H(this.be)){if("value"===this.be.getLookUpProperty()&&this.WG){const t=r("aLookupValue");this.zL.jV(t,this.WG),this.AN!==this.zL.gl.POINTS&&this.zL.HV(t,1)}const t=mg(this.be,this,this.Al);if(!t&&this.be.lut.percentageValues)return!1;this.zL.Ez(n,this.be.lut,t)}else if(Q(this.be)){if(!this.CO)return!1;this.zL.yz(n,this.CO,this.be)}else if(it(this.be)){if(!this.kO)return!1;this.zL.Sz(n,this.kO,this.be)}if(this.NG&&this.AN!==this.zL.gl.POINTS){const t=r("aOffsetPixels");this.zL.jV(t,this.NG),this.AN!==this.zL.gl.POINTS&&this.zL.HV(t,1)}else if(this.AN!==this.zL.gl.POINTS){const t=e("uOffsetPixels");this.zL.fV(t,this.size._())}const a=((null===(h=this.zG)||void 0===h?void 0:h.BG)||0)+this.Fa._();if(this.GG&&this.AN!==this.zL.gl.POINTS){const t=r("aRot");this.zL.UV(t,this.GG),this.AN!==this.zL.gl.POINTS&&this.zL.HV(t,1)}else if(this.AN!==this.zL.gl.POINTS&&a%360!=0){const t=di(a),i=Math.sin(t),s=Math.cos(t);this.zL.cV(e("uRot"),[i,s])}if(this.AN===this.zL.gl.POINTS)this.zL.fV(e("uPointSize"),this.size._());else{const t={x:2/this.us.oi().x,y:2/this.us.oi().y};this.zL.cV(e("uRatioPxClip"),[t.x,t.y])}let l=!1;return this.AN===this.zL.gl.POINTS?(this.zL.Pp(this.AN,s),l=!0):this.zG&&(this.zL.KV(this.AN,0,this.zG.DG,s),l=!0),l}))),this}dO(t){return this.yO===t&&{}}gg(t){this.Cl()>0&&this.Ds();const e=this.yl(),i=zr(e,t,this.dl,!1,!1,this.dt,this.us.dt,this.ol,void 0,void 0);return void 0!==i?e[i]:void 0}ke(t){return super.ke(t)}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return this.size._()}zl(){return this.size._()}GL(){return this.VG&&(this.zL.SV(this.VG),this.VG=void 0),this.zG&&(this.zG=void 0),this.OG&&(this.zL.SV(this.OG),this.OG=void 0),this.GG&&(this.zL.SV(this.GG),this.GG=void 0),this.WG&&(this.zL.SV(this.WG),this.WG=void 0),this}}class lm extends qr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.MN={fill:void 0,border:void 0},this.dR=new Fy,this.ol=ze,this.UG=!1,this.YG=!1,this.HG=!1,this.$G=!1,this.Nc=[],this.mO=yg({polygonStyleSolid:()=>G(this.be)&&this.be,polygonStyleImage:()=>$n(this.be)&&this.be,polygonStyleRadialGradient:()=>Q(this.be)&&this.be,polygonStyleLinearGradient:()=>it(this.be)&&this.be,polygonStylePaletted:()=>H(this.be)&&this.be,lineStyleSolid:()=>Ji(this.Me)&&this.Me,lineStyleFilled:()=>{const t=this.Me&&this.Me.getFillStyle();return G(t)&&t}}),this.aO=t,this.lO=e,this.PN=n,this.zL=t.uO(),this.xN=this.zL.rz}Lr(){const t=this.PN(),e={vs:t=>this.LN(e,t),cs:t=>this.RN(e,t),Rl:t=>this.XG(e,t),kv:t=>this.jG(e,t),sl:[],S:void 0,Ko:0,ZG:!0,yO:t.id,SO:t.color};return this.Nc.push(e),e}Nt(){var t;return this.Nc.length=0,this.UG=!0,this.ji&&this.bn&&(null===(t=this.us.vn)||void 0===t?void 0:t.entity)===this&&this.bn(this,void 0,this.us.vn.collectionMember),this}jp(){return this.Nc}Wc(t){var e;const i=this.Nc.indexOf(t);i>=0&&(this.Nc.splice(i,1),this.$G=!0,this.ji&&this.bn&&(null===(e=this.us.vn)||void 0===e?void 0:e.entity)===this&&this.us.vn.collectionMember===t&&this.bn(this,void 0,this.us.vn.collectionMember))}LN(t,e){var i;return t.ZG=e,this.$G=!0,this.ji&&this.bn&&(null===(i=this.us.vn)||void 0===i?void 0:i.entity)===this&&this.us.vn.collectionMember===t&&this.bn(this,void 0,this.us.vn.collectionMember),t}RN(t,e){return t.Ko=e,this.HG=!0,t}XG(t,e){return t.sl=e,this.UG=!0,t}jG(t,e){return t.S=e,this.YG=!0,t}Ds(){const t=this.jo._(),e=this.jo.o,i=this.ga(),s=this.HG,r=this.UG,n=this.YG,o=this.$G,a=this.Me,l=this.va(),u=this.Nc.filter((t=>t.ZG&&t.sl.length>0));if(this.dR.yV(this.dt),(r||o)&&(this.ol=qe(...u.map((t=>$e(t.sl))))),r||o){const t=qt(u.map((t=>[...t.sl,t.sl[0],{x:Number.NaN,y:Number.NaN}])).flat(),this.dt._i()),e=this.dt._i()?4:2;this.bN=this.zL.oV(t,!1,this.bN);let i=[];u.reduce(((s,r)=>{const n=s,o=(r.sl.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.sl.length+2),0),e=new Float32Array(t);let i=0;u.forEach((t=>{const s=t.sl.length+2;for(let r=i;rt+e.sl.length+2),0),e=new Float32Array(4*t);let i=0;u.forEach((t=>{const s=t.sl.length+2;for(let r=i;rt+e.sl.length+2),0),e=new Float32Array(t);let i=0;u.forEach((t=>{const s=void 0!==t.S?t.S:-34028234663852886e22,r=t.sl.length+2;for(let t=i;tthis.eW(t,e,i,u))),this.HG=!1,this.$G=!1,this.UG=!1,this.YG=!1,this.jo.o=!1,this.Sa(this.be),this.Ma(a),this}yL(t){var e,i;const{fill:s,border:r}=this.MN,n=this.bN,o=this.qG,h=this.tW;if(!n||!o)return this;if(s){const{fillStyleSolid:i,fillStyleLinearGradient:r,fillStyleRadialGradient:a,fillStylePaletted:l,fillStyleImage:u}=s,c=this.QG,d=this.JG,f=1===t?null===(e=s.mousePicking)||void 0===e?void 0:e.shader:s.shader;if(!f||!n||!c||void 0===d)return this;this.zL.JL(f).lV(f,((e,s,f,g)=>{if(this.dt instanceof zi||this.dt instanceof yu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(g("uScaleStart_highpart"),this.dR.Nz()).cV(g("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof Vi&&this.zL.cV(g("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(g("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(g("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(g("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),this.zL.bz(f,n,this.dt._i(),void 0).ZV(c).jV(s("aIsHighlighted"),o).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.zL.XV(s("aColor"),h)}else if(i)this.zL.AV(e("uColor"),i.getColor());else if(a){if(!this.CO)return!1;this.zL.yz(f,this.CO,a)}else if(r){if(!this.kO)return!1;this.zL.Sz(f,this.kO,r)}else if(l){const t=mg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;if(this.zL.Ez(f,l.lut,t),"value"===l.getLookUpProperty()){if(!this.iW)return!1;this.zL.jV(s("aLookupValue"),this.iW)}}else if(u){if(!this.sW)return!1;this.zL.AV(g("uColor"),u.getSurroundingColor()).dV(e("uColorTexture"),this.sW.texture.YE()||this.sW.sourceMissingTexture,0).uV(this.sW.texCoordsBuffer,void 0,{location:s("aTextureCoord"),size:2}).EV(u.fitMode)}return this.zL.JV(d,void 0,void 0,this.zL.gl.UNSIGNED_INT),!0}))}if(r){const{geometry:e,fillStyleSolid:s,thickness:a}=r,l=this.KG,u=1===t?null===(i=r.mousePicking)||void 0===i?void 0:i.shader:r.shader;if(!u||!n||!l)return this;this.zL.JL(u).lV(u,((i,r,u,c)=>{if(this.dt instanceof zi||this.dt instanceof yu?this.zL.cV(i("uScale"),this.dR.gV()).cV(i("uDisp"),this.dR.pV()).cV(c("uScaleStart_highpart"),this.dR.Nz()).cV(c("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof Vi&&this.zL.cV(c("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(c("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(c("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(c("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(i("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(i("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),this.zL.uV(o,1,{location:r("aIsHighlighted"),size:1}).AV(i("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.zL.uV(h,1,{location:r("aColor"),size:4})}else s&&this.zL.AV(i("uColor"),s.getColor());return $y.gN(this.dt._i(),this.zL,n,u,this.dt._i()?4:2,0),$y.yL(this.aO,e,u,this.xN&&1!==t,1===t,a,l),!0}))}return this}eW(t,e,i,s){const r=ut({x:this.ol.min.x,y:this.ol.min.y},this.dt,this.us.dt),n=ut({x:this.ol.max.x,y:this.ol.max.y},this.dt,this.us.dt),o={x:Math.abs(r.x-n.x),y:Math.abs(r.y-n.y)},h=Ty(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.sl.length+2),0),f=new Float32Array(2*d),g=this.ol.max.x-this.ol.min.x,y=this.ol.max.y-this.ol.min.y,m=l-u,p=c-a;let A=0;for(const t of s){for(const e of t.sl){const t=u+m*((e.x-this.ol.min.x)/g),i=a+p*((e.y-this.ol.min.y)/y);f[A]=t,f[A+1]=i,A+=2}const e=u+m*((t.sl[0].x-this.ol.min.x)/g),i=a+p*((t.sl[0].y-this.ol.min.y)/y);f[A]=e,f[A+1]=i,A+=2,f[A]=Number.NaN,f[A+1]=Number.NaN,A+=2}return f}dO(t){const e=this.Nc.find((e=>e.yO===t));return!!e&&{collectionMember:e}}GL(){return this.QG&&(this.zL.SV(this.QG),this.QG=void 0),this.bN&&(this.zL.SV(this.bN),this.bN=void 0),this.qG&&(this.zL.SV(this.qG),this.qG=void 0),this.tW&&(this.zL.SV(this.tW),this.tW=void 0),this.iW&&(this.zL.SV(this.iW),this.iW=void 0),this.MN={fill:void 0,border:void 0},this.sW=this.zL.zz(this.sW),this}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return Me(this.Me)}zl(){return Me(this.Me)}}class um extends Qr{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dR=new Fy,this.hW=ze,this.mO=yg({fillStyleSolid:()=>G(this.be)&&this.be,fillStyleRadialGradient:()=>Q(this.be)&&this.be,fillStyleLinearGradient:()=>it(this.be)&&this.be,fillStyleImage:()=>$n(this.be)&&this.be,strokeStyleSolid:()=>Ji(this.Me)&&this.Me,strokeFillSolid:()=>{const t=this.Me.getFillStyle();return G(t)&&t},strokeFillLinearGradient:()=>{const t=this.Me.getFillStyle();return it(t)&&t},strokeFillRadialGradient:()=>{const t=this.Me.getFillStyle();return Q(t)&&t}}),this.eW=(t,e,i)=>{const s=ut(this.Ya(),this.dt,this.us.dt),r=ni(ut(ri(this.Ya(),this.oi()),this.dt,this.us.dt),s);return Ty(t,e,r.x,r.y,i)},this.aO=t,this.lO=e,this.yO=n,this.SO=o,this.zL=t.uO(),this.lO=e}Ds(){super.Ds();const t=this.jo._(),e=this.ga(),i=this.wa.o||this.X.o||this.Fa.o||this.Pa.o,s=this.Me,r=this.va(),n=s.getThickness(),o=this.Fa._();this.dR.yV(this.dt);const h=this.dt.Ni();if(i){const t=this.X._();this.sl=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]=Ke(n[0],r,t),n[1]=Ke(n[1],r,t),n[2]=Ke(n[2],r,t),n[3]=Ke(n[3],r,t)}return n}(this.wa._(),t.x,t.y,o,this.Pa._());const e=qt(this.sl,this.dt._i());this.bO=this.zL.oV(e,!1,this.bO),this._O=this.sl.length,this.hW=$e(this.sl)}const a=this.mO.fillStyleSolid(e),l=this.mO.fillStyleRadialGradient(e),c=this.mO.fillStyleLinearGradient(e),d=this.mO.fillStyleImage(e),f=a||l||c||d;e&&(this.TO=f?this.zL.cE(Wg["2D"],a&&Wg.Color({dataType:"uniform"}),c&&Wg.Color({dataType:["gradient",c]}),l&&Wg.Color({dataType:["gradient",l]}),d&&Wg.Color({dataType:["image",d.getFitMode()]}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0),l?this.CO=xy(this.Jo||this.hW,this.dt,l.getPosition(),l.getExtent(),l.getShape(),this.zL.sR()):c?this.kO=Sy(this.Jo||this.hW,this.dt,c.getAngle(!0),this.zL.sR()):(this.CO=void 0,this.kO=void 0),this.sW=this.zL.Vz(this.sW,d,h||i,this.eW);const g=this.mO.strokeStyleSolid(r),y=this.mO.strokeFillSolid(r),m=this.mO.strokeFillLinearGradient(r),p=this.mO.strokeFillRadialGradient(r),A=g,x=y||m||p;if(A&&(i||r||h&&1!==n)){if(1===n||-1===n)[this.FO,this.rW]=[this.sl,void 0];else{const t=this.dt;[this.FO,this.rW]=t instanceof Vi?((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.sl,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=ti(Qe(r,s)),l=ti(Qe(o,s)),c=ai(a),d=ai(l);return[[ri(s,ri(si(c,h.x),si(d,h.y))),ri(r,ri(si(a,h.x),si(d,h.y))),ri(o,ri(si(c,h.x),si(l,h.y))),ri(n,ri(si(a,h.x),si(l,h.y))),ri(s,ri(si(a,h.x),si(l,h.y))),ri(r,ri(si(c,h.x),si(l,h.y))),ri(o,ri(si(a,h.x),si(d,h.y))),ri(n,ri(si(c,h.x),si(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.sl,t.Wi(),n)}this.PO=this.zL.oV(qt(this.FO,this.dt._i()),!1,this.PO),this.rW?(this.dN=this.zL.GV(new Uint16Array(this.rW),this.dN),this.IO=this.rW.length):(this.dN&&this.zL.SV(this.dN),this.dN=void 0,this.IO=this.FO.length)}return r&&(this.VO=A&&x?this.zL.cE(Wg["2D"],Wg.Color({dataType:p?["gradient",p]:m?["gradient",m]:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0),p?this.RO=xy(this.hW,this.dt,p.getPosition(),p.getExtent(),p.getShape(),this.zL.sR()):m?this.EO=Sy(this.hW,this.dt,m.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),this.zO=t&&f?this.zO||this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.OO=t&&this.Me!==rt?this.OO||this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.Sa(this.be),this.Ma(s),this.wa.o=!1,this.Fa.o=!1,this.X.o=!1,this.Pa.o=!1,this}dO(t){return this.yO===t&&{}}yL(t){const e=1===t?this.zO:this.TO,i=this.bO,s=this._O,r=this.mO.fillStyleSolid(!1),n=this.mO.fillStyleRadialGradient(!1),o=this.mO.fillStyleLinearGradient(!1),h=this.mO.fillStyleImage(!1);e&&i&&s&&this.be!==B&&(this.zL.JL(e),this.zL.lV(e,((e,a,l,u)=>{if(this.dt instanceof zi||this.dt instanceof yu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(u("uScaleStart_highpart"),this.dR.Nz()).cV(u("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof Vi&&this.zL.cV(u("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(u("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(u("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(u("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(e("uColor"),this.SO);else if(r)this.zL.AV(e("uColor"),r.getColor());else if(n){if(!this.CO)return!1;this.zL.yz(l,this.CO,n)}else if(o){if(!this.kO)return!1;this.zL.Sz(l,this.kO,o)}else if(h){if(!this.sW)return!1;const t=this.sW&&this.sW.texture.YE();this.zL.AV(u("uColor"),h.getSurroundingColor()).dV(e("uColorTexture"),t||this.sW.sourceMissingTexture,0).uV(this.sW.texCoordsBuffer,void 0,{location:a("aTextureCoord"),size:2}).EV(h.fitMode)}return this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).bz(l,i,this.dt._i(),void 0).Pp(this.zL.gl.TRIANGLE_FAN,s),!0})));const a=1===t?this.OO:this.VO,l=this.mO.strokeStyleSolid(!1),u=this.mO.strokeFillSolid(!1),c=this.mO.strokeFillLinearGradient(!1),d=this.mO.strokeFillRadialGradient(!1),f=this.PO;return a&&f&&l&&(this.zL.JL(a),this.zL.lV(a,((e,i,s,r)=>{if(this.dt instanceof zi||this.dt instanceof yu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(r("uScaleStart_highpart"),this.dR.Nz()).cV(r("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof Vi&&this.zL.cV(r("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(r("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(r("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(r("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(e("uColor"),this.SO);else if(u)this.zL.AV(e("uColor"),u.getColor());else if(d){if(!this.RO)return!1;this.zL.yz(s,this.RO,d)}else if(c){if(!this.EO)return!1;this.zL.Sz(s,this.EO,c)}return this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).bz(s,f,this.dt._i(),void 0),this.dN?this.zL.ZV(this.dN).JV(this.IO):this.zL.Pp(this.zL.gl.LINE_LOOP,this.IO),!0}))),this}GL(){return this.dN&&(this.zL.SV(this.dN),this.dN=void 0),this.bO&&(this.zL.SV(this.bO),this.bO=void 0),this.PO&&(this.zL.SV(this.PO),this.PO=void 0),this.sW=this.zL.zz(this.sW),this.TO=void 0,this.VO=void 0,this.zO=void 0,this.OO=void 0,this}xt(){return Math.max(this.wa._().x,this.wa._().x+this.X._().x)}vt(){return Math.min(this.wa._().x,this.wa._().x+this.X._().x)}Mt(){return Math.max(this.wa._().y,this.wa._().y+this.X._().y)}bt(){return Math.min(this.wa._().y,this.wa._().y+this.X._().y)}Vl(){return Me(this.Me)}zl(){return Me(this.Me)}}class cm extends en{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dR=new Fy,this.mO=yg({fillStyleSolid:()=>G(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be,fillStyleRadialGradient:()=>Q(this.be)&&this.be,fillStyleLinearGradient:()=>it(this.be)&&this.be,fillStyleImage:()=>$n(this.be)&&this.be,strokeLineStyleSolid:()=>Ji(this.Me)&&this.Me,strokeLineSolidFill:()=>{const t=this.Me.getFillStyle();return G(t)&&t},strokeLinearGradientFill:()=>{const t=this.Me.getFillStyle();return it(t)&&t},strokeRadialGradientFill:()=>{const t=this.Me.getFillStyle();return Q(t)&&t}}),this.eW=(t,e,i)=>{const s=ut({x:this.ol.min.x,y:this.ol.min.y},this.dt,this.us.dt),r=ut({x:this.ol.max.x,y:this.ol.max.y},this.dt,this.us.dt),n={x:Math.abs(s.x-r.x),y:Math.abs(s.y-r.y)},o=Ty(t,e,n.x,n.y,i),h=o[1],a=o[4],l=o[6],u=o[7],c=new Float32Array(2*this.sl.length),d=this.ol.max.x-this.ol.min.x,f=this.ol.max.y-this.ol.min.y,g=a-l,y=u-h;let m=0;for(const t of this.sl){const e=l+g*((t.x-this.ol.min.x)/d),i=h+y*((t.y-this.ol.min.y)/f);c[m]=e,c[m+1]=i,m+=2}return c},this.aO=t,this.lO=e,this.yO=n,this.SO=o,this.zL=t.uO(),this.lO=e}gg(t){let e,i=Number.MAX_VALUE;for(const s of this.sl){const r=We(ut(s,this.dt,this.us.dt),t);r=3,r=this.Me,n=this.va(),o=r.getThickness(),a=this.ba(o);this.dR.yV(this.dt),this.iM=this.dt.Wi();const l=this.dt.Ni();if(i&&(this.ol=$e(this.sl)),i&&s){const t=qt(this.sl,this.dt._i());this.bO=this.zL.oV(t,!1,this.bO),this.nW=new Uint16Array(h.default(t)),this.oW=this.zL.GV(this.nW,this.oW),this._O=this.nW.length}const u=this.mO.fillStyleSolid(e),c=this.mO.fillStylePaletted(e),d=this.mO.fillStyleRadialGradient(e),f=this.mO.fillStyleLinearGradient(e),g=this.mO.fillStyleImage(e),y=u||c&&"value"!==c.getLookUpProperty()&&c||f||d||g;if(e&&(this.TO=y?this.zL.cE(Wg["2D"],u&&Wg.Color({dataType:"uniform"}),f&&Wg.Color({dataType:["gradient",f]}),d&&Wg.Color({dataType:["gradient",d]}),c&&Wg.Color({dataType:["lookup",c.getLookUpProperty(),c.lut]}),g&&Wg.Color({dataType:["image",g.getFitMode()]}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0),d?this.CO=xy(this.Jo||this.ol,this.dt,d.getPosition(),d.getExtent(),d.getShape(),this.zL.sR()):f?this.kO=Sy(this.Jo||this.ol,this.dt,f.getAngle(!0),this.zL.sR()):(this.CO=void 0,this.kO=void 0),this.sW=this.zL.Vz(this.sW,g,l||i,this.eW),(i||a||l&&1!==o)&&s){const t=1===o||-1===o?this.sl:Py(this.sl,this.iM,o);this.FO=qt(t,this.dt._i()),this.PO=this.zL.oV(this.FO,!0,this.PO),this.IO=t.length}const m=this.mO.strokeLineStyleSolid(n),p=this.mO.strokeLineSolidFill(n),A=this.mO.strokeLinearGradientFill(n),x=this.mO.strokeRadialGradientFill(n),S=m,b=p||A||x;return n&&(this.VO=S&&b?this.zL.cE(Wg["2D"],Wg.Color({dataType:x?["gradient",x]:A?["gradient",A]:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0),x?this.RO=xy(this.Jo||this.ol,this.dt,x.getPosition(),x.getExtent(),x.getShape(),this.zL.sR()):A?this.EO=Sy(this.Jo||this.ol,this.dt,A.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),this.zO=t&&y?this.zO||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.OO=t&&this.Me!==rt?this.zO||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.Ll=!1,this.Sa(this.be),this.Ma(r),this}yL(t){const e=1===t?this.zO:this.TO,i=this.bO,s=this._O,r=this.mO.fillStyleSolid(!1),n=this.mO.fillStyleRadialGradient(!1),o=this.mO.fillStyleLinearGradient(!1),h=this.mO.fillStylePaletted(!1),a=this.mO.fillStyleImage(!1);e&&i&&s&&this.zL.JL(e).lV(e,((e,s,l,u)=>{if(this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(u("uScaleStart_highpart"),this.dR.Nz()).cV(u("uScaleStart_lowpart"),this.dR.Gz()).bz(l,i,this.dt._i(),void 0).ZV(this.oW).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1===t)this.zL.AV(e("uColor"),this.SO);else if(r)this.zL.AV(e("uColor"),r.getColor());else if(n){if(!this.CO)return!1;this.zL.yz(l,this.CO,n)}else if(o){if(!this.kO)return!1;this.zL.Sz(l,this.kO,o)}else if(h){const t=mg(h,this,void 0);if(!t&&h.lut.percentageValues)return!1;this.zL.Ez(l,h.lut,t)}else if(a){if(!this.sW)return!1;this.zL.AV(u("uColor"),a.getSurroundingColor()).dV(e("uColorTexture"),this.sW.texture.YE()||this.sW.sourceMissingTexture,0).uV(this.sW.texCoordsBuffer,void 0,{location:s("aTextureCoord"),size:2}).EV(a.fitMode)}return this.zL.JV(this._O),!0}));const l=1===t?this.OO:this.VO,u=this.Me,c=this.PO,d=this.IO;return l&&c&&d&&this.zL.JL(l).lV(l,((e,i,s,r)=>{this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).bz(s,c,this.dt._i(),void 0);const n=u.getFillStyle();if(1===t)this.zL.AV(e("uColor"),this.SO);else if(G(n))this.zL.AV(e("uColor"),n.getColor());else if(Q(n)){if(!this.RO)return!1;this.zL.yz(s,this.RO,n)}else if(it(n)){if(!this.EO)return!1;this.zL.Sz(s,this.EO,n)}const o=u.getThickness(),h=-1===o||1===o;return this.zL.Pp(h?this.zL.gl.LINE_LOOP:this.zL.gl.TRIANGLE_STRIP,this.IO),!0})),this}dO(t){return this.yO===t&&{}}GL(){return this.oW&&(this.zL.SV(this.oW),this.oW=void 0),this.bO&&(this.zL.SV(this.bO),this.bO=void 0),this.PO&&(this.zL.SV(this.PO),this.PO=void 0),this.TO=void 0,this.VO=void 0,this.zO=void 0,this.OO=void 0,this.sW=this.zL.zz(this.sW),this}}const dm=(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},gm=(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(!Be(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const u=_e(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.gz(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.gz(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.gz(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},pm=(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 Am extends jr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.aW=p("bilinear"),this.Pi={x:0,y:0},this.yw={x:1,y:1},this.Ky=Mr.lineStyle,this.engine=t;const o="columns"===n.dataOrder?n.columns:n.rows,h="columns"===n.dataOrder?n.rows:n.columns;this.En={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}rS(t){return this.aW.M(t),this}nS(){return this.aW._()}sS(t,e){return this.Pi=t,this.yw=e,this}eS(){return{start:this.Pi,step:this.yw,end:{x:this.Pi.x+this.yw.x*this.En.columns,y:this.Pi.y+this.yw.y*this.En.rows}}}qy(t){return this.Ky="function"==typeof t?t(this.Ky):t,this}hS(){return this.Ky}}class xm extends Am{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.dR=new Fy,this.MN={},this.lW=[],this.uW=!1,this.fl=!1,this.mO=yg({fillStyleSolid:()=>G(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be,wireframeStyleLine:()=>Ji(this.Ky)&&this.Ky,wireframeStyleFill:()=>{const t=this.Ky&&this.Ky.getFillStyle();return G(t)&&t}}),this.cW=dm,this.aO=t,this.lO=e,this.yO=o,this.SO=h,this.zL=t.uO(),this.lO=e;const a=Math.min(this.zL.NL,void 0!==n.dW?n.dW:2048),l={x:Math.min(a,this.En.primaryDimensionVectorsCount),y:Math.min(a,this.En.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.En,l,this.cW),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.fW={gridTiles:c,gridTileSizes:d},this.sS(this.Pi,this.yw)}Ds(){const t=this.lW,e=this.be,i=this.ga(),s=this.Ky,r=s!==this.AW,n=this.mO.fillStylePaletted(i),o=this.mO.fillStyleSolid(i),h=this.aW.o,a=this.aW._(),l=this.fl,u=this.jo._();this.gW=this.gW||this.pW();const c=this.gW,d=gm(t,c,l?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));d.size>0&&(pm(this.zL,d,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.uW=!0),this.dR.yV(this.dt);const f=this.MN;if((i||h)&&(f.tile=n?{renderMode:"paletted",fillStylePaletted:n,shader:this.zL.cE(Wg["2D"],Wg.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===a&&"bilinear",flipXY:"rows"===this.En.dataOrder,intensityTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN,lut:n.lut}),Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),flipXY:"rows"===this.En.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),flipXY:"rows"===this.En.dataOrder,normalSource:void 0}))}:void 0),r){const t=this.mO.wireframeStyleLine(r),e=this.mO.wireframeStyleFill(r);f.wireframe=t&&e?-1===t.getThickness()?{renderMode:"primitive",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.En.dataOrder,axisWorldTranslation:gg(this.dt),normalSource:void 0})),fillStyleSolid:e}:{renderMode:"triangulated",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.En.dataOrder,axisWorldTranslation:gg(this.dt),normalSource:void 0})),geometry:Xy(this.zL,1),solidLine:t,fillStyleSolid:e}:void 0,f.wireframe?this.mW=this.mW||this.yW():this.mW&&(this.zL.SV(this.mW.wireframeCoordinatesBuffer),this.mW=void 0)}if(f.mousePicking=u?this.MN.mousePicking||{shader:this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),flipXY:"rows"===this.En.dataOrder,normalSource:void 0}))}:void 0,this.MN=f,void 0===this.Al&&n&&"value"===n.lookUpProperty&&n.lut.percentageValues){let t=Ie,e=Le;this.gW.gridTiles.forEach((i=>{for(let s=0;se&&(e=r)}})),this.Al={min:t,max:e}}return this.fl=!1,this.lW.length=0,this.Sa(e),this.AW=s,this.aW.o=!1,this}pW(){const t=this.fW.gridTiles.map((t=>{const e=mm(this.zL,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e,tileData:t}})),e=this.fW.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.zL.oV([0,0,1,0,0,1,1,1]),s=this.zL.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}yW(){const t=this.En.primaryDimensionVectorsCount+1+this.En.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{const e="columns"===this.En.dataOrder?{x:this.Pi.x+this.yw.x*t.iFirstVector.primary,y:this.Pi.y+this.yw.y*t.iFirstVector.secondary}:{x:this.Pi.x+this.yw.x*t.iFirstVector.secondary,y:this.Pi.y+this.yw.y*t.iFirstVector.primary},i="columns"===this.En.dataOrder?{x:this.yw.x*t.sizeHeatmapDataVectors.primary,y:this.yw.y*t.sizeHeatmapDataVectors.secondary}:{x:this.yw.x*t.sizeHeatmapDataVectors.secondary,y:this.yw.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.En.dataOrder?{x:this.Pi.x+this.yw.x*t.iFirstUniqueVector.primary,y:this.Pi.y+this.yw.y*t.iFirstUniqueVector.secondary}:{x:this.Pi.x+this.yw.x*t.iFirstUniqueVector.secondary,y:this.Pi.y+this.yw.y*t.iFirstUniqueVector.primary},n="columns"===this.En.dataOrder?{x:this.yw.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.yw.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.yw.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.yw.y*t.sizeUniqueHeatmapDataVectors.primary};r.set(t,{startLocationAxis:e,sizeAxis:i,startRenderLocationAxis:s,renderSizeAxis:n})})),this.SW={boundaries:s,tilesInfo:r},this}yL(t){var e,i;const s=this.gW,r=this.SW,n=1===t?null===(e=this.MN.mousePicking)||void 0===e?void 0:e.shader:null===(i=this.MN.tile)||void 0===i?void 0:i.shader;if(this.MN.tile&&n&&s&&r){const e=n,i=this.MN.tile,o={x:(r.boundaries.max.x-r.boundaries.min.x)*Math.sign(this.yw.x),y:(r.boundaries.max.y-r.boundaries.min.y)*Math.sign(this.yw.y)},h={x:o.x/this.En.columns,y:o.y/this.En.rows},a=this.dt.Wi(),l={x:h.x/a.x,y:h.y/a.y};if("solid"===i.renderMode||1===t)this.zL.JL(e).lV(e,((e,r,n)=>{if(1===t)this.zL.AV(e("uColor"),this.SO);else if("solid"===i.renderMode){const{fillStyleSolid:t}=i;this.zL.AV(e("uColor"),t.getColor())}return this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).uV(s.rectangleLocationsBuffer,void 0,{location:r("aPos"),size:2}).cV(e("uScaling"),[this.yw.x*this.En.columns,this.yw.y*this.En.rows]).cV(e("uTranslationAxis"),[this.Pi.x,this.Pi.y]).Pp(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),!0}));else if("paletted"===i.renderMode){const{fillStylePaletted:n}=i,o=this.Al;this.zL.lV(e,((i,h,a)=>{let u=!1;var c,d;return this.zL.JL(e).cV(i("uScale"),this.dR.gV()).cV(i("uDisp"),this.dR.pV()).Ez(a,n.lut,o).uV(s.rectangleLocationsBuffer,void 0,{location:h("aPos"),size:2}).fV(i("uIsHighlighted"),this.Ko).AV(i("uHighlightColorOffset"),2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0),c=t=>{this.zL.cV(i("uTileDimensions"),["columns"===this.En.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.En.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.zL.sR();if("bilinear"===this.aW._()){const t=(this.dt.x.ct(n.startLocationAxis.x)+l.x/2)*h,e=(this.dt.y.ct(n.startLocationAxis.y)+l.y/2)*h;o=[t,e,(this.dt.x.ct(n.startLocationAxis.x+n.sizeAxis.x)-l.x/2)*h-t,(this.dt.y.ct(n.startLocationAxis.y+n.sizeAxis.y)-l.y/2)*h-e]}else{const t=this.dt.x.ct(n.startLocationAxis.x)*h,e=this.dt.y.ct(n.startLocationAxis.y)*h;o=[t,e,this.dt.x.ct(n.startLocationAxis.x+n.sizeAxis.x)*h-t,this.dt.y.ct(n.startLocationAxis.y+n.sizeAxis.y)*h-e]}this.zL.PV(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).Pp(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),u=!0},s.gridTileSizes.forEach((t=>{c(t),t.tiles.forEach((t=>{d(t)}))})),u}))}}const o=this.mW,h=this.MN.wireframe,a=1===t||null==h?void 0:h.shader;if(o&&h&&a&&"primitive"===h.renderMode){const{fillStyleSolid:e}=h;this.zL.JL(a).lV(a,((i,s,r)=>((this.dt instanceof zi||this.dt instanceof yu)&&this.zL.cV(i("uScale"),this.dR.gV()).cV(i("uDisp"),this.dR.pV()),this.zL.fV(i("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(i("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0).AV(i("uColor"),e.getColor()).uV(o.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).cV(i("uScaling"),[this.yw.x,this.yw.y]).cV(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).Pp(this.zL.gl.LINES,2*o.wireframeSegmentsLength),!0)))}else if(o&&h&&a&&"triangulated"===h.renderMode){const{geometry:e,solidLine:i,fillStyleSolid:s}=h;this.zL.JL(a).lV(a,((r,n,h)=>((this.dt instanceof zi||this.dt instanceof yu)&&this.zL.cV(r("uScale"),this.dR.gV()).cV(r("uDisp"),this.dR.pV()),this.zL.fV(r("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(r("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(r("uRenderEffectMask"),2===t?1:0).AV(r("uColor"),s.getColor()).fV(r("uThicknessPixels"),i.getThickness()).cV(r("uRatioPxClip"),[2/this.us.oi().x,2/this.us.oi().y]).uV(o.wireframeCoordinatesBuffer,1,{location:n("aLocationA"),size:2},{location:n("aLocationB"),size:2}).cV(r("uScaling"),[this.yw.x,this.yw.y]).cV(r("uTranslationAxis"),[this.Pi.x,this.Pi.y]),e.JL(h,!1).Pp(o.wireframeSegmentsLength),!0)))}return this}oS(t){return this.lW.push(t),ym(this.fW.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this.Al=void 0,this}Nt(){return this.uW&&(this.fW.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.fl=!0,this.uW=!1,this.Al=void 0),this}dispose(){super.dispose();const t=this.gW;t&&(t.gridTiles.forEach((t=>{this.zL.WL(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.zL.SV(t.rectangleLocationsBuffer)),this.gW=void 0;const e=this.mW;return e&&this.zL.SV(e.wireframeCoordinatesBuffer),this.mW=void 0,this.MN={},this}GL(){return this.dispose(),this}dO(t){return this.yO===t&&{}}gg(t){const e=t,i="columns"===this.En.dataOrder?e.x:e.y,s="columns"===this.En.dataOrder?e.y:e.x,r="columns"===this.En.dataOrder?this.Pi.x:this.Pi.y,n="columns"===this.En.dataOrder?this.Pi.y:this.Pi.x;let o=(i-r)/("columns"===this.En.dataOrder?this.yw.x:this.yw.y),h=(s-n)/("columns"===this.En.dataOrder?this.yw.y:this.yw.x);o=Math.floor(kt(o,0,this.En.primaryDimensionVectorsCount-1)),h=Math.floor(kt(h,0,this.En.secondaryDimensionVectorsCount-1));const a=this.vW(o,h),l="columns"===this.En.dataOrder?{x:this.Pi.x+(o+.5)*this.yw.x,y:this.Pi.y+(h+.5)*this.yw.y}:{x:this.Pi.x+(h+.5)*this.yw.x,y:this.Pi.y+(o+.5)*this.yw.y},u="columns"===this.En.dataOrder?o:h,c="columns"===this.En.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}vx(t){const e=this.SW;if(!e||t.xe.boundaries.max.x||t.ye.boundaries.max.y)return;const i=t,s="columns"===this.En.dataOrder?i.x:i.y,r="columns"===this.En.dataOrder?i.y:i.x,n="columns"===this.En.dataOrder?this.Pi.x:this.Pi.y,o="columns"===this.En.dataOrder?this.Pi.y:this.Pi.x,h="columns"===this.En.dataOrder?this.yw.x:this.yw.y,a="columns"===this.En.dataOrder?this.yw.y:this.yw.x,l=kt((s-n)/h-.5,0,this.En.primaryDimensionVectorsCount-1),u=kt((r-o)/a-.5,0,this.En.secondaryDimensionVectorsCount-1),c=kt(Math.ceil(l)-1,0,this.En.primaryDimensionVectorsCount-1),d=kt(Math.ceil(u)-1,0,this.En.secondaryDimensionVectorsCount-1),f={point:{x:c,y:d},value:this.vW(c,d)},g={point:{x:c,y:d+1},value:this.vW(c,d+1)},y={point:{x:c+1,y:d},value:this.vW(c+1,d)},m={point:{x:c+1,y:d+1},value:this.vW(c+1,d+1)},p=zn({x:l,y:u},f,g,y,m);if(void 0===p)return;const A=kt(Math.floor(l+.5),0,this.En.primaryDimensionVectorsCount-1),x=kt(Math.floor(u+.5),0,this.En.secondaryDimensionVectorsCount-1),S="columns"===this.En.dataOrder?A:x,b="columns"===this.En.dataOrder?x:A,v=t;return{x:v.x,y:v.y,column:S,row:b,cellValue:p}}vW(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}xt(){var t;return(null===(t=this.SW)||void 0===t?void 0:t.boundaries.max.x)||0}vt(){var t;return(null===(t=this.SW)||void 0===t?void 0:t.boundaries.min.x)||0}Mt(){var t;return(null===(t=this.SW)||void 0===t?void 0:t.boundaries.max.y)||0}bt(){var t;return(null===(t=this.SW)||void 0===t?void 0:t.boundaries.min.y)||0}Vl(){return 0}zl(){return 0}hk(){const t=[];return this.fW.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.yw.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}),this.MG=new im(this.dt,this));const t=this.MG.gG(this.wb,this.Ru._());if(t>0){for(let e=0;e0?this.wb[0].boundaries.min.x:Ie:this.ol.min.y=this.wb.length>0?this.wb[0].boundaries.min.y:Ie}this.wb.forEach((t=>t.shape.Ds()));const e=this.wb.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Dt(null===(i=e.shape.Al)||void 0===i?void 0:i.min,Ie)),t.max=Math.max(t.max,Dt(null===(s=e.shape.Al)||void 0===s?void 0:s.max,Le)),t}),{min:Ie,max:Le});return this.wb.forEach((t=>{t.shape.Al=e})),this.Ru.o=!1,this}yL(t){return this.wb.forEach((e=>e.shape.yL(t))),this}dS(t){if(0===t.length)return this;let e=0;const i=this.bW.dataPerSegment,s=t.length;do{let r=this.wb[this.wb.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this.En.scrollDimension?i:this.En.resolution,rows:"rows"===this.En.scrollDimension?i:this.En.resolution,heatmapDataType:this.En.heatmapDataType,dataOrder:this.En.scrollDimension};let e="columns"===this.En.scrollDimension?{x:this.Pi.x+this.yw.x*this.xW,y:this.Pi.y}:{x:this.Pi.x,y:this.Pi.y+this.yw.y*this.xW};this.wb.length>0&&(e="columns"===this.En.scrollDimension?{x:e.x-1*this.yw.x,y:e.y}:{x:e.x,y:e.y-1*this.yw.y},o=!0);const s=new xm(this.aO,this.lO,this.dt,wt,[],t,this.yO,this.SO).rS(this.aW._()).ke(this.be).qy(this.Ky).sS(e,this.yw);r={shape:s,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.xW,hasJoint:!1,boundaries:{min:{x:s.vt(),y:s.bt()},max:{x:s.xt(),y:s.Mt()}}},this.wb.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.En.resolution};o&&(u.values.unshift(this.MW),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.oS(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),this.MW=l[l.length-1],this.xW+=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.oS(c)}));const n=this.xW-1;if(s>n){const t=s-n,i=e.slice(-t);if(i.length{t.shape.dispose().GL()})),this.wb.length=0,this.ol="columns"===this.En.scrollDimension?y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.En.resolution*this.yw.y}):y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.En.resolution*this.yw.x,y:this.Pi.y}),this.xW=0,this.MW=void 0,this}sS(t,e){return super.sS(t,e),this.wb.forEach(((i,s)=>{const r={x:t.x+i.dataStartIndex*e.x,y:t.y+i.dataStartIndex*e.y};i.shape.sS(r,e),i.boundaries={min:{x:i.shape.vt(),y:i.shape.bt()},max:{x:i.shape.xt(),y:i.shape.Mt()}}})),this.wb.length>0?this.ol=qe(...this.wb.map((t=>t.boundaries))):this.ol="columns"===this.En.scrollDimension?y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.En.resolution*this.yw.y}):y({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.En.resolution*this.yw.x,y:this.Pi.y}),this}ke(t){return super.ke(t),this.wb.forEach((t=>t.shape.ke(this.be))),this}qy(t){return super.qy(t),this.wb.forEach((t=>t.shape.qy(this.Ky))),this}rS(t){return super.rS(t),this.wb.forEach((e=>e.shape.rS(t))),this}dispose(){return super.dispose(),this.wb.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.wb.forEach((e=>e.shape.setVisible(t))),this}GL(){return this.wb.forEach((t=>t.shape.GL())),this}dO(t){return this.yO===t&&{}}gg(t){const e=ut(t,this.dt,this.engine.dt),i=this.wb.reduce(((i,s)=>{const r=s.shape.gg(t);if(r){const t=Ye(ut(r,this.dt,this.engine.dt),e);if(void 0===i||t=this.xW||"rows"===this.En.scrollDimension&&e>=this.xW)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}vx(t){const e=ut(t,this.dt,this.engine.dt),i=this.wb.reduce(((i,s)=>{const r=s.shape.vx(t);if(r){const t=Ye(ut(r,this.dt,this.engine.dt),e);if(void 0===i||t=this.xW||"rows"===this.En.scrollDimension&&e>=this.xW)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return 0}zl(){return 0}cs(t){return super.cs(t),this.wb.forEach((e=>e.shape.cs(t))),this}}class vm extends jr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.aW=p("bilinear"),this.Ky=Mr.lineStyle,this.En=n}rS(t){return this.aW.M(t),this}nS(){return this.aW._()}qy(t){return this.Ky="function"==typeof t?t(this.Ky):t,this}hS(){return this.Ky}}class Mm extends vm{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.dR=new Fy,this.MN={},this.mO=yg({fillStyleSolid:()=>G(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be}),this.aO=t,this.lO=e,this.yO=o,this.SO=h,this.zL=t.uO(),this.lO=e,this.sk=new xm(this.aO,t._W,t.dt,wt,[],{columns:n.sectors,rows:n.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===n.dataOrder?"rows":"columns",dW:this.zL.NL},-1,C).qy(rt);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.wW={vertexBuffer:this.zL.oV(l),drawMode:this.zL.gl.TRIANGLE_FAN,drawLength:362}}Ds(){const t=this.ga(),e=this.be,i=this.mO.fillStyleSolid(t),s=this.mO.fillStylePaletted(t),r=i||s,n=this.aW._(),o=this.aW.o,h=this.jo._(),a=this.jo.o;return this.dR.yV(this.dt),this.sk.Ds(),this.sk.gW?((t||o)&&(this.MN.fill=r?{shader:this.zL.cE(Wg["2D"],Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),normalSource:void 0}),s&&Wg.PolarHeatmap({interpolation:"bilinear"===n&&"bilinear",intensityTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this.En.dataOrder,lut:s.lut}),i&&Wg.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:s,fillStyleSolid:i}:void 0),a&&(this.MN.mousePicking=h?{shader:this.zL.cE(Wg["2D"],Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),normalSource:void 0}),Wg.Color({dataType:"uniform"}))}:void 0),this.Sa(e),this.aW.o=!1,this.jo.o=!1,this):this}yL(t){var e;const{vertexBuffer:i,drawLength:s,drawMode:r}=this.wW,n=this.sk.gW;if(!this.MN.fill||!n)return this;const{fillStylePaletted:o,fillStyleSolid:h}=this.MN.fill,a=1===t?null===(e=this.MN.mousePicking)||void 0===e?void 0:e.shader:this.MN.fill.shader;if(!a)return this;const l=this.dt.Xv(),u=Math.min(l.start,l.end),c=Math.max(l.start,l.end),d=Math.min(this.En.amplitudeStart,this.En.amplitudeStart+(this.En.annuli-1)*this.En.amplitudeStep),f=Math.max(this.En.amplitudeStart,this.En.amplitudeStart+(this.En.annuli-1)*this.En.amplitudeStep);let g;return g=l.end>l.start?Math.min(f,c)-l.start:Math.max(d,u)-l.start,this.zL.JL(a).lV(a,((e,a,l,u)=>{if(this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).cV(u("uViewportSize"),[this.aO.oi().x*this.zL.sR(),this.aO.oi().y*this.zL.sR()]).cV(e("uScaling"),[g,g]).cV(e("uTranslationAxis"),[0,0]).uV(i,void 0,{location:a("aPos"),size:2}).fV(u("uAngleOffset"),this.dt.Kv()%(2*Math.PI)).fV(u("uAngleDirection"),this.dt.hx()?1:-1).fV(u("uSectors"),this.En.sectors).fV(u("uAnnuli"),this.En.annuli),1===t)this.zL.AV(e("uColor"),this.SO);else{if(this.zL.fV(e("uAmplitudeStart"),this.En.amplitudeStart).fV(e("uAmplitudeStep"),this.En.amplitudeStep).fV(e("uAmplitudeAxisStart"),this.dt.Xv().start).fV(e("uAmplitudeAxisEnd"),this.dt.Xv().end),o){const t=this.sk.Al;this.zL.Ez(l,o.lut,t).dV(e("uTileIntensityValues"),n.gridTiles[0].intensityDataTexture,0)}h&&this.zL.AV(e("uColor"),h.getColor())}return this.zL.Pp(r,s),!0})),this}oS(t){return this.sk.oS(t),this}Nt(){return this.sk.Nt(),this}dispose(){return super.dispose(),this.sk.dispose(),this.MN={},this.zL.SV(this.wW.vertexBuffer),this}GL(){return this.dispose(),this}ke(t){return super.ke(t),this.sk.ke(this.be),this}dO(t){return this.yO===t&&{}}gg(t){const e=this.En.amplitudeStart,i=this.En.amplitudeStart+(this.En.annuli-1)*this.En.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.En.sectors);n>=this.En.sectors&&(n=0);const o=Math.round((t.amplitude-e)/(i-e)*(this.En.annuli-1));return{iAnnulus:o,iSector:n,cellValue:this.vW(o,n),angle:n*(360/this.En.sectors),amplitude:e+o*(i-e)/(this.En.annuli-1)}}vx(t){const e=this.En.amplitudeStart,i=this.En.amplitudeStart+(this.En.annuli-1)*this.En.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.En.sectors,o=(t.amplitude-e)/(i-e)*(this.En.annuli-1),h=Math.floor(n),a=Math.floor(o),l={point:{x:a,y:h},value:this.vW(a,h)},u={point:{x:a,y:h+1},value:this.vW(a,h+1)},c={point:{x:a+1,y:h},value:this.vW(a+1,h)},d={point:{x:a+1,y:h+1},value:this.vW(a+1,h+1)},f=zn({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}vW(t,e){const i="annuli"===this.En.dataOrder?t:e,s="annuli"===this.En.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}xt(){return 0}vt(){return 0}Mt(){return 0}bt(){return 0}Vl(){return 0}zl(){return 0}}class Tm extends by{constructor(t){super(t);const{vertices:e,drawMode:i,drawSize:s}=this.uN();this.cN=t.oV(e),this.fN=s,this.AN=i}JL(t){return this.zL.uV(this.cN,0,{location:t.attribute("aCurveOrBaseline"),size:1},{location:t.attribute("aSegmentSide"),size:1}),this}Pp(t,e,i){return this.zL.KV(void 0!==e?e:this.AN,i||0,this.fN,t),this}uN(){return{vertices:new Float32Array([1,0,0,0,0,1,0,1,1,1,1,0]),drawMode:this.zL.gl.TRIANGLES,drawSize:6}}IE(){this.zL.SV(this.cN)}}const wm=t=>{let e=t.CV.CE.get(void 0);return e||(e=new Tm(t),t.CV.CE.set(void 0,e),e)};class Em extends on{constructor(t,i,s,r){super(t,i,s,r,[{type:"DataPattern",args:{pattern:"ProgressiveX"}}]),this.kW=Mr.fillStyle,this.TW=Mr.fillStyle,this.FW=p(e.PointShape.Circle),this.IW=p(5),this.PW=p(0),this.DW=p(void 0),this.iF=!0}KT(t){return this.kW=Hr(this.kW,t),this}rF(){return this.kW}BW(){return Xr(this.LW,this.kW)}RW(){return Xr(this.EW,this.TW)}qT(t){return this.TW=Hr(this.TW,t),this}nF(){return this.TW}aF(t){return this.FW.M(t),this}lF(){return this.FW._()}QT(t){return this.IW.M(t),this}oF(){return this.IW._()}uF(t){return this.PW.M(t),this}cF(){return this.PW._()}JT(t){return this.DW.M(t),this}dF(){return this.DW._()}}class km extends Zy{constructor(t,e){super(t,e),this.XN=!1,this.jN={enabled:!1,totalDataPointsAtTime:0},this.QN=t instanceof zi?{type:"linear",scale:t}:{type:"unknown"},this.$N.ha("DataPattern",(t=>{!1===t.allowDataGrouping&&(this.XN=!0)}))}VW(t,e){var i,s;const r=null==t?void 0:t.FT,n=null==t?void 0:t.IT,o=null==t?void 0:t.fT,h=null==t?void 0:t.dT;if(!t||this.XN||!this.UN||"linear"!==this.QN.type||!r||!n||void 0===o||void 0===h||!e)return{cpStateChanged:!1,cpActive:!1};const a=null===(i=t.TT())||void 0===i?void 0:i.x,l=null===(s=t.XT())||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.QN.scale,d=Math.abs("x"===this.UN?c.Wi().x:c.Wi().y),f=d/u,g=Math.floor(.8*f),y=g*u,m=g>=4,p=this.jN.enabled?this.jN.columnWidthAxis/d<1.5:void 0,A=this.jN.enabled&&g>this.jN.dataPointsPerColumn?g/this.jN.dataPointsPerColumn>=2:void 0;let x;return!0===this.jN.enabled?p?A&&(x={enabled:!0,columnWidthAxis:y,dataPointsPerColumn:g,totalDataPointsAtTime:o}):x=m?{enabled:!0,columnWidthAxis:y,dataPointsPerColumn:g,totalDataPointsAtTime:o}:{enabled:!1,totalDataPointsAtTime:o}:m&&(x={enabled:!0,columnWidthAxis:y,dataPointsPerColumn:g,totalDataPointsAtTime:o}),this.jN=x||{...this.jN,totalDataPointsAtTime:o},!!x&&this.Lg(),{cpStateChanged:!!x,cpActive:this.jN.enabled}}zW(t,e){var i,s,r;const n=t.FT,o=t.IT,h=t.AT,a=t.fT,l=t.dT;if(this.XN||!this.jN.enabled||!n||!o||void 0===e)return;const u=n.length,c=this.jN.columnWidthAxis,d=this.dt.x.getInnerStart(),f=this.dt.x.getInnerEnd(),g=md(d,f,n,h,a,l,e,1);if(!g)return;const y=n[g.iFirstSampleDataArray];if(this.OW){if(this.OW.iFirstPackedSample0)if(this.OW.packedColumnsCount-=t,this.OW.packedColumnsCount>0){this.OW.packedDataX.splice(0,2*t),this.OW.packedDataY.splice(0,2*t),this.OW.packedDataColors&&this.OW.packedDataColors.splice(0,2*t),this.OW.packedDataLookupValues&&this.OW.packedDataLookupValues.splice(0,2*t),this.OW.origin+=t*c;const e=pd(this.OW.origin,Math.max(h-1-u+1,0),h-1,(t=>n[yd(t,h,u)])),i=yd(e,h,u);this.OW.iFirstPackedSample=n[i]>=this.OW.origin?e:e+1}else this.OW=void 0}if(void 0!==(null===(i=this.OW)||void 0===i?void 0:i.iLastPackedSample)&&this.OW.iLastPackedSample>g.iLastSample){const t=n[g.iLastSampleDataArray],e=Math.min(Math.floor((this.OW.origin+this.OW.packedColumnsCount*c-t)/c),this.OW.packedColumnsCount);if(e>0)if(this.OW.packedColumnsCount-=e,this.OW.packedColumnsCount>0){for(let t=0;t<2*e;t+=1)this.OW.packedDataX.pop(),this.OW.packedDataY.pop(),this.OW.packedDataColors&&this.OW.packedDataColors.pop(),this.OW.packedDataLookupValues&&this.OW.packedDataLookupValues.pop();const t=pd(this.OW.origin+this.OW.packedColumnsCount*c,Math.max(h-1-u+1,0),h-1,(t=>n[yd(t,h,u)])),i=yd(t,h,u);this.OW.iLastPackedSample=n[i]<=this.OW.origin+this.OW.packedColumnsCount*c?t:t-1}else this.OW=void 0}}const m=this.OW||{origin:y,packedColumnsCount:0,packedDataX:[],packedDataY:[],packedDataColors:t.NT?[]:void 0,packedDataLookupValues:t.OT?[]:void 0,packedDataSize:t.GT?[]:void 0,packedDataRotation:t.WT?[]: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=[];do{let t=Le,i=Le,d=-1,f=Ie,y=Ie,p=-1,A=0;for(;a<=g.iLastSample&&a>=g.iFirstSample;){const g=a%u,x=n[g],S=o[g];if(s<=x&&x<=r)A+=1,Number.isNaN(S)||(S>i&&(t=x,i=S,d=a),S0)t=t===Le?Number.NaN:t,i=i===Le?Number.NaN:i,f=f===Ie?Number.NaN:f,y=y===Ie?Number.NaN:y,d0?(m.packedDataX.push(t),m.packedDataY.push(i),m.packedDataX.push(f),m.packedDataY.push(y)):(m.packedDataX.unshift(f),m.packedDataY.unshift(y),m.packedDataX.unshift(t),m.packedDataY.unshift(i))):(l.push({iFirst:p,iSecond:d}),e>0?(m.packedDataX.push(f),m.packedDataY.push(y),m.packedDataX.push(t),m.packedDataY.push(i)):(m.packedDataX.unshift(t),m.packedDataY.unshift(i),m.packedDataX.unshift(f),m.packedDataY.unshift(y)));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=yd(t,h,u),a=n[i],d=o[i],f=(s+r)/2,g=f-e*c/6,y=d+(g-a)/(x-a)*(S-d),p=f+e*c/6,A=d+(p-a)/(x-a)*(S-d);l.push({iFirst:t,iSecond:t}),e>0?(m.packedDataX.push(g),m.packedDataY.push(y),m.packedDataX.push(p),m.packedDataY.push(A)):(m.packedDataX.unshift(g),m.packedDataY.unshift(y),m.packedDataX.unshift(p),m.packedDataY.unshift(A))}}m.packedColumnsCount+=1,e>0?m.iLastPackedSample=a-1:(m.iFirstPackedSample=a+1,m.origin=s),s+=e*c,r+=e*c,A=0,t=Le,i=Le,d=-1,f=Ie,y=Ie,p=-1}}s+=e*c,r+=e*c}while(s>=d&&r<=f);return l},A=p(m.origin+m.packedColumnsCount*c,1,void 0!==(null===(s=this.OW)||void 0===s?void 0:s.iLastPackedSample)?this.OW.iLastPackedSample+1:g.iFirstSample),x=p(m.origin,-1,void 0!==(null===(r=this.OW)||void 0===r?void 0:r.iFirstPackedSample)?this.OW.iFirstPackedSample-1:g.iFirstSample),S=t.NT&&m.packedDataColors?[t.NT,m.packedDataColors]:void 0,b=t.OT&&m.packedDataLookupValues?[t.OT,m.packedDataLookupValues]:void 0,v=t.GT&&m.packedDataSize?[t.GT,m.packedDataSize]:void 0,M=t.WT&&m.packedDataRotation?[t.WT,m.packedDataRotation]:void 0;if(S||b||v||M){for(const t of A){const e=yd(t.iFirst,h,u),i=yd(t.iSecond,h,u);S&&S[1].push(S[0][e],S[0][i]),b&&b[1].push(b[0][e],b[0][i]),v&&v[1].push(v[0][e],v[0][i]),M&&M[1].push(M[0][e],M[0][i])}for(const t of x){const e=yd(t.iFirst,h,u),i=yd(t.iSecond,h,u);S&&S[1].unshift(S[0][i],S[0][e]),b&&b[1].unshift(b[0][i],b[0][e]),v&&v[1].unshift(v[0][i],v[0][e]),M&&M[1].unshift(M[0][i],M[0][e])}}return this.OW=m.packedColumnsCount>0?m:void 0,{x:m.packedDataX,y:m.packedDataY,color:m.packedDataColors,lookup:m.packedDataLookupValues,size:m.packedDataSize,rotation:m.packedDataRotation}}Lg(){this.OW=void 0}sG(t){if(this.UN&&"linear"===this.QN.type){const e="x"===this.UN?this.QN.scale.x.tA:this.QN.scale.y.tA;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Je===Rs.progressive||e.Je===Rs.regressive){const e=Math.abs("x"===this.UN?this.QN.scale.x.getInnerInterval():this.QN.scale.y.getInnerInterval());if(this.jN.enabled)return 2*e/this.jN.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.UN?s.x:s.y,"x"===this.UN?r.x:r.y,i)}}}eG(t,e,i){if(!this.UN)return e;const s=i.length;let r=Br(i,t.min,this.UN,this.YN,0,s-1);void 0===r&&(r=this.YN?s-1:0);let n=Br(i,t.max,this.UN,this.YN,0,s-1);return void 0===n&&(n=this.YN?0:s-1),1+Math.abs(n-r)}hG(){}}class Cm extends Em{constructor(t,e,i,s,r,n){super(t,e,i,s),this.dR=new Fy,this.xG=new km(this.dt,this),this.mO=yg({lineStyleSolid:()=>Ji(this.Cu)&&this.Cu,lineStyleDashed:()=>Zn(this.Cu)&&this.Cu,strokeFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},strokeFillLinearGradient:()=>{const t=this.Cu.getFillStyle();return it(t)&&t},strokeFillRadialGradient:()=>{const t=this.Cu.getFillStyle();return Q(t)&&t},strokeFillIndividual:()=>{const t=this.Cu.getFillStyle();return W(t)&&t},strokeFillPaletted:()=>{const t=this.Cu.getFillStyle();return H(t)&&t},areaFillSolid:()=>G(this.kW)&&this.kW,areaFillLinearGradient:()=>it(this.kW)&&this.kW,areaFillRadialGradient:()=>Q(this.kW)&&this.kW,areaFillIndividual:()=>W(this.kW)&&this.kW,areaFillPaletted:()=>H(this.kW)&&this.kW,markerFillSolid:()=>G(this.TW)&&this.TW,markerFillLinearGradient:()=>it(this.TW)&&this.TW,markerFillRadialGradient:()=>Q(this.TW)&&this.TW,markerFillPaletted:()=>H(this.TW)&&this.TW,markerFillIndividual:()=>W(this.TW)&&this.TW}),this.sF=p(void 0),this.NW=[],this.fl=!1,this.GW=[],this.WW=void 0,this.lO=e,this.MN={type:"none"},this.zL=t.uO(),this.aO=t,this.xN=this.zL.rz,this.yO=r,this.SO=n}eF(t){return this.sF.M(De(t,this.sF._(),(()=>[t.jT(((e,i)=>{this.NW.push({min:e,max:i}),void 0===t.YT()&&this.UW&&this.GW.push({min:e,max:i})})),t.ZT((()=>{this.fl=!0,this.UW=void 0,this.WW=void 0,this.xG.Lg()}))]))),this.WW=void 0,this}Ds(){var t,i,s,r,n,o,h,a,l,c,d;const f=null===(t=this.sF._())||void 0===t?void 0:t.Wt,g=this.sF.o,y=null==f?void 0:f.FT,m=null==f?void 0:f.IT;if(!f||!y||!m)return this;const p=f.OT,A=f.NT,x=f.GT,S=f.WT,b=f.AT,v=f.fT,M=f.dT,T=this.Cu,w=this.kW,E=g||this.va()||this.BW()||this.RW(),k=this.mO.lineStyleSolid(E),C=this.mO.lineStyleDashed(E),D=k||C,F=D&&D.getThickness(),I=this.mO.strokeFillSolid(E),L=this.mO.strokeFillLinearGradient(E),z=this.mO.strokeFillRadialGradient(E),V=this.mO.strokeFillIndividual(E),P=this.mO.strokeFillPaletted(E),R=I||L||z||V||P,B=this.mO.areaFillSolid(E),_=this.mO.areaFillLinearGradient(E),O=this.mO.areaFillRadialGradient(E),N=this.mO.areaFillIndividual(E),U=this.mO.areaFillPaletted(E),G=B||_||O||N||U,W=this.mO.markerFillSolid(E),Y=this.mO.markerFillLinearGradient(E),H=this.mO.markerFillRadialGradient(E),X=this.mO.markerFillPaletted(E),$=this.mO.markerFillIndividual(E),j=W||Y||H||X||$,q=this.FW._(),J=this.IW._(),Z=this.IW.o,K=this.DW.o,Q=this.NW.length>0||K,tt=this.fl,et=tt?[f.HT()]:(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.NW),it=this.dt.x.Yt,st=this.dt.x.getInnerStart(),rt=this.dt.x.getInnerEnd(),nt=f.YT(),ot=!!C,ht=this.jo._(),at=this.jo.o,{cpStateChanged:lt,cpActive:ut}=this.xG.VW(f,this.iF);if(nt&&ut&&(lt||tt||Q||it||E)){const t=this.xG.zW(f,nt);if(t){const e=!lt&&!tt&&!E;this.YW=Dm(this.zL,[t.x,t.y],t.color,t.lookup,t.size,t.rotation,ot,this.YW,e,nt,1e3,this.dt._i(),(t=>jt(t,this.dt._i()))),this.HW={min:Ie,max:Le};const s=t.y.length;for(let e=0;ethis.XW.iLastSample||E){let i,s,n,o,h,a;if(1===t.dataRanges.length){const e=t.dataRanges[0];i=y.subarray(e.offset,e.offset+e.count),s=m.subarray(e.offset,e.offset+e.count),n=A?A.subarray(e.offset,e.offset+e.count):void 0,o=p?p.subarray(e.offset,e.offset+e.count):void 0,h=x?x.subarray(e.offset,e.offset+e.count):void 0,a=S?S.subarray(e.offset,e.offset+e.count):void 0}else{const e=t.dataRanges[0],r=t.dataRanges[1],l=e.count+r.count;i=new Float32Array(l),i.set(y.subarray(e.offset),0),i.set(y.subarray(r.offset,r.offset+r.count),e.count),s=new Float32Array(l),s.set(m.subarray(e.offset),0),s.set(m.subarray(r.offset,r.offset+r.count),e.count),A&&(n=new Uint32Array(l),n.set(A.subarray(e.offset),0),n.set(A.subarray(r.offset,r.offset+r.count),e.count)),p&&(o=new Float32Array(l),o.set(p.subarray(e.offset),0),o.set(p.subarray(r.offset,r.offset+r.count),e.count)),x&&(h=new Float32Array(l),h.set(x.subarray(e.offset),0),h.set(x.subarray(r.offset,r.offset+r.count),e.count)),S&&(a=new Float32Array(l),a.set(S.subarray(e.offset),0),a.set(S.subarray(r.offset,r.offset+r.count),e.count))}const l=!lt&&!tt&&!E;this.jW=Dm(this.zL,[i,s],n,o,h,a,ot,this.jW,l,nt,1e3,this.dt._i(),(t=>jt(t,this.dt._i())));let c=i,d=s,f=n,g=o;const b=this.DW._();if(b){const t="spline"===b.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=ti(ni({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]=ri(si(n,c),g[1]),g[2]=ni(g[2],si(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;njt(t,this.dt._i()))),this.XW=t}}if(!nt&&(tt||Q||E)){if(!this.YW||this.YW.bufferSize{var s,r,n,o;const h=y.subarray(i.min,i.max+1),a=m.subarray(i.min,i.max+1);if(this.zL.OV(t,i.min*(this.dt._i()?2:1),jt(h,this.dt._i())),this.zL.OV(e,i.min*(this.dt._i()?2:1),jt(a,this.dt._i())),A&&(null===(s=this.YW)||void 0===s?void 0:s.bufferColors)){const t=A.subarray(i.min,i.max+1);this.zL.OV(this.YW.bufferColors,i.min,t,Uint32Array)}if(p&&(null===(r=this.YW)||void 0===r?void 0:r.bufferLookupValues)){const t=p.subarray(i.min,i.max+1);this.zL.OV(this.YW.bufferLookupValues,i.min,t,Float32Array)}if(S&&(null===(n=this.YW)||void 0===n?void 0:n.bufferRotations)){const t=S.subarray(i.min,i.max+1);this.zL.OV(this.YW.bufferRotations,i.min,t,Float32Array)}if(x&&(null===(o=this.YW)||void 0===o?void 0:o.bufferSizes)){const t=x.subarray(i.min,i.max+1);this.zL.OV(this.YW.bufferSizes,i.min,t,Float32Array)}})),this.YW.valueCount=f.fT}this.jW=this.YW}if(this.dR.yV(this.dt),E||Z||at){if(R&&D&&!1!==F){const t=-1===F?"primitive":"triangulated",e=P?["lookup",P.lookUpProperty,P.lut]:V?"attribute":L?["gradient",L]:z?["gradient",z]:"uniform";this.MN="primitive"===t?{type:t,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),C&&Wg.StippleTexture),lineStyleSolid:k,lineStyleDashed:C,fillStyleSolid:I,fillStyleLinearGradient:L,fillStyleRadialGradient:z,fillStyleIndividual:V,fillStylePaletted:P,mousePickingShader:ht&&this.zL.cE(Wg["2D"],Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),C&&Wg.StippleTexture,Wg.MousePicking)}:"triangulated"===t?{type:t,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),this.xN?Wg.AliasedEdge:void 0,C&&Wg.StippleTextureInstanced),geometry:Xy(this.zL,F),thickness:F,lineStyleSolid:k,lineStyleDashed:C,fillStyleSolid:I,fillStyleLinearGradient:L,fillStyleRadialGradient:z,fillStyleIndividual:V,fillStylePaletted:P,mousePickingShader:ht&&this.zL.cE(Wg["2D"],Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),C&&Wg.StippleTextureInstanced,Wg.MousePicking)}:{type:"none"}}else this.MN={type:"none"};if(this.ZW=G?{shader:this.zL.cE(Wg["2D"],U&&Wg.Color({dataType:["lookup",U.lookUpProperty,U.lut]}),N&&Wg.Color({dataType:"attribute"}),B&&Wg.Color({dataType:"uniform"}),_&&Wg.Color({dataType:["gradient",_]}),O&&Wg.Color({dataType:["gradient",O]}),Wg.Area2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0})),geometry:wm(this.zL),fillStyleSolid:B,fillStyleLinearGradient:_,fillStyleRadialGradient:O,fillStyleIndividual:N,fillStylePaletted:U,mousePickingShader:ht&&this.zL.cE(Wg["2D"],Wg.Area2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),Wg.MousePicking)}:void 0,j){const t=x?"attribute":"uniform",e=J<=1&&Wg.PointSize("uniform"),i=Wg.VertexLocation({offset:J>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:{dataType:S?"attribute-deg":"uniform"}}:void 0,axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0});this.QW={shader:this.zL.cE(Wg["2D"],e,i,W&&Wg.Color({dataType:"uniform",overrideOpacity:!0}),Y&&Wg.Color({dataType:["gradient",Y],overrideOpacity:!0}),H&&Wg.Color({dataType:["gradient",H],overrideOpacity:!0}),X&&Wg.Color({dataType:["lookup",X.getLookUpProperty(),X.getPalette()],overrideOpacity:!0}),$&&Wg.Color({dataType:"attribute",overrideOpacity:!0})),geometry:hm(q,this.zL,J),fillStyleSolid:W,fillStyleLinearGradient:Y,fillStyleRadialGradient:H,fillStylePaletted:X,fillStyleIndividual:$,mousePickingShader:ht&&this.zL.cE(Wg["2D"],e,i,Wg.MousePicking)}}else this.QW=void 0}const ct={min:{x:this.vt(),y:this.dt.y.getInnerStart()},max:{x:this.xt(),y:this.Mt()}};if(this.JW=this.zL.Wz(L,this,ct),this.KW=this.zL.Uz(z,this,ct),this.qW=this.zL.Wz(_,this,ct),this.tU=this.zL.Uz(O,this,ct),this.iU=this.zL.Wz(Y,this,ct),this.sU=this.zL.Uz(H,this,ct),(void 0===this.WW||Q)&&p&&(pg(P)||pg(U)||pg(X))){const t=this.WW?et:[f.HT()];let e=this.WW?this.WW.max:Le,i=this.WW?this.WW.min:Ie;const s=p;t.forEach((t=>{for(let r=t.min;r<=t.max;r+=1){const t=s[r];i=te?t:e}})),this.WW={min:i,max:e}}return this.wN=C?this.zL.Dz(C.getPattern()):void 0,this.Iu(T),this.LW=w,this.EW=this.TW,this.IW.o=!1,this.NW.length=0,this.fl=!1,this.DW.o=!1,this.sF.o=!1,this.jo.o=!1,this}yL(t){var e,i,s,r,n,o,h,a,l,u,c,d,f,g,y,m,p;const A=this.zL.gl,x=null===(e=this.YW)||void 0===e?void 0:e.bufferX,S=null===(i=this.YW)||void 0===i?void 0:i.bufferY,b=null===(s=this.YW)||void 0===s?void 0:s.bufferColors,v=null===(r=this.YW)||void 0===r?void 0:r.bufferLookupValues,M=null===(n=this.YW)||void 0===n?void 0:n.valueCount,T=null===(o=this.jW)||void 0===o?void 0:o.valueCount,w=null===(h=this.sF._())||void 0===h?void 0:h.Wt,E=null==w?void 0:w.YT();if(!x||!S||!w)return this;const k=(e,i,s)=>{if(Im(this.zL,e,this.dt._i(),x,"aLocation","X",1,!1,A.FLOAT,Float32Array.BYTES_PER_ELEMENT),Im(this.zL,e,this.dt._i(),S,"aLocation","Y",1,!1,A.FLOAT,Float32Array.BYTES_PER_ELEMENT),i&&1!==t){if(!b)return!1;Im(this.zL,e,!1,b,"aColor","",4,!0,A.UNSIGNED_BYTE,1)}if(s&&"value"===s.lookUpProperty&&1!==t){if(!v)return!1;Im(this.zL,e,!1,v,"aLookupValue","",1,!1,A.FLOAT,Float32Array.BYTES_PER_ELEMENT)}return!0},C=1===t?null===(a=this.ZW)||void 0===a?void 0:a.mousePickingShader:null===(l=this.ZW)||void 0===l?void 0:l.shader;if(this.ZW&&C&&void 0!==M&&M>0&&E){const e=this.ZW;this.zL.JL(C).lV(C,((i,s,r,n)=>!!this.zL.Oz(r,t,this,{uniforms:this.dR,mousePickingColor:this.SO,fillStyleSolid:e.fillStyleSolid,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,fillStylePaletted:e.fillStylePaletted,linearGradientInfo:this.qW,radialGradientInfo:this.tU,lookupValueRange:e.fillStylePaletted?mg(e.fillStylePaletted,this,this.WW):void 0,lookupValueBuffer:null})&&!!k(r,e.fillStyleIndividual,e.fillStylePaletted)&&(null==e||e.geometry.JL(r).Pp(M-1),!0)))}const D="none"===this.MN.type?void 0:1===t?this.MN.mousePickingShader:this.MN.shader;if("none"!==this.MN.type&&D&&void 0!==M&&M>0){const e=this.MN;this.zL.JL(D).lV(D,((i,s,r,n)=>{var o,h;if(!this.zL.Oz(r,t,this,{uniforms:this.dR,mousePickingColor:this.SO,fillStyleSolid:e.fillStyleSolid,fillStylePaletted:e.fillStylePaletted,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,fillStyleIndividual:e.fillStyleIndividual,linearGradientInfo:this.JW,radialGradientInfo:this.KW,lookupValueRange:e.fillStylePaletted?mg(e.fillStylePaletted,this,this.WW):void 0,lookupValueBuffer:"primitive"===e.type?v:null,colorBuffer:"primitive"===e.type?b:null,coordsX:"primitive"===e.type?x:void 0,coordsY:"primitive"===e.type?S:void 0,coordsHighPrecision:this.dt._i()}))return!1;if(e.lineStyleDashed){if(!this.wN)return!1;this.zL.cV(i("uStippleCount"),[this.us.oi().x/this.wN.Rz,this.us.oi().y/this.wN.Rz]).fV(n("uStippleTextureWidthLimiter"),this.wN.Lz/this.wN.Rz).fV(i("uStippleScale"),e.lineStyleDashed.getPatternScale()).dV(i("uStippleTexture"),this.wN.Bz,1)}if("primitive"===e.type){if(e.lineStyleDashed){if(!(null===(o=this.YW)||void 0===o?void 0:o.bufferLengthSoFar))return!1;this.zL.UV(s("aLengthSoFar"),this.YW.bufferLengthSoFar)}jy.SN(this.aO,M)}else{if(!k(r,e.fillStyleIndividual,e.fillStylePaletted))return!1;if(e.lineStyleDashed){if(!(null===(h=this.YW)||void 0===h?void 0:h.bufferLengthSoFar))return!1;Im(this.zL,r,!1,this.YW.bufferLengthSoFar,"aLengthSoFar","",2,!1,A.FLOAT,Float32Array.BYTES_PER_ELEMENT)}$y.yL(this.aO,e.geometry,r,this.xN&&1!==t,1===t,e.thickness,M-1)}return!0}))}const F=null===(u=this.jW)||void 0===u?void 0:u.bufferX,I=null===(c=this.jW)||void 0===c?void 0:c.bufferY,L=null===(d=this.jW)||void 0===d?void 0:d.bufferColors,z=null===(f=this.jW)||void 0===f?void 0:f.bufferLookupValues,V=null===(g=this.jW)||void 0===g?void 0:g.bufferSizes,P=null===(y=this.jW)||void 0===y?void 0:y.bufferRotations,R=1===t?null===(m=this.QW)||void 0===m?void 0:m.mousePickingShader:null===(p=this.QW)||void 0===p?void 0:p.shader,B=this.QW;let _=1;if(E){const t=this.sF?Math.abs((this.xt()-this.vt())/w.getSampleCount()):0,e=this.dt.x.getInnerInterval()/t,i=this.IW._(),s=this.dt.x.ri()/i/1,r=2*s;_=e<=s?1:Math.max(1-(e-s)/(r-s),0)}if(R&&B&&F&&I&&_>0&&void 0!==T&&T>0){const e=B,i=e.geometry.LG(this.IW._())?1:0;this.zL.JL(R).lV(R,((s,r,n,o)=>{if(!this.zL.Oz(n,t,this,{uniforms:this.dR,mousePickingColor:this.SO,fillStyleSolid:e.fillStyleSolid,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,linearGradientInfo:this.iU,radialGradientInfo:this.sU,fillStylePaletted:e.fillStylePaletted,fillStyleIndividual:e.fillStyleIndividual,lookupValueRange:e.fillStylePaletted?mg(e.fillStylePaletted,this,this.WW):void 0,lookupValueBuffer:z,lookupValueAttribDivisor:i,colorBuffer:L,colorAttribDivisor:i}))return!1;if(this.dt._i()?this.zL.uV(F,i,{location:r("aPos_highpartX"),size:1},{location:r("aPos_lowpartX"),size:1}).uV(I,i,{location:r("aPos_highpartY"),size:1},{location:r("aPos_lowpartY"),size:1}):this.zL.jV(r("aPosX"),F,i).jV(r("aPosY"),I,i),1!==t&&this.zL.fV(s("uOpacity"),_),this.IW._()>1)if(P)this.zL.jV(r("aRotDeg"),P,i).fV(s("uBaseRotDeg"),e.geometry.BG);else{const t=di(this.PW._()+e.geometry.BG),i=Math.sin(t),r=Math.cos(t);this.zL.cV(s("uRot"),[i,r])}return e.geometry.Pp(n,V,this.IW._(),T),!0}))}return this}dO(t){return this.yO===t&&{}}dispose(){var t,e,i,s,r,n,o,h,a;return super.dispose(),this.zL.SV(null===(t=this.YW)||void 0===t?void 0:t.bufferX),this.zL.SV(null===(e=this.YW)||void 0===e?void 0:e.bufferY),this.zL.SV(null===(i=this.YW)||void 0===i?void 0:i.bufferColors),this.zL.SV(null===(s=this.YW)||void 0===s?void 0:s.bufferLookupValues),this.zL.SV(null===(r=this.jW)||void 0===r?void 0:r.bufferX),this.zL.SV(null===(n=this.jW)||void 0===n?void 0:n.bufferY),this.zL.SV(null===(o=this.jW)||void 0===o?void 0:o.bufferColors),this.zL.SV(null===(h=this.jW)||void 0===h?void 0:h.bufferLookupValues),this.MN={type:"none"},this.ZW=void 0,this.QW=void 0,this.xG.Lg(),null===(a=this.sF._())||void 0===a||a.Gt(),this.YW=void 0,this.jW=void 0,this.JW=void 0,this.KW=void 0,this.qW=void 0,this.tU=void 0,this.iU=void 0,this.sU=void 0,this}GL(){return this.dispose(),this}eU(t){if(!this.UW){const{xValues:e,yValues:i}=t.readBack();this.UW={min:{x:Ie,y:Ie},max:{x:Le,y:Le}};const s=e.length;for(let t=0;tthis.UW.max.x?s:this.UW.max.x,this.UW.max.y=r>this.UW.max.y?r:this.UW.max.y}return this.GW.length=0,this.UW}const e=t.FT,i=t.IT;if(this.GW.length>0&&e&&i){for(const t of this.GW){for(let s=t.min;s<=t.max;s+=1){const t=e[s],r=i[s];this.UW.min.x=tthis.UW.max.x?t:this.UW.max.x,this.UW.max.y=r>this.UW.max.y?r:this.UW.max.y}this.GW.length=0}return this.UW}return this.UW}xt(){var t,e,i,s,r;const n=null===(t=this.sF._())||void 0===t?void 0:t.Wt;if(!n)return 0;const o=n.YT();return"ProgressiveX"===o?(null===(e=n.TT())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.XT())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.HW)||void 0===s?void 0:s.max)||0:"RegressiveY"===o?(null===(r=this.HW)||void 0===r?void 0:r.max)||0:this.eU(n).max.x}vt(){var t,e,i,s,r;const n=null===(t=this.sF._())||void 0===t?void 0:t.Wt;if(!n)return 0;const o=n.YT();return"ProgressiveX"===o?(null===(e=n.XT())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.TT())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.HW)||void 0===s?void 0:s.min)||0:"RegressiveY"===o?(null===(r=this.HW)||void 0===r?void 0:r.min)||0:this.eU(n).min.x}Mt(){var t,e,i,s,r;const n=null===(t=this.sF._())||void 0===t?void 0:t.Wt;if(!n)return 0;const o=n.YT();return"ProgressiveX"===o?Dt(null===(e=this.HW)||void 0===e?void 0:e.max,0):"RegressiveX"===o?Dt(null===(i=this.HW)||void 0===i?void 0:i.max,0):"ProgressiveY"===o?Dt(null===(s=n.TT())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Dt(null===(r=n.XT())||void 0===r?void 0:r.y,0):this.eU(n).max.y}bt(){var t,e,i,s,r;const n=null===(t=this.sF._())||void 0===t?void 0:t.Wt;if(!n)return 0;const o=n.YT();return"ProgressiveX"===o?Dt(null===(e=this.HW)||void 0===e?void 0:e.min,0):"RegressiveX"===o?Dt(null===(i=this.HW)||void 0===i?void 0:i.min,0):"ProgressiveY"===o?Dt(null===(s=n.XT())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Dt(null===(r=n.TT())||void 0===r?void 0:r.y,0):this.eU(n).min.y}Vl(){var t;const e=Math.max(Me(this.Cu),this.IW._()),i=null===(t=this.sF._())||void 0===t?void 0:t.Wt.YT();return!i||"ProgressiveX"!==i&&"RegressiveX"!==i?e:0}zl(){var t;const e=Math.max(Me(this.Cu),this.IW._()),i=null===(t=this.sF._())||void 0===t?void 0:t.Wt.YT();return!i||"ProgressiveY"!==i&&"RegressiveY"!==i?e:0}}const Dm=(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],A=g[0],x=g[y-1],S=c?2:1;if(h&&a&&h.firstX&&h.lastX&&m>=h.firstX){const e=pd(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=Sd(f,l,void 0),a=Sd(g,l,void 0);if(t.OV(h.bufferX,h.valueCount*S,d(e)),t.OV(h.bufferY,h.valueCount*S,d(a)),i&&h.bufferColors){const e=i.slice(l);t.OV(h.bufferColors,h.valueCount,e,Uint32Array)}if(s&&h.bufferLookupValues){const e=s.slice(l);t.OV(h.bufferLookupValues,h.valueCount,e,Float32Array)}if(r&&h.bufferSizes){const e=r.slice(l);t.OV(h.bufferSizes,h.valueCount,e,Float32Array)}if(n&&h.bufferRotations){const e=n.slice(l);t.OV(h.bufferRotations,h.valueCount,e,Float32Array)}if(o&&h.bufferLengthSoFar){const[i,s,r]=Fm(e,a,h.lastX||0,h.lastY||0,h.lengthSoFarX,h.lengthSoFarY);t.OV(h.bufferLengthSoFar,2*h.valueCount,i,Float32Array),h.lengthSoFarX=s,h.lengthSoFarY=r}return h.valueCount+=u,h.lastX=p,h.lastY=x,h}}}const b=y+u,v=t.zV(b*S,d(f),null==h?void 0:h.bufferX),M=t.zV(b*S,d(g),null==h?void 0:h.bufferY),T=i?t.zV(b,i,null==h?void 0:h.bufferColors,Uint32Array):void 0,w=s?t.zV(b,s,null==h?void 0:h.bufferLookupValues,Float32Array):void 0,E=r?t.zV(b,r,null==h?void 0:h.bufferSizes,Float32Array):void 0,k=n?t.zV(b,n,null==h?void 0:h.bufferRotations,Float32Array):void 0;let C,D=0,F=0;if(o){const e=Fm(f,g,f[0],g[0],0,0);C=t.zV(2*b,e[0],null==h?void 0:h.bufferLengthSoFar,Float32Array),D=e[1],F=e[2]}return{bufferX:v,bufferY:M,bufferColors:T,bufferLookupValues:w,bufferSizes:E,bufferRotations:k,bufferSize:b,bufferLengthSoFar:C,valueCount:y,firstX:m,lastX:p,firstY:A,lastY:x,lengthSoFarX:D,lengthSoFarY:F}},Fm=(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.HV(i,1),t.HV(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.HV(d,1),t.HV(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.HV(i,1),t.HV(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],A=e[7],x=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+A*n+x*a,p*s+A*o+x*l,p*r+A*h+x*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class zm extends Zr{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.hU=[],this.dR=new Fy,this.rU=[u(0,0),u(0,0),u(0,0),u(0,0)],this.nU=y(u(0,0),u(0,0)),this.oU=y(u(0,0),u(0,0)),this.aU=u(0,0),this.lU=u(0,0),this.iM=u(0,0),this.uU=u(0,0),this.cU=0,this.mO=yg({fillStyleSolid:()=>G(this.be)&&this.be,fillStyleRadialGradient:()=>Q(this.be)&&this.be,fillStyleLinearGradient:()=>it(this.be)&&this.be}),this.aO=t,this.lO=e,this.yO=n,this.SO=o,this.zL=t.uO(),this.lO=e,this.DN=t.En.uo}Ds(){const t=this.ya(),e=this.ma(),i=this.jo._();if(t){const t=this.ga(),s=this.mO.fillStyleSolid(t),r=this.mO.fillStyleRadialGradient(t),n=this.mO.fillStyleLinearGradient(t),o=s||r||n,h=this.zL,a=this.zL.sR();if(this.dR.yV(this.dt),this.Ia.o){this.dU&&this.dU.KL(this),this.font.M(yr(this.Ia._()));const t=this.font._();this.dU=this.zL.Eh(t.properties.family),this.dU.JL(this)}const l=this.font.o,c=l||this._a.o;if(c&&this.dU){const t=this.font._();[this.fU,this.oU]=this.dU.tR(this._a._(),t.properties,this.aO.qi.isDark),this.hU.forEach((t=>{t.texCoordBuff&&h.SV(t.texCoordBuff),t.vertexBuff&&h.SV(t.vertexBuff)})),this.hU=this.fU.map((t=>({texCoordBuff:h.oV(t.texCoords,!1),texture:t.texture,info:t}))),this.Ia.o=!1,this.font.o=!1,this._a.o=!1}const d=this.dt.Ni()||e,f=this.wa.o||this.ka.o||this.Ca.o||this.Ta.o||this.Da.o||this.Xt.o||c||d,g=this.Da._(),y=si(u(this.ka._()+1,this.Ca._()+1),.5);if(f&&this.fU&&(this.aU=u(-(g.left*a+this.oU.max.x-this.oU.min.x+g.right*a)*y.x-this.oU.min.x+g.right*a,-(g.bottom*a+this.oU.max.y-this.oU.min.y+g.top*a)*y.y-this.oU.min.y+g.top*a)),(f||d||this.Fa.o||this.ga())&&this.be!==B){if(this.fU){const t=ri(this.wa._(),this.Ta._()),e=ut(t,this.dt,this.us.dt),i=si(e,a);this.uU=i;const s=di(this.Fa._());this.cU=s,c&&this.hU.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.Xt._(),n=[ri(Ke(u((this.oU.min.x+(-r.left-g.left)*a+this.aU.x)/a,(this.oU.max.y+(r.top+g.top)*a+this.aU.y)/a),this.Pa,s),e),ri(Ke(u((this.oU.max.x+(r.right+g.right)*a+this.aU.x)/a,(this.oU.max.y+(r.top+g.top)*a+this.aU.y)/a),this.Pa,s),e),ri(Ke(u((this.oU.max.x+(r.right+g.right)*a+this.aU.x)/a,(this.oU.min.y+(-r.bottom-g.bottom)*a+this.aU.y)/a),this.Pa,s),e),ri(Ke(u((this.oU.min.x+(-r.left-g.left)*a+this.aU.x)/a,(this.oU.min.y+(-r.bottom-g.bottom)*a+this.aU.y)/a),this.Pa,s),e)];this.rU=[ut(n[0],this.us.dt,this.dt),ut(n[1],this.us.dt,this.dt),ut(n[2],this.us.dt,this.dt),ut(n[3],this.us.dt,this.dt)];const o=$e(n);this.lU=u(-(o.max.x-o.min.x)*a*y.x-o.min.x*a+this.uU.x,-(o.max.y-o.min.y)*a*y.y-o.min.y*a+this.uU.y),this.CB=ni(o.max,o.min);const l=$e(this.rU),d=this.dt.pi(l.min,this.lU),f=this.dt.pi(l.max,this.lU);this.nU=$e([d,f])}r?this.CO=xy(this.nU,this.dt,r.getPosition(),r.getExtent(),r.getShape(),this.zL.sR()):n?this.kO=Sy(this.nU,this.dt,n.getAngle(!0),this.zL.sR()):(this.CO=void 0,this.kO=void 0)}(this.ga()||l)&&(this.gR=o?this.zL.cE(Wg["2D"],Wg.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.DN}),Wg.Color({dataType:r?["gradient",r]:n?["gradient",n]:"uniform",maskTexture:!0})):void 0),this.AU=i&&o?this.AU||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.DN})):void 0,this.wa.o=!1,this.ka.o=!1,this.Ca.o=!1,this.Ta.o=!1,this.Fa.o=!1,this.Sa(this.be)}return this.Ba=t,this}yL(t){if(this.ya()){const e=1===t?this.AU:this.gR;if(!e||0===this.hU.length)return this;const i=this.mO.fillStyleSolid(!1),s=this.mO.fillStyleRadialGradient(!1),r=this.mO.fillStyleLinearGradient(!1),n=this.us.UR(),o=n.x,h=n.y;let a=Lm.projection(o,h,-1);const l=Lm.translation(this.aU.x,this.aU.y),u=Lm.translation(this.lU.x,this.lU.y);a=Lm.translate(a,this.uU.x,this.uU.y),a=Lm.multiply(a,u),a=Lm.rotate(a,this.cU),a=Lm.multiply(a,l),1===t&&(a=Lm.scale(a,this.oU.max.x,this.oU.max.y)),this.zL.JL(e).lV(e,((e,o,h,l)=>{if(this.zL.BV(e("uMatrix"),a).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),this.DN&&this.zL.cV(l("uViewportSizePx"),[n.x*this.zL.sR(),n.y*this.zL.sR()]),1===t)this.zL.AV(e("uColor"),this.SO);else if(i)this.zL.AV(e("uColor"),i.getColor());else if(s&&this.CO){this.zL.cV(e("uCenter"),this.CO.center).cV(e("uDistance"),this.CO.distance).PV(e("uBounds"),this.CO.bounds).fV(e("uAspect"),this.CO.aspectRatio);const t=s.getColorStops();for(let i=0;i{this.zL.UV(o("aPos"),t.vertexBuff).UV(o("aMaskTextureCoord"),t.texCoordBuff).dV(e("uMaskTexture"),t.texture,0).Pp(this.zL.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return this}dO(t){return this.yO===t&&{}}Ue(){return this.ya()?this.rU:[]}Cc(){return this.ya()&&this.CB?this.CB:u(0,0)}oi(){if(this.ya()&&this.nU){const t=this.nU;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}GL(){return this.hU.forEach((t=>{t.texCoordBuff&&this.zL.SV(t.texCoordBuff),t.vertexBuff&&this.zL.SV(t.vertexBuff)})),this.hU=[],this.dU&&this.dU.KL(this),this}xt(){return this.nU.max.x}vt(){return this.nU.min.x}Mt(){return this.nU.max.y}bt(){return this.nU.min.y}Vl(){return 0}zl(){return 0}}class Vm{constructor(t,e,i){this.gU=new Set,this.pU=t=>(this.gU.add(t),t),this.mU=t=>(this.gU.delete(t),t.GL(),this),this.us=t,this.ua=e,this.yU=i}mL(t){this.gU.delete(t)&&this.gU.add(t)}W(){for(const t of this.gU)t.GL().dispose();this.us.pn(this.ua)}bs(){return this.us.bs(),this}gn(){return this.ua}}class Pm extends Vm{constructor(){super(...arguments),this.SU=p(void 0),this.ca=!1}ES(t){return this.SU.M(t),this}lg(){return this.SU._()}}class Rm extends Pm{constructor(t,e,i){super(t,e,i),this.aO=t,this.gl=t.uO(),this.vU=this.gU}nV(t){const e=t instanceof Wr&&t;if(!e)return ze;const i=e.vt(),s=e.xt(),r=e.bt(),n=e.Mt();if(i===Ie||s===Le||r===Ie||n===Le)return ze;const o=e.Vl(),h=e.zl(),a=Yr({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.dt),l={min:ut(a.min,e.dt,t.us.dt),max:ut(a.max,e.dt,t.us.dt)},u=this.SU._();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.aO.bU();return{id:t,color:this.aO.MU(t)}})))}zp(t,e,i){const s=this.aO.bU();return this.pU(new sm(this.aO,this,t,this.mU,i,s,this.aO.MU(s),e))}tF(t){const e=this.aO.bU();return this.pU(new Cm(this.aO,this,t,this.mU,e,this.aO.MU(e)))}kr(t){const e=this.aO.bU();return this.pU(new zm(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}Oc(t){const e=this.aO.bU();return this.pU(new am(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}vc(t,e=nn.Simple){const i=this.aO.bU();if(e===nn.Simple)return this.pU(new cm(this.aO,this,t,this.mU,[],i,this.aO.MU(i)));throw new Error("GlEngine.addPolygon | No such polygon type!")}bv(t){return this.pU(new lm(this.aO,this,t,this.mU,[],(()=>{const t=this.aO.bU();return{id:t,color:this.aO.MU(t)}})))}Te(t){const e=this.aO.bU();return this.pU(new um(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}yC(t){const e=this.aO.bU();return this.pU(new Yy(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}Fc(t){const e=this.aO.bU();return this.pU(new Ry(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}ck(t,e,i){if("intensity"===i.heatmapDataType){const s=this.aO.bU();return this.pU(new bm(this.aO,this,t,this.mU,e,s,this.aO.MU(s),i))}throw new gt("Unimplemented Heatmap Grid Static type")}ek(t,e,i){const s=this.aO.bU();return this.pU(new xm(this.aO,this,t,this.mU,e,i,s,this.aO.MU(s)))}Sx(t,e,i){const s=this.aO.bU();return this.pU(new Mm(this.aO,this,t,this.mU,e,i,s,this.aO.MU(s)))}_U(t){return this.pU(new Vy(this.aO,this,this.mU,[],t))}Ds(){if(this.ca){this.ca=!1;const t=Array.from(this.gU).sort(((t,e)=>t.fa()-e.fa()));this.gU.clear();for(const e of t)this.gU.add(e)}for(const t of this.gU)t.Ds();return this}yL(t,e){const i=this.SU._();if(i&&this.gl.rV(i.x*this.gl.sR()*e,i.y*this.gl.sR()*e,i.width*this.gl.sR()*e,i.height*this.gl.sR()*e),1!==t)for(const e of this.gU)e.getVisible()&&e.yL(t);else for(const e of this.gU)e.getMouseInteractions()&&e.getVisible()&&e.yL(t);return this.gl.tV(!1),this}}class Bm extends by{constructor(t){super(t)}}class _m extends Bm{constructor(t){super(t),this.wU="attribute";const{vertices:e,drawSize:i,drawMode:s}=Om(t.gl);this.TL=t.oV(e),this.fN=i,this.AN=s}Pp(t,e,i,s){return this.zL.uV(this.TL,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}).KV(this.AN,0,this.fN,e),this}IE(){this.zL.SV(this.TL)}}const Om=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 Nm extends Bm{constructor(t,e){super(t),this.wU="attribute",this.CU=e;const{vertices:i,indices:s}=Um();this.TL=t.oV(i),this.dN=t.GV(s),this.fN=s.length,this.AN=t.gl.TRIANGLES}Pp(t,e,i,s){return this.zL.uV(this.TL,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).ZV(this.dN).fV(t.uniform("uEdgeRoundness"),this.CU/2).qV(this.AN,this.fN,0,e),this}IE(){this.zL.SV(this.TL),this.zL.SV(this.dN)}kU(t){return this.CU=t,this}TU(){return this.CU}}const Um=()=>{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=Fe.multiply(o,-1),l=Fe.multiply(h,-1),u=i;e[i]={thicknessDirection:Fe.addVec(t,o,h),edge:Fe.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:Fe.addVec(t,a,h),edge:Fe.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:Fe.addVec(t,a,l),edge:Fe.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:Fe.addVec(t,o,l),edge:Fe.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=Fe.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=Fe.normalize(Fe.lerp(t,n.direction,o)),a=Math.PI/2-Fe.angle(h,t),l=Fe.addVec(Fe.multiply(Fe.multiply(n.direction,-1),1-Math.cos(a)),Fe.multiply(Fe.multiply(t,-1),1-Math.sin(a)),Fe.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.CV.FE.get(e);return i||(i=void 0!==e&&e>0?new Nm(t,kt(e,0,1)):new _m(t),t.CV.FE.set(e,i),i)};class Wm extends Ey{Om(t){return this.$E=this.Bm._(),this.Bm.M(t),this}lS(t){return this.FU=t,this}uS(){return this.FU}}class Ym extends Wm{constructor(t,e,i,s,r){super(t,e,i),this.IU=t,this.yO=s,this.SO=r,this.aO=t.aO,this.zL=this.aO.uO()}dO(t){return t===this.yO&&{}}}class Hm extends Ym{constructor(t,e,i,s,r){super(t,e,i,s,r),this.FU="cull-back",this.ol=Ve,this.PU={},this.DU=[],this.mO=yg({fillStyleSolid:()=>G(this.be)&&this.be,fillStyleIndividual:()=>W(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be}),this.be=Mr.fillStyle,this.Bm.M(Gn)}Ds(t){const e=this.DU,i=this.be,s=i!==B,r=this.BU,n=this.ga()||this.LU!==r,o=this.HE(),h=this.jo._(),a=this.jo.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.RU||0;let r=s;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.PU[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.PG&&i.set(this.PG),this.PG=i,this.EU=e,this.VU=s*t}const d=W(i)?i.getFallbackColor():void 0;for(const i of e){const e=i.id,s=void 0!==e&&this.PU[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=y({x:Ie,y:Ie,z:Ie},{x:Le,y:Le,z:Le});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.ol=e}this.RU=r,this.DU.length=0}return this.Sa(i),this.LU=r,this.Bm.o=!1,this.jo.o=!1,this}yL(t){const e=1===t?this.AU:this.gR,i=this.zU,s=this.cN,r=this.be,n=this.RU,o=this.Bm._();return e&&s&&void 0!==n&&this.zL.lV(e,((h,a,l)=>{let u=!1;const c=a("aPos"),d=a("aOffsetAxis");this.zL.JL(e).DV(h("uScale"),this.IU.dR.gV()).DV(h("uDisp"),this.IU.dR.pV()).LV(h("uViewProjectionMatrix"),this.NU).fV(h("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(h("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(h("uRenderEffectMask"),2===t?1:0);const f={location:c,size:3},g={location:d,size:3},y={location:void 0,size:4};if(1!==t&&"phong"===o.type&&this.zL.DV(h("uCameraLoc"),this.GU).DV(h("uLightLoc"),this.WU).fV(h("uAmbientReflection"),o.ambientReflection).fV(h("uSpecularReflection"),o.specularReflection).fV(h("uDiffuseReflection"),o.diffuseReflection).fV(h("uShininess"),o.shininess).AV(h("uLightColor"),o.specularColor).AV(h("uAmbientColor"),o.ambientColor),1===t)this.zL.AV(h("uColor"),this.SO);else if(G(r))this.zL.AV(h("uColorDiffuse"),r.getColor());else if(W(r)){const t=a("aColor");y.location=t}else if(H(r)){const t=mg(r,this,void 0);if(!t&&r.lut.percentageValues)return!1;this.zL.Ez(l,r.lut,t)}return s&&(this.zL.uV(s,1,f,g,y,{location:void 0,size:1}),i.Pp(l,n,"phong"===o.type&&1!==t,!1),u=!0),u})),this}dispose(){return super.dispose(),this.cN&&(this.zL.SV(this.cN),this.cN=void 0),this.gR=void 0,this}GL(){return this.dispose(),this}Zm(t){this.DU=se(this.DU,t,{canReturnB:!0})}ke(t){return this.be=Hr(this.be,t),this}Lh(){return this.be}Xm(t){return this.BU=void 0!==t&&t>0?kt(t,0,1):void 0,this}OU(){return this.BU}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Wm(){return this.ol.max.z}Um(){return this.ol.min.z}Vl(){return 0}zl(){return 0}Ym(){return 0}ga(){return Xr(this.pa,this.be)}Sa(t){this.pa=t}}class Xm extends by{constructor(t,e){super(t),this.wU="custom",this.lN=e;const{vertices:i,drawSize:s}=this.uN();this.cN=t.oV(i),this.fN=s}JL(t){return this.zL.uV(this.cN,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Pp(t){return this.zL.KV(this.zL.gl.TRIANGLE_STRIP,0,this.fN,t),this}uN(){const t=this.lN,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}}IE(){this.zL.SV(this.cN)}}const $m=(t,e=16)=>{let i=t.CV.kE.get(e);return i||(i=new Xm(t,e),t.CV.kE.set(e,i),i)};class jm extends Ym{constructor(t,e,i,s,r){super(t,e,i,s,r),this.FU="cull-back",this.UU=Ve,this.YU=[],this.HU=!1,this.Cu=Mr.lineStyle,this.Bm.M(Nn)}Ds(t){const e=this.HU,i=this.Cu,s=this.Tu!==i,r=this.HE(),n=e;if(e){const t=Jt(this.YU);this.$U=this.zL.oV(t,!1,this.$U)}if(n&&(this.UU=je(this.YU)),s||r){const t=8,e=Ji(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.MN=void 0,G(e)&&("primitive"===s?this.MN={type:s,shader:this.zL.cE(Wg["3D"],Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}),Wg.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.MN={type:s,shader:this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:"uniform",shadingStyle:this.Bm._().type}),Wg.LineInstanced3D({axisWorldTranslation:gg(this.dt)})),geometry:$m(this.zL,t),fillStyle:e}))}return this.HU=!1,this.Tu=i,this.Bm.o=!1,this}yL(t){if(1===t)return this;const e=this.zL.gl,i=this.MN,s=this.$U,r=this.Cu,n=this.Bm._();if(i&&s&&Ji(r))switch(i.type){case"instanced":{const o=.5*this.Ts.bm(r.thickness),h=i.fillStyle.getColor(),a=i.shader,l=i.geometry;this.zL.lV(a,((i,r,u)=>{this.zL.JL(a).DV(i("uScale"),this.IU.dR.gV()).DV(i("uDisp"),this.IU.dR.pV()).LV(i("uViewProjectionMatrix"),this.NU).AV(i("uColorDiffuse"),h).fV(i("uOffsetWU"),o).fV(i("uIsHighlighted"),this.Ko).AV(i("uHighlightColorOffset"),2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0),"phong"===n.type&&this.zL.DV(i("uCameraLoc"),this.GU).DV(i("uLightLoc"),this.WU).fV(i("uAmbientReflection"),n.ambientReflection).fV(i("uSpecularReflection"),n.specularReflection).fV(i("uDiffuseReflection"),n.diffuseReflection).fV(i("uShininess"),n.shininess).AV(i("uLightColor"),n.specularColor).AV(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.zL.HV(c,1),e.enableVertexAttribArray(c),e.vertexAttribPointer(d,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(d,1),e.enableVertexAttribArray(d),l.JL(u).Pp(this.YU.length/2),!0}));break}case"primitive":{const n=Ji(r)?r.getFillStyle():void 0,o=n&&G(n)?n.getColor():void 0;if(o){const r=i.shader;this.zL.lV(r,((i,n)=>(this.zL.JL(r).DV(i("uScale"),this.IU.dR.gV()).DV(i("uDisp"),this.IU.dR.pV()).LV(i("uViewProjectionMatrix"),this.NU).AV(i("uColor"),o).fV(i("uIsHighlighted"),this.Ko).AV(i("uHighlightColorOffset"),2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0).uV(s,void 0,{location:n("aPos"),size:3}).Pp(e.LINES,this.YU.length),!0)))}break}}return this}_l(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.zL.fs.oo&&s>i.length&&St.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}}IE(){this.zL.SV(this.cN)}}const Jm=(t,e)=>{const i=Math.round(e);i<3&&fe(0,wt);const s=i;let r=t.CV.TE.get(Array.from(t.CV.TE.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new qm(t,i,s),t.CV.TE.set({sectors:i,stacks:s},r),r)};class Zm extends Ym{constructor(t,e,i,s,r){super(t,e,i,s,r),this.FU="cull-back",this.wb=[],this.MN={},this.bG=new em(this.wb,(t=>t.vertexBuffer&&this.zL.SV(t.vertexBuffer)),!0),this.Lu=[],this.al=0,this.ll=[],this.ul=0,this.ol=Ve,this.cl=Ve,this.mO=yg({lineStyleSolid:()=>{const t=this.Cu;return Ji(t)&&t},lineFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},lineFillPaletted:()=>{const t=this.Cu.getFillStyle();return H(t)&&t},jointStyleTriangulatedPoints:()=>ar(this.Qm)&&this.Qm,jointSizeTriangulated:()=>{const t=this.Qm;return ar(t)&&t.getSize()},jointFillSolid:()=>{const t=this.Qm.getFillStyle();return G(t)&&t},jointFillPaletted:()=>{const t=this.Qm.getFillStyle();return H(t)&&t},wireframeLineStyleSolid:()=>{const t=ar(this.Qm)&&this.Qm.getWireframeStyle();return Ji(t)&&t},wireframeFillSolid:()=>{const t=ar(this.Qm)&&this.Qm.getWireframeStyle(),e=t&&t.getFillStyle();return G(e)&&e}}),this.fl=!1,this.Cu=Mr.lineStyle,this.Qm=Mr.pointStyle3D,this.Bm.M(Gn),this.kG={attributesPerVertex:3,prepareRenderData:(t,e)=>Jt(t)}}Ds(t){const e=this.fl,i=this.ll,s=this.ul,r=s>0,n=this.Cu,o=n!==this.Tu,h=this.Qm,a=h!==this.ZU,l=this.HE(),u=this.jo.o,c=this.jo._();this.cl&&(this.ol=Je(this.ol,this.cl),this.cl=void 0),r&&(this.Lu=se(this.Lu,i,{canReturnB:!0}),this.al+=s);let d=i,f=s;if(e&&(this.wb.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=Ve})),this.bG.fG(),d=this.Lu,f=this.al),f>0){const t=1e5,e=Math.floor(this.aO.QU/(this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.ha("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=kt(i,t,e);this.bG.lG(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:Ve,vertexBuffer:this.zL.zV(t*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i))})),((t,e,i,s)=>{this.zL.OV(t.vertexBuffer,t.existingCoordinatesCount*this.kG.attributesPerVertex,this.kG.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.mO.lineStyleSolid(o),i=this.mO.lineFillSolid(o),s=this.mO.lineFillPaletted(o),r=i||s,h=this.mO.jointStyleTriangulatedPoints(a),l=this.mO.jointSizeTriangulated(a),u=this.mO.jointFillSolid(a),d=this.mO.jointFillPaletted(a),f=u||d,g=this.mO.wireframeLineStyleSolid(a),y=this.mO.wireframeFillSolid(a),m=n.getThickness()<0||1===n.getThickness()&&this.ha("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.zL.cE(Wg["3D"],Wg.Color({dataType:p}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})),mousePicking:c?{shader:this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}))}:void 0}:"instanced"===m&&e&&r&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:i,fillStylePaletted:s,shader:this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:p,shadingStyle:this.Bm._().type}),Wg.LineInstanced3D({axisWorldTranslation:gg(this.dt)})),geometry:Km(this.zL,e.getThickness()),mousePicking:c?{shader:this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.LineInstanced3D({axisWorldTranslation:gg(this.dt)}))}:void 0}),t.markers=void 0,f&&h){const e=ee(h.getShape(),{cube:()=>Gm(this.zL),sphere:()=>Qm(this.zL,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof l&&l,pointSizeAxis:"object"==typeof l&&l,fillStyleSolid:u,fillStylePaletted:d,shader:this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty(),d.lut]:"uniform",shadingStyle:this.Bm._().type,wireframe:!1!==y}),Wg.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:gg(this.dt),normalSource:e.wU})),mousePicking:c?{shader:this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:gg(this.dt),normalSource:void 0}))}:void 0,wireframe:g&&y&&{thickness:g.getThickness(),fillStyleSolid:y}}}this.MN=t}return this.fl=!1,this.ll=[],this.ul=0,this.Tu=n,this.ZU=h,this.Bm.o=!1,this.jo.o=!1,this}yL(t){var e,i;const s=this.zL.gl,{lines:r,markers:n}=this.MN,o=this.Bm._(),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.zL.lV(e,((r,h,u)=>{let c=!1;if(this.zL.JL(e).DV(r("uScale"),this.IU.dR.gV()).DV(r("uDisp"),this.IU.dR.pV()).LV(r("uViewProjectionMatrix"),this.NU).fV(r("uOffsetWU"),this.Ts.bm(n.getThickness())).fV(r("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(r("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(r("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.zL.DV(r("uCameraLoc"),this.GU).DV(r("uLightLoc"),this.WU).fV(r("uAmbientReflection"),o.ambientReflection).fV(r("uSpecularReflection"),o.specularReflection).fV(r("uDiffuseReflection"),o.diffuseReflection).fV(r("uShininess"),o.shininess).AV(r("uLightColor"),o.specularColor).AV(r("uAmbientColor"),o.ambientColor),1===t)this.zL.AV(r("uColor"),this.SO);else if(a)this.zL.AV(r("uColorDiffuse"),a.getColor());else if(l){const t=mg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.zL.Ez(u,l.lut,t)}return this.wb.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.zL.HV(e,1),s.enableVertexAttribArray(e),s.vertexAttribPointer(r,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(r,1),s.enableVertexAttribArray(r),i.JL(u).Pp(t.existingCoordinatesCount-1),c=!0})),c}))}if(r&&h&&"primitive"===r.type){const e=h,{fillStyleSolid:i,fillStylePaletted:n}=r;this.zL.lV(e,((r,o,h)=>{let a=!1;if(this.zL.JL(e).DV(r("uScale"),this.IU.dR.gV()).DV(r("uDisp"),this.IU.dR.pV()).LV(r("uViewProjectionMatrix"),this.NU).fV(r("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(r("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(r("uRenderEffectMask"),2===t?1:0),1===t)this.zL.AV(r("uColor"),this.SO);else if(i)this.zL.AV(r("uColor"),i.getColor());else if(n){const t=mg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.zL.Ez(h,n.lut,t)}return this.wb.forEach((t=>{this.zL.uV(t.vertexBuffer,void 0,{location:o("aPos"),size:3}).Pp(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.zL.lV(e,((n,a,c,d)=>{let f=!1;if(this.zL.JL(e).DV(n("uScale"),this.IU.dR.gV()).DV(n("uDisp"),this.IU.dR.pV()).LV(n("uViewProjectionMatrix"),this.NU).fV(d("uRatioNwuWu"),this.IU.JU()).fV(n("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(n("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.zL.DV(n("uCameraLoc"),this.GU).DV(n("uLightLoc"),this.WU).fV(n("uAmbientReflection"),o.ambientReflection).fV(n("uSpecularReflection"),o.specularReflection).fV(n("uDiffuseReflection"),o.diffuseReflection).fV(n("uShininess"),o.shininess).AV(n("uLightColor"),o.specularColor).AV(n("uAmbientColor"),o.ambientColor),1===t)this.zL.AV(n("uColor"),this.SO);else if(s)this.zL.AV(n("uColorDiffuse"),s.getColor());else if(r){const t=mg(r,this,void 0);if(!t&&r.lut.percentageValues)return!1;this.zL.Ez(c,r.lut,t)}return u&&1!==t&&this.zL.fV(n("uWireframeThickness"),u.thickness).AV(n("uWireframeColor"),u.fillStyleSolid.getColor()),!1!==h&&this.zL.DV(n("uOffsetAxis"),[h.x,h.y,h.z]),!1!==l&&this.zL.fV(n("uOffsetNWU"),l),this.wb.forEach((e=>{this.zL.uV(e.vertexBuffer,1,{location:a("aPos"),size:3}),i.Pp(c,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(u)&&1!==t),f=!0})),f}))}return this}_l(t,e){Array.isArray(t)||(t=[t]),this.ll=se(this.ll,t,{canReturnB:!0}),this.ul+=t.length;const i=e||je(t);return this.cl=this.cl?Je(this.cl,i):i,this}Ee(t){return this.Cu="function"==typeof t?t(this.Cu):t,this}ku(){return this.Cu}ym(t){return this.Qm="function"==typeof t?t(this.Qm):t,this}KU(){return this.Qm}xt(){return this.cl?Math.max(this.cl.max.x,this.ol.max.x):this.ol.max.x}vt(){return this.cl?Math.min(this.cl.min.x,this.ol.min.x):this.ol.min.x}Mt(){return this.cl?Math.max(this.cl.max.y,this.ol.max.y):this.ol.max.y}bt(){return this.cl?Math.min(this.cl.min.y,this.ol.min.y):this.ol.min.y}Wm(){return this.cl?Math.max(this.cl.max.z,this.ol.max.z):this.ol.max.z}Um(){return this.cl?Math.min(this.cl.min.z,this.ol.min.z):this.ol.min.z}Vl(){return Me(this.Cu)}zl(){return Me(this.Cu)}Ym(){return Me(this.Cu)}yl(){return this.Lu}ml(){return this.ll}wl(){return this.al}Cl(){return this.ul}Nt(){return this.fl=!0,this.Lu.length=0,this.al=0,this.ll=[],this.ul=0,this.ol=Ve,this.cl=void 0,this}dispose(){return super.dispose(),this.bG.AG(),this.MN={},this}GL(){return this.dispose(),this}}const Km=(t,e)=>$m(t,e>50?20:e>20?16:e>10?12:e>5?8:6),Qm=(t,e)=>{const i=e.getSize();return Jm(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class tp extends Ym{constructor(t,e,i,s,r){super(t,e,i,s,r),this.FU="disabled",this.qU=!1,this.tY=!1,this.iY={x:1,y:1,z:1},this.gS={x:0,y:0,z:0},this.AS={x:0,y:0,z:0},this.pS={x:0,y:0,z:0},this.mS={x:1,y:1,z:1},this.sY=ol.projectionOrthographic(-1,1,-1,1,1,-1),this.eY=ol.projectionOrthographic(-1,1,-1,1,1,-1),this.hY=!1,this.mO=yg({fillStyleSolid:()=>G(this.be)&&this.be,fillStyleValuePalette:()=>H(this.be)&&"value"===this.be.lookUpProperty&&this.be}),this.be=Mr.fillStyle,this.Bm.M(Gn)}Ds(t){var e;const i=this.HE(),s=this.jo._(),r=this.jo.o,n=this.ga();this.mO.fillStyleSolid(n);const o=this.mO.fillStyleValuePalette(n),h=this.pS,a=this.mS;if(this.qU&&this.rY&&(this.cN=this.zL.oV(this.rY.vertices,void 0,this.cN),this.dN=this.zL.GV(this.rY.indices,this.dN),this.nY=this.rY.indices.length),"phong"===this.Bm._().type&&(i||this.qU)&&(null===(e=this.rY)||void 0===e?void 0:e.normals)&&(this.oY=this.zL.oV(this.rY.normals,void 0,this.oY)),!this.aY&&o&&"value"===o.lookUpProperty&&this.rY&&(this.aY=new Float32Array(this.rY.vertices.length/3),this.tY=!0),this.aY&&this.tY&&(this.lY=this.zL.oV(this.aY,void 0,this.lY)),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.gR=this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:o?["lookup","value",o.lut]:"uniform",shadingStyle:this.Bm._().type,wireframe:!1}),Wg.Model3D({normalSource:"phong"===this.Bm._().type?"attribute":void 0})),this.AU=s?this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.Model3D({normalSource:void 0})):void 0}if(this.hY){const t=ol.projectionOrthographic(-1,1,-1,1,1,-1);this.eY=ol.rotateXYZ(t,h),this.sY=ol.translate(t,a.x/2,a.y/2,a.z/2),this.sY=ol.rotateXYZ(this.sY,h),this.sY=ol.translate(this.sY,-a.x/2,-a.y/2,-a.z/2),this.hY=!1}return this.Bm.o=!1,this.Sa(this.be),this.jo.o=!1,this.qU=!1,this.tY=!1,this}yL(t){const e=1===t?this.AU:this.gR,i=1===t,s=this.dN,r=this.nY,n=this.cN,o=this.oY,h=this.lY,a=this.gS,l=this.AS,u=this.iY,c=this.mS,d=this.sY,f=this.eY,g=this.mO.fillStyleValuePalette(!1),y=this.mO.fillStyleSolid(!1),m=this.Bm._(),p={location:void 0,size:1};return e&&n&&s&&r?(this.zL.lV(e,((A,x,S,b)=>{if(this.zL.JL(e).DV(A("uScale"),this.IU.dR.gV()).DV(A("uDisp"),this.IU.dR.pV()).LV(A("uViewProjectionMatrix"),this.NU).fV(A("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(A("uHighlightColorOffset"),this.sa).fV(A("uRenderEffectMask"),2===t?1:0),i)this.zL.AV(A("uColor"),this.SO);else{if(this.be===B)return!1;if(y)this.zL.AV(A("uColorDiffuse"),y.getColor());else if(g){if(!h)return!1;const t=g.getPalette();p.location=x("aLookupValue"),this.zL.Ez(S,t,void 0).uV(h,void 0,p)}}return"phong"!==m.type||i||(this.zL.DV(A("uCameraLoc"),this.GU).DV(A("uLightLoc"),this.WU).fV(A("uAmbientReflection"),m.ambientReflection).fV(A("uSpecularReflection"),m.specularReflection).fV(A("uDiffuseReflection"),m.diffuseReflection).fV(A("uShininess"),m.shininess).AV(A("uLightColor"),m.specularColor).AV(A("uAmbientColor"),m.ambientColor).LV(A("uModelRotationNormals"),f),o&&this.zL.uV(o,void 0,{location:S.attribute("aNormal"),size:3})),this.zL.LV(A("uModelRotation"),d).DV(A("uModelScale"),[u.x,u.y,u.z]).DV(A("uLocationAxis"),[a.x,a.y,a.z]).DV(A("uModelAlignment"),[l.x,l.y,l.z]).DV(A("uModelSize"),[c.x,c.y,c.z]),this.zL.uV(n,0,{location:S.attribute("aGeoPos"),size:3}).ZV(s).JV(r,this.zL.gl.TRIANGLES),!0})),this):this}dispose(){return super.dispose(),this.cN&&(this.zL.SV(this.cN),this.cN=void 0),this.dN&&(this.zL.SV(this.dN),this.dN=void 0),this.oY&&(this.zL.SV(this.oY),this.oY=void 0),this.lY&&(this.zL.SV(this.lY),this.lY=void 0),this.gR=void 0,this.AU=void 0,this.rY=void 0,this.aY=void 0,this}GL(){return this.dispose(),this}SS(t){return this.rY=t,this.qU=!0,this.mS=t.modelSize,this}xS(t){return this.aY=t,this.tY=!0,this}ke(t){return this.be=Hr(this.be,t),this}Lh(){return this.be}bS(t){return this.iY=t,this}gV(){return this.iY}MS(t){return this.gS=t,this}_S(t){return this.AS=t,this}wS(t){return this.pS=t,this.hY=!0,this}CS(t){return this.FU=t,this}kS(){return this.FU}xt(){return Le}vt(){return Ie}Mt(){return Le}bt(){return Ie}Wm(){return Le}Um(){return Ie}Vl(){return 0}zl(){return 0}Ym(){return 0}ga(){return Xr(this.pa,this.be)}Sa(t){this.pa=t}}class ep extends Ym{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.FU="cull-back",this.wb=[],this.bG=new em(this.wb,(t=>t.vertexBuffer&&this.zL.SV(t.vertexBuffer)),!1),this.Lu=[],this.al=0,this.ll=[],this.ul=0,this.ol=Ve,this.cl=Ve,this.fl=!1,this.mO=yg({fillStyleSolid:()=>{const t=this.qm.getFillStyle();return G(t)&&t},fillStyleIndividual:()=>{const t=this.qm.getFillStyle();return W(t)&&t},fillStylePalette:()=>{const t=this.qm.getFillStyle();return H(t)&&t},triangulatedPointStyle:()=>{const t=this.qm;return ar(t)&&t},wireframeLineStyleSolid:()=>{const t=ar(this.qm)&&this.qm,e=t&&t.getWireframeStyle();return Ji(e)&&e},wireframeFillStyleSolid:()=>{const t=ar(this.qm)&&this.qm,e=t&&t.getWireframeStyle(),i=e&&e.getFillStyle();return G(i)&&i}}),this.Al=void 0,this.En=n,this.qm=Mr.pointStyle3D,this.Bm.M(Gn);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 y=((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&&W(e)&&e.getFallbackColor()||C,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;eJt(t))(o,h,a,l);this.kG={individualPointColorEnabled:o,individualPointSizeEnabled:h,individualLookupValuesEnabled:a,individualPointSizeAxisEnabled:l,attributesPerVertex:g,attributeOffsetCoordinate:0,attributeOffsetColor:u,attributeOffsetSize:c,attributeOffsetLookUpValue:d,attributeOffsetPointSize3D:f,prepareRenderData:(t,e)=>y(t,this.qm,this.qm.fillStyle)}}Ds(t){const e=this.fl,i=this.ll,s=this.ul,r=s>0,n=this.qm,o=this.qm!==this.uY,h=this.jo._(),a=this.jo.o,l=this.HE();this.cl&&(this.ol=Je(this.ol,this.cl),this.cl=void 0),r&&(this.Lu=se(this.Lu,i,{canReturnB:!0}),this.al+=s);let u=i,c=s;if(e&&(this.wb.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=Ve})),this.bG.fG(),u=this.Lu,c=this.al),c>0){const t=Math.floor(this.aO.QU/(this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=kt(c,1e5,t);this.bG.lG(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:Ve,vertexBuffer:this.zL.zV(t*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i))})),((t,e,i)=>{this.zL.OV(t.vertexBuffer,t.existingCoordinatesCount*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}const d=n.getFillStyle(),f=this.mO.fillStyleSolid(o),g=this.mO.fillStyleIndividual(o),y=this.mO.fillStylePalette(o),m=d===B&&B;if(o||l||a){let t;const e=n.getSize(),i=this.kG.individualPointColorEnabled,s=this.kG.individualPointSizeEnabled,r=this.kG.individualPointSizeAxisEnabled,a=this.kG.individualLookupValuesEnabled;if(g&&!i){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw St.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 St.alert(t),new Error(t)}const l=this.mO.wireframeLineStyleSolid(o),u=this.mO.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(ar(n)){const r=ee(n.getShape(),{cube:()=>Gm(this.zL),sphere:()=>ip(this.zL,n,s)});t={type:"instanced",shader:this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:i,shadingStyle:this.Bm._().type,wireframe:!1!==u}),Wg.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:gg(this.dt),normalSource:r.wU})),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.zL.cE(Wg["3D"],Wg.MousePicking,Wg.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:gg(this.dt),normalSource:void 0})),geometry:r,wireframe:l&&u&&{thickness:l.getThickness()<0?1:l.getThickness(),fillStyleSolid:u}}}else cr(n)&&"number"==typeof e&&(t={type:"primitive",shader:this.zL.cE(Wg["3D"],Wg.PointSize(c),Wg.Color({dataType:i}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:o,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:y,mousePickingShader:h&&this.zL.cE(Wg["3D"],Wg.PointSize(c),Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}))})}this.MN=t}if(void 0===this.Al&&y&&"value"===y.lookUpProperty&&y.lut.percentageValues){let t=Le,e=Ie;for(let i=0;it&&(t=s.value)}this.Al={min:e,max:t}}return this.fl=!1,this.ll=[],this.ul=0,this.uY=n,this.Bm.o=!1,this}yL(t){const e=this.zL.gl,i=this.MN;if(!i)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const r=this.Bm._(),{fillStyleSolid:n,fillStylePaletted:o,useIndividualPointSize:h}=i,a="instanced"===i.type&&i.useIndividualPointSize3D,l="instanced"===i.type&&i.wireframe;return this.zL.lV(s,((u,c,d,f)=>{let g=!1;if(this.zL.JL(s).DV(u("uScale"),this.IU.dR.gV()).DV(u("uDisp"),this.IU.dR.pV()).LV(u("uViewProjectionMatrix"),this.NU).fV(u("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(u("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(u("uRenderEffectMask"),2===t?1:0),"instanced"===i.type){const{pointSizeAxis:t,pointSizeNWU:e}=i;!1!==t&&!1===a&&this.zL.DV(u("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===h&&this.zL.fV(u("uOffsetNWU"),e).fV(f("uRatioNwuWu"),this.IU.JU())}else if("primitive"===i.type){const{pointSizePixels:t}=i;h||this.zL.fV(u("uPointSize"),t).fV(u("uDevicePixelRatio"),this.zL.sR())}if(1===t)this.zL.AV(u("uColor"),this.SO);else if("instanced"===i.type?("phong"===r.type&&this.zL.DV(u("uCameraLoc"),this.GU).DV(u("uLightLoc"),this.WU).fV(u("uAmbientReflection"),r.ambientReflection).fV(u("uSpecularReflection"),r.specularReflection).fV(u("uDiffuseReflection"),r.diffuseReflection).fV(u("uShininess"),r.shininess).AV(u("uLightColor"),r.specularColor).AV(u("uAmbientColor"),r.ambientColor),l&&this.zL.fV(u("uWireframeThickness"),l.thickness).AV(u("uWireframeColor"),l.fillStyleSolid.getColor()),n&&this.zL.AV(u("uColorDiffuse"),n.getColor()),i.fillStyleEmpty&&this.zL.AV(u("uColorDiffuse"),D)):"primitive"===i.type&&n&&this.zL.AV(u("uColor"),n.getColor()),o){const t=mg(o,this,this.Al);if(!t&&o.lut.percentageValues)return!1;this.zL.Ez(d,o.lut,t)}return this.wb.forEach(((s,n)=>{e.bindBuffer(e.ARRAY_BUFFER,s.vertexBuffer);const o=c("aPos");if(e.vertexAttribPointer(o,3,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(o,1),e.enableVertexAttribArray(o),i.fillStyleIndividual&&void 0!==this.kG.attributeOffsetColor&&1!==t){const t=c("aColor");e.vertexAttribPointer(t,4,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(t,1),e.enableVertexAttribArray(t)}if(h&&void 0!==this.kG.attributeOffsetSize){"instanced"===i.type?this.zL.fV(f("uRatioNwuWu"),this.IU.JU()):"primitive"===i.type&&this.zL.fV(u("uDevicePixelRatio"),this.zL.sR());const t=c("instanced"===i.type?"aOffsetNWU":"aPointSize");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(t,1),e.enableVertexAttribArray(t)}if(a&&void 0!==this.kG.attributeOffsetPointSize3D&&"instanced"===i.type){const t=c("aOffsetAxis");e.vertexAttribPointer(t,3,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(t,1),e.enableVertexAttribArray(t)}if(i.fillStylePaletted&&"value"===i.fillStylePaletted.getLookUpProperty()&&void 0!==this.kG.attributeOffsetLookUpValue&&1!==t){const t=c("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(t,1),e.enableVertexAttribArray(t)}"instanced"===i.type?(i.geometry.Pp(d,s.existingCoordinatesCount,"phong"===r.type&&1!==t,Boolean(l)&&1!==t),g=!0):"primitive"===i.type&&(this.zL.Pp(e.POINTS,s.existingCoordinatesCount),g=!0)})),g})),this}_l(t,e){Array.isArray(t)||(t=[t]),this.ll=se(this.ll,t,{canReturnB:!0}),this.ul+=t.length;const i=e||je(t);return this.cl=this.cl?Je(this.cl,i):i,this.Al=void 0,this}ty(t){return this.qm="function"==typeof t?t(this.qm):t,this}cY(){return this.qm}xt(){return this.cl?Math.max(this.cl.max.x,this.ol.max.x):this.ol.max.x}vt(){return this.cl?Math.min(this.cl.min.x,this.ol.min.x):this.ol.min.x}Mt(){return this.cl?Math.max(this.cl.max.y,this.ol.max.y):this.ol.max.y}bt(){return this.cl?Math.min(this.cl.min.y,this.ol.min.y):this.ol.min.y}Wm(){return this.cl?Math.max(this.cl.max.z,this.ol.max.z):this.ol.max.z}Um(){return this.cl?Math.min(this.cl.min.z,this.ol.min.z):this.ol.min.z}Vl(){const t=this.qm,e=t.getSize();return"number"==typeof e?ar(t)?e/2:cr(t)?5:0:0}zl(){return this.Vl()}Ym(){return this.Vl()}yl(){return this.Lu}ml(){return this.ll}wl(){return this.al}Cl(){return this.ul}Nt(){return this.fl=!0,this.Lu.length=0,this.al=0,this.ll=[],this.ul=0,this.ol=Ve,this.cl=void 0,this.Al=void 0,this}dispose(){return super.dispose(),this.bG.AG(),this.MN=void 0,this}GL(){return this.dispose(),this}}const ip=(t,e,i)=>{const s=e.getSize();return Jm(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class sp extends Ym{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.FU="disabled",this.be=Mr.fillStyle,this.Ky=Mr.lineStyle,this.aW=p("bilinear"),this.dY=[],this.fY=void 0,this.MN={},this.AY=!1,this.mO=yg({fillStyleSolid:()=>G(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be,wireframeStyleLine:()=>Ji(this.Ky)&&this.Ky,wireframeStyleFill:()=>{const t=this.Ky&&this.Ky.getFillStyle();return G(t)&&t}}),this.Pi={x:0,z:0},this.yw={x:1,z:1},this.Bm.M(Nn);const o="columns"===s.dataOrder?s.columns:s.rows,h="columns"===s.dataOrder?s.rows:s.columns;this.En={...s,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h},this.gY=new Array(this.En.primaryDimensionVectorsCount).fill(void 0),this.sk=new xm(this.aO,t.aO._W,t.us.dt,wt,[],this.En,-1,C).qy(rt),this.sk.cW=fm;const a=this.sk.fW.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.sk.fW.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.pY={gridTiles:a,gridTileSizes:l,largestGridTileSize:u},this.sS(this.Pi,this.yw)}mY(t){this.yY=t,this.fY=void 0}sS(t,e){this.Pi=t,this.yw=e;const i=this.En,s={min:{x:Math.min(this.Pi.x,this.Pi.x+(i.columns-1)*this.yw.x),z:Math.min(this.Pi.z,this.Pi.z+(i.rows-1)*this.yw.z)},max:{x:Math.max(this.Pi.x,this.Pi.x+(i.columns-1)*this.yw.x),z:Math.max(this.Pi.z,this.Pi.z+(i.rows-1)*this.yw.z)}},r=new Map;return this.pY.gridTiles.forEach((t=>{const e="columns"===this.En.dataOrder?{x:this.yw.x*(t.sizeHeatmapDataVectors.primary-1),z:this.yw.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.yw.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.yw.z*(t.sizeHeatmapDataVectors.primary-1)},i="columns"===this.En.dataOrder?{x:this.Pi.x+this.yw.x*t.iFirstVector.primary,z:this.Pi.z+this.yw.z*t.iFirstVector.secondary}:{x:this.Pi.x+this.yw.x*t.iFirstVector.secondary,z:this.Pi.z+this.yw.z*t.iFirstVector.primary};r.set(t,{sizeAxis:e,startLocationAxis:i})})),this.SW={SY:s,tilesInfo:r},this}eS(){return{start:this.Pi,step:this.yw,end:{x:this.Pi.x+this.yw.x*this.En.columns,z:this.Pi.z+this.yw.z*this.En.rows}}}Ds(t){const e=this.dY,i=Xr(this.pa,this.be),s=this.mO.fillStyleSolid(i),r=this.mO.fillStylePaletted(i),n=this.Ky,o=this.Ky!==this.AW,h=this.mO.wireframeStyleLine(o),a=this.mO.wireframeStyleFill(o),l=!1!==a,u=this.aW.o,c=this.aW._(),d=this.Bm._(),f=this.HE(),g=this.jo._();this.sk.Ds();const y=this.sk.gW;if(!y)return this;this.vY=this.vY||this.xY(y);const m=this.vY;this.bY(m);const p=gm(e,m,void 0,(t=>t.sizeGeometryDataVectors));if(p.size>0&&(pm(this.zL,p,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.AY=!0),"phong"===d.type&&(p.size>0||f)){const t=this.zL.gl,e=this.zL.cE(Wg["2D"],Wg.DrawToNormalTexture({flipXZ:"rows"===this.En.dataOrder,vertexIdSource:this.zL.Cz(),normalTextureType:this.zL.gl2?"uint":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN}));m.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{var r;const n=s.normalmapTexture,o=null===(r=this.SW)||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.zL.lz.yL((()=>{this.zL.lV(e,((r,n,h,l)=>(this.zL.JL(e).kz(h,a).cV(r("uTileDimensionsXZ"),["columns"===this.En.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.En.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).IV(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).Pp(t.POINTS,a),!0)))}),n,h,void 0,this.us.un(),0)}))}))}const A=this.MN;if(i||o||u){const t=h&&a?{wireframeSolid:h,wireframeFillSolid:a}:void 0;s?A.surface={shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:r&&"value"===r.getLookUpProperty()?A.surface={shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:["lookup","value",r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r},wireframe:t}:r?A.surface={shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:["lookup",r.getLookUpProperty(),r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r},wireframe:t}:l&&(A.surface={shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return A.mousePicking=g?this.MN.mousePicking||{shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:"simple",wireframe:!1,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.MN=A,this.dY.length=0,this.pa=this.be,this.AW=n,this.Bm.o=!1,this}xY(t){const e=this.pY.gridTiles.map((e=>{const i=mm(this.zL,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.pY.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.zL.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.zL.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}bY(t){var e;if("phong"===this.Bm._().type)for(let i=0;i{t.normalmapTexture&&(this.zL.WL(t.normalmapTexture),t.normalmapTexture=void 0)}))}yL(t){var e,i,s,r;const n=this.zL.gl,o=this.vY;if(!o)return this;const h=this.Bm._(),a=this.MN,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.zL.lV(l,((e,i,s,r)=>{let a=!1;if(this.zL.JL(l).Fz(s,this.pY.largestGridTileSize.cells).DV(e("uScale"),this.IU.dR.gV()).DV(e("uDisp"),this.IU.dR.pV()).LV(e("uViewProjectionMatrix"),this.NU).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===h.type&&this.zL.DV(e("uCameraLoc"),this.GU).DV(e("uLightLoc"),this.WU).fV(e("uAmbientReflection"),h.ambientReflection).fV(e("uSpecularReflection"),h.specularReflection).fV(e("uDiffuseReflection"),h.diffuseReflection).fV(e("uShininess"),h.shininess).AV(e("uLightColor"),h.specularColor).AV(e("uAmbientColor"),h.ambientColor),u)){const{wireframeFillSolid:t,wireframeSolid:i}=u,s=i.getThickness()<0?1:i.getThickness();this.zL.AV(e("uWireframeColor"),t.getColor()).fV(e("uWireframeThickness"),s)}return 1===t?this.zL.AV(e("uColorDiffuse"),this.SO):"solid"===(null==c?void 0:c.fillMode)&&this.zL.AV(e("uColorDiffuse"),c.fillStyleSolid.getColor()),o.gridTileSizes.forEach((r=>{this.zL.cV(e("uTileDimensionsXZ"),["columns"===this.En.dataOrder?r.sizeHeatmapData.primary:r.sizeHeatmapData.secondary,"columns"===this.En.dataOrder?r.sizeHeatmapData.secondary:r.sizeHeatmapData.primary]).IV(e("uTileDimensions"),[r.sizeHeatmapData.primary,r.sizeHeatmapData.secondary]),r.tiles.forEach((h=>{var l;const d=null===(l=this.SW)||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.yY){const t=this.yY.fill.iFirstPrimary,e=this.yY.fill.iFirstPrimary+this.yY.fill.amountPrimary-1,i=h.iFirstVector.primary,s=h.iFirstVector.primary+h.sizeHeatmapDataVectors.primary-1;if(i>e||sy(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.sk.Al;this.zL.Ez(s,t.lut,i).dV(e("uTileIntensityValues"),h.intensityDataTexture,2).PV(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.vt(),max:this.xt()}:"y"===t.getLookUpProperty()?{min:this.bt(),max:this.Mt()}:"z"===t.getLookUpProperty()?{min:this.Um(),max:this.Wm()}:void 0;if(!e&&t.lut.percentageValues)return;this.zL.Ez(s,t.lut,e)}1!==t&&"phong"===this.Bm._().type&&h.normalmapTexture&&this.zL.dV(e("uNormalmapTexture"),h.normalmapTexture,3),this.zL.uV(o.rectangleLocationsBuffer,0,{location:i("aGeoCellOffset"),size:2},{location:u?i("aTriangleBary"):void 0,size:3}).RV(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).KV(o.rectangleLocationsDrawMode,0,o.rectangleLocationsDrawLength,g),a=!0,n.bindBuffer(n.ARRAY_BUFFER,null)}}))})),a})),this}dispose(){return super.dispose(),this.sk.dispose(),this.vY&&(this.vY.gridTileSizes.forEach((t=>{})),this.vY.gridTiles.forEach((t=>{this.zL.WL(t.heightmapDataTexture),t.normalmapTexture&&this.zL.WL(t.normalmapTexture)})),this.zL.SV(this.vY.rectangleLocationsBuffer),this.vY=void 0),this.MN={},this}GL(){return this.dispose(),this.sk.GL(),this}oS(t){return this.sk.oS(t),this}aS(t){this.dY.push(t),ym(this.pY.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.gY[n];if(e)i=ie.max?s:e.max;else{e={min:Ie,max:Le},this.gY[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.fY={min:i,max:s},this.fY}}class rp extends Ym{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.FU="disabled",this.xW=0,this.MW={},this.Pi={x:0,z:0},this.yw={x:1,z:1},this.En={...s,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.SY={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===s.scrollDimension?this.Pi.x+(s.columns-1)*this.yw.x:this.Pi.x,z:"columns"===s.scrollDimension?this.Pi.z+(s.rows-1)*this.yw.z:this.Pi.z}};const o=()=>({shape:new sp(this.IU,wt,this.ta,{columns:s.columns+("columns"===s.scrollDimension?1:0),rows:s.rows+("rows"===s.scrollDimension?1:0),dataOrder:s.scrollDimension,heatmapDataType:"intensity"},this.yO,this.SO).setVisible(!1),hasData:!1});this.wb=[o(),o()]}Ds(t){this.wb.forEach((e=>{e.shape.Ds(t)}));const e=this.wb.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Dt(null===(i=e.shape.sk.Al)||void 0===i?void 0:i.min,Ie)),t.max=Math.max(t.max,Dt(null===(s=e.shape.sk.Al)||void 0===s?void 0:s.max,Le)),t}),{min:Ie,max:Le}),i=this.wb.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Dt(null===(i=e.shape.fY)||void 0===i?void 0:i.min,Ie)),t.max=Math.max(t.max,Dt(null===(s=e.shape.fY)||void 0===s?void 0:s.max,Le)),t}),{min:Ie,max:Le});return this.wb.forEach((t=>{t.shape.sk.Al=e,t.shape.fY=i})),this}yL(t){return this.wb.forEach((e=>{e.hasData&&(e.shape.NU=this.NU,e.shape.GU=this.GU,e.shape.WU=this.WU,e.shape.yL(t))})),this}sS(t,e){return this.Pi=t,this.yw=e,this.wb.forEach((t=>{t.shape.sS("columns"===this.En.scrollDimension?{x:t.shape.eS().start.x,z:this.Pi.z}:{x:this.Pi.x,z:t.shape.eS().start.z},this.yw)})),"columns"===this.En.scrollDimension?(this.SY.min.z=t.z,this.SY.max.z=this.Pi.z+(this.En.rows-1)*this.yw.z):(this.SY.min.x=t.x,this.SY.max.x=this.Pi.x+(this.En.columns-1)*this.yw.x),this}eS(){return{start:this.Pi,step:this.yw}}Nt(){return this.xW=0,this.MW={},this.SY={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===this.En.scrollDimension?this.Pi.x+(this.En.columns-1)*this.yw.x:this.Pi.x,z:"columns"===this.En.scrollDimension?this.Pi.z+(this.En.rows-1)*this.yw.z:this.Pi.z}},this.wb.forEach((t=>{t.shape.setVisible(!1),t.shape.AY=!1,t.hasData=!1})),this}dS(t){var e;const i=this.wb[0],s=this.wb[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.xW/this.En.scrollDimensionSize)%this.wb.length,o=this.wb[e],h=this.xW%this.En.scrollDimensionSize,a=this.En.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.xW>=this.En.scrollDimensionSize&&c<=this.En.scrollDimensionSize-1,p=l;l&&(o.shape.sS("columns"===this.En.scrollDimension?{x:this.Pi.x+(this.xW-1)*this.yw.x,z:this.Pi.z}:{x:this.Pi.x,z:this.Pi.z+(this.xW-1)*this.yw.z},this.yw),o.shape.setVisible(!0));const A=m?0:1,x=c+(m?1:0);o.shape.mY({fill:{iFirstPrimary:A,amountPrimary:x},wireframe:{iFirstPrimary:A,amountPrimary:x,connectNext:!1}});const S=o===i?s:i,b=c+1,v=1+this.En.scrollDimensionSize-b;S.shape.mY({fill:{iFirstPrimary:b,amountPrimary:v},wireframe:{iFirstPrimary:b,amountPrimary:v-1,connectNext:!0}});const M={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,y);let i=!1;p&&this.MW.yValues&&(i=!0,e.splice(0,0,this.MW.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.En.staticDimensionSize,values:e,type:"y"};o.shape.aS(s),o.hasData=!0,M.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,y);let i=!1;p&&this.MW.intensityValues&&(i=!0,e.splice(0,0,this.MW.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.En.staticDimensionSize,values:e,type:"intensity"};o.shape.oS(s),o.hasData=!0,M.intensityValues=e[u-1]}this.xW+=u,n+=u,this.MW=M}while(ne.shape.rS(t))),this}nS(){return this.wb[0].shape.nS()}ke(t){return this.wb.forEach((e=>e.shape.ke(t))),this}Lh(){return this.wb[0].shape.Lh()}qy(t){return this.wb.forEach((e=>e.shape.qy(t))),this}hS(){return this.wb[0].shape.hS()}GL(){return this.dispose(),this.wb.forEach((t=>t.shape.GL())),this}dispose(){return super.dispose(),this.wb.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.wb.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}Om(t){return super.Om(t),this.wb.forEach((e=>e.shape.Om(t))),this}xt(){return this.SY.max.x}vt(){return this.SY.min.x}Mt(){return Math.max(this.wb[0].shape.Mt(),this.wb[1].shape.Mt())}bt(){return Math.min(this.wb[0].shape.bt(),this.wb[1].shape.bt())}Wm(){return this.SY.max.z}Um(){return this.SY.min.z}Vl(){return 0}zl(){return 0}Ym(){return 0}cs(t){return super.cs(t),this.wb.forEach((e=>e.shape.cs(t))),this}}class np extends Vm{constructor(t,e,i,s){super(t,e,i),this._Y=45,this.wY=.1,this.CY=100,this.GU=f(0,0,1),this.kY=f(0,0,-1),this.TY=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.Bm=new On,this.dt=s}RS(){const{cellIndex:t,cellSpan:e,cellsAmount:i}=this.dt,s=e.x/i.x,r=e.y/i.y,n=t.x/i.x,o=t.y/i.y,h=this.us.oi();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.GU=t,this}getCameraLocation(){return this.GU}setCameraDirection(t){return this.kY=Fe.normalize(t),this}getCameraDirection(){return this.kY}setLightLocation(t){return this.WU=t,this}getLightLocation(){return this.WU}FY(){return f(this.TY[0],this.TY[1],this.TY[2])}IY(){return f(this.TY[4],this.TY[5],this.TY[6])}}class op extends np{constructor(t,e,i,s){super(t,e,i,s),this.dR=new Iy,this.PY=!0,this.aO=t,this.gl=t.uO(),this.vU=this.gU,this.DY=this.us.Go((()=>{this.PY=!0})),this.BY=s.U((()=>{this.PY=!0}))}nV(t){const e=t.vt(),i=t.bt(),s=t.Um(),r=t.xt(),n=t.Mt(),o=t.Wm();if(e===Ie||r===Le||i===Ie||n===Le||s===Ie||o===Le)return ze;const h=t.Vl(),a=t.zl(),l=t.Ym(),u=Math.abs(t.Ts.bm(h)*t.dt.x.et()),c=Math.abs(t.Ts.bm(a)*t.dt.y.et()),d=Math.abs(t.Ts.bm(l)*t.dt.z.et()),f=e-u,g=r+u,y=i-c,m=n+c,p=s-d,A=o+d;let x;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:A},{x:g,y,z:A},{x:f,y:m,z:A},{x:g,y:m,z:A}].map((e=>t.Ts._m(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};x=x?qe(x,{min:t,max:t}):e})),x||ze}xU(t){const e=Array.from(this.vU.values());for(let i=0;ige()));const{viewProjectionMatrix:s}=this.LY();this.RY();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.gU.forEach((t=>{t.NU=s,t.GU=r,t.WU=n,t.Ds(i)})),this}LY(){if(!this.PY&&this.NU)return{viewProjectionMatrix:this.NU};const t=this.RS(),e=t.width/t.height;this.EY=ol.projectionPerspective(this._Y,e,this.wY,this.CY);const i=this.GU;this.TY[12]=i.x,this.TY[13]=i.y,this.TY[14]=i.z;const s=this.kY,r=f(0,1,0),n=Fe.multiply(s,-1),o=Fe.normalize(Fe.cross(r,n)),h=Fe.normalize(Fe.cross(n,o));this.TY[0]=o.x,this.TY[1]=o.y,this.TY[2]=o.z,this.TY[4]=h.x,this.TY[5]=h.y,this.TY[6]=h.z,this.TY[8]=n.x,this.TY[9]=n.y,this.TY[10]=n.z,this.VY=ol.inverse(this.TY);const{cellIndex:a,cellSpan:l,cellsAmount:u}=this.dt,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=ol.multiply(ol.translation(Ln(-1,1,g),Ln(-1,1,y),0),ol.scaling(c,d,1));return this.NU=ol.multiply(m,ol.multiply(this.EY,this.VY)),this.zY=ol.inverse(this.NU),this.PY=!1,{viewProjectionMatrix:this.NU}}RY(){this.dR.iO(this.dt.x),this.dR.sO(this.dt.y),this.dR.eO(this.dt.z)}yL(t,e){const i=this.gl.sR(),s=this.RS(),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.gU.forEach((e=>{e.getVisible()&&(this.gl.qE(e.FU),1!==t&&this.gl.Nm(e.Rm),(1!==t||e.getMouseInteractions())&&e.yL(t))})),this.gl.qE("disabled"),this.gl.Nm(!1),this.gl.tV(!1),this}setCameraLocation(t){return this.GU.x===t.x&&this.GU.y===t.y&&this.GU.z===t.z||(this.PY=!0),super.setCameraLocation(t),this}setCameraDirection(t){return this.kY.x===t.x&&this.kY.y===t.y&&this.kY.z===t.z||(this.PY=!0),super.setCameraDirection(t),this}W(){super.W(),this.us.Wo(this.DY),this.dt.Y(this.BY)}Oc(t){const e=this.aO.bU();return this.pU(new ep(this,this.mU,[],e,this.aO.MU(e),t))}zp(t){const e=this.aO.bU();return this.pU(new Zm(this,this.mU,t,e,this.aO.MU(e)))}jm(){const t=this.aO.bU();return this.pU(new Hm(this,this.mU,[],t,this.aO.MU(t)))}yS(){const t=this.aO.bU();return this.pU(new tp(this,this.mU,[],t,this.aO.MU(t)))}_A(){const t=this.aO.bU();return this.pU(new jm(this,this.mU,[],t,this.aO.MU(t)))}tS(t){const e=this.aO.bU();return this.pU(new sp(this,this.mU,[],t,e,this.aO.MU(e)))}cS(t){const e=this.aO.bU();return this.pU(new rp(this,this.mU,[],t,e,this.aO.MU(e)))}}class hp extends Tr{constructor(t,e,i,s=Cy){var r;if(super(t,e,i),this.X=c(1,1),this.OY=!1,this.NY=0,this.GY=!0,this.WY=0,this.QU=8388608,this.QR=[null,null],this.UY=null,this.YY=null,this.HY=0,this.RA=!1,this.$Y=0,this.bs=(t=!1)=>(this.$i||this.rn||this.jY()||(t&&(this.OY=!0),this.Jr=!0,this.ZY||this.Yr.uE(t)),this),this.ZY=!1,this.gE=t=>{if(this.$i||this.rn)return;const e=t-this.NY;if(e>=this.do||-1===this.do){this.ZY=!0,this.NY=t,this.OY=!1;const i=e>50?1e3/60:e;this.Kr&&this.Kr(i),this.Jr=!1,-1!==this.do&&this.OY&&(this.Yr.uE(this.OY),this.Jr=!0),this.ls.Ds(e),this.dn(),this.fn(),this.qr&&this.qr(),this.ZY=!1,this.D.emit("render"),this.Jr&&this.bs(this.OY)}else this.Jr=!0,this.Yr.uE()},this.QY=new Map,this.uO=()=>this.zL,this.JY=()=>{var t,e,i;const s=this.Bn(),r=this.GY,n=St.performance.now(),o=null===(t=this.KY)||void 0===t?void 0:t.qY.reduce(((t,e)=>t?e.tH&&t.tH&&e.tH>t.tH?e:t:e),void 0),h=null==o?void 0:o.tH,a=null===(e=this.Cn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.Vo)||void 0===i?void 0:i.timeStamp;return r?(this.bs(!0),!1):void 0===o||(void 0===o||!o.iH)&&(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.sH=()=>{var t,e;this.eH=void 0;const i=null===(e=null===(t=this.KY)||void 0===t?void 0:t.hH)||void 0===e?void 0:e.rH;void 0===i||i>=this.WY||this.nH()},this.fn=()=>{if(this.$i||this.rn)return this;const t=this.zL.gl,e=St.performance.now();this.zL.eV(t.FRAMEBUFFER,this.Yr.hE?this.QR[0]:null);const i=this.X,s=i.x>0&&i.y>0;if(this.ln.o&&this.zL.iz(this.ln._()),t.resize&&s&&t.resize(i.x*this.zL.sR(),i.y*this.zL.sR()),this.zL.hV(0,0,i.x*this.zL.sR(),i.y*this.zL.sR()),this.zL.rV(0,0,i.x*this.zL.sR(),i.y*this.zL.sR()),this.zL.Nt(),s)for(const t of this.jr.values())t.yL(0,1);if(this.En.lo&&s&&(this.eH&&(St.clearTimeout(this.eH),this.eH=void 0),this.JY()?(this.nH(),this.zL.eV(t.FRAMEBUFFER,this.Yr.hE?this.QR[0]:null)):this.eH=St.setTimeout(this.sH,500)),this.j(),this.Wr(),this.yn&&this.mn(this.yn),this.Yr.hE){const e=this.zL.gl2.ctx;e.bindFramebuffer(e.READ_FRAMEBUFFER,this.QR[0]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.QR[1]),e.clearBufferfv(e.COLOR,0,[1,1,1,1]),e.blitFramebuffer(0,0,this.X.x*this.zL.sR(),this.X.y*this.zL.sR(),0,0,this.X.x*this.zL.sR(),this.X.y*this.zL.sR(),t.COLOR_BUFFER_BIT,t.LINEAR)}else t.bindTexture(t.TEXTURE_2D,this.YR),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,this.X.x*this.zL.sR(),this.X.y*this.zL.sR(),0),t.bindTexture(t.TEXTURE_2D,null);return this.zL.eV(t.FRAMEBUFFER,null),this.Yr.uE(),this.GY=!1,this.WY=e,this},this.dn=()=>{const t=this.X;if(0===t.x||0===t.y)return this;this.Mo.q(t);for(const t of this.jr.values())t.Ds();return this.j(),this},this.oH=1,this.Yr=t,this.Yr.sE){this.aH=St.document.createElement("canvas"),this.aH.style.width="100%",this.aH.style.height="100%",this.aH.style.display="block",this.aH.style.boxSizing="content-box",this.aH.style.position="absolute";const t=this.aH.getContext("2d",{willReadFrequently:!1,alpha:!0,desynchronized:!1});if(!t)throw new gt("No Canvas context available.");this.HR=t,this.Rr.appendChild(this.aH)}this.Yr.yE(this);const n={preserveDrawingBuffer:!0,antialias:e?e.antialias:void 0,alpha:!0,lineAntialias:!e||(!0===e.lineAntiAlias||!1===e.lineAntiAlias?e.lineAntiAlias:!1!==e.antialias)};let o;if(this.Yr.hE&&t.gl2&&(o=new s(this,this.En,{type:"webgl2",ctx:t.gl2.ctx,antialias:n.antialias,lineAntialias:n.lineAntialias},this.qi.isDark)),o||this.Yr.hE||(o=new s(this,this.En,{type:"webgl1",ctx:t.gl,antialias:n.antialias,lineAntialias:n.lineAntialias},this.qi.isDark)),!o)throw new gt("No WebGL context available."+((null===(r=null==e?void 0:e.webgl)||void 0===r?void 0:r.version)?`\nSelected explicit target: ${e.webgl.version}`:""));this.zL=o;let h=1;if(e&&e.devicePixelRatio)h=!0===e.devicePixelRatio?St.devicePixelRatio||1:e.devicePixelRatio||1;else{const t=St.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(h=St.devicePixelRatio||1)}this.zL.Az(h);const a=e?e.width:void 0,l=e?e.height:void 0;this.vo=this.lH(a),this.bo=this.lH(l),this.uH(this.vo,this.bo),this._W=this.nI("engine offscreen",1e6),this.cH=this.nI("engine bg",0);const u="function"==typeof this.qi.lcjsBackgroundFillStyle?this.qi.lcjsBackgroundFillStyle(this.En.Xs):this.qi.lcjsBackgroundFillStyle;this.Mo=this.cH.Te(this.dt).ke(u).Ce(this.qi.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Ie({x:0,y:0});const d=this.nI("engine effects",200001)._U(this.qi.effect);this.es=d;const f=this.Yr.hE,g=this.oi();f&&(this.QR=[o.bV(),o.bV()]);const y=this.zL.gl;f&&(this.UY=y.createRenderbuffer(),this.YY=y.createRenderbuffer()),this.YR=y.createTexture();const m=g.x*this.zL.sR(),p=g.y*this.zL.sR();if(f){y.bindRenderbuffer(y.RENDERBUFFER,this.UY);const t=this.zL.gl2.ctx;this.HY=this.Yr.RR&&!1!==e.antialias?t.getParameter(t.MAX_SAMPLES):0,t.renderbufferStorageMultisample(t.RENDERBUFFER,this.HY,t.RGBA8,m,p),y.bindRenderbuffer(y.RENDERBUFFER,this.YY),y.renderbufferStorage(y.RENDERBUFFER,y.DEPTH_COMPONENT16,m,p),t.renderbufferStorageMultisample(t.RENDERBUFFER,this.HY,t.DEPTH_COMPONENT16,m,p)}f&&(this.zL.eV(y.FRAMEBUFFER,this.QR[0]),y.framebufferRenderbuffer(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.RENDERBUFFER,this.UY),y.framebufferRenderbuffer(y.FRAMEBUFFER,y.DEPTH_ATTACHMENT,y.RENDERBUFFER,this.YY)),y.bindTexture(y.TEXTURE_2D,this.YR),y.texImage2D(y.TEXTURE_2D,0,y.RGBA,m,p,0,y.RGBA,y.UNSIGNED_BYTE,null),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,y.LINEAR),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_S,y.CLAMP_TO_EDGE),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_T,y.CLAMP_TO_EDGE),f&&(this.zL.eV(y.FRAMEBUFFER,this.QR[1]),y.framebufferTexture2D(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.TEXTURE_2D,this.YR,0)),this.zL.eV(y.FRAMEBUFFER,null),this.nn(),this.Wr(),this.WA=Ar(this),this.UA={qi:this.qi,ls:this.ls,dt:this.dt,bs:t=>this.bs(t),Bn:()=>this.Bn(),WD:t=>this.WD(t),En:this.En,As:t=>this.As(t),es:this.es,$o:t=>this.$o(t),Xo:t=>this.Xo(t),kB:{CB:(t,e,i)=>this.zL.Eh(e.family).qL(t,e,i,this.qi.isDark)}};const A=()=>{this.W()};St.addEventListener("unload",A),this.tn.push((()=>{St.removeEventListener("unload",A)}))}get dH(){return this.jr}Hr(t,e){let i=this.QY.get(t);if(!i){const e=this.zL.vz(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.QY.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{UD:()=>e.RE,YD:t=>{e.RE?t():o.push(t)}}},this.QY.set(t,i),e.JL(this),e.WE((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new Qn(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}WD(t){const e=Array.from(this.QY.values()).find((e=>e.instances.has(t)));if(!e)throw fe(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}Sn(t,e){var i;const s=null===(i=this.KY)||void 0===i?void 0:i.hH;if(!s)return;const r=this.De(e.x,e.y),n=Math.round(r.x*this.zL.sR()),o=Math.round(r.y*this.zL.sR());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.fH(s,n+t[0]/s.AH,o+t[1]/s.AH))).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)}fH(t,e,i){const s=Math.round(e*t.AH),r=Math.round(i*t.AH);if(s<0||s>=t.X.x||r<0||r>=t.X.y)return;const n=4*(s+r*t.X.x),o=t.gH[n+0],h=t.gH[n+1],a=t.gH[n+2],l=t.gH[n+3];return void 0!==o&&void 0!==h&&void 0!==a&&void 0!==l?this.pH(o,h,a,l):void 0}Or(t,e,i){const s=this.zL.gl;this.Yr.hE?(this.zL.eV(s.FRAMEBUFFER,this.QR[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.YR,0)):this.zL.eV(s.FRAMEBUFFER,null);const r=this.UR(),n=r.x,o=r.y,h=new Uint8Array(n*o*4);this.Yr.hE||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.Yr.hE&&(this.zL.eV(s.FRAMEBUFFER,this.QR[0]),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,this.UY),this.zL.eV(s.FRAMEBUFFER,this.QR[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.YR,0)),this.zL.eV(s.FRAMEBUFFER,null);const c=l.toDataURL(t,e);return i?c:(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=St.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof Rm))throw new Error("Unexpected Engine Layer error");return i}return this.An(new Rm(this,e,t))}lI(t,e,i){const s=this.ko(e);if(s){if(fe(0,(()=>{})),!(s instanceof op))throw new Error("Unexpected Engine Layer error");return s}return this.An(new op(this,e,t,i))}oi(){return this.X}UR(){const t=this.zL.sR();return{x:Math.round(this.X.x*t),y:Math.round(this.X.y*t)}}lH(t){return t instanceof Array||(t=[t,t]),t}mH(){return this.Yr.$R}jY(){const t=this.zL.gl;return t&&"resize"in t}nH(){var t;const e=this.zL.gl,i=St.performance.now(),s=this.Bn(),r=this.En.ao,n={x:Math.ceil(this.X.x*this.zL.sR()*r),y:Math.ceil(this.X.y*this.zL.sR()*r)};this.KY||(this.KY={AH:r,yH:n,qY:[],hH:void 0});let o=this.KY.qY.find((t=>!t.iH)),h=!1;o||(h=!0,o={iH:!1,X:n,Bz:e.createTexture(),SH:this.zL.bV(),YY:this.zL.MV(),vH:new Uint8Array,tH:void 0},this.KY.qY.push(o));const a=o;(h||a.X.x!==n.x||a.X.y!==n.y)&&(e.bindTexture(e.TEXTURE_2D,a.Bz),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.zL.eV(e.FRAMEBUFFER,a.SH),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a.Bz,0),e.bindRenderbuffer(e.RENDERBUFFER,a.YY),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.x,n.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,a.YY),a.vH=new Uint8Array(n.x*n.y*4),a.X=n),a.iH=!0,a.tH=i,this.zL.eV(e.FRAMEBUFFER,a.SH),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.zL.hV(0,0,n.x,n.y);for(const t of this.jr.values())t.yL(1,r);this.zL.eV(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.zL.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.KY){const t=this.KY.hH;if(t&&t.rH>i)return;this.KY.hH={rH:i,AH:r,X:n,gH:a.vH,xH:s}}};l?this.zL.Iz(l,a.SH,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.vH).then((()=>{this.$i||(a.iH=!1,u())})).catch((t=>{this.$i||(a.iH=!1,St.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.zL.Pz(a.SH,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.vH),a.iH=!1,u())}nn(t){const e=this.X.x,i=this.X.y,s=t||{x:this.Rr.offsetWidth,y:this.Rr.offsetHeight};if(0!==s.x&&0!==s.y&&(s.x!==e||s.y!==i)){this.X=s,this.dt.x.J(0,s.x).q(s.x),this.dt.y.J(0,s.y).q(s.y);const t=s.x*this.zL.sR(),e=s.y*this.zL.sR(),i=this.zL.gl;this.Yr.sE&&this.HR&&(this.HR.canvas.width=t,this.HR.canvas.height=e);const r=this.Yr.hE;if(this.YR&&(i.bindTexture(i.TEXTURE_2D,this.YR),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null)),r){const s=this.zL.gl2.ctx;this.UY&&(i.bindRenderbuffer(i.RENDERBUFFER,this.UY),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.HY,s.RGBA8,t,e)),this.YY&&(i.bindRenderbuffer(i.RENDERBUFFER,this.YY),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_COMPONENT16,t,e),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.HY,s.DEPTH_COMPONENT16,t,e))}i.bindRenderbuffer(i.RENDERBUFFER,null),this.D.emit("resize",[this.X.x,this.X.y])}}W(){var t;super.W(),this.eH&&(St.clearTimeout(this.eH),this.eH=void 0),Array.from(this.zL.wR.entries()).forEach((([t,e])=>{e.GL(!1),this.zL.wR.delete(t)})),Array.from(this.zL.kV.values()).forEach((t=>{t.unbindResources()})),this.zL.kV.clear(),this.zL.CV.IE(),this.zL.uz.W(),this.zL.SV(this.zL.cz),this.zL.SV(this.zL.dz),this.zL.nz.forEach(((t,e)=>{this.zL.gl.deleteBuffer(e)})),this.zL.nz.clear(),this.zL.wz&&(this.zL.SV(this.zL.wz.buffer),this.zL.wz=void 0),this.zL.wV(this.QR[0]),this.zL.wV(this.QR[1]),this.zL._V(this.UY),this.zL.WL(this.YR),this.zL._V(this.YY),this.KY&&(this.KY.qY.forEach((t=>{this.zL._V(t.YY),this.zL.wV(t.SH),this.zL.WL(t.Bz)})),this.KY=void 0),this.zL.ez.forEach((t=>this.zL.SV(t))),this.QY.clear(),this.Yr.vE(this),this.aH&&(null===(t=this.aH.parentElement)||void 0===t||t.removeChild(this.aH),this.aH=void 0),this.HR&&(this.HR=void 0),this.zL.gl=void 0}bU(){const t=this.oH;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.oH=1),this.oH+=1,t}MU(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,T(i,s,r,e)}pH(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.dH.values()){const e=t.xU(r);if(e)return{entity:e.entity,collectionMember:e.collectionMember,entityIndex:e.index,layerIndex:t.gn()}}}}var ap="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},lp={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.GE(t||0,e||10,i||"be"))}var n;"object"==typeof lp?lp.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.GE=function(t,e,s){if("number"==typeof t)return this.bH(t,e,s);if("object"==typeof t)return this.MH(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._H(t,r):this.wH(t,e,r),"-"===t[0]&&(this.negative=1),this.CH(),"le"===s&&this.MH(this.toArray(),e,s)},r.prototype.bH=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.MH(this.toArray(),e,s)},r.prototype.MH=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.CH()},r.prototype._H=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.CH()},r.prototype.wH=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.IH()},r.prototype.IH=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.CH()}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.CH();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.PH=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.BH=function(t){return 32-Math.clz32(t)}:r.prototype.BH=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.LH=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this.BH(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.FH(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.CH()},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.FH(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.IH()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.IH();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,A=m>>>13,x=0|o[3],S=8191&x,b=x>>>13,v=0|o[4],M=8191&v,T=v>>>13,w=0|o[5],E=8191&w,k=w>>>13,C=0|o[6],D=8191&C,F=C>>>13,I=0|o[7],L=8191&I,z=I>>>13,V=0|o[8],P=8191&V,R=V>>>13,B=0|o[9],_=8191&B,O=B>>>13,N=0|h[0],U=8191&N,G=N>>>13,W=0|h[1],Y=8191&W,H=W>>>13,X=0|h[2],$=8191&X,j=X>>>13,q=0|h[3],J=8191&q,Z=q>>>13,K=0|h[4],Q=8191&K,tt=K>>>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,G))+Math.imul(d,U)|0))<<13)|0;l=((n=Math.imul(d,G))+(r>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(g,U),r=(r=Math.imul(g,G))+Math.imul(y,U)|0,n=Math.imul(y,G);var pt=(l+(s=s+Math.imul(c,Y)|0)|0)+((8191&(r=(r=r+Math.imul(c,H)|0)+Math.imul(d,Y)|0))<<13)|0;l=((n=n+Math.imul(d,H)|0)+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(p,U),r=(r=Math.imul(p,G))+Math.imul(A,U)|0,n=Math.imul(A,G),s=s+Math.imul(g,Y)|0,r=(r=r+Math.imul(g,H)|0)+Math.imul(y,Y)|0,n=n+Math.imul(y,H)|0;var At=(l+(s=s+Math.imul(c,$)|0)|0)+((8191&(r=(r=r+Math.imul(c,j)|0)+Math.imul(d,$)|0))<<13)|0;l=((n=n+Math.imul(d,j)|0)+(r>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(S,U),r=(r=Math.imul(S,G))+Math.imul(b,U)|0,n=Math.imul(b,G),s=s+Math.imul(p,Y)|0,r=(r=r+Math.imul(p,H)|0)+Math.imul(A,Y)|0,n=n+Math.imul(A,H)|0,s=s+Math.imul(g,$)|0,r=(r=r+Math.imul(g,j)|0)+Math.imul(y,$)|0,n=n+Math.imul(y,j)|0;var xt=(l+(s=s+Math.imul(c,J)|0)|0)+((8191&(r=(r=r+Math.imul(c,Z)|0)+Math.imul(d,J)|0))<<13)|0;l=((n=n+Math.imul(d,Z)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(M,U),r=(r=Math.imul(M,G))+Math.imul(T,U)|0,n=Math.imul(T,G),s=s+Math.imul(S,Y)|0,r=(r=r+Math.imul(S,H)|0)+Math.imul(b,Y)|0,n=n+Math.imul(b,H)|0,s=s+Math.imul(p,$)|0,r=(r=r+Math.imul(p,j)|0)+Math.imul(A,$)|0,n=n+Math.imul(A,j)|0,s=s+Math.imul(g,J)|0,r=(r=r+Math.imul(g,Z)|0)+Math.imul(y,J)|0,n=n+Math.imul(y,Z)|0;var St=(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)+(St>>>26)|0,St&=67108863,s=Math.imul(E,U),r=(r=Math.imul(E,G))+Math.imul(k,U)|0,n=Math.imul(k,G),s=s+Math.imul(M,Y)|0,r=(r=r+Math.imul(M,H)|0)+Math.imul(T,Y)|0,n=n+Math.imul(T,H)|0,s=s+Math.imul(S,$)|0,r=(r=r+Math.imul(S,j)|0)+Math.imul(b,$)|0,n=n+Math.imul(b,j)|0,s=s+Math.imul(p,J)|0,r=(r=r+Math.imul(p,Z)|0)+Math.imul(A,J)|0,n=n+Math.imul(A,Z)|0,s=s+Math.imul(g,Q)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,n=n+Math.imul(y,tt)|0;var bt=(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)+(bt>>>26)|0,bt&=67108863,s=Math.imul(D,U),r=(r=Math.imul(D,G))+Math.imul(F,U)|0,n=Math.imul(F,G),s=s+Math.imul(E,Y)|0,r=(r=r+Math.imul(E,H)|0)+Math.imul(k,Y)|0,n=n+Math.imul(k,H)|0,s=s+Math.imul(M,$)|0,r=(r=r+Math.imul(M,j)|0)+Math.imul(T,$)|0,n=n+Math.imul(T,j)|0,s=s+Math.imul(S,J)|0,r=(r=r+Math.imul(S,Z)|0)+Math.imul(b,J)|0,n=n+Math.imul(b,Z)|0,s=s+Math.imul(p,Q)|0,r=(r=r+Math.imul(p,tt)|0)+Math.imul(A,Q)|0,n=n+Math.imul(A,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 vt=(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)+(vt>>>26)|0,vt&=67108863,s=Math.imul(L,U),r=(r=Math.imul(L,G))+Math.imul(z,U)|0,n=Math.imul(z,G),s=s+Math.imul(D,Y)|0,r=(r=r+Math.imul(D,H)|0)+Math.imul(F,Y)|0,n=n+Math.imul(F,H)|0,s=s+Math.imul(E,$)|0,r=(r=r+Math.imul(E,j)|0)+Math.imul(k,$)|0,n=n+Math.imul(k,j)|0,s=s+Math.imul(M,J)|0,r=(r=r+Math.imul(M,Z)|0)+Math.imul(T,J)|0,n=n+Math.imul(T,Z)|0,s=s+Math.imul(S,Q)|0,r=(r=r+Math.imul(S,tt)|0)+Math.imul(b,Q)|0,n=n+Math.imul(b,tt)|0,s=s+Math.imul(p,it)|0,r=(r=r+Math.imul(p,st)|0)+Math.imul(A,it)|0,n=n+Math.imul(A,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(P,U),r=(r=Math.imul(P,G))+Math.imul(R,U)|0,n=Math.imul(R,G),s=s+Math.imul(L,Y)|0,r=(r=r+Math.imul(L,H)|0)+Math.imul(z,Y)|0,n=n+Math.imul(z,H)|0,s=s+Math.imul(D,$)|0,r=(r=r+Math.imul(D,j)|0)+Math.imul(F,$)|0,n=n+Math.imul(F,j)|0,s=s+Math.imul(E,J)|0,r=(r=r+Math.imul(E,Z)|0)+Math.imul(k,J)|0,n=n+Math.imul(k,Z)|0,s=s+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,tt)|0)+Math.imul(T,Q)|0,n=n+Math.imul(T,tt)|0,s=s+Math.imul(S,it)|0,r=(r=r+Math.imul(S,st)|0)+Math.imul(b,it)|0,n=n+Math.imul(b,st)|0,s=s+Math.imul(p,nt)|0,r=(r=r+Math.imul(p,ot)|0)+Math.imul(A,nt)|0,n=n+Math.imul(A,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 Tt=(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)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(_,U),r=(r=Math.imul(_,G))+Math.imul(O,U)|0,n=Math.imul(O,G),s=s+Math.imul(P,Y)|0,r=(r=r+Math.imul(P,H)|0)+Math.imul(R,Y)|0,n=n+Math.imul(R,H)|0,s=s+Math.imul(L,$)|0,r=(r=r+Math.imul(L,j)|0)+Math.imul(z,$)|0,n=n+Math.imul(z,j)|0,s=s+Math.imul(D,J)|0,r=(r=r+Math.imul(D,Z)|0)+Math.imul(F,J)|0,n=n+Math.imul(F,Z)|0,s=s+Math.imul(E,Q)|0,r=(r=r+Math.imul(E,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(T,it)|0,n=n+Math.imul(T,st)|0,s=s+Math.imul(S,nt)|0,r=(r=r+Math.imul(S,ot)|0)+Math.imul(b,nt)|0,n=n+Math.imul(b,ot)|0,s=s+Math.imul(p,at)|0,r=(r=r+Math.imul(p,lt)|0)+Math.imul(A,at)|0,n=n+Math.imul(A,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 wt=(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)+(wt>>>26)|0,wt&=67108863,s=Math.imul(_,Y),r=(r=Math.imul(_,H))+Math.imul(O,Y)|0,n=Math.imul(O,H),s=s+Math.imul(P,$)|0,r=(r=r+Math.imul(P,j)|0)+Math.imul(R,$)|0,n=n+Math.imul(R,j)|0,s=s+Math.imul(L,J)|0,r=(r=r+Math.imul(L,Z)|0)+Math.imul(z,J)|0,n=n+Math.imul(z,Z)|0,s=s+Math.imul(D,Q)|0,r=(r=r+Math.imul(D,tt)|0)+Math.imul(F,Q)|0,n=n+Math.imul(F,tt)|0,s=s+Math.imul(E,it)|0,r=(r=r+Math.imul(E,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(T,nt)|0,n=n+Math.imul(T,ot)|0,s=s+Math.imul(S,at)|0,r=(r=r+Math.imul(S,lt)|0)+Math.imul(b,at)|0,n=n+Math.imul(b,lt)|0,s=s+Math.imul(p,ct)|0,r=(r=r+Math.imul(p,dt)|0)+Math.imul(A,ct)|0,n=n+Math.imul(A,dt)|0;var Et=(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)+(Et>>>26)|0,Et&=67108863,s=Math.imul(_,$),r=(r=Math.imul(_,j))+Math.imul(O,$)|0,n=Math.imul(O,j),s=s+Math.imul(P,J)|0,r=(r=r+Math.imul(P,Z)|0)+Math.imul(R,J)|0,n=n+Math.imul(R,Z)|0,s=s+Math.imul(L,Q)|0,r=(r=r+Math.imul(L,tt)|0)+Math.imul(z,Q)|0,n=n+Math.imul(z,tt)|0,s=s+Math.imul(D,it)|0,r=(r=r+Math.imul(D,st)|0)+Math.imul(F,it)|0,n=n+Math.imul(F,st)|0,s=s+Math.imul(E,nt)|0,r=(r=r+Math.imul(E,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(T,at)|0,n=n+Math.imul(T,lt)|0,s=s+Math.imul(S,ct)|0,r=(r=r+Math.imul(S,dt)|0)+Math.imul(b,ct)|0,n=n+Math.imul(b,dt)|0;var kt=(l+(s=s+Math.imul(p,gt)|0)|0)+((8191&(r=(r=r+Math.imul(p,yt)|0)+Math.imul(A,gt)|0))<<13)|0;l=((n=n+Math.imul(A,yt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(_,J),r=(r=Math.imul(_,Z))+Math.imul(O,J)|0,n=Math.imul(O,Z),s=s+Math.imul(P,Q)|0,r=(r=r+Math.imul(P,tt)|0)+Math.imul(R,Q)|0,n=n+Math.imul(R,tt)|0,s=s+Math.imul(L,it)|0,r=(r=r+Math.imul(L,st)|0)+Math.imul(z,it)|0,n=n+Math.imul(z,st)|0,s=s+Math.imul(D,nt)|0,r=(r=r+Math.imul(D,ot)|0)+Math.imul(F,nt)|0,n=n+Math.imul(F,ot)|0,s=s+Math.imul(E,at)|0,r=(r=r+Math.imul(E,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(T,ct)|0,n=n+Math.imul(T,dt)|0;var Ct=(l+(s=s+Math.imul(S,gt)|0)|0)+((8191&(r=(r=r+Math.imul(S,yt)|0)+Math.imul(b,gt)|0))<<13)|0;l=((n=n+Math.imul(b,yt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(_,Q),r=(r=Math.imul(_,tt))+Math.imul(O,Q)|0,n=Math.imul(O,tt),s=s+Math.imul(P,it)|0,r=(r=r+Math.imul(P,st)|0)+Math.imul(R,it)|0,n=n+Math.imul(R,st)|0,s=s+Math.imul(L,nt)|0,r=(r=r+Math.imul(L,ot)|0)+Math.imul(z,nt)|0,n=n+Math.imul(z,ot)|0,s=s+Math.imul(D,at)|0,r=(r=r+Math.imul(D,lt)|0)+Math.imul(F,at)|0,n=n+Math.imul(F,lt)|0,s=s+Math.imul(E,ct)|0,r=(r=r+Math.imul(E,dt)|0)+Math.imul(k,ct)|0,n=n+Math.imul(k,dt)|0;var Dt=(l+(s=s+Math.imul(M,gt)|0)|0)+((8191&(r=(r=r+Math.imul(M,yt)|0)+Math.imul(T,gt)|0))<<13)|0;l=((n=n+Math.imul(T,yt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,s=Math.imul(_,it),r=(r=Math.imul(_,st))+Math.imul(O,it)|0,n=Math.imul(O,st),s=s+Math.imul(P,nt)|0,r=(r=r+Math.imul(P,ot)|0)+Math.imul(R,nt)|0,n=n+Math.imul(R,ot)|0,s=s+Math.imul(L,at)|0,r=(r=r+Math.imul(L,lt)|0)+Math.imul(z,at)|0,n=n+Math.imul(z,lt)|0,s=s+Math.imul(D,ct)|0,r=(r=r+Math.imul(D,dt)|0)+Math.imul(F,ct)|0,n=n+Math.imul(F,dt)|0;var Ft=(l+(s=s+Math.imul(E,gt)|0)|0)+((8191&(r=(r=r+Math.imul(E,yt)|0)+Math.imul(k,gt)|0))<<13)|0;l=((n=n+Math.imul(k,yt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(_,nt),r=(r=Math.imul(_,ot))+Math.imul(O,nt)|0,n=Math.imul(O,ot),s=s+Math.imul(P,at)|0,r=(r=r+Math.imul(P,lt)|0)+Math.imul(R,at)|0,n=n+Math.imul(R,lt)|0,s=s+Math.imul(L,ct)|0,r=(r=r+Math.imul(L,dt)|0)+Math.imul(z,ct)|0,n=n+Math.imul(z,dt)|0;var It=(l+(s=s+Math.imul(D,gt)|0)|0)+((8191&(r=(r=r+Math.imul(D,yt)|0)+Math.imul(F,gt)|0))<<13)|0;l=((n=n+Math.imul(F,yt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(_,at),r=(r=Math.imul(_,lt))+Math.imul(O,at)|0,n=Math.imul(O,lt),s=s+Math.imul(P,ct)|0,r=(r=r+Math.imul(P,dt)|0)+Math.imul(R,ct)|0,n=n+Math.imul(R,dt)|0;var Lt=(l+(s=s+Math.imul(L,gt)|0)|0)+((8191&(r=(r=r+Math.imul(L,yt)|0)+Math.imul(z,gt)|0))<<13)|0;l=((n=n+Math.imul(z,yt)|0)+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,s=Math.imul(_,ct),r=(r=Math.imul(_,dt))+Math.imul(O,ct)|0,n=Math.imul(O,dt);var zt=(l+(s=s+Math.imul(P,gt)|0)|0)+((8191&(r=(r=r+Math.imul(P,yt)|0)+Math.imul(R,gt)|0))<<13)|0;l=((n=n+Math.imul(R,yt)|0)+(r>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Vt=(l+(s=Math.imul(_,gt))|0)+((8191&(r=(r=Math.imul(_,yt))+Math.imul(O,gt)|0))<<13)|0;return l=((n=Math.imul(O,yt))+(r>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,a[0]=mt,a[1]=pt,a[2]=At,a[3]=xt,a[4]=St,a[5]=bt,a[6]=vt,a[7]=Mt,a[8]=Tt,a[9]=wt,a[10]=Et,a[11]=kt,a[12]=Ct,a[13]=Dt,a[14]=Ft,a[15]=It,a[16]=Lt,a[17]=zt,a[18]=Vt,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.CH()}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.CH()},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.CH();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.CH()},r.prototype.EH=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.BH(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.RH(n,d,c);0!==s.negative;)d--,s.negative=0,s.RH(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.CH(),s.CH(),"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}):0!=(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.EH(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.CH(),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;0==(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;0==(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.VH=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;0==(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;0==(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 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(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.CH(),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).zH(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.zH=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.zH(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.OH(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.OH(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.NH(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.NH(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.NH(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.NH(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.NH(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.NH(this),this.red.pow(this,t)};var p={k256:null,p224:null,p192:null,p25519:null};function A(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.GH()}function x(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function v(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=r.WH(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 T(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.VH(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)}A.prototype.GH=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},A.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.CH(),i},A.prototype.split=function(t,e){t.iushrn(this.n,0,e)},A.prototype.imulK=function(t){return t.imul(this.k)},s(x,A),x.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},x.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.WH=function(t){if(p[t])return p[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new S;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new v}return p[t]=e,e},M.prototype.NH=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype.OH=function(t,e){i(0==(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).zH(this):(a(t,t.umod(this.m).zH(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).zH(this)},M.prototype.add=function(t,e){this.OH(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.zH(this)},M.prototype.iadd=function(t,e){this.OH(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.OH(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.zH(this)},M.prototype.isub=function(t,e){this.OH(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.NH(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this.OH(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this.OH(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 T(t)},s(T,M),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.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.zH(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).zH(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.zH(this)},T.prototype.invm=function(t){return this.imod(t.VH(this.m).mul(this.r2)).zH(this)}}(0,ap);var up=lp.exports;function cp(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 dp=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},fp=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),0==(1&h))n=0;else{const e=t.andln(7)+s&7;n=3!==e&&5!==e||2!==a?h:-h}if(i[0].push(n),0==(1&a))o=0;else{const t=e.andln(7)+r&7;o=3!==t&&5!==t||2!==h?a:-a}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 gp{constructor(t,e){this.type=t,this.p=new up(e.p,16),this.red=e.prime?up.red(e.prime):up.mont(this.p),this.zero=new up(0).toRed(this.red),this.one=new up(1).toRed(this.red),this.two=new up(2).toRed(this.red),this.n=e.n&&new up(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.UH=new Array(4),this.YH=new Array(4),this.HH=new Array(4),this.$H=new Array(4),this.XH=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.jH=!0,this.redN=this.n.toRed(this.red))}ZH(t,e){const i=t.QH(),s=dp(e,1,this.XH);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}qH(t,e,i,s,r){const n=this.UH,o=this.YH,h=this.HH;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]=dp(i[s],n[s],this.XH),h[r]=dp(i[r],n[r],this.XH),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=fp(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)}QH(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 up(t.a,16),b:new up(t.b,16)}))):this.o$(i),{beta:e,lambda:i,basis:s}}n$(t){const e=t===this.p?this.red:up.mont(t),i=new up(2).toRed(e).redInvm(),s=i.redNeg(),r=new up(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}o$(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 up(1),g=new up(0),y=new up(0),m=new up(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 A=r.sqr().add(n.sqr());return o.sqr().add(h.sqr()).cmp(A)>=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}]}a$(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 pp(this,t,e,i)}pointFromX(t,e){(t=new up(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)}l$(t,e,i){const s=this.h$,r=this.r$;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 up(t,16),this.isInfinity()?this:this.s$(t)?this.curve.ZH(this,t):this.curve.endo?this.curve.l$([this],[t]):this.curve.JH(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.l$(s,r):this.curve.qH(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.l$(s,r,!0):this.curve.qH(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 Ap extends yp{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 up(0)):(this.x=new up(e,16),this.y=new up(i,16),this.z=new up(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 Ap(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 xp{constructor(t){this.curve=new mp(t),this.g=this.curve.g,this.n=this.curve.n}}const Sp={};var bp;Sp.PresetCurve=xp,bp={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(Sp,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new xp(bp);return Object.defineProperty(Sp,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class vp{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.f$(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof vp?e:new vp(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}f$(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 Mp(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 wp{constructor(t,e){if(t instanceof wp)return t;this.A$(t,e)||(this.r=new up(t.r,16),this.s=new up(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}A$(t,e){t=cp(t,e);const i=new Tp;if(48!==t[i.place++])return!1;const s=Mp(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=Mp(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=Mp(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 up(n),this.s=new up(h),this.recoveryParam=null,!0}}class Ep{constructor(t){if(!(this instanceof Ep))return new Ep(t);"string"==typeof t&&(t=Sp[t]),t instanceof Sp.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 vp.fromPublic(this,t,e)}g$(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.g$(new up(t,16)),i=this.keyFromPublic(i,s);const r=(e=new wp(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.jH){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,Cp={exports:{}};Cp.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!==ap&&ap.crypto&&(i=ap.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.mk=new a.init,this.p$=0},m$:function(t){"string"==typeof t&&(t=d.parse(t)),this.mk.concat(t),this.p$+=t.sigBytes},y$:function(e){var i,s=this.mk,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this.S$,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 A=s&r^s&n^r&n,x=(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+(x+A)|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},b$:function(){var t=this.mk,i=t.words,s=8*this.p$,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.y$(),this.w$},clone:function(){var t=n.clone.call(this);return t.w$=this.w$.clone(),t}});i.SHA256=n.M$(u),i.HmacSHA256=n._$(u)}(Math),t.SHA256}(Cp.exports),zp={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({x$:function(){this.w$=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},b$:function(){var t=r.b$.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.M$(n),e.HmacSHA224=r._$(n),t.SHA224;var e,i,s,r,n}(Cp.exports),Vp={exports:{}}.exports=Cp.exports.enc.Hex,Pp={exports:{}}.exports=Cp.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.C$;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.C$,r=this.k$;if(!r){r=this.k$=[];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)},C$:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(Cp.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({x$:function(){this.w$=new r.init([1732584193,4023233417,2562383102,271733878])},v$: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.w$.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],A=t[e+7],x=t[e+8],S=t[e+9],b=t[e+10],v=t[e+11],M=t[e+12],T=t[e+13],w=t[e+14],E=t[e+15],k=n[0],C=n[1],D=n[2],F=n[3];k=l(k,C,D,F,o,7,h[0]),F=l(F,k,C,D,a,12,h[1]),D=l(D,F,k,C,f,17,h[2]),C=l(C,D,F,k,g,22,h[3]),k=l(k,C,D,F,y,7,h[4]),F=l(F,k,C,D,m,12,h[5]),D=l(D,F,k,C,p,17,h[6]),C=l(C,D,F,k,A,22,h[7]),k=l(k,C,D,F,x,7,h[8]),F=l(F,k,C,D,S,12,h[9]),D=l(D,F,k,C,b,17,h[10]),C=l(C,D,F,k,v,22,h[11]),k=l(k,C,D,F,M,7,h[12]),F=l(F,k,C,D,T,12,h[13]),D=l(D,F,k,C,w,17,h[14]),k=u(k,C=l(C,D,F,k,E,22,h[15]),D,F,a,5,h[16]),F=u(F,k,C,D,p,9,h[17]),D=u(D,F,k,C,v,14,h[18]),C=u(C,D,F,k,o,20,h[19]),k=u(k,C,D,F,m,5,h[20]),F=u(F,k,C,D,b,9,h[21]),D=u(D,F,k,C,E,14,h[22]),C=u(C,D,F,k,y,20,h[23]),k=u(k,C,D,F,S,5,h[24]),F=u(F,k,C,D,w,9,h[25]),D=u(D,F,k,C,g,14,h[26]),C=u(C,D,F,k,x,20,h[27]),k=u(k,C,D,F,T,5,h[28]),F=u(F,k,C,D,f,9,h[29]),D=u(D,F,k,C,A,14,h[30]),k=c(k,C=u(C,D,F,k,M,20,h[31]),D,F,m,4,h[32]),F=c(F,k,C,D,x,11,h[33]),D=c(D,F,k,C,v,16,h[34]),C=c(C,D,F,k,w,23,h[35]),k=c(k,C,D,F,a,4,h[36]),F=c(F,k,C,D,y,11,h[37]),D=c(D,F,k,C,A,16,h[38]),C=c(C,D,F,k,b,23,h[39]),k=c(k,C,D,F,T,4,h[40]),F=c(F,k,C,D,o,11,h[41]),D=c(D,F,k,C,g,16,h[42]),C=c(C,D,F,k,p,23,h[43]),k=c(k,C,D,F,S,4,h[44]),F=c(F,k,C,D,M,11,h[45]),D=c(D,F,k,C,E,16,h[46]),k=d(k,C=c(C,D,F,k,f,23,h[47]),D,F,o,6,h[48]),F=d(F,k,C,D,A,10,h[49]),D=d(D,F,k,C,w,15,h[50]),C=d(C,D,F,k,m,21,h[51]),k=d(k,C,D,F,M,6,h[52]),F=d(F,k,C,D,g,10,h[53]),D=d(D,F,k,C,b,15,h[54]),C=d(C,D,F,k,a,21,h[55]),k=d(k,C,D,F,x,6,h[56]),F=d(F,k,C,D,E,10,h[57]),D=d(D,F,k,C,p,15,h[58]),C=d(C,D,F,k,T,21,h[59]),k=d(k,C,D,F,y,6,h[60]),F=d(F,k,C,D,v,10,h[61]),D=d(D,F,k,C,f,15,h[62]),C=d(C,D,F,k,S,21,h[63]),n[0]=n[0]+k|0,n[1]=n[1]+C|0,n[2]=n[2]+D|0,n[3]=n[3]+F|0},b$:function(){var t=this.mk,i=t.words,s=8*this.p$,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.y$();for(var h=this.w$,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.w$=this.w$.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.M$(a),i.HmacMD5=n._$(a)})(Math),t.MD5}(Cp.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({x$:function(){this.w$=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},v$:function(t,e){for(var i=this.w$.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},b$:function(){var t=this.mk,e=t.words,i=8*this.p$,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.y$(),this.w$},clone:function(){var t=r.clone.call(this);return t.w$=this.w$.clone(),t}}),e.SHA1=r.M$(h),e.HmacSHA1=r._$(h),t.SHA1;var e,i,s,r,n,o,h}(Cp.exports),Fp=(Dp=Cp.exports).lib.Base,Ip=Dp.enc.Utf8,Dp.algo.HMAC=Fp.extend({init:function(t,e){t=this.T$=new t.init,"string"==typeof e&&(e=Ip.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.F$=e.clone(),n=this.I$=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.B$==this.P$?t=s.createEncryptor:(t=s.createDecryptor,this.S$=1),this.z$&&this.z$.O$==t?this.z$.init(this,i&&i.words):(this.z$=t.call(s,this,i&&i.words),this.z$.O$=t)},v$:function(t,e){this.z$.processBlock(t,e)},b$:function(){var t,e=this.cfg.padding;return this.B$==this.P$?(e.pad(this.mk,this.blockSize),t=this.y$(!0)):(t=this.y$(!0),e.unpad(t)),t},blockSize:4});var y=s.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),m=(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),y.create({ciphertext:i,salt:e})}},p=s.SerializableCipher=r.extend({cfg:r.extend({format:m}),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 y.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.N$(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},N$:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),A=(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,y.create({key:r,iv:o,salt:s})}},x=s.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:A}),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.N$(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)}})}()}(Cp.exports);var Rp={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],A=257*t[g]^16843008*g;o[i]=A<<24|A>>>8,h[i]=A<<16|A>>>16,a[i]=A<<8|A>>>24,l[i]=A,A=16843009*p^65537*m^257*y^16843008*i,u[g]=A<<24|A>>>8,c[g]=A<<16|A>>>16,d[g]=A<<8|A>>>24,f[g]=A,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({x$:function(){if(!this.G$||this.W$!==this.L$){for(var t=this.W$=this.L$,e=t.words,i=t.sigBytes/4,s=4*((this.G$=i+6)+1),n=this.U$=[],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.Y$=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.H$(t,e,this.U$,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.H$(t,e,this.Y$,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},H$:function(t,e,i,s,r,n,o,h){for(var a=this.G$,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++],A=s[d>>>24]^r[l>>>16&255]^n[u>>>8&255]^o[255&c]^i[f++];l=y,u=m,c=p,d=A}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++],A=(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]=A},keySize:8});e.AES=i.M$(y)}(),t.AES}(Cp.exports),Bp={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.R$,s=i.blockSize,r=this.E$,n=this.$$;r&&(n=this.$$=r.slice(0),this.E$=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}(Cp.exports),Op={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(Cp.exports);const Np={"-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=="],1:["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2FuZGJveA=="]},Up=St,Gp=(...t)=>t.slice(1).reduce(((e,i)=>e+Up.atob(Np[t[0]][i].toString())),"");let Wp,Yp,Hp,Xp=new Uint8Array([]);class $p{set e(t){Wp=t}get e(){Yp={Vn:!1,zn:!1,On:!1,Nn:!1,Gn:!1,Wn:!1,Un:!1,Yn:!1,Hn:!1,$n:!1,Xn:!1,jn:!1,Zn:!1,Qn:!1,Jn:!1,Kn:!1,qn:!1,io:!1,so:!1,eo:!1,ho:!1,ro:!1};const t=Xp.length,e=t>=1?Xp[0]:void 0,i=t>=2?Xp[1]:void 0,s=t>=3?Xp[2]:void 0;return void 0!==e&&(Yp.Vn=!!(1&e),Yp.zn=!!(2&e),Yp.On=!!(4&e),Yp.Nn=!!(8&e),Yp.Gn=!!(16&e),Yp.Wn=!!(32&e),Yp.Un=!!(64&e),Yp.Yn=!!(128&e)),void 0!==i&&(Yp.Hn=!!(1&i),Yp.$n=!!(2&i),Yp.Xn=!!(4&i),Yp.jn=!!(8&i),Yp.Zn=!!(16&i),Yp.Qn=!!(32&i),Yp.Jn=!!(64&i),Yp.Kn=!!(128&i)),void 0!==s&&(Yp.qn=!!(1&s),Yp.io=!!(2&s),Yp.so=!!(4&s),Yp.eo=!!(8&s),Yp.ho=!!(16&s),Yp.ro=!!(32&s)),Yp.Wn}set l(t){Hp=t}get l(){return Hp}}let jp=!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")}`},Zp=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),Kp=t=>{const e={},i=t.split("-");if(3!==i.length)return{X$:Gp(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 eA(d,f)?e:{X$:Gp(0,0,1,7,1,12,5)}},Qp=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(-1^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(Zp(h)s[e]===t)))return{};break}case"0002":return Kp(t);default:return{X$:Gp(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}return{X$:Gp(0,0,1,2,1,7,1,12,5)}},tA=t=>{if(!t)return{X$:Gp(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5)};const e=(t[Gp(-1,9)]||t[Gp(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(Up[Gp(-1,6)][Gp(-1,7)])>-1)return{J$:!0};const i=e.filter((t=>t.indexOf("*")>-1));if(oA(Up[Gp(-1,6)][Gp(-1,7)],i))return{J$:!0};const s=t[Gp(-1,8)]||t[Gp(-1,38)];if(""!==s&&null!=s){if(oA(Up[Gp(-1,6)][Gp(-1,7)],[s]))return{J$:!1};if(s===Up[Gp(-1,6)][Gp(-1,7)])return{J$:!1}}return{X$:Gp(0,14,1,20,5)}},eA=(t,e)=>{const i=new Ep("secp256k1").keyFromPublic(Gp(-4,0),"hex"),s=zp(t).toString();return i.verify(s,e)},iA=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(!eA(r,n))return{X$:Gp(0,21,1,2,1,7,1,12,5)};const o=Vp.parse(r);i=Rp.decrypt({ciphertext:Vp.parse(s)},o,{mode:Bp,padding:Op,iv:Vp.parse("00000000000000000000000000000001")}).toString(Pp)}catch(t){return{X$:Gp(0,21,1,2,1,7,1,12,5)}}try{e=JSON.parse(i)}catch(t){return{X$:Gp(0,21,1,2,1,7,1,12,5)}}if(void 0===e[Gp(-1,5)]||null===e[Gp(-1,4)]||!e[Gp(-1,9)])return{X$:Gp(0,21,1,2,1,7,1,12,5)};const s=parseInt(Gp(-3,0),10)||Number(parseInt(Gp(-3,0),10));return e[Gp(-1,5)]{const e=Kp(t),i=e.j$,s=e.Q$;if(e.X$||void 0===i||void 0===s)return e;let r,n="";try{const t=i.slice(e.Q$,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{X$:Gp(0,39,1,40,1,41,5)};const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!eA(`${s}-${r}`,n))return{X$:Gp(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(Gp(-3,0),10)||Number(parseInt(Gp(-3,0),10))))return{X$:Gp(0,21,1,2,1,3,1,4,5)};const a=Int32Array.from(qp(s,8)),l=Lp(e[Gp(-1,31)]).toString(Vp),u=Int32Array.from(qp(l,8)),c=Lp(e[Gp(-1,32)]).toString(Vp),d=Int32Array.from(qp(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t))?{}:{X$:Gp(0,21,1,2,1,7,1,12,5)}})(t,e);case"0002":return((t,e)=>{if(!e)return{X$:Gp(0,39,1,40,1,41,5)};const i=Kp(t),s=i.j$,r=i.Q$;if(i.X$||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))?{}:{X$:Gp(0,21,1,2,1,7,1,12,5)}})(t,e);default:return{X$:Gp(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}},rA=(t,e,i=!0,s)=>{jp=!1,e.yo();const r=e.Rr,n=!!r&&(r===St.document.body||St.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=St.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?Gp(0,0,1,2,1,23,1,24,25,1):"")+n.charAt(0).toUpperCase()+n.substr(1),s){const t=St.document.createElement("a");t.href=s,r=t}else r=St.document.createElement("p1");e.append(r),r.innerHTML=n,r.style.color="red"}},nA=(t,e,i)=>{e?(t[Gp(-1,17)](Gp(-1,19),i),t[Gp(-1,17)](Gp(-1,20),i),t[Gp(-1,17)](Gp(-1,21),i),t[Gp(-1,17)](Gp(-1,22),i)):(t[Gp(-1,18)](Gp(-1,19),i),t[Gp(-1,18)](Gp(-1,20),i),t[Gp(-1,18)](Gp(-1,21),i),t[Gp(-1,18)](Gp(-1,22),i))},oA=(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)}))};let hA;e.Animation=$,e.AnimationEasings=X,e.Animator=j,e.AreaRangeSeries=td,e.AreaSeries=$c,e.AreaSeriesBipolar=Zc,e.AreaSeriesMonopolar=jc,e.AreaSeriesNegative=Jc,e.AreaSeriesPositive=qc,e.AreaSeriesTypes=Kc,e.AutoCursor2DBuilder=ra,e.AutoCursorBuilders=Lf,e.AutoCursorXYBuilder=jl,e.AutoFitStrategies=Jh,e.AutoFitStrategy=$h,e.Axis=Qo,e.Axis3D=Ra,e.AxisScrollStrategies=Rs,e.AxisTickStrategies=Bs,e.Band=Vs,e.BarChart=bf,e.BarChartBar=Af,e.BarChartCategoryAxis=mf,e.BarChartSorting=vf,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=pf,e.BasicSeries=uu,e.BorderedPicture=Fn,e.BoxFigure=Gc,e.BoxSeries=Yc,e.BoxSeries3D=Wa,e.Button=Co,e.Chart=Gh,e.Chart3D=al,e.ChartComponent=Ui,e.ChartMarker=eu,e.ChartMarker2D=class extends eu{constructor(t,e,i,s,r,n){super(t,e,i,s.Xg(t,e,i,n),r,n)}},e.ChartMarkerXY=su,e.ChartWithSeries=Za,e.ChartXY=Pd,e.Color=v,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return T(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 T(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 T(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?w(t):w((t=>{const e=k[t.toLowerCase()];if(e)return e;throw new Error(`Unknown color code: ${t}`)})(t))}catch(t){}return console.warn(`ColorCSS parsing error: ${t}`),w("#fff")},e.ColorHEX=w,e.ColorHSV=E,e.ColorPalettes=Vn,e.ColorRGBA=T,e.ColorShadingStyles=Wn,e.ColorUint32=t=>T(255&t,255&(t>>=8),255&(t>>=8),255&(t>>=8)),e.ConstantLine=Ps,e.CursorBuilder=sa,e.CursorBuilderXY=$l,e.CustomTick=An,e.Dashboard=Cf,e.DashedLine=Jn,e.DataGrid=uf,e.DataPatternsNew=Fr,e.DataSetXY=gd,e.DateTimeTickStrategy=Sh,e.EllipseFigure=Nc,e.EllipseSeries=Uc,e.EmptyFill=R,e.EmptyUIElement=kn,e.Figure=Lc,e.FigureSeries=zc,e.FontSettings=ir,e.FormattingFunctions=Ci,e.FunnelChart=Mu,e.FunnelChartTypes=Cu,e.FunnelChartWithLabelsInsideSlices=ku,e.FunnelChartWithLabelsOnSides=Eu,e.FunnelSlice=Au,e.GaugeChart=Iu,e.GaugeChartTypes=Wf,e.GaugeSlice=zu,e.GenericAxis=qs,e.GlowEffect=io,e.HeatmapGridSeries=rd,e.HeatmapGridSeriesIntensityValues=nd,e.HeatmapScrollingGridSeries=od,e.HeatmapScrollingGridSeriesIntensityValues=hd,e.Highlighter=Gi,e.Icon=Qn,e.ImageFill=Xn,e.IndividualPointFill=class extends N{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")}},e.LUT=V,e.LegendBoxBuilders=$o,e.LineAndPointSeries3D=Ya,e.LineSeries=Ic,e.LineSeries3D=Ha,e.LinearGradientFill=et,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new et({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=Al,e.MapRegions=Gf,e.MapRegionsAfrica=zf,e.MapRegionsAsia=Vf,e.MapRegionsAustralia=Pf,e.MapRegionsCanada=Rf,e.MapRegionsEurope=Bf,e.MapRegionsNorthAmerica=Nf,e.MapRegionsSouthAmerica=Uf,e.MapRegionsUSA=Of,e.MapRegionsWorld=_f,e.MapTypes=cl,e.MarkerBuilders=If,e.MeshModel3D=hl,e.NumericTickStrategy=Ch,e.OHLCSeries=ad,e.OHLCSeriesBars=ud,e.OHLCSeriesCandlesticks=ld,e.OHLCSeriesTypes=cd,e.OnScreenMenu=id,e.OnScreenMenuAnimationsButton=xs,e.OnScreenMenuButton=cs,e.OnScreenMenuControlBase=Zi,e.OnScreenMenuCustomButton=bs,e.OnScreenMenuOsmToggleButton=vs,e.OnScreenMenuToggleButton=ds,e.OnScreenMenuZoomInButton=fs,e.OnScreenMenuZoomInXButton=gs,e.OnScreenMenuZoomInYButton=ys,e.OnScreenMenuZoomOutButton=ms,e.OnScreenMenuZoomOutXButton=ps,e.OnScreenMenuZoomOutYButton=As,e.OnScreenMenuZoomToFitButton=Ss,e.PalettedFill=class extends Y{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=_h,e.PhongShadingStyle=Un,e.Picture=Dn,e.PieChart=Ea,e.PieChartTypes=Ia,e.PieChartWithLabelsInsideSlices=Fa,e.PieChartWithLabelsOnSides=Da,e.PieSlice=ba,e.PixelatedPoints3D=ur,e.PointCloudSeries3D=qa,e.PointLineAreaSeries=bd,e.PointLineSeries=yc,e.PointLineSeries3D=Xa,e.PointSeries=ed,e.PointSeries3D=ja,e.PointSeriesTypes3D=Ja,e.PointStyle3D=dr,e.PolarAreaSeries=fu,e.PolarAreaSeriesInterior=gu,e.PolarAxis=bl,e.PolarAxisAmplitude=Ml,e.PolarAxisTick=vl,e.PolarChart=mu,e.PolarHeatmapSeries=_l,e.PolarLineSeries=Nl,e.PolarPointLineSeries=Ul,e.PolarPointSeries=Gl,e.PolarPolygon=Wl,e.PolarPolygonSeries=du,e.PolarSector=Fl,e.PolarSeries=Ll,e.PolygonFigure=Rc,e.PolygonSeries=Bc,e.PyramidChart=Gu,e.PyramidChartTypes=$u,e.PyramidChartWithLabelsInsideSlices=Xu,e.PyramidChartWithLabelsOnSides=Hu,e.PyramidSlice=_u,e.RadialGauge=Lu,e.RadialGradientFill=K,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new K({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=Hc,e.RectangleFigure=Vc,e.RectangleSeries=Pc,e.SegmentFigure=_c,e.SegmentSeries=Oc,e.Series2D=Il,e.Series3D=Ga,e.SeriesMarkerXY=ru,e.SeriesXY=nu,e.SimpleShadingStyle=On,e.Slice=xa,e.SliceLabelFormatters=pa,e.SliceSorters=ma,e.SolidFill=U,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new U({color:s(t)})},e.SolidGauge=Bu,e.SolidGaugeSlice=Vu,e.SolidLine=qi,e.SpiderAxis=Ku,e.SpiderChart=ac,e.SpiderSeries=tc,e.SplineSeries=Ac,e.StaticCursor2DBuilder=na,e.StaticCursorXYBuilder=ql,e.StepSeries=Fc,e.StipplePatterns=jn,e.SurfaceGridSeries3D=il,e.SurfaceScrollingGridSeries3D=sl,e.TableContentBuilder=Zh,e.Themes=sg,e.Tick=Ko,e.TickStyle=rh,e.TimeFormattingFunctions=Ih,e.TimeTickStrategy=zh,e.TriangulatedPoints3D=hr,e.UIBackgrounds=Ff,e.UICircle=oo,e.UIColumnGrid=class extends fo{constructor(){super(...arguments),this.Nc=[]}addColumn(){return this.addElement(Ao,void 0)}getColumn(t,e=!1){return e&&this.Nc.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.Nc[t]}},e.UIDiamond=ho,e.UIElementBuilders=Xo,e.UIElementColumn=go,e.UIElementLine=co,e.UIElementRow=fo,e.UIElementWithBackground=mn,e.UIEmptyBackground=Cn,e.UILabel=so,e.UILayoutBuilders=ll,e.UILayoutGap=uo,e.UILegendBoxPanel=ul,e.UIObject=cn,e.UIOrigins=Ts,e.UIPanel=Nh,e.UIPoint=lo,e.UIPointer=ao,e.UIPolygon=In,e.UIRectangle=no,e.UIRowGrid=mo,e.VisibleFill=N,e.ZoomBandChart=dd,e.defaultOsmBackgroundColor=Ls,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=B,e.emptyLine=rt,e.emptyPoints3D=nr,e.emptyTick=oh,e.formatLongitudeLatitude=Sl,e.formatNumberAsUnicodeSuperscript=Di,e.isColor=M,e.isCoordinate3D=nl,e.isCoordinateBarChart=xf,e.isCoordinateClient=Bi,e.isCoordinatePolar=Dl,e.isCoordinateXY=Oi,e.isDashedLine=Zn,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=_,e.isEmptyTick=hh,e.isFontSettings=sr,e.isGlowEffect=t=>!(!t||"object"!=typeof t||!("type"in t)||"glow"!==t.type),e.isIcon=to,e.isIndividualPointFill=W,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=it,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=cr,e.isRadialGradientFill=Q,e.isSeriesSupportedByZoomBandChart=t=>t instanceof uu||t instanceof $c||t instanceof td||t instanceof nd||t instanceof ad||t instanceof Fc||t instanceof bd,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=G,e.isSolidLine=Ji,e.isTickStyle=nh,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=ar,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;return o.e=i,hA||(hA=((t,e)=>{let i,s,n=!1,o=!1,h=!1,a=!1,l="",u=!1,c=!1;try{if(Wp){const s=(t=>{if(!Wp)return;const e=Wp.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){Xp=new Uint8Array([2]);const e=(t=>{if(!Wp)return;const e=Wp.split("-");return 4===e.length?e[1].startsWith("m")?2:1:0})();if(1===e){const t=iA(Wp);h=!t.J$,i=t,n=!0}else 2===e?(i=sA(Wp,t),o=!0):(jp=!0,i=Qp(Wp),a=!0)}else if("0002"===s){const e=(t=>{if(!Wp)return;const e=Wp.split("-");return e.length>=2?Uint8Array.from(atob(e[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)jp=!0,i=Qp(Wp),a=!0;else if(189===e){const t=iA(Wp);h=!t.J$,i=t,n=!0}else 159===e?(i=sA(Wp,t),o=!0):i={X$:Gp(0,0,1,7,1,12,5)}}else if("T001"===s){const s=((t,e)=>{const i=Wp.split("-");if(3!==i.length)return{X$:Gp(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(!eA(s,r))return{X$:Gp(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{X$:Gp(0,0,1,2,1,3,1,4,5)};const p=u.getUint16(n,!0),A=l.subarray(n+=2,n+p);if(Xp=new Uint8Array(A),e&&"dHJhZGVy"in e&&"dGVjaG5pY2FsIGFuYWx5c2lz"===e.dHJhZGVy)return{K$:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="};if(e&&"logoGraphic"in e&&e.logoGraphic){const t=e.logoGraphic.split("-");return 3===t.length&&eA(t[0],t[2])?{K$:t[0]}:{X$:Gp(0,0,1,7,1,12,5)}}return{X$:Gp(0,0,1,7,1,12,5)}})(0,t);i=s;const r=s.K$;r&&e?("string"==typeof r&&(e.l=r),n=!0):i={X$:Gp(0,0,1,7,1,12,5)}}else i={X$:Gp(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={X$:Gp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68),Z$:Gp(-2,2)}:window.location.host===Up.atob("c3RhY2tzbmlwcGV0cy5uZXQ=")?(c=!0,u=!1,Xp=new Uint8Array([38]),i={}):(c=!0,u=!0,Xp=new Uint8Array([38]),i={})}}catch(t){i={X$:Gp(0,0,1,7,1,12,5)}}try{a&&(s=Up[Gp(-1,34)][Gp(-1,35)](Gp(-1,39))||void 0)}catch(t){Up.console.error(t)}let d=!1;if(s){const t=s.split("-");if(2===t.length&&eA(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.X$||n||o||d),g=(()=>{const t=new(Up[Gp(-1,0)]);return t.open(Gp(0,26),Gp(-2,0)),t.setRequestHeader(Gp(-1,24),Gp(-1,25)),t.withCredentials=!0,t})(),y=new r.Eventer;if(f){let t;try{t=parseInt(Wp?Wp.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="";Wp=Wp||"";const o=Gp(-4,0);for(let t=0;t{const n={As:t=>{const e=2===t||10===t?Gp(-2,1):void 0,i=`${Gp(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${"string"==typeof t?t:(t=>{switch(t){case 1:return Gp(0,48,49);case 0:return Gp(0,48,50);case 2:return Gp(0,51);case 3:return Gp(0,52,48);case 4:return Gp(0,53,48);case 5:return Gp(0,54,48);case 6:return Gp(0,55,48);case 7:return Gp(0,56,48);case 8:return Gp(0,57,48);case 9:return Gp(0,58,48);case 10:return Gp(0,61,1,62)}return Se(0,"")})(t)}${e?Gp(0,1,63,1,64,1,59,1,65,1,41):""}`;rA(i,o,!1,e)},Ln:t=>y.on("logoChange",t),Rn:t=>y.off(t),...Yp},o=new hp(r,t,n);(null==i?void 0:i.X$)&&rA(i.X$,o,void 0,i.Z$);const a=t=>{if("error"===(null==t?void 0:t.type)&&s){const t=s.split("-");if(2===t.length&&eA(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return jp=!1,void nA(g,!1,c)}}if(g.readyState===Up[Gp(-1,0)].DONE)if(200===g.status){const t=JSON.parse(g[Gp(-1,23)]);if(!eA(l+Gp(-3,0),t.h)){const t=Gp(0,0,1,27,1,28,1,29,1,30,1,31,5);rA(t,o)}Up[Gp(-1,34)][Gp(-1,36)](Gp(-1,39),t.t),Up[Gp(-1,34)][Gp(-1,36)](Gp(-1,33),t.s),jp=!1}else{let e="";try{e=t&&"loadend"!==t.type?Gp(0,0,1,23,1,32,1,24,5):JSON.parse(g[Gp(-1,23)]).message,nA(g,!1,c)}catch(t){console.error(t)}rA(Gp(0,0,1,2,1,7,1,12,5)+e,o)}},c=t=>{a(t)};if(nA(g,!0,c),f?setTimeout((()=>{if(jp){let t=!0;if(s){const e=s.split("-");if(2===e.length&&eA(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&rA(Gp(0,25,1,23,1,32,1,24,5),o)}}),1e4):nA(g,!1,c),u){const t=(()=>{const t=new(Up[Gp(-1,0)]);return t.open(Gp(0,26),Gp(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=Gp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);rA(t,o,!1,Gp(-2,2)),nA(g,!1,r)}if(t.readyState===Up.XMLHttpRequest.DONE){const s=t.getResponseHeader("X-LCJS-SANDBOX-V");if(200!==t.status||s&&"1"!==s){const t=Gp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);rA(t,o,!1,Gp(-2,2)),nA(g,!1,r)}else{const s=JSON.parse(t.responseText);if(!eA(i,s.s)){const t=Gp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);rA(t,o,!1,Gp(-2,2)),nA(g,!1,r)}void 0!==e&&(e.l=s.l),y.emit("logoChange",s.l)}}else{const t=Gp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);rA(t,o,!1,Gp(-2,2)),nA(g,!1,r)}},r=t=>{s(t)};nA(t,!0,r),t.send(i),setTimeout((()=>{if(t.readyState<2){const t=Gp(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);rA(t,o,!1,Gp(-2,2)),nA(g,!1,r)}}),1e4)}return h?(t=>{let e;jp=!1;const i=t.oi(),s=()=>{e&&(t.pn(e.gn()),e=void 0),e=t.nI("deployment test"),e.kr(t.dt).Bh(Gp(0,34,1,33)).Ie({x:i.x/2,y:i.y/2}).Ea(50).zh(13).ke(new U({color:T(128,128,128,100)})).La("Arial").za(500).setMouseInteractions(!1),t.dn().fn()};t.Go((()=>{s()})),setTimeout(s,0),setInterval((()=>{e&&e.gn(){var r,n,o,h,a,l,u,c,d;let f;if(i&&i.license){const t=i.license.split("-");f=t[t.length-1]}const g=null===(n=null===(r=null==i?void 0:i.sharedContextOptions)||void 0===r?void 0:r.webgl)||void 0===n?void 0:n.version,y={$R:null===(o=null==i?void 0:i.sharedContextOptions)||void 0===o?void 0:o.canvas,oo:null==i?void 0:i.warnings,eE:"webgl1"===g?1:"webgl2"===g?2:void 0,qR:!1!==(null===(h=null==i?void 0:i.sharedContextOptions)||void 0===h?void 0:h.antialias),KR:(null===(a=null==i?void 0:i.sharedContextOptions)||void 0===a?void 0:a.devicePixelRatio)||void 0,dE:(null===(l=null==i?void 0:i.sharedContextOptions)||void 0===l?void 0:l.noCanvasStyles)||void 0,pE:(null===(u=null==i?void 0:i.sharedContextOptions)||void 0===u?void 0:u.noCanvasTransform)||void 0,iE:!1!==(null===(c=null==i?void 0:i.sharedContextOptions)||void 0===c?void 0:c.useStackingOrder),sE:!1!==(null===(d=null==i?void 0:i.sharedContextOptions)||void 0===d?void 0:d.useIndividualCanvas),fE:f||void 0},m=new sy(y),p=e=>t(e,m);return{Dashboard:ry(p,e,i,s),ChartXY:hy(p,e,i,s),Spider:ay(p,e,i,s),Polar:ly(p,e,i,s),Pie:uy(p,e,i,s),UIPanel:oy(p,e,i,s),Gauge:cy(p,e,i,s),Funnel:dy(p,e,i,s),Pyramid:fy(p,e,i,s),Chart3D:yy(p,e,i,s),Map:gy(p,e,i,s),DataGrid:my(p,e,i,s),BarChart:py(p,e,i,s),ZoomBandChart:Ay(p,e,i,s),dispose:m.W.bind(m)}})(hA,o.e,n,o.l)},e.onScreenMenuControlBaseHeight=ks,e.onScreenMenuControlBaseWidth=Cs,e.onScreenMenuControlOpacity=Ds,e.onScreenMenuDefaultButtonShape=Is,e.onScreenMenuSpriteURL=Fs,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=Vh,e.synchronizeAxisIntervals=dt,e.translatePoint=ut,e.translatePoint3D=ct,e.transparentFill=ws,e.transparentLine=Es,e.uint32ColorFromObject=t=>F(255*t.r,255*t.g,255*t.b,255*t.a),e.uint32ColorFromRGBA=F,e.vec3Utils=Fe,e.xDimensionStrategy=th,e.yDimensionStrategy=eh}}]); \ No newline at end of file diff --git a/js/vendor.accf70b827d2d6ced06f.bundle.js.LICENSE.txt b/js/vendor.accf70b827d2d6ced06f.bundle.js.LICENSE.txt deleted file mode 100644 index 3cd227b..0000000 --- a/js/vendor.accf70b827d2d6ced06f.bundle.js.LICENSE.txt +++ /dev/null @@ -1,8 +0,0 @@ -/** - * stacking-order by Rich Harris - * https://github.com/Rich-Harris/stacking-order - * - * @license MIT - * - * Converted to TypeScript and edited to match LCJS requirements. - */ diff --git a/resources/zoomBandChart/cyberspace-selector.png b/resources/zoomBandChart/cyberspace-selector.png deleted file mode 100644 index b0f450fcc1c13f7a6224e2c415e565e9ce39e6f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1073 zcmV-11kU@3P)~Y$`6v2g#?ulT8bqVQ9*sE$hMcJ_7YP_dzhPMzS`~lr@7Oe)!k;-urCfA z?sLv>&bjx_Iad^h=@Fga*qdwBqT_EMHja|7LpKAU;)%UE}+V34S4mML|S+z+)Ax{Vg5MyW}GSrt|ceK0qc>0aI3OWco16?e7P>ubE^O4}!~JjTec3 z_0F!_IuEZY&VYLQf4qr4>b;cS`9|_XUN5*%bvD@A_)!0tS9>hA_BMb$INUewkXs~; zf0eDm=8)EkKZML}el#%d^&V@DGuE)VQxAzzRR2QK!Mo2Eq@zJS$#?=ia}hL~-up~q zCczHG*-}{~?KT+{L?DxkAOpSkkpoG)kGBY*(H!V84?6K6S9sAv_C3%ZmKh&n${;J$!84*=pBcFPZi1&BiF^`ttvh*if-~L3W$niV23srSYsf^Q7?wdaUt4&XauJgOumlkF<3Xwm7+lB$q+FXG)!p{LUM=Mh rl8RxuEb~AfYTN%$uK%`5U2gvZ`$Psw@ON9g00000NkvXXu0mjfu>d3v+GA#4-Ope z=bYa?=iZrfF3;`K!*7A3H&@t(} z^aqmrpgfc$tfS+MIX~Z29UE&n8y3c=LxayJjL*+|U-k95no3JwJJCh5DuG#xMW7ZW zw?zPn!RaikN=}Zt$MZbe8y-OreAClQH_hhuhcxJAfGU_j5G*l}M2wA9vr znSy59*}loih1!ga4#0j(K)6+Tg9XWZf|W-!Hl93MU7g;$ZVBcGI&?fOLhv;;jTh9^ zy!#}<;7VoBv>>=FoFsZ;qU>%;O7wMqmT3Ja&zYK9e2|vbev8HzNmisi6Rl!Fa2c$L zBr$qCw(iKt&)ygFty+KXu1L$WOG7hI_NHsrmDrvCVqmCK`g2S5)5_l1W) z&7^U+WEBpFxL52)D7!6|225V>l@D97MxJXhJULEv7s)*9J}oGM2KSR3Akfe@LD}@) z50alGIDz=KR2GS+O#&qnXmFdL9D45?0}@XkYY{;E7|;L&TNhm6|;4g zM1O{zgH%h`Y5bQUgo#87eEr)De0iJssVZT@<+46A8V#wNahE*DuzRlM2SaO?gaspkdbc@<1l7lTR zr>s_M>a}&tHa@V#;h20>QSsJ6qu(WKbki+y(IiR&Np+k)z!Hj!52e@EW|mki@mcZl zh9pdOyS+0bBktjbhSAQhuCL?NH7h}olmtv5RVgt|#xKA~g3yi<`5tl#IoZc)La2sP zSb)%ta)CrSZB*ZosmfLXP$Mua?q+#9~)2%Pf$E iYWx4n^h!)i+ zX@fEd(jY7RWKo7ho6)9G5?Ls1L|K8Mh1Fz61!~%+S+h8u|LwiUo#)J`qtq849Paks z`Mq=QdGDO7VgKmT^n&B=UPn)KbO(~x(TaWOmH}wRzDuqrkgVK?o)krX2Fg2CB0`;j zu0Zk}lxs%JDwZ8f!A0Leg8ag{2X1mRDtEs8+SXJfCdYZD4*d?%NF$bza z@|XiibjeFsW%&CW@-!Mg?s7RC%+}G-zN7r|xf8T#6@X4KS0GrTBk@aGl9pjG1RTN> zb7o9q$%*l7yeWdiUYYAzdBq)e_u*qcZf|efcI!$pV810G+^PhM2$J^%Z|*l~+RP}^ z_=yi;$@;WqY|;E=R|c`GH_F+`;!6ycnP0t_QSrrV znXn{lQ-({3Jehy=1h=f?XItUT%f-84Ac=(pd&aF2L2wzY@h2Iwa8-JRR;wMGvwJ&> zjvD6?R9p9&W#=AbcDwz}wR1&@bn|zT4iZ=e7dm|#^4=I|e)ys_nJ?kC3q?nm&evre zC~&LI##W?n=I*o+e37g|aPYknKSJ4UfwU03cx`4aG?kn>?$H`~F?HPr-Yq>{ z7)?zJ$q&(eYLFi-4kZ~uplUBcG4$MLl5Zr4K)z2Rh)0_QG7{*Sm!K*1T$2Fe(WeFt z5`i?G+m*G2yJ&xY0UH|;&Q>g5z{i5?Vg=AI>bnIEqeWQsLd(-35GS~~`t8r)3F56qNE1d%e2=_LeA9dKQ&rML z%F6X6I-M@OH>uoewKkNUKbb0kkdM0jy^&#+#FvngnmsgV#PZ%0C*N8>U#u)E$ss)+ z6Q5Hm4;y2e95*ZBj7Fo;_N?4;*sJbWuKD!N{G31@Q@K-df_;jMpSybG=!nhO?CuK4 zkMHY`RNc9KR&tx$;sm;!$}JiPlZ3?1PFy}JJTe`Yxr#i8!(so>@V4mby^4#p-Yi+; zw%mdaq;;i$q&}h#u%M8zQKqO#F)4w=f+y?s`cT|#u~-^^d~JDNS5sZq{ON<4rdlNk ziV}|nq*F;uHwTamAwga^P;Uk0I7jxCZEumljCGUUBNy@pB@ieVX~$Hx{CrX0j104xCn z^SDsz0tOd~0A6d;<#e|FuSZMig?RH%4$C4?gsSKJ<@m2w>h<^!%Peq7`8qw100000 LNkvXXu0mjfP~xp@@j~Xi@u8Q4q9QYLwAx;Fy`EmKuenX=yd;Q#=3LdyhNQ%&3#p7att%HuwDI zoO|9o=Q^-|^f+{aW9_$X9nsMqNLfcK_Muw=pcVTTxwb%xa!1-Jin0gFTg^m-ngA_< zlsPDOBGE)n8#=I8fLEfEMib-c=nxDIt*vdPEs}J*uCn%c{;ij9X-Xn#k-?(H9B2+w z#vDN6JbuZTc&(dmuRONo7OC;Oal`#{k518Ivj8-KSpvZlXA*7nqS5g>57&LzF?r+^ zHY<8I3mXu|VMXtX*tOiNEc3|ONKgj>}>5kbnCz!GifxS-I0$o>yu zN#fijHgC#&OV+SUSr^#x%SW*$RpwWWEq+i|EW_YR^~}scaG48*PD+@N?WA!G*}wK6(}(D7 zf(#`Fw(h_h)*`i*;|3!o7)sE*oh&~I0DyRJJJ_JO}sPhYNB>~}ec6RbR4_GPdIvDYG`34H4wQ)^G+8!dn9kS45t>(n$cF+Tc= z#zhm@nN%({N#%D><<1d6$VY#Cy^&$n#5ZbwRH~4r9VqsNjwSho3Q@KfTf^*VO4`1LH*0cjiLlC zHQdy)Hj*xbFmz+MaHQF^NXOwweZ2=e!P3n z@11k+edk<_a7K?N0#2Z@zHoGe0vRu>iI&0pV78qwpZMCirswrOwWR)aK^VfR?D~WZ8OGSJ{u2mKg~KSITRq2Ek=< zB#Gp*XS%Gc=5VZGV-A;=y2yo(sl82dAg!5b6%T^TU`;%Usc2>8y(T{XdL$shQ4GjkexumD}7J-IPGTsXPZAyXxF^=bJ%1B8%14!p_i;aBb}P z9DgY-6%r~dg=~jIePB;_j-c&eeqM;n%@q~%b)H0jhSP%-pB|v`UxE-OGAZzVh%)fq z3g@RPhl#@F%z4uMk)el2c zDD81LUM$wvzn0tRe9;Ht#=JYMb?;