diff --git a/index.html b/index.html index 2d5d0b4..29d027a 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.9e2f9b19a0ebb3c18c1e.bundle.js b/js/app.9e2f9b19a0ebb3c18c1e.bundle.js deleted file mode 100644 index c64e057..0000000 --- a/js/app.9e2f9b19a0ebb3c18c1e.bundle.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk=self.webpackChunk||[]).push([[143],{138:(e,t,s)=>{const a=s(809),{lightningChart:o,ColorPalettes:n,SolidFill:r,SolidLine:l,UILayoutBuilders:i,UIElementBuilders:d,AutoCursorModes:c,AxisTickStrategies:S,emptyLine:u,emptyFill:x,AxisScrollStrategies:m,Themes:p}=a,{createProgressiveTraceGenerator:y}=s(27),T=n.arctionWarm(2),g=(new l).setFillStyle((new r).setColor(T(0))).setThickness(20/window.devicePixelRatio),w=(new r).setColor(T(1)),h=["Dev","Maintenance","Support","Sales","Marketing"],k=864e5,f=Promise.all(h.map(((e,t)=>y().setNumberOfPoints(365).generate().toPromise().then((e=>e.map((e=>({x:e.x*k,y:t>0?100*Math.abs(e.y)+100:50*Math.abs(e.y)+1800})))))))),I=o().Dashboard({numberOfRows:3,numberOfColumns:2}),C=f.then((e=>e.map((e=>e.reduce(((e,t)=>e+t.y),0))))),E=I.createChartXY({columnIndex:0,rowIndex:0,columnSpan:1,rowSpan:2}).setAutoCursorMode(c.disabled).setTitle("Total expenses for 2018 per department").setMouseInteractions(!1),D=E.getDefaultAxisX();D.setTickStrategy(S.Empty).setMouseInteractions(!1).setInterval(0,100,!1,!0).setScrollStrategy(void 0),E.getDefaultAxisY().setTitle("Expenses ($)").setStrokeStyle((e=>e.setThickness(0))).setNibStyle(u).setMouseInteractions(!1);const F=E.addSegmentSeries(),P=h.length+1,R=h.map(((e,t)=>D.addCustomTick(d.AxisTick).setTextFormatter((t=>e)).setValue(100/P*(t+1)).setGridStrokeStyle(u))),b=new Date(2018,0,1),A=I.createChartXY({columnIndex:0,rowIndex:2,columnSpan:2,rowSpan:1}).setPadding({right:40});I.setRowHeight(2,2);const M=A.addLineSeries().setName("Total Expenses").setStrokeStyle((e=>e.setFillStyle(w)));A.getDefaultAxisX().setTickStrategy(S.DateTime,(e=>e.setDateOrigin(b))),f.then((e=>{const t=e.reduce(((e,t)=>t.reduce(((e,t)=>e>t.y?e:t.y),e)),0);A.getDefaultAxisY().setTitle("Expenses ($)").setScrollStrategy(m.fitting).setInterval(0,t)})),M.setCursorResultTableFormatter(((e,t,s,a)=>e.addRow("Total expenses").addRow("Date: "+t.axisX.formatValue(s)).addRow("Expenses: $"+a.toFixed(2)))),Promise.all([C,f]).then((([e,t])=>{const s=R.map(((t,s)=>{const a=t.getValue();return F.add({startX:a,startY:0,endX:a,endY:e[s]})})),a=e=>{A.setTitle(`${h[e]} expenses per day`),M.clear(),M.add(t[e]),s.forEach((e=>e.setStrokeStyle(g))),s[e].setStrokeStyle((e=>e.setFillStyle(w)))};s.forEach(((e,t)=>{e.onMouseEnter((()=>a(t))),e.onTouchStart((()=>a(t)))})),a(0)}));const X=I.createUIPanel({columnIndex:1,rowIndex:0,columnSpan:1,rowSpan:1}).addUIElement(i.Column).setPosition({x:50,y:50}).setPadding({right:40}).setBackground((e=>e.setFillStyle(x).setStrokeStyle(u)));C.then((e=>{const t=X.addElement(i.Row);t.addGap(),t.addElement(d.TextBox.addStyler((t=>t.setTextFont((e=>e.setSize(75/window.devicePixelRatio))).setText("$"+e.reduce(((e,t)=>e+t),0).toFixed())))),t.addGap(),X.addElement(d.TextBox.addStyler((e=>e.setTextFont((e=>e.setSize(25/window.devicePixelRatio))).setText("Total company expenses"))))}));const v=I.createChartXY({columnIndex:1,rowIndex:1,columnSpan:1,rowSpan:1}).setTitle("Total expenses per day").setPadding({right:40});v.getDefaultAxisX().setTickStrategy(S.DateTime,(e=>e.setDateOrigin(b)));const Y=v.addSplineSeries().setName("Total Expenses ($)").setStrokeStyle((e=>e.setThickness(2)));f.then((e=>{const t=new Array(365);for(let s=0;s<365;s++)t[s]={x:s*k,y:h.reduce(((t,a,o)=>t+e[o][s].y),0)};Y.setPointFillStyle(x).add(t)})),Y.setCursorResultTableFormatter(((e,t,s,a)=>e.addRow("Total expenses").addRow("Date: "+t.axisX.formatValue(s)).addRow("Expenses: $"+a.toFixed(2)))),v.getDefaultAxisY().setTitle("Expenses ($)")}},e=>{e.O(0,[736],(()=>(138,e(e.s=138)))),e.O()}]); \ No newline at end of file diff --git a/js/app.cbc258239e7925f03f6c.bundle.js b/js/app.cbc258239e7925f03f6c.bundle.js new file mode 100644 index 0000000..070ad6f --- /dev/null +++ b/js/app.cbc258239e7925f03f6c.bundle.js @@ -0,0 +1 @@ +(self.webpackChunk=self.webpackChunk||[]).push([[143],{138:(e,t,s)=>{const a=s(475),o=s(27),{lightningChart:n,SolidFill:r,SolidLine:l,UILayoutBuilders:i,UIElementBuilders:d,AutoCursorModes:c,AxisTickStrategies:x,emptyLine:u,emptyFill:S,AxisScrollStrategies:m,Themes:p}=a,{createProgressiveTraceGenerator:g}=o,y=["Dev","Maintenance","Support","Sales","Marketing"],T=864e5,h=Promise.all(y.map(((e,t)=>g().setNumberOfPoints(365).generate().toPromise().then((e=>e.map((e=>({x:e.x*T,y:t>0?100*Math.abs(e.y)+100:50*Math.abs(e.y)+1800})))))))),w=n().Dashboard({numberOfRows:3,numberOfColumns:2}),k=w.getTheme(),f=new l({thickness:20/window.devicePixelRatio,fillStyle:new r({color:k.examples.unfocusedDataColor})}),D=new r({color:k.examples.mainDataColor}),E=h.then((e=>e.map((e=>e.reduce(((e,t)=>e+t.y),0))))),I=w.createChartXY({columnIndex:0,rowIndex:0,columnSpan:1,rowSpan:2}).setAutoCursorMode(c.disabled).setTitle("Total expenses for 2018 per department").setMouseInteractions(!1),F=I.getDefaultAxisX();F.setTickStrategy(x.Empty).setMouseInteractions(!1).setInterval({start:0,end:100}).setScrollStrategy(void 0),I.getDefaultAxisY().setTitle("Expenses ($)").setStrokeStyle((e=>e.setThickness(0))).setNibStyle(u).setMouseInteractions(!1);const C=I.addSegmentSeries().setHighlightOnHover(!1),P=y.length+1,R=y.map(((e,t)=>F.addCustomTick().setTextFormatter((t=>e)).setValue(100/P*(t+1)).setGridStrokeStyle(u))),b=new Date(2018,0,1),A=w.createChartXY({columnIndex:0,rowIndex:2,columnSpan:2,rowSpan:1}).setPadding({right:40});w.setRowHeight(2,2);const M=A.addLineSeries().setName("Total Expenses").setStrokeStyle((e=>e.setFillStyle(D)));A.getDefaultAxisX().setTickStrategy(x.DateTime,(e=>e.setDateOrigin(b))),h.then((e=>{const t=e.reduce(((e,t)=>t.reduce(((e,t)=>e>t.y?e:t.y),e)),0);A.getDefaultAxisY().setTitle("Expenses ($)").setScrollStrategy(m.fitting).setInterval({start:0,end:t,stopAxisAfter:!1})})),M.setCursorResultTableFormatter(((e,t,s,a)=>e.addRow("Total expenses").addRow("Date: "+t.axisX.formatValue(s)).addRow("Expenses: $"+a.toFixed(2)))),Promise.all([E,h]).then((([e,t])=>{const s=R.map(((t,s)=>{const a=t.getValue();return C.add({startX:a,startY:0,endX:a,endY:e[s]})})),a=e=>{A.setTitle(`${y[e]} expenses per day`),M.clear(),M.add(t[e]),s.forEach((e=>e.setStrokeStyle(f))),R.forEach((e=>e.setMarker((e=>e.setTextFont((e=>e.setWeight("normal"))))))),s[e].setStrokeStyle((e=>e.setFillStyle(D))),R[e].setMarker((e=>e.setTextFont((e=>e.setWeight("bold")))))};s.forEach(((e,t)=>{e.onMouseEnter((()=>a(t))),e.onTouchStart((()=>a(t)))})),a(0)}));const X=w.createUIPanel({columnIndex:1,rowIndex:0,columnSpan:1,rowSpan:1}).addUIElement(i.Column).setPosition({x:50,y:50}).setPadding({right:40}).setBackground((e=>e.setFillStyle(S).setStrokeStyle(u)));E.then((e=>{const t=X.addElement(i.Row);t.addGap(),t.addElement(d.TextBox.addStyler((t=>t.setTextFont((e=>e.setSize(75/window.devicePixelRatio))).setText("$"+e.reduce(((e,t)=>e+t),0).toFixed())))),t.addGap(),X.addElement(d.TextBox.addStyler((e=>e.setTextFont((e=>e.setSize(25/window.devicePixelRatio))).setText("Total company expenses"))))}));const v=w.createChartXY({columnIndex:1,rowIndex:1,columnSpan:1,rowSpan:1}).setTitle("Total expenses per day").setPadding({right:40});v.getDefaultAxisX().setTickStrategy(x.DateTime,(e=>e.setDateOrigin(b)));const O=v.addSplineSeries().setName("Total Expenses ($)").setStrokeStyle((e=>e.setThickness(2)));h.then((e=>{const t=new Array(365);for(let s=0;s<365;s++)t[s]={x:s*T,y:y.reduce(((t,a,o)=>t+e[o][s].y),0)};O.setPointFillStyle(S).add(t)})),O.setCursorResultTableFormatter(((e,t,s,a)=>e.addRow("Total expenses").addRow("Date: "+t.axisX.formatValue(s)).addRow("Expenses: $"+a.toFixed(2)))),v.getDefaultAxisY().setTitle("Expenses ($)")}},e=>{e.O(0,[736],(()=>(138,e(e.s=138)))),e.O()}]); \ No newline at end of file diff --git a/js/vendor.63fa56fa32f71392ee3e.bundle.js b/js/vendor.63fa56fa32f71392ee3e.bundle.js deleted file mode 100644 index f9d4bff..0000000 --- a/js/vendor.63fa56fa32f71392ee3e.bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendor.63fa56fa32f71392ee3e.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[736],{102:(t,e,i)=>{i.r(e),i.d(e,{EventError:()=>a,Eventer:()=>c,Token:()=>l});var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},n(t,e)};function r(t){var e="function"==typeof Symbol&&t[Symbol.iterator],i=0;return e?e.call(t):{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}}function o(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,o=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}function s(){for(var t=[],e=0;e{Object.defineProperty(e,"t",{value:!0});var n=i(369),r=i(102),o=i(187),s=function(t){if(t&&t.t)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}(n),a=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(o),l=function(t,e){return(l=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])})(t,e)};function h(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}l(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var u=function(){return(u=Object.assign||function(t){for(var e,i=1,n=arguments.length;i=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,o=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}function p(t,e,i){if(i||2===arguments.length)for(var n,r=0,o=e.length;r0&&t.forEach((function(t){e.push(m(t.position,t.high)),i.push(m(t.position,t.low))})),[e,i]},A=function(t,e){return{min:t,max:e}},I=function(t,e,i,n){return{x:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(n)}},F=function(t,e){return void 0===e&&(e=!0),new S(t,e)},T=function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),{left:t,top:e,right:i,bottom:n}},C=T,D=function(t,e){return{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}},L=function(t){function e(e){return t.call(this,e)||this}return h(e,t),e.prototype.toString=function(){return"color:"+this.r+","+this.g+","+this.b+","+this.a},e.prototype.setA=function(t){return this.set("a",t/255)},e.prototype.setR=function(t){return this.set("r",t/255)},e.prototype.setG=function(t){return this.set("g",t/255)},e.prototype.setB=function(t){return this.set("b",t/255)},e.prototype.getA=function(){return 255*this.get("a")},e.prototype.getR=function(){return 255*this.get("r")},e.prototype.getG=function(){return 255*this.get("g")},e.prototype.getB=function(){return 255*this.get("b")},e.prototype.getHighlight=function(){return this._||(this._=new e({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._},e.prototype.getLighter=function(){return this.R||(this.R=new e({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.R},e.prototype.getDarker=function(){return this.N||(this.N=new e({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.N},e.prototype.toRGBAString=function(){return"rgba( "+255*this.r+", "+255*this.g+", "+255*this.b+", "+255*this.a+" )"},e}(n.Record({r:1,g:1,b:1,a:1})),P=new L({}),B=function(t,e,i,n){return void 0===n&&(n=255),new L({r:t/255,g:e/255,b:i/255,a:n/255})},E=function(t){var e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new L({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 L({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 L({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 L({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)}},O=function(t,e,i){var n,r,o;void 0===e&&(e=1),void 0===i&&(i=1),t/=360;var s=Math.floor(6*t),a=6*t-s,l=i*(1-e),h=i*(1-a*e),u=i*(1-(1-a)*e);switch(s%6){case 0:n=i,r=u,o=l;break;case 1:n=h,r=i,o=l;break;case 2:n=l,r=i,o=u;break;case 3:n=l,r=h,o=i;break;case 4:n=u,r=l,o=i;break;default:n=i,r=l,o=h}return new L({r:n,g:r,b:o})},_={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"},V=function(t,e){return t.value-e.value},z=n.Record({steps:[],title:"",units:"",interpolate:!0,color:B(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,valueRangeMin:0,valueRangeMax:0}),N=function(t){var e=t.steps,i=e.length;e.sort(V);for(var n=f(i>0?[e[0].value,e[i-1].value]:[0,0],2),r=n[0],o=n[1],s=i>0?i-1:0,a=Array(s),l=0;l0&&r!==o}},R=function(t){function e(e){var i=N(e);return t.call(this,function(t,e){return{steps:t.steps,title:t.title,units:t.units,interpolate:t.interpolate,color:t.color,valueRangeMin:e.valueRangeMin,valueRangeMax:e.valueRangeMax,length:e.length,min:e.min,max:e.max,subranges:e.subranges,isValid:e.isValid}}(e,i))||this}return h(e,t),e.prototype.toString=function(){return"LUT:interpolate="+this.interpolate+",steps="+this.steps.map((function(t){return t.value+","+t.color.toString()})).join(",")},e.prototype.setSteps=function(t){return this.merge(N(u(u({},this),{steps:t})))},e.prototype.getSteps=function(){return this.get("steps")},e.prototype.setTitle=function(t){return this.set("title",t)},e.prototype.getTitle=function(){return this.get("title")},e.prototype.setUnits=function(t){return this.set("units",t)},e.prototype.getUnits=function(){return this.get("units")},e.prototype.setInterpolation=function(t){return this.set("interpolate",t)},e.prototype.getInterpolation=function(){return this.get("interpolate")},e.prototype.setFallbackColor=function(t){return this.set("color",t)},e.prototype.getFallbackColor=function(){return this.get("color")},e.prototype.getColors=function(t){if(Array.isArray(t)){if(Array.isArray(t[0])){for(var e=t,i=e.length,n=e[0].length,r=p([],f(Array(i))).map((function(){return Array(n)})),o=0;o=t.min.value&&n<=t.max.value})),l=a.min,h=a.max,u=this.isValid?(n-l.value)/(h.value-l.value):1;return this.interpolate?(r=l.color||this.color,o=h.color||this.color,s=u,new L({r:r.r+(o.r-r.r)*s,g:r.g+(o.g-r.g)*s,b:r.b+(o.b-r.b)*s,a:r.a+(o.a-r.a)*s})):u>0?h.color||this.color:l.color||this.color},e}(z),H=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="fillstyle",e}return h(e,t),e.prototype.getDefaultHighlightStyle=function(){return this},e.prototype.toString=function(){return"emptyFill"},e}(n.Record({})),Y=new H,U=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="fillstyle",e}return h(e,t),e.prototype.getDefaultHighlightStyle=function(){return this.G||(this.G=this.createDefaultHighlightStyle()),this.G},e}(n.Record({color:B(255,255,255)})),G=function(t){function e(e){return t.call(this,e)||this}return h(e,t),e.prototype.toString=function(){return"solidFill:"+this.color.toString()},e.prototype.setColor=function(t){return t instanceof L?this.set("color",t):this.set("color",t(this.get("color")))},e.prototype.getColor=function(){return this.get("color")},e.prototype.setA=function(t){return this.setColor(this.getColor().setA(t))},e.prototype.setR=function(t){return this.setColor(this.getColor().setR(t))},e.prototype.setG=function(t){return this.setColor(this.getColor().setG(t))},e.prototype.setB=function(t){return this.setColor(this.getColor().setB(t))},e.prototype.createDefaultHighlightStyle=function(){return this.setColor(this.getColor().getHighlight())},e}(U),X=function(t){function e(e){return t.call(this,e)||this}return h(e,t),e.prototype.toString=function(){return"individualPointFill:"+this.color.toString()},e.prototype.setFallbackColor=function(t){return t instanceof L?this.set("color",t):this.set("color",t(this.get("color")))},e.prototype.getFallbackColor=function(){return this.get("color")},e.prototype.createDefaultHighlightStyle=function(){return this},e}(U),W=function(t){function e(e){var i=t.call(this,e)||this;return i.type="fillstyle",i}return h(e,t),e.prototype.toString=function(){return"palettedFill:lut="+this.lut.toString()+",lookUpProperty="+this.lookUpProperty},e.prototype.getDefaultHighlightStyle=function(){return this},e.prototype.getPalette=function(){return this.get("lut")},e.prototype.setLookUpProperty=function(t){return"function"==typeof t?this.set("lookUpProperty",t(this.get("lookUpProperty"))):this.set("lookUpProperty",t)},e.prototype.getLookUpProperty=function(){return this.get("lookUpProperty")},e}(n.Record({lut:new R({steps:[]}),lookUpProperty:"value"}));e.GradientShape=void 0,(y=e.GradientShape||(e.GradientShape={})).circle="circle",y.ellipse="ellipse",e.GradientExtent=void 0,(d=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",d.closestCorner="closest-corner",d.farthestSide="farthest-side",d.farthestCorner="farthest-corner";var j=function(t){function e(e){var i=t.call(this,e)||this;if(i.type="fillstyle",null===e||e&&null===e.stops||e&&e.stops&&!Array.isArray(e.stops)||e&&e.stops&&Array.isArray(e.stops)&&e.stops.length<2)throw new Error("RadialGradientFill requires minimum two color stops to be defined.");return i}return h(e,t),e.prototype.toString=function(){return"radialGradientFill:"+this.shape+","+this.extent+","+this.position.x+","+this.position.y+","+this.stops.map((function(t){return t.offset+","+t.color.toString()})).join(",")},e.prototype.setColorStops=function(t){if(t.length<2)throw new Error("Minimum of two color stops required");return this.set("stops",t)},e.prototype.getColorStops=function(){return this.get("stops")},e.prototype.setPosition=function(t){return this.set("position",t)},e.prototype.getPosition=function(){return this.get("position")},e.prototype.setShape=function(t){return this.set("shape",t)},e.prototype.getShape=function(){return this.get("shape")},e.prototype.setExtent=function(t){return this.set("extent",t)},e.prototype.getExtent=function(){return this.get("extent")},e.prototype.createDefaultHighlightStyle=function(){return this.setColorStops(this.getColorStops().map((function(t){return{color:t.color.getHighlight(),offset:t.offset}})))},e.prototype.getDefaultHighlightStyle=function(){return this.G||(this.G=this.createDefaultHighlightStyle()),this.G},e}(n.Record({stops:[{color:E("#f00"),offset:0},{color:E("#0f0"),offset:1}],position:m(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner})),K=function(t){function e(e){var i=t.call(this,e)||this;if(i.type="fillstyle",null===e||e&&null===e.stops||e&&e.stops&&!Array.isArray(e.stops)||e&&e.stops&&Array.isArray(e.stops)&&e.stops.length<2)throw new Error("LinearGradientFill requires minimum two color stops to be defined.");return i}return h(e,t),e.prototype.toString=function(){return"linearGradientFill:"+this.angle+","+this.stops.map((function(t){return t.offset+","+t.color.toString()})).join(",")},e.prototype.setColorStops=function(t){if(t.length<2)throw new Error("Minimum of two color stops required");var e=t.sort((function(t,e){return t.offset-e.offset}));return this.set("stops",e)},e.prototype.getColorStops=function(){return this.get("stops")},e.prototype.setAngle=function(t,e){return this.set("angle",e?hi(t):t)},e.prototype.getAngle=function(t){return t?li(this.get("angle")):this.get("angle")},e.prototype.createDefaultHighlightStyle=function(){return this.setColorStops(this.getColorStops().map((function(t){return{color:t.color.getHighlight(),offset:t.offset}})))},e.prototype.getDefaultHighlightStyle=function(){return this.G||(this.G=this.createDefaultHighlightStyle()),this.G},e}(n.Record({stops:[{color:E("#f00"),offset:0},{color:E("#0f0"),offset:1}],angle:0})),Z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linestyle",e}return h(e,t),e.prototype.getDefaultHighlightStyle=function(){return this.H||(this.H=this.createDefaultHighlightStyle()),this.H},e}(n.Record({fillStyle:new G({color:B(255,255,255)}),thickness:1,highlightThicknessMultiplier:2})),q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.createDefaultHighlightStyle=function(){return this},e}(Z),Q=Object.assign(Object.create(new q),{getDefaultHighlightStyle:function(){return this}}),J=function(t){function e(e){return t.call(this,e)||this}return h(e,t),e.prototype.createDefaultHighlightStyle=function(){return this.setFillStyle(this.getFillStyle().getDefaultHighlightStyle()).setThickness(Math.abs(this.get("thickness"))*this.highlightThicknessMultiplier)},e.prototype.setFillStyle=function(t){return"function"==typeof t?this.set("fillStyle",t(this.getFillStyle())):this.set("fillStyle",t)},e}(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getFillStyle=function(){return this.get("fillStyle")},e.prototype.setThickness=function(t){return this.set("thickness",t)},e.prototype.getThickness=function(){return this.get("thickness")},e.prototype.setHighlightThicknessMultiplier=function(t){return this.set("highlightThicknessMultiplier",t)},e.prototype.getHighlightThicknessMultiplier=function(){return this.get("highlightThicknessMultiplier")},e}(Z)),$={d1:function(t){return new t.scale1DConstructor(0,1,1,void 0)},d2:function(t){return(new t.scaleXYConstructor).W({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)}},tt=function(t,e,i){return e===i?t:i.j(e.U(t))},et=function(t,e,i){if(e===i)return t;var n=e instanceof Ti?e.x:e.x instanceof Ti?e.x.x:e.x.Y,r=e instanceof Ti?e.y:e.y instanceof Ti?e.y.y:e.y.Y,o=i instanceof Ti?i.x:i.x instanceof Ti?i.x.x:i.x.Y,s=i instanceof Ti?i.y:i.y instanceof Ti?i.y.y:i.y.Y;return u(u({},t),{x:tt(t.x,n,o),y:tt(t.y,r,s)})},it=function(t,e,i){var n=t(e,i);return function(t){return new G({color:n(t)})}},nt=function(t,e,i){var n=t(e+1,i);return function(t){return new j({stops:[{offset:0,color:n(t)},{offset:1,color:n(t).getDarker()}]})}},rt=function(t,e,i,n){var r=t(e+1,n);return function(t){return new K({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})}},ot=function(){for(var t=[],e=0;ee?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e)},Ft=function(t){return Array.prototype.concat.apply([],t)},Tt=function(t,e){for(var i={x:t[0].length,y:t.length},n=i.x,r=i.y,o=e.column,s=e.row,a=Math.max(0,o.start),l=Math.min(n,o.end),h=Math.max(0,s.start),u=Math.min(r,s.end),c=l-a,f=u-h,p=Array.from(Array(f)).map((function(){return Array(c)})),y=h,d=0;y0){for(var o=r?n(r):void 0,s=0;s=0&&t.splice(i,1)}},oe=function(t){return function(e){t.indexOf(e)<0&&t.push(e)}},se=function(t){for(var e=t.length,i=0;i=0?n:i.length;rt.max.x||e.max.xt.max.y||e.max.ye[1].x||t[3].ye[3].y)},Te=function(t,e){return A(m(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))),m(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))))},Ce=function(t,e){return e+t},De=function(t,e,i){var n=ei(e,t),r=n.x*n.x+n.y*n.y;if(0===r)return t;var o=ei(i,t),s=(o.x*n.x+o.y*n.y)/r;return s<=0?t:s>=1?e:m(t.x+s*n.x,t.y+s*n.y)},Le=function(t,e,i){return i>e?t>=e&&t<=i:t>=i&&t<=e},Pe=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)},Be=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n},Ee=function(t,e,i){var n=Be(e,i);if(0===n)return[Be(t,e),e];var r=oi(ei(t,e),ei(i,e))/n;r=Math.max(0,Math.min(1,r));var o=m(e.x+r*(i.x-e.x),e.y+r*(i.y-e.y));return[Be(t,o),o]},Oe=function(t,e,i){return ti(t,$e(ei(e,t),i))},_e=function(t,e,i){return xe.addVec(t,xe.multiply(xe.subtractVec(e,t),i))},Ve=function(t,e,i){for(var n=i.length,r=0;r0){for(var i=t[0].x,n=t[0].x,r=t[0].y,o=t[0].y,s=0;si&&(i=a.x),a.xr&&(r=a.y),a.y0){for(var i=t[0].x,n=t[0].x,r=t[0].y,o=t[0].y,s=t[0].z,a=t[0].z,l=0;li&&(i=h.x),h.xr&&(r=h.y),h.ys&&(s=h.z),h.ze.max.x?t.max.x:e.max.x,t.max.y>e.max.y?t.max.y:e.max.y))},Ye=function(t,e){return A(k(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 Ue(t,e,i,n){var r=t.x-n.x,o=t.y-n.y,s=n.x-i.x,a=i.y-n.y,l=a*r+s*o,h=(n.y-e.y)*r+(e.x-n.x)*o,u=a*(e.x-n.x)+s*(e.y-n.y);return u<0?l<=0&&h<=0&&l+h>=u:l>=0&&h>=0&&l+h<=u}function Ge(t,e,i){for(var n=ti(i,e[0]),r=e.length-2,o=0;oi.x){if(t.x>e.x)return!1;if(t.xi.x)return!1;if(t.xi.y){if(t.y>e.y)return!1;if(t.yi.y)return!1;if(t.yi.x)if(e.x>n.x){if(t.x>e.x)return!1;if(i.xn.x)return!1;if(t.xn.x){if(t.x>i.x)return!1;if(e.xn.x)return!1;if(e.xi.y)if(e.y>n.y){if(t.y>e.y)return!1;if(i.yn.y)return!1;if(t.yn.y){if(t.y>i.y)return!1;if(e.yn.y)return!1;if(e.yi.x||t.y>i.y||t.xi.x)if(e.x>n.x)if(e.x>r.x){if(t.x>e.x)return!1;if(r.xr.x)return!1;if(n.xr.x){if(t.x>n.x)return!1;if(r.xr.x)return!1;if(t.xn.x)if(i.x>r.x){if(t.x>i.x)return!1;if(r.xr.x)return!1;if(n.xr.x){if(t.x>n.x)return!1;if(r.xr.x)return!1;if(n.xi.y)if(e.y>n.y)if(e.y>r.y){if(t.y>e.y)return!1;if(r.yr.y)return!1;if(n.yr.y){if(t.y>n.y)return!1;if(r.yr.y)return!1;if(t.yn.y)if(i.y>r.y){if(t.y>i.y)return!1;if(r.yr.y)return!1;if(n.yr.y){if(t.y>n.y)return!1;if(r.yr.y)return!1;if(n.y0&&i<1&&n>0&&n<1?e=1:i<0&&i>-1&&n>0&&n<1?e=2:i<0&&i>-1&&n<0&&n>-1?e=3:i>0&&i<1&&n<0&&n>-1&&(e=4),e}var pi=function(t,e,i,n){var r,o,s,a;if(e.x-t.x!=0||n.x-i.x!=0)return e.x-t.x==0?(s=e.x,a=(o=(n.y-i.y)/(n.x-i.x))*(s-i.x)+i.y):n.x-i.x==0?(s=n.x,a=(r=(e.y-t.y)/(e.x-t.x))*(s-t.x)+t.y):(r=(e.y-t.y)/(e.x-t.x),o=(n.y-i.y)/(n.x-i.x),a=r*((s=(i.y-o*i.x+r*t.x-t.y)/(r-o))-t.x)+t.y),m(s,a)},yi=function(t,e){var i=t.length,n=e.length,r=new Uint16Array(i+n);return r.set(t,0),r.set(e,i),r},di=function(t,e){for(var i=[],n=Math.sin(e),r=Math.cos(e),o=0;o=e.dt?t:t+i}),0),this.st=t.reduce((function(t,i,n){return n>=e.dt&&nbi;return!o&&!s||!!r&&(e>t?{start:o?xi:t,end:s?bi:e}:{start:s?bi:t,end:o?xi:e})},e.prototype.U=function(t){var e=this.At(),i=this.Ft(),n=Math.max(t,xi);return e+(this.Et.function(n)-this.Vt.scaleStartLog)/this.Vt.scaleIntervalLog*(i-e)},e.prototype.j=function(t){var e=this.At(),i=(t-e)/(this.Ft()-e),n=this.Vt.scaleStartLog+i*this.Vt.scaleIntervalLog;return Math.pow(this.Et.number,n)},e.prototype.Pt=function(){this.Et&&this.Gt()},e.prototype.Nt=function(e,i){return t.prototype.Nt.call(this,e,i),this.Et&&this.Gt(),this},e.prototype.Mt=function(e){return t.prototype.Mt.call(this,e),this.Et&&this.Gt(),this},e.prototype.wt=function(e){return t.prototype.wt.call(this,e),this.Et&&this.Gt(),this},e.prototype.Wt=function(t){return this.Et={internal:t,function:vi(t),number:mi(t)},this},e.prototype.jt=function(){return this.Et.internal},e.prototype.Ut=function(t,e){var i=this.U(t)+e;return this.j(i)},Object.defineProperty(e.prototype,"Yt",{get:function(){return this.ut||this._t||this.ft||this.ht},enumerable:!1,configurable:!0}),e.prototype.Gt=function(){var t=this.Et.function(this.Rt),e=this.Et.function(this.zt)-t,i=2*this.At()/this.kt-1,n=2*this.Ft()/this.kt-1-i;return this.Vt={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:n},this.Vt},e.prototype.Xt=function(){return this.Vt},e}(gi),vi=function(t){return"e"===t?le:ae(t)},mi=function(t){return"e"===t?Math.E:t},xi=.9*Math.pow(10,-9),bi=1.1*Math.pow(10,32),ki=["K","M","B","T"],wi=function(t,e,i){var n=Math.abs(i-e),r=Math.max(2-Ae(n,10),0);return t.toFixed(r)},Mi={Numeric:function(t,e){return wi(t,e.getInnerStart(),e.getInnerEnd())},NumericUnits:function(t,e){var i=Math.abs(e.getInnerEnd()-e.getInnerStart()),n=t<0;t=Math.abs(t);var r=Ae(t,1e3),o=Math.pow(1e3,r),s="",a="";if(i>=1e3&&t>=1e3){for(var l=Math.pow(10,Ae(i,10)-1),h=Math.round(t/l)*l/o,u=r;u>0;){var c=Math.min(u,ki.length)-1;a=ki[c]+a,u-=c+1}s=(n?"-":"")+h}else{for(h=String(Math.floor(t)),u=1;u<=r;u+=1){var f=h.length-(3*u+(u-1));h=h.substring(0,f)+" "+h.substring(f,h.length)}s=(n?"-":"")+h+(i<=10?function(t,e){if(0===e)return"";var 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-Ae(i,10)):"")}return s+a}},Ai=function(t,e){var i=vi(e);return"e"===e?t?function(t,e){return Math.floor(i(t))+"e"}:function(){return""}:function(t,e){var n=t.toString();if(t>1)return n;var r=Math.floor(i(t));return t.toFixed(Math.abs(r))}},Ii=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.Zt=!1,o.Yt=!1,o.Kt=0,o.kt=1e3,o.Nt(0,10),o.qt(),o}return h(e,t),e.prototype.Ht=function(t,e,i,n,r){if(t===e)return!1;var o=Math.abs(n-i),s=Math.abs(e-t);if(!this.Zt){var a=function(t,e,i){var n=function(t,e){if(eke&&tke){var i=Math.abs(t/Math.pow(2,23)),n=Math.abs(e/Math.pow(2,23)),r=Math.min(i,n);return Math.pow(10,Math.floor(Math.log10(r)))}}(t,e);if(void 0!==n)return n*i}(t,e,this.getCellSize());if(void 0===a)return!1;if(s>a)return!0;var l=(e+t)/2,h=(r?a/2:o/2)*(t>e?-1:1);return{start:l-h,end:l+h}}var u=Math.pow(10,-(12-Math.log10(Math.max(Math.abs(t),1))));if(s>u)return!0;var c=(e+t)/2,f=(r?u/2:o/2)*(t>e?-1:1);return{start:c-f,end:c+f}},e.prototype.Pt=function(){this.qt()},e.prototype.U=function(t){return this.At()+(t-this.Rt)/(this.zt-this.Rt)*(this.Ft()-this.At())},e.prototype.j=function(t){return this.Rt+(t-this.At())/(this.Ft()-this.At())*(this.zt-this.Rt)},e.prototype.Nt=function(e,i){return t.prototype.Nt.call(this,e,i),this.qt(),this},e.prototype.Mt=function(e){return t.prototype.Mt.call(this,e),this.qt(),this},e.prototype.wt=function(e){return t.prototype.wt.call(this,e),this.Jt=Fi(this.zt-this.Rt,this.ct,this.kt,this.st,this.ot),this.qt(),this},e.prototype.Qt=function(){return this.Zt=!0,this},e.prototype.$t=function(){return this.Zt},e.prototype.ti=function(){return Math.abs(this.ii)},e.prototype.ni=function(){return this.ti()/this.Jt},e.prototype.ei=function(){return this.ri},e.prototype.si=function(){return this.oi},e.prototype.getPixelSize=function(){return this.Jt},e.prototype.Xt=function(){return this.Vt},e.prototype.Dt=function(){return t.prototype.Dt.call(this),this.Yt=!0,this},e.prototype.Ot=function(){return t.prototype.Ot.call(this),this.Yt=!1,this},e.prototype.hi=function(t,e){return void 0===e&&(e=Mi.Numeric),e(t,this)},e.prototype.ai=function(){var t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e},e.prototype.ci=function(t){return Fi(t,this.ct,this.kt,this.st,this.ot)},e.prototype.qt=function(){var t=this.Rt,e=this.zt,i=0;this.Zt&&(t=0,e=this.zt-this.Rt,i=this.Rt);var n=e-t,r=Fi(n,this.ct,this.kt,this.st,this.ot);this.oi=t-this.ct[0]*r,this.ri=e+this.ct[1]*r;var o=this.ri-this.oi,s=o-this.ii,a=Math.abs(s/r),l=n-this.Kt,h=Math.abs(l/r);(!this.Vt||a>=.4||h>=.4)&&(this.Kt=n,this.ii=o,this.Jt=r,this.Yt=!0);var u=this.ii*this.ot/(2*this.st),c=-(this.oi-this.ii*this.rt/this.st)-u,f=2*this.At()/this.kt-1,p=2*this.Ft()/this.kt-1-f;this.Vt={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:f,viewportSize:p,scaleStartLog:0,scaleIntervalLog:0}},e.prototype.Ut=function(t,e){return t+this.Jt*e},e}(gi),Fi=function(t,e,i,n,r){return void 0===n&&(n=1),void 0===r&&(r=1),t/(i*n/r-(e[0]+e[1]))},Ti=function(){function t(){}return t.prototype.fi=function(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this},t.prototype.Ot=function(){return this.x.Ot(),this.y.Ot(),this},t.prototype.Dt=function(){return this.x.Dt(),this.y.Dt(),this},t.prototype.wt=function(t,e){return"object"==typeof t?(this.x.wt(t.x),this.y.wt(t.y)):(this.x.wt(t),this.y.wt(e)),this},t.prototype.Bt=function(){return m(this.x.Bt(),this.y.Bt())},t.prototype.li=function(t){return this.x.Mt(t),this},t.prototype.di=function(t){return this.y.Mt(t),this},t.prototype.Ct=function(){return m(this.x.Ct(),this.y.Ct())},t.prototype.vi=function(t,e){return this.x.Nt(t,e),this},t.prototype.yi=function(t,e){return this.y.Nt(t,e),this},t.prototype.getInnerIntervalPixels=function(){var t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.Ct(),y:e-this.y.Ct()}},t.prototype.Si=function(){return this.x.Yt||this.y.Yt},t}(),Ci=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mi="LinearScaleXY",e}return h(e,t),e.prototype.W=function(t,e,i,n){return this.x=new Ii(t.x,e.x,i.x,n?n.x:void 0),this.y=new Ii(t.y,e.y,i.y,n?n.y:void 0),this},e.prototype.$t=function(){return this.x.$t()||this.y.$t()},e.prototype.pi=function(){return m(this.x.getPixelSize(),this.y.getPixelSize())},e.prototype.Xt=function(){return{x:this.x.Xt(),y:this.y.Xt()}},e.prototype.Ut=function(t,e){var i=this.pi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}},e.prototype.gi=function(t,e,i,n){var r=this.pi(),o=Qe(t,e);return o.x*=n,o.y*=n,{x:t.x+i*r.x*o.x,y:t.y+i*r.y*o.y}},e}(Ti),Di=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mi="MixedScaleXY",e}return h(e,t),e.prototype.$t=function(){return!1},e.prototype.Ut=function(t,e){var i=this.x.U(t.x),n=this.y.U(t.y),r={x:i+e.x,y:n+e.y};return{x:this.x.j(r.x),y:this.y.j(r.y)}},e.prototype.gi=function(t,e,i,n){var r={x:this.x.U(t.x),y:this.y.U(t.y)},o={x:this.x.U(e.x),y:this.y.U(e.y)},s=qe(ei(o,r)),a=Qe(o,r),l={x:r.x+s.x*n+a.x*i,y:r.y+s.y*n+a.y*i};return{x:this.x.j(l.x),y:this.y.j(l.y)}},e.prototype.Xt=function(){var t=this.x.Xt(),e=this.y.Xt();return{uScaleStart:[this.x.Rt,this.y.Rt],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]}},e}(Ti),Li={fitting:{start:function(t,e,i,n){return e>=t?i:n},end:function(t,e,i,n){return e>=t?n:i}},expansion:{start:function(t,e,i,n){return e>=t?it?n:t},end:function(t,e,i,n){return e>=t?n>e?n:e:it?Li.progressive.end(t,e,i,n)+(t-e):n>t?n:t},end:function(t,e,i,n){return e>t?n>e?n:e:Li.progressive.start(t,e,i,n)+(e-t)}},regressive:{start:function(t,e,i,n){return e>t?it?Li.regressive.start(t,e,i,n)+(e-t):i1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r.push(o),r},Ni=function(t,e,i,n,r){return i&&(t=t.filter((function(t,e){return e>0}))),n&&(t=t.filter((function(e,i){return i0?e.length:t?1:0;return function(i,r,o,s,a,l){if(!(r>=n)){var h=e[r]||1,u=!1,c=!1,f=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,f="offset"in t&&void 0!==t.offset?t.offset:f),Ni(i,h,u,c,f)}}},Hi={linear:function(t,e,i){var n=e-t;return function(r){return r0){var e=this.Mi[0];return t&&(this.Fi.listeners("allEnd").forEach((function(t,i){return e.onAllAnimationEnd(t,i)})),this.Fi.listeners("everyEnd").forEach((function(t,i){return e.onEveryAnimationEnd(t,i)}))),e.addNextAnimations(this.Mi.slice(1)),e.start(),t&&(this.Fi.emit("end",e),this.Fi.emit("everyEnd",e)),e}t&&(this.Fi.emit("end",void 0),this.Fi.emit("everyEnd",void 0),this.Fi.emit("allEnd"))},t.prototype.finishAll=function(t){void 0===t&&(t=!0);for(var e=this;e;)e=e.finish(t)},t.prototype.getFinalValues=function(){return this.Mi.length>0?this.Mi[this.Mi.length-1].wi.map(bt):this.wi.map(bt)},t.prototype.getTimeUntilFinish=function(){for(var t=this.duration-this.delta,e=0;e60&&console.log("Note: Animator FPS is usually capped at 60 by the browser!");var i,n,r=[],o=0,s=function(){i=void 0;var a=Date.now();(o=a-(n=n||a))/1e3>=1/e&&(n=Date.now()-o%(1e3/e),r.forEach((function(t){t.delta+=o-o%(1e3/e),t.delta>t.duration&&(t.delta=t.duration),t.action(t.eases.map((function(e){return e(t.delta)}))),t.delta===t.duration&&t.finish()})),t()),r.length>0?i=gt.requestAnimationFrame(s):(i=void 0,n=void 0)};return function(t,e){return void 0===t&&(t=1e3),void 0===e&&(e=Hi.linear),function(n,o,a){void 0===a&&(a=t);var l=new Yi(n,o,a,e,r).start();return i||(i=gt.requestAnimationFrame(s)),l}}},Gi=function(t,e){if(e.has(t))return e.get(t);var i=Ne(t.label.Ti());return e.set(t,i),i},Xi=function(t){var e,i,n,r,o=new Map;if(t!==Ei){try{for(var s=c(t.Ci),a=s.next();!a.done;a=s.next()){var l=a.value;o.set(l,new Map)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}try{for(var h=c(t.Bi),u=h.next();!u.done;u=h.next()){var f=u.value;o.set(f,new Map)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}return o},Wi=function(){function t(t,e,i,n,o,s,a){var l=this;this.chart=t,this.Li=e,this.Ii=n,this.Pi=s,this.Fi=new r.Eventer,this.Oi=Ei,this.Di=Pi.Empty,this._i=new Map,this.Ri=new Map,this.zi=Li.fitting,this.Ni=!0,this.Ei=Ui((function(){return l.chart.engine.Vi()}))(300,Hi.linear),this.Gi=!1,this.Hi=!1,this.Wi=ke,this.ji=!1,this.Ui=!1,this.Yi=ke,this.Xi=ke,this.Zi=ke,this.release=function(){!1!==l.Hi&&(l.Hi=!1,l.Wi=gt.performance.now(),l.chart.engine.Vi())},this.Ki={},this.qi=function(t){var e=l._i.get(t.tickLevel);e&&e.delete(t.value);var i=l.Ri.get(t.tickLevel);i&&i.has(t.value)||i&&i.set(t.value,t)},this.Ji=Mt,this.Qi=function(t,e,i,n,r,o){var s,a,h=[],u=[];try{for(var f=c(t),p=f.next();!p.done;p=f.next()){var y=p.value;if(yn)h.push(y);else{var d=l._i.get(e),g=(d?d.get(y):void 0)||l.$i(y,e);g.label.restore(),g.tn(!1);var S=l.nn(g,r);o.set(g,S),h.push(y),u.push(g)}}}catch(t){s={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(s)throw s.error}}return{displayedKeyValues:h,createdTicks:u}},this.en=function(t,e,i,n,r,o,s,a,h,u,c){for(var f=[],p=function(p){var y=t[p],d=e[p],g=void 0,S=void 0;if(l.rn(y,i)){var v=Gi(y,h);g=(S=[t[p-1],t[p+1]].concat(u).concat(c).filter((function(t){return void 0!==t})).filter((function(e){return e.tickLevel!==i||!!t.find((function(t){return t===e}))})).map((function(t){return Ie(v,Gi(t,h))?t:void 0}))).some((function(t){return void 0!==t}))}else g=!1;if(g){var m=!0,x=S.filter((function(t){return void 0!==t}));return m&&i.sn&&x.every((function(t){return Bi(t.tickLevel)}))&&(m=!1),m&&i.sn&&i.sn.hn&&!1===i.sn.hn(d,n,r,o,s,a)&&(m=!1),!1===m?"continue":{value:!0}}f.push(y)},y=0;yh&&(l={start:(s=(e+t)/2)-(a=this.Oi.Cn/2*(t>e?-1:1)),end:s+a}),void 0!==this.Oi.Bn&&this.Oi.Bne?-1:1)),end:s+a});var u=this.Y.Ht(l.start,l.end,this.ln,this.dn,!0);if(!1===u)return this;!0===u||(l=u);var c="interactionZoom"!==r;if(this.stop(),this.Ei&&(!0===i||i>0)){var f=!0===i?void 0:i,p=!this.Ln||this.Ln.isOver()?this.Ei:this.Ln.NextAnimation.bind(this);this.Ln=p([[this.ln,l.start],[this.dn,l.end]],this.an,f),this.Ln.onAnimationEnd((function(){o.Ln=void 0,o.chart.In(),c&&(o.Zi=gt.performance.now())})),n||this.Ln.onAnimationEnd(this.release)}else this.un(l.start,l.end),n||this.release(),c&&(this.Zi=gt.performance.now());return this},t.prototype.getInterval=function(){return{start:this.ln,end:this.dn}},t.prototype.stop=function(){return this.Ln&&this.Ln.finishAll(!1),this.Ln=void 0,!0!==this.Hi&&(this.Hi=!0,this.Wi=gt.performance.now()),this.chart.In(),this.chart.engine.Vi(),this},t.prototype.isStopped=function(){return this.Hi},t.prototype.fit=function(t,e){void 0===e&&(e=!1);var i=this.Pn(!1);if(i){var n=this.dn>=this.ln,r=n?i.min:i.max,o=n?i.max:i.min;this.Tn(r,o,t,e,"userFit")}return this},t.prototype.setScrollStrategy=function(t){return this.zi=t,this.chart.engine.Vi(),this},t.prototype.getScrollStrategy=function(){return this.zi},t.prototype.setAnimationScroll=function(t){return this.Ni=Boolean(t),this.chart.engine.Vi(),this},t.prototype.setAnimationZoom=function(t,e){var i=this;return void 0===e&&(e=300),this.Ln&&(this.Ln.finishAll(!1),this.Ln=void 0),this.Ei=t?Ui((function(){return i.chart.engine.Vi()}))(e,t):void 0,this},t.prototype.setAnimationsEnabled=function(t){return this.Gi=!!t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(Hi.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this},t.prototype.getAnimationsEnabled=function(){return this.Gi},t.prototype.disableAnimations=function(){return this.setAnimationsEnabled(!1),this},t.prototype.onScaleChange=function(t){return this.Fi.on("scaleChange",t)},t.prototype.offScaleChange=function(t){return this.Fi.off(t,"scaleChange")},t.prototype.On=function(t,e){var i,n,r,o,s,a,l=new Map;if(this.Oi===Ei)return this.kn(),l;e=e||new Map;var h=this.Dn(),u=h.min,y=h.max,d=y-u,g=t.physicalAxisSize;this.Ki.physicalAxisSize=g;var S=this._n(this.Oi,u,y,this.ln,this.dn,g),v=[];if(this.Rn(),v.push.apply(v,p([],f(this.zn(this.Oi,u,y,S,e,t,l)))),this.Nn(this.Oi,u,y,S,e,t,v,l),this.En(),S)try{for(var m=c(this.Ri),x=m.next();!x.done;x=m.next()){var b=f(x.value,2),k=b[0],w=b[1],M=S.get(k);if(void 0===M)return l;try{for(var A=(r=void 0,c(w)),I=A.next();!I.done;I=A.next()){var F=f(I.value,1)[0];try{for(var T=(s=void 0,c(M)),C=T.next();!C.done;C=T.next())if(C.value===F)return l}catch(t){s={error:t}}finally{try{C&&!C.done&&(a=T.return)&&a.call(T)}finally{if(s)throw s.error}}w.delete(F)}}catch(t){r={error:t}}finally{try{I&&!I.done&&(o=A.return)&&o.call(A)}finally{if(r)throw r.error}}}}catch(t){i={error:t}}finally{try{x&&!x.done&&(n=m.return)&&n.call(m)}finally{if(i)throw i.error}}return this.Ki.min=u,this.Ki.max=y,this.Ki.scaleInterval=d,this.Ki.physicalAxisSize=g,l},t.prototype._n=function(t,e,i,n,r,o){var s,a,l,h,u,f=new Map;try{for(var p=c(t.Ci),y=p.next();!y.done;y=p.next()){var d=(v=y.value).Vn(e,i,n,r);d=this.Gn(d),f.set(v,d)}}catch(t){s={error:t}}finally{try{y&&!y.done&&(a=p.return)&&a.call(p)}finally{if(s)throw s.error}}try{for(var g=c(t.Bi),S=g.next();!S.done;S=g.next()){var v=S.value;if(d=void 0,void 0===u)d=v.Vn(e,i,e,i);else{var m=[],x=o/(u.filter((function(t){return e<=t&&t<=i})).length-1);if(void 0!==v.Hn&&v.Hn>x)break;for(var b=0;bi)return"continue";var n=v._i.get(d),a=(n?n.get(t):void 0)||v.$i(t,d);a.label.restore();var l=v.nn(a,o),h=Gi(a,r);f.find((function(t){return Ie(h,Gi(t,r))}))&&a.label.dispose(),a.tn(!1),s.set(a,l),f.push(a)},v=this;try{for(var m=(h=void 0,c(g)),x=m.next();!x.done;x=m.next())S(x.value)}catch(t){h={error:t}}finally{try{x&&!x.done&&(u=m.return)&&u.call(m)}finally{if(h)throw h.error}}}}catch(t){a={error:t}}finally{try{y&&!y.done&&(l=p.return)&&l.call(p)}finally{if(a)throw a.error}}return f},t.prototype.Nn=function(t,e,i,n,r,o,s,a){var l,h,u,f=[],p=function(t){var l,h,p=n.get(t);if(!p)return"break";var d=void 0;if(void 0===u)d=[{start:e,end:i,keyValues:p}];else{d=[];for(var g=0;g=S&&k0){if(void 0===t.sn)return C=!1,"break";var h=t.sn.Jn;if(void 0===(l=h(l.slice(),w-1,o,a,e,i)))return"break"}var u=y.en(I.filter((function(t){return l.some((function(e){return At(t.value,e)}))})),A,t,w,o,a,e,i,r,s,f);if(!0===u)return w+=1,M=-1,T=[],"continue";T=T.concat(u)};++Mthis.Y.getInnerStart()?this.Y.getInnerEnd():this.Y.getInnerStart();return A(t,e)},t.prototype.ie=function(t,e,i){for(var n,r,o=[],s="left"===i?t.ne():t.ee(),a=0;s&&a<2;){var l=s.value.value,h=0;try{for(var u=(n=void 0,c(l)),f=u.next();!f.done;f=u.next()){var p=f.value;this.rn(p,e)&&(h+=1,o.push(p))}}catch(t){n={error:t}}finally{try{f&&!f.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}0!==l.length&&0!==h&&(a+=1),s="left"===i?s.ne():s.ee()}return o},t.prototype.rn=function(t,e){return!(t.te()||0===t.label.vn().length||Bi(e)&&!0!==e.re)},t.prototype.se=function(t,e){return this.Oi===Ei||(this.Oi.Ci.forEach((function(i){e=t(e,i.Xn)})),this.Oi.Bi.forEach((function(i){(function(t){return void 0!==t.jn})(i)&&(e=t(e,i.Xn))}))),e},t.prototype.Pn=function(t){var e,i,n;try{for(var r=c(this.oe()),o=r.next();!o.done;o=r.next()){var s=o.value;if(s.he()){var a=this.Li.ae(s),l=this.Li.ue(s);if(void 0!==a&&vt(a)&&void 0!==l&&vt(l)){if("logarithmic"===this.cn.type){var h=void 0;if(Math.sign(a)!==Math.sign(l)&&(h="Logarithmic series data range must be either > 0 or < 0 (encountered ["+a+", "+l+"])"),0!==a&&0!==l||(h="Logarithmic series data range is not defined at 0 (encountered ["+a+", "+l+"])"),h)throw gt.alert(h),new Error(h)}n?(n.min=Math.min(n.min,a),n.max=Math.max(n.max,l)):n=A(a,l)}}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}if(n&&vt(n.min)&&vt(n.max)){if(At(n.min,n.max)){if(t)return;return{min:n.min-1,max:n.max+1}}return n}},t.prototype.ce=function(){var t,e,i=0;try{for(var n=c(this.oe()),r=n.next();!r.done;r=n.next()){var o=r.value,s=this.Li.fe(o);s&&(i=Math.max(i,s))}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return i},t.prototype.le=function(){var t=this,e=this.oe(),i=this.ji,n=!1;if(0!==e.length&&this.zi&&!this.Hi){var r=this.Pn(!0);if(r){var o=this.ln,s=this.dn,a=this.zi.start(o,s,r.min,r.max),l=this.zi.end(o,s,r.min,r.max),h=!1===At(o,a),u=!1===At(s,l);if(a=h?a:o,l=u?l:s,h||u){var c=!1;if(this.Ni)if(this.Ni){c=!0;var f=h?this.de(o,a):o,p=u?this.de(s,l):s;if(!0===this.un(f,p,{allowClamping:!1})&&(h&&!1===At(f,a)||u&&!1===At(p,l))){this.chart.engine.Vi(!0),n=!0;var y=Math.abs(l-a)/Math.abs(f-p);y<1&&(y=1/y),this.Ui=y>=1.4}}else c=!1;c||this.un(a,l)}}}n?(this.ji!==n&&(this.ji=n,this.Yi=gt.performance.now()),this.ve&&(clearTimeout(this.ve),this.ve=void 0)):!0===i&&void 0===this.ve&&(this.Ui=!1,this.ve=setTimeout((function(){!1!==t.ji&&(t.ji=!1,t.Yi=gt.performance.now()),t.ve=void 0,t.chart.engine.Vi()}),200))},t.prototype.un=function(t,e,i){var n,r,o=!i||!("allowClamping"in i)||void 0===i.allowClamping||i.allowClamping,s={start:t,end:e},a=!0,l=Math.abs(e-t),h=Math.abs(this.dn-this.ln);void 0!==this.Oi.Cn&&this.Oi.Cn>l&&(s={start:(n=(e+t)/2)-(r=(o?this.Oi.Cn/2:h/2)*(t>e?-1:1)),end:n+r},a=!1),void 0!==this.Oi.Bn&&this.Oi.Bne?-1:1)),end:n+r},a=!1);var u=this.Y.Ht(s.start,s.end,this.ln,this.dn,o);if(!1===u)return!1;!0!==u&&(s=u);var c=this.ce(),f=this.ye(Math.min(s.start,s.end),Math.max(s.start,s.end),c);return!!(u=this.Y.Ht(s.end>s.start?f.min:f.max,s.end>s.start?f.max:f.min,this.ln,this.dn,!1))&&(!0===u?this.Y.Nt(s.end>s.start?f.min:f.max,s.end>s.start?f.max:f.min):this.Y.Nt(s.start,s.end),this.ln=s.start,this.dn=s.end,this.Fi.emit("scaleChange",s.start,s.end),this.Xi=gt.performance.now(),this.chart.engine.Vi(),a)},t.prototype.Se=function(){return this.ji},t.prototype.me=function(){return void 0!==this.Ln},t}(),ji=function(){function t(t,e,i,n,r,o,s){void 0===s&&(s=r.pe(o).setMouseInteractions(!1)),this.tickLevel=t,this.value=e,this.ge=i,this.be=n,this.xe=r,this.we=o,this.label=s,this.ke=!1}return t.prototype.restore=function(){return this.label.restore(),this.be(this),this},t.prototype.dispose=function(){return this.label.dispose(),this.ke=!0,this.ge(this),this},t.prototype.tn=function(t){return this.ke=t,this},t.prototype.te=function(){return this.ke},t.prototype.isDisposed=function(){return this.label.isDisposed()},t}(),Ki=function(t){function e(e){return t.call(this,e)||this}return h(e,t),e.prototype.setSize=function(t){return this.set("size",t)},e.prototype.setFamily=function(t){return this.set("family",t)},e.prototype.setWeight=function(t){return this.set("weight",t)},e.prototype.setStyle=function(t){return this.set("style",t)},e.prototype.setVariant=function(t){return this.set("variant",t)},e.prototype.getSize=function(){return this.get("size")},e.prototype.getFamily=function(){return this.get("family")},e.prototype.getWeight=function(){return this.get("weight")},e.prototype.getStyle=function(){return this.get("style")},e.prototype.getVariant=function(){return this.get("variant")},e}(n.Record({size:14,family:"Arial",weight:"normal",style:"normal",variant:!1})),Zi=new Ki,qi=function(){},Qi=new qi,Ji=function(t){function e(e){return t.call(this,e)||this}return h(e,t),e.prototype.setSize=function(t){return this.set("size",t)},e.prototype.getSize=function(){return this.get("size")},e.prototype.setFillStyle=function(t){return"function"==typeof t?this.set("fillStyle",t(this.get("fillStyle"))):this.set("fillStyle",t)},e.prototype.getFillStyle=function(){return this.get("fillStyle")},e.prototype.setWireframeStyle=function(t){return"function"==typeof t?this.set("wireframeStyle",t(this.get("wireframeStyle"))):this.set("wireframeStyle",t)},e.prototype.getWireframeStyle=function(){return this.get("wireframeStyle")},e.prototype.setShape=function(t){return this.set("shape",t)},e.prototype.getShape=function(){return this.get("shape")},e.prototype.getDefaultHighlightStyle=function(){return this.G||(this.G=this.setFillStyle(this.getFillStyle().getDefaultHighlightStyle())),this.G},e}(n.Record({shape:"sphere",size:10,fillStyle:new G,wireframeStyle:Q})),$i=function(t){function e(e){return t.call(this,e)||this}return h(e,t),e.prototype.setSize=function(t){return this.set("size",t)},e.prototype.getSize=function(){return this.get("size")},e.prototype.setFillStyle=function(t){return"function"==typeof t?this.set("fillStyle",t(this.get("fillStyle"))):this.set("fillStyle",t)},e.prototype.getFillStyle=function(){return this.get("fillStyle")},e.prototype.getDefaultHighlightStyle=function(){return this.G||(this.G=this.setFillStyle(this.getFillStyle().getDefaultHighlightStyle())),this.G},e}(n.Record({size:5,fillStyle:new G})),tn={Triangulated:Ji,Pixelated:$i},en=new Map,nn=function(t){var e=t.getSize(),i=t.getFamily(),n=t.getWeight(),r=t.getStyle(),o=t.getVariant(),s=r+" "+(o?"small-caps":"normal")+" "+n+" "+e+"px "+i,a=en.get(s);return a||(a=function(t,e){return{font:t,properties:e}}(s,{size:e,family:i,style:r,variant:o,weight:n}),en.set(s,a)),a},rn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e}(n.Record({gridStrokeLength:1,gridStrokeStyle:new J,tickLength:7,tickStyle:new J,tickPadding:0,labelFont:new Ki,labelFillStyle:new G,labelPadding:0,labelAlignment:0,labelRotation:0})),on=function(t){function e(e){return t.call(this,e)||this}return h(e,t),e.prototype.setGridStrokeLength=function(t){return this.set("gridStrokeLength",t)},e.prototype.getGridStrokeLength=function(){return this.get("gridStrokeLength")},e.prototype.setGridStrokeStyle=function(t){return this.set("gridStrokeStyle","function"==typeof t?t(this.get("gridStrokeStyle")):t)},e.prototype.getGridStrokeStyle=function(){return this.get("gridStrokeStyle")},e.prototype.setTickLength=function(t){return this.set("tickLength",t)},e.prototype.getTickLength=function(){return this.get("tickLength")},e.prototype.setTickStyle=function(t){return this.set("tickStyle","function"==typeof t?t(this.get("tickStyle")):t)},e.prototype.getTickStyle=function(){return this.get("tickStyle")},e.prototype.setTickPadding=function(t){return this.set("tickPadding",t)},e.prototype.getTickPadding=function(){return this.get("tickPadding")},e.prototype.setLabelFillStyle=function(t){return this.set("labelFillStyle","function"==typeof t?t(this.get("labelFillStyle")):t)},e.prototype.getLabelFillStyle=function(){return this.get("labelFillStyle")},e.prototype.setLabelFont=function(t){return this.set("labelFont","function"==typeof t?t(this.get("labelFont")):t)},e.prototype.getLabelFont=function(){return this.get("labelFont")},e.prototype.setLabelPadding=function(t){return this.set("labelPadding",t)},e.prototype.getLabelPadding=function(){return this.get("labelPadding")},e.prototype.setLabelAlignment=function(t){return this.set("labelAlignment",t)},e.prototype.getLabelAlignment=function(){return this.get("labelAlignment")},e.prototype.setLabelRotation=function(t){return this.set("labelRotation",t)},e.prototype.getLabelRotation=function(){return this.get("labelRotation")},e}(rn),sn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e}(rn),an=Object.assign(Object.create(new sn),{}),ln=-1,hn=function(t,e,i,n,r){return function(o){return function(s){var a=new Date(s+o),l={year:a.getFullYear(),monthIndex:a.getMonth(),day:a.getDate(),hours:a.getHours(),minutes:a.getMinutes(),seconds:a.getSeconds(),millis:a.getMilliseconds()},h=n?n(l):void 0;if(0===t&&!0===h)return s;var u=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);var c=(0===t?1:t)*i;return t===ln&&!1===h&&(c=0),0!==c&&(l[e]=i*(c>0?Math.floor((u+c)/i):Math.ceil((u+c)/i))),new Date(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis).getTime()-o}}},un=function(t,e,i){for(var n=[],r=3;r=2?r-1:r+6:s+=r>0?8-r:1),new Date(n.getFullYear(),n.getMonth(),s,0,0,0,0).getTime()-e}}},dn=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:Ri({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:Ri(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:un("seconds",1,(function(t){return 0===t.millis}),"millis")},majorTicks:{fitFunction:Ri({ignore:"first"},5,10,15,30)},minorTicks:{amount:4,fitFunction:Ri(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:un("minutes",1,(function(t){return 0===t.seconds&&0===t.millis}),"seconds","millis")},majorTicks:{fitFunction:Ri({ignore:"first"},5,10,15,30)},minorTicks:{amount:12,fitFunction:Ri(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:un("hours",1,(function(t){return 0===t.minutes&&0===t.seconds&&0===t.millis}),"minutes","seconds","millis")},majorTicks:{fitFunction:Ri({ignore:"first"},3,6,12)},minorTicks:{amount:8,fitFunction:Ri(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:un("day",1,(function(t){return 0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis}),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:Ri({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:Ri({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:yn(ln),getNextKeyValueIncludingRef:yn(0),getNextKeyValue:yn(1),greatTicks:!0,majorTicks:{fitFunction:Ri(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:cn("monthIndex",1,(function(t){return 1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis}),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:fn("monthIndex",1,(function(t){return 1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis}),"day","hours","minutes","seconds","millis"),getNextKeyValue:pn("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Ri(void 0,2,3)},minorTicks:{fitFunction:Ri(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:cn("year",1,(function(t){return 1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis}),"monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:fn("year",1,(function(t){return 1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis}),"monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:pn("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Ri({ignore:"first"},2,5)},minorTicks:{fitFunction:Ri(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:cn("year",10,(function(t){return 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:fn("year",10,(function(t){return 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:pn("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Ri(void 0,2,4)},minorTicks:{fitFunction:Ri(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:cn("year",100,(function(t){return 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:fn("year",100,(function(t){return 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:pn("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:cn("year",1e3,(function(t){return 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:fn("year",1e3,(function(t){return 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:pn("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],gn=function(t,e,i){var n=function(t,e,i,n,r){for(var o,s=e-t,a=0;ar?i:n,h=(i+n)/2,u=o>r?n:i;if(dn.indexOf(s)<=dn.findIndex((function(t){return"Hour"===t.label})))return"left"===e?[l]:[];if(!0===s.irregular)a=zi(i,n,s.getPrevKeyValue(t),s.getNextKeyValue(t));else{var f=s.greatTicks.getReferenceKeyValue(t)(i);a=Vi(i,n,s.unit,f)}var p=function(t,e,i){var n,r;try{for(var o=c(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(a>=t&&a<=e)return a}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(i,n,a);return"left"===e?void 0===p||Le(p,h,u)?[l]:[p]:void 0!==p&&Le(p,h,u)?[p]:[u]}},vn=function(t,e){return function(i,n,r,o){var s,a=gn(t,r,o);if(void 0===a)return[];if("great"===t&&void 0!==a.greatTicks)if(!0===a.irregular)s=zi(i,n,a.getPrevKeyValue(e),a.getNextKeyValue(e));else{var l=a.greatTicks.getReferenceKeyValue(e)(i);s=Vi(i,n,a.unit,l)}else if("major"===t&&void 0!==a.majorTicks)s=!0===a.irregular?function(t,e,i,n){for(var r=[],o=i(t),s=0;o1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r.push(o),r}(i,n,a.getPrevKeyValue(e),a.getNextKeyValue(e)):function(t,e,i){for(var n=[],r=t,o=0;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return n.push(r),n}(i,n,a.unit);else{if("minor"!==t||void 0===a.minorTicks)return[];if(!0===a.irregular)s=function(t,e,i,n){for(var r=[],o=i(t),s=0;o1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r}(i,n,a.getNextKeyValueIncludingRef(e),a.getNextKeyValue(e));else{var h=function(t){if(void 0!==t)return dn[dn.indexOf(t)+1]}(a);if(void 0===h)return[];s=_i(i,n,h.unit/a.minorTicks.amount)}}return s}},mn=function(t){return function(e,i,n,r,o,s){var a,l=gn(t,o,s);if(void 0!==l)return"major"===t?a=l.majorTicks.fitFunction:l.minorTicks&&(a=l.minorTicks.fitFunction),a?a(e,i,n,r,o,s):void 0}},xn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.Mn=function(t){var e=this,i=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,n=function(t){return dn.map((function(i){var n=function(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}}(e,t,i);if("object"!=typeof n)return n;try{return new Intl.DateTimeFormat(e.locale,n)}catch(t){var r="";for(var o in n)r+=" "+o+": "+n[o]+",";console.error("Invalid Intl.DateTimeFormat ( locale: "+e.locale+", formatOptions {"+r+"} )")}}))},r=new Map;r.set("great",n("Great")),r.set("major",n("Major")),r.set("minor",n("Minor"));var o=function(t){return String(t)},s=function(t,n){return function(s,a){var l=s+i,h=a.getInnerStart(),u=a.getInnerEnd(),c=h>u,f=gn(t,c?u:h,c?h:u);if(void 0===f)return o(l);"great"===t&&(l=(!1===At(s,"left"===n?h:u)?s:!1===f.irregular?"left"===n&&!1===c||"right"===n&&!0===c?f.greatTicks.getReferenceKeyValue(i)(s):f.greatTicks.getReferenceKeyValue(i)(s+1*f.unit):"left"===n&&!1===c||"right"===n&&!0===c?f.getPrevKeyValue(i)(s):f.getNextKeyValue(i)(s))+i);var p=r.get(t);if(void 0===p)return o(l);var y=p[dn.indexOf(f)];return void 0===y?"":"function"==typeof y?y(l,a,e.locale):y.format(l)}},a=[],l=[{Me:"Great ticks (directive)",Ae:0,qn:!0,Vn:vn("great",i),Hn:void 0},{Me:"Major ticks",Ae:1,Xn:this.majorTickStyle,jn:s("major"),Vn:vn("major",i),sn:{Jn:mn("major")},Hn:void 0}];this.greatTickStyle!==an&&(a.push({Me:"Great ticks (left)",Xn:this.greatTickStyle.setLabelAlignment(-1),jn:s("great","left"),Vn:Sn(i,"left"),bi:!0,re:!1}),a.push({Me:"Great ticks (right)",Xn:this.greatTickStyle.setLabelAlignment(1),jn:s("great","right"),Vn:Sn(i,"right"),bi:!0,re:!1})),this.minorTickStyle!==an&&l.push({Me:"Minor ticks",Ae:2,Xn:this.minorTickStyle,jn:s("minor"),Vn:vn("minor",i),sn:{Jn:mn("minor"),hn:function(t,e,i,n,r,o){var s=gn("minor",r,o);return!s||"Week"!==s.label}},Hn:void 0});var h=this.cursorFormatter;return{Ci:a,Bi:l,xi:h?function(t,e,n){return h(i+t,e,n)}:function(t,e,n){var r=new Date(i+t);return new Intl.DateTimeFormat(n,{year:"numeric",month:"numeric",day:"numeric",minute:"2-digit",hour:"2-digit"}).format(r)+" "},Cn:1e3,Bn:31536e9}},e.prototype.setCursorFormatter=function(t){return this.set("cursorFormatter",t)},e.prototype.getCursorFormatter=function(){return this.get("cursorFormatter")},e.prototype.setGreatTickStyle=function(t){if("function"==typeof t){var e=this.get("greatTickStyle");return e!==an?this.set("greatTickStyle",t(e)):this}return this.set("greatTickStyle",t)},e.prototype.getGreatTickStyle=function(){return this.get("greatTickStyle")},e.prototype.setMajorTickStyle=function(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)},e.prototype.getMajorTickStyle=function(){return this.get("majorTickStyle")},e.prototype.setMinorTickStyle=function(t){if("function"==typeof t){var e=this.get("minorTickStyle");return e!==an?this.set("minorTickStyle",t(e)):this}return this.set("minorTickStyle",t)},e.prototype.getMinorTickStyle=function(){return this.get("minorTickStyle")},e.prototype.setLocale=function(t){return this.set("locale",t)},e.prototype.getLocale=function(){return this.get("locale")},e.prototype.setDateOrigin=function(t){return this.set("dateOrigin",t)},e.prototype.getDateOrigin=function(){return this.get("dateOrigin")},e.prototype.setFormattingDecade=function(t,e){return this.withMutations((function(i){return t&&(i=i.set("formatOptionsMajorDecade",t)),e&&(i=i.set("formatOptionsMinorYear",e)),i}))},e.prototype.setFormattingYear=function(t,e){return this.withMutations((function(i){return t&&(i=i.set("formatOptionsMajorYear",t)),e&&(i=i.set("formatOptionsMinorMonth",e)),i}))},e.prototype.setFormattingMonth=function(t,e,i){return this.withMutations((function(n){return t&&(n=n.set("formatOptionsGreatYear",t)),e&&(n=n.set("formatOptionsMajorMonth",e)),i&&(n=n.set("formatOptionsMinorWeek",i)),n}))},e.prototype.setFormattingWeek=function(t,e,i){return this.withMutations((function(n){return t&&(n=n.set("formatOptionsGreatMonth",t)),e&&(n=n.set("formatOptionsMajorWeek",e)),i&&(n=n.set("formatOptionsMinorDay",i)),n}))},e.prototype.setFormattingDay=function(t,e,i){return this.withMutations((function(n){return t&&(n=n.set("formatOptionsGreatWeek",t)),e&&(n=n.set("formatOptionsMajorDay",e)),i&&(n=n.set("formatOptionsMinorHour",i)),n}))},e.prototype.setFormattingHour=function(t,e,i){return this.withMutations((function(n){return t&&(n=n.set("formatOptionsGreatDay",t)),e&&(n=n.set("formatOptionsMajorHour",e)),i&&(n=n.set("formatOptionsMinorMinute",i)),n}))},e.prototype.setFormattingMinute=function(t,e,i){return this.withMutations((function(n){return t&&(n=n.set("formatOptionsGreatHour",t)),e&&(n=n.set("formatOptionsMajorMinute",e)),i&&(n=n.set("formatOptionsMinorSecond",i)),n}))},e.prototype.setFormattingSecond=function(t,e,i){return this.withMutations((function(n){return t&&(n=n.set("formatOptionsGreatMinute",t)),e&&(n=n.set("formatOptionsMajorSecond",e)),i&&(n=n.set("formatOptionsMinorMillisecond",i)),n}))},e.prototype.setFormattingMilliSecond=function(t,e){return this.withMutations((function(i){return t&&(i=i.set("formatOptionsGreatSecond",t)),e&&(i=i.set("formatOptionsMajorMilliSecond",e)),i}))},e}(n.Record({locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new on,majorTickStyle:new on,minorTickStyle:new on,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:function(t,e,i){var n=new Date(t),r=function(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));var i=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-i.getTime())/864e5+1)/7)}(n);return new Intl.DateTimeFormat(i,{year:"numeric",month:"long"}).format(n)+" 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:function(t){var 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:function(t){var e=new Date(t);return""+(e.getSeconds()+e.getUTCMilliseconds()/1e3).toFixed(1)}})),bn=function(t,e){return function(i,n){var r=n-i;if(e){var o=Math.log10(r/2),s=Math.pow(10,Math.floor(o-t)),a=Math.floor(i/(10*s))*s*10;return Vi(a,n,s,void 0)}var l=Math.log10(r),h=Math.pow(10,Math.floor(l-t));return _i(i,n,h)}},kn=function(t,e,i,n,r,o){return 0===e?t.filter((function(t,e){return e%2==0})):1===e?t.filter((function(t,e){return e%5==0})):void 0},wn=Ri(void 0,2,5),Mn=function(t,e,i,n,r,o){return 0===e?[t[1],t[3],t[5]]:1===e?[t[0],t[3]]:2===e?[t[1]]:void 0},An=function(t,e){var i=vi(t),n=mi(t);if(e)return function(t,e){for(var r=[],o=Math.floor(i(t)),s=Math.ceil(i(e)),a=o-1;a<=s+1;a+=1){var l=Math.pow(n,a);r.push(l)}return r};var r=10===t?9:4;return function(t,e){for(var o=Math.round(i(t)),s=Math.round(i(e)),a=[],l=Math.pow(n,o),h=(Math.pow(n,s)-l)/r,u=1;u<=r;u+=1){var c=l+h*u;c>t&&c=24*Tn?"MajorHours12":i>=Tn?"MajorHours":i>=10*Cn?"MajorMinutes15":i>=1*Cn?"MajorMinutes":i>=1e4?"MajorSeconds15":i>=Dn?"MajorSeconds":i>=100?"MajorMilliseconds100":i>=10?"MajorMilliseconds10":i>=1?"MajorMilliseconds":i>=.1?"MajorMicroseconds100":i>=.01?"MajorMicroseconds10":i>=1*Ln?"MajorMicroseconds":i<=1*Ln?"MajorNanoseconds100":"Unknown"},En={hhmmss:function(t){var e=Math.abs(t),i=t>=0?"":"-",n=Math.floor(e/Tn);e%=Tn;var r=Math.floor(e/Cn);e%=Cn;var o=Math.floor(e/Dn);return""+i+de(n,2)+":"+de(r,2)+":"+de(o,2)},hhmmssmmm:function(t){var e=Math.abs(t),i=t>=0?"":"-",n=Math.floor(e/Tn);e%=Tn;var r=Math.floor(e/Cn);e%=Cn;var o=Math.floor(e/Dn);e%=Dn;var s=Math.floor(e/1);return""+i+de(n,2)+":"+de(r,2)+":"+de(o,2)+"."+de(s,3)},hhmmssmmmuuu:function(t){var e=Math.abs(t),i=t>=0?"":"-",n=Math.floor(e/Tn),r=Math.floor(e/Cn)%60,o=Math.floor(e/Dn)%60,s=Math.floor(e/1)%1e3,a=t.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}).split(".")[1];return""+i+de(n,2)+":"+de(r,2)+":"+de(o,2)+"."+de(s,3)+a},hhmmssmmmuuunnn:function(t){var e=Math.abs(t),i=t>=0?"":"-",n=Math.floor(e/Tn),r=Math.floor(e/Cn)%60,o=Math.floor(e/Dn)%60,s=Math.floor(e/1)%1e3,a=t.toLocaleString("en-US",{minimumFractionDigits:6,maximumFractionDigits:6}).split(".")[1];return""+i+de(n,2)+":"+de(r,2)+":"+de(o,2)+"."+de(s,3)+a}},On={MajorHours12:{major:{format:En.hhmmss,getKeyValues:function(t,e,i,n){var r=12*Tn;return t=Math.floor(t/(4*r))*r*4,Vi(t,e,r,void 0)},fitKeyValues:Ri({ignore:"first"},2,4)},minor:{format:En.hhmmss,getKeyValues:function(t,e,i,n){return _i(t,e,1*Tn)},fitKeyValues:Ri({},2,3,4,6)},defaultValueFormatter:En.hhmmss},MajorHours:{major:{format:En.hhmmss,getKeyValues:function(t,e,i,n){var r=Tn;return t=Math.floor(t/(12*r))*r*12,Vi(t,e,r,void 0)},fitKeyValues:Ri({ignore:"first"},2,6,12)},minor:{format:En.hhmmss,getKeyValues:function(t,e,i,n){return _i(t,e,5*Cn)},fitKeyValues:Ri({},2,4,6)},defaultValueFormatter:En.hhmmss},MajorMinutes15:{major:{format:En.hhmmss,getKeyValues:function(t,e,i,n){return t=Math.floor(t/Tn)*Tn,Vi(t,e,9e5,void 0)},fitKeyValues:Ri({ignore:"first"},2)},minor:{format:En.hhmmss,getKeyValues:function(t,e,i,n){return _i(t,e,1*Cn)},fitKeyValues:Ri({},3,5)},defaultValueFormatter:En.hhmmss},MajorMinutes:{major:{format:En.hhmmss,getKeyValues:function(t,e,i,n){var r=Cn;return t=Math.floor(t/(10*r))*r*10,Vi(t,e,r,void 0)},fitKeyValues:Ri({ignore:"first"},2,5)},minor:{format:En.hhmmss,getKeyValues:function(t,e,i,n){return _i(t,e,5e3)},fitKeyValues:Ri({},2,3,4,6)},defaultValueFormatter:En.hhmmss},MajorSeconds15:{major:{format:En.hhmmss,getKeyValues:function(t,e,i,n){var r=15e3;return t=Math.floor(t/(4*r))*r*4,Vi(t,e,r,void 0)},fitKeyValues:Ri({ignore:"first"},2,4)},minor:{format:En.hhmmss,getKeyValues:function(t,e,i,n){return _i(t,e,1e3)},fitKeyValues:Ri({},3,5)},defaultValueFormatter:En.hhmmss},MajorSeconds:{major:{format:En.hhmmssmmm,getKeyValues:function(t,e,i,n){var r=Dn;return t=Math.floor(t/(10*r))*r*10,Vi(t,e,r,void 0)},fitKeyValues:Ri({ignore:"first"},2,5)},minor:{format:En.hhmmssmmm,getKeyValues:function(t,e,i,n){return _i(t,e,100)},fitKeyValues:Ri({},2,3,5)},defaultValueFormatter:En.hhmmssmmm},MajorMilliseconds100:{major:{format:En.hhmmssmmm,getKeyValues:function(t,e,i,n){return t=100*Math.floor(t/1e3)*10,Vi(t,e,100,void 0)},fitKeyValues:Ri({ignore:"first"},2,5)},minor:{format:En.hhmmssmmm,getKeyValues:function(t,e,i,n){return _i(t,e,10)},fitKeyValues:Ri({},2,3,5)},defaultValueFormatter:En.hhmmssmmm},MajorMilliseconds10:{major:{format:En.hhmmssmmm,getKeyValues:function(t,e,i,n){return t=10*Math.floor(t/100)*10,Vi(t,e,10,void 0)},fitKeyValues:Ri({ignore:"first"},2,5)},minor:{format:En.hhmmssmmm,getKeyValues:function(t,e,i,n){return _i(t,e,1)},fitKeyValues:Ri({},2,3,5)},defaultValueFormatter:En.hhmmssmmm},MajorMilliseconds:{major:{format:En.hhmmssmmmuuu,getKeyValues:function(t,e,i,n){return t=1*Math.floor(t/10)*10,Vi(t,e,1,void 0)},fitKeyValues:Ri({ignore:"first"},2,5)},minor:{format:En.hhmmssmmmuuu,getKeyValues:function(t,e,i,n){return _i(t,e,.1)},fitKeyValues:Ri({},2)},defaultValueFormatter:En.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:En.hhmmssmmmuuu,getKeyValues:function(t,e,i,n){return t=.1*Math.floor(t/1)*10,Vi(t,e,.1,void 0)},fitKeyValues:Ri({ignore:"first"},2,5)},minor:{format:En.hhmmssmmmuuu,getKeyValues:function(t,e,i,n){return _i(t,e,.01)},fitKeyValues:Ri({},2,3,5)},defaultValueFormatter:En.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:En.hhmmssmmmuuu,getKeyValues:function(t,e,i,n){return t=.01*Math.floor(t/.1)*10,Vi(t,e,.01,void 0)},fitKeyValues:Ri({ignore:"first"},2,5)},minor:{format:En.hhmmssmmmuuu,getKeyValues:function(t,e,i,n){return _i(t,e,1*Ln)},fitKeyValues:Ri({},2,3,5)},defaultValueFormatter:En.hhmmssmmmuuu},MajorMicroseconds:{major:{format:En.hhmmssmmmuuunnn,getKeyValues:function(t,e,i,n){return t=.001*Math.floor(t/.01)*10,Vi(t,e,.001,void 0)},fitKeyValues:Ri({ignore:"first"},2,5)},minor:{format:En.hhmmssmmmuuunnn,getKeyValues:function(t,e,i,n){return _i(t,e,100*Pn)},fitKeyValues:Ri({},2,3,5)},defaultValueFormatter:En.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:En.hhmmssmmmuuunnn,getKeyValues:function(t,e,i,n){var r=100*Pn;return t=Math.floor(t/(10*r))*r*10,Vi(t,e,r,void 0)},fitKeyValues:Ri({ignore:"first"},2,5)},minor:{format:En.hhmmssmmmuuunnn,getKeyValues:function(t,e,i,n){return _i(t,e,10*Pn)},fitKeyValues:Ri({},2,3,5)},defaultValueFormatter:En.hhmmssmmmuuunnn},Unknown:{major:{format:function(t,e,i){return""},getKeyValues:function(t,e,i,n){return[]},fitKeyValues:void 0},minor:{format:function(t,e,i){return""},getKeyValues:function(t,e,i,n){return[]},fitKeyValues:void 0},defaultValueFormatter:function(t,e,i){return""}}},_n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.Mn=function(t){var e=this.timeOrigin||0,i=[{Me:"Major ticks",Ae:0,Xn:this.majorTickStyle,jn:function(t,i,n){var r=Bn(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,On[r].major.format)(t+e,i,n)},Vn:function(t,e,i,n){var r=Bn(i,n);return(0,On[r].major.getKeyValues)(t,e,i,n)},sn:{Jn:function(t,e,i,n,r,o){var s=Bn(r,o),a=On[s].major.fitKeyValues;if(a)return a(t,e,i,n,r,o)}},Hn:void 0}];return this.minorTickStyle instanceof on&&i.push({Me:"Minor ticks",Ae:1,Xn:this.minorTickStyle,jn:function(t,i,n){var r=Bn(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,On[r].minor.format)(t+e,i,n)},Vn:function(t,e,i,n){var r=Bn(i,n);return(0,On[r].minor.getKeyValues)(t,e,i,n)},sn:{Jn:function(t,e,i,n,r,o){var s=Bn(r,o),a=On[s].minor.fitKeyValues;if(a)return a(t,e,i,n,r,o)}},Hn:void 0}),{Ci:[],Bi:i,xi:this.cursorFormatter||function(t,i,n){var r=Bn(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return On[r].defaultValueFormatter(t+e,i,n)},Cn:1e-4,Bn:864e6}},e.prototype.setMajorTickStyle=function(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)},e.prototype.getMajorTickStyle=function(){return this.get("majorTickStyle")},e.prototype.setMinorTickStyle=function(t){if("function"==typeof t){var e=this.get("minorTickStyle");return e!==an?this.set("minorTickStyle",t(e)):this}return this.set("minorTickStyle",t)},e.prototype.getMinorTickStyle=function(){return this.get("minorTickStyle")},e.prototype.setCursorFormatter=function(t){return this.set("cursorFormatter",t)},e.prototype.getCursorFormatter=function(){return this.get("cursorFormatter")},e.prototype.setTimeOrigin=function(t){return this.set("timeOrigin",t)},e.prototype.getTimeOrigin=function(){return this.get("timeOrigin")},e}(Fn),Vn={ZoomIn:{x:-43,y:0},ZoomOut:{x:-65,y:0},ZoomToFit:{x:-86,y:0},ZoomInX:{x:-107,y:-1},ZoomOutX:{x:-128,y:-3},ZoomInY:{x:-150,y:0},ZoomOutY:{x:-171,y:0},EnableAnimation:{x:-276,y:0},DisableAnimation:{x:-298,y:0},CollapseMenu:{x:0,y:0},ShowMenu:{x:-21,y:0}},zn={ZoomIn:{x:-43,y:0},ZoomOut:{x:-65,y:0},ZoomToFit:{x:-86,y:0},ZoomInX:{x:-107,y:-1},ZoomOutX:{x:-128,y:-3},ZoomInY:{x:-150,y:0},ZoomOutY:{x:-171,y:0},EnableAnimation:{x:-276,y:0},DisableAnimation:{x:-298,y:0},CollapseMenu:{x:0,y:0},ShowMenu:{x:-21,y:0}};function Nn(t,e,i){return i<0?t:i>1?e:B(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()))}var Rn,Hn,Yn={seriesBackgroundTint:B(20,20,20),dashBGStops:[{color:B(50,51,52),offset:0},{color:B(14,15,16),offset:.5},{color:B(0,0,1),offset:1}],panelBGStops:[{color:B(120,120,120,100),offset:0},{color:B(0,1,1,50),offset:1}],seriesBGStops:[{color:B(20,20,20,200),offset:0},{color:B(0,0,0,255),offset:1}],spiderWebStops:[{color:B(200,200,200,150),offset:0},{color:B(50,50,50,150),offset:.5},{color:B(255,255,255,150),offset:1}],legendFillStops:[{color:B(80,80,80,130),offset:0},{color:B(30,30,30,130),offset:1}],axisColorStops:[{color:B(255,255,255),offset:0},{color:B(50,50,50),offset:1}],axisOverlayColorStops:[{color:B(255,255,255,50),offset:0},{color:B(255,255,255,20),offset:.2},{color:B(255,255,255,30),offset:.8},{color:B(255,255,255,50),offset:1}],gridColor:B(200,200,200),isDarkTheme:!0,colorStrength:1,colorSaturation:.7,darkLightBlendColor:B(255,255,255,255),legendStrokeColor:B(255,255,255),dashRadialFillCenterX:.8,dashRadialFillCenterY:.8,forceLabelsWhite:!1,explicitMasterColor:B(100,100,100),gradientStrength:1,cursorSolverColor:B(32,32,32),mapColor:B(100,100,100),gaugeValueColor:B(100,100,100),useFullHSVPalette:!0,customPaletteSteps:[B(255,0,0),B(0,255,0),B(0,0,255)]},Un=B(254,204,0,.7),Gn=function(t){var i=u(u({},Yn),t),n=i.seriesBackgroundTint,r=i.dashBGStops,o=i.panelBGStops,s=i.seriesBGStops,a=i.spiderWebStops,l=i.legendFillStops,h=i.axisColorStops,c=i.axisOverlayColorStops,f=i.gridColor,p=i.isDarkTheme,y=i.colorStrength,d=i.colorSaturation,g=i.darkLightBlendColor,S=i.legendStrokeColor,v=i.dashRadialFillCenterX,m=i.dashRadialFillCenterY,x=i.forceLabelsWhite,b=i.masterHueDeg,k=i.sliceHueStep,w=i.explicitMasterColor,M=i.gradientStrength,A=i.cursorSolverColor,I=i.mapColor,F=i.gaugeValueColor,T=O(b,d,y),C=Nn(T,B(255,255,255),.5),D=Nn(T,B(255,255,255),.2),L=Nn(T,B(255,255,255),.8),P=Nn(T,B(255,255,255),.9),E=Nn(T,B(255,255,255),.8),_=C,V=Nn(g,T,.3),z=Nn(g,T,.5),N=[{color:Nn(I,B(255,255,255),.4*M),offset:0},{color:Nn(I,B(0,0,0),.1*M),offset:1}],R=Nn(P,B(0,0,0),.8),H=s[0].color.setA(60);function Y(t,e){var n=t*k+e;n<0&&(n+=360*(1+Math.abs(Math.floor(n/360)))),n%=360;var r=i.customPaletteSteps.length,o=Math.floor(n%360/(360/r)),s=o+1;s>=r&&(s=0);var a=n%(360/r)/(360/r),l=Nn(i.customPaletteSteps[o],i.customPaletteSteps[s],a),h=Nn(T,g,.2);return Nn(h,l,.6)}function U(t){if(!0===i.useFullHSVPalette){var e=b+t*k;e<0&&(e+=360*(1+Math.abs(Math.floor(e/360))));var n=O(e,d,y),r=Nn(T,g,.2);return Nn(r,n,.6)}return Y(t,0)}function X(t){if(!0===i.useFullHSVPalette){var e=b+t*k+180;e<0&&(e+=360*(1+Math.abs(Math.floor(e/360))));var n=O(e,d,y),r=Nn(T,g,.2);return Nn(r,n,.6)}return Y(t,180)}p?x&&(L=B(255,255,255),V=B(255,255,255),E=B(255,255,255),C=B(255,255,255),_=B(255,255,255)):(g=B(0,0,0,255),T=O(b,d,y),w!==Yn.explicitMasterColor&&(T=w),C=Nn(T,B(0,0,0),.5),D=Nn(T,B(0,0,0),.2),L=Nn(T,B(0,0,0),.8),P=Nn(T,B(0,0,0),.9),f=B(40,40,40),E=Nn(T,B(0,0,0),.8),_=C,S=B(40,40,40),V=Nn(g,T,.3),z=Nn(g,T,.5),N=[{color:Nn(I,B(255,255,255),.8*M),offset:0},{color:Nn(I,B(0,0,0),.8*M),offset:1}],a=[{color:B(60,60,60,150),offset:0},{color:B(100,100,100,150),offset:.5},{color:B(80,80,80,150),offset:1}],l=[{color:Nn(T,B(100,100,100,0),.6*M),offset:0},{color:Nn(T,B(255,255,255,0),.6*M),offset:1}],c=[{color:B(128,128,128,50),offset:0},{color:B(128,128,128,20),offset:.2},{color:B(128,128,128,30),offset:.8},{color:B(128,128,128,50),offset:1}],R=Nn(P,B(255,255,255),.8));var W=new j({stops:r,position:{x:v,y:m}}),Z=new J({thickness:1,fillStyle:new K({angle:45,stops:[{color:B(255,255,255,150),offset:0},{color:B(50,50,50,150),offset:1}]}),highlightThicknessMultiplier:1}),q=new J({thickness:6,fillStyle:new G({color:B(0,0,0,0)}),highlightThicknessMultiplier:1}),$=new j({stops:o,position:{x:.5,y:.5},shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner}),tt=new J({thickness:1,fillStyle:new G({color:g.setA(20)})}),et=new j({stops:s,position:{x:.5,y:.5},shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner}),it=new J({thickness:0,fillStyle:new G({color:B(0,0,0)})}),nt="Verdana",rt=new Ki({size:16,family:nt,style:"normal",weight:"normal"}),ot=new G({color:E}),st=new G({color:g.setA(20)}),at=new J({thickness:2,fillStyle:new G({color:g.setA(150)})}),lt=st,ht=at,ut=new G({color:C}),ct=new Ki({size:16,family:nt,style:"normal",weight:"normal"}),ft=new J({thickness:1,fillStyle:new G({color:f.setA(75)})}),pt=new J({thickness:1,fillStyle:new G({color:f.setA(50)})}),yt=new J({thickness:1,fillStyle:new G({color:f.setA(20)})}),dt=new J({thickness:2,fillStyle:new G({color:f.setA(200)})}),gt=new J({thickness:1,fillStyle:new G({color:f.setA(200)})}),St=new J({thickness:1,fillStyle:new G({color:f.setA(150)})}),vt=new Ki({size:13,family:nt,style:"italic",weight:"bold"}),mt=new G({color:L}),xt=new Ki({size:12,family:nt,style:"italic",weight:"normal"}),bt=new G({color:L}),kt=new Ki({size:10,family:nt,style:"italic",weight:"normal"}),wt=new G({color:L}),Mt=new J({thickness:2,fillStyle:new K({angle:45,stops:h})}),At=new J({thickness:0,fillStyle:new G({color:B(0,0,0)})}),It=new K({angle:45,stops:c}),Ft=new K({angle:45,stops:[{color:D.setA(50),offset:0},{color:Nn(D,g,.3).setA(50),offset:1}]}),Tt=new J({thickness:1,fillStyle:new G({color:D.setA(100)})}),Ct=new J({thickness:3,fillStyle:new G({color:Nn(D,g,.3).setA(150)})}),Dt=function(t){return new G({color:Nn(U(t),g,.3)})},Lt=new J({thickness:1,fillStyle:new G({color:H})}),Pt=Lt,Bt=new J({thickness:1,fillStyle:new G({color:z})}),Et=new G({color:Nn(O(120,d,y),T,.2)}),Ot=new G({color:Nn(O(0,d,y),T,.2)}),_t=new J({thickness:2,fillStyle:Et,highlightThicknessMultiplier:1}),Vt=new J({thickness:2,fillStyle:Ot,highlightThicknessMultiplier:1}),zt=new G({color:B(255,255,255)}),Nt=new J({thickness:0,fillStyle:new G({color:B(0,0,0)})}),Rt=new G({color:Nn(Nn(A,g,.01),T,.1).setA(220)}),Ht=new J({thickness:1,fillStyle:new G({color:Nn(A,g,.5).setA(240)})}),Yt=new G({color:Nn(A,g,.99)}),Ut=new Ki({size:13,family:nt,style:"italic",weight:"normal"}),Gt=new J({thickness:1,fillStyle:new G({color:B(150,150,150)})}),Xt=new G({color:Nn(Nn(A,g,.01),T,.1).setA(220)}),Wt=new J({thickness:1,fillStyle:new G({color:Nn(A,g,.5).setA(240)})}),jt=new G({color:Nn(A,g,.99)}),Kt=new Ki({size:15,family:nt,style:"normal",weight:"normal"}),Zt=xt,qt=gt,Qt=bt,Jt=new J({thickness:2,fillStyle:new j({stops:a,position:{x:.2,y:.2},shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner})}),$t=Jt,te=new J({thickness:3,fillStyle:new G({color:B(200,200,200)})}),ee=new G({color:L}),ie=new Ki({size:15,family:nt,style:"normal",weight:"normal"}),ne=new G({color:L}),re=new Ki({size:15,family:nt,style:"normal",weight:"normal"}),oe=new on({gridStrokeStyle:new J({thickness:1,fillStyle:new K({angle:45,stops:[{color:B(50,50,50,150),offset:0},{color:B(255,255,255,150),offset:1}]})}),tickLength:7,tickStyle:new J({thickness:1,fillStyle:new G({color:f.setA(200)})}),tickPadding:0,labelFont:new Ki({size:14,family:nt,style:"normal",weight:"normal"}),labelPadding:0,labelFillStyle:new G({color:L})}),se=new J({thickness:2,fillStyle:new j({stops:[{color:B(50,50,50,150),offset:0},{color:B(255,255,255,150),offset:1}],position:{x:.4,y:.8},shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner})}),ae=new G({color:C}),le=new J({thickness:2,fillStyle:new K({angle:45,stops:[{color:B(100,100,100,150),offset:0},{color:B(255,255,255,150),offset:1}]})}),he=new G({color:C}),ue={x:new J({thickness:1,fillStyle:new G({color:B(200,200,200)})}),y:new J({thickness:1,fillStyle:new G({color:B(200,200,200)})}),z:new J({thickness:1,fillStyle:new G({color:B(200,200,200)})})},ce=Q,fe=new J({thickness:1,fillStyle:new G({color:P})}),pe=new J({thickness:1,fillStyle:new G({color:_})}),ye=new G({color:L}),de=new Ki({size:14,family:nt,style:"normal",weight:"normal"}),ge=new j({stops:[{color:n,offset:.5},{color:B(0,0,0,255),offset:1}],position:{x:.5,y:.5}}),Se=new J({thickness:1.5,fillStyle:new j({stops:[{color:B(200,200,200,150),offset:0},{color:B(50,50,50,150),offset:.5},{color:B(255,255,255,150),offset:1}],position:{x:.2,y:.2},shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner})}),ve=new j({stops:[{color:Nn(F,B(255,255,255,255),.5*M),offset:0},{color:F,offset:.5},{color:Nn(F,B(0,0,0,255),.5*M),offset:1}],position:{x:.5,y:.5}}),me=new K({angle:0,stops:l}),xe=new J({thickness:1,fillStyle:new G({color:S})}),be=new G({color:V}),ke=new Ki({size:13,family:nt,style:"italic",weight:"normal"}),we=me,Me=xe,Ae=be,Ie=new K({angle:-45,stops:N}),Fe=new J({thickness:1,fillStyle:new G({color:P})}),Te=new G({color:B(0,0,0,0)}),Ce=new J({thickness:1,fillStyle:new G({color:R})}),De=me,Le=xe,Pe=new J({thickness:1,fillStyle:Dt(0)}),Be=Pe.getFillStyle(),Ee=Pe,Oe=Q,_e=new J({thickness:1,fillStyle:new G({color:B(0,0,0)})}),Ve=an,ze=new on({gridStrokeStyle:ft,tickStyle:dt,tickLength:50,tickPadding:-14,labelFont:vt,labelPadding:0,labelFillStyle:mt}),Ne=new on({gridStrokeStyle:pt,tickStyle:gt,tickLength:7,tickPadding:0,labelFont:xt,labelPadding:0,labelFillStyle:bt}),Re=new on({gridStrokeStyle:yt,tickStyle:St,tickLength:4,tickPadding:5,labelFont:kt,labelPadding:0,labelFillStyle:wt}),He=new In({extremeTickStyle:Ve,majorTickStyle:Ne,minorTickStyle:Re}),Ye=new xn({greatTickStyle:ze,majorTickStyle:Ne,minorTickStyle:Re}),Ue=new _n({majorTickStyle:Ne,minorTickStyle:Re});return{onScreenMenuButtonBackgroundColor:Un,onScreenMenuButtonIconSet:zn,segmentSeriesStyle:Pe,boxFigureStyle:Be,boxFigureLineStyle:Ee,boxFigureStrokeStyle:Oe,boxFigureMedianLineStyle:_e,uiButtonFillStyle:Ae,uiButtonSize:10,candleStickStyle:Bt,candleStickPositiveStyle:Et,candleStickNegativeStyle:Ot,candleStickPositiveStrokeStyle:Q,candleStickNegativeStrokeStyle:Q,OHLCBarPositiveStyle:_t,OHLCBarNegativeStyle:Vt,lcjsBackgroundFillStyle:W,lcjsBackgroundStrokeStyle:Z,dashboardSplitterStyle:q,panelBackgroundFillStyle:$,panelBackgroundStrokeStyle:tt,chartTitleFont:rt,chartTitleFillStyle:ot,seriesBackgroundFillStyle:et,seriesBackgroundStrokeStyle:it,chartXYZoomingRectangleFillStyle:st,chartXYZoomingRectangleStrokeStyle:at,chartXYFittingRectangleFillStyle:lt,chartXYFittingRectangleStrokeStyle:ht,axisTitleFillStyle:ut,axisTitleFont:ct,axisStyle:Mt,axisOverlayStyle:It,axisNibOverlayStyle:It,axisNibStyle:At,numericTickStrategy:He,dateTimeTickStrategy:Ye,timeTickStrategy:Ue,pointMarkerFillStyle:zt,pointMarkerStrokeStyle:Nt,resultTableFillStyle:Rt,resultTableStrokeStyle:Ht,resultTableTextFillStyle:Yt,resultTableTextFont:Ut,customTickGridStrokeStyle:Gt,customTickPointerLength:7,uiPointableTextBoxFillStyle:Xt,uiPointableTextBoxFont:Kt,uiPointableTextBoxStrokeStyle:Wt,uiPointableTextBoxTextFillStyle:jt,uiTickFont:Zt,uiTickStrokeStyle:qt,uiTickTextFillStyle:Qt,uiBackgroundFillStyle:we,uiBackgroundStrokeStyle:Me,uiTextFillStyle:be,uiFont:ke,seriesFillStyle:Dt,seriesStrokeStyle:function(t){return new J({thickness:2,fillStyle:new G({color:U(t)})})},seriesPointFillStyle:function(t){return new G({color:Nn(U(t),g,.3)})},seriesStrokeStyle3D:function(t){return new J({thickness:5,fillStyle:new G({color:U(t)})})},seriesTriangulatedPointStyle3D:function(t){return new tn.Triangulated({shape:"sphere",size:10,fillStyle:new G({color:U(t)})})},seriesNonTriangulatedPointStyle3D:function(t){return new tn.Pixelated({size:5,fillStyle:new G({color:U(t)})})},heatmapGridSeriesWireframeStyle:Lt,surfaceSeriesFillStyle:function(t){return function(t){return new G({color:U(t)})}(t)},surfaceSeriesWireframeStyle:Pt,boxSeriesFillStyle:function(t){return function(t){return new G({color:U(t)})}(t)},mountainsStrokeStyle:function(t){return new J({thickness:2,fillStyle:new G({color:U(t)})})},mountainsFillStyle:function(t){return new K({angle:180,stops:[{color:Nn(U(t),B(255,255,255,0),.1*M).setA(100),offset:0},{color:Nn(U(t),B(0,0,0,0),.5*M).setA(100),offset:1}]})},mountainsInvertedStrokeStyle:function(t){return new J({thickness:2,fillStyle:new G({color:X(t)})})},mountainsInvertedFillStyle:function(t){return new K({angle:0,stops:[{color:Nn(X(t),B(255,255,255,0),.1*M).setA(100),offset:0},{color:Nn(X(t),B(0,0,0,0),.5*M).setA(100),offset:1}]})},bandFillStyle:Ft,bandStrokeStyle:Tt,constantLineStrokeStyle:Ct,spiderSeriesFillStyle:function(t){return new G({color:U(t).setA(100)})},spiderSeriesStrokeStyle:function(t){return new J({thickness:2,fillStyle:new G({color:U(t)}),highlightThicknessMultiplier:2})},spiderWebStyle:Jt,spiderAxisStyle:$t,spiderAxisNibStyle:te,spiderScaleLabelFillStyle:ee,spiderScaleLabelFont:ie,spiderAxisLabelFillStyle:ne,spiderAxisLabelFont:re,polarRadialAxisTickStyle:oe,polarRadialAxisStyle:se,polarRadialAxisTitleStyle:ae,polarAmplitudeAxisStyle:le,polarAmplitudeAxisTitleStyle:he,axesStyles3D:ue,boundingBoxStyle3D:ce,sliceChartRadialFillStylePalette:function(t){var e=U(t);return new j({stops:[{color:Nn(e,B(255,255,255),.2*M),offset:0},{color:e,offset:.5},{color:Nn(e,B(0,0,0),.2*M),offset:1}]})},sliceChartStackedFillStylePalette:function(t){var e=U(t);return new K({angle:90,stops:[{color:Nn(e,B(255,255,255),.5*M),offset:0},{color:e,offset:.5},{color:Nn(e,B(0,0,0),.5*M),offset:1}]})},sliceChartStrokeStyle:fe,sliceLabelConnectorStyle:pe,sliceLabelFillStyle:ye,sliceLabelFont:de,gaugeBackgroundFillStyle:ge,gaugeBackgroundStrokeStyle:Se,gaugeSliceFillStyle:ve,mapChartFillStyle:Ie,mapChartStrokeStyle:Fe,mapChartOutlierRegionFillStyle:Te,mapChartOutlierRegionStrokeStyle:Ce,mapChartSeparateRegionFillStyle:De,mapChartSeparateRegionStrokeStyle:Le,rectangleSeriesFillStyle:function(t){var e=U(t);return new K({angle:90,stops:[{color:Nn(e,B(255,255,255),.5*M),offset:0},{color:e,offset:.5},{color:Nn(e,B(0,0,0),.8*M),offset:1}]})}}},Xn=function(t,e,i){return t*(1-i)+e*i},Wn=function(t,e,i,n,r){if(void 0!==e.value&&void 0!==i.value&&void 0!==n.value&&void 0!==r.value){var o=(t.x-i.point.x)/(r.point.x-i.point.x),s=(r.point.y-i.point.y)*o+i.point.y,a=(t.x-e.point.x)/(n.point.x-e.point.x),l=(n.point.y-e.point.y)*a+e.point.y,h=(t.y-l)/(s-l),u=Xn(i.value,r.value,o),c=Xn(e.value,n.value,a);return Xn(c,u,h)}},jn={warm:function(t){return function(e){return O(60/(t-1)*e,.8,.8)}},cold:function(t){return function(e){return O(60/(t-1)*e+180,.8,.8)}},fullSpectrum:function(t){return function(e){return O(360/t*e,.8,.8)}},reverseSpectrum:function(t){return function(e){return O(360/t*(t-e),.8,.8)}},flatUI:function(t){return function(e){return O(360/t*e+8,.8,.8-.15/t*e)}},arction:function(t){return function(e){var i=1-.2/t*e;return O(360/t*e+51,i,i)}},arctionWarm:function(t){return function(e){var i=t-1,n=1-.2/i*e;return O(46-46/i*e+4,n,n)}},sunset:function(t){return function(e){var i=[170,320];return O(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)}},dynamic:function(t){return function(e){var i=e%2,n=[234,346];return O(i?n[0]:n[1],i?.3:.9,.5+.5/(t-1)*e)}},magenta:function(t){return function(e){var i=[.9,.6];return O(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)}},greyscale:function(t){return function(e){return O(0,0,.25+.5/(t-1)*e)}},frozen:function(t){return function(e){var i=[.8,.6];return O(160+80/(t-1)*e,.6,e%2?i[0]:i[1])}},retro:function(t){return function(e){var i=[6,183];return O(e%2?i[0]:i[1],.7,.5+.5/(t-1)*e)}},crayons:function(t){return function(e){var i=180+230/(t-1)*e;return i>360&&(i-=360),O(i,.9,.8)}},custom:function(t,e){return function(i){var n=.25+.5/(t-1)*i;if(!e)return O(0,0,n);var r=e.getR()/255,o=e.getG()/255,s=e.getB()/255,a=Math.max(r,o,s),l=Math.min(r,o,s),h=0;if(a!==l){var u=a-l;switch(a){case r:h=(o-s)/u+(o1?1:i},Qn=function(t,e){if(e.length<2)throw new Error("Invalid palette size");for(var i=0;i=0?(i.ur.splice(e,1),i.ur.length>0?i.mr.style.cursor=i.ur[i.ur.length-1][1]:i.mr.style.cursor="default"):(i.ur.push([0,"default"]),i.mr.style.cursor="default")},this.gr=function(t){return i.br.l(t),i},this.wr=function(){return i.br.S()},this.kr=function(){i.rr&&i.rr(),i.Mr(),i.sr&&i.sr()},this.Ar=function(t){return i.tr.set(t.Fr(),t),i.tr=new Map(p([],f(i.tr.entries())).sort((function(t,e){return t[0]-e[0]}))),t},this.Tr=function(t){return i.tr.delete(t),i},this.Ot=function(){return i.br.i=!1,i},this.Dt=function(){return i.br.i=!0,i},this.Cr=function(t){if(i.cr){var e=i.Br;i.Br=t;var n=i.Lr(t.clientX,t.clientY);i.Ir=n;var r=Array.from(i.tr.values()).reverse().reduce((function(t,e){return t||(void 0!==e.Pr()?e:void 0)}),void 0);Array.from(i.tr.values()).reverse().reduce((function(i,o){return void 0===r||o===r?o.Cr(t,e,n.x,n.y,i):i}),!0)}},this.Or=function(t){var e,n;i.cr=!1,i.Ir=void 0,i.Br=t;try{for(var r=c(i.tr.values()),o=r.next();!o.done;o=r.next())o.value.Or(t)}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},this.Dr=function(t){i.cr=!0,i.Br=t},this._r=function(){return i.Ir},this.Rr=function(){return Array.from(i.tr.values()).reduce((function(t,e){return t||void 0!==e.Pr()}),!1)},this.zr={overrideInteractionMouseButtons:t&&t.overrideInteractionMouseButtons?t.overrideInteractionMouseButtons:void 0,resourcesBaseUrl:t&&void 0!==t.resourcesBaseUrl&&null!==t.resourcesBaseUrl?t.resourcesBaseUrl:"resources",warnings:!t||!("warnings"in t)||"boolean"!=typeof t.warnings||t.warnings},this.Nr=this.Er();var n=e?e.container:void 0;if(n){if("string"==typeof n){var o=gt.document.getElementById(n);if(!o)throw new Error('Container "'+n+"\" doesn't exist.");this.mr=o}else this.mr=n;gt.addEventListener("resize",this.vr),this.hr=function(){gt.removeEventListener("resize",i.vr)}}else{if(void 0===TB){var s=gt.document.createElement("div");s.id="lcjs-auto-flexbox",s.style.position="relative",s.style.width="100%",s.style.display="flex",s.style.flexDirection="column",gt.document.body.appendChild(s),TB=s,gt.addEventListener("resize",BB)}for(var a=1;null!==gt.document.getElementById("chart-"+a);)a+=1;this.mr=gt.document.createElement("div"),this.mr.id="chart-"+a,this.mr.style.flex="1",TB.appendChild(this.mr),BB(),PB.push(this.vr),this.hr=function(){TB&&TB.removeChild(i.mr),PB.includes(i.vr)&&PB.splice(PB.indexOf(i.vr),1),0===PB.length&&TB&&(gt.document.body.removeChild(TB),TB=void 0,gt.removeEventListener("resize",BB))}}gt.ResizeObserver&&(this.Vr=new gt.ResizeObserver(function(t){var e,n;try{for(var r=c(t),o=r.next();!o.done;o=r.next())o.value.target===i.mr&&i.vr()}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}.bind(this)),this.Vr.observe(this.mr)),this.mr.style.position="relative",this.mr.style.boxSizing="content-box",this.mr.addEventListener("fullscreenchange",this.vr),this.mr.addEventListener("webkitfullscreenchange",this.vr);var l=e?e.maxFps:void 0;this.Gr=l?-1===l?-1:0!==l?1e3/l:0:0;var h,u=new Map,y=!1,d=function(t,e){return function(n){var r=function(t){return{x:t.clientX,y:t.clientY}}(n);switch(n.type){case"pointerover":case"pointerenter":case"pointermove":case"pointerdown":u.set(n.pointerId,r);break;default:u.delete(n.pointerId),y=!1}n.interactions=Array.from(u.values()),i.Hr(AB.osm)>0&&i.handleOsmPointerEvent(n);var o=i.Wr(n);switch(n.pointerType){case"pen":case"mouse":default:t&&t(n);break;case"touch":!o&&e&&e(n)}n.defaultPrevented&&(y=!0)}};if(this.mr.onwheel=this.jr(wB.wheel),this.mr.oncontextmenu=this.jr(wB.contextmenu),this.mr.onclick=this.jr(wB.click),this.mr.ondblclick=this.jr(wB.dbclick),this.mr.onlostpointercapture=function(){y=!1},this.mr.ontouchmove=function(t){y&&t.preventDefault()},this.mr.onpointerover=d(),this.mr.onpointerenter=d(this.Dr),this.mr.onpointerdown=d(this.jr(wB.mouseDown),this.Ur(MB.touchStart)),this.mr.onpointermove=d(this.Cr,this.Ur(MB.touchMove)),this.mr.onpointerup=d(this.jr(wB.mouseUp),this.Ur(MB.touchEnd)),this.mr.onpointercancel=d(),this.mr.onpointerout=d(),this.mr.onpointerleave=d(this.Or,this.Ur(MB.touchEnd)),!gt.requestAnimationFrame||!gt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");gt.addEventListener("scroll",this.lr),this.br=F(new L({r:0,g:0,b:0,a:0})),this.Yr={container:(h=this).mr,scale:h.Y,Vi:function(t){return h.Vi(t)},_r:function(){return h._r()},Rr:function(){return h.Rr()},Xr:function(t){return h.Xr(t)},setMouseStyle:function(t,e){return h.Sr(t,e)},restoreMouseStyle:function(t){return h.pr(t)},clientLocation2Engine:function(t,e){return h.Lr(t,e)},engineLocation2Client:function(t,e){return h.Zr(t,e)},captureFrame:function(t,e){return h.Kr(t,e)},renderFrame:function(t,e,i){return void 0===i&&(i=!1),h.qr(t,e,i)},layout:function(){return h.vr()},setBackgroundFillStyle:function(t){return h.setBackgroundFillStyle(t),this},setBackgroundStrokeStyle:function(t){return h.setBackgroundStrokeStyle(t),this},getBackgroundFillStyle:function(){return h.getBackgroundFillStyle()},getBackgroundStrokeStyle:function(){return h.getBackgroundStrokeStyle()}}}return t.prototype.Jr=function(){return this.Br},t.prototype.Qr=function(t){var e;(null===(e=this.Nr.get(t.$r))||void 0===e?void 0:e.delete(t.ts))&&this.mr.removeChild(t.ns)},t.prototype.Hr=function(t){return this.Nr.get(t).size},t.prototype.Er=function(){var t=new Map;for(var e in AB)({}).hasOwnProperty.call(AB,e)&&(Number.isNaN(Number(e))||t.set(Number(e),new Map));return t},t.prototype.handleOsmPointerEvent=function(t){this.Wr(t)?this.cr&&(this.Or(t),"touch"===t.pointerType&&(t.forceTouchEnd=!0,this.es(MB.touchEnd,t))):this.cr||this.Dr(t)},t.prototype.Xr=function(t){var e,i=this.rs(t);return this.mr.appendChild(i.ns),null===(e=this.Nr.get(t))||void 0===e||e.set(i.ts,i),i},t.prototype.rs=function(t){var e=this,i={ts:LB(),$r:t,ns:gt.document.createElement("div"),dispose:function(){return e.Qr(i)}};return i.ns.id=i.ts,i},t.prototype.ss=function(){return this.os},t.prototype.hs=function(){return this.us},t.prototype.setBackgroundFillStyle=function(t){return this.cs.pn(t),this},t.prototype.getBackgroundFillStyle=function(){return this.cs.mn()},t.prototype.setBackgroundStrokeStyle=function(t){return this.cs.fs(t),this},t.prototype.getBackgroundStrokeStyle=function(){return this.cs.ls()},t.prototype.ds=function(t){return this.sr=t,this},t.prototype.vs=function(t){return this.rr=t,this},t.prototype.ys=function(t){return this.tr.get(t)},t.prototype.Ss=function(){return Array.from(this.tr.keys()).reverse().reduce((function(t,e){return e!==Number.MAX_SAFE_INTEGER&&e>t?e:t}),0)+1},t.prototype.jr=function(t){var e=this;return function(i){return e.ps(t,i)}},t.prototype.ps=function(t,e){Array.from(this.tr.values()).reverse().reduce((function(i,n){return n.ps(e,i,t)}),!0)},t.prototype.Ur=function(t){var e=this;return function(i){return e.es(t,i)}},t.prototype.es=function(t,e){for(var i=e.interactions.length,n=this.Lr(e.clientX,e.clientY),r=new Array(i),o=0;o=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom),i},t.prototype.bs=function(t){return this.Fi.on("resize",t)},t.prototype.xs=function(t){return this.Fi.off(t,"resize")},t.prototype.ws=function(){return this.Fi.topicOff("resize"),this},t.prototype.ks=function(){var t,e;if(this.tr)try{for(var i=c(this.tr.values()),n=i.next();!n.done;n=i.next())n.value.ks()}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}this.rr=void 0,this.sr=void 0,gt.removeEventListener("scroll",this.lr),this.mr.removeEventListener("fullscreenchange",this.vr),this.mr.removeEventListener("webkitfullscreenchange",this.vr),this.Ms(),this.Vr&&this.Vr.disconnect(),this.hr(),this.er&>.cancelAnimationFrame(this.er)},t.prototype.Ms=function(){var t,e,i,n;try{for(var r=c(this.Nr.values()),o=r.next();!o.done;o=r.next()){var s=o.value;try{for(var a=(i=void 0,c(s.values())),l=a.next();!l.done;l=a.next())l.value.dispose()}catch(t){i={error:t}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.Lr=function(t,e){return m(t-this.nr.x,this.nr.y-e)},t.prototype.Zr=function(t,e){return m(t+this.nr.x,this.nr.y-e)},t}(),VB=function(t){return void 0===t&&(t=1),{type:"horizontalProgressive",packager:function(e,i,n){if(e.length>1){for(var r=$e(i,n*t),o=Math.abs(r.x),s=e.length,a=[],l=0,h=0,u=e[0].x+o;hp&&(p=e[h].y),e[h].y1){for(var r=$e(i,n*t),o=Math.abs(r.x),s=e.length,a=[],l=0,h=0,u=e[0].x-o;hu&&h=u;)e[h].y>p&&(p=e[h].y),e[h].y1){for(var r=$e(i,n*t),o=Math.abs(r.y),s=e.length,a=[],l=0,h=0,u=e[0].y+o;hp&&(p=e[h].x),e[h].x1){for(var r=$e(i,n*t),o=Math.abs(r.y),s=e.length,a=[],l=0,h=0,u=e[0].y-o;hu&&h=u;)e[h].x>p&&(p=e[h].x),e[h].xi.max.x)){for(var o,s=Number.MAX_VALUE,a=n;a<=r;a+=1){var l=t[a],h=l.x>e.x?l.x-e.x:e.x-l.x;hi.max.y)){for(var o,s=Number.MAX_VALUE,a=n;a<=r;a+=1){var l=t[a],h=l.y>e.y?l.y-e.y:e.y-l.y;hh.x?l.x:h.x,p=l.y>h.y?l.y:h.y;if(!(s&&(af)||!s&&(ap)))for(var y=r,d=Math.floor((r+o)/2),g=o,S=-1;;){var v=a-(s?t[d].x:t[d].y);if(v*(n?-1:1)>0)y=Math.min(d+1,g),S=Math.floor((y+g)/2);else{if(0===Math.abs(v))return d;g=Math.max(d-1,y),S=Math.floor((y+g)/2)}if(S===d){var m=d>r?Math.abs(a-(s?t[d-1].x:t[d-1].y)):be,x=dh.x?l.x:h.x,p=l.y>h.y?l.y:h.y;if(!(s&&(af)||!s&&(ap)))for(var y=r,d=Math.floor((r+o)/2),g=o,S=-1;;){var v=a-(s?t[d].x:t[d].y);if(v*(n?-1:1)>0)y=Math.min(d+1,g),S=Math.floor((y+g)/2);else{if(0===Math.abs(v))return{a:d,b:d,lerpAmount:0};g=Math.max(d-1,y),S=Math.floor((y+g)/2)}if(S===d){if(v*(n?-1:1)<0&&d>r){var m=t[d-1],x=t[d];return{a:d-1,b:d,lerpAmount:s?(e.x-m.x)/(x.x-m.x):(e.y-m.y)/(x.y-m.y)}}return d0},e.prototype.co=function(){return!1===this.Co&&this.fo()},e.prototype.Sn=function(t){return this.po.l(t),this},e.prototype.vn=function(){return this.po.S()},e.prototype.bn=function(t){return t instanceof Ki?this.Ao.l(t):this.Ao.l(t(this.Ao.S())),this},e.prototype.gn=function(){return this.Ao.S()},e.prototype.Bo=function(t){return this.Ao.l(this.Ao.S().setFamily(t)),this},e.prototype.Lo=function(){return this.Ao.S().getFamily()},e.prototype.Io=function(t){return this.Ao.l(this.Ao.S().setSize(t)),this},e.prototype.Po=function(){return this.Ao.S().getSize()},e.prototype.Oo=function(t){return this.Ao.l(this.Ao.S().setWeight(t)),this},e.prototype.Do=function(){return this.Ao.S().getWeight()},e.prototype._o=function(t){return this.Ao.l(this.Ao.S().setStyle(t)),this},e.prototype.Ro=function(){return this.Ao.S().getStyle()},e.prototype.zo=function(t){return this.Ao.l(this.Ao.S().setVariant(t)),this},e.prototype.No=function(){return this.Ao.S().getVariant()},e.prototype.Eo=function(t){return this.bo.l(t),this},e.prototype.Vo=function(){return this.bo.S()},e.prototype.xn=function(t){return this.Mo.l(t),this},e.prototype.wn=function(){return this.Mo.S()},e.prototype.Go=function(t,e){return this.ko.l(m(t,e)),this},e.prototype.Ho=function(){return this.ko.S()},e.prototype.Wo=function(t){return this.wo.l(t),this},e.prototype.jo=function(){return this.wo.S()},e.prototype.Uo=function(t){return this.xo.l(t),this},e.prototype.Yo=function(){return this.xo.S()},e.prototype.Xo=function(t){return this.wo.l(t.x),this.xo.l(t.y),this},e.prototype.Zo=function(t){return this.ct.l(t),this},e.prototype.Ko=function(){return this.ct.S()},e.prototype.qo=function(t){return this.To.l(t),this},e.prototype.Jo=function(){return this.To.S()},e}(rE),lE=function(t){function i(i,n,r,o,s,a){void 0===a&&(a=5);var l=t.call(this,i,n,r,o,s,F(a))||this;return l.Qo=[],l.$o=F(e.PointShape.Square),l.Mo=F(0),l.th=F(!1),l.ih=F(!1),l.eh=F(!1),l.rh=we,l.sh=0,l.oh=[],l.hh=0,l.ah=we,l.uh=DB.Nearest,l}return h(i,t),i.prototype.fh=function(t){return this.uh=t,this},i.prototype.lh=function(){return this.oh},i.prototype.dh=function(){return this.Qo},i.prototype.yh=function(t){return this.$o.l(t),this},i.prototype.xn=function(t){return this.Mo.l(t),this},i.prototype.Sh=function(t){return this.th.l(t),this},i.prototype.mh=function(t){return this.ih.l(t),this},i.prototype.ph=function(t){return this.eh.l(t),this},i.prototype.gh=function(t,e){return Array.isArray(t)||(t=[t]),this.hh+=t.length,this.oh=ce(this.oh,t,{canReturnB:!0}),this.ah&&(this.ah=e?He(this.ah,e):void 0),this},i.prototype.bh=function(){return this.so=!0,this.Qo.length=0,this.sh=0,this.rh=we,this.oh=[],this.hh=0,this},i.prototype.xh=function(){return this.sh},i.prototype.wh=function(){return this.hh},i}(sE),hE=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.bo=F(m(0,0)),s.kt=F(m(100,100)),s.Mo=F(0),s.Fo=F(m(0,0)),s.kh=!1,s}return h(e,t),e.prototype.Un=function(){return this.Mh(),this},e.prototype.Eo=function(t){var e=this.bo.S();return t.x===e.x&&t.y===e.y||(this.bo.l(t),this.Mh()),this},e.prototype.Vo=function(){return this.bo.S()},e.prototype.Ah=function(t){var e=this.bo.S();return t!==e.x&&(this.bo.l(m(t,e.y)),this.Mh()),this},e.prototype.Fh=function(t){var e=this.bo.S();return t!==e.y&&(this.bo.l(m(e.x,t)),this.Mh()),this},e.prototype.wt=function(t){var e=this.kt.S();return t.x===e.x&&t.y===e.y||(this.kt.l(m(t.x,t.y)),this.Mh()),this},e.prototype.Bt=function(){return this.kt.S()},e.prototype.Th=function(t){var e=this.kt.S();return t!==e.x&&(this.kt.l(m(t,e.y)),this.Mh()),this},e.prototype.Ch=function(t){var e=this.kt.S();return t!==e.x&&(this.kt.l(m(e.x,t)),this.Mh()),this},e.prototype.xn=function(t){return this.Mo.l(t),this},e.prototype.wn=function(){return this.Mo.S()},e.prototype.Bh=function(t){var e=this.Fo.S();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.kh=!1,this.Mh()):(this.kh=!0,this.Fo.l(t))),this},e.prototype.Mh=function(){if(!this.kh){var t=this.bo.S(),e=this.kt.S(),i=m(t.x+e.x/2,t.y+e.y/2),n=this.Fo.S();i.x===n.x&&i.y===n.y||this.Fo.l(i)}},e}(oE),uE=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.Qo=[],e.bo=F(m(0,0)),e.rh=we,e}return h(e,t),e.prototype.Lh=function(t){return t=se(t),this.Qo=t,this.so=!0,this},e.prototype.Ih=function(){return this.Qo},e.prototype.Z=function(){return this.rh.max.x},e.prototype.X=function(){return this.rh.min.x},e.prototype.q=function(){return this.rh.max.y},e.prototype.K=function(){return this.rh.min.y},e.prototype.Ph=function(){return 0},e.prototype.Oh=function(){return 0},e}(oE),cE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e}(uE),fE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e}(uE);!function(t){h((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(uE);var pE,yE=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.Dh=new Array,s._h=new Array,s.Rh=F({type:"disabled",packager:function(t,e,i){return t.slice()}}),s.rh=we,s.ah=we,s.zh=0,s.Nh=!1,s.oh=[Array(),Array()],s.Eh=!1,s.Vh=(new G).setColor(B(42,171,240)),s.Gh=!1,s.Hh=!1,s}return h(e,t),e.prototype.gh=function(t,e){var i=this.zh-1,n=f(i>0&&!this.Eh?[[this.Dh[i]],[this._h[i]]]:[[],[]],2),r=n[0],o=n[1];if(t instanceof Array){var s=f(M(t),2),a=s[0],l=s[1];r=ce(r,a,{canReturnB:!0}),o=ce(o,l,{canReturnB:!0})}else{var h=t.position;r.push(m(h,t.high)),o.push(m(h,t.low))}return this.Eh?(this.oh[0]=ce(this.oh[0],r,{canReturnB:!0}),this.oh[1]=ce(this.oh[1],o,{canReturnB:!0})):(this.oh=[r,o],this.Eh=!0),this.ah&&(this.ah=e?He(this.ah,e):void 0),this},e.prototype.bh=function(){return this.so=!0,this.Dh.length=0,this._h.length=0,this.zh=0,this.rh=we,this},e.prototype.dh=function(){return[this.Dh,this._h]},e.prototype.lh=function(){return[this.oh[0],this.oh[1]]},e.prototype.Wh=function(t){return this.Rh.l(t),this},e.prototype.jh=function(){return this.Rh.S()},e.prototype.Uh=function(t){return this.Vh="function"==typeof t?t(this.Vh):t,this},e.prototype.Yh=function(){return this.Vh},e.prototype.xh=function(){return this.zh-(Number(this.Gh)+Number(this.Hh))},e.prototype.wh=function(){return this.oh.length},e.prototype.Xh=function(t){return this.Gh=t,this},e.prototype.Zh=function(){return this.Gh},e.prototype.Kh=function(t){return this.Hh=t,this},e.prototype.qh=function(){return this.Hh},e.prototype.co=function(){return this.uo===Y&&this.Jh===Y&&(this.ho!==Y||this.Vh!==Y)},e.prototype.Qh=function(t){this.Jh=t},e.prototype.fo=function(){return this.Vh!==Y||t.prototype.fo.call(this)},e.prototype.ao=function(){return t.prototype.ao.call(this)||!this.Jh||this.Jh!==this.Vh},e}(rE),dE=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.bo=F(m(0,0)),s.$h=F(0),s.ri=F(360),s.ta=F(100),s.ia=F(100),s.na=F(0),s.ea=F(void 0),s.ra=m(0,0),s.sa=m(0,0),s.oa=m(0,0),s}return h(e,t),e.prototype.ha=function(){return this.ta.S()},e.prototype.aa=function(){return this.ia.S()},e.prototype.Vo=function(){return this.bo.S()},e.prototype.ua=function(){return this.$h.S()},e.prototype.ei=function(){return this.ri.S()},e.prototype.ca=function(){return this.na.S()},e.prototype.fa=function(){return this.ea.S()},e.prototype.la=function(){return this.ra},e.prototype.da=function(){return this.sa},e.prototype.va=function(){return this.oa},e.prototype.Eo=function(t){return this.bo.l(t),this},e.prototype.ya=function(t){return this.$h.l(t),this},e.prototype.Sa=function(t){return this.ri.l(t),this},e.prototype.ma=function(t){return this.ia.l(t),this.ta.l(t),this},e.prototype.pa=function(t){return this.ta.l(t),this},e.prototype.ga=function(t){return this.ia.l(t),this},e.prototype.ba=function(t){return this.na.l(t<0?0:t),this},e.prototype.xa=function(t){return this.ea.l(void 0!==t&&t<=0?void 0:t),this},e}(oE);!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple",t[t.Convex=2]="Convex"}(pE||(pE={}));var gE,SE=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.engine=e,s.wa=OB.lineStyle,s}return h(e,t),e.prototype.ka=function(t){return this.wa=function(t,e){return"function"==typeof e?e(t):e}(this.wa,t),this},e.prototype.Ma=function(){return this.wa},e.prototype.vo=function(){return function(t,e){return!t||!1===t.equals(e)}(this.Aa,this.wa)},e.prototype.Fa=function(t){return function(t,e){return!t||t.thickness!==e}(this.Aa,t)},e.prototype.co=function(){return function(t,e){return t===Q&&e!==Q}(this.Aa,this.wa)},e.prototype.fo=function(){return function(t){return t!==Q}(this.wa)},e.prototype.Ta=function(t){this.Aa=t},e}(JB),vE=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.oi=m(0,0),s.ri=m(0,0),s}return h(e,t),e.prototype.l=function(t){var e=t.min,i=t.max;return this.so=!0,this.oi=e,this.ri=i,this},e.prototype.si=function(){return this.oi},e.prototype.ei=function(){return this.ri},e.prototype.Ca=function(t){return this.so=!0,this.oi=t,this},e.prototype.Sa=function(t){return this.so=!0,this.ri=t,this},e}(SE),mE=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.Ba=[],s}return h(e,t),e.prototype.gh=function(t,e){return this.Ba.push(t),this.Ba.push(e),this.so=!0,this},e.prototype.bh=function(){return this.Ba.length=0,this.so=!0,this},e}(SE),xE=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.La=[],s.rh=we,s.oh=new Array,s.sh=0,s.uh=DB.NearestX,s.Ia=F(void 0),s.Gh=!1,s.Hh=!1,s}return h(e,t),e.prototype.Pa=function(t){return this.Ia.l(t),this},e.prototype.Oa=function(){return this.Ia.S()},e.prototype.lh=function(){return this.oh},e.prototype.dh=function(){return this.La},e.prototype.fh=function(t){return this.uh=t,this},e.prototype.bh=function(){return this.so=!0,this.La.length=0,this.sh=0,this.oh=[],this.rh=we,this},e.prototype.xh=function(){return this.sh-(Number(this.Gh)+Number(this.Hh))},e.prototype.wh=function(){return this.oh.length},e.prototype.Xh=function(t){return this.Gh=t,this},e.prototype.Zh=function(){return this.Gh},e.prototype.Kh=function(t){return this.Hh=t,this},e.prototype.qh=function(){return this.Hh},e}(SE),bE=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.engine=e,s.zh=0,s.Da=0,s.kt=F({x:0,y:0}),s._a=F({x:0,y:0}),s.Ra=F({x:0,y:0}),s.oi={x:0,y:0},s.ri={x:0,y:0},s.za=!0,s.Na=!0,s.Ea=!0,s.rh=we,s.Va=!0,s.Ga=Y,s}return h(e,t),e.prototype.Ha=function(t){return this.Ga=tE(this.Ga,t),this},e.prototype.Wa=function(){return this.Ga},e.prototype.l=function(t){return kE.l(this,t,(function(t,e){return{x:t,y:e}})),this},e.prototype.ja=function(){return kE.ja(this)},e.prototype.Ua=function(){return kE.Ua(this)},e.prototype.Vo=function(){return kE.Vo(this)},e.prototype.wh=function(){return kE.wh(this)},e.prototype.Ya=function(t,e,i){return kE.Ya(this,t,e,i),this},e.prototype.Xa=function(t,e,i){return kE.Xa(this,t,e,i),this},e.prototype.Za=function(t,e){return kE.Za(this,t,e),this},e.prototype.Ka=function(t,e){return kE.Ka(this,t,e),this},e.prototype.qa=function(t,e){return kE.qa(this,t,e),this},e.prototype.bh=function(){return kE.bh(this,(function(t,e){return{x:t,y:e}})),this},e.prototype.Ja=function(){return kE.Ja(this)},e.prototype.Qa=function(){return kE.Qa(this)},e.prototype.$a=function(){return kE.$a(this)},e.prototype.xh=function(){return kE.xh(this)},e.prototype.co=function(){return kE.co(this)},e.prototype.fo=function(){return kE.fo(this)},e.prototype.tu=function(){return this.iu},e.prototype.nu=function(){return this.eu},e}(rE),kE={l:function(t,e,i){t.so=!0,t.za=!0,t.Na=!0,t.Ea=!0;var n=e.start,r=e.end,o=e.rows,s=e.columns;t.Va=e.pixelate;var a={x:e.pixelate&&s>=1||!e.pixelate&&s>1?s:0,y:e.pixelate&&o>=1||!e.pixelate&&o>1?o:0};t._a.l(a),t.oi=u({},n),t.ri=u({},r),t.kt.l(ei(r,n)),kE.ru(t,i)},ru:function(t,e){var i=t._a.S();if(i.x>0&&i.y>0){t.iu?t.iu.length=0:t.iu=[];var n=t.Va?ti(i,{x:1,y:1}):{x:i.x,y:i.y};t.Ra.l(n),t.iu=Array.from(Array(n.y)).map((function(){return Array(n.x)})),t.eu=Array.from(Array(i.y)).map((function(){return Array(i.x)})),kE.su(t,i,n,e),t.zh=n.x*n.y,t.Da=i.x*i.y}else t.iu=void 0,t.Ra.l({x:0,y:0})},su:function(t,e,i,n){var r,o,s=t.oi,a=t.ri,l=t.iu,h=t.eu;if(l){for(var u=i.x,f=i.y,p=t.kt.S(),y={x:p.x/(u-1),y:p.y/(f-1)},d=0;d0?t[0].length:0,n=Array.from(Array(i)).map((function(){return Array(e)})),r=0;r0?e[0].length:0,g=(h=o,0);h0?e[0].length:0,y=(h=o,0);h0?e[0].length:0,g=(h=o,0);h0?e[0].length:0,d=(h=o,0);h0){for(var i=0,n=0,r=0;r=this.fu?(this.du.splice(r,1),r-=1):this.du[r].state&&(n=!0);return this.lu?0===e.interactions.length&&(this.du.push({state:!1,time:i}),this.lu=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.du.push({state:!0,time:i}),n=!0,this.lu=!0),n},t.prototype.Un=function(t,e,i){if(i&&!this.lu){var n=this.du.reduce((function(t,e){return e.state?t.on+=1:t.off+=1,t}),{on:0,off:0});n.on>=1&&n.off>=1&&(this.cu(t,e),this.du.length=0)}},t}(),DoublePoke:function(){function t(t,e){void 0===e&&(e=300),this.cu=t,this.fu=e,this.lu=!1,this.du=[]}return t.prototype.uu=function(t,e){for(var i=gt.performance.now(),n=!1,r=0;r=this.fu?(this.du.splice(r,1),r-=1):this.du[r].state&&(n=!0);return this.lu?0===e.interactions.length&&(this.du.push({state:!1,time:i}),this.lu=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.du.push({state:!0,time:i}),n=!0,this.lu=!0),n},t.prototype.Un=function(t,e,i){if(i){var n=this.du.reduce((function(t,e){return e.state?t.on+=1:t.off+=1,t}),{on:0,off:0});n.on>=2&&n.off>=1&&(this.cu(t,e),this.du.length=0)}},t}(),Drag:function(){function t(t,e,i,n,r){void 0===n&&(n=1),void 0===r&&(r=100),this.vu=t,this.yu=e,this.Su=i,this.mu=n,this.pu=r}return t.prototype.uu=function(t,e){var i=e.interactions.length;if(i===this.mu){if(void 0!==this.gu)return!0;if("pointerdown"===e.type&&(1===i||function(t){var e=t.length;if(e>0){for(var i=wE(t),n=0,r=0;r0},t}(),TE=function(t,i,n){var r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){var o=t.scale.Ut(t.getPosition(),{x:r!==e.UIDraggingModes.onlyVertical?i.x:0,y:r!==e.UIDraggingModes.onlyHorizontal?i.y:0}),s=t.scale,a=t.getSize(),l=t.getOrigin(),h=s.Ut({x:s.x.getInnerStart(),y:s.y.getInnerStart()},ii({x:(1+l.x)/2,y:(1+l.y)/2},a)),u=s.Ut({x:s.x.getInnerEnd(),y:s.y.getInnerEnd()},ii({x:(l.x-1)/2,y:(l.y-1)/2},a)),c={x:Math.min(Math.max(o.x,h.x),u.x),y:Math.min(Math.max(o.y,h.y),u.y)};t.setPosition(c),ee(n)}},CE=function(t,e,i,n,r){TE(t,r,e)},DE=function(t,e,i,n,r){TE(t,n,r)},LE=function(t){function i(e,i,n,r,o,s){var a=t.call(this)||this;a.Vu=e,a.renderingScale=i,a.scale=n,a.Ts=r,a.Cs=o,a.theme=s,a.position=m(50,50),a.origin=m(0,0),a.size=m(0,0),a._s=!1,a.Gu=void 0,a.Hu=void 0,a.Wu=IE,a.ju=void 0,a.Uu=function(){var t="function"==typeof a.Wu?a.Wu(a):a.Wu;t&&(a.Hu=a.Vu.As.Sr(t))},a.Yu=function(){a.Vu.As.pr(a.Hu)},a.ct=T(0,0,0,0),a.Vu.Vi(),a.onMouseEnter(a.Uu),a.onMouseLeave(a.Yu),a.onMouseDrag(CE);var l=ME(new AE.Drag(Mt,DE,Mt));return a.onTouchStart(l.onTouchStart),a.onTouchMove(l.onTouchMove),a.onTouchEnd(l.onTouchEnd),a.Ii=s,a}return h(i,t),i.prototype.setAutoDispose=function(t){return this.ju=t,this.Vu.Vi(),this},i.prototype.getAutoDispose=function(){return this.ju},i.prototype.getSize=function(t){return void 0===t&&(t=e.UISpace.Everything),t===e.UISpace.Everything?m(this.size.x+(this.ct.left+this.ct.right),this.size.y+(this.ct.bottom+this.ct.top)):this.size},i.prototype.setContentSize=function(t){this.size=t},i.prototype.setMargin=function(t){return this.ct="object"==typeof t?D(this.ct,t):{left:t,top:t,right:t,bottom:t},this.Vu.Vi(),this},i.prototype.getMargin=function(){return this.ct},i.prototype.Xu=function(){if(this.ju){var t=this.size,e=this.renderingScale.Bt(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.ju.type&&i.x>=this.ju.maxWidth||"max-height"===this.ju.type&&i.y>=this.ju.maxHeight)&&this.dispose()}return this},i.prototype.Un=function(){return this},i.prototype.dispose=function(){return this.Vu.Vi(),this._s=!0,this.Ts(this),this},i.prototype.restore=function(){return this._s=!1,this.Vu.Vi(),this.Cs(this),this},i.prototype.isDisposed=function(){return this._s},i.prototype.setPosition=function(t){return this.position=t,this.Vu.Vi(),this},i.prototype.getPosition=function(t,i){void 0===t&&(t=this.origin),void 0===i&&(i=e.UISpace.Everything);var n=this.getSize(e.UISpace.Everything),r=this.scale.Ut(this.position,ii({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},n));if(i===e.UISpace.Everything)return this.scale.Ut(r,ii({x:(t.x+1)/2,y:(t.y+1)/2},n));var o=this.scale.Ut(r,{x:this.ct.left,y:this.ct.bottom}),s=this.getSize(e.UISpace.Content);return this.scale.Ut(o,ii({x:(t.x+1)/2,y:(t.y+1)/2},s))},i.prototype.setOrigin=function(t){return this.origin=t,this.Vu.Vi(),this},i.prototype.getOrigin=function(){return this.origin},i.prototype.setDraggingMode=function(t){return void 0===t&&(t=e.UIDraggingModes.notDraggable),this.Gu=t,this.Vu.Vi(),this},i.prototype.getDraggingMode=function(){return void 0!==this.Gu?this.Gu:e.UIDraggingModes.notDraggable},i.prototype.setMouseStyle=function(t){return this.Wu=t,this},i.prototype.getMouseStyle=function(){return this.Wu},i}(FE),PE=function(t){function i(e,i,n,r,o,s,a){var l=t.call(this,e,i,n,o,s,a)||this;return l.Vu=e,l.Zu=r,l.To=T(),l.Ku=!1,l.backgroundElement=new l.Zu(l.Vu,l.renderingScale,l.scale,Mt,Mt,a),l.Eu(l.backgroundElement),l}return h(i,t),i.prototype.onHighlight=function(t){return this.Fi.on("highlight",t)},i.prototype.offHighlight=function(t){return this.Fi.off(t)},i.prototype.setBackground=function(t){return t(this.backgroundElement),this},i.prototype.getBackground=function(){return this.backgroundElement},i.prototype.Xu=function(){return t.prototype.Xu.call(this),t.prototype.isDisposed.call(this)||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).Xu(),this},i.prototype.Un=function(){var i=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.qu(i).Un(),t.prototype.Un.call(this)},i.prototype.dispose=function(){return t.prototype.dispose.call(this),this.backgroundElement.dispose(),this},i.prototype.restore=function(){return t.prototype.restore.call(this),this.backgroundElement.restore(),this},i.prototype.isDisposed=function(){return t.prototype.isDisposed.call(this)&&this.backgroundElement.isDisposed()},i.prototype.setPadding=function(t){return this.To="object"==typeof t?D(this.To,t):{left:t,top:t,right:t,bottom:t},this.Vu.Vi(),this},i.prototype.getPadding=function(){return this.To},i.prototype.getSize=function(i){void 0===i&&(i=e.UISpace.Everything);var n=t.prototype.getSize.call(this,i);return i>=e.UISpace.PaddedContent&&(n=m(n.x+this.To.left+this.To.right,n.y+this.To.bottom+this.To.top)),i>=e.UISpace.PaddedBackground&&(n=m(n.x+this.backgroundElement.Ju()+this.backgroundElement.Qu(),n.y+this.backgroundElement.$u()+this.backgroundElement.tc())),n},i.prototype.getPosition=function(i,n){if(void 0===i&&(i=this.origin),void 0===n&&(n=e.UISpace.Everything),n===e.UISpace.Everything)return t.prototype.getPosition.call(this,i,n);var r=t.prototype.getPosition.call(this,m(-1,-1),e.UISpace.Everything),o=this.getMargin(),s=this.scale.Ut(r,{x:o.left,y:o.bottom});if(n===e.UISpace.PaddedBackground){var a=this.getSize(e.UISpace.PaddedBackground);return this.scale.Ut(s,ii({x:(i.x+1)/2,y:(i.y+1)/2},a))}var l=this.scale.Ut(s,{x:this.backgroundElement.Ju(),y:this.backgroundElement.$u()});if(n===e.UISpace.PaddedContent){var h=this.getSize(e.UISpace.PaddedContent);return this.scale.Ut(l,ii({x:(i.x+1)/2,y:(i.y+1)/2},h))}var u=this.getPadding(),c=this.scale.Ut(l,{x:u.left,y:u.bottom}),f=this.getSize(e.UISpace.Content);return this.scale.Ut(c,ii({x:(i.x+1)/2,y:(i.y+1)/2},f))},i.prototype.setMouseInteractions=function(t){return this.backgroundElement.setMouseInteractions(t),this},i.prototype.getMouseInteractions=function(){return this.backgroundElement.getMouseInteractions()},i.prototype.getHighlighted=function(){return this.Ku},i.prototype.setHighlighted=function(t){return this.Ku=t,this.backgroundElement.setHighlighted(t),this.Fi.emit("highlight",t),this},i}(LE),BE=function(t){function e(e,i,n,r,o,s,a,l,h,u,c,f){var p=t.call(this)||this;return p.ic=i,p.nc=n,p.axisScale=r,p.renderingScale=o,p.rc=a,p.sc=l,p.oc=h,p.Ts=u,p.Cs=c,p.hc=p.Eu(p.ic.ac(p.renderingScale)),p.u=0,p.uc=1,p.cc=!1,p.fc=new Ki,p.lc=!0,p.Ii=f,p.dc=p.Eu(p.oc.vc(p.nc,p.renderingScale,s,Mt,Mt,p.Ii,!1).setOrigin($t(p.sc)).setDirection(p.sc)),p.axis=e,p.setMouseInteractions(!1),p.hc.ka(f.customTickGridStrokeStyle),p}return h(e,t),e.prototype.setValue=function(t){return this.u=t,this.nc.Vi(),this.Fi.emit("valueChange",this.u),this},e.prototype.getValue=function(){return this.u},e.prototype.setTextFormatter=function(t){return this.yc=t,this.nc.Vi(),this},e.prototype.setTickLength=function(t){return this.dc.setPointerLength(t),this.ic.Vi(),this},e.prototype.getTickLength=function(){return this.dc.getPointerLength()},e.prototype.setTickLabelPadding=function(t){return this.dc.setTickLabelPadding(t),this.ic.Vi(),this},e.prototype.setTickLabelRotation=function(t){return this.dc.setTextRotation(t),this.ic.Vi(),this},e.prototype.getTickLabelRotation=function(){return this.dc.getTextRotation()},e.prototype.getTickLabelPadding=function(){return this.dc.getTickLabelPadding()},e.prototype.setGridStrokeLength=function(t){return this.uc=t,this.ic.Vi(),this},e.prototype.getGridStrokeLength=function(){return this.uc},e.prototype.setGridStrokeStyle=function(t){return this.hc.ka(t),this.ic.Vi(),this},e.prototype.getGridStrokeStyle=function(){return this.hc.Ma()},e.prototype.restore=function(){return this.hc.restore(),this.cc||this.dc.restore(),this.Cs(this),this.ic.As.Vi(),this},e.prototype.dispose=function(){return this.hc.dispose(),this.dc.dispose(),this.Ts(this),this.ic.As.Vi(),this},e.prototype.isDisposed=function(){return this.hc.isDisposed()&&this.dc.isDisposed()},e.prototype.disposeMarker=function(){return this.cc=!0,this.dc.dispose(),this.nc.Vi(),this},e.prototype.restoreMarker=function(){return this.cc=!1,this.isDisposed()||this.dc.restore(),this.nc.Vi(),this},e.prototype.isDisposedMarker=function(){return this.cc},e.prototype.setMarker=function(t){return t(this.dc),this.nc.Vi(),this},e.prototype.getMarker=function(){return this.dc},e.prototype.setMouseInteractions=function(t){return this.dc.setMouseInteractions(t),this.hc.setMouseInteractions(t),this},e.prototype.getMouseInteractions=function(){return this.hc.getMouseInteractions()},e.prototype.setAllocatesAxisSpace=function(t){return this.lc=t,this.nc.Vi(),this},e.prototype.getAllocatesAxisSpace=function(){return this.lc},e.prototype.isInScale=function(){return Le(this.u,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())},e.prototype.onValueChange=function(t){return this.Fi.on("valueChange",t)},e.prototype.offValueChange=function(t){return this.Fi.off(t,"valueChange")},e}(FE),EE=function(t){function e(e,i,n,r,o,s,a,l,h,u,c,f){var p=t.call(this,e,i,n,r,o,s,a,l,f,u,h,c)||this;return p.ic=i,p.nc=n,p.gh=h,p.Ts=u,p.Ii=c,p.Sc=!1,p}return h(e,t),e.prototype.isDisposed=function(){return!this.Sc&&t.prototype.isDisposed.call(this)},e.prototype.dispose=function(){return this.Sc=!1,t.prototype.dispose.call(this)},e.prototype.update=function(){return this},e.prototype.plot=function(t,e,i,n){if(this.isInScale()){this.Sc=!1;var r=tt(this.u,this.axisScale,this.rc.getWidth(this.renderingScale));this.hc.restore().Ca(this.rc.toPoint(r,t)).Sa(this.rc.toPoint(r,t-(i+e*this.uc))),this.cc||(this.yc&&this.dc.setText(this.yc(this.u,this)),this.dc.restore().setPosition(this.rc.toPoint(r,n)).Un().Xu())}else this.hc.dispose(),this.dc.dispose();return this},e.prototype.mc=function(){var t=this.dc.Un().getSize();return this.rc.getHeight(t)},e}(BE);e.HighlightModes=void 0,(gE=e.HighlightModes||(e.HighlightModes={}))[gE.noHighlighting=0]="noHighlighting",gE[gE.onHover=1]="onHover",gE[gE.onHoverIndividual=2]="onHoverIndividual";var OE,_E=function(){function t(t,i,n,o){var s=this;this.Ie=t,this.gc=i,this.bc=n,this.Ii=o,this.xc=!0,this.Ku=!1,this.wc=e.HighlightModes.noHighlighting,this.kc=[],this._s=!1,this.Mc=0,this.Fi=new r.Eventer,this.Ac=this.xc,this.Fc=[],this.Tc=function(t,e){e?s.restore():s.dispose()},this.onEntryMouseEnter=function(){return s.setHighlighted(!0)},this.onEntryMouseLeave=function(){return s.setHighlighted(!1)},this.onMouseEnter=function(t){return s.Fi.on("mouseEnter",t)},this.onMouseLeave=function(t){return s.Fi.on("mouseLeave",t)},this.onMouseClick=function(t){return s.Fi.on("mouseClick",t)},this.onMouseDoubleClick=function(t){return s.Fi.on("mouseDoubleClick",t)},this.onMouseDown=function(t){return s.Fi.on("mouseDown",t)},this.onMouseUp=function(t){return s.Fi.on("mouseUp",t)},this.onMouseMove=function(t){return s.Fi.on("mouseMove",t)},this.offMouseEnter=function(t){return s.Fi.off(t,"mouseEnter")},this.offMouseLeave=function(t){return s.Fi.off(t,"mouseLeave")},this.offMouseClick=function(t){return s.Fi.off(t,"mouseClick")},this.offMouseDoubleClick=function(t){return s.Fi.off(t,"mouseDoubleClick")},this.offMouseDown=function(t){return s.Fi.off(t,"mouseDown")},this.offMouseUp=function(t){return s.Fi.off(t,"mouseUp")},this.offMouseMove=function(t){return s.Fi.off(t,"mouseMove")},this.offMouseDragStart=function(t){return s.Fi.off(t,"mouseDragStart")},this.offMouseDrag=function(t){return s.Fi.off(t,"mouseDrag")},this.offMouseDragStop=function(t){return s.Fi.off(t,"mouseDragStop")},this.offMouseWheel=function(t){return s.Fi.off(t,"mouseWheel")},this.Cc=function(t,e){0===s.Mc&&s.Fi.emit("mouseEnter",s,e);var i=m(e.clientX,e.clientY);s.Bc(t,i)},this.Lc=function(t,e){1===s.Mc&&s.Fi.emit("mouseLeave",s,e),s.Ic(t)},this.Pc=function(t,e){s.Fi.emit("mouseMove",s,e),s.Oc(t,m(e.clientX,e.clientY))},this.Dc=function(t,e){return s.Fi.emit("mouseClick",s,e)},this._c=function(t,e){return s.Fi.emit("mouseDoubleClick",s,e)},this.Rc=function(t,e){return s.Fi.emit("mouseDown",s,e)},this.zc=function(t,e){return s.Fi.emit("mouseUp",s,e)},this.Nc=function(t,e,i){s.Fi.emit("mouseDragStart",s,e,i)},this.Ec=function(t,e,i,n,r){s.Fi.emit("mouseDrag",s,e,i,n,r)},this.Vc=function(t,e,i,n){s.Fi.emit("mouseDragStop",s,e,i,n)},this.Gc=function(t,e){s.Fi.emit("mouseWheel",s,e)},this.Hc=function(t,e){s.Fi.emit("touchStart",s,e),s.Bc(t,m(e.clientX,e.clientY))},this.Wc=function(t,e){s.Fi.emit("touchMove",s,e),s.Oc(void 0,m(e.clientX,e.clientY))},this.jc=function(t,e){s.Fi.emit("touchEnd",s,e),s.Ic(t)}}return t.prototype.onHighlight=function(t){return this.Fi.on("highlight",t)},t.prototype.offHighlight=function(t){return this.Fi.off(t)},t.prototype.setName=function(t){var e=this;return this.Uc=t,this.Fc.forEach((function(t){return t.setText(e.Uc)})),this},t.prototype.getName=function(){return this.Uc},t.prototype.isDisposed=function(){return this._s},t.prototype.dispose=function(){this._s=!0;var t=this.kc.slice();return t.forEach(wt),this.kc=t,this.Fc.forEach((function(t){return t.getOn()?t.setOn(!1):void 0})),this.gc(this),this.Ie.engine.Vi(),this},t.prototype.restore=function(){return this._s=!1,this.kc.forEach(kt),this.Fc.forEach((function(t){return t.getOn()?void 0:t.setOn(!0)})),this.bc(this),this.Ie.engine.Vi(),this},t.prototype.setHighlighted=function(t){var e=this;return this.Ku=t,this.kc.forEach((function(i){return e.Yc(i,t)})),this.Fi.emit("highlight",t),this.Ie.engine.Vi(),this},t.prototype.getHighlighted=function(){return this.Ku},t.prototype.Xc=function(t){this.xc=t;for(var e=0;e0},t.prototype.setHighlightOnHover=function(t){return this.wc=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.Ku&&this.setHighlighted(!1),this},t.prototype.getHighlightOnHover=function(){return this.wc!==e.HighlightModes.noHighlighting},t.prototype.Kc=function(t,e){return void 0===e&&(e=this.kc),e.includes(t)||(e.push(t),t.setIsUnderMouse(this.Mc>0).setMouseInteractions(this.xc).setMouseEnterEventHandler(this.Cc).setMouseLeaveEventHandler(this.Lc).setMouseClickEventHandler(this.Dc).setMouseDoubleClickEventHandler(this._c).setMouseDownEventHandler(this.Rc).setMouseUpEventHandler(this.zc).setMouseMoveEventHandler(this.Pc).setMouseDragStartEventHandler(this.Nc).setMouseDragEventHandler(this.Ec).setMouseDragStopEventHandler(this.Vc).setMouseWheelEventHandler(this.Gc).setTouchStartEventHandler(this.Hc).setTouchMoveEventHandler(this.Wc).setTouchEndEventHandler(this.jc)),t},t.prototype.attach=function(t,e){void 0===e&&(e=!0),t.setText(this.Uc),t.setButtonOffStrokeStyle(t.getButtonOffStrokeStyle().set("thickness",1)),t.setButtonOnStrokeStyle(t.getButtonOnStrokeStyle().set("thickness",1));var i=t.getLocked();return t.setLocked(!1).setOn(!this.isDisposed()).setLocked(i),e&&t.onSwitch(this.Tc),t.setLocked(!e),t.onMouseEnter(this.onEntryMouseEnter),t.onMouseLeave(this.onEntryMouseLeave),this.onMouseEnter((function(){return t.setHighlighted(!0)})),this.onMouseLeave((function(){return t.setHighlighted(!1)})),this.onTouchStart((function(){return t.setHighlighted(!0)})),this.onTouchEnd((function(){return t.setHighlighted(!1)})),this.Fc.push(t),this},t.prototype.onMouseDragStart=function(t){return this.Fi.on("mouseDragStart",t)},t.prototype.onMouseDrag=function(t){return this.Fi.on("mouseDrag",t)},t.prototype.onMouseDragStop=function(t){return this.Fi.on("mouseDragStop",t)},t.prototype.onMouseWheel=function(t){return this.Fi.on("mouseWheel",t)},t.prototype.onTouchStart=function(t){return this.Fi.on("touchStart",t)},t.prototype.onTouchMove=function(t){return this.Fi.on("touchMove",t)},t.prototype.onTouchEnd=function(t){return this.Fi.on("touchEnd",t)},t.prototype.offTouchStart=function(t){return this.Fi.off(t,"touchStart")},t.prototype.offTouchMove=function(t){return this.Fi.off(t,"touchMove")},t.prototype.offTouchEnd=function(t){return this.Fi.off(t,"touchEnd")},t.prototype.Bc=function(t,i,n){void 0===n&&(n=1),this.Mc+=n,this.wc===e.HighlightModes.onHoverIndividual&&this.Yc(t,!0),this.Mc===n&&this.wc===e.HighlightModes.onHover&&this.setHighlighted(!0)},t.prototype.Ic=function(t,i){void 0===i&&(i=1),this.Mc=Math.max(0,this.Mc-i),this.wc===e.HighlightModes.onHoverIndividual&&this.Yc(t,!1),0===this.Mc&&this.wc===e.HighlightModes.onHover&&this.setHighlighted(!1)},t.prototype.Oc=function(t,e){},t}(),VE=function(t){function e(e,i,n,r,o,s,a,l){var h=t.call(this,i,n,r,l)||this;return h.Vu=e,h.axis=o,h.Y=s,h.qc=a,h.Jc(),h}return h(e,t),e.prototype.Oc=function(){},e}(_E),zE=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.Uc="Band",e.Qc=0,e.$c=0,e.ho=new v(e.Ii.bandFillStyle),e.do=new v(e.Ii.bandStrokeStyle),e.nt=e.Kc(e.Vu.tf(e.Y)).pn(e.ho.L()).fs(e.do.L()),e}return h(i,t),i.prototype.setValueStart=function(t){return this.Qc=t,this.Fi.emit("valueChange",this,this.Qc,this.$c),this.Vu.Vi(),this},i.prototype.getValueStart=function(){return this.Qc},i.prototype.setValueEnd=function(t){return this.$c=t,this.Fi.emit("valueChange",this,this.Qc,this.$c),this.Vu.Vi(),this},i.prototype.getValueEnd=function(){return this.$c},i.prototype.setFillStyle=function(t){this.ho.C(t);var e=this.ho.D(this.Ku);return this.nt.pn(e),this.Vu.Vi(),this},i.prototype.getFillStyle=function(){return this.ho.L()},i.prototype.setFillStyleHighlight=function(t){if(this.ho.I(t),this.getHighlighted()){var e=this.ho.D(!0);this.nt.pn(e)}return this.Vu.Vi(),this},i.prototype.getFillStyleHighlight=function(){return this.ho.D(!0)},i.prototype.setStrokeStyle=function(t){this.do.C(t);var e=this.do.D(this.Ku);return this.nt.fs(e),this.Vu.Vi(),this},i.prototype.getStrokeStyle=function(){return this.do.L()},i.prototype.setStrokeStyleHighlight=function(t){if(this.do.I(t),this.getHighlighted()){var e=this.do.D(!0);this.nt.fs(e)}return this.Vu.Vi(),this},i.prototype.getStrokeStyleHighlight=function(){return this.do.D(!0)},i.prototype.onValueChange=function(t){return this.Fi.on("valueChange",t)},i.prototype.offValueChange=function(t){return this.Fi.off(t,"valueChange")},i.prototype.Xu=function(){return this.nt.Eo(this.qc.toVec2(this.Qc,this.qc.getHeight(this.Y).getInnerStart())).wt(this.qc.toVec2(this.$c-this.Qc,this.qc.getHeight(this.Y).getInnerInterval())),this},i.prototype.attach=function(e,i){return t.prototype.attach.call(this,e,i),fe(e,this.Ii,{fill:this.ho,stroke:this.do}),this},i.prototype.Yc=function(t,e){t.pn(this.ho.D(e)),this.Vu.Vi()},i.prototype.Jc=function(){var t,i,n=this,r=function(e,r){var o=et(n.Vu.As.Lr(r.x,r.y),n.Vu.As.Y,n.Y),s=n.qc.getWidth(o),a=n.axis.Y.U(n.Qc),l=n.axis.Y.U(n.$c),h=(n.axis.Y.U(s)-a)/(l-a);0==(t=!(h<.1||h>.9))&&(i=h<.5)},o=function(e,r,o,s,a){var l=n.qc.getWidth(s);t?(n.Qc=n.axis.Y.Ut(n.Qc,l),n.$c=n.axis.Y.Ut(n.$c,l)):i?n.Qc=n.axis.Y.Ut(n.Qc,l):n.$c=n.axis.Y.Ut(n.$c,l),ee(a),n.Fi.emit("valueChange",n,n.Qc,n.$c),n.Vu.Vi()};this.onMouseMove((function(i,o){r(0,m(o.clientX,o.clientY));var s=t?e.MouseStyles.Point:n.qc.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});n.if=n.Ie.engine.setMouseStyle(s,n.if)})),this.onMouseLeave((function(){n.Ie.engine.restoreMouseStyle(n.if),n.if=void 0})),this.onMouseDrag((function(t,e,i,n,r){0===i&&o(0,0,0,r,e)}));var s=ME(new AE.Drag(r,o));this.onTouchStart(s.onTouchStart),this.onTouchMove(s.onTouchMove),this.onTouchEnd(s.onTouchEnd)},i}(VE),NE=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.Uc="Constant Line",e.u=0,e.do=new v(e.Ii.constantLineStrokeStyle),e.it=e.Kc(e.Vu.ac(e.Y)).ka(e.do.L()),e}return h(i,t),i.prototype.setValue=function(t){return this.u=t,this.Fi.emit("valueChange",this,this.u),this.Vu.Vi(),this},i.prototype.getValue=function(){return this.u},i.prototype.setStrokeStyle=function(t){this.do.C(t);var e=this.do.D(this.Ku);return this.it.ka(e),this.Vu.Vi(),this},i.prototype.getStrokeStyle=function(){return this.do.L()},i.prototype.setStrokeStyleHighlight=function(t){if(this.do.I(t),this.getHighlighted()){var e=this.do.D(!0);this.it.ka(e)}return this.Vu.Vi(),this},i.prototype.getStrokeStyleHighlight=function(){return this.do.D(!0)},i.prototype.onValueChange=function(t){return this.Fi.on("valueChange",t)},i.prototype.offValueChange=function(t){return this.Fi.off(t,"valueChange")},i.prototype.Xu=function(){return this.it.Ca(this.qc.toVec2(this.u,this.qc.getHeight(this.Y).getInnerStart())).Sa(this.qc.toVec2(this.u,this.qc.getHeight(this.Y).getInnerEnd())),this},i.prototype.attach=function(e,i){return t.prototype.attach.call(this,e,i),fe(e,this.Ii,{stroke:this.do}),this},i.prototype.Yc=function(t,e){t.ka(this.do.D(e)),this.Vu.Vi()},i.prototype.Jc=function(){var t=this,i=function(e,i,n,r){t.u=t.axis.Y.Ut(t.u,t.qc.getWidth(r)),t.Fi.emit("valueChange",t,t.u),t.Vu.Vi()};this.onMouseMove((function(){var i=t.qc.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});t.if=t.Ie.engine.setMouseStyle(i,t.if)})),this.onMouseLeave((function(){t.Ie.engine.restoreMouseStyle(t.if),t.if=void 0})),this.onMouseDrag((function(t,e,n,r,o){0===n&&i(0,0,0,o)}));var n=ME(new AE.Drag(void 0,i));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)},i}(VE),RE=function(t,e){return t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiFont)},HE=function(t,e){return fe(t.setButtonOffSize(e.uiButtonSize).setButtonOnSize(e.uiButtonSize),e,{fill:e.uiButtonFillStyle}),t},YE=function(t,e,i){i&&"setBackground"in t&&t.setBackground((function(t){return t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle)}))},UE={uiElement:void 0,stylers:s.List(),addStyler:function(t){return u(u({},this),{stylers:this.stylers.push(t)})},applyStylers:function(t,e){return this.stylers.forEach((function(i){return void 0!==i?i(t,e):void 0})),t}},GE={background:void 0,setBackground:function(t){return u(u({},this),{background:t})}},XE={vc:function(t,e,i,n,r,o,s){var a=this.applyStylers(new this.uiElement(t,e,i,n,r,o),o);return YE(a,o,s),a}},WE={vc:function(t,e,i,n,r,o,s){var a=this.applyStylers(new this.uiElement(t,e,i,this.background,n,r,o),o);return YE(a,o,s),a}},jE=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.nf=!0,e}return h(e,t),e.prototype.Xu=function(){return t.prototype.Xu.call(this),this},e.prototype.setMouseInteractions=function(t){return this.nf=t,this},e.prototype.getMouseInteractions=function(){return this.nf},e}(LE),KE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.onHighlight=function(t){return this.Fi.on("highlight",t)},e.prototype.offHighlight=function(t){return this.Fi.off(t)},e.prototype.qu=function(t){return this.size=t,this},e.prototype.Ju=function(){return 0},e.prototype.Qu=function(){return 0},e.prototype.tc=function(){return 0},e.prototype.$u=function(){return 0},e.prototype.getHighlighted=function(){return!1},e.prototype.setHighlighted=function(){return this},e.prototype.setFillStyleHighlight=function(){return this},e.prototype.getFillStyleHighlight=function(){return Y},e.prototype.setFillStyle=function(){return this},e.prototype.getFillStyle=function(){return Y},e.prototype.setStrokeStyle=function(){return this},e.prototype.getStrokeStyle=function(){return Q},e.prototype.setStrokeThickness=function(){return this},e.prototype.getStrokeThickness=function(){return 0},e}(jE),ZE=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.setSize=e.qu.bind(e),e}return h(e,t),e}(KE),qE=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ho=new v(Y),e.Fi=new r.Eventer,e.Ku=!1,e}return h(e,t),e.prototype.onHighlight=function(t){return this.Fi.on("highlight",t)},e.prototype.offHighlight=function(t){return this.Fi.off(t)},e.prototype.setFillStyle=function(t){return this.ho.C(t),this.$o.pn(this.ho.D(this.Ku)),this.Vu.Vi(),this},e.prototype.getFillStyle=function(){return this.ho.L()},e.prototype.setFillStyleHighlight=function(t){return this.ho.I(t),this.$o.pn(this.ho.D(this.Ku)),this},e.prototype.getFillStyleHighlight=function(){return this.ho.O()},e.prototype.getHighlighted=function(){return this.Ku},e.prototype.setHighlighted=function(t){return this.Ku=t,this.$o.pn(this.ho.D(t)),this.Fi.emit("highlight",t),this.Vu.Vi(),this},e.prototype.setMouseInteractions=function(t){return this.$o.setMouseInteractions(t),this},e.prototype.getMouseInteractions=function(){return this.$o.getMouseInteractions()},e.prototype.dispose=function(){return t.prototype.dispose.call(this),this.$o.dispose(),this},e.prototype.restore=function(){return t.prototype.restore.call(this),this.$o.restore(),this},e.prototype.isDisposed=function(){return t.prototype.isDisposed.call(this)&&this.$o.isDisposed()},e}(LE),QE=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.do=new v(Q),e}return h(e,t),e.prototype.setStrokeStyle=function(t){return this.do.C(t),this.$o.fs(this.do.D(this.getHighlighted())),this.Vu.Vi(),this},e.prototype.getStrokeStyle=function(){return this.do.L()},e.prototype.setStrokeStyleHighlight=function(t){return this.do.I(t),this.$o.fs(this.do.D(this.getHighlighted())),this},e.prototype.getStrokeStyleHighlight=function(){return this.do.O()},e.prototype.setHighlighted=function(e){return t.prototype.setHighlighted.call(this,e),this.$o.fs(this.do.D(e)),this},e}(qE),JE=function(t){function e(e,i,n,r,o,s,a){var l=t.call(this,e,i,n,o,s,a)||this;return l.Vu=e,l.$o=l.Vu.ef(l.renderingScale,r).fs(l.getStrokeStyle()).pn(l.getFillStyle()),l.Eu(l.$o),l}return h(e,t),e.prototype.rf=function(){var t=this,e=this.sf();if(e.length>2){var i=Ne(e),n=m(i.max.x-i.min.x,i.max.y-i.min.y);this.setContentSize(n);var r=e.map((function(e){var r=ti(e,$e(i.min,-1));return t.scale.Ut(t.position,ti(r,ii($e(ti(t.origin,m(1,1)),-.5),n)))})).map((function(e){return et(e,t.scale,t.renderingScale)}));this.$o.Lh(r)}else this.$o&&this.$o.dispose(),this.setContentSize(m(0,0))},e.prototype.Xu=function(){return t.prototype.Xu.call(this),t.prototype.isDisposed.call(this)||this.rf(),this},e.prototype.Un=function(){return this.rf(),t.prototype.Un.call(this)},e}(QE),$E=function(t){function i(e,i,n,r,o,s){var a=t.call(this,e,i,n,r,o,s)||this;return a.po="label",a.$o=a.Vu.pe(a.renderingScale).pn(a.ho.D(a.getHighlighted())).Sn(a.po),a.Eu(a.$o),a}return h(i,t),i.prototype.Xu=function(){var t=this.getPosition(m(0,0),e.UISpace.Content),i=et(t,this.scale,this.renderingScale);return this.$o.Eo(i),this},i.prototype.Un=function(){this.$o.Un();var e=0===this.po.length?m(0,0):this.$o.hf();return this.setContentSize(e),t.prototype.Un.call(this)},i.prototype.setText=function(t){return this.po=t,this.$o.Sn(this.po),this.Vu.Vi(),this},i.prototype.getText=function(){return this.po},i.prototype.setFont=function(t){return this.$o.bn(t),this.Vu.Vi(),this},i.prototype.getFont=function(){return this.$o.gn()},i.prototype.setTextRotation=function(t){return this.$o.xn(t),this.Vu.Vi(),this},i.prototype.getTextRotation=function(){return this.$o.wn()},i}(qE),tO=u(u(u({},UE),XE),{uiElement:$E}),eO=function(t){function i(e,i,n,r,o,s){var a=t.call(this,e,i,n,r,o,s)||this;return a.fitTo=a.qu.bind(a),a.setSize=a.fitTo,a.$o=a.Vu.tf(i).pn(a.ho.D(a.getHighlighted())).fs(a.getStrokeStyle()),a.Eu(a.$o),a}return h(i,t),i.prototype.Xu=function(){var t=this,i=Ne([this.getPosition(m(-1,-1),e.UISpace.Content),this.getPosition(m(1,1),e.UISpace.Content)].map((function(e){return et(e,t.scale,t.renderingScale)}))),n={x:i.max.x-i.min.x,y:i.max.y-i.min.y};return this.$o.wt(n).Eo(et(this.getPosition(m(-1,-1),e.UISpace.Content),this.scale,this.renderingScale)).Un(),this},i.prototype.qu=function(t){return this.setContentSize(t),this.Vu.Vi(),this},i.prototype.Ju=function(){return 0},i.prototype.Qu=function(){return 0},i.prototype.tc=function(){return 0},i.prototype.$u=function(){return 0},i}(QE),iO=function(t){function i(e,i,n,r,o,s){var a=t.call(this,e,i,n,r,o,s)||this;return a.af=m(0,0),a.setSize=a.fitTo.bind(a),a.$o=e.uf(i).ya(0).Sa(360).pn(a.ho.D(a.getHighlighted())).fs(a.getStrokeStyle()),a.Eu(a.$o),a}return h(i,t),i.prototype.Xu=function(){var t=this.getSize(e.UISpace.Content).x/2;return this.$o.pa(t*this.renderingScale.pi().x).ga(t*this.renderingScale.pi().y).Eo(et(this.getPosition(m(0,0),e.UISpace.Content),this.scale,this.renderingScale)).xa(255).Un(),this},i.prototype.qu=function(t){var e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(m(2*e,2*e)),this.af=t,this.Vu.Vi(),this},i.prototype.Ju=function(){return(this.getSize(e.UISpace.Content).x-this.af.x)/2},i.prototype.Qu=function(){return(this.getSize(e.UISpace.Content).x-this.af.x)/2},i.prototype.tc=function(){return(this.getSize(e.UISpace.Content).y-this.af.y)/2},i.prototype.$u=function(){return(this.getSize(e.UISpace.Content).y-this.af.y)/2},i.prototype.fitTo=function(t){var e=Math.min(t.x,t.y);return this.setContentSize(m(e,e)),this.af=t,this},i}(QE),nO=function(t){function i(e,i,n,r,o,s){var a=t.call(this,e,i,n,pE.Convex,r,o,s)||this;return a.Vu=e,a.cf=F(m(0,0)),a.ff=!1,a.setSize=a.fitTo.bind(a),a.rf(),a}return h(i,t),i.prototype.sf=function(){var t=this.cf.S();if(this.ff){var e=Math.min(t.x,t.y);return[m(0,0),m(e/2,e/2),m(0,e),m(-e/2,e/2)]}var i=2*Math.sqrt(this.cf.S().x*this.cf.S().x/4+this.cf.S().y*this.cf.S().y/4),n=m(Math.cos(Math.PI/4)*i,0),r=m(0,Math.sin(Math.PI/4)*i),o=m(0,0),s=ti(o,ti(n,r)),a=ti(s,ti(r,$e(n,-1)));return[o,s,a,ei(a,ti(n,r))]},i.prototype.qu=function(t){return this.cf.l(t),this.ff=!1,this.Vu.Vi(),this},i.prototype.Ju=function(){return this.ff?0:(this.getSize(e.UISpace.Content).x-this.cf.S().x)/2},i.prototype.Qu=function(){return this.ff?0:(this.getSize(e.UISpace.Content).x-this.cf.S().x)/2},i.prototype.tc=function(){return this.ff?0:(this.getSize(e.UISpace.Content).y-this.cf.S().y)/2},i.prototype.$u=function(){return this.ff?0:(this.getSize(e.UISpace.Content).y-this.cf.S().y)/2},i.prototype.fitTo=function(t){return this.cf.l(t),this.ff=!0,this.Vu.Vi(),this},i}(JE),rO=function(t){function i(i,n,r,o,s,a){var l=t.call(this,i,n,r,pE.Simple,o,s,a)||this;return l.lf=F(m(0,0)),l.df=F(10),l.vf=F(void 0),l.sc=F(e.UIDirections.Right),l.rf(),l}return h(i,t),i.prototype.setDirection=function(t){return this.sc.l(t),this.Vu.Vi(),this},i.prototype.getDirection=function(){return this.sc.S()},i.prototype.setPointerLength=function(t){return this.df.l(t),this.Vu.Vi(),this},i.prototype.getPointerLength=function(){return this.df.S()},i.prototype.setPointerAngle=function(t){return this.vf.l(t),this.Vu.Vi(),this},i.prototype.getPointerAngle=function(){var t=this.vf.S();if(void 0===t){var e=this.yf();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)},i.prototype.qu=function(t){return this.lf.l(t),this.Vu.Vi(),this},i.prototype.Sf=function(){var t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)},i.prototype.mf=function(){return te(this.sc.S())?this.lf.S().x:this.lf.S().y},i.prototype.yf=function(){return te(this.sc.S())?this.lf.S().y:this.lf.S().x},i.prototype.Ju=function(){switch(this.sc.S()){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.Sf()-this.yf());default:return 0}},i.prototype.Qu=function(){switch(this.sc.S()){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.Sf()-this.yf());default:return 0}},i.prototype.tc=function(){switch(this.sc.S()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Sf()-this.yf());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}},i.prototype.$u=function(){switch(this.sc.S()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Sf()-this.yf());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}},i.prototype.sf=function(){var t=$t(this.sc.S()),e=Qe(m(0,0),t),i=this.getPointerLength(),n=this.Sf(),r=this.mf(),o=this.yf();if(!(0!==i&&0!==n||0!==r&&0!==o))return[];var s=m(0,0),a=ti(ti(s,$e(t,-i)),$e(e,n/2)),l=ti(a,$e(e,(o-n)/2)),h=ti(l,$e(t,-r)),u=ti(ti(s,$e(t,-i)),$e(e,-n/2)),c=ti(u,$e(e,-(o-n)/2)),f=ti(c,$e(t,-r));return 0===r||0===o?[s,a,u]:0===i||0===n?[l,h,f,c]:At(o,n)?[s,a,h,f,u]:[s,a,l,h,f,c,u]},i}(JE),oO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.setSize=function(t){return this.setContentSize(t),this.Vu.Vi(),this},e}(jE),sO=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pf=[],e.gf=0,e.bf=function(t){var i=e.pf.indexOf(t);i>=0&&e.pf.splice(i,1)},e.xf=function(t){e.pf.includes(t)||e.pf.push(t)},e}return h(e,t),e.prototype.getMembers=function(){return this.pf},e.prototype.getMemberCount=function(){return this.pf.length},e.prototype.setMinimumSize=function(t){return this.wf=t,this.Vu.Vi(),this},e.prototype.getMinimumSize=function(){return this.wf},e.prototype.addElement=function(t,e){void 0===e&&(e=-1);var i=t.vc(this.Vu,this.renderingScale,this.scale,this.bf,this.xf,this.Ii,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.pf.splice(e,0,i):this.pf.push(i),this.Eu(i),jt(!this.isDisposed())(i),i},e.prototype.dispose=function(){t.prototype.dispose.call(this);var e=this.pf.slice();return e.slice().forEach(wt),this.pf=e,this},e.prototype.restore=function(){return t.prototype.restore.call(this),this.pf.forEach(kt),this},e.prototype.isDisposed=function(){return this.pf.reduce((function(t,e){return!!t&&e.isDisposed()}),t.prototype.isDisposed.call(this))},e.prototype.setMouseInteractions=function(e){t.prototype.setMouseInteractions.call(this,e);for(var i=0;i0?(this.size.x-this.gf)/r:0;return this.pf.reduce((function(t,e){return e instanceof oO?i.scale.Ut({x:t,y:n.y},{x:o+e.getSize().x,y:0}).x:e.setOrigin(m(-1,0)).setPosition(m(t,n.y)).Xu().getPosition(m(1,0)).x}),n.x),this},i.prototype.Un=function(){for(var e=0;e0?(this.size.y-this.gf)/r:0;return this.pf.reduce((function(t,e){return e instanceof oO?i.scale.Ut({x:n.x,y:t},{x:0,y:-(o+e.getSize().y)}).y:e.setOrigin(m(0,1)).setPosition(m(n.x,t)).Xu().getPosition(m(0,-1)).y}),n.y),this},i.prototype.Un=function(){for(var e=0;e0?this.If*r.y+this.Df.Bt().y:0)+.5*this.Tf[0].Bt().y},s={x:o.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*this.Tf[this.Tf.length-1].Bt().y};this.Of.Eo({x:u.x,y:o.y}),this.Df.Xo({x:-1,y:-1}).Eo(h);var a=n.min,l=n.max;n.getSteps().forEach((function(t,e){var r=Oe(o,s,!0===n.getInterpolation()?(t.value-a)/(l-a):.9*(t.value-a)/(l-a));i.Tf[e].Xo({x:-1,y:0}).Eo(r)}))}else{var h,u=this.getPosition({x:-1,y:-1},e.UISpace.Content),c=this.getPosition({x:1,y:1},e.UISpace.Content),f=this.Tf.reduce((function(t,e){return Math.max(t,e.Bt().y)}),0),p=ti(u,{x:.5*this.Tf[0].Bt().x,y:f}),y={x:(h={x:c.x,y:p.y}).x-(.5*this.Tf[this.Tf.length-1].Bt().x+(this.Bf.length>0?this.If*r.x+this.Df.Bt().x:0)),y:p.y},d={x:p.x,y:p.y+this.Cf*r.y};this.Of.Eo(d),this.Df.Xo({x:1,y:1}).Eo(h);var g=n.min,S=n.max;n.getSteps().forEach((function(t,e){var r=Oe(p,y,!0===n.getInterpolation()?(t.value-g)/(S-g):.9*(t.value-g)/(S-g));i.Tf[e].Xo({x:0,y:1}).Eo(r)}))}}return this},i.prototype.Un=function(){if(this.Nf){this.Df.restore(),this.Of.restore();for(var e=this.Nf.getSteps(),i=this.Tf.length;i0?this.If+this.Df.Un().hf().y:0)+r+.5*this.Tf[0].Un().hf().y+.5*this.Tf[this.Tf.length-1].Un().hf().y;this.setContentSize({x:o,y:s})}else n=this._f,r=this.Rf,this.Of.wt({x:n*this.renderingScale.x.getPixelSize(),y:r*this.renderingScale.y.getPixelSize()}),o=(this.Bf.length>0?this.If+this.Df.Un().hf().x:0)+n+.5*this.Tf[0].Un().hf().x+.5*this.Tf[this.Tf.length-1].Un().hf().x,s=r+this.Cf+this.Tf.reduce((function(t,e){return Math.max(t,e.Un().hf().y)}),0),this.setContentSize({x:o,y:s})}else this.Tf.forEach((function(t){return t.dispose()})),this.Tf.length=0,this.Df.dispose(),this.Of.dispose(),this.setContentSize({x:0,y:0});return t.prototype.Un.call(this)},i.prototype.restore=function(){return t.prototype.restore.call(this),this.Of.restore(),this.Tf.forEach(kt),this.Df.restore(),this},i.prototype.dispose=function(){return t.prototype.dispose.call(this),this.Of.dispose(),this.Tf.forEach(wt),this.Df.dispose(),this},i.prototype.isDisposed=function(){return t.prototype.isDisposed.call(this)&&this.Of.isDisposed()},i.prototype.setMouseInteractions=function(t){return this.Of.setMouseInteractions(t),this.Tf.forEach((function(e){return e.setMouseInteractions(t)})),this},i.prototype.getMouseInteractions=function(){return this.Of.getMouseInteractions()},i}(LE),IO={lutElement:{},setLUT:function(t){return this.lutElement.zf(t),this},getLUT:function(){return this.lutElement.Ef()},setLUTLength:function(t){return this.lutElement.Vf(t),this},getLUTLength:function(){return this.lutElement.Gf()},setLUTThickness:function(t){return this.lutElement.Hf(t),this},getLUTThickness:function(){return this.lutElement.Wf()},setLookUpUnit:function(t){return this.lutElement.jf(t),this},getLookUpUnit:function(){return this.lutElement.Uf()},setLUTStepValueFormatter:function(t){return this.lutElement.Yf(t),this}},FO=u(u(u({},UE),GE),{background:eO,alignment:"horizontal",setAlignment:function(t){return u(u({},this),{alignment:t})},vc:function(t,e,i,n,r,o,s){var a=this,l=new lO(t,e,i,this.background,n,r,o),h=l.addElement({vc:function(){return new AO(t,e,i,Mt,Mt,o,a.alignment)}}),u=Object.assign(l,SO,{stylableTexts:[h]},IO,{lutElement:h});return YE(u,o,s),this.applyStylers(u,o)}}).addStyler(RE),TO=u(u(u({},UE),GE),{background:eO,buttonBuilder:wO,setPictureOff:function(t){return u(u({},this),{buttonBuilder:this.buttonBuilder.setPictureOff(t)})},setPictureOn:function(t){return u(u({},this),{buttonBuilder:this.buttonBuilder.setPictureOn(t)})},alignment:"horizontal",setAlignment:function(t){return u(u({},this),{alignment:t})},vc:function(t,i,n,r,o,s){var a=this,l=new lO(t,i,n,this.background,r,o,s),h=l.addElement(yO),u=h.addElement(pO);u.addGap();var c=u.addElement(this.buttonBuilder);u.addGap();var f=h.addElement(pO);f.addGap();var p=f.addElement(tO);f.addGap(),h.addGap();var y=l.addElement(yO);y.addGap();var d=y.addElement({vc:function(){return new AO(t,i,n,Mt,Mt,s,a.alignment)}});y.addGap(),l.addGap();var g=Object.assign(l,dO,{setTextLabel:p},SO,{stylableTexts:[p,d]},gO("LUTText",[d]),vO,{button:c},IO,{lutElement:d}),S=function(){g.setOn(!g.getOn())};g.onMouseClick(S),g.onMouseEnter((function(){return g.setHighlighted(!0)})),g.onMouseLeave((function(){return g.setHighlighted(!1)})),g.setMouseStyle(e.MouseStyles.Point);var v=ME(new AE.Poke(S));return g.onTouchStart(v.onTouchStart),g.onTouchMove(v.onTouchMove),g.onTouchEnd(v.onTouchEnd),this.applyStylers(g,s)}}).addStyler(RE).addStyler(HE),CO={alignment:null,title:null,entryStylers:null,entries:[],add:function(t,e){var i=!e||"object"!=typeof e||void 0===e.disposeOnClick||e.disposeOnClick,n=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return t instanceof QO?this.addChart(t,i,n):"attach"in t?this.addAttachable(t,i,n):t&&this.addDashboard(t,i,n),this},addAttachable:function(t,e,i){var n=t.Ef&&t.Ef(),r=i;r||(r=n?TO.setAlignment(this.alignment):MO);var o=this.addElement(r);if(n&&"setLUT"in o){o.setLUT(n.lut);var s=n.lut.getUnits(),a=n.lookUpProperty,l=s.length>0?s:"x"===a?"x":"y"===a?"y":"z"===a?"z":"";o.setLookUpUnit(l)}return this.entryStylers.forEach((function(t){return t(o)})),this.entries.push({entry:o,component:t}),t.attach(o,e),this},addChart:function(t,e,i){var n=this;return t.Xf().forEach((function(t){return n.addAttachable(t,e,i)})),this},addDashboard:function(t,e,i){var n=this;return t.forEachChart((function(t){return n.addChart(t,e,i)})),this},setTitle:function(t){return this.title.setText(t),this},getTitle:function(){return this.title.getText()},setTitleFillStyle:function(t){return this.title.setTextFillStyle(t),this},getTitleFillStyle:function(){return this.title.getTextFillStyle()},setTitleFont:function(t){return this.title.setTextFont(t),this},getTitleFont:function(){return this.title.getTextFont()},setTitleRotation:function(t){return this.title.setTextRotation(t),this},getTitleRotation:function(){return this.title.getTextRotation()},setEntries:function(t){return this.entries.forEach((function(e){return t(e.entry,e.component)})),this}},DO={alignment:"vertical",layoutBuilder:pO,setAlignment:function(t){return u(u({},this),{alignment:t,layoutBuilder:"horizontal"===t?yO:pO})},getAlignment:function(){return this.alignment},titleBuilder:xO,styleTitle:function(t){return u(u({},this),{titleBuilder:this.titleBuilder.addStyler(t)})},entryStylers:[],styleEntries:function(t){return u(u({},this),{entryStylers:p(p([],f(this.entryStylers)),[t])})}},LO=u(u(u(u({},UE),GE),DO),{background:eO,vc:function(t,e,i,n,r,o,s){var a=Object.assign(this.layoutBuilder.setBackground(this.background).vc(t,e,i,n,r,o,!1),CO,{alignment:this.alignment,entryStylers:this.entryStylers}),l=a.addElement("horizontal"===this.alignment?pO:yO),h=l.addElement(this.titleBuilder).setText("Legend").setMargin({right:6});return l.addGap(),a=Object.assign(a,{title:h}),YE(a,o,s),this.applyStylers(a,o)}}).addStyler((function(t,e){return t.setPadding(5).setMargin(3)})).styleEntries((function(t){return t.setPadding({left:3,right:3})})),PO=function(t){function i(i,n,r,o,s,a){var l=t.call(this,i,n,r,o,s,a)||this;return l.Zf=10,l.Kf=e.UIDirections.Up,l.qf=0,l.po=l.Eu(i.pe(l.renderingScale)),l.it=l.Eu(i.ac(l.renderingScale)),l}return h(i,t),i.prototype.Xu=function(){if(t.prototype.Xu.call(this),t.prototype.isDisposed.call(this))return this;var i=et(this.getPosition(),this.scale,this.renderingScale),n=this.renderingScale.Ut(i,{x:this.Kf===e.UIDirections.Right?-this.Zf:this.Kf===e.UIDirections.Left?this.Zf:0,y:this.Kf===e.UIDirections.Up?-this.Zf:this.Kf===e.UIDirections.Down?this.Zf:0}),r=this.renderingScale.Ut(n,{x:this.Kf===e.UIDirections.Right?-this.qf:this.Kf===e.UIDirections.Left?this.qf:0,y:this.Kf===e.UIDirections.Up?-this.qf:this.Kf===e.UIDirections.Down?this.qf:0});return this.it.Ca(i).Sa(n),this.po.Eo(r).Xo(this.Kf===e.UIDirections.Up?{x:0,y:1}:this.Kf===e.UIDirections.Down?{x:0,y:-1}:this.Kf===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this},i.prototype.Un=function(){var i=this.it.Ma(),n=i instanceof J?i.getThickness():0;return this.size=this.Kf===e.UIDirections.Left||this.Kf===e.UIDirections.Right?{x:this.Zf+this.qf+this.po.Un().hf().x,y:n}:{y:this.Zf+this.qf+this.po.Un().hf().y,x:n},t.prototype.Un.call(this)},i.prototype.dispose=function(){return t.prototype.dispose.call(this),this.po.dispose(),this.it.dispose(),this},i.prototype.restore=function(){return t.prototype.restore.call(this),this.po.restore(),this.it.restore(),this},i.prototype.setMouseInteractions=function(t){return this.po.setMouseInteractions(t),this.it.setMouseInteractions(t),this},i.prototype.getMouseInteractions=function(){return this.po.getMouseInteractions()},i.prototype.getText=function(){return this.po.vn()},i.prototype.setTextFillStyle=function(t){return this.po.pn(t),this.Vu.Vi(),this},i.prototype.getTextFillStyle=function(){return this.po.mn()},i.prototype.setTextFont=function(t){return this.po.bn(t),this},i.prototype.setTextRotation=function(t){return this.po.xn(t),this},i.prototype.getTextRotation=function(){return this.po.wn()},i.prototype.getTextFont=function(){return this.po.gn()},i.prototype.setText=function(t){return this.po.Sn(t),this.Vu.Vi(),this},i.prototype.setDirection=function(t){return this.Kf=t,this.Vu.Vi(),this},i.prototype.getDirection=function(){return this.Kf},i.prototype.setPointerLength=function(t){return this.Zf=t,this.Vu.Vi(),this},i.prototype.getPointerLength=function(){return this.Zf},i.prototype.setTickLabelPadding=function(t){return this.qf=t,this.Vu.Vi(),this},i.prototype.getTickLabelPadding=function(){return this.qf},i.prototype.setTickStyle=function(t){return this.it.ka(t),this.Vu.Vi(),this},i.prototype.getTickStyle=function(){return this.it.Ma()},i}(LE),BO=u(u({},UE),{vc:function(t,e,i,n,r,o,s){var a=new PO(t,e,i,n,r,o);return YE(a,o,s),this.applyStylers(a,o)}}).addStyler(RE).addStyler((function(t,e){return t.setPointerLength(e.numericTickStrategy.majorTickStyle.getTickLength()).setTickLabelPadding(e.numericTickStrategy.majorTickStyle.getTickPadding()).setTickStyle(e.uiTickStrokeStyle||e.numericTickStrategy.majorTickStyle.getTickStyle()).setTextFont(e.customTickMarkerFont||e.uiTickFont||Zi).setTextFillStyle(e.customTickMarkerTextFillStyle||e.uiTickTextFillStyle||Y)})),EO=MO.addStyler((function(t){return t.onSwitch((function(e,i){return!0===i?setTimeout((function(){return t.setOn(!1)}),300):void 0}))})),OO=LO.setAlignment("horizontal"),_O=LO.setAlignment("vertical"),VO={TextBox:xO,CheckBox:MO,ButtonBox:EO,PointableTextBox:bO,AxisTick:BO,LUTRange:FO},zO={HorizontalLegendBox:OO,VerticalLegendBox:_O},NO=function(t){function e(e,i,n,r,o,s,a,l,h){var u=t.call(this,e,i,n,r,o,s,h)||this;return u.Jf=a,u.Qf=l,u}return h(e,t),e}(ji),RO=function(t,e,i){return It(t+.1*(e-t)+.5*i.getPixelSize()*Math.sign(e-t),t,e)},HO=function(t,e,i){var n=i.U(t),r=i.U(e);return It(i.j(n+.1*(r-n)+.5*Math.sign(r-n)),t,e)},YO=function(t){function i(i,n,o,s,a,l,h,u,c,f,p,y,d,g,S,v,x){var b,k=t.call(this,f,c,h,S,v,{numeric:S.numericTickStrategy,datetime:S.dateTimeTickStrategy,time:S.timeTickStrategy},x)||this;k.Jf=i,k.$f=n,k.tl=o,k.nc=s,k.il=a,k.nl=l,k.chart=f,k.el=y,k.rl=d,k.sl=new Map,k.ol=void 0,k.hl=0,k.al=[],k.ul=[],k.zi=Li.fitting,k.cl=!0,k.fl=0,k.ll=8,k.dl=void 0,k.vl=void 0,k.yl=20,k.Sl=1,k.ml=!0,k.pl=!0,k.bl=!0,k.xl=!0,k.wl=!0,k.kl=!0,k.Ml=!0,k.Al=!0,k.Fl=!0,k.Tl=!0,k.Cl=k.Li.defaultDragMouseStyle,k.Bl=k.Li.defaultDragMouseStyle,k.Ll=k.Li.defaultDragMouseStyle,k.Il=k.Li.defaultDragMouseStyle,k.Pl=k.Li.defaultDragMouseStyle,k.Fi=new r.Eventer,k.Ol=[],k.Dl=function(t){var e=k.ul.indexOf(t);e>=0&&k.ul.splice(e,1)},k._l=function(t){return k.ul.indexOf(t)<0&&k.ul.push(t),k.Dl},k.Hc=function(t,e){return k.Fi.emit("axisAreaTouch",k,e)},k.Rl=re(k.Ol),k.zl=oe(k.Ol),k.onAxisInteractionAreaMouseClick=function(t){return k.Fi.on("axisAreaMouseClick",t)},k.onAxisInteractionAreaMouseDoubleClick=function(t){return k.Fi.on("axisAreaDoubleClick",t)},k.onAxisInteractionAreaMouseDown=function(t){return k.Fi.on("axisAreaMouseDown",t)},k.onAxisInteractionAreaMouseUp=function(t){return k.Fi.on("axisAreaMouseUp",t)},k.onAxisInteractionAreaMouseEnter=function(t){return k.Fi.on("axisAreaMouseEnter",t)},k.onAxisInteractionAreaMouseLeave=function(t){return k.Fi.on("axisAreaMouseLeave",t)},k.onAxisInteractionAreaMouseMove=function(t){return k.Fi.on("axisAreaMouseMove",t)},k.onAxisInteractionAreaMouseWheel=function(t){return k.Fi.on("axisAreaMouseWheel",t)},k.onAxisInteractionAreaMouseDragStart=function(t){return k.Fi.on("axisAreaMouseDragStart",t)},k.onAxisInteractionAreaMouseDrag=function(t){return k.Fi.on("axisAreaMouseDrag",t)},k.onAxisInteractionAreaMouseDragStop=function(t){return k.Fi.on("axisAreaMouseDragStop",t)},k.onAxisInteractionAreaTouchStart=function(t){return k.Fi.on("axisAreaTouchStart",t)},k.onAxisInteractionAreaTouch=function(t){return k.Fi.on("axisAreaTouch",t)},k.onAxisInteractionAreaTouchStop=function(t){return k.Fi.on("axisAreaTouchEnd",t)},k.onAxisAreaMouseDragStart=function(t){return k.Fi.on("axisAreaMouseDragStart",t)},k.onAxisAreaMouseDrag=function(t){return k.Fi.on("axisAreaMouseDrag",t)},k.onAxisAreaMouseDragStop=function(t){return k.Fi.on("axisAreaMouseDragStop",t)},k.onAxisInteractionAreaMouseTouchStart=function(t){return k.Fi.on("axisAreaTouchStart",t)},k.onAxisInteractionAreaMouseTouch=function(t){return k.Fi.on("axisAreaTouch",t)},k.onAxisInteractionAreaMouseTouchStop=function(t){return k.Fi.on("axisAreaTouchEnd",t)},k.offAxisInteractionAreaMouseClick=function(t){return k.Fi.off(t,"axisAreaMouseClick")},k.offAxisInteractionAreaMouseDoubleClick=function(t){return k.Fi.off(t,"axisAreaDoubleClick")},k.offAxisInteractionAreaMouseDown=function(t){return k.Fi.off(t,"axisAreaMouseDown")},k.offAxisInteractionAreaMouseUp=function(t){return k.Fi.off(t,"axisAreaMouseUp")},k.offAxisInteractionAreaMouseEnter=function(t){return k.Fi.off(t,"axisAreaMouseEnter")},k.offAxisInteractionAreaMouseLeave=function(t){return k.Fi.off(t,"axisAreaMouseLeave")},k.offAxisInteractionAreaMouseMove=function(t){return k.Fi.off(t,"axisAreaMouseMove")},k.offAxisInteractionAreaMouseWheel=function(t){return k.Fi.off(t,"axisAreaMouseWheel")},k.offAxisInteractionAreaMouseDragStart=function(t){return k.Fi.off(t,"axisAreaMouseDragStart")},k.offAxisInteractionAreaMouseDrag=function(t){return k.Fi.off(t,"axisAreaMouseDrag")},k.offAxisInteractionAreaMouseDragStop=function(t){return k.Fi.off(t,"axisAreaMouseDragStop")},k.offAxisInteractionAreaTouchStart=function(t){return k.Fi.off(t,"axisAreaTouchStart")},k.offAxisInteractionAreaTouch=function(t){return k.Fi.off(t,"axisAreaTouch")},k.offAxisInteractionAreaTouchStop=function(t){return k.Fi.off(t,"axisAreaTouchEnd")},k.offAxisInteractionAreaMouseTouchStart=function(t){return k.Fi.off(t,"axisAreaTouchStart")},k.offAxisInteractionAreaMouseTouch=function(t){return k.Fi.off(t,"axisAreaTouch")},k.offAxisInteractionAreaMouseTouchStop=function(t){return k.Fi.off(t,"axisAreaTouchEnd")},k.Nl=function(t,e){return e.getAllocatesAxisSpace()?Math.max(t,e.update().mc()):t},k.El=function(t){var e=k.al.indexOf(t);-1!==e&&k.al.splice(e,1)},k.Vl=function(t){k.al.includes(t)||k.al.push(t)},k.Gl=function(t,e){k.xl&&(k.Fi.emit("axisAreaDoubleClick",k,e),k.release(),ee(e))},k.Hl=function(t){(k.pl||k.ml||k.bl||k.xl)&&(k.Fi.emit("axisAreaMouseEnter",k),k.Wl(t))},k.jl=function(t){k.Ul(t),k.Fi.emit("axisAreaMouseLeave",k)},k.Yl=function(t,e,i){var n,r,o=Pt(null===(n=k.chart.zr.overrideInteractionMouseButtons)||void 0===n?void 0:n.axisXYZoomMouseButton,0),s=Pt(null===(r=k.chart.zr.overrideInteractionMouseButtons)||void 0===r?void 0:r.axisXYPanMouseButton,2),a=m(e.clientX,e.clientY);i===s&&k.pl?(k.Fi.emit("axisAreaMouseDragStart",k,e,i),k.Xl(t),ee(e)):i===o&&k.ml&&(k.Fi.emit("axisAreaMouseDragStart",k,e,i),k.Zl(t,a),ee(e))},k.Kl=function(t,e,i,n,r){var o,s,a=Pt(null===(o=k.chart.zr.overrideInteractionMouseButtons)||void 0===o?void 0:o.axisXYZoomMouseButton,0),l=Pt(null===(s=k.chart.zr.overrideInteractionMouseButtons)||void 0===s?void 0:s.axisXYPanMouseButton,2),h=m(e.clientX,e.clientY);i===l&&k.pl?(k.Fi.emit("axisAreaMouseDrag",k,e,i,n,r),k.ql(t,r),ee(e)):i===a&&k.ml&&(k.Fi.emit("axisAreaMouseDrag",k,e,i,n,r),k.Jl(t,n,h,r),ee(e))},k.Ql=function(t,e,i,n){var r,o,s=Pt(null===(r=k.chart.zr.overrideInteractionMouseButtons)||void 0===r?void 0:r.axisXYZoomMouseButton,0),a=Pt(null===(o=k.chart.zr.overrideInteractionMouseButtons)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=m(e.clientX,e.clientY);i===a&&k.pl?(k.$l(t),k.Fi.emit("axisAreaMouseDragStop",k,e,i,n),ee(e)):i===s&&k.ml&&(k.Fi.emit("axisAreaMouseDragStop",k,e,i,n),k.td(t,n,l),ee(e)),t.getIsUnderMouse()&&(k.pl||k.ml||k.bl||k.xl)&&k.Wl(t)},k.nd=function(t,e){if(k.bl){k.Fi.emit("axisAreaMouseWheel",k,e),k.stop();var i=k.Li.getWidth(k.nc.As.Lr(e.clientX,e.clientY)),n=k.Y.j(i);k.zoom(n,ve(e)),ee(e)}},k.ed=function(t,e){return k.Fi.emit("axisAreaMouseClick",k,e)},k.rd=function(t,e){return k.Fi.emit("axisAreaMouseDown",k,e)},k.sd=function(t,e){return k.Fi.emit("axisAreaMouseUp",k,e)},k.od=function(t,e){return k.Fi.emit("axisAreaMouseMove",k,e)},k.hd=function(t,e,i){k.ml&&(k.Fi.emit("axisAreaTouchStart",k,i),k.Wl(t),k.Zl(t,e),ee(i))},k.ad=function(t,e,i,n,r){k.ml&&(k.Fi.emit("axisAreaTouch",k,r),k.Jl(t,e,i,n),ee(r))},k.ud=function(t,e,i,n){k.ml&&(k.Fi.emit("axisAreaTouchEnd",k,n),k.td(t,e,i),k.Ul(t),ee(n))},k.fd=function(t,e,i,n){(k.pl||k.bl)&&(k.Wl(t),k.Xl(t),ee(n))},k.ld=function(t,e,i,n,r,o){if(k.pl){var s=m((n.x+r.x)/2,(n.y+r.y)/2);k.ql(t,s),ee(o)}if(k.bl){var a=k.nc.As.Lr(e.x,e.y),l=k.nc.As.Lr(i.x,i.y),h=Math.abs(k.Li.getWidth(ei(a,n))-k.Li.getWidth(ei(l,r)))-Math.abs(k.Li.getWidth(a)-k.Li.getWidth(l)),u=k.Y.Ut(k.ln,-h),c=k.Y.Ut(k.dn,h);k.un(u,c),ee(o)}},k.dd=function(t,e,i,n){(k.pl||k.bl)&&(k.$l(t),k.Ul(t),ee(n))},k.vd=function(t,e){(k.wl||k.kl)&&k.yd(t)},k.Sd=function(t,e){k.md(t)},k.pd=function(t,e,i){var n=m(e.clientX,e.clientY);k.wl&&k.gd(t,n)},k.bd=function(t,e,i,n,r){var o=m(e.clientX,e.clientY);k.wl&&k.xd(t,o,n,r)},k.wd=function(t,e,i,n,r){var o=m(e.clientX,e.clientY);k.wl&&k.kd(t,o,n,r)},k.Md=function(t,e,i,n){var r=m(e.clientX,e.clientY);(k.wl||k.kl)&&k.Ad(t,r,n),(k.wl||k.kl)&&k.yd(t)},k.Fd=function(t,e){k.kl&&(k.stop(),k.zoom(k.ln,ve(e)),ee(e))},k.Td=function(t,e){k.kl&&(k.stop(),k.zoom(k.dn,ve(e)),ee(e))},k.Cd=function(t,e,i){k.wl&&(k.yd(t),k.gd(t,e),ee(i))},k.Bd=function(t,e,i,n,r){k.wl&&(k.xd(t,e,i,n),ee(r))},k.Ld=function(t,e,i,n,r){k.wl&&(k.kd(t,e,i,n),ee(r))},k.Id=function(t,e,i,n){k.wl&&(k.Ad(t,e,i),k.md(t),ee(n))},g(k,k._l),h.Pd=k,k.Od=p,k.Dd=k.Od>50?1:-1,k._d=(b=k.Li.toPoint(0,-k.Dd),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),k.Rd=u,k.zd=k.Y instanceof Ii?(new Ci).fi(k.Li.toVec2(k.Y,k.Rd)):(new Di).fi(k.Li.toVec2(k.Y,k.Rd)),k.Nd=k.chart.pixelScale,k.Ed=(new Ci).fi(k.Li.toVec2(k.Li.getWidth(k.Nd),k.Rd)),k.Vd=k.tl.ac(k.zd).setMouseInteractions(!1),k.Gd=k.tl.ac(k.zd).setMouseInteractions(!1),k.Hd=k.tl.ac(k.zd).setMouseInteractions(!1),k.Wd=k.nc.tf(k.Nd).pn($P).fs(Q),k.jd=k.nc.tf(k.Nd).pn($P).fs(Q),k.Ud=k.nc.tf(k.Nd).pn($P).fs(Q),k.yn=k.tl.pe(k.zd).setMouseInteractions(!1).xn(k.Li.getTitleTextRotation(k.Dd));var w=ME(new AE.Drag(k.hd,k.ad,k.ud,1),new AE.Pinch(k.fd,k.ld,k.dd),new AE.DoublePoke(k.Gl)),M=ME(new AE.Drag(k.Cd,k.Bd,k.Id)),A=ME(new AE.Drag(k.Cd,k.Ld,k.Id));return k.Wd.setMouseEnterEventHandler(k.Hl).setMouseLeaveEventHandler(k.jl).setMouseDragStartEventHandler(k.Yl).setMouseDragEventHandler(k.Kl).setMouseDragStopEventHandler(k.Ql).setMouseWheelEventHandler(k.nd).setMouseDoubleClickEventHandler(k.Gl).setMouseClickEventHandler(k.ed).setMouseDownEventHandler(k.rd).setMouseUpEventHandler(k.sd).setMouseMoveEventHandler(k.od).setTouchStartEventHandler(w.onTouchStart).setTouchMoveEventHandler(w.onTouchMove).setTouchEndEventHandler(w.onTouchEnd),k.jd.setMouseEnterEventHandler(k.vd).setMouseLeaveEventHandler(k.Sd).setMouseDragStartEventHandler(k.pd).setMouseDragEventHandler(k.bd).setMouseDragStopEventHandler(k.Md).setMouseWheelEventHandler(k.Fd).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),k.Ud.setMouseEnterEventHandler(k.vd).setMouseLeaveEventHandler(k.Sd).setMouseDragStartEventHandler(k.pd).setMouseDragEventHandler(k.wd).setMouseDragStopEventHandler(k.Md).setMouseWheelEventHandler(k.Td).setTouchStartEventHandler(A.onTouchStart).setTouchMoveEventHandler(A.onTouchMove).setTouchEndEventHandler(A.onTouchEnd),k.Vd.ka(S.axisStyle),k.Gd.ka(S.axisNibStyle),k.Hd.ka(S.axisNibStyle),k.Yd=S.axisOverlayStyle,k.Xd=S.axisNibOverlayStyle,k.yn.pn(k.Ii.axisTitleFillStyle).bn(k.Ii.axisTitleFont),k}return h(i,t),i.prototype.Se=function(){return this.ji},i.prototype.me=function(){return void 0!==this.Ln},i.prototype.addBand=function(t){void 0===t&&(t=!0);var e=t?this.nl:this.il,i=new zE(e,this.chart,this.Rl,this.zl,this,this.zd,this.Li,this.Ii);return this.zl(i),i},i.prototype.addConstantLine=function(t){void 0===t&&(t=!0);var e=t?this.nl:this.il,i=new NE(e,this.chart,this.Rl,this.zl,this,this.zd,this.Li,this.Ii);return this.zl(i),i},i.prototype.Zd=function(t){this.Ol.forEach(t)},i.prototype.Kd=function(t){return this.Ol.map(t)},i.prototype.getHighlighters=function(){return this.Ol},i.prototype.setThickness=function(t){return"number"==typeof t?(this.qd=t,this.Jd=t):"object"==typeof t&&(this.qd=t.min,this.Jd=t.max),this.Jf.Vi(),this},i.prototype.getThickness=function(){return{min:this.qd,max:this.Jd}},i.prototype.setMouseInteractions=function(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)},i.prototype.oe=function(){return this.ul},i.prototype.Zn=function(t,e,i,n){return new NO(e,t,i,n,this.tl,this.zd,this.Jf,this.zd)},i.prototype.kn=function(){var e,i;if(this.sl){try{for(var n=c(this.sl),r=n.next();!r.done;r=n.next()){var o=r.value;o[1].grid.dispose(),o[1].tick.dispose()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}this.sl.clear()}t.prototype.kn.call(this)},i.prototype.Kn=function(t,e){var i=e.tickStart,n=t.tickLevel.Xn,r=i+n.getTickLength()*this.Dd+n.getTickPadding()*this.Dd;t.label.Eo(this.Li.toPoint(t.value,r)).Xo(this.Li.toPoint(n.getLabelAlignment(),-this.Dd)).xn(n.labelRotation)},i.prototype.Qd=function(t,e){var i=e.startPosition,n=e.gridStrokeLen,r=e.gridStrokeStart,o=e.tickStart,s=t.tickLevel.Xn,a=i-n*s.getGridStrokeLength(),l=o+s.getTickLength()*this.Dd;return{gridStroke:{start:this.Li.toPoint(t.value,r),end:this.Li.toPoint(t.value,a)},tickStroke:{start:this.Li.toPoint(t.value,o),end:this.Li.toPoint(t.value,l)}}},i.prototype.$d=function(t,e,i,n){return this.Jf.ac(this.zd).ka(new J({fillStyle:new G({color:O(360*(1-n))}),thickness:5})).Ca(this.Li.toVec2(t,0)).Sa(this.Li.toVec2(t,this.Dd*(50*n)))},i.prototype.de=function(t,e){return"linear"===this.cn.type?RO(t,e,this.Y):HO(t,e,this.Y)},i.prototype.tv=function(t,e){return e instanceof Ii?RO:HO},i.prototype.ye=function(t,e,i){if("linear"===this.cn.type){var n=this.Y.ci(e-t);return{min:t-i*n,max:e+i*n}}var r=this.Y;return{min:r.Ut(t,-i),max:r.Ut(e,i)}},i.prototype.Xu=function(t,e,i){var n,r,o,s,a,l,h,u,p,y,d,g,S,v=this.Vd.Ma(),m=this.Y.getInnerStart()this.Y.getInnerStart()?this.Y.getInnerEnd():this.Y.getInnerStart(),b=this.Y.Tt(),k=this.Rd.getInnerInterval(),w=v instanceof J?v.getThickness()*this.Dd/2:0,M=this.Od/100*k,A=M+t,I=A+w,F=k*this.Dd,T=I+w,C=this.al.reduce(this.Nl,0),D=0;if(this.Oi!==Ei){var L=this.Y.Tt();this.On({physicalAxisSize:L,startPosition:M,gridStrokeLen:F,gridStrokeStart:A,tickStart:T});try{for(var P=c(this._i),B=P.next();!B.done;B=P.next()){var E=f(B.value,2),O=E[0],_=E[1],V=this.sl.get(O);if(!V)if(O.bi)V={grid:this.Jf.nv(this.zd).setMouseInteractions(!1),tick:this.Jf.nv(this.zd).setMouseInteractions(!1)};else if("Ae"in O){var z=Array.from(this._i.keys()).filter((function(t){return"Ae"in t})).reverse().indexOf(O),N=this.$f[z];if(!N)throw new Error("Not enough tick layers. This is an internal LCJS error - if you see this, please contact Arction support.");V={grid:N.nv(this.zd).setMouseInteractions(!1),tick:N.nv(this.zd).setMouseInteractions(!1)}}if(V){V.grid.bh(),V.tick.bh();try{for(var R=(o=void 0,c(_)),H=R.next();!H.done;H=R.next()){var Y=f(H.value,2),U=(Y[0],Y[1]),G=this.Qd(U,{physicalAxisSize:L,startPosition:M,gridStrokeLen:F,gridStrokeStart:A,tickStart:T});U.label.isDisposed()||(V.grid.gh(G.gridStroke.start,G.gridStroke.end),V.tick.gh(G.tickStroke.start,G.tickStroke.end))}}catch(t){o={error:t}}finally{try{H&&!H.done&&(s=R.return)&&s.call(R)}finally{if(o)throw o.error}}V.grid.ka(O.Xn.getGridStrokeStyle()),V.tick.ka(O.Xn.getTickStyle()),this.sl.set(O,V)}}}catch(t){n={error:t}}finally{try{B&&!B.done&&(r=P.return)&&r.call(P)}finally{if(n)throw n.error}}try{for(var X=c(this._i.values()),W=X.next();!W.done;W=X.next()){O=W.value;var j=ke;try{for(var K=(h=void 0,c(O.values())),Z=K.next();!Z.done;Z=K.next()){var q=(U=Z.value).tickLevel.Xn,Q=this.Li.getHeight(U.label.Bt()),$=q.getTickLength()+q.getTickPadding()+Q+q.getLabelPadding();j=Math.max(j,$)}}catch(t){h={error:t}}finally{try{Z&&!Z.done&&(u=K.return)&&u.call(K)}finally{if(h)throw h.error}}D=Math.max(D,j)}}catch(t){a={error:t}}finally{try{W&&!W.done&&(l=X.return)&&l.call(X)}finally{if(a)throw a.error}}S=T+Math.max(D,C)*this.Dd}else D=0,S=T+C*this.Dd;this.Vd.Ca(this.Li.toPoint(m,I)).Sa(this.Li.toPoint(x,I)),this.Gd.Ca(this.Li.toPoint(this.Y.Ut(this.Y.getInnerStart(),this.ll),I)).Sa(this.Li.toPoint(this.Y.getInnerStart(),I)),this.Hd.Ca(this.Li.toPoint(this.Y.Ut(this.Y.getInnerEnd(),-this.ll),I)).Sa(this.Li.toPoint(this.Y.getInnerEnd(),I));var tt=this.yn&&this.yn.vn().length>0?this.Li.getHeight(this.yn.Un().Bt()):0,it=S+.5*tt*this.Dd;this.yn.Eo(this.Li.toPoint(this.Y.Ut(this.Y.getInnerStart(),b/2),it));var nt,rt=T,ot=rt+this.Dd*this.hl,st=Math.min(this.yl,.25*b);if(this.ol){var at=this.Od/100*k+t,lt=-this.Dd*k-t;nt={start:this.Li.toVec2(this.ol.min,T+this.Dd*this.hl),end:this.Li.toVec2(this.ol.max,at+lt)}}else nt={start:this.Li.toVec2(this.Y.Ut(this.Y.getInnerStart(),st),rt),end:this.Li.toVec2(this.Y.Ut(this.Y.getInnerEnd(),-st),ot)};var ht=et(this.Li.toVec2(this.Y.getInnerStart(),ot),this.zd,this.Nd),ut=et(nt.start,this.zd,this.Nd),ct=et(nt.end,this.zd,this.Nd),ft=et(this.Li.toVec2(this.Y.getInnerEnd(),rt),this.zd,this.Nd);this.Wd.Eo(ut).wt(ei(ct,ut)),this.jd.Eo(ht).wt(ei(ut,ht)),this.Ud.Eo(ct).wt(ei(ft,ct));try{for(var pt=c(this.al),yt=pt.next();!yt.done;yt=pt.next())(U=yt.value).update().plot(A,F,t,T)}catch(t){p={error:t}}finally{try{yt&&!yt.done&&(y=pt.return)&&y.call(pt)}finally{if(p)throw p.error}}try{for(var dt=c(this.Ol),gt=dt.next();!gt.done;gt=dt.next())gt.value.Xu()}catch(t){d={error:t}}finally{try{gt&&!gt.done&&(g=dt.return)&&g.call(dt)}finally{if(d)throw d.error}}var St=(v instanceof J?v.getThickness():0)+Math.max(D,C)+(this.yn&&this.yn.vn().length>0?tt+this.fl:0);return this.hl=It(St,void 0!==this.qd?this.qd:0,void 0!==this.Jd?this.Jd:be),this},i.prototype.ev=function(t){var e,i,n,r,o=this.Vd.Ma(),s=o instanceof J?o.getThickness()*this.Dd/2:0,a=this.Rd.getInnerInterval(),l=this.Od/100*a+t,h=l+s,u=a*this.Dd,f=h+s;try{for(var p=c(this.al),y=p.next();!y.done;y=p.next())y.value.update().plot(l,u,t,f)}catch(t){e={error:t}}finally{try{y&&!y.done&&(i=p.return)&&i.call(p)}finally{if(e)throw e.error}}try{for(var d=c(this.Ol),g=d.next();!g.done;g=d.next())g.value.Xu()}catch(t){n={error:t}}finally{try{g&&!g.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}},i.prototype.getHeight=function(){return this.hl},i.prototype.rv=function(t,e){e=e||VO.PointableTextBox;var i=new EE(this,t?this.Jf:this.tl,this.nc,this.Y,this.Ed,this.Ed,this.Li,this._d,this.Vl,this.El,this.Ii,e).setTextFormatter(this.formatValue);return this.al.push(i),i},i.prototype.Wl=function(t){t.pn(this.Yd).As.Vi(),this.dl=t.As.Sr(this.Cl,this.dl)},i.prototype.Ul=function(t){t.pn($P).As.Vi(),t.As.pr(this.dl)},i.prototype.Xl=function(t){this.stop(),t.As.pr(this.dl)},i.prototype.ql=function(t,e){var i=-this.Li.getWidth(e);this.pan(i),this.dl=t.As.Sr(this.Bl,this.dl)},i.prototype.pan=function(t){var e=this.ln,i=this.dn,n=this.Y.Ut(e,t),r=this.Y.Ut(i,t);this.un(n,r,{allowClamping:!1})},i.prototype.zoom=function(t,e){var i=this.Y.U(this.ln),n=this.Y.U(this.dn),r=this.Y.U(t),o=It((r-i)/(n-i),0,1),s=.2*this.Y.Tt(),a=o*this.Sl*s*-e,l=(1-o)*this.Sl*s*e,h=this.Y.Ut(this.ln,a),u=this.Y.Ut(this.dn,l);this.un(h,u)},i.prototype.$l=function(t){this.ol=void 0,t.As.pr(this.dl)},i.prototype.Zl=function(t,e){this.stop(),t.As.pr(this.dl)},i.prototype.Jl=function(t,e,i,n){var r=et(this.nc.As.Lr(i.x,i.y),this.nc.As.Y,this.zd),o=It(this.Li.getWidth(r),this.ln,this.dn),s=this.Li.getWidth(et(this.nc.As.Lr(e.x,e.y),this.nc.As.Y,this.zd)),a=Le(this.Li.getHeight(r),this.Li.getHeight(et(this.Wd.Vo(),this.Nd,this.zd)),this.Li.getHeight(et(ti(this.Wd.Vo(),this.Wd.Bt()),this.Nd,this.zd)));Math.abs(this.Y.U(o)-this.Y.U(s))>10&&a?(this.ol=A(Math.min(o,s),Math.max(o,s)),this.dl=t.As.Sr(this.Ll,this.dl)):(this.ol=void 0,this.dl=t.As.Sr(this.Cl,this.dl)),this.nc.Vi()},i.prototype.td=function(t,e,i){if(this.ol){var n=this.ol.min,r=this.ol.max,o=this.dn0?(this.jv&&(this.jv.finish(!1),this.jv=void 0),this.Zv(this.Nv,0,(function(){return t.prototype.dispose.call(e)}))):t.prototype.dispose.call(this),this.Vv=!0,this},e.prototype.restore=function(){if(this.Ie.getAnimationsEnabled()&&(this.jv&&(this.jv.finish(!1),this.jv=void 0),this.Zv(this.Nv,this.u)),this.getExploded()&&!this.Ie.getMultipleSliceExplosion())for(var e=this.Ie.getSlices(),i=0;i=0&&(u.Kv.splice(e,1),u.hy())},u.uy=function(t){u.Kv.indexOf(t)<0&&(u.Kv.push(t),u.hy(),t.setHighlightOnHover(u.$v))},l&&(u.Ii=l),u.ly=n.ys(e.LayerIndices.bottom),u.vy=n.ys(e.LayerIndices.top),u.Cv.Sn("Pie Chart"),u.Tv(s,u.pixelScale),u.onBackgroundMouseDoubleClick(a_);var c=ME(new AE.DoublePoke(a_));return u.onBackgroundTouchStart(c.onTouchStart),u.onBackgroundTouchMove(c.onTouchMove),u.onBackgroundTouchEnd(c.onTouchEnd),h&&u.setAnimationsEnabled(!1),u}return h(i,t),i.prototype.addSlice=function(t,e){var i=new r_(this.ny,this.ly,this.vy,this,this.pixelScale,this.oy,this.uy,this.Ii);this.ny+=1,i.setName(t);var n=this.Gi;return this.Gi=!1,i.setValue(e),this.Gi=n,this.yy(i),this.Kv.push(i),this.hy(),i.setHighlightOnHover(this.$v),i},i.prototype.addSlices=function(t){for(var e=[],i=0;i0})),l=0;for(s=0;s0?h/l:0);for(s=0;s=0?1:-1,y:t.y>=0?1:-1,z:t.z>=0?1:-1};return{gridlinePositionA:k(0,e.y,e.z),gridlinePositionB:k(0,e.y,-e.z),gridlinePositionC:k(0,-e.y,-e.z)}}},A_={ae:function(t){return t.getYMin()},ue:function(t){return t.getYMax()},fe:function(t){return t.Ay().y},Fy:function(t){return t.y},Ty:function(t,e){return{x:e.x,y:t.y,z:e.z}},Kf:k(-1,0,0),Cy:function(t){var e={x:t.x>=0?1:-1,y:t.y>=0?1:-1,z:t.z>=0?1:-1};return{gridlinePositionA:k(e.x,0,e.z),gridlinePositionB:k(e.x,0,-e.z),gridlinePositionC:k(-e.x,0,-e.z)}}},I_={ae:function(t){return t.getZMin()},ue:function(t){return t.getZMax()},fe:function(t){return t.Ay().z},Fy:function(t){return t.z},Ty:function(t,e){return{x:e.x,y:e.y,z:t.z}},Kf:k(1,0,0),Cy:function(t){var e={x:t.x>=0?1:-1,y:t.y>=0?1:-1,z:t.z>=0?1:-1};return{gridlinePositionA:k(e.x,-e.y,0),gridlinePositionB:k(e.x,e.y,0),gridlinePositionC:k(-e.x,e.y,0)}}},F_=function(t){if(t instanceof J){var e=t.getThickness(),i=t.getFillStyle();if(i instanceof G)return 1===e?Qi:new Ji({size:e,fillStyle:i,shape:"sphere"})}return Qi},T_=function(t){function e(e,i,n,r,o,s,a,l){var h=t.call(this,e,i,n,r,l,{numeric:r.numericTickStrategy,datetime:r.dateTimeTickStrategy,time:r.timeTickStrategy},{type:"linear"})||this;return h.By=o,h.Ly=s,h.Iy=a,h.Py=h.By.Y,h.Oy=h.By.ky([u_.InternalUI]).ka(h.Li.Fy(h.Ii.axesStyles3D)).Dy(F_(h.Li.Fy(h.Ii.axesStyles3D))).setMouseInteractions(!1),h.yn=h.Ly.pe(h.Iy).setMouseInteractions(!1).pn(h.Ii.axisTitleFillStyle).bn(h.Ii.axisTitleFont),h.sl=new Map,h._y=function(){},h.Ry=function(){},h.zy=function(){},h.Ny=function(){},h.Oy.setMouseEnterEventHandler(h._y).setMouseLeaveEventHandler(h.Ry).setMouseDragEventHandler(h.zy).setMouseDragStopEventHandler(h.Ny),n.Pd=h,h}return h(e,t),e.prototype.setStrokeStyle=function(t){return this.Oy.ka(t).Dy(F_(this.Oy.Ma())),this.chart.engine.Vi(),this},e.prototype.getStrokeStyle=function(){return this.Oy.Ma()},e.prototype.setAnimationScroll=function(e){return t.prototype.setAnimationScroll.call(this,e),this},e.prototype.setMouseInteractions=function(t){return this},e.prototype.oe=function(){return this.chart.getSeries()},e.prototype.Ey=function(t){return Math.abs(this.Y.Vy(t)*this.By.Gy(1))},e.prototype.ye=function(t,e,i){var n=Math.abs(this.Y.Vy(e-t)*this.By.Gy(1));return{min:t-i*n,max:e+i*n}},e.prototype.Zn=function(t,e,i,n){return new C_(e,t,i,n,this.Ly,this.Iy,this.By)},e.prototype.Kn=function(t,e){var i=e.wuSize,n=e.start,r=e.end,o=e.tickDirection3D,s=e.tickDirection2D,a=t.tickLevel.Xn,l=(t.value-this.Y.getInnerStart())/(this.Y.getInnerEnd()-this.Y.getInnerStart()),h=xe.addVec(_e(n,r,l),xe.multiplyVec(xe.multiply(o,this.By.Gy(.5*this.Oy.Ma().thickness)),i)),u=xe.addVec(h,xe.multiplyVec(xe.multiply(o,this.By.Gy(a.tickLength)),i)),c=this.By.Hy(u)||m(0,0),f=ti(et(c,this.chart.engine.scale,this.Iy),$e(s,a.tickPadding));return t.label.Eo(f).Xo({x:-s.x,y:-s.y}),{posTickEnd3D:u,posTickStart3D:h,tickPositionRelative:l}},e.prototype.$d=function(t,e,i){var n=e.wuSize,r=e.start,o=e.end,s=e.tickDirection3D,a=(t-this.Y.getInnerStart())/(this.Y.getInnerEnd()-this.Y.getInnerStart()),l=xe.addVec(_e(r,o,a),xe.multiplyVec(xe.multiply(s,this.By.Gy(.5*this.Oy.Ma().thickness)),n)),h=xe.addVec(l,xe.multiplyVec(xe.multiply(s,this.By.Gy(10)),n)),u=this.By.Hy(l)||m(0,0),c=this.By.Hy(h)||m(0,0);return this.Ly.ac(this.Iy).Ca(u).Sa(c).ka(new J({fillStyle:new G({color:O(120*i)}),thickness:1}))},e.prototype.de=function(t,e){return D_(t,e,this.Y)},e.prototype.Xu=function(t){var e,i,n,r,o,s,a=this,l=this.Py,h=k(l.x.Wy(),l.y.Wy(),l.z.Wy());this.Li===I_?(o=k(l.x.getInnerEnd(),l.y.getInnerStart(),l.z.getInnerStart()),s=k(l.x.getInnerEnd(),l.y.getInnerStart(),l.z.getInnerEnd())):(o=k(l.x.getInnerStart(),l.y.getInnerStart(),l.z.getInnerStart()),s=this.Li.Ty(k(l.x.getInnerEnd(),l.y.getInnerEnd(),l.z.getInnerEnd()),o));var u=this.Li.Kf,p=this.By.Hy(o)||m(0,0),y=this.By.Hy(s)||m(0,0),d=_e(o,s,.5),g=xe.addVec(d,xe.multiplyVec(xe.multiply(u,-1),h)),S=this.By.Hy(d)||m(0,0),v=this.By.Hy(g)||m(0,0),x=qe(ei(et(S,this.chart.engine.scale,this.Iy),et(v,this.chart.engine.scale,this.Iy)));this.Oy.bh().gh([o,s]);var b=this.Li.Cy(t),w=b.gridlinePositionA,M=b.gridlinePositionB,A=b.gridlinePositionC,I=function(t){return{x:-1===t.x?a.Py.x.getInnerStart():1===t.x?a.Py.x.getInnerEnd():0,y:-1===t.y?a.Py.y.getInnerStart():1===t.y?a.Py.y.getInnerEnd():0,z:-1===t.z?a.Py.z.getInnerStart():1===t.z?a.Py.z.getInnerEnd():0}},F=I(w),T=I(M),C=I(A),D={physicalAxisSize:Je(ei(p,y)),wuSize:h,start:o,end:s,tickDirection3D:u,tickDirection2D:x,gridlinePositionA:F,gridlinePositionB:T,gridlinePositionC:C},L=this.On(D);try{for(var P=c(this._i),B=P.next();!B.done;B=P.next()){var E=f(B.value,2),O=E[0],_=E[1],V=this.sl.get(O);V||(V={grid:this.By.nv().setMouseInteractions(!1),tick:this.By.nv().setMouseInteractions(!1)}),V.grid.bh(),V.tick.bh();try{for(var z=(n=void 0,c(_)),N=z.next();!N.done;N=z.next()){var R=f(N.value,2)[1],H=this.Qd(R,D,L);H.gridStroke&&V.grid.gh(H.gridStroke),V.tick.gh([H.tickStroke.start,H.tickStroke.end])}}catch(t){n={error:t}}finally{try{N&&!N.done&&(r=z.return)&&r.call(z)}finally{if(n)throw n.error}}V.grid.ka(O.Xn.getGridStrokeStyle()),V.tick.ka(O.Xn.getTickStyle()),this.sl.set(O,V)}}catch(t){e={error:t}}finally{try{B&&!B.done&&(i=P.return)&&i.call(P)}finally{if(e)throw e.error}}var Y=this.$n((function(t,e){var i=e.label.Bt();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),m(0,0)),U=Math.atan((y.y-p.y)/(y.x-p.x));this.yn.Xo({x:0,y:0}).xn(180*-U/Math.PI);var G=xe.addVec(d,xe.multiplyVec(xe.multiply(u,this.By.Gy(.5*this.Oy.Ma().thickness+this.se((function(t,e){return Math.max(t,e.tickLength)}),0))),h)),X=this.By.Hy(G)||m(0,0),W=ti(et(X,this.chart.engine.scale,this.Iy),ti(ti(ii(Y,x),$e(x,this.se((function(t,e){return Math.max(t,e.labelPadding)}),0))),ii($e(this.yn.Un().Bt(),.5),x)));this.yn.Eo(W),this.Oy.jy={overrideFollowing:!1,skipMousePicking:!1}},e.prototype.Qd=function(t,e,i){var n,r=e.gridlinePositionA,o=e.gridlinePositionB,s=e.gridlinePositionC,a=i.get(t),l=a.posTickStart3D,h=a.posTickEnd3D,c=a.tickPositionRelative;return At(c,0)||At(c,1)||(n=[this.isX()?u(u({},r),{x:l.x}):this.isY()?u(u({},r),{y:l.y}):this.isZ()?u(u({},r),{z:l.z}):{x:0,y:0,z:0},this.isX()?u(u({},o),{x:l.x}):this.isY()?u(u({},o),{y:l.y}):this.isZ()?u(u({},o),{z:l.z}):{x:0,y:0,z:0},this.isX()?u(u({},s),{x:l.x}):this.isY()?u(u({},s),{y:l.y}):this.isZ()?u(u({},s),{z:l.z}):{x:0,y:0,z:0}]),{gridStroke:n,tickStroke:{start:l,end:h}}},e.prototype.kn=function(){var e,i;if(this.sl){try{for(var n=c(this.sl),r=n.next();!r.done;r=n.next()){var o=r.value;o[1].grid.dispose(),o[1].tick.dispose()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}this.sl.clear()}t.prototype.kn.call(this)},e.prototype.isX=function(){return this.Li===M_},e.prototype.isY=function(){return this.Li===A_},e.prototype.isZ=function(){return this.Li===I_},e}(Wi),C_=function(t){function e(e,i,n,r,o,s,a,l){var h=t.call(this,e,i,n,r,o,s,l)||this;return h.Jf=a,h}return h(e,t),e}(ji),D_=function(t,e,i){return It(t+.1*(e-t)+Math.abs(i.Wy())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e))},L_=function(){this.type="simple"},P_=new L_,B_=function(t){this.type="phong",this.ambientReflection=1,this.specularReflection=.1,this.diffuseReflection=1,this.ambientColor=E("#000"),this.specularColor=E("#fff"),this.shininess=32,t&&(this.ambientReflection=Number.isNaN(Number(t.ambientReflection))?this.ambientReflection:Number(t.ambientReflection),this.specularReflection=Number.isNaN(Number(t.specularReflection))?this.specularReflection:Number(t.specularReflection),this.diffuseReflection=Number.isNaN(Number(t.diffuseReflection))?this.diffuseReflection:Number(t.diffuseReflection),this.ambientColor=t.ambientColor||this.ambientColor,this.specularColor=t.specularColor||this.specularColor,this.shininess=t.shininess||this.shininess)},E_=new B_,O_={Simple:L_,Phong:B_},__=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,o)||this;return s.Ie=e,s.By=r,s.Uy=E_,s.Yy=!0,s.Xy=!0,s.setMouseInteractions(!1),s}return h(e,t),e.prototype.setAutoScrollingEnabled=function(t){return this.Yy=t,this.Ie.engine.Vi(),this},e.prototype.getAutoScrollingEnabled=function(){return this.Yy},e.prototype.setColorShadingStyle=function(t){return this.Uy=t,this.kc.forEach((function(e){return e.Zy(t)})),this.By.Vi(),this},e.prototype.getColorShadingStyle=function(){return this.Uy},e.prototype.setDepthTestEnabled=function(t){return this.Xy=t,this.kc[0].Ky(t),this.By.Vi(),this},e.prototype.getDepthTestEnabled=function(){return this.Xy},e.prototype.qy=function(){},e.prototype.Xu=function(){},e.prototype.Jy=function(){},e.prototype.getXMax=function(){var t=this.kc[0];return t?t.Z():void 0},e.prototype.getXMin=function(){var t=this.kc[0];return t?t.X():void 0},e.prototype.getYMax=function(){var t=this.kc[0];return t?t.q():void 0},e.prototype.getYMin=function(){var t=this.kc[0];return t?t.K():void 0},e.prototype.getZMax=function(){var t=this.kc[0];return t?t.$():void 0},e.prototype.getZMin=function(){var t=this.kc[0];return t?t.J():void 0},e.prototype.Ay=function(){var t=this.kc[0];return t?k(t.Ph(),t.Oh(),t.Qy()):k(0,0,0)},e.prototype.$y=function(t){return this},e.prototype.tS=function(){return this},e}(_E),V_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.La=[],e}return h(e,t),e.prototype.add=function(t){return Array.isArray(t)?this.iS(t):this.iS([t]),this},e.prototype.clear=function(){var t,e;this.La.length=0;try{for(var i=c(this.kc),n=i.next();!n.done;n=i.next())n.value.bh().dispose()}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return this.kc.length=0,this.Mc=0,this},e.prototype.getPointAmount=function(){return this.kc.reduce((function(t,e){return t+e.xh()+e.wh()}),this.La.length)},e.prototype.qy=function(){},e.prototype.Xu=function(){this.La.length>0&&this.nS(this.La)},e.prototype.Jy=function(){this.eS=void 0,this.La.length=0},e.prototype.he=function(){return this.Yy&&this.getPointAmount()>0},e.prototype.iS=function(t){0!==t.length&&(this.eS?this.eS=Ye(this.eS,Re(t)):this.eS=Re(t),this.La=ce(this.La,t,{canReturnB:!1}),this.Ie.engine.Vi())},e.prototype.getXMax=function(){return Xt(this.kc,Et,Math.max,Rt,this.eS)},e.prototype.getXMin=function(){return Xt(this.kc,Bt,Math.min,Nt,this.eS)},e.prototype.getYMax=function(){return Xt(this.kc,_t,Math.max,Yt,this.eS)},e.prototype.getYMin=function(){return Xt(this.kc,Ot,Math.min,Ht,this.eS)},e.prototype.getZMax=function(){return Xt(this.kc,zt,Math.max,Gt,this.eS)},e.prototype.getZMin=function(){return Xt(this.kc,Vt,Math.min,Ut,this.eS)},e.prototype.Ay=function(){var t,e,i=k(0,0,0);try{for(var n=c(this.kc),r=n.next();!r.done;r=n.next()){var o=r.value;i.x=Math.max(i.x,o.Ph()),i.y=Math.max(i.y,o.Oh()),i.z=Math.max(i.z,o.Qy())}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return i},e}(__),z_=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;s.Uc="Box Series 3D",s.rS=.25,s.Ef=function(){return pe(s.ho)};var a=s.Ie.getSeries().length;s.ho=new v(ge(s.Ii.boxSeriesFillStyle,a));var l=s.By.oS().Ky(s.Xy).pn(s.ho.L()).sS(s.rS);return s.Kc(l),s}return h(e,t),e.prototype.invalidateData=function(t){var e=t.length;if(0===e)return this;var i,n=t[0];if(!n)return this;if("xMin"in n||"yMin"in n||"zMin"in n||"xMax"in n||"yMax"in n||"zMax"in n){i=[];for(var r=0;r0},e.prototype.Yc=function(t,e){t.ka(this.wa.D(e)).Dy(this.aS.D(e)),this.By.Vi()},e.prototype.attach=function(e,i){return t.prototype.attach.call(this,e,i),fe(e,this.Ii,{stroke:this.wa}),this},e.prototype.Oc=function(t,e){},e}(__),R_=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;s.Uc="Line Series 3D";var a=s.Ie.getSeries().length;return s.wa=new v(Se(o.lineSeries3DStrokeStyle,a,o.seriesStrokeStyle3D)),s.aS=new v(OB.pointStyle3D),s.uS(s.wa.L(),s.wa.P()),s.Kc(s.By.ky([u_.UserSeries]).Ky(s.Xy).ka(s.wa.D(s.Ku)).Dy(s.aS.D(s.Ku))),s}return h(e,t),e.prototype.setStrokeStyle=function(e){t.prototype.setStrokeStyle.call(this,e),this.uS(this.wa.L(),this.wa.P());var i=this.aS.D(this.getHighlighted());return this.kc[0].Dy(i),this},e.prototype.setStrokeStyleHighlight=function(e){t.prototype.setStrokeStyleHighlight.call(this,e),this.uS(this.wa.L(),this.wa.P());var i=this.aS.D(this.getHighlighted());return this.kc[0].Dy(i),this},e.prototype.uS=function(t,e){var i=new tn.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()}),n=new tn.Triangulated({shape:"sphere",fillStyle:e.getFillStyle(),size:e.getThickness()});this.aS.C(i).I(n)},e}(N_),H_=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;s.Uc="Point Line Series 3D";var a=s.Ie.getSeries().length;return s.wa=new v(Se(o.pointLineSeries3DStrokeStyle,a,o.seriesStrokeStyle3D)),s.aS=new v(Se(o.pointLineSeries3DPointStyle,a,o.seriesTriangulatedPointStyle3D)),s.cS(),s.Kc(s.By.ky([u_.UserSeries]).Ky(s.Xy).ka(s.wa.D(s.Ku)).Dy(s.aS.D(s.Ku))),s}return h(e,t),e.prototype.setPointStyle=function(t){this.aS.C(t),this.cS();var e=this.aS.D(this.Ku);return this.kc[0].Dy(e),this.By.Vi(),this},e.prototype.getPointStyle=function(){return this.aS.L()},e.prototype.setPointStyleHighlight=function(t){if(this.aS.I(t),this.getHighlighted()){var e=this.aS.D(!0);this.kc[0].Dy(e)}return this.By.Vi(),this},e.prototype.getPointStyleHighlight=function(){return this.aS.D(!0)},e.prototype.setStrokeStyle=function(e){t.prototype.setStrokeStyle.call(this,e);var i=this.wa.L(),n=Math.abs(i.getThickness()),r=this.aS.L();n>r.getSize()&&this.aS.C(r.setSize(n)),this.cS();var o=this.aS.D(this.Ku);return this.kc[0].Dy(o),this.By.Vi(),this},e.prototype.setStrokeStyleHighlight=function(e){return t.prototype.setStrokeStyleHighlight.call(this,e),this.cS(),this.By.Vi(),this},e.prototype.setLineStyle=function(t){return this.setStrokeStyle(t),this},e.prototype.cS=function(){var t=this.aS.L(),e=this.wa.L(),i=t.getSize();"number"==typeof i?this.aS.I(t.setSize(i*e.highlightThicknessMultiplier)):this.aS.I(t.setSize(xe.multiply(i,e.highlightThicknessMultiplier)))},e.prototype.Yc=function(t,e){t.ka(this.wa.D(e)).Dy(this.aS.D(e)),this.By.Vi()},e}(N_),Y_=function(t){function e(e,i,n,r,o,s){return t.call(this,e,i,n,r,o)||this}return h(e,t),e.prototype.add=function(t){return(t=Array.isArray(t)?t:[t])?(this.kc[0].gh(t.slice()),this.By.Vi(),this):this},e.prototype.clear=function(){return this.kc[0].bh(),this.Mc=0,this},e.prototype.getPointAmount=function(){var t=this.kc[0];return t.xh()+t.wh()},e.prototype.he=function(){return this.Yy&&this.getPointAmount()>0},e.prototype.Yc=function(t,e){t.fS(this.lS.D(e)),this.By.Vi()},e.prototype.attach=function(e,i){return t.prototype.attach.call(this,e,i),fe(e,this.Ii,{point3D:this.lS}),this},e.prototype.Oc=function(t,e){},e}(__),U_=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,r,o,s)||this;a.Uc="Point Series 3D",a.Ef=function(){return pe(a.lS.L().getFillStyle())};var l=a.Ie.getSeries().length;a.lS=new v(Se(o.pointSeries3DPointStyle,l,o.seriesTriangulatedPointStyle3D));var h=u({individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1},s);return a.Kc(a.By.dS(h).Ky(a.Xy).fS(a.lS.D(a.Ku))),a}return h(e,t),e.prototype.setPointStyle=function(t){var e,i;this.lS.C(t);var n=this.lS.D(this.Ku);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.fS(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return this.By.Vi(),this},e.prototype.getPointStyle=function(){return this.lS.L()},e.prototype.setPointStyleHighlight=function(t){var e,i;if(this.lS.I(t),this.getHighlighted()){var n=this.lS.D(!0);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.fS(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}return this.By.Vi(),this},e.prototype.getPointStyleHighlight=function(){return this.lS.D(!0)},e}(Y_),G_=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,r,o,s)||this;a.Uc="Point Cloud Series 3D",a.Ef=function(){return pe(a.lS.L().getFillStyle())};var l=a.Ie.getSeries().length;a.lS=new v(ge(o.seriesNonTriangulatedPointStyle3D,l));var h=u({individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1},s);return a.Kc(a.By.dS(h).fS(a.lS.D(a.Ku))),a}return h(e,t),e.prototype.setPointStyle=function(t){var e,i;this.lS.C(t);var n=this.lS.D(this.Ku);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.fS(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return this.By.Vi(),this},e.prototype.getPointStyle=function(){return this.lS.L()},e.prototype.setPointStyleHighlight=function(t){var e,i;if(this.lS.I(t),this.getHighlighted()){var n=this.lS.D(!0);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.fS(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}return this.By.Vi(),this},e.prototype.getPointStyleHighlight=function(){return this.lS.D(!0)},e}(Y_),X_={Triangulated:U_,Pixelated:G_},W_=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,r,s)||this;a.Ef=function(){return pe(a.ho)};var l=a.Ie.getSeries().length;return a.ho=new v(ge(a.Ii.surfaceSeriesFillStyle,l)),a.Kc(a.vS(o).Ky(a.Xy)),a}return h(e,t),e.prototype.reset=function(t){return this.kc[0].l(j_(t)),this.By.Vi(),this},e.prototype.setFillStyle=function(t){var e,i;this.ho.C(t);var n=this.ho.D(this.Ku);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.pn(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return this.By.Vi(),this},e.prototype.getFillStyle=function(){return this.ho.L()},e.prototype.setWireframeStyle=function(t){return this.kc[0].Ha(t),this.By.Vi(),this},e.prototype.getWireframeStyle=function(){return this.kc[0].Wa()},e.prototype.Ya=function(t,e,i){return this.kc[0].Ya(t,e,i),this.By.Vi(),this},e.prototype.Xa=function(t,e,i){return this.kc[0].Xa(t,e,i),this.By.Vi(),this},e.prototype.invalidateColorsOnly=function(t,e){return this.kc[0].Za(t,e),this.Ie.engine.Vi(),this},e.prototype.invalidateValuesOnly=function(t,e){return this.kc[0].Ka(t,e),this.Ie.engine.Vi(),this},e.prototype.vS=function(t){return this.By.yS().l(j_(t)).pn(this.ho.D(this.Ku))},e.prototype.he=function(){return this.Yy},e.prototype.qy=function(){},e.prototype.Xu=function(){},e.prototype.Jy=function(){},e.prototype.Yc=function(t,e){t.pn(this.ho.D(e)),this.By.Vi()},e.prototype.attach=function(e,i){return t.prototype.attach.call(this,e,i),fe(e,this.Ii,{fill:this.ho}),this},e}(__),j_=function(t){var e={x:t.start.x,y:t.start.z},i={x:t.end.x,y:t.end.z};return u(u({},t),{start:e,end:i})},K_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.Uc="Surface Grid Series 3D",e}return h(e,t),e.prototype.addRow=function(e,i,n){return t.prototype.Ya.call(this,e,i,n)},e.prototype.addColumn=function(e,i,n){return t.prototype.Xa.call(this,e,i,n)},e.prototype.invalidateYOnly=function(t,e){return this.kc[0].hu(t,e),this.By.Vi(),this},e.prototype.Xu=function(){t.prototype.Xu.call(this),this.kc[0].Un(!1)},e}(W_),Z_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.Uc="Surface Mesh Series 3D",e}return h(e,t),e.prototype.invalidateGeometryOnly=function(t,e){return this.kc[0].qa(t,e),this.By.Vi(),this},e.prototype.Xu=function(){t.prototype.Xu.call(this),this.kc[0].Un(!1)},e}(W_),q_={Grid:K_,Mesh:Z_},Q_=function(t,e){var i,n,r,o,s=0,a=0;t.forEachAxis((function(t){s+=t.Se()?1:0,a+=t.me()?1:0}));var l=function(t){return"getMouseInteractionsWhileScrolling"in t}(t)?t.getMouseInteractionsWhileScrolling():void 0,h=function(t){return"getMouseInteractionsWhileZooming"in t}(t)?t.getMouseInteractionsWhileZooming():void 0;if(!1===l&&a>0||!1===h&&s>0)try{for(var u=c(e),f=u.next();!f.done;f=u.next())f.value.$y(!1).Xc(!1)}catch(t){i={error:t}}finally{try{f&&!f.done&&(n=u.return)&&n.call(u)}finally{if(i)throw i.error}}else try{for(var p=c(e),y=p.next();!y.done;y=p.next())y.value.tS().Zc()}catch(t){r={error:t}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}},J_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.SS=[],e.mS=0,e.pS=!1,e.gS=function(t){var i=e.SS.indexOf(t);i>=0&&(e.SS.splice(i,1),e.Fi.emit("seriesDispose",e,t))},e.bS=function(t){e.SS.includes(t)||(e.SS.push(t),t.setHighlightOnHover(e.pS))},e.xS=function(){e.mS+=1},e.wS=function(){e.mS-=1},e}return h(e,t),e.prototype.kS=function(t){this.SS.push(t),t.onMouseEnter(this.xS),t.onMouseLeave(this.wS),t.setHighlightOnHover(this.pS),this.Fi.emit("seriesRestore",this,t)},e.prototype.Xf=function(){return this.SS},e.prototype.MS=function(){return this.mS},e.prototype.setSeriesHighlightOnHover=function(t){return this.pS=t,this.SS.forEach((function(e){return e.setHighlightOnHover(t)})),this},e}(QO),$_=xe.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081}),tV=function(){function t(t,e,i,n,r){this.AS=t,this.FS=e,this.TS=i,this.Hy=n,this.CS=r,this.BS=!0,this.LS=!0,this.IS=2*-Math.PI/2160,this.PS=2*Math.PI/2160,this.OS=.1,this.DS=1*Math.PI/180}return t.prototype.getDefaultCameraConfiguration=function(t){var e={direction:$_,location:xe.multiply($_,-1)};return this.cameraLocationChanged({boundingBox:t,cameraDirection:e.direction,cameraLocation:e.location})||e},t.prototype.applyCameraInteractions=function(t,e){var i=this,n={direction:t.cameraDirection,location:t.cameraLocation};return e.forEach((function(t){"rotate"===t.type?n=i._S(n,t):"wheel-zoom"===t.type?n=i.RS(n,t):"rotate+zoom"===t.type?n=i.zS(n,t):"fixed-rotate"===t.type?n=i.NS(n,t):"move"===t.type&&(n=i.ES(n,t))})),this.BS?n=this.VS(t.boundingBox,n):this.LS&&(n=this.GS(t.boundingBox,n)),n},t.prototype._S=function(t,e){var i=e.rotation,n=t.location,r=xe.multiply(xe.normalize(t.location),-1),o=this.HS(r),s=o.Right,a=o.Up,l=n,h=this.WS(r),u=i.x*this.IS*h;l=xe.rotateAroundAxis(l,a,u);var c=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.PS,h-this.DS);return 0!==c&&(l=xe.rotateAroundAxis(l,s,c)),{location:l,direction:xe.multiply(xe.normalize(l),-1)}},t.prototype.RS=function(t,e){var i=e.deltaY;this.BS&&this.jS(!1);var n=t.location,r=xe.multiply(xe.normalize(n),-1),o=i*this.OS,s=xe.length(n)*-o;return{direction:r,location:xe.addVec(n,xe.multiply(r,s))}},t.prototype.zS=function(t,e){var i=e.rotation,n=e.cameraDistance;this.BS&&this.jS(!1);var r=this._S(t,{type:"rotate",rotation:i}).location,o=xe.multiply(xe.normalize(r),-1),s=xe.multiply(o,-n);return{direction:xe.multiply(xe.normalize(s),-1),location:s}},t.prototype.NS=function(t,e){this.BS&&this.jS(!1);var i=e.rotation,n=t.location,r=t.direction,o=this.HS(r),s=o.Right,a=o.Up,l=i.x*this.IS,h=xe.normalize(xe.rotateAroundAxis(r,a,l)),u=i.y*this.PS;return{location:n,direction:h=xe.normalize(xe.rotateAroundAxis(h,s,u))}},t.prototype.ES=function(t,e){this.BS&&this.jS(!1),this.LS=!1;var i=e.amountRight,n=e.amountForward,r=t.location,o=t.direction,s=this.HS(o).Right;return{location:xe.addVec(r,xe.multiply(o,.01*n),xe.multiply(s,.01*i)),direction:o}},t.prototype.boundingBoxChanged=function(t){var e={location:t.cameraLocation,direction:xe.multiply(xe.normalize(t.cameraLocation),-1)};return this.BS?this.VS(t.boundingBox,e):this.GS(t.boundingBox,e)},t.prototype.cameraLocationChanged=function(t){var e={location:t.cameraLocation,direction:xe.multiply(xe.normalize(t.cameraLocation),-1)};return this.BS?this.VS(t.boundingBox,e):this.GS(t.boundingBox,e)},t.prototype.viewportChanged=function(t){var e={location:t.cameraLocation,direction:xe.multiply(xe.normalize(t.cameraLocation),-1)};if(this.BS)return this.VS(t.boundingBox,e)},t.prototype.VS=function(t,e,i){var n=e;i=void 0!==i?i:0,n=this.US(t,n,100,20,1,i,5);var r=this.WS(n.direction);return this.YS(n,this.XS(t,n,100,1),r)},t.prototype.US=function(t,e,i,n,r,o,s){var a=this;return eV(o,s,(function(t){return{direction:e.direction,location:xe.multiply(e.direction,-t)}}),(function(e){return a.ZS(t,e)}),i,r,"linear",n)},t.prototype.XS=function(t,e,i,n){var r=this,o=this.HS(e.direction),s=o.Right,a=o.Left,l=o.Up,h=o.Down,u=this.KS(t,!1,e),c=e,f=n,p=.1;return Math.abs(u.bottom-u.top)>f&&(c=u.bottomf&&(c=u.leftr;f&&"linear"===s||!f&&"reversed"===s?(u=(l.value+t)/2,e=l.value):(u=(l.value+e)/2,t=l.value),h+=1}while(hi||e.y>n){if(!0===this.Ie.zr.warnings){var r="NewSurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid "+this.om.columns+"x"+this.om.rows+", input "+e.columns+"x"+e.rows+".\n Excess data will be automatically clipped. This can result in sub-optimal performance.";gt.console.warn(r)}for(var o=[],s=0;sc||u>f){!0===this.Ie.zr.warnings&&(r="NewSurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid "+this.om.columns+"x"+this.om.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.",gt.console.warn(r));var p=Math.max(-a,0),y=Math.max(-h,0),d=Math.max(l-c,0),g=Math.max(u-f,0),S=e.primary-(p+d);if(o=[],0===y&&0===g)for(s=0;si||e.y>n){if(!0===this.Ie.zr.warnings){var r="NewSurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid "+this.om.columns+"x"+this.om.rows+", input "+e.columns+"x"+e.rows+".\n Excess data will be automatically clipped. This can result in sub-optimal performance.";gt.console.warn(r)}for(var o=[],s=0;sc||u>f){!0===this.Ie.zr.warnings&&(r="NewSurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid "+this.om.columns+"x"+this.om.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.",gt.console.warn(r));var p=Math.max(-a,0),y=Math.max(-h,0),d=Math.max(l-c,0),g=Math.max(u-f,0),S=e.primary-(p+d);if(o=[],0===y&&0===g)for(s=0;s(a="columns"===this.om.scrollDimension?this.om.rows:this.om.columns)-1){if(!0===this.Ie.zr.warnings){var r="SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with "+a+" "+("columns"===this.om.scrollDimension?"rows":"columns")+", input yValues have "+n+".\nExcess data will be automatically clipped. This can result in sub-optimal performance.";gt.console.warn(r)}for(var o=[],s=0;s(a="columns"===this.om.scrollDimension?this.om.rows:this.om.columns)-1){for(!0===this.Ie.zr.warnings&&(r="SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with "+a+" "+("columns"===this.om.scrollDimension?"rows":"columns")+", input intensityValues have "+l+".\nExcess data will be automatically clipped. This can result in sub-optimal performance.",gt.console.warn(r)),o=[],s=0;su?e=e.slice(0,u):i=i.slice(0,h))}var c=e?e.length:null==i?void 0:i.length,f=e?e[0].length:null==i?void 0:i[0].length;return this.kc[0].Sm({startPrimary:0,startSecondary:0,lengthPrimary:c,lengthSecondary:f,heightMapValues:e,intensityValues:i}),this.By.Vi(),this},e.prototype.setCullMode=function(t){return this.kc[0].dm("boolean"==typeof t?t?"cull-back":"disabled":t),this},e.prototype.getCullMode=function(){return this.kc[0].vm()},e.prototype.qy=function(){},e.prototype.Xu=function(){},e.prototype.Jy=function(){},e.prototype.he=function(){return this.Yy},e.prototype.Yc=function(t,e){t.pn(this.ho.D(e)).Ha(this.Ga.D(e)),this.By.Vi()},e}(__);!function(t){t[t.bg=0]="bg",t[t.seriesBackground=1]="seriesBackground",t[t.layer3D=2]="layer3D",t[t.axesUi=3]="axesUi",t[t.ui=4]="ui"}(f_||(f_={}));var sV=function(t){function e(e,i,n,r,o,s,a){var l=t.call(this,e,i,n,i.ys(f_.bg),i.ys(f_.ui),r,s,a?a.theme:void 0)||this;l.pm=1,l.gm=[],l.bm={x:(new nV).Nt(-1,1),y:(new nV).Nt(-1,1),z:(new nV).Nt(-1,1)},l.xm=2,l.wm=!0,l.km=!0,l.Mm=!0,l.Am=0,l.axes={id:"axes",chart:l},l.world={id:"world",chart:l},l.yr=function(){var t={x:l.pixelScale.x.At(),y:l.pixelScale.y.At(),width:l.pixelScale.x.getInnerInterval(),height:l.pixelScale.y.getInnerInterval()};l.By.Tm(t).Fm(t);var e=l.Cm.viewportChanged(l.Bm());e&&l.Lm(e),l.Im.Fm(t),l.Pm.Fm(t),l.engine.Vi()},l.Om=!1,l.Cv.Sn("Chart3D");var h,u={x:l.pixelScale.x.At(),y:l.pixelScale.y.At(),width:l.pixelScale.x.getInnerInterval(),height:l.pixelScale.y.getInnerInterval()};l.Pm=i.ys(f_.seriesBackground).Fm(u),l.By=i.Dm(f_.layer3D,l.bm).Tm(u).Fm(u),l.Im=i.ys(f_.axesUi),l.Im.Fm(u),l._m={x:new T_(l,M_,l.bm.x,l.Ii,l.By,l.Im,l.pixelScale,!1),y:new T_(l,A_,l.bm.y,l.Ii,l.By,l.Im,l.pixelScale,!1),z:new T_(l,I_,l.bm.z,l.Ii,l.By,l.Im,l.pixelScale,!1)},l.Rm=l.By.ky([u_.InternalUI]).setMouseInteractions(!1),l.setBoundingBoxStrokeStyle(l.Ii.boundingBoxStyle3D),l.zm=l.Pm.ef(l.engine.scale,pE.Convex).pn(l.Ii.seriesBackgroundFillStyle).fs(l.Ii.seriesBackgroundStrokeStyle).setMouseInteractions(!1),l.Nm({x:1,y:1,z:1},!0),l.Cm=new tV(l.engine.scale,l.pixelScale,l.bm,(function(t,e){return e&&l.Lm(e),l.By.Hy(t)}),(function(t,e){return e&&l.Lm(e),l.By.CS(t)})),l.Em=l.Cm.getDefaultCameraConfiguration(l.Vm(l.Gm)),l.Lm(l.Em);var c=ME(new AE.Pinch((function(t,e,i){h={locationOne:e,locationTwo:i,cameraLocation:l.By.getCameraLocation()}}),(function(t,e,i,n,r,o){if(l.Mm||l.km){var s=Math.pow(h.locationOne.x-h.locationTwo.x,2)+Math.pow(h.locationOne.y-h.locationTwo.y,2),a=Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2),u=xe.length(h.cameraLocation),c=s/a*u,f=m((n.x+r.x)/2,(n.y+r.y)/2);l.gm.push({type:"rotate+zoom",rotation:l.Mm?f:{x:0,y:0},cameraDistance:l.km?c:u}),l.engine.Vi(),ee(o)}}),(function(t){})),new AE.Drag((function(t){}),(function(t,e,i,n,r){if(l.Mm){var o=n;l.gm.push({type:"rotate",rotation:o}),l.engine.Vi(),ee(r)}}),(function(t){})));return l.onBackgroundTouchStart(c.onTouchStart),l.onBackgroundTouchMove(c.onTouchMove),l.onBackgroundTouchEnd(c.onTouchEnd),l.onBackgroundMouseDrag((function(t,e,i,n,r){if(l.Mm){var o=r;l.gm.push({type:"rotate",rotation:o}),l.engine.Vi(),ee(e)}})),l.onBackgroundMouseDown((function(t,e){ee(e)})),l.onBackgroundMouseWheel((function(t,e){if(l.km){if(l.wm)l.Am=5*Math.sign(e.deltaY),e.ctrlKey&&(l.Am=2*Math.sign(e.deltaY));else{var i=ve(e);l.gm.push({type:"wheel-zoom",deltaY:i})}l.engine.Vi(),ee(e)}})),a&&!0===a.disableAnimations&&l.setAnimationsEnabled(!1),l.onResize(l.yr),l.Tv(o,l.pixelScale),l}return h(e,t),e.prototype.addPointSeries=function(t){var e=new(t&&t.type||U_)(this,this.gS,this.bS,this.By,this.Ii,t);return this.kS(e),e},e.prototype.addLineSeries=function(){var t=new R_(this,this.gS,this.bS,this.By,this.Ii);return this.kS(t),t},e.prototype.addPointLineSeries=function(){var t=new H_(this,this.gS,this.bS,this.By,this.Ii);return this.kS(t),t},e.prototype.addSurfaceSeries=function(t){var e=new(t&&t.type||K_)(this,this.gS,this.bS,this.By,u({},t),this.Ii);return this.kS(e),e},e.prototype.addSurfaceGridSeries=function(t){var e=new rV(this,this.gS,this.bS,this.By,t,this.Ii);return this.kS(e),e},e.prototype.addSurfaceScrollingGridSeries=function(t){var e=new oV(this,this.gS,this.bS,this.By,t,this.Ii);return this.kS(e),e},e.prototype.addSurfaceMeshSeries=function(t){var e=new Z_(this,this.gS,this.bS,this.By,u({},t),this.Ii);return this.kS(e),e},e.prototype.addBoxSeries=function(){var t=new z_(this,this.gS,this.bS,this.By,this.Ii);return this.kS(t),t},e.prototype.getDefaultAxisX=function(){return this._m.x},e.prototype.getDefaultAxisY=function(){return this._m.y},e.prototype.getDefaultAxisZ=function(){return this._m.z},e.prototype.getDefaultAxes=function(){return[this._m.x,this._m.y,this._m.z]},e.prototype.setCameraLocation=function(t){var e={location:t,direction:xe.normalize(xe.multiply(t,-1))},i=this.Cm.cameraLocationChanged(this.Bm(e));return i&&(e=i),this.Lm(e),this.engine.Vi(),this},e.prototype.getCameraLocation=function(){return this.By.getCameraLocation()},e.prototype.getCameraDirection=function(){return this.By.getCameraDirection()},e.prototype.setCameraAutomaticFittingEnabled=function(t){this.Cm.jS(t);var e=this.Cm.cameraLocationChanged(this.Bm());return e&&this.Lm(e),this},e.prototype.getCameraAutomaticFittingEnabled=function(){return this.Cm.tm()},e.prototype.onCameraChange=function(t){return this.Fi.on("cameraChange",t)},e.prototype.offCameraChange=function(t){return this.Fi.off(t,"cameraChange")},e.prototype.setSeriesBackgroundFillStyle=function(t){return this.zm.pn(t),this.ic.Vi(),this},e.prototype.getSeriesBackgroundFillStyle=function(){return this.zm.mn()},e.prototype.setSeriesBackgroundStrokeStyle=function(t){return this.zm.fs(t),this.ic.Vi(),this},e.prototype.getSeriesBackgroundStrokeStyle=function(){return this.zm.ls()},e.prototype.setBoundingBoxStrokeStyle=function(t){return this.Rm.ka(t).Dy(F_(this.Rm.Ma())),this.By.Vi(),this},e.prototype.getBoundingBoxStrokeStyle=function(){return this.Rm.Ma()},e.prototype.setBoundingBox=function(t){return this.Nm(t,!1),this},e.prototype.Nm=function(t,e){this.Gm=t;var i=this.Vm(t);if(this.bm.x.wt(i.x),this.bm.y.wt(i.y),this.bm.z.wt(-i.z),!e){var n=this.Cm.boundingBoxChanged(this.Bm());n&&this.Lm(n)}this.engine.Vi()},e.prototype.getBoundingBox=function(){return this.Gm},e.prototype.Xu=function(){var e=this;this.wm&&0!==this.Am&&(this.gm.push({type:"wheel-zoom",deltaY:.1*this.Am}),this.Am-=Math.sign(this.Am),0!==this.Am&&this.engine.Vi(!0));var i=this.getCameraDirection();if(this.gm.length>0){var n=this.Cm.applyCameraInteractions(this.Bm(),this.gm);n&&this.Lm(n),this.gm.length=0}this.Hm&&xe.equals(this.Hm.location,this.Em.location)&&xe.equals(this.Hm.direction,this.Em.direction)||this.Fi.emit("cameraChange",this,this.getCameraLocation()),this.Hm=this.Em,t.prototype.Xu.call(this);for(var r=0;r0?r-1:u.length-1],u[ri.x.getInnerEnd()||n.yi.y.getInnerEnd();var t,i,n,r},t.prototype.tp=function(){return t=this.Km,i=this.Y,n=et(t.getPosition(m(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=et(t.getPosition(m(1,1),e.UISpace.PaddedBackground),t.scale,i),n.xi.x.getInnerEnd();var t,i,n,r},t.prototype.ip=function(){return t=this.Km,i=this.Y,n=et(t.getPosition(m(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=et(t.getPosition(m(1,1),e.UISpace.PaddedBackground),t.scale,i),n.yi.y.getInnerEnd();var t,i,n,r},t.prototype.np=function(t){return this.qm.push(t),t},t}(),cV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.Fo=e.np(new hV((function(t){return e.Km.setOrigin(t)}),(function(){return e.Km.getOrigin()}))),e}return h(e,t),e.prototype.$m=function(){var t=this.Fo.getNormalValue(),e=m(this.tp()?-t.x:t.x,this.ip()?-t.y:t.y);this.Fo.alter(e)},e}(uV),fV=function(t){function e(e,i,n,r){var o=t.call(this,e,i)||this;return o.ep=n,o.rp=r,o.sp=o.np(new hV((function(t){return o.Km.setTextFont((function(e){return e.setSize(t)}))}),(function(){return o.Km.getTextFont().getSize()}))),o}return h(e,t),e.prototype.$m=function(){var t=this.sp.getNormalValue(),e=this.ep;if(e=s)this.getMembers()[l].dispose(),l-=1,a-=1;else for(var h=t[l].length,u=i.getMembers().length,c=0;c=h)i.getMembers()[c].dispose(),c-=1,u-=1;else if(void 0!==f&&f.length>0){for(e=p.length;e=p.length?y=i.addElement(tO,void 0):(d=p[c])instanceof oO?(i.getMembers()[c].dispose(),y=i.addElement(tO,c)):y=d,y.setFont(this.fc).setFillStyle(this.ap).setText(f).setTextRotation(this.Pf)}else{for(e=p.length;e=p.length?i.addGap(void 0,void 0):(d=p[c])instanceof $E&&(i.getMembers()[c].dispose(),i.addGap(void 0,c))}}return this.Vu.Vi(),this},e.prototype.restore=function(){return this.dispose(),t.prototype.restore.call(this),this},e.prototype.setTextFillStyle=function(t){this.ap="function"==typeof t?t(this.ap):t;for(var e=0;e=i.x.getInnerStart()&&n.x<=i.x.getInnerEnd()&&n.y>=i.y.getInnerStart()&&n.y<=i.y.getInnerEnd()}(this.bo,this.scale),this},t}(),vV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mp=!1,e}return h(e,t),e.prototype.pointAt=function(e){return this.pp(e.fillStyle),t.prototype.pointAt.call(this,e)},e.prototype.pp=function(t){t&&this.mp&&this.Km.setTextFillStyle(t)},e.prototype.setResultTableAutoTextStyle=function(t){return this.mp=t,this.Vu.Vi(),this},e.prototype.getResultTableAutoTextStyle=function(){return this.mp},e}(SV),mV=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.setPosition=function(t){return this.bo=t,this.yp.setPosition(t),this.Km.setPosition(t),this.Vu.Vi(),this},e}(SV),xV=function(t,e,i){var n=this;void 0===i&&(i=[]),this.cp=t,this.fp=e,this.gp=i,this.bp=function(t){return n.gp.forEach((function(e){return e(t)})),t}},bV=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.xp=function(t,e,n,r){return i.bp(new vV(t,e,n,i.cp,i.fp,r))},i.addStyler=function(t){return new e(i.cp,i.fp,i.gp.map((function(t){return t})).concat(t))},i.setPointMarker=function(t){return new e(t,i.fp,i.gp.map((function(t){return t})))},i.setResultTableBackground=function(t){return new e(i.cp,t,i.gp.map((function(t){return t})))},i}return h(e,t),e}(xV),kV=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.wp=function(t,e,n,r){return i.bp(new mV(t,e,n,i.cp,i.fp,r))},i.addStyler=function(t){return new e(i.cp,i.fp,i.gp.map((function(t){return t})).concat(t))},i.setPointMarker=function(t){return new e(t,i.fp,i.gp.map((function(t){return t})))},i.setResultTableBackground=function(t){return new e(i.cp,t,i.gp.map((function(t){return t})))},i}return h(e,t),e}(xV),wV=function(t){return t.setPointMarker((function(t){return t.setSize(m(5,5)).setOrigin(m(0,0))})).setResultTable((function(t){return t.setOrigin(m(-1,-1)).setMargin(5)}))},MV=function(t){return t.setPointMarker((function(t){return t.setSize(m(20,20)).setOrigin(m(0,0))})).setResultTable((function(t){return t.setBackground((function(t){return t})).setOrigin(m(-1,-1)).setMargin(10)}))};new bV(eO,eO,[wV]);var AV=new bV(eO,rO,[wV,function(t){return t.disposePointMarker().setResultTable((function(t){return t.setOrigin(m(0,-1)).setMargin(0).setBackground((function(t){t instanceof rO&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))}))}]),IV=AV;new kV(nO,eO,[MV,function(t){return t.disposeResultTable()}]);var FV,TV=new kV(ZE,eO,[MV,function(t){return t.setResultTable((function(t){return t.setOrigin(JP.LeftBottom)}))}]),CV=function(t,e,i,n,r){return{location:t,scale:e,resultTableContent:i,series:n,fillStyle:r}},DV={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},LV=function(t,e){var i;if(t===DV.World)i="countries_world.json";else if(t===DV.NorthAmerica)i="countries_northAmerica.json";else if(t===DV.SouthAmerica)i="countries_southAmerica.json";else if(t===DV.Africa)i="countries_africa.json";else if(t===DV.Europe)i="countries_europe.json";else if(t===DV.Asia)i="countries_asia.json";else if(t===DV.USA)i="states_usa.json";else if(t===DV.Canada)i="territoriesProvinces_canada.json";else{if(t!==DV.Australia){var n="LCJS MapChart unidentified `type`: "+t;throw gt.alert(n),new Error(n)}i="territories_australia.json"}var r=e+"/maps/"+i;return gt.fetch(r).then((function(t){return t.json()})).catch((function(t){var i='LightningChart JS Map data request failed.\nresourcesBaseUrl: "'+e+'"\nPlease see API documentation of MapChart to learn more about this.\nThe latest documentation can be found at arction.com.';throw gt.alert(i),new Error(i)}))},PV=function(t,e){return!(!e.name||t.name.toLowerCase()!==e.name.toLowerCase())||"ISO_A3"in t&&"ISO_A3"in e&&t.ISO_A3.toLowerCase()===e.ISO_A3.toLowerCase()},BV=function(t,e,i){var n,r=e.name.toLowerCase();if(t===DV.USA&&("alaska"===r?n={translate:{x:55,y:-25},scale:{x:.16,y:.16}}:"hawaii"===r&&(n={translate:{x:48,y:7},scale:{x:1,y:1}})),n){for(var o=n.translate,s=n.scale,a=Ne(Ft(i)),l=[],h=0;hthis.uiScale.x.Ft()||t.ythis.uiScale.y.Ft())){var n,r=Number.MAX_VALUE;try{for(var o=c(this.SS),s=o.next();!s.done;s=o.next()){var a=s.value;if(a.getCursorEnabled()){var l=a.solveNearestFromScreen(t);if(l){var h=et(l.location,l.scale,this.engine.scale),u=Pe(t,h);Number.isNaN(u)||n&&!(u0)?this.Lp=this.solveNearest():this.Lp=void 0),(void 0!==this.Lp||n)&&this.engine.Vi()}},i.prototype.kS=function(e){e.onHover(this.Mp),t.prototype.kS.call(this,e)},i.prototype.Ip=function(t){return this.Fi.on("seriesRestore",t)},i.prototype.Pp=function(t){return this.Fi.off(t)},i.prototype.Op=function(t){return this.Fi.on("seriesDispose",t)},i.prototype.Dp=function(t){return this.Fi.off(t)},i.prototype.dispose=function(){return this.SS.slice().forEach(wt),t.prototype.dispose.call(this)},i}(J_),zV=function(t){function i(i,n,r,o,s,a,l){var h=t.call(this,i,n,r,n.ys(_V.bg),n.ys(_V.ui),o,l,a?a.theme:void 0)||this;h._p=[],h.Rp=[],h.zp=[],h.Y=h.sv.d2({scaleXYConstructor:Ci}),h.xc=!0,h.ho=new v(h.Ii.mapChartFillStyle),h.do=new v(h.Ii.mapChartStrokeStyle),h.Np=h.Ii.mapChartOutlierRegionFillStyle,h.Ep=h.Ii.mapChartOutlierRegionStrokeStyle,h.Vp=h.Ii.mapChartSeparateRegionFillStyle,h.Gp=h.Ii.mapChartSeparateRegionStrokeStyle,h.Ku=!1,h.Hp=e.AutoCursorModes.onHover,h.Wp=RV,h.Gi=!1,h.onMouseEnter=function(t){return h.Fi.on("mouseEnter",t)},h.onMouseLeave=function(t){return h.Fi.on("mouseLeave",t)},h.onMouseClick=function(t){return h.Fi.on("mouseClick",t)},h.onMouseDoubleClick=function(t){return h.Fi.on("mouseDoubleClick",t)},h.onMouseDown=function(t){return h.Fi.on("mouseDown",t)},h.onMouseUp=function(t){return h.Fi.on("mouseUp",t)},h.onMouseMove=function(t){return h.Fi.on("mouseMove",t)},h.offMouseEnter=function(t){return h.Fi.off(t,"mouseEnter")},h.offMouseLeave=function(t){return h.Fi.off(t,"mouseLeave")},h.offMouseClick=function(t){return h.Fi.off(t,"mouseClick")},h.offMouseDoubleClick=function(t){return h.Fi.off(t,"mouseDoubleClick")},h.offMouseDown=function(t){return h.Fi.off(t,"mouseDown")},h.offMouseUp=function(t){return h.Fi.off(t,"mouseUp")},h.offMouseMove=function(t){return h.Fi.off(t,"mouseMove")},h.offMouseDragStart=function(t){return h.Fi.off(t,"mouseDragStart")},h.offMouseDrag=function(t){return h.Fi.off(t,"mouseDrag")},h.offMouseDragStop=function(t){return h.Fi.off(t,"mouseDragStop")},h.offMouseWheel=function(t){return h.Fi.off(t,"mouseWheel")},h.onMapDataReady=function(t){var e=h.Fi.on("mapDataReady",t);return h.jp&>.setTimeout((function(){return t()})),e},h.onViewChange=function(t){return h.Fi.on("viewChange",t)},h.Yp=function(t,e,i,n,r){h.Y.x.wt(n).Mt([h.ct.left+h.To.left,h.ct.right+h.To.right]),h.Y.y.wt(r).Mt([h.ct.bottom+h.To.bottom,h.ct.top+h.To.top+h.Pv()]),h.Xp&&h.Zp(h.Kp,h.Y,h.Xp)},h.Cc=function(t,i,n,r){h.Hp!==e.AutoCursorModes.disabled&&(h.qp(t,n,r),ee(i)),h.Fi.emit("mouseEnter",h,i)},h.Lc=function(t,e,i,n){h.Jp(t,i,n),h.Fi.emit("mouseLeave",h,e),e&&ee(e)},h.Pc=function(t,i,n,r){h.Hp!==e.AutoCursorModes.disabled&&(h.qp(t,n,r),ee(i)),h.Fi.emit("mouseMove",h,i)},h.Dc=function(t,e){return h.Fi.emit("mouseClick",h,e)},h._c=function(t,e){return h.Fi.emit("mouseDoubleClick",h,e)},h.Rc=function(t,e){return h.Fi.emit("mouseDown",h,e)},h.zc=function(t,e){return h.Fi.emit("mouseUp",h,e)},h.Nc=function(t,e,i){h.Fi.emit("mouseDragStart",h,e,i)},h.Ec=function(t,e,i,n,r){h.Fi.emit("mouseDrag",h,e,i,n,r)},h.Vc=function(t,e,i,n){h.Fi.emit("mouseDragStop",h,e,i,n)},h.Gc=function(t,e){h.Fi.emit("mouseWheel",h,e)},h.Hc=function(t,e,i,n){h.Qp=h.engine.clientLocation2Engine(e.clientX,e.clientY),h.qp(t,i,n),h.Fi.emit("touchStart",h,e),ee(e)},h.Wc=function(t,e,i,n){h.Qp=h.engine.clientLocation2Engine(e.clientX,e.clientY),h.qp(t,i,n),h.Fi.emit("touchMove",h,e),ee(e)},h.jc=function(t,e,i,n){h.Qp=void 0,h.Jp(t,i,n),h.Fi.emit("touchEnd",h,e),ee(e)},h.$p=n.ys(_V.plotting),h.onResize(h.Yp),h.Cv.Sn("Map Chart");var u=Pt(a?a.autoCursorBuilder:void 0,TV);h.tg=u.wp(h.nc,h.Y,h.Y,h.Ii).dispose(),h.Tv(s,h.uiScale);var c=Pt(a&&a.type,DV.World);return h.Kp=c,h.ig(c).then((function(){h.Fi.emit("mapDataReady")})),h}return h(i,t),i.prototype.setFillStyle=function(t){return this.ho.C(t),this.ng(),this},i.prototype.getFillStyle=function(){return this.ho.L()},i.prototype.setStrokeStyle=function(t){return this.do.C(t),this.ng(),this},i.prototype.getStrokeStyle=function(){return this.do.L()},i.prototype.setOutlierRegionFillStyle=function(t){var e=this;return this.Np="function"==typeof t?t(this.Np):t,this.Rp.forEach((function(t){return t.pn(e.Np)})),this.engine.Vi(),this},i.prototype.getOutlierRegionFillStyle=function(){return this.Np},i.prototype.setOutlierRegionStrokeStyle=function(t){var e=this;return this.Ep="function"==typeof t?t(this.Ep):t,this.Rp.forEach((function(t){return t.fs(e.Ep)})),this.engine.Vi(),this},i.prototype.getOutlierRegionStrokeStyle=function(){return this.Ep},i.prototype.setSeparateRegionFillStyle=function(t){var e=this;return this.Vp="function"==typeof t?t(this.Vp):t,this.zp.forEach((function(t){return t.pn(e.Vp)})),this.engine.Vi(),this},i.prototype.getSeparateRegionFillStyle=function(){return this.Vp},i.prototype.setSeparateRegionStrokeStyle=function(t){var e=this;return this.Gp="function"==typeof t?t(this.Gp):t,this.zp.forEach((function(t){return t.fs(e.Gp)})),this.engine.Vi(),this},i.prototype.getSeparateRegionStrokeStyle=function(){return this.Gp},i.prototype.invalidateRegionValues=function(t){var e,i;if(!this.jp||!this.eg)return this.rg=this.rg||[],this.rg.push(t),this;var n=this.ho.D(!1),r=n instanceof W;if("function"==typeof t)for(var o=0;o0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]n&&(a=(s.max.y-s.min.y)*(o/n-1),s.min.y-=a/2,s.max.y+=a/2);e.x.Nt(s.min.x,s.max.x),e.y.Nt(s.min.y,s.max.y);var l=this.Y.x.It(),h=this.Y.y.It();this.Fi.emit("viewChange",{latitudeRange:{start:s.min.y,end:s.max.y},longitudeRange:{start:s.min.x,end:s.max.x},margin:{top:h[1],bottom:h[0],left:l[0],right:l[1]}})},i.prototype.og=function(t){for(var e,i,n=0;n0,n=e>0;return[de(Math.abs(0|t),2),"° ",de(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")+", "+[de(Math.abs(0|e),2),"° ",de(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(n?"N":"S")},YV=function(t){function e(e,i,n,r,o,s,a,l){var h=t.call(this,e,i,i.ag(n),r,o,{numeric:r.numericTickStrategy,datetime:r.dateTimeTickStrategy,time:r.timeTickStrategy},{type:"linear"})||this;return h.ug=s,h.cg=a,h.lg=l,h.dg=n,h.yn=l.pe(n).setMouseInteractions(!1).bn(r.axisTitleFont),h}return h(e,t),e.prototype.setStrokeStyle=function(t){return this.vg="function"==typeof t?t(this.vg):t,this.cg.Vi(),this},e.prototype.getStrokeStyle=function(){return this.vg},e.prototype.Zn=function(t,e,i,n){return new UV(e,t,i,n,this.dg,this.lg,this.lg,this.yg(this.ug,this.dg),this.lg.ac(this.dg).setMouseInteractions(!1))},e.prototype.Kn=function(t,e){var i=this.Sg(this.dg,t);this.mg&&!1===this.mg(t)?t.label.dispose():t.label.restore().Eo(ti(this.pg(this.dg,t.value),i.padding)).Xo(i.alignment).xn(i.rotation).Go(i.offset.x,i.offset.y),this.gg(this.dg,t.gridline,t.tickline,t)},e.prototype.setMouseInteractions=function(t){return this},e.prototype.Xu=function(){var t=this;this.On({physicalAxisSize:0});var e=this.$n((function(e,i){var n=i.tickLevel.Xn,r=.5*t.vg.thickness+n.tickLength+n.tickPadding+Math.abs(i.label.Un().Bt().y/t.dg.pi().y)+n.labelPadding;return Math.max(e,r)}),0);return this.xg(this.dg,this.vg,e),this.wg(this.dg,this.yn,e),e},e}(Wi),UV=function(t){function e(e,i,n,r,o,s,a,l,h,u){var c=t.call(this,e,i,n,r,s,o,a,o,u)||this;return c.gridline=l,c.tickline=h,l.setMouseInteractions(!1),c}return h(e,t),e.prototype.restore=function(){return t.prototype.restore.call(this),this.gridline.restore(),this.tickline.restore(),this},e.prototype.dispose=function(){return t.prototype.dispose.call(this),this.gridline.dispose(),this.tickline.dispose(),this},e.prototype.isDisposed=function(){return t.prototype.isDisposed.call(this)&&this.gridline.isDisposed()&&this.tickline.isDisposed()},e}(NO),GV=function(t){function e(e,i,n,r,o,s,a,l){var h=t.call(this,e,XV,i,n,r,o,s,a)||this;return h.kg=l,h.vg=h.Ii.polarAmplitudeAxisStyle,h.Oy=h.cg.ac(h.dg).setMouseInteractions(!1),h.setScrollStrategy(Li.expansion),h.setTickStrategy(Pi.Numeric),h.yn.pn(n.polarAmplitudeAxisTitleStyle),h.setTitle("Amplitude"),h}return h(e,t),e.prototype.oe=function(){return this.kg()},e.prototype.de=function(t,e){return RO(t,e,this.dg.y)},e.prototype.ye=function(t,e,i){var n=2*(e-t),r=this.dg.x.ci(n);return{min:t-i*r,max:e+i*r}},e.prototype.pg=function(t,e){return{x:t.Mg()?e-t.Ag().start:t.Ag().start-e,y:0}},e.prototype.yg=function(t,e){return t.uf(e)},e.prototype.gg=function(t,e,i,n){var r=n.tickLevel.Xn,o=t.Mg()?n.value-t.Ag().start:t.Ag().start-n.value;At(n.value,t.Ag().start)||At(n.value,t.Ag().end)?e.dispose():e.restore().ya(0).Sa(360).xa(void 0).ba(0).ma(o).xa(60).pn(Y).fs(r.gridStrokeStyle);var s=.5*this.vg.thickness;i.Ca({x:o,y:-s*t.pi().y}).Sa({x:o,y:-(s+r.tickLength)*t.pi().y}).ka(r.tickStyle)},e.prototype.Sg=function(t,e){var i=e.tickLevel.Xn;return{alignment:{x:0,y:1},padding:{x:0,y:t.pi().y*-(.5*this.vg.thickness+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}},e.prototype.xg=function(t,e,i){var n=t.Mg()?t.Ag().end-t.Ag().start:t.Ag().start-t.Ag().end;this.Oy.Ca({x:0,y:0}).Sa({x:n,y:0}).ka(e)},e.prototype.wg=function(t,e,i){var n=t.Mg()?(t.Ag().start+t.Ag().end)/2-t.Ag().start:t.Ag().start-(t.Ag().start+t.Ag().end)/2;e.Xo({x:0,y:1}).Eo({x:n,y:-i*t.pi().y})},e}(YV),XV={ae:function(t){return t.getAmplitudeMin()},ue:function(t){return t.getAmplitudeMax()},fe:function(t){},ag:function(t){return{getInnerStart:function(){return t.Ag().start},getInnerEnd:function(){return t.Ag().end},Nt:function(e,i){return t.Fg(e,i)},Ht:function(e,i,n,r,o){return t.y.Ht(e,i,n,r,o)}}}},WV=function(t){function e(e,i,n,r,o,s,a){var l=t.call(this,e,KV,i,n,r,o,s,a)||this;return l.vg=l.Ii.polarRadialAxisStyle,l.Tg=90,l.Cg=12,l.Bg=jV,l.Oy=l.cg.uf(l.dg).setMouseInteractions(!1),l.mg=function(t){for(var e=180*(t.value-l.dg.Lg())/Math.PI%360;e<0;)e+=360;for(;e>360;)e-=360;if(e>=0&&e<=20||e>=340&&e<=360)return!1},l.zi=void 0,l.setTickStyle(n.polarRadialAxisTickStyle),l.yn.pn(n.polarRadialAxisTitleStyle),l.setTitle("Degrees"),l.setNorth(l.Tg),l}return h(e,t),e.prototype.setTickStyle=function(t){return this.Ig="function"==typeof t?t(this.Ig):t,this.Pg(),this.cg.Vi(),this},e.prototype.getTickStyle=function(){return this.Ig},e.prototype.setTickFormattingFunction=function(t){return this.Bg=t,this.Pg(),this.cg.Vi(),this},e.prototype.getTickFormattingFunction=function(){return this.Bg},e.prototype.setClockwise=function(t){this.dg.Og(t);var e=this.Tg*Math.PI/180;return t?this.dg.Dg(e+Math.PI/2):this.dg.Dg(e-Math.PI/2),this.cg.Vi(),this},e.prototype.getClockwise=function(){return!this.dg._g()},e.prototype.setNorth=function(t){for(;t<0;)t+=360;t%=360,this.Tg=t;var e=t*Math.PI/180;return this.getClockwise()?this.dg.Dg(e+Math.PI/2):this.dg.Dg(e-Math.PI/2),this.cg.Vi(),this},e.prototype.getNorth=function(){return 180*this.dg.Lg()/Math.PI},e.prototype.setDivision=function(t){return this.Cg=t,this.Pg(),this.cg.Vi(),this},e.prototype.getDivision=function(){return this.Cg},e.prototype.oe=function(){return[]},e.prototype.de=function(t,e){return e},e.prototype.ye=function(t,e,i){return{min:t,max:e}},e.prototype.pg=function(t,e){var i=t._g()?1:-1,n=t.Lg(),r=t.Mg()?t.Ag().end-t.Ag().start:t.Ag().start-t.Ag().end;return{x:Math.cos((e-n)*i)*r,y:Math.sin((e-n)*i)*r}},e.prototype.yg=function(t,e){return t.ac(e)},e.prototype.gg=function(t,e,i,n){var r=this.Ig,o=t._g()?1:-1,s=t.Lg(),a=(n.value-s)*o,l=Math.cos(a),h=Math.sin(a),u=t.Mg()?t.Ag().end-t.Ag().start:t.Ag().start-t.Ag().end,c={x:l*u,y:h*u};e.Ca({x:0,y:0}).Sa(c);var f={x:c.x+l*r.tickLength*t.pi().x,y:c.y+h*r.tickLength*t.pi().y};i.Ca(c).Sa(f),e.ka(r.gridStrokeStyle),i.ka(r.tickStyle)},e.prototype.Sg=function(t,e){for(var i,n=this.Ig,r=t._g()?1:-1,o=t.Lg(),s=(e.value-o)*r;s<0;)s+=2*Math.PI;for(;s>=2*Math.PI;)s-=2*Math.PI;i=s>0&&s<=Math.PI?-s+Math.PI/2:-s-Math.PI/2;var a=n.tickLength+n.tickPadding,l=Math.cos(s)*a*t.pi().x,h=Math.sin(s)*a*t.pi().y;return{alignment:{x:0,y:0},padding:{x:l,y:h},rotation:180*i/Math.PI,offset:{x:l,y:h}}},e.prototype.xg=function(t,e,i){var n=t.Mg()?t.Ag().end-t.Ag().start:t.Ag().start-t.Ag().end;this.Oy.ya(0).Sa(360).ba(0).ma(n+.5*e.thickness*t.pi().x).xa(60).pn(Y).fs(e)},e.prototype.wg=function(t,e,i){var n=t.Lg(),r=this.Sg(t,{value:0+n}),o=t.Mg()?t.Ag().end-t.Ag().start:t.Ag().start-t.Ag().end;e.Xo(r.alignment).xn(r.rotation).Go(r.offset.x,r.offset.y).Eo(ti({x:o,y:0},r.padding))},e.prototype.Pg=function(){var t=this;this.Fn({Ci:[],Bi:[{Me:"Radial ticks",Ae:0,Xn:this.Ig,jn:this.Bg,Vn:function(e,i,n,r){for(var o=[],s=2*Math.PI/t.Cg,a=0;a<2*Math.PI;a+=s)o.push(a);return o},sn:{Jn:function(){},hn:function(){return!1}},Hn:void 0}],xi:jV,Cn:void 0,Bn:void 0})},e}(YV),jV=function(t,e,i){return(180*t/Math.PI).toFixed(0)},KV={ae:function(t){},ue:function(t){},fe:function(t){},ag:function(t){return{getInnerStart:function(){return 0},getInnerEnd:function(){return 2*Math.PI},Nt:function(t,e){},Ht:function(e,i,n,r,o){return t.x.Ht(e,i,n,r,o)}}}},ZV=function(t){function e(e,i,n,r,o,s){var a=t.call(this,i,n,r,s)||this;return a.Vu=e,a.dg=o,a.Uc="Sector",a.Rg=0,a.zg=1*Math.PI/2,a.Ng=void 0,a.Eg=void 0,a.Xv=a.Kc(a.Vu.uf(a.dg)),a.ho=new v(s.bandFillStyle),a.do=new v(s.bandStrokeStyle),a.setMouseInteractions(!1),a}return h(e,t),e.prototype.setAngleStart=function(t){return this.Rg=It(t,0,360),this.Vu.Vi(),this},e.prototype.getAngleStart=function(){return this.Rg},e.prototype.setAngleEnd=function(t){return this.zg=It(t,0,360),this.Vu.Vi(),this},e.prototype.getAngleEnd=function(){return this.zg},e.prototype.setAmplitudeStart=function(t){return this.Ng=t,this.Vu.Vi(),this},e.prototype.getAmplitudeStart=function(){return this.Ng},e.prototype.setAmplitudeEnd=function(t){return this.Eg=t,this.Vu.Vi(),this},e.prototype.getAmplitudeEnd=function(){return this.Eg},e.prototype.setFillStyle=function(t){return this.ho.C(t),this.Vu.Vi(),this},e.prototype.getFillStyle=function(){return this.ho.L()},e.prototype.setFillStyleHighlighted=function(t){return this.ho.I(t),this.Vu.Vi(),this},e.prototype.getFillStyleHighlighted=function(){return this.ho.O()},e.prototype.setStrokeStyle=function(t){return this.do.C(t),this.Vu.Vi(),this},e.prototype.getStrokeStyle=function(){return this.do.L()},e.prototype.setStrokeStyleHighlight=function(t){return this.do.I(t),this.Vu.Vi(),this},e.prototype.getStrokeStyleHighlight=function(){return this.do.D(!0)},e.prototype.Xu=function(){var t=this.dg.Ag(),e=180*this.dg.Lg()/Math.PI,i=void 0!==this.Ng?It(this.Ng,t.start,t.end):t.start,n=void 0!==this.Eg?It(this.Eg,t.start,t.end):t.end,r=this.dg.Mg()?i-t.start:t.start-i,o=this.dg.Mg()?n-t.start:t.start-n,s=Math.min(r,o),a=Math.max(r,o),l=this.dg._g()?1:-1,h=Math.abs(this.zg-this.Rg);this.Xv.ya((this.Rg-e)*l).Sa((this.zg-e)*l).ba(100*s/a).ma(a).pn(this.ho.D(this.Ku)).fs(this.do.D(this.Ku)).xa(Math.ceil(h/2))},e.prototype.Yc=function(t,e){},e.prototype.attach=function(e,i){return void 0===i&&(i=!0),t.prototype.attach.call(this,e,i),fe(e,this.Ii,{fill:this.ho,stroke:this.do}),this},e}(_E),qV=function(t,i,n){return n instanceof VV&&(n.getAutoCursorMode()!==e.AutoCursorModes.disabled&&!0===t||i.listeners("hover").size>1)||i.listeners("hover").size>0},QV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.Yy=!0,e.Vg=!0,e.Gg=!0,e.onHover=function(t){return e.Fi.on("hover",t)},e.offHover=function(t){return e.Fi.off(t,"hover")},e}return h(e,t),e.prototype.setAutoScrollingEnabled=function(t){return this.Yy=t,this.Ie.engine.Vi(),this},e.prototype.getAutoScrollingEnabled=function(){return this.Yy},e.prototype.qy=function(){this.Hg&&qV(this.Gg,this.Fi,this.Ie)&&this.Fi.emit("hover",this,void 0===this.Wg?this.solveNearestFromScreen(this.Hg):this.solveNearestFromSegment(this.Hg,this.Wg))},e.prototype.Xu=function(){},e.prototype.Jy=function(){},e.prototype.$y=function(t){return this.Gg=t,this},e.prototype.tS=function(){return this.Gg=this.Vg,this},e.prototype.setCursorEnabled=function(t){return this.Gg=t,this.Vg=t,this},e.prototype.getCursorEnabled=function(){return this.Gg},e.prototype.Bc=function(e,i,n){void 0===n&&(n=1),t.prototype.Bc.call(this,e,i,n),this.Wg=e,this.Hg=this.Ie.engine.clientLocation2Engine(i.x,i.y),qV(this.Gg,this.Fi,this.Ie)&&this.Fi.emit("hover",this,this.solveNearestFromSegment(this.Hg,this.Wg))},e.prototype.Ic=function(e,i){void 0===i&&(i=1),t.prototype.Ic.call(this,e,i),this.Wg=void 0,this.Hg=void 0,qV(this.Gg,this.Fi,this.Ie)&&this.Fi.emit("hover",this,void 0)},e.prototype.Oc=function(e,i){t.prototype.Oc.call(this,e,i),this.Wg=e,this.Hg=this.Ie.engine.clientLocation2Engine(i.x,i.y),qV(this.Gg,this.Fi,this.Ie)&&this.Fi.emit("hover",this,void 0===this.Wg?this.solveNearestFromScreen(this.Hg):this.solveNearestFromSegment(this.Hg,this.Wg))},e}(_E),JV=function(t){function e(e,i,n,r,o,s){var a=t.call(this,i,n,r,s)||this;return a.Vu=e,a.Ie=i,a.Wp=$V,a.scale=o,a}return h(e,t),e.prototype.getAmplitudeMin=function(){return this.jg?this.jg.min:void 0},e.prototype.getAmplitudeMax=function(){return this.jg?this.jg.max:void 0},e.prototype.setCursorResultTableFormatter=function(t){return this.Wp=t,this.Ie.engine.Vi(),this},e.prototype.getCursorResultTableFormatter=function(){return this.Wp},e}(QV),$V=function(t,e,i,n,r){return t.addRow(e.getName()).addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(n))},tz=function(t,e){var i,n,r=[],o=e.Ag().start,s=e.Ag().end,a=e.Mg(),l=e._g()?1:-1,h=e.Lg(),u=Math.abs(s-o),f=Math.min(o,s)+.001*u,p=Math.max(o,s)-.001*u;try{for(var y=c(t),d=y.next();!d.done;d=y.next()){var g=d.value,S=It(g.amplitude,f,p),v=g.angle*Math.PI/180-h,m=Math.cos(v*l)*(a?S-o:o-S),x=Math.sin(v*l)*(a?S-o:o-S),b=g.color;r.push({x:m,y:x,color:b})}}catch(t){i={error:t}}finally{try{d&&!d.done&&(n=y.return)&&n.call(y)}finally{if(i)throw i.error}}return r},ez=function(t){var e,i,n={min:be,max:ke};try{for(var r=c(t),o=r.next();!o.done;o=r.next()){var s=o.value;n.min=Math.min(n.min,s.amplitude),n.max=Math.max(n.max,s.amplitude)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return n},iz=function(t){return t.slice().map((function(t){return t.angle>=0&&t.angle<=360?t:u(u({},t),{angle:t.angle%360})}))},nz=function(t,e){var i=ui(t);for(e._g()||(i*=-1),i+=180*e.Lg()/Math.PI;i<0;)i+=360;i%=360;var n=Je(t),r=e.Ag(),o=Math.abs(r.end-r.start);return{angle:i,amplitude:Xn(r.start,r.end,n/o)}},rz=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,r,o,s)||this;a.Uc="Line Series",a.Ug=[],a.Yg=!1,a.Xg=!1;var l=a.Ie.getSeries().length;return a.wa=new v(ge(a.Ii.seriesStrokeStyle,l)),a.Zg=a.Kc(e.ky(o,void 0,[u_.UserSeries]).ka(a.wa.D(a.Ku))).fh(DB.Nearest),a}return h(e,t),e.prototype.setData=function(t){return this.Ug=iz(t),this.Yg=!0,this.jg=ez(this.Ug),this.Vu.Vi(),this},e.prototype.setStrokeStyle=function(t){var e,i;this.wa.C(t);var n=this.wa.D(this.Ku);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.ka(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return this.Vu.Vi(),this},e.prototype.getStrokeStyle=function(){return this.wa.L()},e.prototype.setStrokeStyleHighlight=function(t){var e,i;if(this.wa.I(t),this.getHighlighted()){var n=this.wa.D(!0);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.ka(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}return this.Vu.Vi(),this},e.prototype.getStrokeStyleHighlight=function(){return this.wa.D(!0)},e.prototype.setConnectDataAutomaticallyEnabled=function(t){return this.Xg=t,this.Vu.Vi(),this},e.prototype.getConnectDataAutomaticallyEnabled=function(){return this.Xg},e.prototype.he=function(){return this.Yy&&this.Ug.length>0},e.prototype.Yc=function(t,e){t.ka(this.wa.D(e)),this.Vu.Vi()},e.prototype.solveNearestFromScreen=function(t){return this.solveNearestFromSegment(t,this.Zg)},e.prototype.solveNearestFromSegment=function(t,e){var i=e.Kg(t);if(i){var n=nz(i,this.scale),r=n.angle,o=n.amplitude;return CV(i,this.scale,this.Wp(new dV,this,r,o,this.Ie.getAmplitudeAxis().formatValue).vc(),this,this.wa.L().getFillStyle())}},e.prototype.Xu=function(){if(this.Yg||this.scale.qg()){var t=tz(this.Ug,this.scale),e=Ne(t);this.Xg?(t.push(u({},t[0])),this.Zg.Kh(!0)):this.Zg.Kh(!1),this.Zg.bh().gh(t).eo(e),this.Yg=!1,this.Zg.Un()}},e.prototype.attach=function(e,i){return void 0===i&&(i=!0),t.prototype.attach.call(this,e,i),fe(e,this.Ii,{stroke:this.wa}),this},e}(JV),oz=function(t){function i(i,n,r,o,s,a){var l=t.call(this,i,n,r,o,s,a)||this;l.Uc="Point Line Series",l.Ug=[],l.Yg=!1,l.Xg=!1,l.Jg=3,l.Mo=0,l.Qg=e.PointShape.Circle;var h=l.Ie.getSeries().length;return l.ho=new v(ge(l.Ii.seriesPointFillStyle,h)),l.wa=new v(ge(l.Ii.seriesStrokeStyle,h)),l.Zg=l.Kc(i.ky(s,void 0,[u_.UserSeries]).ka(l.wa.D(l.Ku))).fh(DB.Nearest),l.$g=l.Kc(i.dS(s).pn(l.ho.D(l.Ku)).yh(l.Qg).wt(l.Jg)).fh(DB.Nearest),l}return h(i,t),i.prototype.setData=function(t){return this.Ug=iz(t),this.Yg=!0,this.jg=ez(this.Ug),this.Vu.Vi(),this},i.prototype.setStrokeStyle=function(t){this.wa.C(t);var e=this.wa.D(this.Ku);return this.Zg.ka(e),this.Vu.Vi(),this},i.prototype.getStrokeStyle=function(){return this.wa.L()},i.prototype.setStrokeStyleHighlight=function(t){if(this.wa.I(t),this.getHighlighted()){var e=this.wa.D(!0);this.Zg.ka(e)}return this.Vu.Vi(),this},i.prototype.getStrokeStyleHighlight=function(){return this.wa.D(!0)},i.prototype.setPointFillStyle=function(t){this.ho.C(t);var e=this.ho.D(this.Ku);return this.$g.pn(e),this.Vu.Vi(),this},i.prototype.getPointFillStyle=function(){return this.ho.L()},i.prototype.setPointFillStyleHighlight=function(t){if(this.ho.I(t),this.getHighlighted()){var e=this.ho.D(!0);this.$g.pn(e)}return this.Vu.Vi(),this},i.prototype.getPointFillStyleHighlight=function(){return this.ho.D(!0)},i.prototype.setPointSize=function(t){return this.Jg=t,this.$g.wt(t),this.Vu.Vi(),this},i.prototype.getPointSize=function(){return this.Jg},i.prototype.setPointShape=function(t){return this.Qg=t,this.$g.yh(this.Qg),this},i.prototype.getPointShape=function(){return this.Qg},i.prototype.setPointRotation=function(t){return this.Mo=t,this.$g.xn(t),this.Vu.Vi(),this},i.prototype.getPointRotation=function(){return this.Mo},i.prototype.setConnectDataAutomaticallyEnabled=function(t){return this.Xg=t,this.Vu.Vi(),this},i.prototype.getConnectDataAutomaticallyEnabled=function(){return this.Xg},i.prototype.he=function(){return this.Yy&&this.Ug.length>0},i.prototype.Yc=function(t,e){t instanceof xE?t.ka(this.wa.D(e)):t.pn(this.ho.D(e)),this.Vu.Vi()},i.prototype.solveNearestFromScreen=function(t){return this.solveNearestFromSegment(t,this.Zg)},i.prototype.solveNearestFromSegment=function(t,e){var i=e instanceof lE?e.tb(t):e.Kg(t);if(i){var n=nz(i,this.scale),r=n.angle,o=n.amplitude;return CV(i,this.scale,this.Wp(new dV,this,r,o,this.Ie.getAmplitudeAxis().formatValue).vc(),this,"color"in i&&this.ho.L()instanceof X?new G({color:i.color}):this.ho.L())}},i.prototype.Xu=function(){if(this.Yg||this.scale.qg()){var t=tz(this.Ug,this.scale),e=Ne(t);this.Xg?(t.push(u({},t[0])),this.Zg.Kh(!0)):this.Zg.Kh(!1),this.Zg.bh().gh(t).eo(e),this.$g.bh().gh(t).eo(e),this.Yg=!1,this.Zg.Un(),this.$g.Un()}},i}(JV),sz=function(t){function i(i,n,r,o,s,a){var l=t.call(this,i,n,r,o,s,a)||this;l.Uc="Point Series",l.Ug=[],l.Yg=!1,l.Jg=3,l.Mo=0,l.Qg=e.PointShape.Circle;var h=l.Ie.getSeries().length;return l.ho=new v(ge(l.Ii.seriesPointFillStyle,h)),l.$g=l.Kc(i.dS(s).pn(l.ho.D(l.Ku)).yh(l.Qg).wt(l.Jg)).fh(DB.Nearest),l}return h(i,t),i.prototype.setData=function(t){return this.Ug=iz(t),this.Yg=!0,this.jg=ez(this.Ug),this.Vu.Vi(),this},i.prototype.setPointFillStyle=function(t){var e,i;this.ho.C(t);var n=this.ho.D(this.Ku);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.pn(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return this.Vu.Vi(),this},i.prototype.getPointFillStyle=function(){return this.ho.L()},i.prototype.setPointFillStyleHighlight=function(t){var e,i;if(this.ho.I(t),this.getHighlighted()){var n=this.ho.D(!0);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.pn(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}return this.Vu.Vi(),this},i.prototype.getPointFillStyleHighlight=function(){return this.ho.D(!0)},i.prototype.setPointSize=function(t){var e,i;this.Jg=t;try{for(var n=c(this.kc),r=n.next();!r.done;r=n.next())r.value.wt(t)}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return this.Vu.Vi(),this},i.prototype.getPointSize=function(){return this.Jg},i.prototype.setPointShape=function(t){var e,i;this.Qg=t;try{for(var n=c(this.kc),r=n.next();!r.done;r=n.next())r.value.yh(this.Qg)}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return this},i.prototype.getPointShape=function(){return this.Qg},i.prototype.setPointRotation=function(t){var e,i;this.Mo=t;try{for(var n=c(this.kc),r=n.next();!r.done;r=n.next())r.value.xn(t)}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return this.Vu.Vi(),this},i.prototype.getPointRotation=function(){return this.Mo},i.prototype.he=function(){return this.Yy&&this.Ug.length>0},i.prototype.Yc=function(t,e){t.pn(this.ho.D(e)),this.Vu.Vi()},i.prototype.solveNearestFromScreen=function(t){var e=this.$g.tb(t);if(e){var i=nz(e,this.scale),n=i.angle,r=i.amplitude;return CV(e,this.scale,this.Wp(new dV,this,n,r,this.Ie.getAmplitudeAxis().formatValue).vc(),this,"color"in e&&this.ho.L()instanceof X?new G({color:e.color}):this.ho.L())}},i.prototype.solveNearestFromSegment=function(t,e){return this.solveNearestFromScreen(t)},i.prototype.Xu=function(){if(this.Yg||this.scale.qg()){var t=tz(this.Ug,this.scale),e=Ne(t);this.$g.bh().gh(t).eo(e),this.Yg=!1,this.$g.Un()}},i.prototype.attach=function(e,i){return void 0===i&&(i=!0),t.prototype.attach.call(this,e,i),fe(e,this.Ii,{fill:this.ho}),this},i}(JV),az=function(){function t(t,e,i,n,r){this.Ie=t,this.ib=e,this.nb=i,this.SS=n,this.eb=!1,this.$o=r}return t.prototype.setGeometry=function(t){return this.rb=t,this.eb=!0,this.Ie.engine.Vi(),this},t.prototype.getGeometry=function(){return this.rb},t.prototype.setMouseInteractions=function(t){return this.$o.setMouseInteractions(t),this},t.prototype.dispose=function(){return this.$o.dispose(),this.ib(this),this},t.prototype.isDisposed=function(){return this.$o.isDisposed()},t.prototype.restore=function(){return this.$o.restore(),this.nb(this),this},t}(),lz=function(t,e,i){var n=e.Y,r=i.Y,o=(t.x-n.getInnerStart())/(n.getInnerEnd()-n.getInnerStart()),s=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.Dd&&(o=1-o),1===e.Dd&&(s=1-s),m(s,o)},hz=function(t){function e(e,i,n,r,o,s,a,l,h){var u=t.call(this,e,i,UO(n.Y,r.Y),o,s,h)||this;return u.axisX=n,u.axisY=r,u.sb=a,u.ob=l,u.Ii=h,u.hb=u.axisX.rv(!1,u.sb).setMouseInteractions(!1).setAllocatesAxisSpace(!1),u.ab=!1,u.ub=u.axisY.rv(!1,u.ob).setMouseInteractions(!1).setAllocatesAxisSpace(!1),u.cb=!1,u.fb=!0,u.lb=!0,u.vb=!1,u.yb=!1,u.setGridStrokeYStyle=function(t){return u.ub.setGridStrokeStyle(t),u},u.getGridStrokeYStyle=function(){return u.ub.getGridStrokeStyle()},u}return h(e,t),e.prototype.pointAt=function(e){return t.prototype.pointAt.call(this,e),this.setPosition(et(e.location,e.scale,this.scale)),this},e.prototype.setPosition=function(e){t.prototype.setPosition.call(this,e),this.hb.setValue(e.x),this.ub.setValue(e.y);var i=lz(m(this.hb.getValue(),this.ub.getValue()),this.axisX,this.axisY);return this.hb.setGridStrokeLength(this.vb?i.x:1),this.ub.setGridStrokeLength(this.yb?i.y:1),this},e.prototype.Xu=function(){!this.isDisposed()&&this.vp?(this.hb.restore(),this.ub.restore()):(this.hb.dispose(),this.ub.dispose());var e=lz(m(this.hb.getValue(),this.ub.getValue()),this.axisX,this.axisY);return this.hb.setGridStrokeLength(this.vb?e.x:1),this.ub.setGridStrokeLength(this.yb?e.y:1),t.prototype.Xu.call(this)},e.prototype.dispose=function(){return t.prototype.dispose.call(this),this.hb.dispose(),this.ub.dispose(),this},e.prototype.restore=function(){return t.prototype.restore.call(this),this.hb.restore(),this.ub.restore(),this},e.prototype.setGridStrokeXCut=function(t){return this.vb=t,this.Vu.Vi(),this},e.prototype.getGridStrokeXCut=function(){return this.vb},e.prototype.setGridStrokeYCut=function(t){return this.yb=t,this.Vu.Vi(),this},e.prototype.getGridStrokeYCut=function(){return this.yb},e.prototype.setGridStrokeXStyle=function(t){return this.hb.setGridStrokeStyle(t),this},e.prototype.getGridStrokeXStyle=function(){return this.hb.getGridStrokeStyle()},e.prototype.disposeTickMarkerX=function(){return this.hb.disposeMarker(),this.Vu.Vi(),this},e.prototype.restoreTickMarkerX=function(){return this.hb.restoreMarker(),this.Vu.Vi(),this},e.prototype.isDisposedTickMarkerX=function(){return this.hb.isDisposedMarker()},e.prototype.disposeTickMarkerY=function(){return this.ub.disposeMarker(),this.Vu.Vi(),this},e.prototype.restoreTickMarkerY=function(){return this.ub.restoreMarker(),this.Vu.Vi(),this},e.prototype.isDisposedTickMarkerY=function(){return this.ub.isDisposedMarker()},e.prototype.setTickMarkerX=function(t){return this.hb.setMarker(t),this},e.prototype.setTickMarkerY=function(t){return this.ub.setMarker(t),this},e.prototype.getTickMarkerX=function(){return this.hb.getMarker()},e.prototype.getTickMarkerY=function(){return this.ub.getMarker()},e}(mV),uz=function(t){function e(e,i,n,r,o,s,a,l){var h=t.call(this,e,i,n,r,o,l)||this;return h.cp=r,h.fp=o,h.sb=s,h.ob=a,h.Ii=l,h.vb=!1,h.yb=!1,h.Sb=h.Ii.customTickGridStrokeStyle,h.mb=h.Ii.customTickGridStrokeStyle,h.pb=!1,h.gb=!1,h.bb=new Map,h.xb=new Map,h.wb=!1,h.kb=!1,h.Ii.pointMarkerHorizontalGridStrokeStyle&&h.setGridStrokeXStyle(h.Ii.pointMarkerHorizontalGridStrokeStyle),h.Ii.pointMarkerVerticalGridStrokeStyle&&h.setGridStrokeYStyle(h.Ii.pointMarkerVerticalGridStrokeStyle),h}return h(e,t),e.prototype.Xu=function(){return this.Mb&&this.Ab&&(!this.isDisposed()&&this.vp?(this.Ab.restore(),this.Mb.restore()):(this.Ab.dispose(),this.Mb.dispose())),t.prototype.Xu.call(this)},e.prototype.restore=function(){return t.prototype.restore.call(this),this.Mb&&this.Mb.restore(),this.Ab&&this.Ab.restore(),this},e.prototype.dispose=function(){return this.isDisposed()||(t.prototype.dispose.call(this),this.Mb&&this.Mb.dispose(),this.Ab&&this.Ab.dispose()),this},e.prototype.pointAt=function(e){var i=e.location,n=e.series,r=n.axisX,o=n.axisY,s=this.$i(r,!0),a=this.$i(o,!1);s!==this.Mb&&this.Mb&&(this.Mb.dispose(),s.restore()),a!==this.Ab&&this.Ab&&(this.Ab.dispose(),a.restore()),s.setValue(i.x),a.setValue(i.y);var l=lz(m(i.x,i.y),r,o);return s.setGridStrokeLength(this.vb?l.x:1),a.setGridStrokeLength(this.yb?l.y:1),this.Mb=s,this.Ab=a,t.prototype.pointAt.call(this,e)},e.prototype.pp=function(e){if(t.prototype.pp.call(this,e),e){var i=function(t){return t.setTextFillStyle(e)};this.Mb&&this.pb&&this.Mb.setMarker(i),this.Ab&&this.gb&&this.Ab.setMarker(i)}},e.prototype.$i=function(t,e){var i=(e?this.bb:this.xb).get(t);return i||(e?(i=t.rv(!1,this.sb),this.bb.set(t,i)):(i=t.rv(!1,this.ob),this.xb.set(t,i)),this.Yn(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i},e.prototype.Yn=function(t,e){var i=e?this.Sb:this.mb;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.wb:this.kb)?t.disposeMarker():t.restoreMarker(),t},e.prototype.setGridStrokeXCut=function(t){return this.vb=t,this.Vu.Vi(),this},e.prototype.getGridStrokeXCut=function(){return this.vb},e.prototype.setGridStrokeYCut=function(t){return this.yb=t,this.Vu.Vi(),this},e.prototype.getGridStrokeYCut=function(){return this.yb},e.prototype.setGridStrokeXStyle=function(t){var e=this;return this.Sb=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.bb.forEach((function(t){return t.setGridStrokeStyle(e.Sb)})),this},e.prototype.getGridStrokeXStyle=function(){return this.Sb},e.prototype.setGridStrokeYStyle=function(t){var e=this;return this.mb=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.xb.forEach((function(t){return t.setGridStrokeStyle(e.mb)})),this},e.prototype.getGridStrokeYStyle=function(){return this.mb},e.prototype.disposeTickMarkerX=function(){return this.bb.forEach((function(t){return t.disposeMarker()})),this.wb=!0,this},e.prototype.restoreTickMarkerX=function(){return this.bb.forEach((function(t){return t.restoreMarker()})),this.wb=!1,this},e.prototype.isDisposedTickMarkerX=function(){return this.wb},e.prototype.disposeTickMarkerY=function(){return this.xb.forEach((function(t){return t.disposeMarker()})),this.kb=!0,this},e.prototype.restoreTickMarkerY=function(){return this.xb.forEach((function(t){return t.restoreMarker()})),this.kb=!1,this},e.prototype.isDisposedTickMarkerY=function(){return this.kb},e.prototype.setTickMarkerX=function(t){return this.bb.forEach((function(e){return e.setMarker(t)})),this.sb=this.sb.addStyler(t),this.Vu.Vi(),this},e.prototype.setTickMarkerY=function(t){return this.xb.forEach((function(e){return e.setMarker(t)})),this.ob=this.ob.addStyler(t),this.Vu.Vi(),this},e.prototype.setTickMarkerXAutoTextStyle=function(t){return this.pb=t,this.Vu.Vi(),this},e.prototype.getTickMarkerXAutoTextStyle=function(){return this.pb},e.prototype.setTickMarkerYAutoTextStyle=function(t){return this.gb=t,this.Vu.Vi(),this},e.prototype.getTickMarkerYAutoTextStyle=function(){return this.gb},e}(vV),cz=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,o)||this;return s.cp=e,s.fp=i,s.sb=n,s.ob=r,s.gp=o,s}return h(e,t),e}(xV),fz=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.xp=function(t,e,n,r){return i.bp(new uz(t,e,n,i.cp,i.fp,i.sb,i.ob,r))},i.addStyler=function(t){return new e(i.cp,i.fp,i.sb,i.ob,i.gp.map((function(t){return t})).concat(t))},i.setPointMarker=function(t){return new e(t,i.fp,i.sb,i.ob,i.gp.map((function(t){return t})))},i.setResultTableBackground=function(t){return new e(i.cp,t,i.sb,i.ob,i.gp.map((function(t){return t})))},i}return h(e,t),e}(cz),pz=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.wp=function(t,e,n,r,o){return i.bp(new hz(t,e,n,r,i.cp,i.fp,i.sb,i.ob,o))},i.addStyler=function(t){return new e(i.cp,i.fp,i.sb,i.ob,i.gp.map((function(t){return t})).concat(t))},i.setPointMarker=function(t){return new e(t,i.fp,i.sb,i.ob,i.gp.map((function(t){return t})))},i.setResultTableBackground=function(t){return new e(i.cp,t,i.sb,i.ob,i.gp.map((function(t){return t})))},i}return h(e,t),e}(cz),yz=MV,dz=new fz(eO,eO,VO.PointableTextBox,VO.PointableTextBox,[function(t){wV(t)}]),gz=new pz(nO,eO,VO.PointableTextBox,VO.PointableTextBox,[yz]),Sz=function(t,i,n){switch(t){case e.UIVisibilityModes.always:return!0;case e.UIVisibilityModes.never:return!1;case e.UIVisibilityModes.whenDragged:return n;case e.UIVisibilityModes.whenHovered:return i&&!n;case e.UIVisibilityModes.whenHoveredOrDragged:return n||i;case e.UIVisibilityModes.whenNotDragged:return!n;default:return!1}},vz=function(t,e){return Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd())},mz=function(){function t(t,i,n,o,s,a){var l=this;this.Vu=t,this.renderingScale=i,this.scale=n,this.tg=o,this.Fb=s,this.Tb=a,this.Cb=e.UIVisibilityModes.always,this.Bb=e.UIVisibilityModes.always,this.Is=!0,this.Lb=!1,this.Ib=!1,this.bo=m(0,0),this.Gu=e.UIDraggingModes.draggable,this.Hu=void 0,this.Fi=new r.Eventer,this.Pb=function(t,i,n){l.Lb=!0,l.Vu.Vi();var r=l.Gu===e.UIDraggingModes.notDraggable?l.Gu:n||l.Gu;l.Hu=l.Vu.As.Sr(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.Ob=function(){l.Lb=!1,l.Vu.Vi(),l.Vu.As.pr(l.Hu)},this.Db=function(t,e){l.Ib=!0,ee(e),l.Vu.Vi()},this._b=function(t,i){if(l.Gu!==e.UIDraggingModes.notDraggable){var n=i||l.Gu,r=et(l.Vu.As.Lr(t.x,t.y),l.Vu.As.Y,l.scale),o=m(n!==e.UIDraggingModes.onlyVertical?vz(r.x,l.scale.x):l.bo.x,n!==e.UIDraggingModes.onlyHorizontal?vz(r.y,l.scale.y):l.bo.y);return l.setPosition(o),!0}return!1},this.Rb=function(t,e){l.Ib=!1,ee(e),l.Vu.Vi()};var h=o.getPointMarker().setMouseInteractions(!0);h.onMouseEnter(this.Pb),h.onMouseLeave(this.Ob),h.onMouseDragStart(this.Db),h.onMouseDrag((function(t,e){return l._b(m(e.clientX,e.clientY))&&ee(e)})),h.onMouseDragStop(this.Rb),h.onTouchStart(this.Db),h.onTouchMove((function(t,e){return l._b(m(e.clientX,e.clientY))&&ee(e)})),h.onTouchEnd(this.Rb),o.getResultTable().setMouseInteractions(!0),this.setPosition(this.bo)}return t.prototype.setPosition=function(t){return this.bo=t,this.tg.setPosition(t),this.Fi.emit("positionChange",this,this.bo),this},t.prototype.getPosition=function(){return this.bo},t.prototype.onPositionChange=function(t){return this.Fi.on("positionChange",t)},t.prototype.offPositionChange=function(t){return this.Fi.off(t,"positionChange")},t.prototype.setPointMarkerVisibility=function(t){return this.Cb=t,this.Vu.Vi(),this},t.prototype.getPointMarkerVisibility=function(){return this.Cb},t.prototype.setResultTableVisibility=function(t){return this.Bb=t,this.Vu.Vi(),this},t.prototype.getResultTableVisibility=function(){return this.Bb},t.prototype.setMouseInteractions=function(t){return this.Is=t,this.tg.getPointMarker().setMouseInteractions(t),this.tg.getResultTable().setMouseInteractions(t),this},t.prototype.getMouseInteractions=function(){return this.Is},t.prototype.setAutoFitStrategy=function(t){return this.tg.setAutoFitStrategy(t),this},t.prototype.getAutoFitStrategy=function(){return this.tg.getAutoFitStrategy()},t.prototype.isAttached=function(){return!0},t.prototype.Xu=function(){var t=this.isAttached();return Sz(this.Cb,this.Lb,this.Ib)?this.tg.restorePointMarker():this.tg.disposePointMarker(),t&&Sz(this.Bb,this.Lb,this.Ib)?this.tg.restoreResultTable():this.tg.disposeResultTable(),this.tg.Xu(),this},t.prototype.Un=function(){return this.tg.Un(),this},t.prototype.pointAt=function(t){return this.tg.pointAt(t),this},t.prototype.dispose=function(){return this.Fb(this),this.tg.dispose(),this},t.prototype.restore=function(){return this.Tb(this),this.tg.restore(),this},t.prototype.isDisposed=function(){return this.tg.isDisposed()},t.prototype.setPointMarker=function(t){return this.tg.setPointMarker(t),this},t.prototype.getPointMarker=function(){return this.tg.getPointMarker()},t.prototype.setResultTable=function(t){return this.tg.setResultTable(t),this},t.prototype.getResultTable=function(){return this.tg.getResultTable()},t.prototype.setDraggingMode=function(t){return void 0===t&&(t=e.UIDraggingModes.notDraggable),this.Gu=t,this.Vu.Vi(),this},t.prototype.getDraggingMode=function(){return this.Gu},t}(),xz=function(t){function e(e,i,n,r,o,s,a){var l=t.call(this,e,i,n,r.wp(e,i,n,a),o,s)||this;return l.Vu=e,l.Fb=o,l.Tb=s,l.Ii=a,l}return h(e,t),e}(mz),bz=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e}(function(t){function i(i,n,r,o,s,a,l,h){var u=t.call(this,i,n,UO(r.Y,o.Y),s.wp(i,n,r,o,h),a,l)||this;u.Vu=i,u.axisX=r,u.axisY=o,u.Fb=a,u.Tb=l,u.zb=e.UIVisibilityModes.always,u.Nb=e.UIVisibilityModes.always,u.Eb=e.UIVisibilityModes.always,u.Vb=e.UIVisibilityModes.always,u.gridStrokeStyleX=u.tg.getGridStrokeXStyle(),u.gridStrokeStyleY=u.tg.getGridStrokeYStyle(),u.Ii=h;var c=u.tg.getTickMarkerX().setMouseInteractions(!0);c.onMouseEnter((function(t,i){return u.Pb(t,i,e.UIDraggingModes.onlyHorizontal)})),c.onMouseLeave(u.Ob),c.onMouseDragStart(u.Db),c.onMouseDrag((function(t,i){return u._b(m(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&ee(i)})),c.onMouseDragStop(u.Rb),c.onTouchStart(u.Db),c.onTouchMove((function(t,i){return u._b(m(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&ee(i)}));var f=u.tg.getTickMarkerY().setMouseInteractions(!0);return f.onMouseEnter((function(t,i){return u.Pb(t,i,e.UIDraggingModes.onlyVertical)})),f.onMouseLeave(u.Ob),f.onMouseDragStart(u.Db),f.onMouseDrag((function(t,i){return u._b(m(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&ee(i)})),f.onMouseDragStop(u.Rb),f.onTouchStart(u.Db),f.onTouchMove((function(t,i){return u._b(m(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&ee(i)})),h.pointMarkerTextFillStyle&&(f.setTextFillStyle(h.pointMarkerTextFillStyle),c.setTextFillStyle(h.pointMarkerTextFillStyle)),u}return h(i,t),i.prototype.Xu=function(){var e=this.isAttached();return!this.isDisposed()&&e&&Sz(this.Eb,this.Lb,this.Ib)?this.tg.restoreTickMarkerX():this.tg.disposeTickMarkerX(),!this.isDisposed()&&e&&Sz(this.Vb,this.Lb,this.Ib)?this.tg.restoreTickMarkerY():this.tg.disposeTickMarkerY(),this.tg.setGridStrokeXStyle(!this.isDisposed()&&e&&Sz(this.zb,this.Lb,this.Ib)?this.gridStrokeStyleX:Q),this.tg.setGridStrokeYStyle(!this.isDisposed()&&e&&Sz(this.Nb,this.Lb,this.Ib)?this.gridStrokeStyleY:Q),t.prototype.Xu.call(this)},i.prototype.setGridStrokeXVisibility=function(t){return this.zb=t,this.Vu.Vi(),this},i.prototype.getGridStrokeXVisibility=function(){return this.zb},i.prototype.setGridStrokeYVisibility=function(t){return this.Nb=t,this.Vu.Vi(),this},i.prototype.getGridStrokeYVisibility=function(){return this.Nb},i.prototype.setTickMarkerXVisibility=function(t){return this.Eb=t,this.Vu.Vi(),this},i.prototype.getTickMarkerXVisibility=function(){return this.Eb},i.prototype.setTickMarkerYVisibility=function(t){return this.Vb=t,this.Vu.Vi(),this},i.prototype.getTickMarkerYVisibility=function(){return this.Vb},i.prototype.setGridStrokeXCut=function(t){return this.tg.setGridStrokeXCut(t),this},i.prototype.getGridStrokeXCut=function(){return this.tg.getGridStrokeXCut()},i.prototype.setGridStrokeYCut=function(t){return this.tg.setGridStrokeYCut(t),this},i.prototype.getGridStrokeYCut=function(){return this.tg.getGridStrokeYCut()},i.prototype.setGridStrokeXStyle=function(t){return this.gridStrokeStyleX=t instanceof Z?t:t(this.gridStrokeStyleX),this},i.prototype.getGridStrokeXStyle=function(){return this.tg.getGridStrokeXStyle()},i.prototype.setGridStrokeYStyle=function(t){return this.gridStrokeStyleY=t instanceof Z?t:t(this.gridStrokeStyleY),this},i.prototype.getGridStrokeYStyle=function(){return this.tg.getGridStrokeYStyle()},i.prototype.setTickMarkerX=function(t){return this.tg.setTickMarkerX(t),this},i.prototype.getTickMarkerX=function(){return this.tg.getTickMarkerX()},i.prototype.setTickMarkerY=function(t){return this.tg.setTickMarkerY(t),this},i.prototype.getTickMarkerY=function(){return this.tg.getTickMarkerY()},i.prototype.setMouseInteractions=function(e){return t.prototype.setMouseInteractions.call(this,e),this.tg.getTickMarkerX().setMouseInteractions(e),this.tg.getTickMarkerY().setMouseInteractions(e),this},i}(mz)),kz=function(t){function e(e,i,n,r,o,s,a){var l=t.call(this,e,i,n.axisX,n.axisY,r,o,s,a)||this;return l.Vu=e,l.owningSeries=n,l.Fb=o,l.Tb=s,l.Gb=!1,l.Ii=a,l}return h(e,t),e.prototype.setPosition=function(e){return t.prototype.setPosition.call(this,e),this.Gb=!1,this.Vu.Vi(),this},e.prototype.Un=function(){if(!this.Gb){var e=this.owningSeries.solveNearestFromScreen(et(this.bo,this.scale,this.Vu.As.Y));e?(this.bo=et(e.location,this.owningSeries.scale,this.scale),this.tg.pointAt(e),this.Gb=!0):this.tg.setPosition(this.bo)}return t.prototype.Un.call(this)},e.prototype.isAttached=function(){return this.Gb},e}(bz),wz=function(t){function e(e,i,n,r,o,s,a,l,h,u){var c=t.call(this,e,i,n,u)||this;return c.chart=e,c.Vu=r,c.axisX=o,c.axisY=s,c.axisXAttachHandler=a,c.axisYAttachHandler=l,c.pv=h,c.Hb=[],c.addMarker=function(t){void 0===t&&(t=gz);var e=new kz(c.pv(),c.Ie.uiScale,c,t,c.removeMarker,c.restoreMarker,c.Ii);return c.Hb.push(e),e},c.removeMarker=function(t){var e=c.Hb.indexOf(t);-1!==e&&c.Hb.splice(e,1)},c.restoreMarker=function(t){c.Hb.includes(t)||c.Hb.push(t)},c.Ii=u,c.scale=UO(o.Y,s.Y),c.Wb(c.scale),c.attacheAxis(),c}return h(e,t),e.prototype.attacheAxis=function(){this.jb=this.axisXAttachHandler(this),this.Ub=this.axisYAttachHandler(this)},e.prototype.Xu=function(){t.prototype.Xu.call(this);for(var e=0;e0){var a=t.slice(o,s);o+=s,n(a,!0)}}for(;o0){var e=this.La[this.La.length-1];this.Kb={x:e.x,y:e.y}}return this},i.prototype.addArrayX=function(t,e,i){void 0===e&&(e=1);var n=i;return n||(n=this.Kb?this.Kb.y+e:0),this.add(function(t,e,i){void 0===e&&(e=1);for(var n=void 0!==i?i:0,r=new Array(t.length),o=0;o0?t:0,this.Vu.Vi(),this},i.prototype.getMaxPointCount=function(){return this.Zb>0?this.Zb:void 0},i.prototype.getPointAmount=function(){return this.kc.reduce((function(t,e){return t+e.xh()+e.wh()}),this.La.length)},i.prototype.clear=function(){this.eS=void 0;for(var t=0;t0},i.prototype.getXMax=function(){return this.Xb.getXMax(this.kc,this.eS)||0},i.prototype.getXMin=function(){return this.Xb.getXMin(this.kc,this.eS)||0},i.prototype.getYMax=function(){return this.Xb.getYMax(this.kc,this.eS)||0},i.prototype.getYMin=function(){return this.Xb.getYMin(this.kc,this.eS)||0},i.prototype.Ay=function(){var t,e,i=m(0,0);try{for(var n=c(this.kc),r=n.next();!r.done;r=n.next()){var o=r.value;i.x=Math.max(i.x,o.Ph()),i.y=Math.max(i.y,o.Oh())}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return i},i.prototype.qb=function(t,e,i,n){this.Xb.qb(t,e,i,n,this.scale)},i.prototype.qy=function(){t.prototype.qy.call(this);var e=this.kc.length;this.Jb&&this.qb(this.kc,this.getPointAmount(),this.Jb,this.Zb),e!==this.kc.length&&this.Yb()},i.prototype.Xu=function(){var e,i;t.prototype.Xu.call(this);var n=this.getBoundaries();this.La.length>0&&(this.nS(this.La),this.La=[]);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.eo(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return t.prototype.Xu.call(this)},i.prototype.Jy=function(){this.eS=void 0,this.La.length=0},i.prototype.iS=function(t){0!==t.length&&(this.eS?this.eS=He(this.eS,Ne(t)):this.eS=Ne(t),this.Fi.emit("dataAdd",this,t,this.eS),this.La=ce(this.La,t,{canReturnB:!1}),this.Vu.Vi())},i.prototype.Qb=function(){return Az(this.kc)},i.prototype.$b=function(t){return this.Fi.on("dataAdd",t)},i.prototype.tx=function(t){return this.Fi.off(t)},i.prototype.ix=function(t){return this.Fi.on("dataClear",t)},i.prototype.nx=function(t){return this.Fi.off(t)},i}(wz),Cz=function(t,e,i,n){for(var r,o,s=Number.MAX_VALUE,a=0;a=0&&a.sx.splice(e,1),a.Vu.Vi()},a.hx=function(t){a.sx.indexOf(t)<0&&a.sx.push(t),a.Vu.Vi()};var l=a.Ie.getSeries().length;return a.ho=new v(ge(a.Ii.mountainsFillStyle,l)),a.do=new v(ge(a.Ii.mountainsStrokeStyle,l)),a}return h(e,t),e.prototype.addPolygon=function(){var t=new az(this.Ie,this.ox,this.hx,this,this.ux());return this.sx.push(t),t},e.prototype.setFillStyle=function(t){var e,i;this.ho.C(t);var n=this.ho.D(this.Ku);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.pn(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return this.Vu.Vi(),this},e.prototype.getFillStyle=function(){return this.ho.L()},e.prototype.setFillStyleHighlight=function(t){var e,i;if(this.ho.I(t),this.getHighlighted()){var n=this.ho.D(!0);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.pn(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}return this.Vu.Vi(),this},e.prototype.getFillStyleHighlight=function(){return this.ho.D(!0)},e.prototype.setStrokeStyle=function(t){var e,i;this.do.C(t);var n=this.do.D(this.Ku);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.fs(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return this.Vu.Vi(),this},e.prototype.getStrokeStyle=function(){return this.do.L()},e.prototype.setStrokeStyleHighlight=function(t){var e,i;if(this.do.I(t),this.getHighlighted()){var n=this.do.D(!0);try{for(var r=c(this.kc),o=r.next();!o.done;o=r.next())o.value.fs(n)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}return this.Vu.Vi(),this},e.prototype.getStrokeStyleHighlight=function(){return this.do.D(!0)},e.prototype.he=function(){return this.Yy&&void 0!==this.sx.find((function(t){return void 0!==t.lx}))},e.prototype.Xu=function(){var t=this;this.sx.forEach((function(e){(e.eb||t.scale.qg())&&e.vx&&(e.$o.Lh(tz(e.vx,t.scale)),e.eb=!1,e.$o.Un())}))},e.prototype.qy=function(){t.prototype.qy.call(this);var e=A(be,ke);this.sx.forEach((function(t){if(t.rb){var i=!t.eb&&t.vx?t.vx:iz(t.rb);t.vx=i;var n=!t.eb&&t.lx?t.lx:ez(i);t.lx=n,e.min=Math.min(e.min,n.min),e.max=Math.max(e.max,n.max)}})),this.jg=e},e.prototype.Yc=function(t,e){t.pn(this.ho.D(e)).fs(this.do.D(e)),this.Vu.Vi()},e.prototype.solveNearestFromScreen=function(t){var e=this,i=Cz(t,this.kc,(function(t,i){var n=t.tb(i);if(n)return et(n,e.scale,t.As.Y)}),Pe);if(i){var n=et(i[0],i[1].As.Y,this.scale),r=this.yx(i[1]);if(r){var o=nz(n,this.scale),s=o.angle,a=o.amplitude;return{location:n,scale:this.scale,resultTableContent:this.Wp(new dV,this,s,a,this.Ie.getAmplitudeAxis().formatValue).vc(),series:this,fillStyle:this.ho.L(),polarPolygon:r}}}},e.prototype.solveNearestFromSegment=function(t,e){var i=this.yx(e);if(i){var n=e.tb(t);if(n){var r=nz(n,this.scale),o=r.angle,s=r.amplitude;return{location:n,scale:this.scale,resultTableContent:this.Wp(new dV,this,o,s,this.Ie.getAmplitudeAxis().formatValue).vc(),series:this,fillStyle:this.ho.L(),polarPolygon:i}}}},e.prototype.attach=function(e,i){return void 0===i&&(i=!0),t.prototype.attach.call(this,e,i),fe(e,this.Ii,{fill:this.ho,stroke:this.do}),this},e.prototype.ux=function(){return this.Kc(this.Vu.ef(this.scale,pE.Simple).pn(this.ho.D(this.Ku)).fs(this.do.D(this.Ku)))},e.prototype.yx=function(t){return this.sx.find((function(e){return e.$o===t}))},e}(JV),Lz=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,r,o,s)||this;a.Uc="Area Series",a.Ug=[],a.Yg=!1,a.Xg=!1,a.Sx=!1;var l=a.Ie.getSeries().length;return a.ho=new v(Se(a.Ii.polarAreaSeriesFillStyle,l,a.Ii.mountainsFillStyle)),a.do=new v(Se(a.Ii.polarAreaSeriesStrokeStyle,l,a.Ii.mountainsStrokeStyle)),a}return h(e,t),e.prototype.setData=function(t){var e=function(t){for(var e,i,n=[],r=!1,o=0;o0},e.prototype.attach=function(e,i){return void 0===i&&(i=!0),t.prototype.attach.call(this,e,i),fe(e,this.Ii,{fill:this.ho,stroke:this.do}),this},e}(JV),Pz=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mx=e.Kc(e.Vu.ef(e.scale,pE.Simple)),e}return h(e,t),e.prototype.Xu=function(){if(this.Yg||this.scale.qg()){var t=this.Ug,e=!0===this.Xg?tz(t.concat(function(t){if(0===t.length)return t;var e=t[0],i=t[t.length-1];if(At(e.angle,i.angle))return t;for(var n=1*Math.sign(i.angle-e.angle),r=0,o=[],s=i.angle+n;!At(s%360,e.angle%360);s+=n)if(o.push({angle:s,amplitude:0}),(r+=1)>360)return[];for(var a=0;a=this.gx.start},e.prototype.Og=function(t){this.bx=t,this.Ax=!0},e.prototype._g=function(){return!1===this.bx},e.prototype.Dg=function(t){this.xx=t,this.Ax=!0},e.prototype.Lg=function(){return this.xx},e.prototype.$t=function(){return!1},e.prototype.W=function(t,e,i,n){return this.x=new Ii(t.x,e.x,i.x,n?n.x:void 0),this.y=new Ii(t.y,e.y,i.y,n?n.y:void 0),this},e.prototype.Xt=function(){return this.Vt},e.prototype.qg=function(){return this.Mx},e.prototype.Cx=function(){return this.Ax},e.prototype.Si=function(){return this.Yt},e.prototype.pi=function(){return this.Fx},e.prototype.Ot=function(){return this.i=!1,this.Yt=!1,this.Mx=!1,this.Ax=!1,this},e.prototype.Dt=function(){return this.i=!0,this.Yt=!0,this.Mx=!0,this.Ax=!0,this},e.prototype.wt=function(t,e){return"object"==typeof t?(this.kt.x=t.x,this.kt.y=t.y):(this.kt.x=t,this.kt.y=e),this.Tx(),this},e.prototype.li=function(t){return this.wx=t,this.Tx(),this},e.prototype.di=function(t){return this.kx=t,this.Tx(),this},e.prototype.Ct=function(){return m(this.wx[0]+this.wx[1],this.kx[0]+this.kx[1])},e.prototype.Bt=function(){return this.kt},e.prototype.Tx=function(){var t=this.gx,e=m(this.x.Lt(this.kt.x),this.y.Lt(this.kt.y)),i=this.wx[0]+this.wx[1],n=this.kx[0]+this.kx[1],r=Math.max(e.x-i,0),o=Math.max(e.y-n,0),s=.5*(r>o?o:r),a=[this.wx[0]+Math.max((r-2*s)/2,0),this.wx[1]+Math.max((r-2*s)/2,0)],l=[this.kx[0]+Math.max((o-2*s)/2,0),this.kx[1]+Math.max((o-2*s)/2,0)],h=Math.abs(t.end-t.start);this.x.wt(this.kt.x).Mt(a).Nt(-h,h),this.y.wt(this.kt.y).Mt(l).Nt(-h,h),this.Fx={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.Vt={x:this.x.Xt(),y:this.y.Xt()},this.Dt()},e.prototype.Ut=function(t,e){var i=this.pi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}},e.prototype.gi=function(t,e,i,n){var r=this.pi(),o=Qe(t,e);return o.x*=n,o.y*=n,{x:t.x+i*r.x*o.x,y:t.y+i*r.y*o.y}},e}(Ti),Ez=function(t){function i(i,n,r,o,s,a,l){var h=t.call(this,i,n,r,n.ys(NV.bg),n.ys(NV.ui),o,l,a?a.theme:void 0)||this;h.kp=e.AutoCursorModes.snapToClosest,h.Ol=[],h.Gi=!0,h.Is=!0,h.Bx=function(t,e,i,n,r){h.dg.wt(n,r)},h.Rl=re(h.Ol),h.zl=oe(h.Ol),h.Lx=function(){return h.SS},h.Ix=n.ys(NV.gridLines),h.Px=n.ys(NV.series),h.Ox=n.ys(NV.axisLines),h.Dx=n.ys(NV.axisTicks),h.dg=r.d2({scaleXYConstructor:Bz}),h.onResize(h.Bx),h.Cv.Sn("Polar Chart");var u=Pt(a?a.autoCursorBuilder:void 0,IV);return h.Tp=u.xp(h.nc,h.uiScale,h.uiScale,h.Ii),h.Cp=t.prototype.Fp.call(h,h.ic.uf(h.dg).pn(h.Ii.seriesBackgroundFillStyle).fs(h.Ii.seriesBackgroundStrokeStyle)).ya(0).Sa(360).ba(0),a&&!0===a.disableAnimations&&h.setAnimationsEnabled(!1),h.Tv(s,h.pixelScale),h._x=new GV(h,h.dg,h.Ii,!(!a||!0!==a.disableAnimations),h.Ix,h.Ox,h.Dx,h.Lx),h.Rx=new WV(h,h.dg,h.Ii,!(!a||!0!==a.disableAnimations),h.Ix,h.Ox,h.Dx),h}return h(i,t),i.prototype.addLineSeries=function(){var t=new rz(this.Px,this,this.gS,this.bS,this.dg,this.Ii);return this.kS(t),t},i.prototype.addPointSeries=function(){var t=new sz(this.Px,this,this.gS,this.bS,this.dg,this.Ii);return this.kS(t),t},i.prototype.addPointLineSeries=function(){var t=new oz(this.Px,this,this.gS,this.bS,this.dg,this.Ii);return this.kS(t),t},i.prototype.addAreaSeries=function(){var t=new Pz(this.Px,this,this.gS,this.bS,this.dg,this.Ii);return this.kS(t),t},i.prototype.addPolygonSeries=function(){var t=new Dz(this.Px,this,this.gS,this.bS,this.dg,this.Ii);return this.kS(t),t},i.prototype.getSeries=function(){return this.SS},i.prototype.addSector=function(){var t=new ZV(this.Px,this,this.Rl,this.zl,this.dg,this.Ii);return this.zl(t),t},i.prototype.getAmplitudeAxis=function(){return this._x},i.prototype.getRadialAxis=function(){return this.Rx},i.prototype.Xu=function(){var e,i,n,r,o,s,a,l,h,u;t.prototype.Xu.call(this);try{for(var f=c(this.SS),p=f.next();!p.done;p=f.next())p.value.qy()}catch(t){e={error:t}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(e)throw e.error}}this._x.le(),this.Rx.le();try{for(var y=c(this.SS),d=y.next();!d.done;d=y.next())d.value.Xu()}catch(t){n={error:t}}finally{try{d&&!d.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}for(var g=1;g<=2;g+=1){var S=this._x.Xu(),v=this.Rx.Xu(),m=this.Pv(),x=[this.To.left+v,this.To.right+v],b=[this.To.bottom+v,this.To.top+v+m];if(this.dg.li(x).di(b),!(!this.zx||Math.abs(this.zx.amplitude-S)>=4||Math.abs(this.zx.radial-v)>=4)||1!==g){this.zx={amplitude:S,radial:v};break}}var k=this.dg.Ag().start,w=this.dg.Ag().end;this.Cp.ma(this.dg.Mg()?((null===(h=this.zx)||void 0===h?void 0:h.radial)||0)*this.dg.x.getPixelSize()+w-k:((null===(u=this.zx)||void 0===u?void 0:u.radial)||0)*this.dg.x.getPixelSize()+k-w).xa(360);try{for(var M=c(this.Ol),A=M.next();!A.done;A=M.next())A.value.Xu()}catch(t){o={error:t}}finally{try{A&&!A.done&&(s=M.return)&&s.call(M)}finally{if(o)throw o.error}}this.Bp();try{for(var I=c(this.SS),F=I.next();!F.done;F=I.next())F.value.Jy()}catch(t){a={error:t}}finally{try{F&&!F.done&&(l=I.return)&&l.call(I)}finally{if(a)throw a.error}}return t.prototype.Fv.call(this),this.In(),this},i.prototype.setAnimationsEnabled=function(t){return this.Gi=!!t,this._x.setAnimationsEnabled(t),this.Rx.setAnimationsEnabled(t),this},i.prototype.getAnimationsEnabled=function(){return this.Gi},i.prototype.disableAnimations=function(){return this.setAnimationsEnabled(!1),this},i.prototype.setMouseInteractions=function(t){return this.Is=t,this},i.prototype.getMouseInteractions=function(){return this.Is},i.prototype.getMinimumSize=function(){return m(Oz,Oz)},i.prototype.In=function(){},i.prototype.forEachAxis=function(t){t(this._x),t(this.Rx)},i.prototype.dispose=function(){return this.Ix.ks(),this.Px.ks(),this.Ox.ks(),this.Dx.ks(),t.prototype.dispose.call(this)},i.prototype.Xf=function(){return p(p([],f(this.SS)),f(this.Ol))},i}(VV),Oz=300;!function(t){t[t.bg=0]="bg",t[t.gridLines=1]="gridLines",t[t.series=2]="series",t[t.axisLines=3]="axisLines",t[t.axisTicks=4]="axisTicks",t[t.ui=5]="ui"}(NV||(NV={}));var _z,Vz,zz=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e}(e_),Nz=function(t){function e(e,i,n,r,o,s,a,l){var h=t.call(this,r,s,a,l)||this;return h.Ie=r,h.scale=o,h.gc=s,h.bc=a,h.Uc="Slice",h.u=0,h._v=!1,h.Nx=Y,h.zv=Y,h.Nv=h.u,h.Vv=!1,h.Gv=Ui((function(){return h.Ie.engine.Vi()})),h.Wv=function(){h.jv=void 0},h.index=e,h.mx=h.Kc(i.ef(o,pE.Convex)),h.Me=h.Kc(n.pe(o)),h}return h(e,t),e.prototype.setValue=function(t){return this.Ie.getAnimationsEnabled()?this.Vv||this.Zv(this.Nv,t):this.Nv=t,this.u=t,this.Ie.engine.Vi(),this},e.prototype.getValue=function(){return this.u},e.prototype.dispose=function(){var e=this;return this.Ie.getAnimationsEnabled()&&this.Nv>0?(this.jv&&(this.jv.finish(!1),this.jv=void 0),this.Zv(this.Nv,0,(function(){return t.prototype.dispose.call(e)}))):t.prototype.dispose.call(this),this.Vv=!0,this},e.prototype.restore=function(){return this.Ie.getAnimationsEnabled()&&(this.jv&&(this.jv.finish(!1),this.jv=void 0),this.Zv(this.Nv,this.u)),t.prototype.restore.call(this),this.Vv=!1,this},e.prototype.Zv=function(t,e,i){var n=this;this.jv=this.Gv(300,Hi.ease)([[t,e]],(function(t){var e=f(t,1)[0];n.Nv=e,n.Ie.engine.Vi()})),this.jv.onEveryAnimationEnd(this.Wv),i&&this.jv.onAnimationEnd(i)},e.prototype.setStyle=function(t,e,i,n){this.Nx=t,this.zv=i,this.mx.pn(this.Ku?this.Nx.getDefaultHighlightStyle():this.Nx).fs(e),this.Me.pn(this.Ku?this.zv.getDefaultHighlightStyle():this.zv).bn(n);for(var r=0;r=100?100:t)/100)},Yz=function(t,i,n,r,o,s,a,l){void 0===s&&(s=0),void 0===a&&(a=e.FunnelSliceModes.VariableHeight),i=Hz(i,r.x),n=Hz(n,r.x);var h,u=t.length,c=0;h=t.reduce((function(t,e){return t+e.getAnimatedValue()}),0);var f={x:l-i/2,y:r.y+o.bottom},p={x:l+i/2,y:r.y+o.bottom},y={x:0,y:o.bottom},d={x:0,y:o.bottom},g=0,S=0;if(s)for(var v=0;v0&&(f={x:y.x+x*s,y:y.y-s},p={x:d.x-x*s,y:d.y-s}),y={x:l-(k=(i+c/h*(n-i))/2),y:parseInt(""+(a===e.FunnelSliceModes.VariableWidth?f.y-w:w),10)},d={x:l+k,y:parseInt(""+(a===e.FunnelSliceModes.VariableWidth?p.y-w:w),10)},p.x>=f.x&&d.x>y.x&&b.mx.Lh([y,f,p,d])}},Uz=function(t){function i(i,n,r,o,s,a,l,h){var u=t.call(this,i,n,r,n.ys(Vz.bg),n.ys(Vz.ui),o,a,l)||this;return u.Kv=[],u.qv=$O.None,u.$v=!0,u.ny=0,u.Ex=80,u.Vx=20,u.Gx=0,u.Hx=e.FunnelSliceModes.VariableHeight,u.Gi=!0,u.oy=function(t){var e=u.Kv.indexOf(t);e>=0&&(u.Kv.splice(e,1),u.hy())},u.uy=function(t){u.Kv.indexOf(t)<0&&(u.Kv.push(t),u.hy(),t.setHighlightOnHover(u.$v))},u.ly=n.ys(Vz.bottom),u.vy=n.ys(Vz.top),u.Cv.Sn("Funnel Chart"),u.Jv=u.Ii.sliceChartStackedFillStylePalette,u.Qv=u.Ii.sliceChartStrokeStyle,u.ty=u.Ii.sliceLabelFont,u.iy=u.Ii.sliceLabelFillStyle,h&&u.setAnimationsEnabled(!1),u.Tv(s,u.pixelScale),u}return h(i,t),i.prototype.addSlice=function(t,e){var i=new Nz(this.ny,this.ly,this.vy,this,this.pixelScale,this.oy,this.uy,this.Ii);return this.ny+=1,i.setName(t),i.setValue(e),this.Kv.push(i),this.engine.Vi(),i.setHighlightOnHover(this.$v),i},i.prototype.addSlices=function(t){for(var e=[],i=0;i0})),a=0;for(r=0;r0?l/a:0);for(r=0;r0){var o=(r[1].y-r[0].y)/2+r[0].y;return{x:i===e.FunnelLabelSide.Left?(r[0].x-r[1].x)/2+r[1].x-n:(r[2].x-(4===r.length?r[3].x:r[1].x))/2+(4===r.length?r[3].x:r[1].x)+n,y:o}}},Xz=function(t){var e=t.Ih();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}},Wz=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.Sy=t_.NamePlusValue,i.py=10,i.Wx=e.FunnelLabelSide.Left,i.jx=e.SliceLabelIndices.LabelsOnSides,i.by=[],i.xy=i.Ii.sliceLabelConnectorStyle,i}return h(i,t),i.prototype.setLabelConnectorStyle=function(t){this.xy=t;for(var e=0;e=0&&u.Kv.splice(e,1)},u.uy=function(t){u.Kv.indexOf(t)<0&&u.Kv.push(t)},u.Vu=n.ys(e.LayerIndices.bottom),u.vy=n.ys(e.LayerIndices.top),u.Cv.Sn("Gauge Chart"),u.Tv(s,u.pixelScale);var c=ME();return u.onBackgroundTouchStart(c.onTouchStart),u.onBackgroundTouchMove(c.onTouchMove),u.onBackgroundTouchEnd(c.onTouchEnd),h&&u.setAnimationsEnabled(!1),u}return h(i,t),i.prototype.setAnimationsEnabled=function(t){return this.Gi=t,this},i.prototype.getAnimationsEnabled=function(){return this.Gi},i.prototype.disableAnimations=function(){return this.setAnimationsEnabled(!1),this},i.prototype.dispose=function(){return this.Vu.ks(),this.vy.ks(),t.prototype.dispose.call(this)},i}(QO),qz=function(t){function i(i,n,r,o,s,a,l,h){var u=t.call(this,i,n,r,o,s,a,l,h)||this;u.sa=90,u.oa=-270,u.Xx={min:u.sa,max:u.oa},u.Zx=Ui((function(){return u.Vu.Vi()})),u.Kx=function(){u.qx=void 0};var c=n.ys(e.LayerIndices.bottom);return n.ys(e.LayerIndices.top),u.Jx=c.uf(u.pixelScale).pn(u.Ii.gaugeBackgroundFillStyle).fs(u.Ii.gaugeBackgroundStrokeStyle),u}return h(i,t),i.prototype.setAngleInterval=function(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);var i=this.sa,n=this.oa,r=this.Xx;return this.getAnimationsEnabled()?this.Qx(r,{min:t,max:e}):(r.min=t,r.max=e,this.sa=t,this.oa=e),this.Fi.emit("angleIntervalChange",this,{min:i,max:n},{min:t,max:e}),this.engine.Vi(),this},i.prototype.getAngleInterval=function(){return{min:this.sa,max:this.oa}},i.prototype.setGaugeFillStyle=function(t){return this.Jx.pn(t),this.engine.Vi(),this},i.prototype.setGaugeStrokeStyle=function(t){return this.Jx.fs(t),this.engine.Vi(),this},i.prototype.Qx=function(t,e,i){var n=this;this.qx=this.Zx(1e3,Hi.ease)([[t.min,e.min],[t.max,e.max]],(function(t){var e=f(t,2),i=e[0],r=e[1];n.Xx={min:i,max:r},n.sa=i,n.oa=r,n.Vu.Vi()})),this.qx.onEveryAnimationEnd(this.Kx),i&&this.qx.onAnimationEnd(i)},i.prototype.onAngleIntervalChange=function(t){return this.Fi.on("angleIntervalChange",t)},i.prototype.offAngleIntervalChange=function(t){return this.Fi.off(t,"angleIntervalChange")},i}(Zz),Qz=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.$x=function(t){return this.Fi.on("valueChange",t)},e.prototype.tw=function(t){return this.Fi.on("valueIntervalChange",t)},e.prototype.offValueChange=function(t){return this.Fi.off(t,"valueChange")},e.prototype.offIntervalChange=function(t){return this.Fi.off(t,"valueIntervalChange")},e.prototype.attach=function(e,i){return void 0===i&&(i=!0),t.prototype.attach.call(this,e,i),this.styleAttachedEntry(e),this},e.prototype.setHighlighted=function(e){t.prototype.setHighlighted.call(this,e);for(var i=0;io&&(i=o);var s=this.oa-e*this.rw,a=this.sa+e*this.ew,l=this.ow-this.sw,h=(0!==l?(s-a)/l:1/0)*(i-this.sw);this.arc.ya(a).Sa(a+h);var u="function"==typeof t?t(i,{getInnerStart:function(){return r},getInnerEnd:function(){return o}}):t.format(i);this.label.Sn(u)},e.prototype.aw=function(){var t=this,e=this.Ie.getIntervalLabelFormatter(),i="function"==typeof e?e(this.sw,{getInnerStart:function(){return t.sw},getInnerEnd:function(){return t.ow}}):e.format(this.sw);return this.minLabel.Sn(i).Un(),this.minLabel.Bt()},e.prototype.uw=function(){var t=this,e=this.Ie.getIntervalLabelFormatter(),i="function"==typeof e?e(this.ow,{getInnerStart:function(){return t.sw},getInnerEnd:function(){return t.ow}}):e.format(this.ow);return this.maxLabel.Sn(i).Un(),this.maxLabel.Bt()},e.prototype.setName=function(e){return t.prototype.setName.call(this,e),this.Ie.engine.Vi(),this},e.prototype.setValue=function(t){var e=this.u;return this.Nv=e,this.Ie.getAnimationsEnabled()?this.isDisposed()||this.Zv(this.Nv,t):this.Nv=t,this.u=t,this.Fi.emit("valueChange",this,e,t),this.Ie.engine.Vi(),this},e.prototype.getValue=function(){return this.u},e.prototype.dispose=function(){var e=this;return this.Ie.getAnimationsEnabled()&&this.Nv>0?(this.jv&&(this.jv.finish(!1),this.jv=void 0),this.Zv(this.Nv,0,(function(){return t.prototype.dispose.call(e)}))):t.prototype.dispose.call(this),this},e.prototype.restore=function(){return this.Ie.getAnimationsEnabled()&&(this.jv&&(this.jv.finish(!1),this.jv=void 0),this.Zv(0,this.u)),t.prototype.restore.call(this),this},e.prototype.setInterval=function(t,e){var i=this.sw,n=this.ow;return this.Fi.emit("valueIntervalChange",this,{min:i,max:n},{min:t,max:e}),this.sw=t,this.ow=e,this.Ie.engine.Vi(),this},e.prototype.setIntervalLabelsFont=function(t){return this.minLabel.bn(t),this.maxLabel.bn(t),this.Ie.engine.Vi(),this},e.prototype.getIntervalLabelsFont=function(){return this.minLabel.gn()},e.prototype.setIntervalLabelsVisible=function(t){return t?(this.minLabel.restore(),this.maxLabel.restore()):(this.minLabel.dispose(),this.maxLabel.dispose()),this.hw=t,this},e.prototype.getIntervalLabelsVisible=function(){return this.hw},e.prototype.setAngleInterval=function(t,e){return this.sa=t,this.oa=e,this.Ie.engine.Vi(),this},e.prototype.setMinAngle=function(t){return this.sa=t,this.Ie.engine.Vi(),this},e.prototype.setMaxAngle=function(t){return this.oa=t,this.Ie.engine.Vi(),this},e.prototype.setMarginInDegrees=function(t,e){return void 0===t&&(t=this.ew),void 0===e&&(e=this.rw),t!==this.ew&&(this.ew=t),e!==this.rw&&(this.rw=e),this.Ie.engine.Vi(),this},e.prototype.setFillStyle=function(t){this.iw.C(t);var e=this.iw.D(this.Ku);this.arc.pn(e);for(var i=0;ir?25*n:25*r)));var s=Array(o+2),a=Math.PI,l=0,h=0,u=e*a/180,c=(i*a/180-u)/o;for(s[l]=m(t.x,t.y),l+=1;l<=o+1;)s[l]=m(t.x+n*Math.cos(u+h*c),t.y+r*Math.sin(u+h*c)),l+=1,h+=1;return[s,o]}var eN,iN,nN=function(t){function e(e,i,n,r,o,s,a,l){var h=t.call(this,e,i,n,r,o,s,a,l)||this;h.Rf=20,h.lw=new Intl.NumberFormat,h.dw=new Intl.NumberFormat,h.yw=!1,h.Sw=5;var u=new $z(h.Vu,h.vy,h,h.pixelScale,h.oy,h.uy,h.Ii);return h.mw=u,h.Kv.push(u),h.setPadding(10),h}return h(e,t),e.prototype.Xu=function(){t.prototype.Xu.call(this),t.prototype.Fv.call(this);var e=this.Pv(),i=Ne([this.mw.aw(),this.mw.uw()]),n=m(this.pixelScale.x.getInnerInterval()-(this.To.left+this.To.right+2*i.max.x),this.pixelScale.y.getInnerInterval()-(this.To.bottom+this.To.top+2*i.max.y+e)),r=Math.max(.5*Math.min(n.x,n.y),0),o=m(this.To.left+i.max.x+.5*n.x,this.To.bottom+i.max.y+.5*n.y),s=this.yw?this.pw(o,r):o,a=this.Jx.do.thickness,l=r-.5*a,h=r-this.Rf,u=h/r*100;u=u>100||u<0?99:u;var c=100*(1-(this.Rf-a)/r);this.gw(s,h)&&(this.Jx.ma(r).ba(u),this.mw.arc.ma(l).ba(c));var f,p,y=.5*(f=r,(p=this.oa-this.sa)/(2*Math.PI*f*(p/360))*a);this.Jx.ya(this.sa).Sa(this.oa).Eo(s),this.mw.arc.Eo(s),this.mw.label.Eo(s),this.Nf&&this.mw.setFillStyle(new G({color:this.Nf.getColors(this.mw.getAnimatedValue())})),this.mw.setMinAngle(this.sa).setMaxAngle(this.oa).setMarginInDegrees(y,y).Xu();var d=this.Jx.ha();if(this.mw.getIntervalLabelsVisible()){this.bw(this.sa,this.oa,s,d+this.Sw);var g=this.mw.minLabel.Un().Ti(),S=this.mw.maxLabel.Un().Ti();Fe(g,S)&&this.xw(g,S,s,d+this.Sw)}},e.prototype.gw=function(t,e){var i=$e(this.mw.label.Un().Bt(),.5),n=t.x+e,r=t.x-e,o=t.y+e,s=t.y-e;return!(t.x+i.x>n||t.x-i.xo||t.y-i.y=0?i=-n:n=-i),[i,n]},e.prototype.pw=function(t,e){var i=Ne(f(tN(t,this.sa,this.oa,e,e),1)[0]),n=.5*(i.max.x-i.min.x),r=.5*(i.max.y-i.min.y);return ti(ei(t,m(i.min.x+n,i.min.y+r)),t)},e.prototype.bw=function(t,e,i,n){var r=li(t),o=li(e);this.mw.minLabel.Eo(Ke(m(i.x+n,i.y),i,-r)),this.mw.maxLabel.Eo(Ke(m(i.x+n,i.y),i,-o)),this.mw.minLabel.Xo(m(-Math.cos(r),-Math.sin(r))),this.mw.maxLabel.Xo(m(-Math.cos(o),-Math.sin(o)))},e.prototype.getDefaultSlice=function(){return this.mw},e.prototype.setAutoScaling=function(t){return this.yw=t,this.engine.Vi(),this},e.prototype.getAutoScaling=function(){return this.yw},e.prototype.setDataLabelFormatter=function(t){return this.dw=t,this.engine.Vi(),this},e.prototype.getDataLabelFormatter=function(){return this.dw},e.prototype.setIntervalLabelFormatter=function(t){return this.lw=t,this.engine.Vi(),this},e.prototype.getIntervalLabelFormatter=function(){return this.lw},e.prototype.setIntervalLabelPadding=function(t){return this.Sw=t,this.engine.Vi(),this},e.prototype.getIntervalLabelPadding=function(){return this.Sw},e.prototype.setThickness=function(t){return this.Rf=t,this},e.prototype.setLUT=function(t){return this.Nf=t,this.engine.Vi(),this},e.prototype.setDataLabelFont=function(t){return this.mw.label.bn(t),this.engine.Vi(),this},e.prototype.getDataLabelFont=function(){return this.mw.label.gn()},e.prototype.getMinimumSize=function(){return m(500,300)},e.prototype.setDataLabelFillStyle=function(t){return this.mw.cw(t),this.engine.Vi(),this},e.prototype.getDataLabelFillStyle=function(){return this.mw.fw()},e.prototype.Xf=function(){return this.Kv},e.prototype.dispose=function(){return this.mw.dispose(),t.prototype.dispose.call(this)},e}(qz),rN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e}(e_),oN=function(t){function e(e,i,n,r,o,s,a,l){var h=t.call(this,r,s,a,l)||this;return h.Ie=r,h.scale=o,h.gc=s,h.bc=a,h.Uc="Slice",h.u=0,h._v=!1,h.Nx=Y,h.zv=Y,h.Nv=h.u,h.Vv=!1,h.Gv=Ui((function(){return h.Ie.engine.Vi()})),h.Wv=function(){h.jv=void 0},h.index=e,h.mx=h.Kc(i.ef(o,pE.Convex)),h.Me=h.Kc(n.pe(o)),h}return h(e,t),e.prototype.setValue=function(t){return this.Ie.getAnimationsEnabled()?this.Vv||this.Zv(this.Nv,t):this.Nv=t,this.u=t,this.Ie.engine.Vi(),this},e.prototype.getValue=function(){return this.u},e.prototype.dispose=function(){var e=this;return this.Ie.getAnimationsEnabled()&&this.Nv>0?(this.jv&&(this.jv.finish(!1),this.jv=void 0),this.Zv(this.Nv,0,(function(){return t.prototype.dispose.call(e)}))):t.prototype.dispose.call(this),this.Vv=!0,this},e.prototype.restore=function(){return this.Ie.getAnimationsEnabled()&&(this.jv&&(this.jv.finish(!1),this.jv=void 0),this.Zv(this.Nv,this.u)),t.prototype.restore.call(this),this.Vv=!1,this},e.prototype.Zv=function(t,e,i){var n=this;this.jv=this.Gv(300,Hi.ease)([[t,e]],(function(t){var e=f(t,1)[0];n.Nv=e,n.Ie.engine.Vi()})),this.jv.onEveryAnimationEnd(this.Wv),i&&this.jv.onAnimationEnd(i)},e.prototype.setStyle=function(t,e,i,n){this.Nx=t,this.zv=i,this.mx.pn(this.Ku?this.Nx.getDefaultHighlightStyle():this.Nx).fs(e),this.Me.pn(this.Ku?this.zv.getDefaultHighlightStyle():this.zv).bn(n);for(var r=0;r=100?100:t)/100)},lN=function(t,i,n,r,o,s,a,l){void 0===s&&(s=0),void 0===a&&(a=e.PyramidSliceModes.VariableHeight),i=aN(i,r.x),n=aN(n,r.x);var h,u=t.length,c=0;h=t.reduce((function(t,e){return t+e.getAnimatedValue()}),0);var f={x:l-i/2,y:r.y+o.bottom},p={x:l+i/2,y:r.y+o.bottom},y={x:0,y:o.bottom},d={x:0,y:o.bottom},g=0,S=0;if(s)for(var v=0;v0&&(f={x:y.x+x*s,y:y.y-s},p={x:d.x-x*s,y:d.y-s}),y={x:l-(k=(i+c/h*(n-i))/2),y:parseInt(""+(a===e.PyramidSliceModes.VariableWidth?f.y-w:w),10)},d={x:l+k,y:parseInt(""+(a===e.PyramidSliceModes.VariableWidth?p.y-w:w),10)},p.x>=f.x&&d.x>=y.x&&b.mx.Lh([y,f,p,d])}},hN=function(t){function i(i,n,r,o,s,a,l,h){var u=t.call(this,i,n,r,n.ys(iN.bg),n.ys(iN.ui),o,a,l)||this;return u.Kv=[],u.qv=$O.None,u.Jv=u.Ii.sliceChartStackedFillStylePalette,u.Qv=u.Ii.sliceChartStrokeStyle,u.$v=!1,u.ty=u.Ii.sliceLabelFont,u.iy=u.Ii.sliceLabelFillStyle,u.ny=0,u.Ex=0,u.Vx=80,u.Gx=0,u.Hx=e.PyramidSliceModes.VariableHeight,u.Gi=!0,u.oy=function(t){var e=u.Kv.indexOf(t);e>=0&&(u.Kv.splice(e,1),u.hy())},u.uy=function(t){u.Kv.indexOf(t)<0&&(u.Kv.push(t),u.hy(),t.setHighlightOnHover(u.$v))},u.ly=n.ys(iN.bottom),u.vy=n.ys(iN.top),u.Cv.Sn("Pyramid Chart"),h&&u.setAnimationsEnabled(!1),u.Tv(s,u.pixelScale),u}return h(i,t),i.prototype.addSlice=function(t,e){var i=new oN(this.ny,this.ly,this.vy,this,this.pixelScale,this.oy,this.uy,this.Ii);return this.ny+=1,i.setName(t),i.setValue(e),this.Kv.push(i),this.engine.Vi(),i},i.prototype.addSlices=function(t){for(var e=[],i=0;i0})),a=0;for(r=0;r0?l/a:0);for(r=0;r0){var o=(r[1].y-r[0].y)/2+r[0].y;return{x:i===e.PyramidLabelSide.Left?(r[0].x-r[1].x)/2+r[1].x-n:(r[2].x-(4===r.length?r[3].x:r[1].x))/2+(4===r.length?r[3].x:r[1].x)+n,y:o}}},cN=function(t){var e=t.Ih();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}},fN=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.Sy=t_.NamePlusValue,i.py=10,i.Wx=e.PyramidLabelSide.Left,i.jx=e.SliceLabelIndices.LabelsOnSides,i.by=[],i.xy=i.Ii.sliceLabelConnectorStyle,i}return h(i,t),i.prototype.setLabelConnectorStyle=function(t){this.xy=t;for(var e=0;e0?n-1:l-1],u=i[n],c=i[n0},i.prototype.addPoints=function(){for(var t=this,e=[],i=0;i=3&&(this.mx||(this.mx=this.Kc(this.Vu.ef(this.scale,pE.Simple).fs(this.Ow.D(this.Ku)).pn(this.Pw.D(this.Ku)))),this.mx.Lh(e),this.$g||(this.$g=this.Kc(this.Vu.dS(this.scale).wt(this.Jg).yh(this.Qg).xn(this.Mo).pn(this.Dw.D(this.Ku)))),this.$g.bh().gh(e))}},i.prototype.attach=function(e,i){return void 0===i&&(i=!0),t.prototype.attach.call(this,e,i),fe(e,this.Ii,{fill:this.Pw,stroke:this.Ow}),this},i.prototype.Rw=function(){for(var t=0;t=0?i:i+2*Math.PI},wN=function(t){return Ne(t.shapeTag.Ti())},MN=function(t){return Ne(t.Ti())},AN=function(t,i,n,r){return t.ba(0).Eo(n).ya(90).Sa(-270).xa(i===e.SpiderWebMode.Circle?void 0:r.length)},IN={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},FN={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},TN=function(){FN.alignmentX=0,FN.alignmentY=0,FN.paddingX=0,FN.paddingY=0};!function(t){t[t.bg=0]="bg",t[t.axisBg=1]="axisBg",t[t.plotting=2]="plotting",t[t.fg=3]="fg",t[t.ui=4]="ui"}(vN||(vN={}));var CN,DN=function(t){function i(i,n,r,o,s,a,l){var h=t.call(this,i,n,r,n.ys(vN.bg),n.ys(vN.ui),o,l,a?a.theme:void 0)||this;h.kp=e.AutoCursorModes.onHover,h.To=T(20,20,20,20),h.axisScale=$.d1({scale1DConstructor:Ii,dimension:"x"}).Nt(0,1),h._m=[],h.Ew=[],h.Vw=[],h.Gw=Li.expansion,h.Hw=!0,h.Ww=SN,h.jw=gN,h.Gi=!0,h.Is=!0,h.Uw=e.SpiderWebMode.Normal,h.Yw=4,h.Xw=h.Ii.spiderWebStyle,h.Zw=h.Ii.spiderScaleLabelFillStyle,h.Kw=h.Ii.spiderScaleLabelFont,h.qw=5,h.Jw=h.Ii.spiderAxisLabelFillStyle,h.Qw=h.Ii.spiderAxisLabelFont,h.$w=5,h.tk=h.Ii.spiderAxisStyle,h.ik=new v(h.Ii.spiderAxisNibStyle),h.ll=10,h.nk=m(0,0),h.ek=T(),h.removeAxis=function(t){for(var e=0;e=0&&void 0!==i){var u=kN(l,h._m.length),c=m(Math.cos(u),Math.sin(u)),f=a.x*c.x+a.y*c.y,p=Je(ei(t.shapeAxis.si(),t.shapeAxis.ei())),y=i.min+(i.max-i.min)*Math.max(1+f/p,.01);h.axisScale.Nt(i.min,y),ee(s),h.engine.Vi()}},s=function(){if(i=void 0,void 0!==n)if(h.Gi){var t=A(h.axisScale.getInnerStart(),h.axisScale.getInnerEnd()),e=h.dk(),r=n;if(void 0!==e){var o=r.start(t.min,t.max,e.min,e.max),s=r.end(t.min,t.max,e.min,e.max);h.lk=h.ic.As.ir(300,Hi.ease)([[0,1]],(function(e){var i=f(e,1)[0];h.axisScale.Nt(t.min+i*(o-t.min),t.max+i*(s-t.max))})),h.lk.onAnimationEnd((function(){h.lk=void 0,h.Gw=r}))}else h.Gw=n}else h.Gw=n;n=void 0};e.setMouseEnterEventHandler(h.vk).setMouseLeaveEventHandler(h.yk).setMouseDragStartEventHandler(r).setMouseDragEventHandler((function(t,e,i,n,r){return o(0,m(e.clientX,e.clientY),n,0,e)})).setMouseDragStopEventHandler(s);var a=ME(new AE.Drag((function(t,e,i){h.vk(t),r(),ee(i)}),o,(function(t,e,i,n){h.yk(t),s(),ee(n)})));return e.setTouchStartEventHandler(a.onTouchStart).setTouchMoveEventHandler(a.onTouchMove).setTouchEndEventHandler(a.onTouchEnd)},h.Sk=function(t){h.Hw&&!h.hasAxis(t)&&h.addAxis(t)},h.Aw=function(t,e){var i,n;try{for(var r=c(h._m),o=r.next();!o.done;o=r.next()){var s=o.value;if(s.tag===t){var a=Math.max(Math.min((e-h.axisScale.getInnerStart())/(h.axisScale.getInnerEnd()-h.axisScale.getInnerStart()),1),0);return Oe(s.shapeAxis.si(),s.shapeAxis.ei(),a)}}}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}},h.Fw=function(t){var e,i;if(0!==h._m.length){var n,r=ei(et(t,h.engine.scale,h.pixelScale),h._m[0].shapeAxis.si()),o=Math.atan2(r.y,r.x),s=be;try{for(var a=c(h._m),l=a.next();!l.done;l=a.next()){var u=l.value,f=ei(u.shapeAxis.ei(),u.shapeAxis.si()),p=Math.atan2(f.y,f.x),y=Math.abs(o-p);y0?d.right=Math.max(d.right,M.x+.5*(1-w.alignmentX)*k.x-g):d.left=Math.max(d.left,-M.x+.5*(w.alignmentX+1)*k.x-g),b>0?d.top=Math.max(d.top,M.y+.5*(1-w.alignmentY)*k.y-g):d.bottom=Math.max(d.bottom,-M.y+.5*(w.alignmentY+1)*k.y-g)}if(this.Gw){var A=this.dk();if(void 0!==A){var I=this.Gw.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),A.min,A.max),F=this.Gw.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),A.min,A.max);this.axisScale.Nt(I,F)}}var C=m(this.pixelScale.x.getInnerStart()+(d.left+this.pixelScale.x.getInnerInterval()-d.right)/2,this.pixelScale.y.getInnerStart()+(d.bottom+this.pixelScale.y.getInnerInterval()-d.top)/2),D=Math.min(y.x/2-(d.left+d.right)/2,y.y/2-(d.bottom+d.top)/2);this.nk=m(Math.max(y.x-(2*D+d.left+d.right),0),Math.max(y.y-(2*D+d.bottom+d.top),0)),this.ek=T(this.ct.left+this.To.left+d.left,this.ct.top+this.To.top+p+d.top,this.ct.right+this.To.right+d.right,this.ct.bottom+this.To.bottom+d.bottom),this.my(C,D);try{for(var L=c(this.SS),P=L.next();!P.done;P=L.next())P.value.qy()}catch(t){e={error:t}}finally{try{P&&!P.done&&(i=L.return)&&i.call(L)}finally{if(e)throw e.error}}try{for(var B=c(this.SS),E=B.next();!E.done;E=B.next())E.value.Xu()}catch(t){n={error:t}}finally{try{E&&!E.done&&(r=B.return)&&r.call(B)}finally{if(n)throw n.error}}t.prototype.Fv.call(this),this.Bp();try{for(var O=c(this.SS),_=O.next();!_.done;_=O.next())_.value.Jy()}catch(t){o={error:t}}finally{try{_&&!_.done&&(s=O.return)&&s.call(O)}finally{if(o)throw o.error}}},i.prototype.dispose=function(){return this.mk.ks(),this.$p.ks(),this.tl.ks(),t.prototype.dispose.call(this)},i.prototype.getMinimumSize=function(){return m(this.ek.left+this.ek.right+100,this.ek.bottom+this.ek.top+100)},i.prototype.my=function(t,e){for(var i,n,r,o,s=this._m.length,a=[],l=0;l0&&h>1,c=0;c=l&&t.push(s());var f=t[c];AN(f,i,n,o);var p=r*((c+1)/e);f.ma(p)}else c=c&&t.push(a());var v=t[f];f+=1;var x=(i-g)/i,b=Oe(o,s[p],x);v.Eo(ti(b,m(S.paddingX,S.paddingY))).Wo(S.alignmentX).Uo(S.alignmentY).Sn(h(x))}}for(var k=f;k1;try{for(var a=c(this._m),l=a.next();!l.done;l=a.next()){var h=l.value;try{for(var u=(i=void 0,c(this.SS)),f=u.next();!f.done;f=u.next()){var p=f.value.getValue(h.tag,s);void 0!==p&&(r=void 0===r?p:Math.min(r,p),o=void 0===o?p:Math.max(o,p))}}catch(t){i={error:t}}finally{try{f&&!f.done&&(n=u.return)&&n.call(u)}finally{if(i)throw i.error}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}if(void 0!==r&&void 0!==o)return A(r,o)},i}(VV),LN={getWidth:function(t){return t.x},getHeight:function(t){return t.y},toVec2:function(t,e){return{x:t,y:e}},toPoint:function(t,e){return m(t,e)}},PN={getWidth:function(t){return t.y},getHeight:function(t){return t.x},toVec2:function(t,e){return{x:e,y:t}},toPoint:function(t,e){return m(e,t)}},BN={defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:function(){return 0},ae:function(t){return t.getXMin()},ue:function(t){return t.getXMax()},fe:function(t){return t.Ay().x}},EN={defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:function(t){return 90*t},ae:function(t){return t.getYMin()},ue:function(t){return t.getYMax()},fe:function(t){return t.Ay().y}},ON=u(u({},LN),BN),_N=u(u({},PN),EN),VN=function(t){function e(e,i,n,o,s){var a=t.call(this)||this;return a.Vu=e,a.scale=i,a.pk=n,a.gk=o,a.bk=[],a.Ku=!1,a.nf=!0,a.Fi=new r.Eventer,a.xk=function(t){return a.bk.push(t),a.Eu(t),t.setMouseInteractions(a.nf),t},a.getHighlighted=function(){return a.Ku},a.Ii=s,a}return h(e,t),e.prototype.onHighlight=function(t){return this.Fi.on("highlight",t)},e.prototype.offHighlight=function(t){return this.Fi.off(t)},e.prototype.dispose=function(){return this.bk.forEach(wt),this.pk&&this.pk(this),this.Vu.As.Vi(),this},e.prototype.isDisposed=function(){return this.bk.reduce((function(t,e){return function(t,e){return!!t&&e.isDisposed()}(t,e)}),!0)},e.prototype.restore=function(){return this.gk&&this.gk(this),this.bk.forEach(kt),this.Vu.As.Vi(),this},e.prototype.setHighlighted=function(t){return this.Ku=t,this.Fi.emit("highlight",t),this.Vu.Vi(),this},e.prototype.setMouseInteractions=function(t){this.nf=t;for(var e=0;e=0&&e.kc.splice(i,1),e.Vu.Vi()},e.gk=function(t){e.kc.findIndex((function(e){return e===t}))<0&&e.kc.push(t),e.Vu.Vi()},e}return h(e,t),e.prototype.clear=function(){return this.kc.slice().forEach(wt),this.kc.length=0,this.Mc=0,this.Vu.Vi(),this},e.prototype.wk=function(t,e){void 0!==e?this.kc.splice(e,0,t):this.kc.push(t),jt(!this.isDisposed())(t),t.setMouseInteractions(this.xc),this.Yc(t,this.getHighlighted()),t.onMouseEnter(this.Cc),t.onMouseLeave(this.Lc),t.onMouseClick(this.Dc),t.onMouseDoubleClick(this._c),t.onMouseDown(this.Rc),t.onMouseUp(this.zc),t.onMouseMove(this.Pc),t.onMouseDragStart(this.Nc),t.onMouseDrag(this.Ec),t.onMouseDragStop(this.Vc),t.onMouseWheel(this.Gc),t.onTouchStart(this.Hc),t.onTouchMove(this.Wc),t.onTouchEnd(this.jc),this.Vu.Vi()},e.prototype.Yc=function(t,e){t.setHighlighted(e)},e}(wz),NN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e}(VN),RN=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.kk=void 0,e.Mk=function(){e.kk=void 0},e}return h(i,t),i.prototype.he=function(){return this.Yy&&this.kc.length>0},i.prototype.setDefaultStyle=function(t){this.Ak=t,this.kc.forEach(t),t(this.Fk);for(var e=0;e0){var o=0,s=t[0];i[o]=s,o+=1;for(var a=1;a1)for(var r=m(0,0),o=m(0,0),s=m(0,0),a=qe(ei(t[1],t[0])),l=0,h=0,u=0;ue?Math.abs(f/(3*r.x)):1,h=Math.abs(o.x)>e?Math.abs(f/(3*o.x)):1}c[1]=ti($e(r,l),c[1]),c[2]=ei(c[2],$e(o,h)),n[u]=c}return n.length>0?n:[]}(t),u=h.length,c=Array(u*e),f=0,p=0;p0){var e=d.kc[d.kc.length-1];if(t.length>0){var i=e.dh(),n=e.lh(),r=i.length+n.length-+e.Zh();if(r>=d.Jb){var o=n.length>0?n[n.length-1]:i[e.Zh()?r:r-1],s=m((o.x+t[0].x)/2,(o.y+t[0].y)/2);e.gh(s,A(m(s.x,s.y),m(s.x,s.y))).Kh(!0),d.Kc(d.hM([s].concat(t)).Xh(!0))}else e.gh(t,d.eS)}}else t.length>0&&d.Kc(d.hM(t))},d.aM=function(t){if(d.sM.length>0){var e=d.sM[d.sM.length-1];t.length>0&&((e.dh().length+e.lh().length)*d.rM>=d.Jb?d.Kc(d.uM(t),d.sM):e.gh(t))}else t.length>0&&d.Kc(d.uM(t),d.sM)},d.cM=function(t,e){var i=t.Kg(e);if(i)return et(i,d.scale,d.Vu.As.Y)},d.fM=function(t,e){var i=t.lM(e);if(i)return et(i,d.scale,d.Vu.As.Y)},d.Ii=f,d.dM=new v(ge(f.seriesPointFillStyle,y)),d.wa=new v(ge(d.Ii.seriesStrokeStyle,y)),d}return h(e,t),e.prototype.add=function(e){return t.prototype.add.call(this,e),this},e.prototype.Qb=function(){return Az(this.sM)},e.prototype.setStrokeStyle=function(t){this.wa.C(t);for(var e=this.wa.D(this.Ku),i=0;i0?this.kc[this.kc.length-1].dh().length+this.kc[this.kc.length-1].lh().length-+this.kc[this.kc.length-1].Zh():void 0;Mz(t,e,this.Jb,this.oM),Mz(t,e,this.Jb,this.aM)},e.prototype.uM=function(t,e){return this.Vu.dS(this.scale).gh(t,e).setMouseInteractions(this.xc).pn(this.dM.D(this.Ku)).yh(this.Qg).wt(this.Jg).xn(this.Mo).Sh(this.th).mh(this.ih).ph(this.eh).fh(HB(this.eM))},e.prototype.hM=function(t,e){return this.Vu.ky(this.scale,void 0,p([u_.UserSeries],f(this.iM))).gh(t,e).setMouseInteractions(this.xc).ka(this.wa.D(this.Ku)).fh(HB(this.eM))},e.prototype.attach=function(e,i){return void 0===i&&(i=!0),fe(e,this.Ii,{stroke:this.wa,fill:this.dM}),t.prototype.attach.call(this,e,i)},e.prototype.getPointAmount=function(){return this.sM.reduce((function(t,e){return t+e.xh()+e.wh()}),this.La.length)},e.prototype.setHighlighted=function(e){for(var i=this.dM.D(e),n=0;n=e?t.lh().slice(-e):Array.prototype.concat(t.dh(),t.lh()).slice(-e)},QN=function(t,e,i){var n=Array.prototype.concat(t.dh(),t.lh()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.bh().gh(n).Un()},JN=function(t){function e(e,i,n,r,o,s,a,l,h,u,c,f,p,y){var d=t.call(this,e,i,n,r,o,s,a,l,h,u,c,f,p,y)||this;return d.Uc="Spline Series",d.rM=32,d.Jb=8e3,d.vM=function(t){if(0!==t.length){var e=d.sM.length;if(e>0){var i=e>1,n=d.sM[e-1];if(i)if(32*(y=(p=Array.prototype.concat(n.dh(),n.lh())).length)>=d.Jb){var r=qN(n,3),o=Array.prototype.concat(r,t),s=KN(o,32);QN(d.kc[e-1],s,32),d.Kc(d.hM(s.slice(66)))}else if(y<5){var a=d.sM[e-2],l=(r=qN(a,3),o=Array.prototype.concat(r,p,t),s=KN(o,32),d.kc[e-1]),h=s.slice(66);l.bh().gh(h).Un()}else{l=d.kc[e-1];var u=Array.prototype.concat(l.dh(),l.lh()),c=qN(n,4),f=(o=Array.prototype.concat(c,t),s=KN(o,32),u.slice(0,-66).concat(s.slice(33)));l.bh().gh(f).Un()}else{var p,y=(p=Array.prototype.concat(n.dh(),n.lh())).length;l=d.kc[e-1],32*y>=d.Jb?(r=qN(n,3),o=Array.prototype.concat(r,t),s=KN(o,32),QN(d.kc[0],s,32),d.Kc(d.hM(s.slice(66)))):y+t.length>2?(o=Array.prototype.concat(p,t),s=KN(o,32),l.bh().gh(s).Un()):l.gh(t)}}else{var g=t.length>2?KN(t,32):t,S=Ne(g);d.Kc(d.hM(g,S))}d.aM(t)}},d.yM=function(t,e){var i=t.tb(e);if(i)return et(i,d.scale,d.Vu.As.Y)},d.Ii=f,d}return h(e,t),e.prototype.setCursorInterpolationEnabled=function(e){return t.prototype.setCursorInterpolationEnabled.call(this,e)},e.prototype.nS=function(t){var e=this.sM.length,i=this.sM.length>0?this.sM[e-1].dh().length+this.sM[e-1].lh().length:void 0;Mz(t,i,Math.ceil(this.Jb/this.rM),this.vM)},e.prototype.solveNearestFromScreen=function(e,i){if(void 0===i&&(i=this.nM),i)return t.prototype.solveNearestFromScreen.call(this,e,i);var n=Cz(e,this.sM,this.yM,"nearest-x"===this.eM?function(t,e){return Math.abs(t.x-e.x)}:"nearest-y"===this.eM?function(t,e){return Math.abs(t.y-e.y)}:function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)});if(void 0!==n){var r=et(n[0],this.Vu.As.Y,this.scale);return CV(r,this.scale,this.Wp(new dV,this,r.x,r.y,r).vc(),this,n[1].mn())}},e.prototype.solveNearestFromSegment=function(e,i,n){if(void 0===n&&(n=this.nM),n||i instanceof lE)return t.prototype.solveNearestFromSegment.call(this,e,i,n);var r=Cz(e,this.sM,this.yM,"nearest-x"===this.eM?function(t,e){return Math.abs(t.x-e.x)}:"nearest-y"===this.eM?function(t,e){return Math.abs(t.y-e.y)}:function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)});if(void 0!==r){var o=et(r[0],this.Vu.As.Y,this.scale),s=i.Ma();return CV(o,this.scale,this.Wp(new dV,this,o.x,o.y,o).vc(),this,s instanceof J?s.getFillStyle():void 0)}},e.prototype.setMaxPointCount=function(e){return t.prototype.setMaxPointCount.call(this,void 0!==e&&e>0?33*e:0),this},e}(ZN),$N=function(){function t(){this.mi="FreeformPattern",this.Rh={type:"disabled",packager:function(t,e,i){return t.slice()}}}return t.prototype.qb=function(t,e,i,n,r){if(n>0){var o=Math.trunc((e-n)/i);if(o>0&&t.length>1)for(var s=t.splice(0,o),a=0;a0){var o=Math.ceil(n/i),s=t.length-o;if(s>0){var a=this.mM(t,r);if(a>0){var l=s-a>0?a:s;if(l>0){for(var h=0;h1)for(var o=0;o0?t[t.length-1].Z():void 0},e.prototype.getXMin=function(t,e){return void 0===t&&(t=[]),t.length>0&&t[0].xh()>0?t[0].X():e?e.min.x:void 0},e.prototype.setPrecision=function(t){return this.set("_columnPackaging",VB(tR(t)))},e}(rR),sR=function(t){function e(){var e=t.call(this,{Rh:zB()})||this;return e.mi="HorizontalRegressivePattern",e}return h(e,t),e.prototype.mM=function(t,e){var i=t.length,n=Math.max(e.x.getInnerStart(),e.x.getInnerEnd()),r=0;if(i>1)for(var o=0;o0&&t[0].xh()>0?t[0].Z():e?e.max.x:void 0},e.prototype.getXMin=function(t,e){return void 0===t&&(t=[]),void 0!==e?e?e.min.x:void 0:t.length>0?t[t.length-1].X():void 0},e.prototype.setPrecision=function(t){return this.set("_columnPackaging",zB(tR(t)))},e}(rR),aR=function(t,e){var i=e.X();return t?Math.min(i,t):i},lR=function(t,e){var i=e.Z();return t?Math.max(i,t):i},hR=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.SM=function(t,e){return Math.abs(t.y-e.y)},e.prototype.getXMax=function(t,e){return void 0===t&&(t=[]),t.reduce(lR,e?e.max.x:void 0)},e.prototype.getXMin=function(t,e){return void 0===t&&(t=[]),t.reduce(aR,e?e.min.x:void 0)},e}(eR),uR=function(t){function e(){var e=t.call(this,{Rh:NB()})||this;return e.mi="VerticalProgressivePattern",e}return h(e,t),e.prototype.mM=function(t,e){var i=t.length,n=Math.min(e.y.getInnerStart(),e.y.getInnerEnd()),r=0;if(i>1)for(var o=0;o0?t[t.length-1].q():void 0},e.prototype.getYMin=function(t,e){return void 0===t&&(t=[]),t.length>0&&t[0].xh()>0?t[0].K():e?e.min.y:void 0},e.prototype.setPrecision=function(t){return this.set("_columnPackaging",NB(tR(t)))},e}(hR),cR=function(t){function e(){var e=t.call(this,{Rh:RB()})||this;return e.mi="VerticalRegressivePattern",e}return h(e,t),e.prototype.mM=function(t,e){var i=t.length,n=Math.max(e.y.getInnerStart(),e.y.getInnerEnd()),r=0;if(i>1)for(var o=0;o0&&t[0].xh()>0?t[0].q():e?e.max.y:void 0},e.prototype.getYMin=function(t,e){return void 0===t&&(t=[]),void 0!==e?e?e.min.y:void 0:t.length>0?t[t.length-1].K():void 0},e.prototype.setPrecision=function(t){return this.set("_columnPackaging",RB(tR(t)))},e}(hR),fR={horizontalProgressive:new oR,horizontalRegressive:new sR,verticalProgressive:new uR,verticalRegressive:new cR,freeform:new $N},pR=function(t){function e(e,i,n,r,o,s,a,l,h,u,c,f,p,y){var d=t.call(this,e,i,n,r,o,s,a,l,h,fR.horizontalProgressive,u,f,p,y)||this;return d.Uc="Step Series",d.oM=function(t){var e=d.kc.length>0?d.kc[d.kc.length-1].dh().length+d.kc[d.kc.length-1].lh().length:void 0;Mz(t,e,d.Jb,d.pM)},d.pM=function(t){var e=t.length;if(d.kc.length>0){var i=d.kc[d.kc.length-1];if(e>0){var n=i.dh(),r=i.lh(),o=r.length>0?r[r.length-1]:n[n.length-1],s=jN([o].concat(t),d.gM);s.shift();var a=m((o.x+s[0].x)/2,(o.y+s[0].y)/2),l=Array.prototype.concat(a,s);(r.length>0?n.length+r.length:n.length)>=d.Jb?(i.gh(a,A(m(a.x,a.y),m(a.x,a.y))).Kh(!0),d.Kc(d.hM(l).Xh(!0)),d.sM.push(d.uM(t))):i.gh(l)}}else e>0&&d.Kc(d.hM(jN(t,d.gM)));d.aM(t)},d.Ii=f,d.gM=c,void 0===d.iM.find((function(t){return"DataPattern"===t.type}))&&d.iM.push({type:"DataPattern",args:{pattern:"ProgressiveX"}}),d}return h(e,t),e}(ZN),yR=function(t){function e(e,i,n,r,o,s,a,l,h,u,c,f,p,y){var d=t.call(this,e,i,n,r,o,s,a,l,h,u,c)||this;return d.iM=f,d.Uc="Line Series",d.nM=!0,d.Jb=void 0,d.eM="nearest-x",d.Ia=void 0,d.Ef=function(){return pe(d.wa.L().getFillStyle())},d.cM=function(t,e){var i=t.Kg(e);if(i)return et(i,d.scale,d.Vu.As.Y)},d.fM=function(t,e){var i=t.lM(e);if(i)return et(i,d.scale,d.Vu.As.Y)},d.wa=new v(ge(d.Ii.seriesStrokeStyle,p)),d.bM={individualLookupValuesEnabled:void 0!==(null==y?void 0:y.individualLookupValuesEnabled)&&y.individualLookupValuesEnabled},d.setMouseInteractions(!1),d}return h(e,t),e.prototype.add=function(e){return t.prototype.add.call(this,e),this},e.prototype.setMouseInteractions=function(e){return t.prototype.setMouseInteractions.call(this,e)},e.prototype.setStrokeStyle=function(t){this.wa.C(t);for(var e=this.wa.D(this.Ku),i=0;i0?this.root.ne():this.root},t.prototype.zM=function(t){if(this.root)return this.LM(t),this.contentCompare(this.root.value,t)>=0?this.root.ne():this.root},t.prototype.NM=function(t){if(this.root)return this.LM(t),this.contentCompare(this.root.value,t)>=0?this.root:this.root.ee()},t.prototype.EM=function(t){if(this.root)return this.LM(t),this.contentCompare(this.root.value,t)<=0?this.root.ee():this.root},t.prototype.VM=function(t){var e=this;t instanceof Array?t.forEach((function(t){return e.gh(t)})):this.gh(t)},t.prototype.LM=function(t){var e,i,n,r,o,s;if(this.root){for(i=e=new IR,n=e,s=new IR,o=this.root;;){var a=this.contentCompare(t,o.value);if(a<0){if(!o.left)break;if(this.contentCompare(t,o.left.value)<0&&(r=o.left,o.left=r.right,o.CM(),r.right=o,r.CM(),!(o=r).left))break;(r=new IR).right=o,r.left=s.left,s.left=r,n.left=o,n.CM(),n=o,o=o.left}else{if(!(a>0))break;if(!o.right)break;if(this.contentCompare(t,o.right.value)>0&&(r=o.right,o.right=r.left,o.CM(),r.left=o,r.CM(),!(o=r).right))break;(r=new IR).left=o,r.right=s.right,s.right=r,i.right=o,i.CM(),i=o,o=o.right}}for(i.right=o.left,i.CM(),n.left=o.right,n.CM(),o.left=e.right,o.right=e.left;s.left;)s.left.right.CM(),s.left=s.left.left;for(;s.right;)s.right.left.CM(),s.right=s.right.right;o.CM(),this.root=o}},t.prototype.FM=function(t,e,i){return this.root&&(e=this.root.FM(t,e,0,i,this)),e},t.prototype.TM=function(t,e,i){return this.root&&(e=this.root.TM(t,e,this.length-1,i,this)),e},t.prototype.bh=function(){this.root=null,this.length=0},t.prototype.GM=function(t,e){for(var i,n=this._M();n;){var r=this.EM(n.value);t.call(e,i?i.value:void 0,n.value,r?r.value:void 0),i=n,n=r}},t.prototype.HM=function(t,e,i){for(var n,r=this._M(),o=0;r;){var s=this.EM(r.value);e=t.call(i,e,n?n.value:void 0,r.value,s?s.value:void 0,o++,this),n=r,r=s}return e},t}(),TR=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.equals=function(t){return MR(this.key,t.key)&&MR(this.value,t.value)},t.prototype.compare=function(t){return wR(this.key,t.key)},t}(),CR=function(){function t(t,e,i){var n=this;void 0===e&&(e=MR),void 0===i&&(i=wR),this.length=0,this.contentEquals=e,this.contentCompare=i,this.store=new FR(void 0,(function(t,i){return e(t.key,i.key)}),(function(t,e){return i(t.key,e.key)})),t&&(Array.isArray(t)?t.forEach((function(t){return n.gh(t.key,t.value)})):this.gh(t.key,t.value))}return t.prototype.S=function(t){var e=this.store.S(new TR(t,void 0));return e?e.value.value:void 0},t.prototype.l=function(t,e){var i=new TR(t,e),n=this.store.S(i);if(n)return n.value.value=e,n;var r=this.store.gh(i);return this.length+=1,r},t.prototype.gh=function(t,e){return this.l(t,e)},t.prototype.BM=function(t){return this.store.BM(new TR(t,void 0))},t.prototype.bh=function(){this.store.bh(),this.length=0},t.prototype.FM=function(t,e,i){var n=this;return this.store.FM((function(e,r){return t.call(i,e,r.value,r.key,n)}),e,this.store)},t.prototype.TM=function(t,e,i){var n=this;return this.store.TM((function(e,r){return t.call(i,e,r.value,r.key,n)}),e,this.store)},t.prototype.OM=function(t){var e=new TR(t,void 0);return!!this.store.BM(e)&&(this.store.OM(e),this.length--,!0)},t.prototype.PM=function(t,e){return this.FM((function(i,n,r){t.call(e,n,r)}),void 0)},t.prototype.WM=function(t){return this.store.S(new TR(t,void 0))||void 0},t.prototype.GM=function(t,e){for(var i,n=this.store._M();n;){var r=this.store.EM(n.value);t.call(e,i?i.value.value:void 0,n.value.value,r?r.value.value:void 0),i=n,n=r}},t.prototype.HM=function(t,e,i){for(var n,r=this.store._M(),o=0;r;){var s=this.store.EM(r.value);e=t.call(i,e,n?n.value.value:void 0,r.value.value,s?s.value.value:void 0,o++,this),n=r,r=s}return e},t.prototype.DM=function(){return this.store.DM()},t.prototype._M=function(){return this.store._M()},t.prototype.RM=function(t){return this.store.RM(new TR(t,void 0))},t.prototype.zM=function(t){return this.store.zM(new TR(t,void 0))},t.prototype.NM=function(t){return this.store.NM(new TR(t,void 0))},t.prototype.EM=function(t){return this.store.EM(new TR(t,void 0))},t}(),DR={minGapNew:1.75,minGapSplit:2,maxGapFuse:1.5},LR=function(t,e){return Math.min(t,e[3])},PR=function(t,e){return Math.max(t,e[2])},BR=function(t,e){var i=t.length;if(!(i<2))return[e,t[0].y,t.reduce(xt,ke),t.reduce(mt,be),t[i-1].y]},ER=function(t,e){var i=[],n=t.getDataIndices(),r=e.getDataIndices();return Array.isArray(n)?i=i.concat(n):i.push(n),Array.isArray(r)?i=i.concat(r):i.push(r),i},OR=function(t,e){if(t.length>0)return e>0?t[t.length-1]:t[0]},_R=function(t,e,i){return 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))},VR=function(t){function i(i,n,r,o,s,a,l,h,u,c,f,p,y){var d=t.call(this,i,n,r,o,s,a,l,h,u,p)||this;return d.jM=c,d.UM=f,d.Uc="OHLC Series",d.YM=new CR,d.kk=A(x(be,be),x(ke,ke)),d.XM=0,d.ZM=5,d.KM=DR,d.Ia=void 0,d.qM=void 0,d.JM=void 0,d.QM=!0,d.wc=e.HighlightModes.onHover,d.Wp=_R,d.$M=new d.jM(d.Vu,d.scale,Mt,Mt,!0,d.Ii).dispose(),d.tA=new d.UM(d.Vu,d.scale,Mt,Mt,!1,d.Ii).dispose(),d}return h(i,t),i.prototype.Wb=function(t){if(!(t.x instanceof Ii))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.iA=t.x},i.prototype.setStyle=function(t){return this.nA=t,this.eA(),this.Vu.Vi(),this},i.prototype.setPositiveStyle=function(t){return this.rA=t,this.eA(),this.Vu.Vi(),this},i.prototype.setNegativeStyle=function(t){return this.sA=t,this.eA(),this.Vu.Vi(),this},i.prototype.setFigureWidth=function(t){return this.ZM=t,this.Vu.Vi(),this},i.prototype.getFigureWidth=function(){return this.ZM},i.prototype.setFigureAutoFitting=function(t){return this.KM=t?DR:void 0,this.Vu.Vi(),this},i.prototype.getFigureAutoFitting=function(){return void 0!==this.KM},i.prototype.oA=function(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},i.prototype.hA=function(t,e,i,n){var r=function(t){return t[4]>=t[1]}(t),o=new(r?this.jM:this.UM)(this.Vu,this.scale,this.pk,this.gk,r,this.Ii);return this.wk(o,n),this.aA(o),this.Yc(o,this.Ku),o.Xk(t[0],t[1],t[2],t[3],t[4],e).Th(i),o},i.prototype.uA=function(t){var e=this.XM;return this.XM+=1,this.YM.l(e,t),this.QM=!0,this.Fi.emit("dataAdd",this,[t],void 0),e},i.prototype.eA=function(){var t=this;this.kc.forEach((function(e){t.nA&&t.nA(e),e.positive&&t.rA?t.rA(e):!e.positive&&t.sA&&t.sA(e)}))},i.prototype.aA=function(t){this.nA&&this.nA(t),t.positive&&this.rA?this.rA(t):!t.positive&&this.sA&&this.sA(t)},i.prototype.cA=function(t){return t*this.iA.getPixelSize()},i.prototype.fA=function(t){return t/this.iA.getPixelSize()},i.prototype.lA=function(t){if(!Array.isArray(t))return this.YM.S(t);if(this.YM.S(t[0])&&this.YM.S(t[t.length-1])){for(var e=0,i=this.YM.S(t[0])[1],n=ke,r=be,o=this.YM.S(t[t.length-1])[4],s=0;s1){var n=t>0?this.kc.length-1:0;this.kc[n].dispose()}var r;do{r=!1;var o=OR(this.kc,t);if(o){for(var s=o.getPosition(),a=o.getDataIndices(),l=("number"==typeof a?a:a[t>0?a.length-1:0])+t,h=void 0,u=[],c=[];;){var f=this.YM.S(l);if(!f)break;if(!this.oA(f[0],e))break;if(h){if(Math.abs(s-f[0])>=1.5*i)break;t>0?h[4]=f[4]:h[1]=f[1],h[2]=Math.max(h[2],f[2]),h[3]=Math.min(h[3],f[3])}else h=f.slice();u.push(f[0]),t>0?c.push(l):c.splice(0,0,l),l+=t}if(h){var p=t>0?void 0:0;this.hA(h,c,e,p),r=!0}}}while(r)}},i.prototype.qb=function(t){var e;if(t&&"maxDataPointCount"in t){var i=t.maxDataPointCount;if(i&&this.YM.length>i){var n=this.XM-1;if(s=this.YM.store._M()){for(var r=n-i;r>=s.value.key;r-=1)this.YM.OM(r);var o=!0;for(this.kk.min.y=be,this.kk.max.y=ke,r=1+n-i;r<=n;r+=1)(c=this.YM.S(r))&&(this.kk.min.y=Math.min(this.kk.min.y,c[3]),this.kk.max.y=Math.max(this.kk.max.y,c[2]),o&&(this.kk.min.x=c[0],o=!1))}}}else if(t&&"minDataPointCount"in t&&t.minDataPointCount){var s,a=t.minDataPointCount,l=this.scale.x.getInnerStart();if(n=this.XM-1,s=this.YM.store._M()){var h=s.value.key,u=void 0;for(r=s.value.key;r<=n&&!((null===(e=this.YM.S(r))||void 0===e?void 0:e[0])>=l);r+=1)u=r;if(void 0!==u&&u-h>=1e3&&this.YM.length-(u-h)>=a){for(r=u;r>=h;r-=1)this.YM.OM(r);if(s=this.YM.store._M(),o=!0,this.kk.min.y=be,this.kk.max.y=ke,s)for(r=s.value.key;r<=n;r+=1){var c;(c=this.YM.S(r))&&(this.kk.min.y=Math.min(this.kk.min.y,c[3]),this.kk.max.y=Math.max(this.kk.max.y,c[2]),o&&(this.kk.min.x=c[0],o=!1))}}}}return this},i.prototype.setDataCleaning=function(t){return this.Ia=t,this.Vu.Vi(),this},i.prototype.setMaxPointCount=function(t){return this.setDataCleaning({maxDataPointCount:t}),this},i.prototype.Jy=function(){t.prototype.Jy.call(this),this.qb(this.Ia);var e=this.iA.getPixelSize(),i=this.qM,n=A(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd()),r=this.JM,o=this.cA(this.ZM),s=!r||n.max-n.min!=r.max-r.min,a=this.kc.length;if(!r||n.min>r.min)for(var l=0;l=0&&(h=this.kc[l],!this.oA(h.getPosition(),o));l-=1)h.dispose();if(0===this.kc.length&&this.YM.length>0)for(l=0;l0){var c=this.KM?o*this.KM.minGapNew:0;if((s||!r||n.minr.max)&&(this.dA(1,o,c),this.QM=!0),this.KM){var f=o*this.KM.maxGapFuse,p=o*this.KM.minGapSplit;if(void 0===i||e!==i||this.QM){var y=void 0;do{for(y=!1,l=0;l1){var g=h.getPosition(),S=l>0?this.kc[l-1]:void 0,v=l=1.5*p)&&(!v||v.getPosition()-g>=1.5*p)){y=!0,h.dispose();var m=d.length,x=Math.round(m/2),b=d.splice(x,m-x),k=this.lA(d),w=this.lA(b);void 0!==k&&this.hA(k,d,o,l),void 0!==w&&this.hA(w,b,o,l+1),l+=1}}}}while(y);var M=void 0;do{for(M=!1,l=0;l0){for(var i=et(t,this.Vu.As.Y,this.scale),n=void 0,r=0;ri.x+o.Zk())break;if(s>=i.x){var a=r>0?i.x-this.kc[r-1].getPosition():Number.MAX_VALUE,l=s-i.x,h=r0){if(Array.isArray(e[0])){for(var i=e,n=0;n0},e}(VR),NR=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.La=[],e}return h(e,t),e.prototype.he=function(){return this.Yy&&(this.YM.length>0||this.La.length>0)},e.prototype.add=function(t){Array.isArray(t)?this.addPoints(t):this.addPoint(t);var e=this.La[this.La.length-1];return this.Kb=e?{x:e.x,y:e.y}:void 0,this},e.prototype.addPoint=function(t){return this.La.push(t),this.Vu.Vi(),this.kk.min.x=Math.min(this.kk.min.x,t.x),this.kk.max.x=Math.max(this.kk.max.x,t.x),this.kk.min.y=Math.min(this.kk.min.y,t.y),this.kk.max.y=Math.max(this.kk.max.y,t.y),this},e.prototype.addPoints=function(t){return t.length>0&&(this.La=this.La.concat(t),this.Vu.Vi(),this.kk.min.x=Math.min(this.kk.min.x,t[0].x),this.kk.max.x=Math.max(this.kk.max.x,t[t.length-1].x),this.kk.min.y=t.reduce(mt,this.kk.min.y),this.kk.max.y=t.reduce(xt,this.kk.max.y)),this},e.prototype.addArrayY=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=0);var n=i;return n||(n=this.Kb?this.Kb.x+e:0),this.add(Iz(t,e,n)),this},e.prototype.Jy=function(){if(this.qb(this.Ia),this.La.length>0){var e=void 0;if(void 0!==this.vA)e=this.vA;else{var i=this.KM?this.KM.minGapNew:1;e=this.cA(this.ZM*i)}var n=void 0!==this.yA?this.yA:this.La[0].x,r=function(t,e,i){for(var n=[],r=[],o=!1;t.length>0;){for(var s=0;s=i+e){var l=BR(r,i+e/2);void 0!==l&&(n.push(l),t.splice(0,r.length-1)),i+=e;break}}if(r.length=0,!o)break}return n}(this.La,e,n);if(r.length>0){for(var o=0;o0){var n=i.kc.length-1,r=i.kc[n];if(e>0){var o=f(r.dh(),2),s=o[0],a=o[1],l=f(r.lh(),2),h=l[0],u=l[1];if((h?s.length+h.length:s.length)>=i.Jb){var c=h&&h.length>0?h[h.length-1]:s[s.length-1],p=u&&u.length>0?u[u.length-1]:a[s.length-1],y=(c.x+t[0].position)/2,d=si(y,c,m(t[0].position,t[0].high)).y,g=si(y,p,m(t[0].position,t[0].low)).y,S=b(y,d,g);r.gh(S,A(m(y,g),m(y,d))).Kh(!0),i.Kc(i.kA([S].concat(t)).Xh(!0))}else r.gh(t)}}else e>0&&i.Kc(i.kA(t))},i.MA=function(t){var e=i.gA,n=t.length;if(i.gA.length>0){if(n>0){var r=e[e.length-1],o=r.dh(),s=r.lh();if(o.length+s.length>=i.Jb){var a=s.length>0?s[s.length-1]:o[o.length-1],l=(a.x+t[0].x)/2,h=si(l,a,m(t[0].x,t[0].y)).y,u=m(l,h);r.gh(u,A(m(l,h),m(l,h))).Kh(!0),e.push(i.AA([u].concat(t),i.eS).Xh(!0))}else r.gh(t)}}else n>0&&e.push(i.AA(t))},i.FA=function(t){var e=i.bA,n=t.length;if(i.bA.length>0){if(n>0){var r=e[e.length-1],o=r.dh(),s=r.lh();if(o.length+s.length>=i.Jb){var a=s.length>0?s[s.length-1]:o[o.length-1],l=(a.x+t[0].x)/2,h=si(l,a,m(t[0].x,t[0].y)).y,u=m(l,h);r.gh(u,A(m(l,h),m(l,h))).Kh(!0),e.push(i.TA([u].concat(t)).Xh(!0))}else r.gh(t)}}else n>0&&e.push(i.TA(t))},i.CA=function(t,e){var n=t.Kg(e);if(n)return[et(n[0],i.scale,i.Vu.As.Y),et(n[1],i.scale,i.Vu.As.Y)]},i.BA=function(t,e){var n=t.lM(e);if(n)return[et(n[0],i.scale,i.Vu.As.Y),et(n[1],i.scale,i.Vu.As.Y)]},i}return h(i,t),i.prototype.setDataCleaning=function(t){return this.setMaxPointCount(t&&t.minDataPointCount),this},i.prototype.clear=function(){for(var t=0;t0?t:0,this.Vu.Vi(),this},i.prototype.getMaxPointCount=function(){return this.Zb>0?this.Zb:void 0},i.prototype.setCursorResultTableFormatter=function(t){return this.Wp=t,this.Ie.engine.Vi(),this},i.prototype.getCursorResultTableFormatter=function(){return this.Wp},i.prototype.getXMax=function(){return Xt(this.kc,Et,Math.max,Rt,this.eS)},i.prototype.getXMin=function(){return Xt(this.kc,Bt,Math.min,Nt,this.eS)},i.prototype.getYMax=function(){return Xt(this.kc,_t,Math.max,Yt,this.eS)},i.prototype.getYMin=function(){return Xt(this.kc,Ot,Math.min,Ht,this.eS)},i.prototype.Ay=function(){var t,e,i=m(0,0);try{for(var n=c(this.kc),r=n.next();!r.done;r=n.next()){var o=r.value;i.x=Math.max(i.x,o.Ph()),i.y=Math.max(i.y,o.Oh())}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return i},i.prototype.he=function(){return this.Yy&&this.getPointAmount()>0},i.prototype.Wb=function(t){},i.prototype.iS=function(t,e,i){this.La=ce(this.La,t,{canReturnB:!1}),this.mA=ce(this.mA,e,{canReturnB:!1}),this.pA=ce(this.pA,i,{canReturnB:!1}),this.Vu.Vi()},i.prototype.LA=function(t,e,i,n){this.IA(e,i,n),this.iS(Array.isArray(t)?t:[t],e,i)},i.prototype.IA=function(t,e,i){var n=He(Ne(t),Ne(e));this.eS?this.eS=He(this.eS,n):this.eS=n,i&&(this.eS=He(this.eS,i))},i.prototype.mM=function(){var t=this.kc.length,e=Math.min(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd()),i=0;if(t>1)for(var n=0;n0){var r=Math.ceil(i/e),o=t.length-r;if(o>0&&n>0){var s=o-n>0?n:o;if(s>0){for(var a=0;a0?this.kc[this.kc.length-1]:void 0,i=e?e.dh()[0].length+(e.lh()[0]?e.lh()[0].length:0):void 0;Mz(t,i,this.Jb,this.wA)},i.prototype.OA=function(t){var e=this.gA.length>0?this.gA[this.gA.length-1].dh().length+this.gA[this.gA.length-1].lh().length:void 0;Mz(t,e,this.Jb,this.MA)},i.prototype.DA=function(t,e){var i=this.gA.length>0?this.gA[this.gA.length-1].dh().length+this.gA[this.gA.length-1].lh().length:void 0;Mz(t,i,this.Jb,this.MA),Mz(e,i,this.Jb,this.FA)},i.prototype.kA=function(t,e){return this.Vu._A(this.scale).gh(t,e).pn(this.RA.D(this.Ku)).Uh(this.zA.D(this.Ku)).Wh(this.Rh)},i.prototype.NA=function(t,e,i){return this.Vu.ky(this.scale,void 0,[u_.UserSeries]).gh(t,i).setMouseInteractions(!1).ka(e)},i.prototype.AA=function(t,e){return this.NA(t,this.EA.D(this.Ku),e)},i.prototype.TA=function(t,e){return this.NA(t,this.VA.D(this.Ku),e)},i.prototype.GA=function(t){this.RA.C(t);for(var e=this.RA.D(this.Ku),i=0;i0){var e=this.kc.length,i=this.mM();this.qb(this.kc,this.Jb,this.Zb,i);var n=this.kc.length;this.gA.length>0&&this.qb(this.gA,this.Jb,this.Zb,i),this.bA.length>0&&this.qb(this.bA,this.Jb,this.Zb,i),e!==n&&this.Yb(),this.xA=!0}},i.prototype.Xu=function(){var e,i,n,r,o,s;if(t.prototype.Xu.call(this),this.La.length>0&&(this.PA(this.La),this.hF(this.mA,this.pA),this.xA=!0),this.xA){var a=this.getBoundaries();try{for(var l=c(this.kc),h=l.next();!h.done;h=l.next())h.value.eo(a)}catch(t){e={error:t}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(e)throw e.error}}try{for(var u=c(this.gA),f=u.next();!f.done;f=u.next())f.value.eo(a)}catch(t){n={error:t}}finally{try{f&&!f.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}try{for(var p=c(this.bA),y=p.next();!y.done;y=p.next())y.value.eo(a)}catch(t){o={error:t}}finally{try{y&&!y.done&&(s=p.return)&&s.call(p)}finally{if(o)throw o.error}}}},i.prototype.Jy=function(){this.eS=void 0,this.La.length=0,this.mA.length=0,this.pA.length=0},i.prototype.dispose=function(){t.prototype.dispose.call(this);for(var e=0;e0){var i=this.uF(e),n=f(this.cF(i),2),r=n[0],o=n[1];this.LA(i,r,o,A(m(be,this.aF),m(ke,this.aF)));var s=this.La[this.La.length-1];this.Kb=s?{position:s.position,high:s.high,low:s.low}:void 0,this.Fi.emit("dataAdd",this,e,this.eS)}return this},e.prototype.addArrayY=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=0);var n=i;return n||(n=this.Kb?this.Kb.position+e:0),this.add(Iz(t,e,n)),this},e.prototype.$b=function(t){return this.Fi.on("dataAdd",t)},e.prototype.tx=function(t){return this.Fi.off(t)},e.prototype.ix=function(t){return this.Fi.on("dataClear",t)},e.prototype.nx=function(t){return this.Fi.off(t)},e}(UR),WR=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.VA=new v(Q),e}return h(e,t),e.prototype.hF=function(t){return this.OA(t)},e.prototype.cF=function(t){for(var e=t.length,i=Array(e),n=0;n=o){var l=b(s.x,s.y,o);0!==i&&Wt(e[i-1],l)||(e[i]=l,i+=1),a.y=o?((h=pi(m(ke,o),m(be,o),s,a))&&(e[i]=b(h.x,h.y,o),i+=1),e[i]=b(a.x,a.y,o),i+=1):(e[i]=b(a.x,o,o),i+=1)}}return i},e.prototype.Qb=function(){return Az(this.kc,(function(t){return t[0]}))},e.prototype.setFillStyle=function(t){return this.GA(t),this},e.prototype.setFillStyleHighlight=function(t){return this.HA(t),this},e.prototype.getFillStyle=function(){return this.UA()},e.prototype.getFillStyleHighlight=function(){return this.YA()},e.prototype.attach=function(e,i){return void 0===i&&(i=!0),fe(e,this.Ii,{fill:this.RA,stroke:this.EA}),t.prototype.attach.call(this,e,i)},e}(WR),KR=function(t){function e(e,i,n,r,o,s,a,l,h,u,c){var f=t.call(this,e,i,n,r,o,s,a,l,h,u,c)||this,p=e.getSeries().length;return f.RA=new v(Y),f.zA=new v(ge(f.Ii.mountainsInvertedFillStyle,p)),f.EA=new v(ge(f.Ii.mountainsInvertedStrokeStyle,p)),f}return h(e,t),e.prototype.uF=function(t){return this.vF(t)},e.prototype.vF=function(t){var e=[];return 1===t.length?this.lF(t[0],e):this.dF(t,e),e},e.prototype.lF=function(t,e,i){void 0===i&&(i=0);var n=this.aF;return e[i]=t.y>n?b(t.x,n,n):b(t.x,t.y,n),i+1},e.prototype.dF=function(t,e,i){void 0===i&&(i=0);for(var n=0,r=t.length-1,o=this.aF;no?((h=pi(m(ke,o),m(be,o),s,a))&&(e[i]=b(h.x,h.y,o),i+=1),e[i]=b(a.x,o,o),i+=1):(e[i]=b(a.x,a.y,o),i+=1)}else{var h;l=b(s.x,o,o),0!==i&&Wt(e[i-1],l)||(e[i]=l,i+=1),a.y<=o?((h=pi(m(ke,o),m(be,o),s,a))&&(e[i]=b(h.x,h.y,o),i+=1),e[i]=b(a.x,a.y,o),i+=1):(e[i]=b(a.x,o,o),i+=1)}}return i},e.prototype.Qb=function(){return Az(this.kc,(function(t){return t[1]}))},e.prototype.setFillStyle=function(t){return this.WA(t),this},e.prototype.setFillStyleHighlight=function(t){return this.jA(t),this},e.prototype.getFillStyle=function(){return this.Yh()},e.prototype.getFillStyleHighlight=function(){return this.ZA()},e.prototype.attach=function(e,i){return void 0===i&&(i=!0),fe(e,this.Ii,{fill:this.zA,stroke:this.EA}),t.prototype.attach.call(this,e,i)},e}(WR),ZR=function(t){function e(e,i,n,r,o,s,a,l,h,u,c){var f=t.call(this,e,i,n,r,o,s,a,l,h,u,c)||this,p=e.getSeries().length;return f.RA=new v(ge(f.Ii.mountainsFillStyle,p)),f.EA=new v(ge(f.Ii.mountainsStrokeStyle,p)),f.zA=new v(ge(f.Ii.mountainsInvertedFillStyle,p)),f.VA=new v(ge(f.Ii.mountainsInvertedStrokeStyle,p)),f}return h(e,t),e.prototype.uF=function(t){return this.yF(t)},e.prototype.hF=function(t,e){return this.DA(t,e)},e.prototype.yF=function(t){var e=0,i=[],n=t.length,r=this.aF;return n>0&&(this.SF&&(this.SF.y<=r&&r<=t[0].y||this.SF.y>=r&&r>=t[0].y)&&(i[e]=b(.5*(this.SF.x+t[0].x),r,r),e+=1),this.SF=t[n-1],1===n?this.lF(t[0],i,e):this.dF(t,i)),i},e.prototype.lF=function(t,e,i){return void 0===i&&(i=0),e[i]=b(t.x,t.y,this.aF),i+1},e.prototype.dF=function(t,e){for(var i=0,n=0,r=t.length-1,o=this.aF;n=o&&o>=a.y)&&(e[i]=b(.5*(s.x+a.x),o,o),i+=1),e[i]=b(a.x,a.y,o),i+=1}return i},e.prototype.cF=function(t){for(var e=t.length,i=Array(e),n=Array(e),r=this.aF,o=0;or?(i[o]=m(s.position,s.high),n[o]=m(s.position,r)):s.highi||e.y>n){if(!0===this.chart.zr.warnings){var r="HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid "+this.om.columns+"x"+this.om.rows+", input "+e.columns+"x"+e.rows+".\nExcess data will be automatically clipped. This can result in sub-optimal performance.";gt.console.warn(r)}for(var o=[],s=0;sc||u>f){!0===this.chart.zr.warnings&&(r="HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid "+this.om.columns+"x"+this.om.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.",gt.console.warn(r));var p=Math.max(l-c,0),y=e.primary-p,d=Math.max(u-f,0);for(o=[],s=0;s0?-d:void 0);t={iColumn:t.iColumn,iRow:t.iRow,values:o}}this.kc[0].fm({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:a,startSecondary:h,values:t.values})}return this.Fi.emit("invalidateIntensity",this,t),this.Vu.Vi(),this},e.prototype.setFillStyle=function(t){return this.ho.C(t),this.kc[0].pn(this.ho.L()),this.Fi.emit("styleChange",this),this.Vu.Vi(),this},e.prototype.getFillStyle=function(){return this.ho.L()},e.prototype.setCursorResultTableFormatter=function(t){return this.Wp=t,this.Ie.engine.Vi(),this},e.prototype.getCursorResultTableFormatter=function(){return this.Wp},e.prototype.NF=function(t){return this.Fi.on("invalidateIntensity",t)},e.prototype.EF=function(t){return this.Fi.off(t)},e}(aH),hH=function(t){function e(e,i,n,r,o,s,a,l,h,c,f,p){var y=t.call(this,e,i,n,r,o,s,a,l,h,f)||this;y.Uc="Scrolling Heatmap Grid Series",y.Wp=sH,y.nM=!1,y.Ii=f;var d=p;y.ho=new v(Se(f.heatmapGridSeriesFillStyle,d,f.seriesFillStyle)),y.Ga=new v(Se(y.Ii.heatmapGridSeriesWireframeStyle,d,Q));var g=u({scrollDimension:"columns",heatmapDataType:"intensity",start:{x:0,y:0},step:{x:1,y:1}},c);y.om=g;var S=[{type:"DataPattern",args:{pattern:"columns"===g.scrollDimension?g.step.x>0?"ProgressiveX":"RegressiveX":g.step.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}];return y.Kc(y.Vu.VF(y.scale,S,g).pn(y.ho.D(y.Ku)).Ha(y.Ga.D(y.Ku))),y.setMouseInteractions(!1),y}return h(e,t),e.prototype.clear=function(){return this.kc[0].bh(),this.Vu.Vi(),this},e.prototype.setWireframeStyle=function(t){return this.Ga.C(t),this.kc[0].Ha(this.Ga.D(this.Ku)),this.Vu.Vi(),this},e.prototype.getWireframeStyle=function(){return this.Ga.L()},e.prototype.setPixelInterpolationMode=function(t){return t=t||"disabled",this.kc[0].am(t),this.Vu.Vi(),this},e.prototype.getPixelInterpolationMode=function(){return this.kc[0].um()},e.prototype.setCursorInterpolationEnabled=function(t){return this.nM=t,this.Vu.As.Vi(),this},e.prototype.getCursorInterpolationEnabled=function(){return this.nM},e.prototype.setDataCleaning=function(t){return this.kc[0].Pa(t),this.Vu.Vi(),this},e.prototype.he=function(){return this.Yy},e.prototype.Ef=function(){return pe(this.ho)},e.prototype.attach=function(e,i){return t.prototype.attach.call(this,e,i),fe(e,this.Ii,{fill:this.ho}),this},e.prototype.pn=function(t){var e=this;return this.ho.C(t),this.kc.forEach((function(t){return t.pn(e.ho.D(e.Ku))})),this.Vu.Vi(),this},e.prototype.solveNearestFromScreen=function(t,e){void 0===e&&(e=this.nM);var i=et(t,this.Vu.As.Y,this.scale),n=e?this.kc[0].mF(i):this.kc[0].tb(i);if(n)return CV(n,this.scale,this.Wp(new dV,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).vc(),this)},e.prototype.solveNearestFromSegment=function(t,e,i){void 0===i&&(i=this.nM);var n=et(t,this.Vu.As.Y,this.scale),r=i?e.mF(n):e.tb(n);if(r)return CV(r,this.scale,this.Wp(new dV,this,{x:r.x,y:r.y,column:r.column,row:r.column,intensity:r.cellValue}).vc(),this)},e.prototype.Wb=function(t){if(!(t instanceof Ci))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Ci&&t.$t())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")},e.prototype.getXMax=function(){return this.kc[0].Z()||0},e.prototype.getXMin=function(){return this.kc[0].X()||0},e.prototype.getYMax=function(){return this.kc[0].q()||0},e.prototype.getYMin=function(){return this.kc[0].K()||0},e.prototype.Ay=function(){var t,e,i=m(0,0);try{for(var n=c(this.kc),r=n.next();!r.done;r=n.next()){var o=r.value;i.x=Math.max(i.x,o.Ph()),i.y=Math.max(i.y,o.Oh())}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return i},e.prototype.Yc=function(t,e){t.pn(this.ho.D(e)).Ha(this.Ga.D(e)),this.Vu.Vi()},e}(wz),uH=function(t){function e(e,i,n,r,o,s,a,l,h,u,c,f){var p=t.call(this,e,i,n,r,o,s,a,l,h,u,c,f)||this;return p.Wp=sH,p}return h(e,t),e.prototype.addIntensityValues=function(t){var e=t.length,i=t[0].length,n=("columns"===this.om.scrollDimension?t.length:t[0].length,"rows"===this.om.scrollDimension?t.length:t[0].length,0+i-1),r=this.om.resolution-1;if(n>r){if(!0===this.chart.zr.warnings){var o="HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: "+this.om.resolution+", input "+e+"x"+i+".\nExcess data will be automatically clipped. This can result in sub-optimal performance.";gt.console.warn(o)}for(var s=[],a=0;a=4||Math.abs(h.zx.left-y)>=4||Math.abs(h.zx.right-d)>=4||Math.abs(h.zx.top-p)>=4)||t){h.zx={bottom:f,left:y,top:p,right:d},h.Cp.wt(m(b,k));var E=h.getDefaultAxisX(),O=h.getDefaultAxisY();if(E&&O){var _=I(E.Y.At(),O.Y.At(),E.Y.Tt(),O.Y.Tt());h.$p.Fm(_),h.il.Fm(_),h.nl.Fm(_),h.cv&&h.cv();var V=function(t){return function(e,i,n,r){return i.ev(e),e+i.getHeight()*t}};h.WF.reduce(V(-1),0),h.HF.reduce(V(1),0),h.jF.reduce(V(-1),0),h.UF.reduce(V(1),0)}}else h.yT(!0)},h.addAreaSeries=function(t){var e=t&&t.xAxis?t.xAxis:h.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:h.getDefaultAxisY();bH(e,i);var n=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:qR.Positive)(h,h.gS,h.bS,h.$p,e,i,h.ST(e),h.ST(i),h.pv,n,h.Ii,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:h.SS.length);return h.kS(r),r},h.addAreaRangeSeries=function(t){var e=t&&t.xAxis?t.xAxis:h.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:h.getDefaultAxisY();bH(e,i);var n=new JR(h,h.gS,h.bS,h.$p,e,i,h.ST(e),h.ST(i),h.pv,h.Ii,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:h.SS.length);return h.kS(n),n},h.addHeatmapSeries=function(t){var e=t.xAxis?t.xAxis:h.getDefaultAxisX(),i=t.yAxis?t.yAxis:h.getDefaultAxisY(),n=t.type?t.type:rH.Grid;bH(e,i);var r=new n(h,h.gS,h.bS,h.$p,e,i,h.ST(e),h.ST(i),h.pv,u({},t),h.Ii,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:h.SS.length);return h.kS(r),r},h.mT=!1,h.pT=function(){(h.XF||h.ZF)&&(h.cT=h.engine.setMouseStyle(h.oT))},h.gT=function(){h.mT=!1,h.engine.restoreMouseStyle(h.cT)},h.bT=function(t,e,i){var n,r,o=Pt(null===(n=h.zr.overrideInteractionMouseButtons)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),s=Pt(null===(r=h.zr.overrideInteractionMouseButtons)||void 0===r?void 0:r.chartXYPanMouseButton,2);h.engine.restoreMouseStyle(h.cT);var a=h.nc.As.Lr(e.clientX,e.clientY);i===o&&(h.XF||h.ZF)?(h.xT(t,a),ee(e)):i===s&&h.qF&&(h.cT=h.engine.setMouseStyle(h.hT),ee(e))},h.wT=function(t,e,i,n,r){var o,s,a=m(e.clientX,e.clientY),l=Pt(null===(o=h.zr.overrideInteractionMouseButtons)||void 0===o?void 0:o.chartXYRectangleZoomFitMouseButton,0),u=Pt(null===(s=h.zr.overrideInteractionMouseButtons)||void 0===s?void 0:s.chartXYPanMouseButton,2);i===l&&(h.XF||h.ZF)?(h.kT(t,n,a),ee(e)):i===u&&h.qF&&(h.MT($e(r,-1)),ee(e)),h.nc.Vi()},h.AT=function(t,e,i,n){var r,o,s=Pt(null===(r=h.zr.overrideInteractionMouseButtons)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),a=Pt(null===(o=h.zr.overrideInteractionMouseButtons)||void 0===o?void 0:o.chartXYPanMouseButton,2);if(i===s&&(h.XF||h.ZF)){var l=m(e.clientX,e.clientY);h.FT(t,n,l),ee(e)}else i===a&&h.qF&&ee(e);h.engine.restoreMouseStyle(h.cT),h.Cp.getIsUnderMouse()&&(h.cT=h.engine.setMouseStyle(h.oT))},h.TT=function(t,e){if(h.KF){var i=h.nc.As.Lr(e.clientX,e.clientY);h.zoom(i,m(ve(e),ve(e))),ee(e)}},h.CT=function(t,e,i,n,r,o){if(h.qF){var s=m(-(n.x+r.x)/2,-(n.y+r.y)/2);h.MT(s),ee(o)}if(h.KF){var a=h.engine.clientLocation2Engine(e.x,e.y),l=h.engine.clientLocation2Engine(i.x,i.y),u=ei(m(Math.abs(a.x-n.x-(l.x-r.x)),Math.abs(a.y-n.y-(l.y-r.y))),m(Math.abs(a.x-l.x),Math.abs(a.y-l.y)));h.forEachAxisX((function(t){t.getChartInteractionZoomByWheel()&&t.Tn(t.Y.Ut(t.getInterval().start,-u.x),t.Y.Ut(t.getInterval().end,u.x),!1,!0,"interactionZoom")})),h.forEachAxisY((function(t){t.getChartInteractionZoomByWheel()&&t.Tn(t.Y.Ut(t.getInterval().start,-u.y),t.Y.Ut(t.getInterval().end,u.y),!1,!0,"interactionZoom")})),ee(o)}},h.BT=function(t,e,i){(h.ZF||h.XF)&&(h.xT(t,e),ee(i))},h.LT=function(t,e,i,n,r){(h.ZF||h.XF)&&(h.kT(t,e,i),ee(r))},h.IT=function(t,e,i,n){(h.ZF||h.XF)&&(h.FT(t,e,i),ee(n))},h.setPadding({right:24}),h.PT=[dH.gridLine0,dH.gridLine1,dH.gridLine2].map((function(t){return n.ys(t)})),h.il=n.ys(dH.highlightersBelow),h.$p=n.ys(dH.plotting),h.nl=n.ys(dH.highlightersAbove),h.tl=n.ys(dH.fg),h.GF.x.Nt(0,h.uiScale.x.getCellSize()-(h.ct.left+h.ct.right+h.To.left+h.To.right)),h.GF.y.Nt(0,h.uiScale.y.getCellSize()-(h.ct.bottom+h.ct.top+h.To.bottom+h.To.top)),h.GF.wt(h.uiScale.Bt().x,h.uiScale.Bt().y),h.Cp=t.prototype.Fp.call(h,h.ic.tf(h.GF)).pn(h.Ii.seriesBackgroundFillStyle).fs(h.Ii.seriesBackgroundStrokeStyle).Eo(m(0,0)).wt(m(h.GF.getInnerIntervalPixels().x,h.GF.getInnerIntervalPixels().y));var f=Pt(a?a.autoCursorBuilder:void 0,dz);h.Tp=f.xp(h.nc,h.GF,h.GF,h.Ii),h.addAxisX(a&&a.defaultAxisX),h.addAxisY(a&&a.defaultAxisY),h.onResize(h.dT),h.Cv.Sn("ChartXY");var p=ME(new AE.Drag(h.BT,h.LT,h.IT,1),new AE.Pinch(Mt,h.CT,Mt));return h.onSeriesBackgroundMouseEnter(h.pT),h.onSeriesBackgroundMouseLeave(h.gT),h.onSeriesBackgroundMouseWheel(h.TT),h.onSeriesBackgroundMouseDragStart(h.bT),h.onSeriesBackgroundMouseDrag(h.wT),h.onSeriesBackgroundMouseDragStop(h.AT),h.onSeriesBackgroundTouchStart(p.onTouchStart),h.onSeriesBackgroundTouchMove(p.onTouchMove),h.onSeriesBackgroundTouchEnd(p.onTouchEnd),a&&!0===a.disableAnimations&&h.setAnimationsEnabled(!1),h.Tv(s,h.GF),h}return h(i,t),i.prototype.getMinimumSize=function(){var t=this.GF.Ct(),e=this.GF.pi();return m(Math.max(t.x+yH.x,this.Cv.isDisposed()?0:this.Cv.Un().Bt().x/e.x),t.y+yH.y+this.Pv())},i.prototype.getSeries=function(){return this.SS},i.prototype.addChartMarkerXY=function(t,e,i){void 0===t&&(t=gz);var n=new bz(this.nc,this.uiScale,e||this.getDefaultAxisX(),i||this.getDefaultAxisY(),t,this.Fb,this.Tb,this.Ii);return this.Av(n),n},i.prototype.addAxisX=function(t){var e,i=xH(t),n=i.opposite,r=i.type;(e="linear"===r.type?this.sv.d1({dimension:"x",scale1DConstructor:Ii}):"linear-highPrecision"===r.type?this.sv.d1({dimension:"x",scale1DConstructor:Ii}).Qt():this.sv.d1({dimension:"x",scale1DConstructor:Si}).Wt(r.base)).wt(this.GF.x.Bt());var o=n?this.HF:this.WF,s=new YO(this.ic,this.PT,this.tl,this.nc,this.il,this.nl,e,this.GF.y,ON,this,n?100:0,this.el,this.rl(o),this.vT,this.Ii,!this.Gi,r);return o.push(s),this.nc.Vi(),s},i.prototype.addAxisY=function(t){var e,i=xH(t),n=i.opposite,r=i.type;(e="linear"===r.type?this.sv.d1({dimension:"y",scale1DConstructor:Ii}):"linear-highPrecision"===r.type?this.sv.d1({dimension:"y",scale1DConstructor:Ii}).Qt():this.sv.d1({dimension:"y",scale1DConstructor:Si}).Wt(r.base)).wt(this.GF.y.Bt());var o=n?this.UF:this.jF,s=new YO(this.ic,this.PT,this.tl,this.nc,this.il,this.nl,e,this.GF.x,_N,this,n?100:0,this.el,this.rl(o),this.vT,this.Ii,!this.Gi,r);return o.push(s),this.nc.Vi(),s},i.prototype.dispose=function(){return this.$p.ks(),this.tl.ks(),this.PT.forEach((function(t){return t.ks()})),this.nl.ks(),this.il.ks(),this.FF().forEach((function(t){return t.dispose()})),KO(this.GF),t.prototype.dispose.call(this)},i.prototype.getDefaultAxisX=function(){return this.WF[0]?this.WF[0]:this.HF[0]},i.prototype.getDefaultAxisY=function(){return this.jF[0]?this.jF[0]:this.UF[0]},i.prototype.getDefaultAxes=function(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]},i.prototype.getAxes=function(){for(var t=this,i=[],n=0;n0?new Set(i):gH;return Ft(Array.from(r).map((function(i){switch(i){default:case e.AxisPosition.Top:return t.HF;case e.AxisPosition.Bottom:return t.WF;case e.AxisPosition.Left:return t.jF;case e.AxisPosition.Right:return t.UF}})))},i.prototype.OT=function(t){var e;return this.forEachAxisX((function(i){e=t===i?"x":e})),this.forEachAxisY((function(i){e=t===i?"y":e})),e},i.prototype.forEachAxisX=function(t){this.WF.forEach(t),this.HF.forEach(t)},i.prototype.forEachAxisY=function(t){this.jF.forEach(t),this.UF.forEach(t)},i.prototype.Xu=function(){var e,i,n,r,o,s;t.prototype.Xu.call(this);try{for(var a=c(this.SS),l=a.next();!l.done;l=a.next())l.value.qy()}catch(t){e={error:t}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(e)throw e.error}}try{for(var h=c(this.SS),u=h.next();!u.done;u=h.next())u.value.Xu()}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}this.forEachAxis(SH),this.Bp(),this.yT(),t.prototype.Fv.call(this);try{for(var f=c(this.SS),p=f.next();!p.done;p=f.next())p.value.Jy()}catch(t){o={error:t}}finally{try{p&&!p.done&&(s=f.return)&&s.call(f)}finally{if(o)throw o.error}}this.In()},i.prototype.Ot=function(){for(var e=0;e=10;o&&l&&s.x===n.x&&this.XF?(this.$F.pn(this.nT).fs(this.eT),this.tT.ka(Q),this.iT.ka(Q),this.cT=this.engine.setMouseStyle(this.aT,this.cT)):o&&l&&a.x===n.x&&this.ZF?(this.$F.pn(this.rT).fs(this.sT),this.tT.ka(this.sT).Ca(n).Sa(r),this.iT.ka(this.sT).Ca(m(n.x,r.y)).Sa(m(r.x,n.y)),this.cT=this.engine.setMouseStyle(this.uT,this.cT)):(this.$F.fs(Q).pn(Y),this.tT.ka(Q),this.iT.ka(Q),this.engine.restoreMouseStyle(this.cT)),this.nc.Vi()},i.prototype.FT=function(t,e,i){var n=this;if(this.mT){var r=et(this.engine.clientLocation2Engine(e.x,e.y),this.nc.As.Y,this.GF),o=et(this.engine.clientLocation2Engine(i.x,i.y),this.nc.As.Y,this.GF),s=Le(o.x,this.GF.x.getInnerStart(),this.GF.x.getInnerEnd())&&Le(o.y,this.GF.y.getInnerStart(),this.GF.y.getInnerEnd()),a=this.$F.Vo(),l=ti(a,this.$F.Bt()),h=Math.min(this.$F.Bt().x,this.$F.Bt().y)>=10;s&&h&&At(a.x,r.x)&&this.XF?(this.forEachAxisX((function(t){if(t.getChartInteractionZoomByDrag()){var e=et(a,n.GF,t.zd).x,i=et(l,n.GF,t.zd).x;t.Tn(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((function(t){if(t.getChartInteractionZoomByDrag()){var e=et(a,n.GF,t.zd).y,i=et(l,n.GF,t.zd).y;t.Tn(e,i,!0,!0,"interactionSetInterval")}}))):s&&h&&At(l.x,r.x)&&this.ZF&&this.forEachAxis(mH)}this.$F.fs(Q).pn(Y),this.tT.ka(Q),this.iT.ka(Q),this.mT=!1,this.nc.Vi()},i.prototype.pan=function(t){this.forEachAxisX((function(e){e.stop().pan(t.x)})),this.forEachAxisY((function(e){e.stop().pan(t.y)}))},i.prototype.MT=function(t){this.forEachAxisX((function(e){e.getChartInteractionPanByDrag()&&e.stop().pan(t.x)})),this.forEachAxisY((function(e){e.getChartInteractionPanByDrag()&&e.stop().pan(t.y)}))},i.prototype.zoom=function(t,e){this.forEachAxis(vH),this.forEachAxisX((function(i){i.zoom(i.Y.j(t.x),e.x)})),this.forEachAxisY((function(i){i.zoom(i.Y.j(t.y),e.y)}))},i.prototype.DT=function(t,e){this.forEachAxis(vH),this.forEachAxisX((function(i){i.getChartInteractionZoomByWheel()&&i.zoom(i.Y.j(t.x),e.x)})),this.forEachAxisY((function(i){i.getChartInteractionZoomByWheel()&&i.zoom(i.Y.j(t.y),e.y)}))},i.prototype.setAnimationsEnabled=function(t){return this.Gi=!!t,this.forEachAxis((function(e){return e.setAnimationsEnabled(t)})),this},i.prototype.getAnimationsEnabled=function(){return this.Gi},i.prototype.disableAnimations=function(){return this.setAnimationsEnabled(!1),this},i.prototype.Xf=function(){var e=[];return this.forEachAxis((function(t){return t.Zd((function(t){return e.push(t)}))})),t.prototype.Xf.call(this).concat(e)},i.prototype.FF=function(){return this.QF},i.prototype.Je=function(){return this.Ov(this.$p)},i.prototype.setMouseInteractionsWhileScrolling=function(t){return this.Om=t,this},i.prototype.getMouseInteractionsWhileScrolling=function(){return this.Om},i.prototype.setMouseInteractionsWhileZooming=function(t){return this.JF=t,this},i.prototype.getMouseInteractionsWhileZooming=function(){return this.JF},i.prototype.forEachAxis=function(t){this.forEachAxisX(t),this.forEachAxisY(t)},i.prototype.In=function(){Q_(this,this.SS)},i}(VV),MH=function(t){return t instanceof Tz||t instanceof XR||t instanceof JR||t instanceof lH||t instanceof VR||t instanceof pR},AH=function(){function t(t,i,n,o,s,a,l,h,y){var d,g,S=this;this.zr=t,this.Fi=new r.Eventer,this._T=new Map,this.SS=new Map,this.RT=function(t,e){var i=t.series;S.zT&&(e instanceof JR||e instanceof pR||e instanceof lH||e instanceof Tz||e instanceof XR||e instanceof VR)&&S.zT(i,e)},this.NT=function(t){var e=t.map((function(t){return t.cn.type}));if(1!==p([],f(new Set(e))).length)throw new Error("All ZoomBandChart axes must be of the same type")},this.ET=function(t,e){0!==S.SS.size&&void 0!==p([],f(S.SS.values())).find((function(t){return!1===t.series.isDisposed()}))||S.VT.Tn(t,e,!1,!1,"zoomBandChart")},this.attachedAxes=Array.isArray(s)?s:[s],this.attachedAxis=this.attachedAxes[0],this.NT(this.attachedAxes);var v=this.attachedAxes[0].chart.OT(this.attachedAxes[0])||"x";this.GT=v,this.rc="x"===v?LN:PN;var m=this.attachedAxes[0].onScaleChange(this.ET);this.HT=function(){return S.attachedAxes[0].offScaleChange(m)};var x,b=this.rc.toVec2("linear"===(x=this.attachedAxes[0].cn).type||"linear-highPrecision"===x.type?x:{type:"logarithmic",base:"number"==typeof x.base?x.base:"e"===x.base?"e":function(){throw new Error("Unhandled logarithmic base: "+x.base)}()},void 0),k=b.x,w=b.y;this.WT=new wH(t,i,n,o,l,u(u({},h),{defaultAxisX:k,defaultAxisY:w}),y).setTitle("Zoom Band Chart").setMouseInteractions(!1).setAutoCursorMode(e.AutoCursorModes.disabled),this.engine=this.WT.engine;var M=this.WT.getDefaultAxisX().setMouseInteractions(!1),A=this.WT.getDefaultAxisY().setMouseInteractions(!1);this.VT=this.rc.getWidth({x:M,y:A}).setScrollStrategy(Li.fitting).setAnimationScroll(!1),this.jT(this.rc.getHeight({x:M,y:A})),this.VT.Fn(this.attachedAxes[0].An()),this.band=this.VT.addBand(a),this.UT(this.band,this.attachedAxes);for(var I=0;I1&&ot.apply(void 0,p([],f(e))),e[0].onScaleChange((function(e,i){if(!r){o=!0;var s=gt.performance.now();n=s,t.setValueStart(e).setValueEnd(i),requestAnimationFrame((function(){return requestAnimationFrame((function(){n!==s||(o=!1)}))}))}})),t.onValueChange((function(t,n,s){if(!o){r=!0;var a=gt.performance.now();i=a,e[0].Tn(n,s,!1,!0,"zoomBandChart"),requestAnimationFrame((function(){return requestAnimationFrame((function(){i!==a||(r=!1)}))}))}}))},t.prototype._l=function(t){var e=this.rc.getHeight({x:t.axisX,y:t.axisY}),i=this._T.get(e);i||(0===this._T.size?i=this.rc.getHeight({x:this.WT.getDefaultAxisX(),y:this.WT.getDefaultAxisY()}):(i=this.rc.getHeight({x:this.WT.addAxisX.bind(this.WT),y:this.WT.addAxisY.bind(this.WT)})(),this.jT(i))),this._T.set(e,i);var n,r,o=this.rc.getWidth({x:this.VT,y:i}),s=this.rc.getHeight({x:this.VT,y:i});if(t instanceof JR){var a=n=this.WT.addAreaRangeSeries({xAxis:o,yAxis:s});a.add(t.Qb());var l=t.$b((function(t,e,i){return a.add(e)}));r=function(){return t.tx(l)}}else if(t instanceof pR){var h=t.gM,c=n=this.WT.addStepSeries({mode:h,xAxis:o,yAxis:s});c.add(t.Qb());var f=t.$b((function(t,e,i){return c.add(e)}));r=function(){return t.tx(f)}}else if(t instanceof lH){var p=u(u({},t.OF),{xAxis:void 0,yAxis:void 0}),y=this.WT.addHeatmapGridSeries(p);n=y;var d=function(){y.setWireframeStyle(t.getWireframeStyle()).setPixelInterpolationMode(t.getPixelInterpolationMode()).setFillStyle(t.getFillStyle())};d();var g=t.RF(d);t._F(y);var S=t.NF((function(t,e){y.invalidateIntensityValues(e)}));r=function(){t.zF(g),t.EF(S)}}else{var v=this.WT.addLineSeries({xAxis:this.rc.getWidth({x:this.VT,y:i}),yAxis:this.rc.getHeight({x:this.VT,y:i})});if(n=v,t instanceof VR){var m=function(t){for(var e=[],i=t.length,n=0;n=0&&cu:f100-p||-1===h&&u<0+p){a.fill(0);break}a[c]=u-f,u+=p*h}return a},LH=function(){function t(t,i,n,o,s){var a=this;this.zr=t,this.XT=i,this.ZT=o,this.KT=new Array,this.Fi=new r.Eventer,this.qT=[],this.hv=[],this.JT=void 0,this.QT=void 0,this.$T=function(t){var e=f(t,2),i=e[0],n=e[1];a.uiScale.wt(i,n),a.engine.Vi()},this.tC=function(){for(var t=function(t,e,i){var n=ME(new AE.Drag(i?a.iC:a.nC,(function(t,n,r,o,s){a.eC(o,e,i),ee(s)}),i?a.rC:a.sC));t.setMouseEnterEventHandler(i?a.iC:a.nC).setMouseLeaveEventHandler(i?a.rC:a.sC).setMouseDragEventHandler((function(t,n,r,o,s){a.eC(s,e,i),ee(n)})).setTouchStartEventHandler(n.onTouchStart).setTouchMoveEventHandler(n.onTouchMove).setTouchEndEventHandler(n.onTouchEnd);var r=a.oC.L();r instanceof J&&r.fillStyle instanceof K&&i?t.ka(r.setFillStyle(r.fillStyle.setAngle(90))):t.ka(r),t.dispose()},e=0;e=0&&a.qT.splice(e,1)},this.vv=function(t){var e=a.hv.indexOf(t);e>=0&&a.hv.splice(e,1)},this.vC=function(t){a.qT.includes(t)||a.qT.push(t)},this.Sv=function(t){a.hv.includes(t)||a.hv.push(t)},this.yC=function(t,e,i,n,r){if(a.SC(e,i,n,r)){var o={panel:t,columnIndex:e,rowIndex:i,columnSpan:n,rowSpan:r};return a.KT.push(o),a.mC(e,i,n,r),a.pC(o),t}throw new st("Out of dashboard range.")},this.hC=i.numberOfRows,this.cC=i.numberOfColumns;var l=this.hC*this.cC;this.uC=new Array(this.hC-1),this.fC=new Array(this.cC-1),this.gC={x:new FH(new Array(this.cC).fill(1)),y:new FH(new Array(this.hC).fill(1))},this.Ii=i.theme||FB,this.oC=new v(this.Ii.dashboardSplitterStyle),this.bC=!!i.disableAnimations,this.xC=IH(n,l+1,1),this.aC=n.xv(0),this.wC=this.xC(l).gv,this.bv=n.xv(Number.MAX_SAFE_INTEGER-1);var h=n.Bt();this.uiScale=$.d2({scaleXYConstructor:Ci}).vi(0,100).yi(0,100).wt(h),this.kC=n.MC.bind(n),this.AC=n.FC.bind(n),this.TC=n.CC.bind(n),this.BC=n.LC.bind(n),this.ss=n.ss.bind(n),this.hs=n.hs.bind(n),this.engine=n.Yr,this.tC(),n.bs(this.$T),n.Vi(),this.IC();var u=function(t,e){return{on:t.on.bind(t,"dashboard-resize"),off:t.off.bind(t)}}(this.Fi);this.createChartXY=function(t){var e=PH(t,a.XT,a.bC);return a.yC(new wH(a.zr,a.xC(a.PC(t.columnIndex,t.rowIndex)),a.OC(e,a.gC),a.lC,s,e,u),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=function(t){var e=PH(t,a.XT,a.bC);return a.yC(new DN(a.zr,a.xC(a.PC(t.columnIndex,t.rowIndex)),a.OC(e,a.gC),a.lC,s,e,u),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=function(t){var e=PH(t,a.XT,a.bC);return a.yC(new Ez(a.zr,a.xC(a.PC(t.columnIndex,t.rowIndex)),a.OC(e,a.gC),a.lC,s,e,u),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=function(t){var e=PH(t,a.XT,a.bC),i=e&&e.type?e.type:b_;return a.yC(new i(a.zr,a.xC(a.PC(t.columnIndex,t.rowIndex)),a.OC(e,a.gC),a.lC,s,u,e.theme),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=function(t){var e=PH(t,a.XT,a.bC),i=e&&e.type?e.type:nN;return a.yC(new i(a.zr,a.xC(a.PC(t.columnIndex,t.rowIndex)),a.OC(e,a.gC),a.lC,s,u,e.theme,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=function(t){var e=PH(t,a.XT,a.bC),i=e&&e.type?e.type:Wz;return a.yC(new i(a.zr,a.xC(a.PC(t.columnIndex,t.rowIndex)),a.OC(e,a.gC),a.lC,s,u,e.theme),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=function(t){var e=PH(t,a.XT,a.bC),i=t&&t.type?t.type:fN;return a.yC(new i(a.zr,a.xC(a.PC(t.columnIndex,t.rowIndex)),a.OC(e,a.gC),a.lC,s,u,e.theme),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=function(t){var e=PH(t,a.XT,a.bC);return a.yC(new ZO(a.zr,a.xC(a.PC(t.columnIndex,t.rowIndex)),a.OC(e,a.gC),a.lC,s,u,e.theme),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=function(t){var e=PH(t,a.XT,a.bC);return a.yC(new lV(a.zr,a.xC(a.PC(t.columnIndex,t.rowIndex)),a.OC(e,a.gC),a.lC,s,u,e.theme),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=function(t){var e=PH(t,a.XT,a.bC),i=void 0===e.bandAboveSeries||e.bandAboveSeries;return a.yC(new AH(a.zr,a.xC(a.PC(t.columnIndex,t.rowIndex)),a.OC(e,a.gC),a.lC,e.axis,i,s,e,u),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=function(t){var e=PH(t,a.XT,a.bC);return a.yC(new zV(a.zr,a.xC(a.PC(t.columnIndex,t.rowIndex)),a.OC(e,a.gC),a.lC,s,e,u),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=function(t){var e=PH(t,a.XT,a.bC),i=new sV(a.zr,a.xC(a.PC(t.columnIndex,t.rowIndex)),a.OC(e,a.gC),a.lC,s,u,e);return a.yC(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}return t.prototype.PC=function(t,e){return t+e*this.cC},t.prototype.OC=function(t,e){var i=this;return{d1:function(n){return new n.scale1DConstructor("x"===n.dimension?t.columnIndex:t.rowIndex,"x"===n.dimension?t.columnSpan:t.rowSpan,"x"===n.dimension?i.cC:i.hC,"x"===n.dimension?e.x:e.y)},d2:function(n){return(new n.scaleXYConstructor).W({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:i.cC,y:i.hC},e)}}},t.prototype.setWidth=function(t){return t instanceof Array||(t=[t,t]),this.kC(t[0]),this.AC(t[1]),this},t.prototype.setHeight=function(t){return t instanceof Array||(t=[t,t]),this.TC(t[0]),this.BC(t[1]),this},t.prototype.getWidth=function(){return this.ss()},t.prototype.getHeight=function(){return this.hs()},t.prototype.setBackgroundFillStyle=function(t){return this.engine.setBackgroundFillStyle(t),this.aC.Vi(),this},t.prototype.getBackgroundFillStyle=function(){return this.engine.getBackgroundFillStyle()},t.prototype.setBackgroundStrokeStyle=function(t){return this.engine.setBackgroundStrokeStyle(t),this.aC.Vi(),this},t.prototype.getBackgroundStrokeStyle=function(){return this.engine.getBackgroundStrokeStyle()},t.prototype.getTheme=function(){return this.Ii},t.prototype.setSplitterStyle=function(t){var e=this.oC.D(!1);return this.oC.C(t),this.DC(e),this},t.prototype.getSplitterStyle=function(){return this.oC.D(!1)},t.prototype.setSplitterStyleHighlight=function(t){var e=this.oC.D(!1);return this.oC.I(t),this.DC(e),this},t.prototype.getSplitterStyleHighlight=function(){return this.oC.D(!0)},t.prototype.DC=function(t){var e,i,n,r,o=f([this.oC.D(!1),this.oC.D(!0)],2),s=o[0],a=o[1];try{for(var l=c(this.fC),h=l.next();!h.done;h=l.next())(y=h.value).ka(y.Ma()===t?s:a)}catch(t){e={error:t}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(e)throw e.error}}try{for(var u=c(this.uC),p=u.next();!p.done;p=u.next()){var y;(y=p.value).ka(y.Ma()===t?s:a)}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}this.IC()},t.prototype.setColumnWidth=function(t,e){var i=this.gC.x.S();t>=0&&t=e.length)throw new st("Column index is out of dashboard range.");return e[t]},t.prototype.setRowHeight=function(t,e){var i=this.gC.y.S();t>=0&&t=e.length)throw new st("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]},t.prototype.eC=function(t,e,i){var n,r;i&&Math.abs(t.x)>0?this._C(e,t.x):!i&&Math.abs(t.y)>0&&this.RC(e,t.y),this.Fi.emit("dashboard-resize");try{for(var o=c(this.KT),s=o.next();!s.done;s=o.next())s.value.panel.Dt()}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}this.engine.Vi()},t.prototype.RC=function(t,e){var i=this,n=DH(this.KT,this.uC,t,e,this.uiScale.y.getPixelSize(),!1),r=[],o=0;n.forEach((function(t,e){var n=i.uC[e].si();if(n){var s=n.y+t;i.uC[e].Ca(m(0,s)),i.uC[e].Sa(m(100,s));var a=(s-o)/100;r[e]=a,o=s}})),r[this.hC-1]=1-o/100,this.gC.y.l(r)},t.prototype._C=function(t,e){var i=this,n=DH(this.KT,this.fC,t,e,this.uiScale.x.getPixelSize(),!0),r=[],o=0;n.forEach((function(t,e){var n=i.fC[e].si();if(n){var s=n.x+t;i.fC[e].Ca(m(s,0)),i.fC[e].Sa(m(s,100));var a=(s-o)/100;r[e]=a,o=s}})),r[this.cC-1]=1-o/100,this.gC.x.l(r)},t.prototype.mC=function(t,e,i,n){var r=e-1,o=e-1+n,s=t-1,a=t-1+i;r>=0&&this.uC[r].restore(),o=0&&this.fC[s].restore(),a=0&&t>=0&&e+n<=this.hC&&t+i<=this.cC},t.prototype.pC=function(t){var e=this.oC.L(),i=e===Q?0:e.thickness/2,n={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Zo(n)},t.prototype.IC=function(){var t,e;this.uiScale.x.Mt([0,0]),this.uiScale.y.Mt([0,0]);try{for(var i=c(this.KT),n=i.next();!n.done;n=i.next()){var r=n.value;this.pC(r)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}this.engine.Vi()},t}(),PH=function(t,e,i){var n,r,o=u(u({},t),{columnSpan:t.columnSpan||1,rowSpan:t.rowSpan||1,theme:t.theme||e.theme,disableAnimations:void 0!==t.disableAnimations?t.disableAnimations:i});return o.rowIndex=(n=o.rowIndex,r=o.rowSpan,e.numberOfRows-(n+r)),o},BH="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAfCAMAAAAyYMTAAAAC/VBMVEUAAABcXE1CQkJDQEDg4uLb3NyOjY3a2trq7OxCQUHZ2dkvLy9BPz/R0dE/Pz9FRETHx8ejo6PX2Ng+PT1FRUWrqqrIycm5urpCQUHq6urKyspDQkLh4uLO0NDR0tJ/f3/i4+NgXl7q6+vq6urj5uZAQEDm5+fCw8OOjY2Hh4f6yQJHRUKcnJzMzMxOSz9paGiAgIDY2dlTUVFGRUXa29vY2dnr6+vW19fr6+tBQUFERETo6+vY2NhAQEA/Pz92dnaoqKjn6OjR0tLP0NCmpqaSkpLQ0dHDxMRbWlqGhobBwsKNeSlmZmZFQ0PY2dno6OixsbHb29udnZ3m5uZFREPj5OSWlpbDw8NFRENmZmbIycnb3NzWrg+KiorZ2tq1tbXCoBbT1NReVjpiWTh2aDHX2Nh2dXXZ2trMzMxEQkJZWVne399FRERNTEzf4eFISEhAQEA8PDzU1NSLi4v9ywJFREPW1tb2xgPovAiYmJjf4OB6enrftAyLi4tLSEG6u7t2dnZ6enpWUDzLzMylpqZXV1fFxcWXmJiRkZFDQ0Oenp7o6ura2tqAgIB0c3OgoaHX19fh4uLa29taWFi8vr5oZmadnZ1UU1O9vb28vLzvwAbf39+KiYl1dHTLzMyEg4PitgvMpxLIpBSampq7u7uxlBu3t7epjR9pXzXg4eGFhYXg4OCoqKi8vb2FhYX+zABiYWHDxMT8ygFaWlrFxcWnp6ff4eHExcVjZGShoqKDgoLp7Oy3t7fHx8fW2NjruwCniDV6enrT09O8nBhxcHBmXDechCOCcC2ysrJkY2NQT09wb2/R0tKbm5tcXFzm6OhJSUnr6+v9zABtYjL8ygB8fHxiYmJnZ2ehoaGtra3+zADc3d3HpRRPT0+Hh4f9ywB6enr8ywCTk5P8zAD6zABEQ0Pr7Oz+zADo6enNzc3j4+Pb29vFxcXe39/W1ta3t7dvbm7+/v7q6+u9vb1cW1tPTk7IyclFREOWlZV+fn5mZmb29vZXVlbv7+9HRka4S7StAAAA5XRSTlMAAmJE1Sn+DGhPEgciCC38BfljGQ397u1dL/VZIRz+0sycUUUcFP37+ff14dnV1dTGxKGYkFlXQTw6NjU1MSn8+/f27OLh29nX1NLAmGhNS/769vTw7+/r5+Xf3dnX0NDOy8fFwLauqZ6HhHh2cnFCPRAP/Pr49e/m4+Hg397b2dXRzczMwsC1p6eknp6ckIKAfWdkYk8oHfzy7ezr6OLi4dPRy8nIxcXDvbq1tLOrqKWjmZiOjYd3dW1jXkw9LwwF497LyMTCwLq4rqmclpORj2NdWEdDPy7o2MGypYeBenZSS0AsNPhBGgAAB1RJREFUWMPFmHVUFGEQwGc5OC7xOE/lEFBJQWyQFFQQEAW7u7u7u7u7u7u7u7tzZ/eOUux8fvvtofhO78zn74+b2Xuzb383M7vv3YIA0yYf+wNqtFTC32SSPRA0E+AnaMlaYCQVh+/ieigmZpgd/AL5zwHBPrsErOKVhbWEA/P4/hP4LnY5irYs5Dz9V7Ty/LRWe9acLAVMyesCd7qv3w8/0nIAiG0GsE+bqAZNEAAEqUkTXYRvghhSoAgK1IAiMFAhjC4xUJGh1T4xsBMowoU8HL6PhDVnxUIa+h1fwPldArCkNfgIBMTX7Zl9GhM1FZhuIwACVsGE+DLR8Qyc6b+k5+TwmLqls08DTeEhfatHiVpRgxeXdp6miFKRbRvi9RNaWehEq8zihHY14jhu0WWwpMUEzrsQXmukjlkTDWtXQXh2R4BDRVzmjdQp+4+FFiWKKr0axkXA+GjQRifAVIOo1S0uBNb4Q/xYgIZxYF0r36JGQijLcUuJYh+uy/EsNha03ObF1I/L2m5OR5LPVAWVYCb0dnbY11+uzbFdq23aF1rMVYK62yittvVM1Zi5mXZLTsZdoeMUR3Ct1ca61tHu3GFBzo+0KR+7guOOsqwFLbLybXLqYMIckrtUb69xDm14Kn5c6/nKSdlyEYZCi4EAilK9SV4zYtiRb1c+PEcEOaFd36zWtKosJTZdarDsco5wrGsPrk8WK1oOQtBWAoDE6OKwZF2s0/aeDU9BYgkGCFSLKTWZ5hvrAkCMqOVMtAJvqMjYGw4FK1qDenACTdgCNPqRSTZmf0ZL4byTcalXUwlTfPyzuvrEOoEm+3hGk6igWnDipj3YhcNen2nqgFKiVmp9e0W9mgzsndE/p2WtrsSCUuf1Qo6b1Z2mrGUtV3+qBbuy1YovKCeXy1EQoH4k2bSrjrXyD2kD28kxHChdvdaSkwAjZsYW8t8MBPWQXNVjBwhC2ecqLWr1q8NlIPg1oXNsZEULQnRizOrkRFckIpTkEiB45bTpwICyAxAYSYK8o1BtE+El/o7iug42EYJfVFGwpNXEj8tMj66Nad9ErX+HNrqDBa0aDTjKguWcyAq2SheOG8T+a609ccyPtRrN4iiHq9Sgkd6ADbiFrEnrv7B/U8ZOUZmMnWrCDfqvWpc4il9jltBYvBfp8579r1rrxbXqJz4munMZO5XPTEsjk9FV0MvCIINgmSdQ3GVq+IKHzAXM8XS/KJPtFivN0ciKCYEJ81ALM+zCERpUYUWOkdyUmmnpsSK9cZrjYsigHo4DSmWjHL7Qi377Lfaj05HgrKKV5tihT1ZidX7NiGGuAA9NayUiPOEL/EhrN85QCXG87wbIoCqfIHYCXxWHLwz3NR/9Skz1Pdi7d0FXTCaV5hRDR4b0eV3+wbtO0BnStTLxus9SMXn3lI18+zbyUyatMViJDjG37XTQj85ta2s7RYF8bduV5WFbL0yx3RJsS1itBxfbprrWJM09RgEQRiv3lEfjUC86YFKZ+7YemNxCxUQG2pG40m51VaxoOwUmjYuKybkMDvhxPb5pT5N+YsyW9OKZm+HZ00xa9bCu2JhUiQfPG5KN2CwYUwypyF9f64avKhyciKmGJCyldMcKHeuhm8GI9aFYOv8q2RvLrcYSKhBoTYpSSJGi+vPnyTxuhcKYZsDFsUk4o8IGcF02/OyWEXCFu3WZzQwdp0nr6YtvtCrjaSGUx7TpVfmaCfKKfFsZVnOyqYg7sg7GgaERTXGA0w5MLR6A1ch0izqNwmyKksaaNnJvY86qWAYoYlFSKIRIJPL66A+z0+9uxDKq2ekXQsly3Vt2ZrgcNm06IGHNoFov36e9fPryq5Yn8m2FOBErEbPi0AndJM2xEDAljTmhNrYim04+7PC5qjAWUqAhBNphtYtCk1ww+TpiM6DUpkU+quDclUuW5LGMmk+VPBrQyp53k4CASj4d4ArAj7TYd7zhZaaVd8cUifhz67ZGR4BgTPOqjeWEizow3ily0PBJcrq5s7FcMFbQAZEOwJ7CmSXUiGNBgPEmRe7o2Kmkt+ObNylYLgzTSJOAhq9Y0GI/pBozdWsb4sYwvd6+F57Wopu+kwwrQWXSqPKYTemJKVdpoyAA+6p5oxNpFACR3oLOdp22YWnohqWKeXh4uJiKSpdHn/Y6nbe3zW6sJN6IPmprWtKPwm7hu292qzBSdvF8gr0bTct4kkbBRHJReyPiMKFRpKpZGHkEZEzXtSISyMHOFJoMdzcV6dNR4FXoGHHpghBxq5X/iW/ev00mK/+mM9FyAhNnfX19O3fuPNnfNwSuzc8rTcJyntUilbBTehLgQV5pwT3SggCjpG3t8kYqt0rPgdr/rQNMnZNXauTJ4k0mp0ilG/aaimCscCiN1I2XbgaBdXlJYvlf9VODweD4MtlgePWBdQBz9DKZ7Dwmy8EqwaRyNKaFgBl//A7CnOaImJ4cx4BVCguVz4cy8Ev85huba0WKFCnaVgfWmSpUJijh1/gMHDQcrlbMjHoAAAAASUVORK5CYII=",EH="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAfCAMAAAAyYMTAAAABFFBMVEUAAACEhITm7OygnZ3c3986OjrKy8vW1tYiIiI5OTnf399DQ0Onp6fX19eHh4fOzs7j4+OWlpaRkZGrrq6kpKShoqKhoaG/v78rKyt3d3d8e3ucmpq1tbV3d3dbW1t/f3+bm5vIycmCgYG4ubmVlZWNiYl0dXXR0dGCgYHExcU+Pj6hn5+UlJRta2uDg4O5ubmvr6+8vb2oqamnqqpISEhJSUmopqa6urqSlJSxsbHo6Ohsamre3t6FhIRfX1+BgYGKiorExMSVlZWbmZmgoKCoq6u5urpTUVFzc3NgYGDm5+fHx8fAwMCurq7T1dVMS0vExMSHhoZqaWmSkpKwsLDk5OR2dnasrKyMjIyenp6SkpKloaEjfdvjAAAAXHRSTlMAJydHDgolBwMOCQgCEw4FDENAPkM1JSQGMStFODQXCi0eNyolPSclLxkXRColGwk7MCkkFRFBPjUlJCklNCYiFQ48ODEtNSIfHBpIQTQgG0Q7LiAeFgUWET0wPfWkCs4AAAXUSURBVFjDxZiJUhpBEIZ7d3bZ2+VmWYRwX3IrIKAiKIJJjPeR5P3fIz0zELSIoKlY+avc7hn/Gb7paaEEmJ6GwisaHsM/lWSyYL3FeyysUQ1elx3JZO5seId6CRZC8marKqzVA+iWAn+Usl/eq47Vj8H69CeY7CIJp/qfTXgNywBIzjAZ6Tisz39sezGjmHUvgOn1sh0w/MaiUyY7bf0dWLsFDhc5EPsSwDqsSBWslls8fYCJDJCpAVgzsHbzxRZAKRmOavVI3g09AKQE93Qyx+oJxdCDGXIAJEF9O1ZfDFM4URQLW7AWyzvZUyZlFW6LcDeEeiiNaJd2qwzwowaldBnU1NSB40OQim2Q/XOsqQG3LrRqCDuFzVjZQpiGiCh6MByIYk9Yh/V9kqlMVSuqYj5W9UOwBieOkpRH+yNJSrlQGqDr4laSrH2H5a1lb9Wv1dEh2JP2Zqxwn+FkRVSWFgsh11ar3NYArChtqBMZTozIZThhuSBd51FTKFUBzNAA8yPnrvqi5XGxgwssV92I5aE4ixjBmzwQNmAZNEhpfOg/DAjPWtrITV2CnuYGxEIGjecuPjJLLG9Rhd1Z5BI2YGGpqHpCWGTCm9x9E5Y5fgL72xHAaOyq9jiJGCfHCGpyrNskOutQz9lgheZYFTDpgjqaN2AhBdOBUBDFfp+n67HsosHi1uGkdSRjso8vVblRcU+cybbhkWKB+6MVPgeo7beGwh5QVfKnrYFG+W5gLVb2QFyI8vXYPYY3YIE8j6qmqTQ6BubyfIZGmds0WWXBUfk5DBVzQGXKa7F64gv1+XuDwLE+TqOivAYrW5jfn4cF1lO0WB+OVZ/C61i7fQ5T4O8MvKcKOJxj/R99XvQUg1n0VA+f/xNLWl4c/7jhZcri839i8WIdZDkELxbjWsWSJBYUSYeFdMnmiZf/bjm7KtMroV46YWV3nW/eZwVaQHhosbhWsJTAd5nGUlCAhSLBBE+aQRl+K4Ozq+c/C3SCwbHDnKtSGicqhvvbWtjGU/K2WiiMxXoNSyI5lcbj6PITo0k0XomA34Dfuo2uvnl/6/iig8HgiDtXJe2wz7BZq7WV5Xe4Kyx14OExmRROUc+xSuSQv4BHBeWzBzUyGyTjSXnBKgRjnpJewLmUArYnBZYHdW8C6MxZ9wZiU3YoHZ1ootugLOShi+xvGfLdMwIpcTrREKvP2mqp3ny0/bXypdv9knyGlSEuDXbAJ+vNHb8/Rs71js/vIzvOnY/4rwcWoaMT8O5cqxHi88VIBaQz5kykSNoBqoXJDOVyfkIeIUJyPiIkfSR3fQ5meFh7HIIuft4SVsWxkpUXWGfknDV3MPfQJANNviBtiUQ17Sdpqz1SNZwUqWrtHZ9hkSJckLJWI2mzGTvS5EZMa5I8MC1MYMiyXCEu9sHeHck7F2TPULFDwqWhDPf38OkVLOFqW0guLxGrRNr8uIfeTs4As+GTS6QKsB3TsJJ7wB5KJ4eVqpoN7CDEk4JpFVf6nQY/EzfZHb+jf2s2m2cIi9t8GuzRAFSOjHBeeB0redVdtDyvEl+YInkkA9ARIEMS9EUNRJORDw20c5skoXeuVVqYEiniSpwLkBqguAknsIzpdNpHEvQcOM3CUmuwhEr36hmWRcidrih43HOJjBVTQrazmIa4aUSLGaAEcg66XMA7sygOQj+SE8WkgxAJSbqu2/bc5A36ZVZoug1KIn7YhHVxRXvr6mVvRQghgUZja5toMCaB7W2Sp7cDjOAnCexioajrXOn4DSwUUGjTh84GmcFTjAQDgcDQy00zhZDtszN0lnjT6Th+3Ih12sWWvwg9x6pFqeKaG5XBcKNx/PMyizcAT3HsmnY0flSPH6Er3rajN3Acx15zbxyQmRMHGibx+OXChNvFUdxJNYtisv6/6mS3290WuqiK8ACrUiRJum/gLWyUTp2B3IrzQ76DSAWDwR3/FDYrQp25S3if/vIbG6OMasMbJFOnBu/ULxhct69nFFK8AAAAAElFTkSuQmCC";e.ImageFitMode=void 0,(kH=e.ImageFitMode||(e.ImageFitMode={}))[kH.Fill=0]="Fill",kH[kH.Fit=1]="Fit",kH[kH.Stretch=2]="Stretch",kH[kH.Center=3]="Center";var OH,_H=function(t){function e(e){var i=t.call(this,e)||this;return i.type="fillstyle",i}return h(e,t),e.prototype.setSource=function(t){return this.set("source",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.setSurroundingColor=function(t){return t instanceof L?this.set("surroundingColor",t):this.set("surroundingColor",t(this.get("surroundingColor")))},e.prototype.getSurroundingColor=function(){return this.get("surroundingColor")},e.prototype.setSourceMissingColor=function(t){return t instanceof L?this.set("sourceMissingColor",t):this.set("sourceMissingColor",t(this.get("sourceMissingColor")))},e.prototype.getSourceMissingColor=function(){return this.get("sourceMissingColor")},e.prototype.setFitMode=function(t){return this.set("fitMode",t)},e.prototype.getFitMode=function(){return this.get("fitMode")},e.prototype.createDefaultHighlightStyle=function(){return this.asImmutable()},e.prototype.getDefaultHighlightStyle=function(){return this.G||(this.G=this.createDefaultHighlightStyle()),this.G},e}(n.Record({source:void 0,surroundingColor:B(0,0,0,0),sourceMissingColor:B(0,0,0,255),fitMode:e.ImageFitMode.Fill})),VH={translation:function(t,e,i){return[1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1]},xRotation:function(t){var 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:function(t){var 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:function(t){var 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:function(t,e,i){return[t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1]},translate:function(t,e,i,n){return VH.multiply(t,VH.translation(e,i,n))},xRotate:function(t,e){return VH.multiply(t,VH.xRotation(e))},yRotate:function(t,e){return VH.multiply(t,VH.yRotation(e))},zRotate:function(t,e){return VH.multiply(t,VH.zRotation(e))},scale:function(t,e,i,n){return VH.multiply(t,VH.scaling(e,i,n))},multiply:function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],h=e[7],u=e[8],c=e[9],f=e[10],p=e[11],y=e[12],d=e[13],g=e[14],S=e[15],v=t[0],m=t[1],x=t[2],b=t[3],k=t[4],w=t[5],M=t[6],A=t[7],I=t[8],F=t[9],T=t[10],C=t[11],D=t[12],L=t[13],P=t[14],B=t[15],E=[];return E[0]=i*v+n*k+r*I+o*D,E[1]=i*m+n*w+r*F+o*L,E[2]=i*x+n*M+r*T+o*P,E[3]=i*b+n*A+r*C+o*B,E[4]=s*v+a*k+l*I+h*D,E[5]=s*m+a*w+l*F+h*L,E[6]=s*x+a*M+l*T+h*P,E[7]=s*b+a*A+l*C+h*B,E[8]=u*v+c*k+f*I+p*D,E[9]=u*m+c*w+f*F+p*L,E[10]=u*x+c*M+f*T+p*P,E[11]=u*b+c*A+f*C+p*B,E[12]=y*v+d*k+g*I+S*D,E[13]=y*m+d*w+g*F+S*L,E[14]=y*x+d*M+g*T+S*P,E[15]=y*b+d*A+g*C+S*B,E},inverse:function(t){var e=[],i=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],h=t[7],u=t[8],c=t[9],f=t[10],p=t[11],y=t[12],d=t[13],g=t[14],S=t[15],v=f*S,m=g*p,x=l*S,b=g*h,k=l*p,w=f*h,M=r*S,A=g*o,I=r*p,F=f*o,T=r*h,C=l*o,D=u*d,L=y*c,P=s*d,B=y*a,E=s*c,O=u*a,_=i*d,V=y*n,z=i*c,N=u*n,R=i*a,H=s*n,Y=v*a+b*c+k*d-(m*a+x*c+w*d),U=m*n+M*c+F*d-(v*n+A*c+I*d),G=x*n+A*a+T*d-(b*n+M*a+C*d),X=w*n+I*a+C*c-(k*n+F*a+T*c),W=1/(i*Y+s*U+u*G+y*X);return e[0]=W*Y,e[1]=W*U,e[2]=W*G,e[3]=W*X,e[4]=W*(m*s+x*u+w*y-(v*s+b*u+k*y)),e[5]=W*(v*i+A*u+I*y-(m*i+M*u+F*y)),e[6]=W*(b*i+M*s+C*y-(x*i+A*s+T*y)),e[7]=W*(k*i+F*s+T*u-(w*i+I*s+C*u)),e[8]=W*(D*h+B*p+E*S-(L*h+P*p+O*S)),e[9]=W*(L*o+_*p+N*S-(D*o+V*p+z*S)),e[10]=W*(P*o+V*h+R*S-(B*o+_*h+H*S)),e[11]=W*(O*o+z*h+H*p-(E*o+N*h+R*p)),e[12]=W*(P*f+O*g+L*l-(E*g+D*l+B*f)),e[13]=W*(z*g+D*r+V*f-(_*f+N*g+L*r)),e[14]=W*(_*l+H*g+B*r-(R*g+P*r+V*l)),e[15]=W*(R*f+E*r+N*l-(z*l+H*f+O*r)),e},projectionPerspective:function(t,e,i,n){var r=1/Math.tan(t*Math.PI/180/2),o=1/(i-n);return[r/e,0,0,0,0,r,0,0,0,0,(i+n)*o,-1,0,0,i*n*o*2,0]},projectionOrthographic:function(t,e,i,n,r,o){return[2/(e-t),0,0,-(e+t)/(e-t),0,2/(n-i),0,-(n+i)/(n-i),0,0,-2/(o-r),-(o+r)/(o-r),0,0,0,1]}},zH=function(t){this.NC=t},NH=function(){function t(){var t=this;this.EC=new Array,this.VC=function(e){return t.EC.push(e),e},this.GC=this.VC(new Map),this.HC=this.VC(new Map),this.WC=this.VC(new Map),this.jC=this.VC(new Map),this.UC=this.VC(new Map)}return t.prototype.YC=function(){this.EC.forEach((function(t){t.forEach((function(t){return t.YC()})),t.clear()}))},t}(),RH=function(){function t(t){this.XC=t,this.ZC=new Map}return t.prototype.KC=function(t){return!!this.ZC.get(t)},t.prototype.S=function(t){var e=this.ZC.get(t);return e&&e.textureInfo},t.prototype.gh=function(t){if(t instanceof R){var e=this.ZC.get(t);e&&(e={textureInfo:e.textureInfo,refs:e.refs+1},this.ZC.set(t,e))}else t.textureInfo&&this.ZC.set(t.lut,{textureInfo:t.textureInfo,refs:1});return this},t.prototype.Ts=function(t){if(!t)return this;var e=this.ZC.get(t);return e&&(0===(e={textureInfo:e.textureInfo,refs:e.refs-1}).refs?(this.XC.deleteTexture(e.textureInfo.texture),this.ZC.delete(t)):this.ZC.set(t,e)),this},t.prototype.qC=function(t){var e=this.ZC.get(t);return e?e.refs:void 0},t.prototype._f=function(){return this.ZC.size},t}(),HH=function(t){return new RH(t)},YH=function(t,e){this.Fo=t,this.kt=e,this.JC=!0,this.QC=null,this.$C=null},UH=function(){function t(t){this.tB=!1,this.iB=1,this.nB=t,this.eB={Fo:m(0,0),kt:m(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),JC:!0,QC:null,$C:null},this.rB=m(64,64),this.sB=new Uint8ClampedArray(this.rB.x*this.rB.y*this.iB)}return t.prototype.oB=function(t,e){if(!t.JC)return null;if(t.QC&&t.$C){var i=this.oB(t.QC,e);return null!==i?i:this.oB(t.$C,e)}var n,r,o=x(t.kt.x,t.kt.y);if(t.Fo.x+t.kt.x>=Number.MAX_SAFE_INTEGER&&(o.x=this.rB.x-t.Fo.x-1),t.Fo.y+t.kt.y>=Number.MAX_SAFE_INTEGER&&(o.y=this.rB.y-t.Fo.y-1),t.kt.x===e.x&&t.kt.y===e.y)return t.JC=!1,t;if(o.xt.kt.y)),l?(n=new YH(ti(t.Fo,{x:0,y:1}),m(t.kt.x,e.y)),r=new YH(ti(t.Fo,{x:0,y:e.y+1}),m(t.kt.x,t.kt.y-1-e.y))):(n=new YH(ti(t.Fo,{x:1,y:0}),m(e.x,t.kt.y)),r=new YH(ti(t.Fo,{x:e.x+1,y:0}),m(t.kt.x-1-e.x,t.kt.y))),t.QC=n,t.$C=r,this.oB(t.QC,e)},t.prototype.hB=function(t,e){var i={aB:!1,Fo:null},n=this.oB(this.eB,e);if(null===n)for(;null===n&&this.rB.xthis.nB||t.y>this.nB)return!1;for(var e=new Uint8ClampedArray(t.x*t.y*this.iB),i=0;i0;){var f=u.shift(),p=f.prefix,y=f.obj;s+=p+":";var d=Object.keys(y).sort();try{for(var g=(i=void 0,c(d)),S=g.next();!S.done;S=g.next()){var v=S.value,m=y[v];"object"==typeof m&&m.__proto__===Object.prototype||Array.isArray(m)?u.push({prefix:v,obj:m}):s+=v+"="+String(m)+","}}catch(t){i={error:t}}finally{try{S&&!S.done&&(n=g.return)&&n.call(g)}finally{if(i)throw i.error}}}else s+=String(h)+","}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return s},$H={"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"},tY={EmptyFragmentShader:"\nvoid main(void) {\n\n}\n"},eY=function(){function t(t){this.modifiers=[],this.modifiers=t}return t.prototype.alter=function(e){var i=new t(this.modifiers.slice());return i.modifiers.push.apply(i.modifiers,e),i},t.prototype.build=function(t){var e,i;try{for(var n=c(this.modifiers),r=n.next();!r.done;r=n.next())t=(0,r.value)(t)}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return t},t}(),iY=function(){for(var t=[],e=0;e 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.){\n colorFragment = uColor;\n }\n gl_FragColor = colorFragment;\n}\n"},NY={Basic:"\nattribute vec2 aPos;\nuniform vec2 uScale;\nuniform vec2 uDisp;\nvoid main(void) {\n gl_Position = vec4( ( aPos - uDisp ) / uScale, 0.0, 1.0 );\n}\n",BasicOffsetted:"\nattribute vec2 aPos;\nuniform vec2 uScale;\nuniform vec2 uDisp;\nuniform vec2 uOffset;\nvoid main(void) {\n gl_Position = vec4( ( (aPos + uOffset) - uDisp ) / uScale, 0.0, 1.0 );\n}\n",BasicInstanced:"\nattribute vec2 aPos;\nattribute vec2 aRot;\nattribute vec2 aGeo;\nattribute float aSize;\nuniform vec2 uScale;\nuniform vec2 uRatioPxClip;\nuniform vec2 uDisp;\nvoid main(void) {\n vec2 rotatedGeo = vec2(\n aGeo.x * aRot.y + aGeo.y * aRot.x,\n aGeo.y * aRot.y - aGeo.x * aRot.x\n );\n vec2 scaled = (rotatedGeo * aSize * uRatioPxClip);\n gl_Position = vec4( (aPos - uDisp ) / uScale + scaled, 0.0, 1.0 );\n}\n",PointSize:"\nattribute vec2 aPos;\nuniform vec2 uScale;\nuniform vec2 uDisp;\nuniform float uPointSize;\nvoid main(void) {\n gl_Position = vec4( ( aPos - uDisp ) / uScale, 0.0, 1.0 );\n gl_PointSize = uPointSize;\n}\n",Texture:"\nattribute vec2 aPos;\nattribute vec2 aMaskTextureCoord;\nuniform vec2 uScale;\nuniform vec2 uDisp;\nvarying vec2 vMaskTextureCoord;\nvoid main(void) {\n gl_Position = vec4( ( aPos - uDisp ) / uScale, 0.0, 1.0 );\n vMaskTextureCoord = aMaskTextureCoord;\n}\n",PointSizePointColor:"\nattribute vec2 aPos;\nattribute vec4 aColor;\nuniform vec2 uScale;\nuniform vec2 uDisp;\nuniform float uPointSize;\nvarying vec4 vColor;\nvoid main(void) {\n gl_Position = vec4( ( aPos - uDisp ) / uScale, 0.0, 1.0 );\n gl_PointSize = uPointSize;\n vColor = aColor;\n}\n",PointColor:"\nattribute vec2 aPos;\nattribute vec4 aColor;\nuniform vec2 uScale;\nuniform vec2 uDisp;\nvarying vec4 vColor;\nvoid main(void) {\n gl_Position = vec4( ( aPos - uDisp ) / uScale, 0.0, 1.0 );\n vColor = aColor;\n}\n",PointColorOffsetted:"\nattribute vec2 aPos;\nattribute vec4 aColor;\nuniform vec2 uScale;\nuniform vec2 uDisp;\nuniform vec2 uOffset;\nvarying vec4 vColor;\nvoid main(void) {\n gl_Position = vec4( ( (aPos + uOffset) - uDisp ) / uScale, 0.0, 1.0 );\n vColor = aColor;\n}\n",PointColorInstanced:"\nattribute vec2 aPos;\nattribute vec2 aRot;\nattribute vec2 aGeo;\nattribute vec4 aColor;\nattribute float aSize;\nuniform vec2 uScale;\nuniform vec2 uRatioPxClip;\nuniform vec2 uDisp;\nvarying vec4 vColor;\nvoid main(void) {\n vec2 rotatedGeo = vec2(\n aGeo.x * aRot.y + aGeo.y * aRot.x,\n aGeo.y * aRot.y - aGeo.x * aRot.x\n );\n vec2 scaled = (rotatedGeo * aSize * uRatioPxClip);\n gl_Position = vec4( ( aPos - uDisp ) / uScale + scaled, 0.0, 1.0 );\n vColor = aColor;\n}\n",Paletted:"\nattribute vec2 aPos;\nattribute float aIntensity;\nuniform vec2 uScale;\nuniform vec2 uDisp;\nvarying float vLookupValue;\nvoid main(void) {\n gl_Position = vec4( ( aPos - uDisp ) / uScale, 0.0, 1.0 );\n vLookupValue = aIntensity;\n}\n",PalettedOffsetted:"\nattribute vec2 aPos;\nattribute float aIntensity;\nuniform vec2 uScale;\nuniform vec2 uDisp;\nuniform vec2 uOffset;\nvarying float vLookupValue;\nvoid main(void) {\n gl_Position = vec4( ( (aPos + uOffset) - uDisp ) / uScale, 0.0, 1.0 );\n vLookupValue = aIntensity;\n}\n"},RY=function(){function t(t,e,i,n){if(this.id=t,this.shader=i,this.gl=n,!e||!i)throw new ft("Could not find "+this.PB()+" shader source code.");if(this.gl.shaderSource(i,e),this.gl.compileShader(i),!this.gl.getShaderParameter(i,this.gl.COMPILE_STATUS)){var r=this.gl.getShaderInfoLog(i);try{var o=Number(r.match(/ERROR:\s?\d:(\d*)/)[1]);r+="...\n"+e.split("\n").filter((function(t,e){return Math.abs(o-e)<=1})).join("\n")+"\n..."}catch(t){}throw new ft("Could not create "+this.PB()+" shader: \n\n "+r)}}return t.prototype.PB=function(){return this.id.toString()+" "+(this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex")},t}(),HY=function(t){function e(e,i,n){return t.call(this,e,i,n.createShader(n.VERTEX_SHADER),n)||this}return h(e,t),e}(RY),YY=function(t){function e(e,i,n){return t.call(this,e,i,n.createShader(n.FRAGMENT_SHADER),n)||this}return h(e,t),e}(RY),UY=function(){function t(t,e,i,n){if(void 0===n&&(n=i.createProgram()),this.XC=i,this.OB=n,this.DB=new Map,this._B=new Map,this.RB=t.PB(),this.zB=e.PB(),i.attachShader(n,t.shader),i.attachShader(n,e.shader),i.bindAttribLocation(n,0,"aPos"),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new ft("Could not compile WebGL program. \n\n"+i.getProgramInfoLog(n));i.deleteShader(t.shader),i.deleteShader(e.shader)}return t.prototype.NB=function(t){var e=this.EB(t);if(void 0===e)throw new ft("Could not get "+t+" uniform from "+this.RB+" and "+this.zB+" shaders.");return e},t.prototype.EB=function(t){var e=this.DB.get(t);if(e)return e;var i=this.XC.getUniformLocation(this.OB,t);return i?(this.DB.set(t,i),i):void 0},t.prototype.VB=function(t){var e=this.GB(t);if(void 0===e)throw new ft("Could not get "+t+" attribute from "+this.RB+" and "+this.zB+" shaders.");return e},t.prototype.GB=function(t){var e=this._B.get(t);if(e||0===e)return e;var i=this.XC.getAttribLocation(this.OB,t);return i||0===i?(this._B.set(t,i),i):void 0},t.prototype.ks=function(){this.XC.deleteProgram(this.OB)},t}(),GY=function(t,e,i){return void 0===i&&(i=void 0),function(){t.HB=e,i&&i()}},XY=function(){function t(t,e){var i=this;if(this._s=!1,this.WB=0,this.jB=0,this.UB=!1,this.HB=!1,this.YB=!1,this.XB=!1,this.ZB=!1,this.KB=new Set,this.qB=new Set,this.JB=e,this.XC=t,this.QB=null,this.UB=e instanceof gt.HTMLVideoElement,this.JB instanceof gt.HTMLImageElement)this.JB.addEventListener("load",(function(){i.XB=!0,i.$B()})),this.JB.addEventListener("error",(function(){i.ZB=!0})),this.JB.complete&&(this.XB=!0,this.$B());else if(this.JB instanceof gt.HTMLVideoElement){var n=this;this.JB.addEventListener("canplay",(function(){n.jB=this.videoHeight,n.WB=this.videoWidth,n.XB=!0,n.$B()}),!0),this.JB.addEventListener("play",GY(this,!0,(function(){return i.$B()}))),this.JB.addEventListener("playing",GY(this,!0,(function(){return i.$B()}))),this.JB.addEventListener("pause",GY(this,!1)),this.JB.addEventListener("ended",GY(this,!1)),this.JB.readyState>=1&&(this.WB=this.JB.videoWidth,this.jB=this.JB.videoHeight,this.HB=!this.JB.paused,this.XB=!0,this.$B())}else this.XB=!0,this.$B()}return t.prototype.TB=function(t){this.qB.add(t)},t.prototype.CB=function(t){this.qB.delete(t),0===this.qB.size&&this.dispose()},t.prototype.tL=function(t){this.KB.add(t),this.YB&&(t(),this.iL(t))},t.prototype.iL=function(t){this.KB.delete(t)},t.prototype.$B=function(){var t=this;if(!(this._s||this.ZB||this.YB)&&this.XB){var e=this.XC.gl;if(!this.QB&&this.JB){this.QB=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.QB),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);var i=e.RGBA,n=e.RGBA,r=e.UNSIGNED_BYTE,o=this.JB,s=this.WB>0?this.WB:o.width,a=this.jB>0?this.jB:o.height;e.texImage2D(e.TEXTURE_2D,0,i,n,r,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.WB=s,this.jB=a,e.bindTexture(e.TEXTURE_2D,null)}this.YB=!0,this.KB&&this.KB.forEach((function(e){e(),t.iL(e)}))}},t.prototype.Un=function(){var t=this.XC.gl;if(!this.ZB&&this.YB&&this.QB&&!this._s){var e=t.RGBA,i=t.RGBA,n=t.UNSIGNED_BYTE,r=this.JB;r&&(t.bindTexture(t.TEXTURE_2D,this.QB),t.texImage2D(t.TEXTURE_2D,0,e,i,n,r))}},t.prototype.nL=function(){return this.QB},t.prototype.restore=function(){return this._s&&(this._s=!1,this.$B()),this},t.prototype.dispose=function(){return this._s||(this.QB&&(this.XC.pB(this.QB),this.QB=null),this.qB.clear(),this._s=!0,this.YB=!1),this},t.prototype.isDisposed=function(){return this._s},t}(),WY=function(){function t(t,e,i){var n,r,o=this;void 0===i&&(i=!0),this.zr=t,this.LB=function(){var t=gt.document.createElement("canvas"),e=t.getContext("2d");if(!e)throw new ct("Failed to get Text canvas rendering context");return e.fillStyle="#fff",function(i,n,r){var o=n.style+" "+n.weight+" "+n.size*r+"px "+n.family;e.font=o,e.textBaseline="alphabetic",e.textAlign="left";var s=e.measureText(i);if(0!==s.width){var a=void 0!==s.actualBoundingBoxLeft&&void 0!==s.actualBoundingBoxRight?Math.ceil(s.actualBoundingBoxLeft+s.actualBoundingBoxRight):Math.ceil(s.width),l=s.width,h=Math.round(n.size*r),u=void 0!==s.actualBoundingBoxLeft?s.actualBoundingBoxLeft:0;t.width=a>0?a:l,t.height=2*h,e.font=o,e.textBaseline="alphabetic",e.textAlign="left",e.clearRect(0,0,t.width,t.height),e.fillStyle="#fff",e.fillText(i,u,h);for(var c=e.getImageData(0,0,t.width,t.height),f=0,p=0,y=c.width,d=0;d=0;d-=1){for(g=0;g-1&&o.gl.enableVertexAttribArray(l)}var h=0;for(a=0;a-1&&o.gl.vertexAttribPointer(u.location,u.size,o.gl.FLOAT,!1,s*Float32Array.BYTES_PER_ELEMENT,h*Float32Array.BYTES_PER_ELEMENT),h+=u.size}if(void 0!==e)for(a=0;a-1&&o.CL(c,e)}return o},this.BL=function(){for(var t=[],e=0;e-1&&o.gl.disableVertexAttribArray(r)}return o},this.LL=function(t,e){return void 0===t||(o.gl.bindBuffer(o.gl.ARRAY_BUFFER,e),o.gl.enableVertexAttribArray(t),o.gl.vertexAttribPointer(t,4,o.gl.FLOAT,!1,0,0)),o},this.IL=function(t,e){return void 0===t||(o.gl.bindBuffer(o.gl.ARRAY_BUFFER,e),o.gl.vertexAttribPointer(t,1,o.gl.FLOAT,!1,0,0),o.gl.enableVertexAttribArray(t)),o},this.PL=function(t){return o.gl.bindBuffer(o.gl.ELEMENT_ARRAY_BUFFER,t),o},this.my=function(t,e,i){return void 0===i&&(i=0),e>0&&o.gl.drawArrays(t,i,e),o},this.OL=function(t,e,i,n){return void 0===e&&(e=o.gl.TRIANGLES),void 0===i&&(i=0),void 0===n&&(n=o.gl.UNSIGNED_SHORT),t>0&&o.gl.drawElements(e,t,n,i),o},this.DL=function(t,e,i,n){if(n>0&&(o.gl2&&o.gl2.ctx.drawArraysInstanced(t,e,i,n),o.gl1)){if(!o.gl1._L.ANGLE_instanced_arrays)return gt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),o;o.gl1._L.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,n)}return o},this.RL=function(t,e,i,n,r){if(void 0===r&&(r=o.gl.UNSIGNED_SHORT),n>0&&(o.gl2&&o.gl2.ctx.drawElementsInstanced(t,e,r,i,n),o.gl1)){if(!o.gl1._L.ANGLE_instanced_arrays)return gt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),o;o.gl1._L.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,n)}return o},this.CL=function(t,e){if(t>-1&&(o.gl2&&o.gl2.ctx.vertexAttribDivisor(t,e),o.gl1)){if(!o.gl1._L.ANGLE_instanced_arrays)return gt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),o;o.gl1._L.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return o},this.zL=function(t,e,i,n){void 0===n&&(n=0);var r=o.gl.TEXTURE0+n;o.gl.activeTexture(r),o.gl.bindFramebuffer(o.gl.FRAMEBUFFER,e),o.gl.bindTexture(o.gl.TEXTURE_2D,i),o.gl.framebufferTexture2D(o.gl.FRAMEBUFFER,o.gl.COLOR_ATTACHMENT0,o.gl.TEXTURE_2D,i,0);var s=o.NL();s&&o.EL(!1),t(),s&&o.EL(!0),o.gl.bindTexture(o.gl.TEXTURE_2D,null),o.gl.bindFramebuffer(o.gl.FRAMEBUFFER,null)},this.VL=function(t,e,i){var n=gt.document.createElement("canvas").getContext("2d").createImageData(i.x,i.y),r=n.data;return o.gl.readPixels(t,e,i.x,i.y,o.gl.RGBA,o.gl.UNSIGNED_BYTE,r),n},this.bh=function(){return o.gl.clear(o.gl.COLOR_BUFFER_BIT),o.gl.clear(o.gl.DEPTH_BUFFER_BIT),o},this.GL=function(t){return o.gl.clearColor(t.r,t.g,t.b,t.a),o},this.HL=function(t,e,i,n){return o.gl.viewport(t,e,i,n),o},this.TB=function(t){return o.gl.useProgram(t.OB),o},this.WL=!1,this.gl=e.ctx,this.jL=e.antialias,this.UL=e.lineAntialias,i&&(this.gl.enable(this.gl.BLEND),this.YL());var s=[];if(this._L={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this._L).forEach((function(t){null===o._L[t]&&s.push(t)})),"webgl2"===e.type)this.gl2={ctx:e.ctx},this.XL=!0;else{var a={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")};a.OES_standard_derivatives||(this.UL=!1),Object.keys(a).forEach((function(t){null===a[t]&&s.push(t)}));var l={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.XL=!!l.OES_texture_float,this.gl1={ctx:e.ctx,_L:a,optional:l}}this.hL=s,this.SB=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.wB=this.ZL();var h,u,c,y,d,g,S,v=(u=(h=this).gl,c=new Map,y=new Map,d=new Map,g={totalMs:0,vertexShaders:0,fragmentShaders:0,programs:0},S=function(t,e,i){void 0===i&&(i=[]);var n=[],r=[];if(h.gl1){var o=t.match(/#extension.*/g);o&&r.push.apply(r,p([],f(o))),t=t.replace(/#extension.*/g,"")}else if(n.push("#version 300 es"),(t=(t=(t=t.replace(/#extension.*/g,"")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).includes("usampler2D")&&n.push("precision highp usampler2D;"),"vertex"===e)t=t.replace(/varying/g,"out");else{t=t.replace(/varying/g,"in");var s=i.find((function(t){return"fragOutput"===t.type}));t=(t=s?"out "+s.fragOutput+" fragOutput;\n"+t:"out vec4 fragOutput;\n"+t).replace(/gl_FragColor/g,"fragOutput")}return r&&n.push.apply(n,p([],f(r))),n.push("precision highp float;"),n.push("precision highp int;"),n.join("\n")+"\n"+t},{KL:function(t,e){var i=gt.performance.now(),n=t.toString()+e.toString(),r=d.get(n);if(r)return r;var o=c.get(t);o||(s=S(s=NY[t],"vertex"),o=new HY(t,s,u),c.set(t,o),g.vertexShaders+=1);var s,a=y.get(e);a||(s=S(s=zY[e],"vertex"),a=new YY(e,s,u),y.set(e,a),g.fragmentShaders+=1);var l=new UY(o,a,u);return d.set(n,l),g.programs+=1,g.totalMs+=gt.performance.now()-i,l},qL:function(){for(var t=[],e=0;e=t)return this.SI.buffer;this.SI&&(this.aI(this.SI.buffer),this.SI=void 0);for(var e=t,i=new Float32Array(e),n=0;n 0.0) {\n colorDiffuse = vec4(mix(colorDiffuse.rgb, uWireframeColor.rgb, edge * uWireframeColor.a), max(colorDiffuse.a, uWireframeColor.a));\n }":"if (edge > 0.0) {\n colorDiffuse = uWireframeColor;\n } else {\n discard;\n }")),d.push.apply(d,p([iY("varying vec3 vTriangleBary")],f("phong"===r?[iY("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;"),!1,lY(PY)]:[!1,lY(BY)]))),{vertexShaderModifiers:y,fragmentShader:"EmptyFragmentShader",fragmentShaderModifiers:d}}}},DebugSurfaceGridNormals:function(t){return{idFeature:"DebugSurfaceGridNormals",idVertex:"DebugSurfaceGridNormals:"+JH(t),idFragment:"DebugSurfaceGridNormals:"+JH(t),apply:function(e){return{vertexShaderModifiers:p(p(p([iY.apply(void 0,p(["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",cY,gY,yY,"ubyte"===t.heightmapTextureType&&pY],f("uint"===t.normalTextureType?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"]))),oY.apply(void 0,p(p([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?"pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":"decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), "+t.littleEndian+")"),"float y01 = "+("float"===t.heightmapTextureType?"pickTexel(uHeightmapTexture, vec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":"decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), "+t.littleEndian+")"),"float y10 = "+("float"===t.heightmapTextureType?"pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":"decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), "+t.littleEndian+")"),"float y11 = "+("float"===t.heightmapTextureType?"pickTexel(uHeightmapTexture, vec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":"decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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)"],f("uint"===t.normalTextureType?["vec4 normalAxisRGB = vec4(pickTexelUnsigned(uNormalmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)"]:["vec4 normalAxisRGB = pickTexel(uNormalmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))"])),["vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vec3 normalWorld = normalize(normalAxis * uScale)"]))],f("uint"===t.normalTextureType?[nY(dY)]:[])),f(tU({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:vY,variableNameWorldCoord:mY}))),[aY("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:"EmptyFragmentShader",fragmentShaderModifiers:[lY("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]}}}},OffsetTowardsCamera:function(){return{idFeature:"OffsetTowardsCamera",idVertex:"OffsetTowardsCamera",idFragment:void 0,apply:function(t){return{vertexShaderModifiers:[iY("uniform vec3 uCameraLoc"),aY("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]}}}},AliasedEdge:function(){return{idFeature:"AliasedEdge",idVertex:"AliasedEdge",idFragment:"AliasedEdge",apply:function(t){return{vertexShaderModifiers:[iY("attribute float aSegmentInside"),iY("varying float vSegmentInside"),iY("varying float vSegmentSide"),aY("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[uY("#extension GL_OES_standard_derivatives : enable"),iY("uniform float uAALimit"),iY("varying float vSegmentInside"),iY("varying float vSegmentSide"),sY("gl_FragColor = ","\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 "+wY+".a = "+wY+".a * aa;\n ")]}}}}},nU=function(t){if(t instanceof Ci||t instanceof Bz)return t.$t()?"linear-highPrecision":"linear";if(t instanceof Di){var e={};return t.x instanceof Si&&(e.x={base:t.x.jt()}),t.y instanceof Si&&(e.y={base:t.y.jt()}),["logarithmic",e]}return"linear"};function rU(t,i,n,r,o,s){var a,l,h=i.x.U(t.max.x),u=i.x.U(t.min.x),c=i.y.U(t.max.y),f=i.y.U(t.min.y),p=h-u,y=c-f,d=p/y,g=p*n.x,S=y*n.y,v=p-g,m=y-S,x=g>v?[v,g]:[g,v],b=S>m?[m,S]:[S,m],k=1,w=1;switch(r){default:case e.GradientExtent.closestSide:a=x[0]/p,l=b[0]/y,o===e.GradientShape.circle?(k=M=Math.min(a*d,l),w=M):(k=a*d,w=l);break;case e.GradientExtent.farthestSide:a=x[1]/p,l=b[1]/y,o===e.GradientShape.circle?(k=M=Math.max(a*d,l),w=M):(k=a*d,w=l);break;case e.GradientExtent.closestCorner:l=b[0]/y,o===e.GradientShape.circle?(a=x[0]/p*d,k=M=Math.sqrt(a*a+l*l),w=M):(a=x[0]/p,k=(M=Math.sqrt(a*a+l*l))*d,w=M);break;case e.GradientExtent.farthestCorner:var M;l=b[1]/y,o===e.GradientShape.circle?(a=x[1]/p*d,k=M=Math.sqrt(a*a+l*l),w=M):(a=x[1]/p,k=(M=Math.sqrt(a*a+l*l))*d,w=M)}return{bounds:[u*s,f*s,p*s,y*s],center:[n.x*d,n.y],distance:[Math.max(k,1e-4),Math.max(w,1e-4)],aspectRatio:d}}function oU(t,e,i,n){var r=e.x.U(t.max.x),o=e.x.U(t.min.x),s=e.y.U(t.max.y),a=e.y.U(t.min.y),l=r-o,h=s-a,u=Math.abs(l*Math.sin(i))+Math.abs(h*Math.cos(i)),c=m(l/2-Math.sin(i)*(u/2),h/2-Math.cos(i)*(u/2)),f=m(l/2+Math.sin(i)*(u/2),h/2+Math.cos(i)*(u/2));return{bounds:[o*n,a*n,l*n,h*n],startPoint:[c.x*n,c.y*n],endPoint:[f.x*n,f.y*n]}}var sU,aU=function(t,e,i){return function(t,e,i,n){for(var r,o,s,a,l=[],h=0,u=$e(e,i/2),c=t[t.length-1],f=0,p=0;p0&&(c=t[p-1]),St(r,c)&&(c=ti(r,qe($e(ei(o,r),-1)))),St(r,o)&&(o=ti(r,qe($e(ei(c,r),-1))));var y=ni(c,e),d=ni(r,e),g=ni(o,e),S=qe(ei(d,y)),v=qe(ei(g,d)),x=ti(S,v),b=m(-x.y,x.x),k=m(-S.y,S.x),w=1/oi(b,k),M=Je(b),A=qe(ei(S,v)),I=Math.sign(oi(b,A))||1,F=ii(b,$e(u,w)),T=ii(b,$e(u,-w));if(M<1||w===1/0){var C={x:0,y:0},D={x:0,y:0},L={x:0,y:0},P={x:0,y:0},B=m(-v.y,v.x),E=Math.sign(oi(S,b))||I,O=ii(k,$e(u,E)),_=ii(B,$e(u,E));1===I?(C=O,D=T,L=_,P=T):(C=F,D=O,L=F,P=_);var V=4*Pe(c,r),z=4*Pe(r,o);(w>V||w>z)&&(1===I?(C=O,D=_,L=_,P=O):(C=_,D=O,L=O,P=_));var N=ti(r,C),R=ti(r,D),H=ti(r,L),Y=ti(r,P);l[h]=N,l[h+=1]=R,l[h+=1]=H,l[h+=1]=Y,h+=1,f=4}else N=ti(r,F),R=ti(r,T),l[h]=N,l[h+=1]=R,h+=1,f=2;a=s,s=t[p]}return l[h]=l[0],l[h+=1]=l[1],h+=1,[l,f,[a,s]]}(t,e,i)[0]},lU=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.HI=e,s.DB=new jY,s.WI=we,s.jI=we,s.NC=e.UI(),s}return h(e,t),e.prototype.YI=function(t,e){var i,n=0,r=Array(0);if(void 0!==e){for(var o=t.length,s=Array(o+e.length),a=0,l=0;a0?tN(this.bo.S(),this.$h.S(),this.ri.S(),this.ta.S()*d/100,this.ia.S()*d/100,y)[0]:[this.bo.S()],S=p.length-1;if(2===S){var v=(p[S-1].x+p[1].x)/2,x=(p[S-1].y+p[1].y)/2;this.ra=m(v,x)}else{var b=Math.floor(S/2);this.ra=m(p[b].x,p[b].y)}this.sa=p[1];var k=p.length-1;this.oa=p[k],this.na.S()&&(p.shift(),g.shift());var w=!1;(this.i()||this.bo.i||this.$h.i||this.ri.i||this.ta.i||this.ia.i||this.na.i||this.ea.i||l)&&(this.jI=A(m(this.Vo().x-h,this.Vo().y-u),m(this.Vo().x+h,this.Vo().y+u)),w=!0,this.bo.i=!1,this.$h.i=!1,this.ri.i=!1,this.ta.i=!1,this.ia.i=!1,this.na.i=!1,this.ea.i=!1,this.oo());var M=this.ao();(w||M)&&this.ho!==Y&&(this.na.S()?(this.ZI&&this.NC.gl.deleteBuffer(this.ZI),t=f(this.YI(p,g),4),this.KI=t[0],this.ZI=t[1],this.qI=t[2],this.JI=t[3]):(this.ZI&&this.NC.gl.deleteBuffer(this.ZI),e=f(this.YI(p,void 0),4),this.KI=e[0],this.ZI=e[1],this.qI=e[2],this.JI=e[3]),this.ho instanceof j?this.QI=rU(this.jI,this.Y,this.ho.getPosition(),this.ho.getExtent(),this.ho.getShape(),this.NC.IB()):this.ho instanceof K?this.$I=oU(this.jI,this.Y,this.ho.getAngle(!0),this.NC.IB()):(this.QI=void 0,this.$I=void 0)),M&&(this.tP=this.NC.KL(iU["2D"],iU.Color({dataType:this.ho instanceof j||this.ho instanceof K?["gradient",this.ho]:"uniform"}),iU.VertexLocation({axisWorldTranslation:nU(this.Y),normalSource:void 0})),this.lo(this.ho));var I=this.do;if(I instanceof J&&(w||this.So(I.getThickness()))){this.na.S()?360===a?(p.pop(),g.pop(),i=f(this.XI(p,void 0,I.getThickness(),this.Fx),2),this.iP=i[0],this.nP=i[1],this.eP&&this.iP?this.NC.wL(this.eP,this.iP,!0):!this.eP&&this.iP?this.eP=this.NC.gL(this.iP,!0):this.eP&&!this.iP&&(this.NC.aI(this.eP),this.eP=void 0),n=f(this.XI(g,void 0,I.getThickness(),this.Fx),2),this.rP=n[0],this.sP=n[1],this.oP&&this.rP?this.NC.wL(this.oP,this.rP,!0):!this.oP&&this.rP?this.oP=this.NC.gL(this.rP,!0):this.oP&&!this.rP&&(this.NC.aI(this.oP),this.oP=void 0)):(r=f(this.XI(p,g,I.getThickness(),this.Fx),2),this.iP=r[0],this.nP=r[1],this.eP&&this.iP?this.NC.wL(this.eP,this.iP,!0):!this.eP&&this.iP?this.eP=this.NC.gL(this.iP,!0):this.eP&&!this.iP&&(this.NC.aI(this.eP),this.eP=void 0),this.rP&&(this.oP&&this.NC.gl.deleteBuffer(this.oP),this.oP=void 0,this.sP=0)):(360===a&&(p.shift(),p.pop()),o=f(this.XI(p,void 0,I.getThickness(),this.Fx),2),this.iP=o[0],this.nP=o[1],this.eP&&this.iP?this.NC.wL(this.eP,this.iP,!0):!this.eP&&this.iP?this.eP=this.NC.gL(this.iP,!0):this.eP&&!this.iP&&(this.NC.aI(this.eP),this.eP=void 0));var F=I.getFillStyle();F instanceof j?this.hP=rU(this.jI,this.Y,F.getPosition(),F.getExtent(),F.getShape(),this.NC.IB()):F instanceof K?this.aP=oU(this.jI,this.Y,F.getAngle(!0),this.NC.IB()):(this.hP=void 0,this.aP=void 0),this.uP=F===Y?void 0:this.NC.KL(iU["2D"],iU.Color({dataType:F instanceof j||F instanceof K?["gradient",F]:"uniform"}),iU.VertexLocation({axisWorldTranslation:nU(this.Y),normalSource:void 0})),this.mo(I)}if(w){var T=1,C=1;I instanceof J&&(T=I.getThickness()*this.Fx.x,C=I.getThickness()*this.Fx.y),this.WI=A(m(this.jI.min.x-T,this.jI.min.y-C),m(this.jI.max.x+T,this.jI.max.y+C))}}return this},e.prototype.zC=function(){var t=this;if(this.fo()){this.Un();var e=this.ho,i=this.tP,n=this.ZI;i&&n&&this.NC.TB(i).hI(i,(function(r,o,s,a){t.NC.uL(r("uScale"),t.DB.II()).uL(r("uDisp"),t.DB.LI()).uL(a("uScaleStart_highpart"),t.DB.OI()).uL(a("uScaleStart_lowpart"),t.DB.DI()).dI(s,n,t.Y.$t(),void 0),e instanceof G?t.NC.yL(r("uColor"),e.getColor()):e instanceof j?t.QI&&t.NC.uI(i,t.QI,e):e instanceof K&&t.$I&&t.NC.cI(i,t.$I,e),t.NC.my(t.JI,t.qI)}));var r=this.do;r instanceof J&&(void 0!==this.eP&&this.cP(this.eP,this.nP,r),void 0!==this.oP&&this.cP(this.oP,this.sP,r))}return this},e.prototype.cP=function(t,e,i){var n=this,r=this.uP,o=i.getFillStyle();r&&this.NC.TB(r).hI(r,(function(s,a,l,h){n.NC.uL(s("uScale"),n.DB.II()).uL(s("uDisp"),n.DB.LI()).dI(l,t,n.Y.$t(),void 0),o instanceof G?n.NC.yL(s("uColor"),o.getColor()):o instanceof j?n.hP&&n.NC.uI(r,n.hP,o):o instanceof K&&n.aP&&n.NC.cI(r,n.aP,o);var u=i.getThickness(),c=-1===u||1===u;n.NC.my(c?n.NC.gl.LINE_LOOP:n.NC.gl.TRIANGLE_STRIP,e)}))},e.prototype.fP=function(t,e){if(this.fo()&&this.Fx){var i=et({x:t,y:e},this.As.Y,this.Y);if(je.nt(i,this.WI.min,this.WI.max)){if(je.nt(i,this.jI.min,this.jI.max)&&this.ho!==Y&&this.KI){var n=this.KI.length,r=2;if(this.na.S())for(;rMath.abs(b.y/this.Fx.y)){var u=m(v.x,v.y+a),c=m(v.x,v.y-a),f=m(x.x,x.y+a),p=m(x.x,x.y-a);if(Ue(i,u,c,f)||Ue(i,f,p,u))return!0}else{var y=m(v.x+l,v.y),d=m(v.x-l,v.y),g=m(x.x+l,x.y),S=m(x.x-l,x.y);if(Ue(i,y,d,g)||Ue(i,g,S,y))return!0}if(this.rP&&1!==o.getThickness()){if(ze(i,this.rP))return!0}else if(this.rP)for(s=this.rP.length-1,a=2*this.Fx.y,l=2*this.Fx.x,h=0;hMath.abs(b.y/this.Fx.y)){if(u=m(v.x,v.y+a),c=m(v.x,v.y-a),f=m(x.x,x.y+a),p=m(x.x,x.y-a),Ue(i,u,c,f)||Ue(i,f,p,u))return!0}else if(y=m(v.x+l,v.y),d=m(v.x-l,v.y),g=m(x.x+l,x.y),S=m(x.x-l,x.y),Ue(i,y,d,g)||Ue(i,g,S,y))return!0}}}}return!1},e.prototype.mB=function(){return this.lP&&(this.NC.aI(this.lP),this.lP=void 0),this.dP&&(this.NC.aI(this.dP),this.dP=void 0),this.ZI&&(this.NC.aI(this.ZI),this.ZI=void 0),this.eP&&(this.NC.aI(this.eP),this.eP=void 0),this.oP&&(this.NC.aI(this.oP),this.oP=void 0),this},e}(dE),hU=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.HI=e,s.DB=new jY,s.WI=we,s.NC=e.UI(),s}return h(e,t),e.prototype.tb=function(t){var e,i,n,r=Number.MAX_VALUE;try{for(var o=c(this.Qo),s=o.next();!s.done;s=o.next()){var a=s.value,l=Pe(et(a,this.Y,this.As.Y),t);lMath.abs(f.y/this.Fx.y)){var p=m(u.x,u.y+a),y=m(u.x,u.y-a),d=m(c.x,c.y+a),g=m(c.x,c.y-a);if(Ue(i,p,y,d)||Ue(i,d,g,p))return!0}else{var S=m(u.x+l,u.y),v=m(u.x-l,u.y),x=m(c.x+l,c.y),b=m(c.x-l,c.y);if(Ue(i,S,v,x)||Ue(i,x,b,S))return!0}}}}}return!1},e.prototype.mB=function(){return this.lP&&(this.NC.aI(this.lP),this.lP=void 0),this.ZI&&(this.NC.aI(this.ZI),this.ZI=void 0),this.eP&&(this.NC.aI(this.eP),this.eP=void 0),this},e}(cE),uU=function(t,e,i){void 0===i&&(i=200);var n=i-1;t<=1&&(t+=1),e<=1&&(e+=1);for(var r=Math.ceil((t-1)/n),o=Math.ceil((e-1)/n),s=Array.from(Array(r)).map((function(){return Array(o)})),a=0,l=0,h=0,u=t-1;a=r-1,f=h>=o-1,p=t[c?a-1:a+1][h],y=t[a][f?h-1:h+1],d=xe.normalize(xe.cross(xe.divideVec(xe.subtractVec(c?p:u,c?u:p),n),xe.divideVec(xe.subtractVec(f?u:y,f?y:u),n)));l[h]=d}var g=r-1,S=o-1,v=g*S*6,m=Array(g*S*6*6),x=Array(v),b=A(w(be,be,be),w(ke,ke,ke)),k=0,M=1,I=2,F=3,T=0,C=0;for(a=0;a=r-1,g=p>=o-1,S=t[d?f-1:f+1][p],v=t[f][g?p-1:p+1],m=xe.normalize(xe.cross(xe.divideVec(xe.subtractVec(d?S:y,d?y:S),n),xe.divideVec(xe.subtractVec(g?y:v,g?v:y),n)));l[c+0]=y.x,l[c+1]=y.y,l[c+2]=y.z,l[(c+=3)+0]=m.x,l[c+1]=m.y,l[c+2]=m.z,c+=3,u.min.x=Math.min(u.min.x,y.x),u.min.y=Math.min(u.min.y,y.y),u.min.z=Math.min(u.min.z,y.z),u.max.x=Math.max(u.max.x,y.x),u.max.y=Math.max(u.max.y,y.y),u.max.z=Math.max(u.max.z,y.z)}var x=0;for(f=0;f0){try{for(var n=c(this.yP),r=n.next();!r.done;r=n.next()){var o=r.value,s=o||{},a=s.vbo,l=s.ibo,h=s.colors,u=s.intensities;a&&(i.aI(a),o.vbo=void 0),l&&(i.aI(l),o.ibo=void 0),h&&(i.aI(h),o.colors=void 0),u&&(i.aI(u),o.intensities=void 0)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.yP.length=0}},e.prototype.mB=function(){return this.pP(),this.kP&&(this.NC.sI(this.kP),this.kP=void 0),this.HI.QL.Ts(this.gP),this.xP=void 0,this},e.prototype.qa=function(e,i){return this.vP="mesh",t.prototype.qa.call(this,e,i)},e.prototype.Z=function(){return"grid"===this.vP?this.rh.max.x+this.oi.x:this.rh.max.x},e.prototype.X=function(){return"grid"===this.vP?this.rh.min.x+this.oi.x:this.rh.min.x},e.prototype.q=function(){return"grid"===this.vP?this.rh.max.y+this.oi.y:this.rh.max.y},e.prototype.K=function(){return"grid"===this.vP?this.rh.min.y+this.oi.y:this.rh.min.y},e.prototype.Ph=function(){return 0},e.prototype.Oh=function(){return 0},e}(bE),vU=function(){function t(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}return t.prototype.MP=function(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},t.prototype.AP=function(){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},t.prototype.FP=function(){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},t.prototype.tt=function(t){var e=t.buffer,i=t.position;return e[i]=this.first,e[i+1]=this.second,e[i+2]=this.third,i+=3,t.position=i,t.next&&this.AP(),this},t.prototype.et=function(t){var e=t.buffer,i=t.position;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.FP(),this},t.prototype.TP=function(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(var i=0;i0&&(mU.AP(),u>0&&(u-=1)),o.push(t),r.push(mU.first,mU.second,mU.third),l=mU.second,s=t,a=void 0,h&&o.push(i,n),[s,a,l,u]},MU=function(t,e){var i,n,r,o,s,a,l,h;void 0===e&&(e=0),mU.MP(e);var u,c,p=f(t,2),y=p[0],d=p[1],g=y.length,S=[],v=[],m=[],x=e,b=0,k=y[b],w=d[b],M=y[b],A=d[b],I=!1,F=x>0?M.y!==A.y?2:1:0;if(g>1)for(;bA.y?k.y>w.y?(u=(i=f(xU(M,A,k,w,S,m,u,c,x,T),3))[0],c=i[1],x=i[2]):k.yw.y?(u=(s=f(bU(M,A,k,w,v,S,m,u,c,x,T),3))[0],c=s[1],x=s[2]):(u=(a=f(kU(M,A,k,v,m,u,c,x,I,T),4))[0],c=a[1],x=a[2],I=a[3]):k.y===w.y?(u=M,I&&(m.push(M),I=!1,mU.AP()),0===m.length&&x>0&&F>0&&(F-=1)):k.y>w.y?(u=(l=f(wU(M,0,k,w,S,m,u,c,x,T,F),4))[0],c=l[1],x=l[2],F=l[3]):(u=(h=f(wU(M,0,k,w,v,m,u,c,x,T,F),4))[0],c=h[1],x=h[2],F=h[3])}return[m,new Uint16Array(S),new Uint16Array(v),x,F]},AU=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.HI=e,s.DB=new jY,s.BP=0,s.Qo=Array(),s.LP=0,s.IP=new Uint16Array(0),s.PP=new Uint16Array(0),s.NC=e.UI(),s}return h(e,t),e.prototype.Un=function(){var t=this.co()||this.i();if(this.fo()){this.DB.xI(this.Y);var e=this.Y instanceof Di==0,i=e?this.Y.pi():void 0,n=this.jh(),r=this.Y.Si()||t,o=this.i()||this.Rh.i||r&&"disabled"!==n.type;if(o){if(this.BP=0,this.IP=new Uint16Array(0),this.PP=new Uint16Array(0),this.Qo.length=0,this.LP=0,this.zh>1){var s=f(MU([e?n.packager(this.Dh,i,.5):this.Dh,e?n.packager(this._h,i,.5):this._h]),4),a=s[0],l=s[1],h=s[2],u=s[3];this.BP=u,this.IP=l,this.PP=h,this.Qo=a,this.LP=a.length}this.oo(),this.Rh.i=!1}if(this.Eh&&this.oh[0].length>1){var c=f(this.oh,2),p=c[0],y=c[1],d=p.length,g=f(MU([e?n.packager(p,i,.5):p,e?n.packager(y,i,.5):y],this.BP),5),S=(a=g[0],l=g[1],h=g[2],u=g[3],g[4]);this.BP=u,this.rh=this.ah?He(this.rh,this.ah):He(this.rh,Ne(a));for(var v=a.length,m=S;m0||this.zh>0?1:S;m0&&this.oh[0].length>0?[p(p([],f(this.dh()[0])),f(this.lh()[0])),p(p([],f(this.dh()[1])),f(this.lh()[1]))]:this.dh(),2),i=e[0],n=e[1],r=i.length>2&&i[1].x0&&this.oh[0].length>0?[p(p([],f(this.dh()[0])),f(this.lh()[0])),p(p([],f(this.dh()[1])),f(this.lh()[1]))]:this.dh(),2),i=e[0],n=e[1],r=i.length;if(0!==r){var o=this.Gh?1:0,s=r-(this.Hh?2:1),a=i.length>2&&i[1].xMath.abs(a.y/r.y)){var l=r.y,h=m(o.x,o.y+l),u=m(o.x,o.y-l),c=m(s.x,s.y+l),f=m(s.x,s.y-l);return Ue(n,h,u,c)||Ue(n,c,f,h)}var p=r.x,y=m(o.x+p,o.y),d=m(o.x-p,o.y),g=m(s.x+p,s.y),S=m(s.x-p,s.y);return Ue(n,y,d,g)||Ue(n,g,S,y)}}}return!1},e.prototype.dispose=function(){return t.prototype.dispose.call(this),this.gP&&(this.HI.QL.Ts(this.gP),this.gP=void 0),this.xP=void 0,this.YP=void 0,this.HP&&(this.NC.aI(this.HP),this.HP=void 0),this},e.prototype.mB=function(){return this},e}(vE),FU=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.HI=e,s.DB=new jY,s.NC=e.UI(),s.OB=s.NC.KL(iU["2D"],iU.Color({dataType:"uniform"}),iU.VertexLocation({axisWorldTranslation:nU(s.Y),normalSource:void 0})),s}return h(e,t),e.prototype.Un=function(){var t=this.wa,e=this.Ba,i=this.co()||this.i();if(this.fo()&&t instanceof J){var n=t.getThickness(),r=this.Fa(n);this.DB.xI(this.Y);var o=this.Y.Si()||i;if(this.i()||r||o&&1!==n)if(this.HP&&this.NC.gl.deleteBuffer(this.HP),1===n||-1===n){var s=ie(e,this.Y.$t());this.HP=this.NC.gL(s),this.UP=e.length,this.jP=this.NC.gl.LINES}else{for(var a=[],l=0;l0){for(var i=Math.max(t[e-1].x,t[0].x),n=Math.min(t[e-1].x,t[0].x),r=t[0].y,o=t[0].y,s=0;sr&&(r=a.y),a.y0){for(var i=Math.max(t[e-1].y,t[0].y),n=Math.min(t[e-1].y,t[0].y),r=t[0].x,o=t[0].x,s=0;sr&&(r=a.x),a.x2*this.eO.totalDataPointsAtTime;if(d&&!g)return this.hO=setTimeout((function(){return i.aO(t)}),1e3),!1;var S,v=f>=10,m=this.eO.enabled?this.eO.columnWidthAxis/h<1.5:void 0,x=this.eO.enabled&&f>this.eO.dataPointsPerColumn?f/this.eO.dataPointsPerColumn>=2:void 0;!0===this.eO.enabled?m?x&&(S={enabled:!0,columnWidthAxis:p,dataPointsPerColumn:f,totalDataPointsAtTime:r}):S=v?{enabled:!0,columnWidthAxis:p,dataPointsPerColumn:f,totalDataPointsAtTime:r}:{enabled:!1,totalDataPointsAtTime:r}:v&&(S={enabled:!0,columnWidthAxis:p,dataPointsPerColumn:f,totalDataPointsAtTime:r});var b=!1===e;return S?(b&&(this.eO=S),!0):(b&&(this.eO=u(u({},this.eO),{totalDataPointsAtTime:r})),!1)},e.prototype.hp=function(){this.uO=void 0,this.rO.length=0,this.hO&&(clearTimeout(this.hO),this.hO=void 0)},e.prototype.cO=function(t){var e;if(0===t.length)return t;if(this.nO||!this.$P||"linear"!==this.sO.type||!this.eO.enabled)return t;var i,n,r=(e=this.rO.length>0?ce(this.rO,t,{canReturnB:!0}):t).length,o=[],s=void 0===this.uO,a=-1,l=-1,h=0,u=0;if("x"!==this.$P||this.tO)if("x"===this.$P&&this.tO)for(y=this.eO.columnWidthAxis,d=(this.uO?this.uO.x:e[0].x)-y,p=0;p=d?((!i||g.y>i.y)&&(i=g,a=p),(!n||g.y=f?((!i||g.x>i.x)&&(i=g,a=p),(!n||g.xi.x)&&(i=g,a=p),(!n||g.xi.y)&&(i=g,a=p),(!n||g.y0&&(this.uO=o[v-1]),o},e.prototype.fO=function(t){if(this.$P&&"linear"===this.sO.type){var e="x"===this.$P?this.sO.scale.x.Pd:this.sO.scale.y.Pd;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.zi===Li.progressive||e.zi===Li.regressive){var i=Math.abs("x"===this.$P?this.sO.scale.x.getInnerInterval():this.sO.scale.y.getInnerInterval());if(this.eO.enabled)return 2*i/this.eO.columnWidthAxis;var n=t.length,r=t[0],o=t[n-1];return i/this.calculateAvgStepBetweenDataPoints("x"===this.$P?r.x:r.y,"x"===this.$P?o.x:o.y,n)}}},e.prototype.lO=function(t,e,i){if(!this.$P)return e;var n=i.length,r=WB(i,t.min,this.$P,this.tO,0,n-1);void 0===r&&(r=this.tO?n-1:0);var o=WB(i,t.max,this.$P,this.tO,0,n-1);return void 0===o&&(o=this.tO?0:n-1),1+Math.abs(o-r)},e.prototype.dO=function(){this.hO&&(clearTimeout(this.hO),this.hO=void 0)},e.prototype.aO=function(t){this.oO(t,!0)&&this.Vi()},e}(DU),BU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.renderVisibleOnly=function(t,e){var i=this.Y.x.getInnerStart(),n=this.Y.x.getInnerEnd(),r=Math.min(i,n),o=Math.max(i,n),s=this.Y.y.getInnerStart(),a=this.Y.y.getInnerEnd(),l=Math.min(s,a),h=Math.max(s,a);t.forEach((function(t,i){t.existingCoordinatesCount<=1||t.boundaries.max.xo||t.boundaries.max.yh||e(t)}))},e}(DU),EU=function(){function t(t,e,i){this.vO=e,this.yO=i,this.SO=t,this.mO=[]}return t.prototype.pO=function(t,e,i,n){var r=t.length;if(0!==r){var o=t,s=r,a=this.SO[this.SO.length-1];do{var l=this.SO.length,h=void 0;a||(a=this.gO(e,s)),a&&0==a.allocatedCoordinatesCount-a.existingCoordinatesCount&&(a=void 0);var c=0;if(this.yO&&l>0&&(void 0===a||0===a.existingCoordinatesCount)){var f=this.SO[l-1].lastDataPoint;f?(o.splice(0,0,f),c=1,s+=1):console.error("SegmentationHelper _connectSegments = true, but segment has no lastDataPoint information!")}if(a)h=Math.min(s,a.allocatedCoordinatesCount-a.existingCoordinatesCount),n(a,o.slice(0,h),h,c);else{var p=Math.ceil(e)+c;h=Math.min(p,s);var y=o.slice(0,h),d=u(u({},i(p,y,h,c)),{isDropped:!1});this.SO.push(d)}h>0&&(s>h?s=(o=o.slice(h)).length:(o=[],s=0))}while(s>0);this.bO()}},t.prototype.xO=function(t){var e=t,i=this.SO.indexOf(e);i>=0&&this.SO.splice(i,1),e.droppedTimestamp=gt.performance.now(),this.mO.push(e)},t.prototype.wO=function(){var t=this;this.SO.slice().forEach((function(e){return t.xO(e)}))},t.prototype.kO=function(){var t=this;this.SO.forEach((function(e){return t.vO(e)})),this.mO.forEach((function(e){return t.vO(e)})),this.SO.length=0,this.mO.length=0},t.prototype.gO=function(t,e){var i=2*t/3,n=4*t/3,r=this.mO.findIndex((function(t){return t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=n}));if(r>=0){var o=this.mO[r];return this.mO.splice(r,1),this.SO.push(o),o}},t.prototype.bO=function(){if(this.mO.length>5)for(var t=gt.performance.now(),e=0;e=1e4)&&(this.vO(i),this.mO.splice(e,1),e-=1)}},t}(),OU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.MO=function(t,e){if(!e||"object"!=typeof e)return 0;var i=this.Y.x.getInnerStart(),n=this.Y.x.getInnerEnd(),r=Math.min(i,n),o=Math.max(i,n),s=this.Y.y.getInnerStart(),a=this.Y.y.getInnerEnd(),l=Math.min(s,a),h=Math.max(s,a);if("maxDataPointCount"in e)return this.AO(t,e.maxDataPointCount,r,o,l,h);if("minDataPointCount"in e)return this.FO(t,e.minDataPointCount,r,o,l,h);if("progressiveDataCleaningThreshold"in e)return this.TO(t,e.progressiveDataCleaningThreshold,r,o,l,h);throw new Error("Unimplemented data cleaning configuration: "+JSON.stringify(e))},e.prototype.AO=function(t,e,i,n,r,o){if(void 0===e||e<=0)return 0;var s=t.reduce((function(t,e){return t+e.existingDataPointsCount}),0);if(s<=e)return 0;for(var a=0,l=s,h=0;he&&(a+=1,l-=u.existingDataPointsCount)}return a},e.prototype.TO=function(t,e,i,n,r,o){if(void 0===e||!this.$P)return 0;for(var s=0,a=0;an:l.boundaries.min.y>o:"x"===this.$P?l.boundaries.max.xe:l.boundaries.min.y>e:"x"===this.$P?l.boundaries.max.x2))break;s+=1}return s},e.prototype.FO=function(t,e,i,n,r,o){if(void 0===e||0===e)return 0;for(var s=0,a=0,l=t.length-1;l>=0;l-=1){var h=t[l];if(a>e)if(this.$P){if(this.tO?"x"===this.$P?h.boundaries.min.x>n:h.boundaries.min.y>o:"x"===this.$P?h.boundaries.max.xn||h.boundaries.max.yo?s+=1:s=0;a+=h.existingDataPointsCount}return s},e.prototype.CO=function(t,e){var i=t.reduce((function(t,e){return He(t,e.boundaries)}),we);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){var n=e.progressiveDataCleaningThreshold;"x"!==this.$P||this.tO?"x"===this.$P&&this.tO?i.max.x=Math.min(i.max.x,n):"y"!==this.$P||this.tO?"y"===this.$P&&this.tO&&(i.max.y=Math.min(i.max.y,n)):i.min.y=Math.max(i.min.y,n):i.min.x=Math.max(i.min.x,n)}return i},e}(DU),_U=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,r,o)||this;a.om=s,a.DB=new jY,a.kc=[],a.BO=new BU(a.Y,a),a.LO=new PU(a.Y,a,(function(){return a.engine.Vi()})),a.IO=new EU(a.kc,(function(t){return t.coordsBuffer&&a.NC.aI(t.coordsBuffer)}),!0),a.PO=new OU(a.Y,a),a.YP={type:"none"},a.NC=e.UI(),a.HI=e;var l,h,u,c=a.Y.$t(),f=!0===(null==s?void 0:s.individualLookupValuesEnabled),p=0;c||(l=p,p+=2),c&&(h=p,p+=4),f&&(u=p,p+=1);var y=function(t,e){return e?function(e,i){return function(t,e){if(!e){for(var i=t.length,n=new Float32Array(3*i),r=0,o=0;r0,a=this.Ls;this.Is.S(),s&&(this.La=ce(this.La,r,{canReturnB:!0}),this.sh+=o);var l=this.Ia.i,h=this.PO.MO(this.kc,this.Ia.S());if(h>0){for(var u=0,c=0;c0){var g=this.LO.fO(this.La)||(this.$s("ApplicationType",(function(t){return"InternalUI"===t.type}))?this.sh:1e5);d/g>10&&(g=d/10),this.IO.pO(y,g,(function(e,i,n,r){var o=t.BO.calculateUserDataPointsBoundaries(i);return{allocatedCoordinatesCount:e,existingDataPointsCount:t.LO.lO(o,n,t.La)-r,existingCoordinatesCount:n,jointPointsCount:r,boundaries:o,coordsBuffer:t.NC.bL(e*t.OO.attributesPerVertex,t.OO.prepareRenderData(i,n)),lastDataPoint:i[n-1]}}),(function(e,i,n,r){var o=He(e.boundaries,t.BO.calculateUserDataPointsBoundaries(i)),s=t.LO.lO(o,e.existingCoordinatesCount+n,t.La)-(e.jointPointsCount+r);t.NC.xL(e.coordsBuffer,e.existingCoordinatesCount*t.OO.attributesPerVertex,t.OO.prepareRenderData(i,n)),e.jointPointsCount+=r,e.lastDataPoint=i[n-1],e.existingDataPointsCount=s,e.existingCoordinatesCount+=n,e.boundaries=o}))}if(l&&(this.rh=this.PO.CO(this.kc,this.Ia.S())),this.DB.xI(this.Y),n||a){var S=i instanceof J&&i,v=S&&S.getThickness(),m=S&&S.getFillStyle(),x=m instanceof G&&m,b=m instanceof K&&m,k=m instanceof j&&m,w=m instanceof W&&m,M=x||b||k||w,A=this.OO.individualLookupValuesEnabled;if(w&&"value"===w.getLookUpProperty()&&!A){var I='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw gt.alert(I),new Error(I)}if(M&&S&&!1!==v){var F=-1===v?"primitive":"triangulated",T=b?["gradient",b]:k?["gradient",k]:w?["lookup",w.getLookUpProperty()]:"uniform";this.YP="primitive"===F?{type:F,shader:this.NC.KL(iU["2D"],iU.Color({dataType:T}),iU.VertexLocation({axisWorldTranslation:nU(this.Y),normalSource:void 0})),lineStyle:S,fillStyleSolid:x,fillStyleLinearGradient:b,fillStyleRadialGradient:k,fillStylePaletted:w}:"triangulated"===F?{type:F,shader:this.NC.KL(iU["2D"],iU.Color({dataType:T}),iU.LineInstanced2D({axisWorldTranslation:nU(this.Y),normalSource:void 0}),this.NC.UL?iU.AliasedEdge():void 0),geometry:VU(this.NC,v),lineStyle:S,fillStyleSolid:x,fillStyleLinearGradient:b,fillStyleRadialGradient:k,fillStylePaletted:w}:{type:"none"},this.Ta(S)}else this.YP={type:"none"};if(k?this.hP=rU(this.ro(),this.Y,k.getPosition(),k.getExtent(),k.getShape(),this.NC.IB()):b?this.aP=oU(this.ro(),this.Y,b.getAngle(!0),this.NC.IB()):(this.hP=void 0,this.aP=void 0),w){if(w&&w.lut.isValid){var C=w.getPalette();this.xP=this.HI.wP(C,this.gP,this.xP),this.gP=C}}else this.HI.QL.Ts(this.gP),this.gP=void 0}return this.so=!1,this.Ls=!1,this.oh=[],this.Is.i=!1,this.oo(),this.Ia.i=!1,this},e.prototype.zC=function(){var t=this;this.Un();var e=this.NC.gl,i=this.YP;if(!i||"none"===i.type)return this;var n=i.shader,r=i.lineStyle,o=i.fillStyleSolid,s=i.fillStyleLinearGradient,a=i.fillStyleRadialGradient,l=i.fillStylePaletted;return this.NC.TB(n).hI(n,(function(h,u,c,f){if(t.Y instanceof Ci||t.Y instanceof Bz?t.NC.uL(n.NB("uScale"),t.DB.II()).uL(n.NB("uDisp"),t.DB.LI()).uL(n.EB("uScaleStart_highpart"),t.DB.OI()).uL(n.EB("uScaleStart_lowpart"),t.DB.DI()):t.Y instanceof Di&&t.NC.uL(n.EB("uScaleStart"),t.DB.MixedScaleXY.uScaleStart).uL(n.EB("uScaleStartLog"),t.DB.MixedScaleXY.uScaleStartLog).uL(n.EB("uScaleInterval"),t.DB.MixedScaleXY.uScaleInterval).uL(n.EB("uScaleIntervalLog"),t.DB.MixedScaleXY.uScaleIntervalLog).uL(n.NB("uViewportStart"),t.DB.MixedScaleXY.uViewportStart).uL(n.NB("uViewportSize"),t.DB.MixedScaleXY.uViewportSize),o?t.NC.yL(n.NB("uColor"),o.getColor()):a?t.hP&&t.NC.uI(n,t.hP,a):s?t.aP&&t.NC.cI(n,t.aP,s):l&&t.xP&&t.NC.pL(h("uLookupTexture"),t.xP.texture,0).SL(h("uLookupMin"),l.lut.min).SL(h("uLookupMax"),l.lut.max).SL(h("uLookupTextureHeightPx"),t.xP.textureHeight),"triangulated"===i.type){var p=r.getThickness()+1;t.NC.SL(n.NB("uThicknessPixels"),p).SL(n.EB("uAALimit"),1-(p-1)/p).uL(n.NB("uRatioPxClip"),[2/t.As.Bt().x,2/t.As.Bt().y])}t.BO.renderVisibleOnly(t.kc,(function(n){var r=n.coordsBuffer;if(r){if(e.bindBuffer(e.ARRAY_BUFFER,r),"triangulated"===i.type)if(t.Y.$t()||void 0===t.OO.attributeOffsetCoordinateLowPrecision){if(t.Y.$t()&&void 0!==t.OO.attributeOffsetCoordinateHighPrecision){var o=u("aLocationA_highpart"),s=u("aLocationA_lowpart"),a=u("aLocationB_highpart"),h=u("aLocationB_lowpart");e.vertexAttribPointer(o,2,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,t.OO.attributeOffsetCoordinateHighPrecision*Float32Array.BYTES_PER_ELEMENT),t.NC.CL(o,1),e.enableVertexAttribArray(o),e.vertexAttribPointer(s,2,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(t.OO.attributeOffsetCoordinateHighPrecision+2)*Float32Array.BYTES_PER_ELEMENT),t.NC.CL(s,1),e.enableVertexAttribArray(s),e.vertexAttribPointer(a,2,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(t.OO.attributeOffsetCoordinateHighPrecision+t.OO.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),t.NC.CL(a,1),e.enableVertexAttribArray(a),e.vertexAttribPointer(h,2,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(t.OO.attributeOffsetCoordinateHighPrecision+t.OO.attributesPerVertex+2)*Float32Array.BYTES_PER_ELEMENT),t.NC.CL(h,1),e.enableVertexAttribArray(h)}}else{var f=u("aLocationA"),p=u("aLocationB");e.vertexAttribPointer(f,2,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,t.OO.attributeOffsetCoordinateLowPrecision*Float32Array.BYTES_PER_ELEMENT),t.NC.CL(f,1),e.enableVertexAttribArray(f),e.vertexAttribPointer(p,2,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(t.OO.attributeOffsetCoordinateLowPrecision+t.OO.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),t.NC.CL(p,1),e.enableVertexAttribArray(p)}else if(t.Y.$t()||void 0===t.OO.attributeOffsetCoordinateLowPrecision){if(t.Y.$t()&&void 0!==t.OO.attributeOffsetCoordinateHighPrecision){var y=u("aPos_highpart");e.vertexAttribPointer(y,2,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,t.OO.attributeOffsetCoordinateHighPrecision*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(y);var d=u("aPos_lowpart");e.vertexAttribPointer(d,2,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(t.OO.attributeOffsetCoordinateHighPrecision+2)*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(d)}}else{var g=u("aPos");e.vertexAttribPointer(g,2,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,t.OO.attributeOffsetCoordinateLowPrecision*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(g)}if(l&&"value"===l.lookUpProperty&&void 0!==t.OO.attributeOffsetLookUpValue)if("triangulated"===i.type){var S=u("aLookupValueA");e.vertexAttribPointer(S,1,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,t.OO.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),t.NC.CL(S,1),e.enableVertexAttribArray(S);var v=u("aLookupValueB");e.vertexAttribPointer(v,1,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(t.OO.attributeOffsetLookUpValue+t.OO.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),t.NC.CL(v,1),e.enableVertexAttribArray(v)}else{var m=u("aLookupValue");e.vertexAttribPointer(m,1,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,t.OO.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(m)}"triangulated"===i.type?i.geometry.TB(c).my(n.existingCoordinatesCount-1):t.NC.my(e.LINE_STRIP,n.existingCoordinatesCount,0)}})),e.bindBuffer(e.ARRAY_BUFFER,null)})),this},e.prototype.gh=function(t,e){return Array.isArray(t)||(t=[t]),this.oh=ce(this.oh,t,{canReturnB:!0}),this.rh=He(this.rh,e||this.BO.calculateUserDataPointsBoundaries(t)),this},e.prototype.bh=function(){return t.prototype.bh.call(this),this},e.prototype.dispose=function(){return t.prototype.dispose.call(this),this.LO.dO(),this.gP&&(this.HI.QL.Ts(this.gP),this.gP=void 0),this.YP={type:"none"},this.xP=void 0,this},e.prototype.mB=function(){return this.IO.kO(),this},e.prototype.Kg=function(t){var e=this.oh.length>0?p(p([],f(this.dh())),f(this.lh())):this.dh(),i=YB(e,t,this.uh,this.Gh,this.Hh,this.Y,this.engine.Y,this.rh,this.BO.$P,this.BO.tO);return void 0!==i?e[i]:void 0},e.prototype.lM=function(t){var e=this.oh.length>0?p(p([],f(this.dh())),f(this.lh())):this.dh(),i=e.length;if(0!==i){var n=this.Gh?1:0,r=i-(this.Hh?2:1);if(this.uh===DB.Nearest){for(var o=be,s=void 0,a=void 0,l=0;lv&&this.BO.$P)if("x"===this.BO.$P)for(var m=y/(I=y/v),x=0;x=0&&Fr.x){S=(g=m*x)+v;break}}}else if("y"===this.BO.$P){var I;for(m=y/(I=v),x=0;x=0&&Fr.y){S=(g=m*x)+v;break}}}}for(;gl&&D.xf&&D.y=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2)},zU=function(t){function e(e,i){var n=t.call(this,e)||this;n.DO=i,n._O=ie(i,!1),n.RO=i.length,n.sB=e.gL(n._O);var r=Ne(n.DO);return n.kt=m(r.max.x-r.min.x,r.max.y-r.min.y),n}return h(e,t),e.prototype.YC=function(){this.NC.aI(this.sB)},e}(zH),NU=function(t){var e,i=((e=[]).push(m(-2/1.73205080757/2,.3333333333333333)),e.push(m(0,-.6666666666666666)),e.push(m(.5773502691892515,.3333333333333333)),e);return new zU(t,i)},RU=function(t){var e=[m(-.5,-.5),m(-.5,.5),m(.5,-.5),m(.5,-.5),m(-.5,.5),m(.5,.5)];return new zU(t,e)},HU=function(t,e){var i,n=(void 0===(i=e)&&(i=25),tN(m(0,0),0,360,.5,.5,i)[0]);return new zU(t,n)},YU=function(t,e,i){var n=e.rL.GC.get(t);return n||(n=i(e),e.rL.GC.set(t,n)),n},UU=function(t){function i(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.HI=e,s.DB=new jY,s.WI=A(x(ke,ke),x(be,be)),s.zO=[],s.NC=e.UI(),s}return h(i,t),i.prototype.Un=function(){var t=this.co()||this.i(),i=this.oh,n=i.length,r=n>0,o=this.$o.S(),s=this.ho,a=this.size.S(),l=this.Y.Si()||t,h=this.i()||this.size.i||this.$o.i,u=i&&i.length>0||this.Ls,c=l||h||this.Ls;if(r){this.Qo=ce(this.Qo,i,{canReturnB:!0}),this.sh+=n;var f=this.zO[this.zO.length-1],p=f?{oi:f.oi,ri:f.ri,kk:{max:{x:f.kk.max.x,y:f.kk.max.y},min:{x:f.kk.min.x,y:f.kk.min.y}},NO:{max:{x:f.NO.max.x,y:f.NO.max.y},min:{x:f.NO.min.x,y:f.NO.min.y}}}:void 0,y=i.length;if(p||((g={oi:0,ri:i.length>=1e3?1e3:i.length}).kk=Ne(i.slice(0,g.ri)),g.NO=$B(g.kk,{x:a,y:a},this.Y),this.zO[0]=g,p=g,y=i.length-(g.ri||0)),p&&y)if(p.ri-p.oi+y<1e3)p.ri+=p.ri-p.oi+y,p.kk=Ne(i.slice(p.oi,p.ri)),p.NO=$B(p.kk,{x:a,y:a},this.Y),this.zO[this.zO.length-1]=p;else{p.ri-p.oi<1e3&&((g={oi:p.oi,ri:p.oi+1e3}).kk=Ne(i.slice(g.oi,g.ri)),g.NO=$B(g.kk,{x:a,y:a},this.Y),this.zO[this.zO.length-1]=g);for(var d=p.ri;dthis.Qo.length?this.Qo.length:d+1e3}).kk=Ne(i.slice(g.oi,g.ri)),g.NO=$B(g.kk,{x:a,y:a},this.Y),d=g.ri,this.zO[this.zO.length]=g}}}if(r||this.Ls||this.so){this.rh=this.ah?He(this.rh,this.ah):He(this.rh,Ne(this.Qo));var S=ie(this.Qo,this.Y.$t());this.EO=this.sh,this.VO=this.NC.gL(S)}if(this.DB.xI(this.Y),h||this.ao()){var v=this.th.S()?"attribute":"uniform";this.OB=s===Y?void 0:this.NC.KL(iU["2D"],a<=1&&iU.PointSize(v),iU.VertexLocation({offset:a>1?{dataType:v,sizeUnit:"px",symmetric:!0,rotation:(this.ih.S()||this.Mo.S()%360!=0)&&{dataType:this.ih.S()?"attribute":"uniform"}}:void 0,axisWorldTranslation:nU(this.Y),normalSource:void 0}),s instanceof G?iU.Color({dataType:"uniform"}):s instanceof X?iU.Color({dataType:"attribute"}):s instanceof W?iU.Color({dataType:["lookup",s.getLookUpProperty()]}):s instanceof j||s instanceof K?iU.Color({dataType:["gradient",s]}):void 0)}if(s!==Y?c&&(this.GO&&(this.GO=void 0),a>1||s instanceof X?a<=1?this.jP=this.NC.gl.POINTS:o===e.PointShape.Triangle?(this.GO=YU(e.PointShape.Triangle,this.NC,NU),this.jP=this.NC.gl.TRIANGLES):o===e.PointShape.Circle?(this.GO=YU(e.PointShape.Circle,this.NC,(function(t){return HU(t,24)})),this.jP=this.NC.gl.TRIANGLE_FAN):o===e.PointShape.Square?(this.GO=YU(e.PointShape.Square,this.NC,RU),this.jP=this.NC.gl.TRIANGLES):this.jP=this.NC.gl.POINTS:this.jP=this.NC.gl.POINTS):this.GO&&(this.GO=void 0),u||this.ao()){var m=this.Qo.length;if(s instanceof X&&this.EO&&this.EO>0){for(var x=s.getFallbackColor(),b=new Float32Array(4*m),k=0;k0&&a>1){var M=new Float32Array(m);for(k=0;k0&&a>1){var A=new Float32Array(2*m),I=li(this.Mo.S()),F=Math.sin(I),T=Math.cos(I);for(k=0;k0){var C=new Float32Array(m);for(k=0;k0||r||t)&&(this.rh&&u&&(this.WI=$B(this.rh,{x:a,y:a},this.Y)),this.oh=[],this.hh=0,this.ah=we),this.oo(),this.uo=s,this.$o.i=!1,this.size.i=!1,this.so=!1,this},i.prototype.zC=function(){var t=this;if(this.fo()){this.Un();var e=this.OB,i=this.VO,n=this.EO,r=this.ho;e&&i&&n&&r!==Y&&(this.NC.TB(e),this.NC.hI(e,(function(r,o,s,a){if(t.Y instanceof Ci||t.Y instanceof Bz?t.NC.uL(r("uScale"),t.DB.II()).uL(r("uDisp"),t.DB.LI()).uL(a("uScaleStart_highpart"),t.DB.OI()).uL(a("uScaleStart_lowpart"),t.DB.DI()):t.Y instanceof Di&&t.NC.uL(a("uScaleStart"),t.DB.MixedScaleXY.uScaleStart).uL(a("uScaleStartLog"),t.DB.MixedScaleXY.uScaleStartLog).uL(a("uScaleInterval"),t.DB.MixedScaleXY.uScaleInterval).uL(a("uScaleIntervalLog"),t.DB.MixedScaleXY.uScaleIntervalLog).uL(r("uViewportStart"),t.DB.MixedScaleXY.uViewportStart).uL(r("uViewportSize"),t.DB.MixedScaleXY.uViewportSize),t.NC.dI(s,i,t.Y.$t(),t.GO?1:void 0),t.GO){var l=o("aInstanceGeo");t.NC.AL(l,t.GO.sB).CL(l,0)}if(t.ho instanceof G)t.NC.yL(r("uColor"),t.ho.getColor());else if(t.ho instanceof X&&t.HO){var h=o("aColor");t.NC.LL(h,t.HO),t.jP!==t.NC.gl.POINTS&&t.NC.CL(h,1)}else if(t.ho instanceof W&&t.xP){if("value"===t.ho.getLookUpProperty()&&t.wi){var u=o("aLookupValue");t.NC.IL(u,t.wi),t.jP!==t.NC.gl.POINTS&&t.NC.CL(u,1)}t.NC.pL(r("uLookupTexture"),t.xP.texture,0).SL(r("uLookupMin"),t.ho.lut.min).SL(r("uLookupMax"),t.ho.lut.max).SL(r("uLookupTextureHeightPx"),t.xP.textureHeight)}else t.ho instanceof j?t.QI&&t.NC.uI(e,t.QI,t.ho):t.ho instanceof K&&t.$I&&t.NC.cI(e,t.$I,t.ho);if(t.WO&&t.jP!==t.NC.gl.POINTS){var c=o("aOffsetPixels");t.NC.IL(c,t.WO),t.jP!==t.NC.gl.POINTS&&t.NC.CL(c,1)}else if(t.jP!==t.NC.gl.POINTS){var f=r("uOffsetPixels");t.NC.SL(f,t.size.S())}if(t.jO&&t.jP!==t.NC.gl.POINTS){var p=o("aRot");t.NC.AL(p,t.jO),t.jP!==t.NC.gl.POINTS&&t.NC.CL(p,1)}else if(t.jP!==t.NC.gl.POINTS&&t.Mo.S()%360!=0){var y=li(t.Mo.S()),d=Math.sin(y),g=Math.cos(y);t.NC.uL(r("uRot"),[d,g])}if(t.jP===t.NC.gl.POINTS)t.NC.SL(r("uPointSize"),t.size.S());else{var S={x:2/t.As.Bt().x,y:2/t.As.Bt().y};t.NC.uL(r("uRatioPxClip"),[S.x,S.y])}t.jP===t.NC.gl.POINTS?t.NC.my(t.jP,n):t.GO&&t.NC.DL(t.jP,0,t.GO.RO,n)})))}return this},i.prototype.tb=function(t){var e=this.hh>0?p(p([],f(this.dh())),f(this.lh())):this.dh(),i=YB(e,t,this.uh,!1,!1,this.Y,this.As.Y,this.rh,void 0,void 0);return void 0!==i?e[i]:void 0},i.prototype.fP=function(t,i){var n=this.Y;if(n instanceof Di)return!1;var r=n.pi();if(this.fo()&&this.ho!==Y){var o=et({x:t,y:i},this.As.Y,this.Y);if(!je.nt(o,this.WI.min,this.WI.max))return!1;for(var s=!1,a=function(t){if(je.nt(o,l.zO[t].NO.min,l.zO[t].NO.max)){var i=l.dh(),n=l.size.S(),a=l.$o.S(),h=li(l.Mo.S());if(l.jP===l.NC.gl.POINTS){for(var u=r.y*n,c=r.x*n,f=l.zO[t].oi;fMath.abs(c.y/this.Fx.y)){var f=m(h.x,h.y+s),p=m(h.x,h.y-s),y=m(u.x,u.y+s),d=m(u.x,u.y-s);if(Ue(i,f,p,y)||Ue(i,y,d,f))return!0}else{var g=m(h.x+a,h.y),S=m(h.x-a,h.y),v=m(u.x+a,u.y),x=m(u.x-a,u.y);if(Ue(i,g,S,v)||Ue(i,v,x,g))return!0}}}}}return!1},e.prototype.mB=function(){return this.qO&&(this.NC.aI(this.qO),this.qO=void 0),this.ZI&&(this.NC.aI(this.ZI),this.ZI=void 0),this.eP&&(this.NC.aI(this.eP),this.eP=void 0),this.xP=void 0,this},e}(fE),jU=function(t,e){for(var i=0,n=[];i0;o-=s?1:0,o-=i+o0;o-=s?1:0,o-=0;var a=Math.min(o,t-r),l=i-(s?1:0),h={start:l,startUnique:r,sizeData:Math.min(e,t-l),sizeUniqueData:a};n.push(h),i+=a}return n},ZU=function(t,e,i,n){if(i){var r=new Map;return e.gridTiles.forEach((function(t){r.set(t,{type:i,dataInvalidationRanges:[{tileInvalidationOffset:{primary:0,secondary:0},tileInvalidationLength:t.sizeHeatmapDataVectors}]})})),r}for(var o=new Map,s=function(i){var r=t[i],s={x:r.startPrimary,y:r.startSecondary},a={x:s.x+r.lengthPrimary-1,y:s.y+r.lengthSecondary-1},l=[s,{x:a.x,y:s.y},a,{x:s.x,y:a.y}];e.gridTiles.forEach((function(t){var e=t.iFirstVector,i=n(t),s={x:e.primary+i.primary-1,y:e.secondary+i.secondary-1},a=[{x:e.primary,y:e.secondary},{x:s.x,y:e.secondary},s,{x:e.primary,y:s.y}];if(Fe(l,a)){var h=o.get(t);h||(h={type:r.type,dataInvalidationRanges:[]},o.set(t,h));for(var u,c,f=Te(l,a),p={primary:f.min.x-e.primary,secondary:f.min.y-e.secondary},y={primary:1+f.max.x-f.min.x,secondary:1+f.max.y-f.min.y},d=!1,g=[{x:p.primary,y:p.secondary},{x:p.primary+y.primary,y:p.secondary},{x:p.primary+y.primary,y:p.secondary+y.secondary},{x:p.primary,y:p.secondary+y.secondary}],S=0;S0&&(JU(this.NC,p,(function(t){return t.intensityData}),(function(t){return t.intensityDataTexture})),this.QO=!0),this.DB.xI(this.Y);var y=this.YP;if((i||this.Ls||l)&&(a?(this.sD=this.HI.wP(a,this.oD,this.sD),this.oD=a):(this.sD=void 0,this.HI.QL.Ts(this.oD),this.oD=void 0),y.tile=o&&this.sD?{renderMode:"paletted",fillStylePaletted:o,colorLookupTexture:this.sD,shader:this.NC.KL(iU["2D"],iU.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===h&&"bilinear",flipXY:"rows"===this.om.dataOrder,intensityTextureType:this.NC.XL?"float":"ubyte",littleEndian:this.NC.IS_MACHINE_LITTLE_ENDIAN}),iU.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:nU(this.Y),flipXY:"rows"===this.om.dataOrder,normalSource:void 0}))}:s?{renderMode:"solid",fillStyleSolid:s,shader:this.NC.KL(iU["2D"],iU.Color({dataType:"uniform"}),iU.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:nU(this.Y),flipXY:"rows"===this.om.dataOrder,normalSource:void 0}))}:void 0),r||this.Ls){var d=n instanceof J&&n,g=d&&d.getFillStyle(),S=g instanceof G&&g;y.wireframe=d&&S?-1===d.getThickness()?{renderMode:"primitive",shader:this.NC.KL(iU["2D"],iU.Color({dataType:"uniform"}),iU.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.om.dataOrder,axisWorldTranslation:nU(this.Y),normalSource:void 0})),fillStyleSolid:S}:{renderMode:"triangulated",shader:this.NC.KL(iU["2D"],iU.Color({dataType:"uniform"}),iU.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.om.dataOrder,axisWorldTranslation:nU(this.Y),normalSource:void 0}),this.NC.UL?iU.AliasedEdge():void 0),geometry:CU(this.NC,1),solidLine:d,fillStyleSolid:S}:void 0,y.wireframe?this.hD=this.hD||this.aD():this.hD&&(this.NC.aI(this.hD.wireframeCoordinatesBuffer),this.hD=void 0)}return this.YP=y,this.so=!1,this.$O=!1,this.Ls=!1,this.JO.length=0,this.lo(e),this.au=n,this.nD.i=!1,this},e.prototype.rD=function(){var t=this,e=this.iD.gridTiles.map((function(e){var i=QU(t.NC,e.sizeHeatmapDataVectors.secondary,e.sizeHeatmapDataVectors.primary);return u(u({},e),{intensityDataTexture:i})})),i=this.iD.gridTileSizes.map((function(t){return u(u({},t),{tiles:e.filter((function(e){return e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary}))})})),n=this.NC.gL([0,0,1,0,0,1,1,1]),r=this.NC.gl.TRIANGLE_STRIP;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:n,rectangleLocationsDrawMode:r,rectangleLocationsDrawLength:4}},e.prototype.aD=function(){for(var t=this.om.primaryDimensionVectorsCount+1+this.om.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t),i=0,n=0;nthis.rh.max.x||t.ythis.rh.max.y)){var e=t,i="columns"===this.om.dataOrder?e.x:e.y,n="columns"===this.om.dataOrder?e.y:e.x,r="columns"===this.om.dataOrder?this.om.start.x:this.om.start.y,o="columns"===this.om.dataOrder?this.om.start.y:this.om.start.x,s="columns"===this.om.dataOrder?this.om.step.x:this.om.step.y,a="columns"===this.om.dataOrder?this.om.step.y:this.om.step.x,l=It((i-r)/s-.5,0,this.om.primaryDimensionVectorsCount-1),h=It((n-o)/a-.5,0,this.om.secondaryDimensionVectorsCount-1),u=It(Math.ceil(l)-1,0,this.om.primaryDimensionVectorsCount-1),c=It(Math.ceil(h)-1,0,this.om.secondaryDimensionVectorsCount-1),f={point:{x:u,y:c},value:this.uD(u,c)},p={point:{x:u,y:c+1},value:this.uD(u,c+1)},y={point:{x:u+1,y:c},value:this.uD(u+1,c)},d={point:{x:u+1,y:c+1},value:this.uD(u+1,c+1)},g=Wn({x:l,y:h},f,p,y,d);if(void 0!==g){var S=It(Math.floor(l+.5),0,this.om.primaryDimensionVectorsCount-1),v=It(Math.floor(h+.5),0,this.om.secondaryDimensionVectorsCount-1),m="columns"===this.om.dataOrder?S:v,x="columns"===this.om.dataOrder?v:S,b=t;return{x:b.x,y:b.y,column:m,row:x,cellValue:g}}}},e.prototype.uD=function(t,e){for(var i=0;i=n.iFirstVector.primary&&t<=n.iFirstVector.primary+n.sizeHeatmapDataVectors.primary-1&&e>=n.iFirstVector.secondary&&e<=n.iFirstVector.secondary+n.sizeHeatmapDataVectors.secondary-1){var r=t-n.iFirstVector.primary,o=e-n.iFirstVector.secondary,s=r*n.sizeHeatmapDataVectors.secondary+o;return n.intensityData[s]}}return 0},e.prototype.Z=function(){return this.rh.max.x},e.prototype.X=function(){return this.rh.min.x},e.prototype.q=function(){return this.rh.max.y},e.prototype.K=function(){return this.rh.min.y},e.prototype.Ph=function(){return 0},e.prototype.Oh=function(){return 0},e.prototype._F=function(){var t=[];return this.iD.gridTiles.forEach((function(e){if(e.hasIntensityData){for(var i=new Array(e.sizeUniqueHeatmapDataVectors.primary).fill(0).map((function(t){return new Array(e.sizeUniqueHeatmapDataVectors.secondary).fill(0)})),n=0;n0){for(var e=0;e0?this.kc[0].boundaries.min.x:be:this.rh.min.y=this.kc.length>0?this.kc[0].boundaries.min.y:be}return this.kc.forEach((function(t){return t.shape.Un()})),this.Ia.i=!1,this},e.prototype.zC=function(){return this.Un(),this.kc.forEach((function(t){return t.shape.zC()})),this},e.prototype.Sm=function(t){if(0===t.length)return this;var e=0,i=this.fD.dataPerSegment,n=t.length;do{var r=this.kc[this.kc.length-1],o=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,s=!1;if(!r||0===o){var a={columns:"columns"===this.om.scrollDimension?i:this.om.resolution,rows:"rows"===this.om.scrollDimension?i:this.om.resolution,heatmapDataType:this.om.heatmapDataType,dataOrder:this.om.scrollDimension,step:this.om.step,start:"columns"===this.om.scrollDimension?{x:this.om.start.x+this.om.step.x*this.cD,y:this.om.start.y}:{x:this.om.start.x,y:this.om.start.y+this.om.step.y*this.cD}};this.kc.length>0&&(a.start="columns"===this.om.scrollDimension?{x:a.start.x-1*this.om.step.x,y:a.start.y}:{x:a.start.x,y:a.start.y-1*this.om.step.y},s=!0);var l=new $U(this.HI,this.Y,Mt,Mt,[],a).am(this.nD.S()).pn(this.ho).Ha(this.Ga);r={shape:l,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.cD,hasJoint:!1,boundaries:l.rh},this.kc.push(r),o=i-(s?1:0)}var h=n-e,c=Math.min(o,h),f=t.slice(e,e+c),p={type:"intensity",values:f,startPrimary:r.existingDataPointsCount+(r.hasJoint?1:0),startSecondary:0,lengthPrimary:c,lengthSecondary:this.om.resolution};s&&(p.values.unshift(this.lD),p.lengthPrimary+=1,r.hasJoint=!0),r.shape.fm(p),r.existingDataPointsCount+=c,r.existingCoordinatesCount+=c+(s?1:0),r.boundaries=r.shape.rh,this.lD=f[f.length-1],this.cD+=c,e+=c}while(e=this.cD||"rows"===this.om.scrollDimension&&o>=this.cD)return;return{x:n.result.x,y:n.result.y,column:r,row:o,cellValue:n.result.cellValue}}},e.prototype.mF=function(t){var e=this,i=et(t,this.Y,this.engine.Y),n=this.kc.reduce((function(n,r){var o=r.shape.mF(t);if(o){var s=Be(et(o,e.Y,e.engine.Y),i);if(void 0===n||s=this.cD||"rows"===this.om.scrollDimension&&o>=this.cD)return;return{x:n.result.x,y:n.result.y,column:r,row:o,cellValue:n.result.cellValue}}},e.prototype.Z=function(){return this.rh.max.x},e.prototype.X=function(){return this.rh.min.x},e.prototype.q=function(){return this.rh.max.y},e.prototype.K=function(){return this.rh.min.y},e.prototype.Ph=function(){return 0},e.prototype.Oh=function(){return 0},e}(function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,r,o)||this;a.engine=e,a.Ga=OB.lineStyle,a.Ia=F(void 0),a.nD=F("bilinear");var l="columns"===s.scrollDimension?A({x:s.start.x,y:s.start.y},{x:s.start.x,y:s.start.y+s.resolution*s.step.y}):A({x:s.start.x,y:s.start.y},{x:s.start.x+s.resolution*s.step.x,y:s.start.y});return a.om=u(u({},s),{initialBoundaries:l}),a}return h(e,t),e.prototype.Ha=function(t){return this.Ga="function"==typeof t?t(this.Ga):t,this},e.prototype.Wa=function(){return this.Ga},e.prototype.Pa=function(t){return this.Ia.l(t),this},e.prototype.Oa=function(){return this.Ia.S()},e.prototype.am=function(t){return this.nD.l(t),this},e.prototype.um=function(){return this.nD.S()},e}(rE)),eG={translation:function(t,e){return[1,0,0,0,1,0,t,e,1]},rotation:function(t){var e=Math.cos(t),i=Math.sin(t);return[e,-i,0,i,e,0,0,0,1]},scaling:function(t,e){return[t,0,0,0,e,0,0,0,1]},translate:function(t,e,i){return eG.multiply(t,eG.translation(e,i))},rotate:function(t,e){return eG.multiply(t,eG.rotation(e))},scale:function(t,e,i){return eG.multiply(t,eG.scaling(e,i))},multiply:function(t,e){var i=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],h=t[7],u=t[8],c=e[0],f=e[1],p=e[2],y=e[3],d=e[4],g=e[5],S=e[6],v=e[7],m=e[8];return[c*i+f*o+p*l,c*n+f*s+p*h,c*r+f*a+p*u,y*i+d*o+g*l,y*n+d*s+g*h,y*r+d*a+g*u,S*i+v*o+m*l,S*n+v*s+m*h,S*r+v*a+m*u]},projection:function(t,e,i){return[2/t,0,0,0,-2*i/e,0,-1,1*i,1]}},iG=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r,o)||this;return s.HI=e,s.dD=[],s.DB=new jY,s.vD=[m(0,0),m(0,0),m(0,0),m(0,0)],s.yD=A(m(0,0),m(0,0)),s.SD=A(m(0,0),m(0,0)),s.mD=m(0,0),s.pD=m(0,0),s.Fx=m(0,0),s.gD=m(0,0),s.bD=0,s.NC=e.UI(),s}return h(e,t),e.prototype.Un=function(){var t,e=this.fo(),i=this.co()||this.i();if(e){var n=this.NC,r=this.NC.IB();if(this.DB.xI(this.Y),this.Ao.i||this.Ls){this.xD&&this.xD.CB(this),this.font.l(nn(this.Ao.S()));var o=this.font.S();this.xD=this.NC.gn(o.properties.family),this.xD.TB(this)}var s=this.font.i||this.Ls||this.po.i||this.Ls;s&&this.xD&&(o=this.font.S(),t=f(this.xD.BB(this.po.S(),o.properties),2),this.wD=t[0],this.SD=t[1],this.dD.forEach((function(t){t.texCoordBuff&&n.aI(t.texCoordBuff),t.vertexBuff&&n.aI(t.vertexBuff)})),this.dD=this.wD.map((function(t){return{texCoordBuff:n.gL(t.texCoords,!1),texture:t.texture,info:t}})),this.Ao.i=!1,this.font.i=!1,this.po.i=!1);var a=this.Y.Si()||i||this.Ls,l=this.bo.i||this.wo.i||this.xo.i||this.ko.i||s||a||this.Ls,h=this.To.S(),u=$e(m(this.wo.S()+1,this.xo.S()+1),.5);if(l&&this.wD&&(this.mD=m(-(h.left*r+this.SD.max.x-this.SD.min.x+h.right*r)*u.x-this.SD.min.x+h.right*r,-(h.bottom*r+this.SD.max.y-this.SD.min.y+h.top*r)*u.y-this.SD.min.y+h.top*r)),(l||a||this.Mo.i||this.ao())&&this.ho!==Y){if(this.wD){var c=ti(this.bo.S(),this.ko.S()),p=et(c,this.Y,this.As.Y),y=$e(p,r);this.gD=y;var d=li(this.Mo.S());this.bD=d,s&&this.dD.forEach((function(t){var e=t.info;e&&(t.vertexBuffLen=e.vertices.length/2,t.vertexBuff?n.wL(t.vertexBuff,e.vertices,!0):t.vertexBuff=n.gL(e.vertices,!0))}));var g=this.ct.S(),S=[ti(Ke(m((this.SD.min.x+(-g.left-h.left)*r+this.mD.x)/r,(this.SD.max.y+(g.top+h.top)*r+this.mD.y)/r),this.Fo,d),p),ti(Ke(m((this.SD.max.x+(g.right+h.right)*r+this.mD.x)/r,(this.SD.max.y+(g.top+h.top)*r+this.mD.y)/r),this.Fo,d),p),ti(Ke(m((this.SD.max.x+(g.right+h.right)*r+this.mD.x)/r,(this.SD.min.y+(-g.bottom-h.bottom)*r+this.mD.y)/r),this.Fo,d),p),ti(Ke(m((this.SD.min.x+(-g.left-h.left)*r+this.mD.x)/r,(this.SD.min.y+(-g.bottom-h.bottom)*r+this.mD.y)/r),this.Fo,d),p)];this.vD=[et(S[0],this.As.Y,this.Y),et(S[1],this.As.Y,this.Y),et(S[2],this.As.Y,this.Y),et(S[3],this.As.Y,this.Y)],this.yD=Ne(this.vD);var v=Ne(S);this.pD=m(-(v.max.x-v.min.x)*r*u.x-v.min.x*r+this.gD.x,-(v.max.y-v.min.y)*r*u.y-v.min.y*r+this.gD.y),this.kD=ei(v.max,v.min)}this.ho instanceof j?this.QI=rU(this.yD,this.Y,this.ho.getPosition(),this.ho.getExtent(),this.ho.getShape(),this.NC.IB()):this.ho instanceof K?this.$I=oU(this.yD,this.Y,this.ho.getAngle(!0),this.NC.IB()):(this.QI=void 0,this.$I=void 0)}this.ao()&&(this.OB=this.ho===Y?void 0:this.NC.KL(iU["2D"],iU.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0}),iU.Color({dataType:this.ho instanceof j||this.ho instanceof K?["gradient",this.ho]:"uniform",maskTexture:!0}))),this.bo.i=!1,this.wo.i=!1,this.xo.i=!1,this.ko.i=!1,this.Mo.i=!1,this.lo(this.ho),this.oo()}return this.Co=e,this},e.prototype.zC=function(){var t=this;if(this.fo()){this.Un();var e=this.OB;if(!e)return this;var i=this.NC.eL,n=this.NC.gl.drawingBufferWidth,r=this.NC.gl.drawingBufferHeight,o=eG.projection(n,r,-1),s=eG.translation(this.mD.x,this.mD.y),a=eG.translation(this.pD.x,this.pD.y);o=eG.translate(o,this.gD.x,this.gD.y),o=eG.multiply(o,a),o=eG.rotate(o,this.bD),o=eG.multiply(o,s),this.NC.TB(e).hI(e,(function(e,n,r,s){if(t.NC.dL(e("uMatrix"),o),t.ho instanceof G)t.NC.yL(e("uColor"),t.ho.getColor());else if(t.ho instanceof j&&t.QI){t.NC.uL(e("uCenter"),t.QI.center).uL(e("uDistance"),t.QI.distance).fL(e("uBounds"),t.QI.bounds).SL(e("uAspect"),t.QI.aspectRatio);for(var a=t.ho.getColorStops(),l=0;l=l.x&&r>=l.y&&i<=l.x+l.width&&r<=l.y+l.height;if(void 0!==n.LD){if(void 0!==e&&void 0!==n.LD.Xs){var u=m(t.clientX-e.clientX,e.clientY-t.clientY);0===u.x&&0===u.y||n.LD.Xs(n.LD,t,n.ID,n.PD,u)}return!1}var f=h&&o?n.OD(n.AD,i,r):void 0;try{for(var p=c(n.AD),y=p.next();!y.done;y=p.next()){var d=y.value;d.getMouseInteractions()&&d.io(t,d===f,e)}}catch(t){s={error:t}}finally{try{y&&!y.done&&(a=p.return)&&a.call(p)}finally{if(s)throw s.error}}return!1!==o&&void 0===f},n.Or=function(t){var e,i;try{for(var r=c(n.AD),o=r.next();!o.done;o=r.next()){var s=o.value;s.getMouseInteractions()&&s.no(t)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}void 0!==n.LD&&void 0!==n.ID&&void 0!==n.PD&&(void 0!==n.LD.Zs&&n.LD.Zs(n.LD,t,n.ID,n.PD),n.LD=void 0)},n}return h(e,t),e.prototype.ks=function(){var t,e;try{for(var i=c(this.AD),n=i.next();!n.done;n=i.next())n.value.mB().dispose()}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}this.DD=void 0,this.LD=void 0,this.As.Tr(this.MD)},e.prototype.Vi=function(){return this.As.Vi(),this},e.prototype.Fm=function(t){return this.FD.l(t),this},e.prototype.Dv=function(){return this.FD.S()},e.prototype.Tm=function(t){return this.HL.l(t),this},e.prototype._D=function(){return this.HL.S()},e.prototype.Fr=function(){return this.MD},e.prototype.ps=function(t,e,i){if(i===wB.mouseUp&&void 0!==this.LD&&void 0!==this.ID&&void 0!==this.PD&&t.button===this.ID&&(void 0!==(r=rG(this.LD)).dragStop&&r.dragStop(this.LD,t,this.ID,this.PD),this.LD=void 0,this.ID=void 0),i===wB.contextmenu&&ee(t),e){var n=Array.from(this.AD).filter((function(t){return t.getIsUnderMouse()}));if(n&&n.length>0){var r,o=n[0];void 0===this.LD&&i===wB.mouseDown&&(this.LD=o,this.ID=t.button,this.PD=m(t.clientX,t.clientY),void 0!==(r=rG(this.LD)).dragStart&&r.dragStart(this.LD,t,this.ID));var s=m(t.clientX,t.clientY),a=rG(o)[wB[i]];return a&&a(o,t,t.button,s,s),!1}return!0}return!1},e.prototype.es=function(t,e,i,n,r){if(void 0!==this.DD){var o=oG(this.DD)[MB[i]];this.DD&&o&&o(this.DD,e),i===MB.touchEnd&&0===t.length&&(this.DD=void 0)}else if(i===MB.touchStart){var s=this.FD.S(),a=!s||n>=s.x&&r>=s.y&&n<=s.x+s.width&&r<=s.y+s.height,l=t.length;if(this.DD=void 0,a)for(var h=0;h0?new uG(t,It(e,0,1)):new lG(t),t.rL.UC.set(e,i),i)},pG=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.GD=e,o.HI=e.HI,o.NC=o.HI.UI(),o}return h(e,t),e}(function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.so=!0,o}return h(e,t),e.prototype.Zy=function(t){return this.HD=this.Uy.S(),this.Uy.l(t),this},e.prototype.dm=function(t){return this.WD=t,this},e.prototype.vm=function(){return this.WD},e.prototype.i=function(){return this.so||this.Ls},e.prototype.oo=function(){this.so=!1,this.Ls=!1},e}(function(t){function e(e,i,n,r){var o=t.call(this,e.As,i,n,r)||this;return o.Vu=e,o.Y=o.Vu.Y,o.Xy=!0,o.jy={},o.Uy=F(P_),o}return h(e,t),e.prototype.jD=function(){var t;return this.Uy.i&&this.Uy.S().type!==(null===(t=this.HD)||void 0===t?void 0:t.type)},e.prototype.Ky=function(t){return this.Xy=t,this},e.prototype.UD=function(t){return this.jy=t,this},e}(ZB))),yG=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.WD="cull-back",o.rh=Me,o.YD={},o.XD=[],o.ho=OB.fillStyle,o.Uy.l(E_),o}return h(e,t),e.prototype.Un=function(t){var e,i,n,r,o,s,a,l,h=this.XD,u=this.ho,f=u!==Y,p=this.ZD,y=this.i()||this.ao()||this.KD!==p,d=this.jD();if(f){try{for(var g=c(h),S=g.next();!S.done;S=g.next())(N=S.value).id=void 0!==N.id?String(N.id):void 0,N.xSize=void 0!==N.xSize&&N.xSize<0?-N.xSize:N.xSize,N.ySize=void 0!==N.ySize&&N.ySize<0?-N.ySize:N.ySize,N.zSize=void 0!==N.zSize&&N.zSize<0?-N.zSize:N.zSize}catch(t){e={error:t}}finally{try{S&&!S.done&&(i=g.return)&&i.call(g)}finally{if(e)throw e.error}}var v,m,x,b=11,k=this.qD||0,w=k;try{for(var M=c(h),I=M.next();!I.done;I=M.next())void 0!==(R=(N=I.value).id)&&void 0!==this.YD[R]||(w+=1)}catch(t){n={error:t}}finally{try{I&&!I.done&&(r=M.return)&&r.call(M)}finally{if(n)throw n.error}}if(x=!(m=v=w!==k)&&(h.length<100?"chunks":"all"),v){var F=w*b,T=new Float32Array(F);this._O&&T.set(this._O),this._O=T,this.JD=F,this.QD=k*b}var C=u instanceof X?u.getFallbackColor():void 0;try{for(var D=c(h),L=D.next();!L.done;L=D.next()){var P=void 0!==(R=(N=L.value).id)&&this.YD[R],B=[N.xCenter,N.yCenter,N.zCenter,N.xSize,N.ySize,N.zSize,N.color?N.color.r:C?C.r:void 0,N.color?N.color.g:C?C.g:void 0,N.color?N.color.b:C?C.b:void 0,N.color?N.color.a:C?C.a:void 0,N.value];if(P){for(var E=0;E0){var K=A({x:be,y:be,z:be},{x:ke,y:ke,z:ke});for(E=0;EJ?K.max.x:J,K.max.y=K.max.y>it?K.max.y:it,K.max.z=K.max.z>st?K.max.z:st}this.rh=K}this.qD=w,this.XD.length=0}return this.lo(u),this.oo(),this.KD=p,this.Uy.i=!1,this},e.prototype.zC=function(){var t=this,e=this.OB,i=this.$D,n=this.KP,r=this.ho,o=this.qD,s=this.Uy.S();return e&&n&&void 0!==o&&this.NC.hI(e,(function(a,l,h){var u=l("aPos"),c=l("aOffsetAxis");t.NC.TB(e).lL(a("uScale"),t.GD.DB.II()).lL(a("uDisp"),t.GD.DB.LI()).vL(a("uViewProjectionMatrix"),t.i_),"phong"===s.type&&t.NC.lL(a("uCameraLoc"),t.n_).lL(a("uLightLoc"),t.e_).SL(a("uAmbientReflection"),s.ambientReflection).SL(a("uSpecularReflection"),s.specularReflection).SL(a("uDiffuseReflection"),s.diffuseReflection).SL(a("uShininess"),s.shininess).yL(a("uLightColor"),s.specularColor).yL(a("uAmbientColor"),s.ambientColor);var f={location:u,size:3},p={location:c,size:3},y={location:void 0,size:4},d={location:void 0,size:1};if(r instanceof G)t.NC.yL(a("uColorDiffuse"),r.getColor());else if(r instanceof X){var g=l("aColor");y.location=g}else if(r instanceof W){var S=r.getLookUpProperty(),v=r.getPalette();"value"===S&&(d.location=l("aLookupValue")),t.NC.pL(a("uLookupTexture"),t.xP.texture,0).SL(a("uLookupMin"),v.min).SL(a("uLookupMax"),v.max).SL(a("uLookupTextureHeightPx"),t.xP.textureHeight)}n&&(t.NC.TL(n,1,f,p,y,d),i.my(h,o))})),this},e.prototype.fP=function(t,e){},e.prototype.mB=function(){return this.KP&&(this.NC.aI(this.KP),this.KP=void 0),this.HI.QL.Ts(this.gP),this.xP=void 0,this.gP=void 0,this.OB=void 0,this},e.prototype.hS=function(t){this.XD=ce(this.XD,t,{canReturnB:!0})},e.prototype.pn=function(t){return this.ho=tE(this.ho,t),this},e.prototype.mn=function(){return this.ho},e.prototype.sS=function(t){return this.ZD=void 0!==t&&t>0?It(t,0,1):void 0,this},e.prototype.t_=function(){return this.ZD},e.prototype.Z=function(){return this.rh.max.x},e.prototype.X=function(){return this.rh.min.x},e.prototype.q=function(){return this.rh.max.y},e.prototype.K=function(){return this.rh.min.y},e.prototype.$=function(){return this.rh.max.z},e.prototype.J=function(){return this.rh.min.z},e.prototype.Ph=function(){return 0},e.prototype.Oh=function(){return 0},e.prototype.Qy=function(){return 0},e.prototype.ao=function(){return eE(this.uo,this.ho)},e.prototype.lo=function(t){this.uo=t},e}(pG),dG=function(t){function e(e,i){var n=t.call(this,e)||this;n.XP=i,n.zD="custom";var r=n.ZP(),o=r.vertices,s=r.drawSize;return n.KP=e.gL(o),n.JP=s,n}return h(e,t),e.prototype.TB=function(t){return this.NC.TL(this.KP,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this},e.prototype.my=function(t){return this.NC.DL(this.NC.gl.TRIANGLE_STRIP,0,this.JP,t),this},e.prototype.ZP=function(){for(var t,e,i=this.XP,n=new Float32Array(2*(i+1)*3),r=0,o=0;o<=i;o+=1){var s=2*Math.PI*o/i,a=Math.cos(s),l=Math.sin(s);try{for(var h=(t=void 0,c([0,1])),u=h.next();!u.done;u=h.next()){var f=u.value;n[r+0]=f,n[r+1]=a,n[r+2]=l,r+=3}}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=h.return)&&e.call(h)}finally{if(t)throw t.error}}}return{vertices:n,drawSize:r/3}},e.prototype.YC=function(){this.NC.aI(this.KP)},e}(zH),gG=function(t,e){void 0===e&&(e=16);var i=t.rL.WC.get(e);return i||(i=new dG(t,e),t.rL.WC.set(e,i),i)},SG=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.WD="cull-back",o.Ba=[],o.wa=OB.lineStyle,o.Uy.l(P_),o}return h(e,t),e.prototype.Un=function(t){var e=this.i(),i=this.wa,n=this.Aa!==i,r=this.jD();if(e){this.r_&&(this.NC.aI(this.r_),this.r_=void 0);var o=ne(this.Ba);this.r_=this.NC.gL(o)}if(n||r){var s=i instanceof J&&i.getFillStyle(),a=1===i.thickness?"primitive":"instanced";this.YP=void 0,s instanceof G&&("primitive"===a?this.YP={type:a,shader:this.NC.KL(iU["3D"],iU.VertexLocation({axisWorldTranslation:nU(this.Y),normalSource:void 0}),iU.Color({dataType:"uniform"})),fillStyle:s}:"instanced"===a&&(this.YP={type:a,shader:this.NC.KL(iU["3D"],iU.ColorShaded3D({dataType:"uniform",shadingStyle:this.Uy.S().type}),iU.LineInstanced3D({axisWorldTranslation:nU(this.Y)})),geometry:gG(this.NC,8),fillStyle:s}))}return this.oo(),this.Aa=i,this.Uy.i=!1,this},e.prototype.zC=function(){var t=this,e=this.NC.gl,i=this.YP,n=this.r_,r=this.wa,o=this.Uy.S();if(i&&n)switch(i.type){case"instanced":var s=.5*this.Vu.Gy(r.thickness),a=i.fillStyle.getColor(),l=i.shader,h=i.geometry;this.NC.hI(l,(function(i,r,u){t.NC.TB(l).lL(i("uScale"),t.GD.DB.II()).lL(i("uDisp"),t.GD.DB.LI()).vL(i("uViewProjectionMatrix"),t.i_).yL(i("uColorDiffuse"),a).SL(i("uOffsetWU"),s),"phong"===o.type&&t.NC.lL(i("uCameraLoc"),t.n_).lL(i("uLightLoc"),t.e_).SL(i("uAmbientReflection"),o.ambientReflection).SL(i("uSpecularReflection"),o.specularReflection).SL(i("uDiffuseReflection"),o.diffuseReflection).SL(i("uShininess"),o.shininess).yL(i("uLightColor"),o.specularColor).yL(i("uAmbientColor"),o.ambientColor),e.bindBuffer(e.ARRAY_BUFFER,n);var c=r("aLocationA"),f=r("aLocationB");e.vertexAttribPointer(c,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),t.NC.CL(c,1),e.enableVertexAttribArray(c),e.vertexAttribPointer(f,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),t.NC.CL(f,1),e.enableVertexAttribArray(f),h.TB(u).my(t.Ba.length/2)}));break;case"primitive":var u=r instanceof J?r.getFillStyle():void 0,c=u&&u instanceof G?u.getColor():void 0;if(c){var f=i.shader;this.NC.hI(f,(function(i,r){t.NC.TB(f).lL(i("uScale"),t.GD.DB.II()).lL(i("uDisp"),t.GD.DB.LI()).vL(i("uViewProjectionMatrix"),t.i_),t.NC.yL(i("uColor"),c).TL(n,void 0,{location:r("aPos"),size:3}).my(e.LINES,t.Ba.length)}))}}return this},e.prototype.gh=function(t){for(var e=0;e0&&(a(l,h,1,0,0),a(l,h+1,1,1,0),a(l+1,h,0,0,1)),ln.length&>.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:n,drawSize:r/6}},e.prototype.YC=function(){this.NC.aI(this.KP)},e}(zH),mG=function(t,e){var i=Math.round(e);i<3&&me();var n=i,r=t.rL.jC.get(Array.from(t.rL.jC.keys()).find((function(t){return t.sectors===i&&t.stacks===n})));return r||(r=new vG(t,i,n),t.rL.jC.set({sectors:i,stacks:n},r),r)},xG=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.WD="cull-back",o.kc=[],o.YP={},o.IO=new EU(o.kc,(function(t){return t.vertexBuffer&&o.NC.aI(t.vertexBuffer)}),!0),o.La=[],o.sh=0,o.oh=[],o.hh=0,o.rh=Me,o.ah=Me,o.wa=OB.lineStyle,o.aS=OB.pointStyle3D,o.Uy.l(E_),o.OO={attributesPerVertex:3,prepareRenderData:function(t,e){return ne(t)}},o}return h(e,t),e.prototype.Un=function(t){var e=this,i=this.so,n=this.Ls,r=this.oh,o=this.hh,s=o>0,a=this.wa,l=a!==this.Aa,h=this.aS,u=h!==this.a_,c=this.jD();this.ah&&(this.rh=Ye(this.rh,this.ah),this.ah=void 0),s&&(this.La=ce(this.La,r,{canReturnB:!0}),this.sh+=o);var f=r,p=o;if((i||n)&&(this.kc.forEach((function(t){t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=Me})),this.IO.wO(),f=this.La,p=this.sh),p>0){var y=Math.floor(this.HI.u_/(this.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),d=this.$s("ApplicationType",(function(t){return"UserSeries"===t.type}))?p:1e3,g=It(d,1e5,y);this.IO.pO(f,g,(function(t,i,n,r){return{existingDataPointsCount:n-r,existingCoordinatesCount:n,allocatedCoordinatesCount:t,jointPointsCount:r,lastDataPoint:i[n-1],boundaries:Me,vertexBuffer:e.NC.bL(t*e.OO.attributesPerVertex,e.OO.prepareRenderData(i,n))}}),(function(t,i,n,r){e.NC.xL(t.vertexBuffer,t.existingCoordinatesCount*e.OO.attributesPerVertex,e.OO.prepareRenderData(i,n)),t.existingDataPointsCount+=n-r,t.existingCoordinatesCount+=n,t.jointPointsCount+=r,t.lastDataPoint=i[n-1]}))}if(l||u||n||c){var S={},v=a instanceof J&&a,m=v&&v.getFillStyle(),x=m instanceof G&&m,b=m instanceof W&&m,k=x||b,w=h instanceof Ji&&h.getSize(),M=h instanceof Ji&&h.getFillStyle(),A=M instanceof G&&M,I=M instanceof W&&M,F=A||I,T=a.thickness<0||1===a.thickness&&this.$s("ApplicationType",(function(t){return"InternalUI"===t.type}))?"primitive":"instanced",C=b?["lookup",b.getLookUpProperty()]:"uniform";if("primitive"===T&&k?S.lines={type:"primitive",fillStyleSolid:x,fillStylePaletted:b,shader:this.NC.KL(iU["3D"],iU.Color({dataType:C}),iU.VertexLocation({axisWorldTranslation:nU(this.Y),normalSource:void 0}))}:"instanced"===T&&v&&k&&(S.lines={type:"instanced",lineStyleSolid:v,fillStyleSolid:x,fillStylePaletted:b,shader:this.NC.KL(iU["3D"],iU.ColorShaded3D({dataType:C,shadingStyle:this.Uy.S().type}),iU.LineInstanced3D({axisWorldTranslation:nU(this.Y)})),geometry:bG(this.NC,v.getThickness())}),S.markers=void 0,F){var D=he(h.getShape(),{cube:function(){return fG(e.NC)},sphere:function(){return kG(e.NC,h)}});S.markers={geometry:D,pointStyle:h,pointSizeNWU:"number"==typeof w&&w,pointSizeAxis:"object"==typeof w&&w,fillStyleSolid:A,fillStylePaletted:I,shader:this.NC.KL(iU["3D"],iU.ColorShaded3D({dataType:I?["lookup",I.getLookUpProperty()]:"uniform",shadingStyle:this.Uy.S().type}),iU.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof w?"nwu":"axis",symmetric:"number"==typeof w,halved:!0},axisWorldTranslation:nU(this.Y),normalSource:D.zD}))}}if(this.YP=S,b){if(b&&b.lut.isValid){var L=b.getPalette();this.xP=this.HI.wP(L,this.gP,this.xP),this.gP=L}}else this.HI.QL.Ts(this.gP),this.gP=void 0}return this.oo(),this.oh=[],this.hh=0,this.Aa=a,this.a_=h,this.Uy.i=!1,this},e.prototype.zC=function(){var t=this,e=this.NC.gl,i=this.YP,n=i.lines,r=i.markers,o=this.Uy.S();if(n&&"instanced"===n.type){var s=n.shader,a=n.geometry,l=n.lineStyleSolid,h=n.fillStyleSolid,u=n.fillStylePaletted;this.NC.hI(s,(function(i,n,r){t.NC.TB(s).lL(i("uScale"),t.GD.DB.II()).lL(i("uDisp"),t.GD.DB.LI()).vL(i("uViewProjectionMatrix"),t.i_).SL(i("uOffsetWU"),t.Vu.Gy(l.getThickness())),"phong"===o.type&&t.NC.lL(i("uCameraLoc"),t.n_).lL(i("uLightLoc"),t.e_).SL(i("uAmbientReflection"),o.ambientReflection).SL(i("uSpecularReflection"),o.specularReflection).SL(i("uDiffuseReflection"),o.diffuseReflection).SL(i("uShininess"),o.shininess).yL(i("uLightColor"),o.specularColor).yL(i("uAmbientColor"),o.ambientColor),h?t.NC.yL(i("uColorDiffuse"),h.getColor()):u&&t.xP&&t.NC.pL(i("uLookupTexture"),t.xP.texture,0).SL(i("uLookupMin"),u.lut.min).SL(i("uLookupMax"),u.lut.max).SL(i("uLookupTextureHeightPx"),t.xP.textureHeight),t.kc.forEach((function(i){e.bindBuffer(e.ARRAY_BUFFER,i.vertexBuffer);var o=n("aLocationA"),s=n("aLocationB");e.vertexAttribPointer(o,3,e.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),t.NC.CL(o,1),e.enableVertexAttribArray(o),e.vertexAttribPointer(s,3,e.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),t.NC.CL(s,1),e.enableVertexAttribArray(s),a.TB(r).my(i.existingCoordinatesCount-1)}))}))}if(n&&"primitive"===n.type){var c=n.shader,f=n.fillStyleSolid,p=n.fillStylePaletted;this.NC.hI(c,(function(i,n){t.NC.TB(c).lL(i("uScale"),t.GD.DB.II()).lL(i("uDisp"),t.GD.DB.LI()).vL(i("uViewProjectionMatrix"),t.i_),f?t.NC.yL(i("uColor"),f.getColor()):p&&t.xP&&t.NC.pL(i("uLookupTexture"),t.xP.texture,0).SL(i("uLookupMin"),p.lut.min).SL(i("uLookupMax"),p.lut.max).SL(i("uLookupTextureHeightPx"),t.xP.textureHeight),t.kc.forEach((function(i){t.NC.TL(i.vertexBuffer,void 0,{location:n("aPos"),size:3}).my(e.LINE_STRIP,i.existingCoordinatesCount)}))}))}if(r){var y=r.shader,d=r.geometry,g=r.fillStyleSolid,S=r.fillStylePaletted,v=r.pointSizeAxis,m=r.pointSizeNWU;this.NC.hI(y,(function(e,i,n,r){t.NC.TB(y).lL(e("uScale"),t.GD.DB.II()).lL(e("uDisp"),t.GD.DB.LI()).vL(e("uViewProjectionMatrix"),t.i_).SL(r("uRatioNwuWu"),t.GD.c_()),"phong"===o.type&&t.NC.lL(e("uCameraLoc"),t.n_).lL(e("uLightLoc"),t.e_).SL(e("uAmbientReflection"),o.ambientReflection).SL(e("uSpecularReflection"),o.specularReflection).SL(e("uDiffuseReflection"),o.diffuseReflection).SL(e("uShininess"),o.shininess).yL(e("uLightColor"),o.specularColor).yL(e("uAmbientColor"),o.ambientColor),g?t.NC.yL(e("uColorDiffuse"),g.getColor()):S&&t.xP&&t.NC.pL(e("uLookupTexture"),t.xP.texture,0).SL(e("uLookupMin"),S.lut.min).SL(e("uLookupMax"),S.lut.max).SL(e("uLookupTextureHeightPx"),t.xP.textureHeight),!1!==v&&t.NC.lL(e("uOffsetAxis"),[v.x,v.y,v.z]),!1!==m&&t.NC.SL(e("uOffsetNWU"),m),t.kc.forEach((function(e){t.NC.TL(e.vertexBuffer,1,{location:i("aPos"),size:3}),d.my(n,e.existingCoordinatesCount)}))}))}return this},e.prototype.gh=function(t,e){Array.isArray(t)||(t=[t]),this.oh=ce(this.oh,t,{canReturnB:!0}),this.hh+=t.length;var i=e||Re(t);return this.ah=this.ah?Ye(this.ah,i):i,this},e.prototype.ka=function(t){return this.wa="function"==typeof t?t(this.wa):t,this},e.prototype.Ma=function(){return this.wa},e.prototype.Dy=function(t){return this.aS="function"==typeof t?t(this.aS):t,this},e.prototype.f_=function(){return this.aS},e.prototype.Z=function(){return this.ah?Math.max(this.ah.max.x,this.rh.max.x):this.rh.max.x},e.prototype.X=function(){return this.ah?Math.min(this.ah.min.x,this.rh.min.x):this.rh.min.x},e.prototype.q=function(){return this.ah?Math.max(this.ah.max.y,this.rh.max.y):this.rh.max.y},e.prototype.K=function(){return this.ah?Math.min(this.ah.min.y,this.rh.min.y):this.rh.min.y},e.prototype.$=function(){return this.ah?Math.max(this.ah.max.z,this.rh.max.z):this.rh.max.z},e.prototype.J=function(){return this.ah?Math.min(this.ah.min.z,this.rh.min.z):this.rh.min.z},e.prototype.Ph=function(){return.5*this.wa.thickness},e.prototype.Oh=function(){return.5*this.wa.thickness},e.prototype.Qy=function(){return.5*this.wa.thickness},e.prototype.dh=function(){return this.La},e.prototype.lh=function(){return this.oh},e.prototype.xh=function(){return this.sh},e.prototype.wh=function(){return this.hh},e.prototype.bh=function(){return this.so=!0,this.La.length=0,this.sh=0,this.oh=[],this.hh=0,this.rh=Me,this.ah=void 0,this},e.prototype.fP=function(t,e){},e.prototype.dispose=function(){return t.prototype.dispose.call(this),this.IO.kO(),this.YP={},this.gP&&(this.HI.QL.Ts(this.gP),this.gP=void 0),this.xP=void 0,this},e.prototype.mB=function(){return this.dispose(),this},e}(pG),bG=function(t,e){return gG(t,e>50?20:e>20?16:e>10?12:e>5?8:6)},kG=function(t,e){var i=e.getSize();return mG(t,"number"==typeof e?i>50?20:i>20?16:i>10?12:i>5?8:6:20)},wG=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r)||this;s.om=o,s.WD="cull-back",s.kc=[],s.IO=new EU(s.kc,(function(t){return t.vertexBuffer&&s.NC.aI(t.vertexBuffer)}),!1),s.La=[],s.sh=0,s.oh=[],s.hh=0,s.rh=Me,s.ah=Me,s.lS=OB.pointStyle3D,s.Uy.l(E_);var a,l,h,u,c=!0===(null==o?void 0:o.individualPointColorEnabled),f=!0===(null==o?void 0:o.individualPointSizeEnabled),p=!0===(null==o?void 0:o.individualLookupValuesEnabled),y=!0===(null==o?void 0:o.individualPointSizeAxisEnabled),d=0;d+=3,c&&(a=d,d+=4),f&&(l=d,d+=1),p&&(h=d,d+=1),y&&(u=d,d+=3);var g=function(t,e,i,n){return t||e||i||n?!t||e||i||n?t||!e||i||n?t||e||!i||n?t||e||i||!n?function(r,o,s){for(var a=3+(t?4:0)+(e?1:0)+(i?1:0)+(n?3:0),l=r.length,h=new Float32Array(l*a),u=0,c=u,f=0;f0,a=this.lS,l=this.lS!==this.l_,h=this.Is.i,u=this.jD();this.ah&&(this.rh=Ye(this.rh,this.ah),this.ah=void 0),s&&(this.La=ce(this.La,r,{canReturnB:!0}),this.sh+=o);var c=r,f=o;if((i||n)&&(this.kc.forEach((function(t){t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=Me})),this.IO.wO(),c=this.La,f=this.sh),f>0){var p=Math.floor(this.HI.u_/(this.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),y=It(f,1e5,p);this.IO.pO(c,y,(function(t,i,n){return{existingDataPointsCount:n,existingCoordinatesCount:n,allocatedCoordinatesCount:t,boundaries:Me,vertexBuffer:e.NC.bL(t*e.OO.attributesPerVertex,e.OO.prepareRenderData(i,n))}}),(function(t,i,n){e.NC.xL(t.vertexBuffer,t.existingCoordinatesCount*e.OO.attributesPerVertex,e.OO.prepareRenderData(i,n)),t.existingDataPointsCount+=n,t.existingCoordinatesCount=t.existingDataPointsCount}))}if(l||n||u||h){var d=void 0,g=a.getSize(),S=a.getFillStyle(),v=this.OO.individualPointColorEnabled,m=this.OO.individualPointSizeEnabled,x=this.OO.individualPointSizeAxisEnabled,b=this.OO.individualLookupValuesEnabled,k=S instanceof G&&S,w=S instanceof X&&S,M=S instanceof W&&S;if(w&&!v){var A="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw gt.alert(A),new Error(A)}if(M&&"value"===M.getLookUpProperty()&&!b)throw A='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !',gt.alert(A),new Error(A);var I=a instanceof Ji&&a,F=I&&I.getWireframeStyle(),T=F&&F instanceof J&&F,C=T&&T.getFillStyle(),D=C&&C instanceof G&&C;if(k||w||M||D){var L=w?"attribute":M?["lookup",M.getLookUpProperty()]:"uniform",P=m&&"number"==typeof g,B=x&&"object"==typeof g,E=P||B?"attribute":"uniform";if(a instanceof Ji){var O=he(a.getShape(),{cube:function(){return fG(e.NC)},sphere:function(){return MG(e.NC,a,m)}});d={type:"instanced",shader:this.NC.KL(iU["3D"],iU.ColorShaded3D({dataType:L,shadingStyle:this.Uy.S().type,wireframe:!1!==D}),iU.VertexLocation({offset:{dataType:E,sizeUnit:"number"==typeof g?"nwu":"axis",halved:!0,symmetric:"number"==typeof g},axisWorldTranslation:nU(this.Y),normalSource:O.zD})),pointStyle:a,useIndividualPointSize:P,useIndividualPointSize3D:B,pointSizeNWU:"number"==typeof g&&g,pointSizeAxis:"object"==typeof g&&g,fillStyleSolid:k,fillStyleIndividual:w,fillStylePalette:M,geometry:O,wireframe:T&&D&&{thickness:T.getThickness(),fillStyleSolid:D}}}else a instanceof $i&&"number"==typeof g&&(d={type:"primitive",shader:this.NC.KL(iU["3D"],iU.PointSize(E),iU.Color({dataType:L}),iU.VertexLocation({axisWorldTranslation:nU(this.Y),normalSource:void 0})),pointStyle:a,pointSizePixels:g,useIndividualPointSize:P,fillStyleSolid:k,fillStyleIndividual:w,fillStylePalette:M})}if(this.YP=d,S instanceof W){var _=S.getPalette();this.sD=this.HI.wP(_,this.gP,this.sD),this.gP=_}else this.sD=void 0,this.HI.QL.Ts(this.gP),this.gP=void 0}return this.oo(),this.oh=[],this.hh=0,this.l_=a,this.Uy.i=!1,this},e.prototype.zC=function(){var t=this,e=this.NC.gl,i=this.YP;if(!i)return this;var n=i.shader;if(!n)return this;var r=this.Uy.S(),o=i.fillStyleSolid,s=i.fillStylePalette,a=i.useIndividualPointSize,l="instanced"===i.type&&i.useIndividualPointSize3D;return this.NC.hI(n,(function(h,u,c,f){if(t.NC.TB(n).lL(h("uScale"),t.GD.DB.II()).lL(h("uDisp"),t.GD.DB.LI()).vL(h("uViewProjectionMatrix"),t.i_),"instanced"===i.type){var p=i.pointSizeAxis,y=i.pointSizeNWU;!1!==p&&!1===l&&t.NC.lL(h("uOffsetAxis"),[p.x,p.y,p.z]),!1!==y&&!1===a&&t.NC.SL(h("uOffsetNWU"),y).SL(f("uRatioNwuWu"),t.GD.c_())}else if("primitive"===i.type){var d=i.pointSizePixels;a||t.NC.SL(h("uPointSize"),d).SL(h("uDevicePixelRatio"),t.NC.IB())}if("instanced"===i.type){var g=i.wireframe;"phong"===r.type&&t.NC.lL(h("uCameraLoc"),t.n_).lL(h("uLightLoc"),t.e_).SL(h("uAmbientReflection"),r.ambientReflection).SL(h("uSpecularReflection"),r.specularReflection).SL(h("uDiffuseReflection"),r.diffuseReflection).SL(h("uShininess"),r.shininess).yL(h("uLightColor"),r.specularColor).yL(h("uAmbientColor"),r.ambientColor),g&&t.NC.SL(h("uWireframeThickness"),g.thickness).yL(h("uWireframeColor"),g.fillStyleSolid.getColor()),o&&t.NC.yL(h("uColorDiffuse"),o.getColor())}else"primitive"===i.type&&o&&t.NC.yL(h("uColor"),o.getColor());s&&t.sD&&t.NC.pL(h("uLookupTexture"),t.sD.texture,0).SL(h("uLookupMin"),s.lut.min).SL(h("uLookupMax"),s.lut.max).SL(h("uLookupTextureHeightPx"),t.sD.textureHeight),t.kc.forEach((function(n,r){e.bindBuffer(e.ARRAY_BUFFER,n.vertexBuffer);var o=u("aPos");if(e.vertexAttribPointer(o,3,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,t.OO.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&t.NC.CL(o,1),e.enableVertexAttribArray(o),i.fillStyleIndividual&&void 0!==t.OO.attributeOffsetColor){var s=u("aColor");e.vertexAttribPointer(s,4,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,t.OO.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&t.NC.CL(s,1),e.enableVertexAttribArray(s)}if(a&&void 0!==t.OO.attributeOffsetSize){"instanced"===i.type?t.NC.SL(f("uRatioNwuWu"),t.GD.c_()):"primitive"===i.type&&t.NC.SL(h("uDevicePixelRatio"),t.NC.IB());var p=u("instanced"===i.type?"aOffsetNWU":"aPointSize");e.vertexAttribPointer(p,1,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,t.OO.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&t.NC.CL(p,1),e.enableVertexAttribArray(p)}if(l&&void 0!==t.OO.attributeOffsetPointSize3D&&"instanced"===i.type){var y=u("aOffsetAxis");e.vertexAttribPointer(y,3,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,t.OO.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&t.NC.CL(y,1),e.enableVertexAttribArray(y)}if(i.fillStylePalette&&"value"===i.fillStylePalette.getLookUpProperty()&&void 0!==t.OO.attributeOffsetLookUpValue){var d=u("aLookupValue");e.vertexAttribPointer(d,1,e.FLOAT,!1,t.OO.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,t.OO.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&t.NC.CL(d,1),e.enableVertexAttribArray(d)}"instanced"===i.type?i.geometry.my(c,n.existingCoordinatesCount):"primitive"===i.type&&t.NC.my(e.POINTS,n.existingCoordinatesCount)}))})),this},e.prototype.gh=function(t,e){Array.isArray(t)||(t=[t]),this.oh=ce(this.oh,t,{canReturnB:!0}),this.hh+=t.length;var i=e||Re(t);return this.ah=this.ah?Ye(this.ah,i):i,this},e.prototype.fS=function(t){return this.lS="function"==typeof t?t(this.lS):t,this},e.prototype.d_=function(){return this.lS},e.prototype.Z=function(){return this.ah?Math.max(this.ah.max.x,this.rh.max.x):this.rh.max.x},e.prototype.X=function(){return this.ah?Math.min(this.ah.min.x,this.rh.min.x):this.rh.min.x},e.prototype.q=function(){return this.ah?Math.max(this.ah.max.y,this.rh.max.y):this.rh.max.y},e.prototype.K=function(){return this.ah?Math.min(this.ah.min.y,this.rh.min.y):this.rh.min.y},e.prototype.$=function(){return this.ah?Math.max(this.ah.max.z,this.rh.max.z):this.rh.max.z},e.prototype.J=function(){return this.ah?Math.min(this.ah.min.z,this.rh.min.z):this.rh.min.z},e.prototype.Ph=function(){var t=this.lS,e=t.getSize();return"number"==typeof e?t instanceof Ji?e/2:t instanceof $i?5:0:0},e.prototype.Oh=function(){return this.Ph()},e.prototype.Qy=function(){return this.Ph()},e.prototype.dh=function(){return this.La},e.prototype.lh=function(){return this.oh},e.prototype.xh=function(){return this.sh},e.prototype.wh=function(){return this.hh},e.prototype.bh=function(){return this.so=!0,this.La.length=0,this.sh=0,this.oh=[],this.hh=0,this.rh=Me,this.ah=void 0,this},e.prototype.fP=function(t,e){},e.prototype.dispose=function(){return t.prototype.dispose.call(this),this.IO.kO(),this.HI.QL.Ts(this.gP),this.gP=void 0,this.sD=void 0,this.YP=void 0,this},e.prototype.mB=function(){return this.dispose(),this},e}(pG),MG=function(t,e,i){var n=e.getSize();return mG(t,"number"==typeof n?i||n>=50?20:n>=10?10:n>=3?5:3:32)},AG=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.vP="grid",o.WD="disabled",o.yP=[],o.zh=0,o.Da=0,o.kt=F({x:0,y:0,z:0}),o._a=F({x:0,y:0}),o.Ra=F({x:0,y:0}),o.oi={x:0,y:0},o.ri={x:0,y:0},o.za=!0,o.Na=!0,o.Ea=!0,o.rh=Me,o.Va=!0,o.ho=OB.fillStyle,o.Ga=Y,o.Uy.l(P_),o}return h(e,t),e.prototype.Un=function(){var t,e,i,n,r,o,s,a,l,h,u,f,p=this.co(),y=this.Ls,d=this.so;if(this.fo()&&this.eu&&this.iu){var g=this.NC,S=this.ho,v=this.uo!==S,m=this.jD(),x=this.Ga,b=this.au!==x,k=this.ja(),w=this.Y.x.i||this.Y.y.i||this.Y.z.i;if(k||y){var M=this._a.S(),A=M.y,I=M.x,F=this.Va?101:201;this.SP=uU(A,I,F),this.mP=cU(this.SP),this.pP(),this.yP=this.mP.map((function(){return{vbo:void 0,ibo:void 0,colors:void 0,intensities:void 0,length:0}})),this._a.i=!1,this.Ra.i=!1}var T=this.mP,C=this.yP,D=this.iu;if(p||y||w||this.Ea||d||k){this.rh=Me;try{for(var L=c(T),P=L.next();!P.done;P=L.next()){var B=P.value;fU(D,this.Va,B,yU,this.Y)}}catch(e){t={error:e}}finally{try{P&&!P.done&&(e=L.return)&&e.call(L)}finally{if(t)throw t.error}}var E=0;try{for(var O=c(C),_=O.next();!_.done;_=O.next()){(et=_.value).vbo&&g.gl.deleteBuffer(et.vbo),et.ibo&&g.gl.deleteBuffer(et.ibo);var V=T[E];E+=1,et.vbo=g.gL(V.vbo),et.ibo=g.kL(V.ibo),et.length=V.length,et.lengthWireframe=V.lengthWireframe,this.rh=Ye(this.rh,V.boundary)}}catch(t){i={error:t}}finally{try{_&&!_.done&&(n=O.return)&&n.call(O)}finally{if(i)throw i.error}}this.Ea=!1}if(S instanceof W||(this.HI.QL.Ts(this.gP),this.gP=void 0),v||y||m){var z=S instanceof G&&S,N=S instanceof X&&S,R=S instanceof W&&S;this.OB=z||N||R?g.KL(iU["3D"],iU.ColorShaded3D({dataType:z?"uniform":N?"attribute":["lookup",R.getLookUpProperty()],shadingStyle:this.Uy.S().type}),iU.VertexLocation({translation:"grid"===this.vP?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:nU(this.Y),normalSource:"attribute"})):void 0}(b||y)&&(this.bP=x instanceof G?g.KL(iU["3D"],iU.Color({dataType:"uniform"}),iU.VertexLocation({translation:"grid"===this.vP?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:nU(this.Y),normalSource:void 0}),iU.OffsetTowardsCamera()):void 0);var H=this.eu;if(S instanceof W&&S.lut.isValid){if("value"===S.getLookUpProperty()&&(this.Na||this.Ls)){try{for(var Y=c(T),U=Y.next();!U.done;U=Y.next()){var j=U.value;dU(H,this.Va,j,yU)}}catch(t){r={error:t}}finally{try{U&&!U.done&&(o=Y.return)&&o.call(Y)}finally{if(r)throw r.error}}E=0;try{for(var K=c(C),Z=K.next();!Z.done;Z=K.next())(et=Z.value)&&et.intensities&&g.gl.deleteBuffer(et.intensities),V=T[E],E+=1,et.intensities=g.ML(V.intensities)}catch(t){s={error:t}}finally{try{Z&&!Z.done&&(a=K.return)&&a.call(K)}finally{if(s)throw s.error}}this.Na=!1}var q=S.getPalette();this.xP=this.HI.wP(q,this.gP,this.xP),this.gP=q}else if(S instanceof X&&(this.kP&&g.sI(this.kP),this.za||this.Ls)){try{for(var Q=c(T),J=Q.next();!J.done;J=Q.next())j=J.value,gU(H,S.color,this.Va,j,yU)}catch(t){l={error:t}}finally{try{J&&!J.done&&(h=Q.return)&&h.call(Q)}finally{if(l)throw l.error}}E=0;try{for(var $=c(C),tt=$.next();!tt.done;tt=$.next()){var et;(et=tt.value).colors&&g.gl.deleteBuffer(et.colors),V=T[E],E+=1,et.colors=g.ML(V.colors)}}catch(t){u={error:t}}finally{try{tt&&!tt.done&&(f=$.return)&&f.call($)}finally{if(u)throw u.error}}this.za=!1}}return this.so=!1,this.Ls=!1,this.lo(this.ho),this.au=this.Ga,this.Uy.i=!1,this},e.prototype.zC=function(){var t=this,e=this.eu&&this.iu;if(this.fo()&&e){var i=this.OB,n=this.Uy.S();if(i){var r=(l=this.ho)instanceof G&&l,o=l instanceof W&&l,s=l instanceof X&&l;this.NC.hI(i,(function(e,a,l){var h,u;t.NC.TB(i).lL(e("uScale"),t.GD.DB.II()).lL(e("uDisp"),t.GD.DB.LI()).vL(e("uViewProjectionMatrix"),t.i_),"phong"===n.type&&t.NC.lL(e("uCameraLoc"),t.n_).lL(e("uLightLoc"),t.e_).SL(e("uAmbientReflection"),n.ambientReflection).SL(e("uSpecularReflection"),n.specularReflection).SL(e("uDiffuseReflection"),n.diffuseReflection).SL(e("uShininess"),n.shininess).yL(e("uLightColor"),n.specularColor).yL(e("uAmbientColor"),n.ambientColor),"grid"===t.vP&&t.NC.lL(e("uTranslationAxis"),[t.oi.x,0,t.oi.y]),r&&t.NC.yL(e("uColorDiffuse"),r.getColor()),o&&o.lut.isValid&&t.xP&&t.NC.SL(e("uLookupMin"),o.lut.min).SL(e("uLookupMax"),o.lut.max).SL(e("uLookupTextureHeightPx"),t.xP.textureHeight).pL(e("uLookupTexture"),t.xP.texture,0);try{for(var f=c(t.yP),p=f.next();!p.done;p=f.next()){var y=p.value,d=y.vbo,g=y.ibo,S=y.colors,v=y.intensities,m=y.length;t.NC.TL(d,void 0,{location:a("aPos"),size:3},{location:a("aNormal"),size:3}).PL(g),o&&"value"===o.getLookUpProperty()&&v&&t.NC.IL(a("aLookupValue"),v),s&&S&&t.NC.LL(a("aColor"),S),t.NC.OL(m)}}catch(t){h={error:t}}finally{try{p&&!p.done&&(u=f.return)&&u.call(f)}finally{if(h)throw h.error}}}))}var a=this.bP;if(a){var l,h=(l=this.Ga)instanceof G&&l;h&&this.NC.hI(a,(function(e,i,n){var r,o;t.NC.TB(a).lL(a.NB("uScale"),t.GD.DB.II()).lL(a.NB("uDisp"),t.GD.DB.LI()).vL(a.NB("uViewProjectionMatrix"),t.i_).lL(a.NB("uCameraLoc"),t.n_),"grid"===t.vP&&t.NC.lL(a.NB("uTranslationAxis"),[t.oi.x,0,t.oi.y]),t.NC.yL(a.NB("uColor"),h.getColor());try{for(var s=c(t.yP),l=s.next();!l.done;l=s.next()){var u=l.value,f=u.vbo,p=u.ibo,y=u.lengthWireframe;t.NC.TL(f,void 0,{location:i("aPos"),size:3},{location:void 0,size:3}).PL(p).OL(y,t.NC.gl.LINES)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}}))}}return this},e.prototype.fP=function(t,e){},e.prototype.pP=function(){var t,e,i=this.NC;if(this.yP.length>0){try{for(var n=c(this.yP),r=n.next();!r.done;r=n.next()){var o=r.value,s=o||{},a=s.vbo,l=s.ibo,h=s.colors,u=s.intensities;a&&(i.aI(a),o.vbo=void 0),l&&(i.aI(l),o.ibo=void 0),h&&(i.aI(h),o.colors=void 0),u&&(i.aI(u),o.intensities=void 0)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.yP.length=0}},e.prototype.mB=function(){return this.pP(),this.kP&&(this.NC.sI(this.kP),this.kP=void 0),this.OB=void 0,this.bP=void 0,this.HI.QL.Ts(this.gP),this.gP=void 0,this.xP=void 0,this},e.prototype.l=function(t){return kE.l(this,t,(function(t,e){return{x:t,y:0,z:e}})),this},e.prototype.ja=function(){return kE.ja(this)},e.prototype.Ua=function(){return kE.Ua(this)},e.prototype.Vo=function(){return kE.Vo(this)},e.prototype.wh=function(){return kE.wh(this)},e.prototype.Ya=function(t,e,i){return kE.Ya(this,t,e,i),this},e.prototype.Xa=function(t,e,i){return kE.Xa(this,t,e,i),this},e.prototype.Za=function(t,e){return kE.Za(this,t,e),this},e.prototype.Ka=function(t,e){return kE.Ka(this,t,e),this},e.prototype.qa=function(t,e){return this.vP="mesh",kE.qa(this,t,e),this},e.prototype.hu=function(t,e){return kE.hu(this,t,e),this},e.prototype.bh=function(){return kE.bh(this,(function(t,e){return{x:t,y:0,z:e}})),this},e.prototype.Ja=function(){return kE.Ja(this)},e.prototype.Qa=function(){return kE.Qa(this)},e.prototype.$a=function(){return kE.$a(this)},e.prototype.xh=function(){return kE.xh(this)},e.prototype.co=function(){return kE.co(this)},e.prototype.fo=function(){return kE.fo(this)},e.prototype.Z=function(){return"grid"===this.vP?this.rh.max.x+this.oi.x:this.rh.max.x},e.prototype.X=function(){return"grid"===this.vP?this.rh.min.x+this.oi.x:this.rh.min.x},e.prototype.q=function(){return this.vP,this.rh.max.y},e.prototype.K=function(){return this.vP,this.rh.min.y},e.prototype.$=function(){return"grid"===this.vP?this.rh.max.z+this.oi.y:this.rh.max.z},e.prototype.J=function(){return"grid"===this.vP?this.rh.min.z+this.oi.y:this.rh.min.z},e.prototype.Ph=function(){return 0},e.prototype.Oh=function(){return 0},e.prototype.Qy=function(){return 0},e.prototype.pn=function(t){return this.ho=tE(this.ho,t),this},e.prototype.mn=function(){return this.ho},e.prototype.Ha=function(t){return this.Ga=tE(this.Ga,t),this},e.prototype.Wa=function(){return this.Ga},e.prototype.ao=function(){return eE(this.uo,this.ho)},e.prototype.lo=function(t){this.uo=t},e}(pG),IG=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r)||this;s.WD="disabled",s.ho=OB.fillStyle,s.Ga=OB.lineStyle,s.nD=F("bilinear"),s.v_=[],s.y_=Me,s.S_=void 0,s.m_=!1,s.Uy.l(P_);var a="columns"===o.dataOrder?o.columns:o.rows,l="columns"===o.dataOrder?o.rows:o.columns;s.om=u(u({},o),{primaryDimensionVectorsCount:a,secondaryDimensionVectorsCount:l}),s.y_={min:{x:Math.min(o.start.x,o.start.x+(o.columns-1)*o.step.x),z:Math.min(o.start.z,o.start.z+(o.rows-1)*o.step.z)},max:{x:Math.max(o.start.x,o.start.x+(o.columns-1)*o.step.x),z:Math.max(o.start.z,o.start.z+(o.rows-1)*o.step.z)}},s.p_=new Array(s.om.primaryDimensionVectorsCount).fill(void 0),s.g_=new $U(s.HI,e.As.Y,Mt,Mt,[],u(u({},s.om),{start:{x:0,y:0},step:{x:1,y:1}})).Ha(Q),s.g_.tD=KU;var h=s.g_.iD.gridTiles.map((function(t){var e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,n=t.iFirstVector,r=t.iFirstUniqueVector,o="columns"===s.om.dataOrder?{x:s.om.step.x*(t.sizeHeatmapDataVectors.primary-1),z:s.om.step.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:s.om.step.x*(t.sizeHeatmapDataVectors.secondary-1),z:s.om.step.z*(t.sizeHeatmapDataVectors.primary-1)},a="columns"===s.om.dataOrder?{x:s.om.start.x+s.om.step.x*t.iFirstVector.primary,z:s.om.start.z+s.om.step.z*t.iFirstVector.secondary}:{x:s.om.start.x+s.om.step.x*t.iFirstVector.secondary,z:s.om.start.z+s.om.step.z*t.iFirstVector.primary},l=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary),h={primary:t.sizeHeatmapDataVectors.primary-1,secondary:t.sizeHeatmapDataVectors.secondary-1};return{iFirstVector:t.iFirstVector,iFirstUniqueVector:t.iFirstUniqueVector,sizeHeatmapDataVectors:t.sizeHeatmapDataVectors,sizeUniqueHeatmapDataVectors:t.sizeUniqueHeatmapDataVectors,iFirstGeometryVector:n,iFirstGeometryUniqueVector:r,sizeGeometryDataVectors:e,sizeUniqueGeometryDataVectors:i,startLocationAxis:a,sizeAxis:o,heightmapData:l,normalmapSize:h}})),c=s.g_.iD.gridTileSizes.map((function(t){var e=h.filter((function(e){return e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary})),i=e[0].sizeGeometryDataVectors;return u(u({},t),{tiles:e,sizeGeometryData:i})})),f=h.reduce((function(t,e){var i=e.sizeHeatmapDataVectors.primary,n=e.sizeHeatmapDataVectors.secondary,r=i*n;return r>t.cells?{primary:i,secondary:n,cells:r}:t}),{primary:0,secondary:0,cells:0});return s.b_={gridTiles:h,gridTileSizes:c,largestGridTileSize:f},s}return h(e,t),e.prototype.x_=function(t){this.w_=t,this.S_=void 0},e.prototype.k_=function(t){"columns"===this.om.dataOrder?(this.y_.min.x=Math.min(this.om.start.x,this.om.start.x+(this.om.columns-1)*this.om.step.x)+t,this.y_.max.x=Math.max(this.om.start.x,this.om.start.x+(this.om.columns-1)*this.om.step.x)+t):(this.y_.min.z=Math.min(this.om.start.z,this.om.start.z+(this.om.rows-1)*this.om.step.z)+t,this.y_.max.z=Math.max(this.om.start.z,this.om.start.z+(this.om.rows-1)*this.om.step.z)+t),this.M_=t},e.prototype.Un=function(t){var e=this,i=this.v_,n=this.ho,r=n instanceof G&&n,o=n instanceof W&&n,s=eE(this.uo,n),a=o&&o.getPalette(),l=this.Ga,h=l instanceof J&&l,u=h&&h.getFillStyle(),c=u&&u instanceof G&&u,f=!1!==c,p=l!==this.au,y=this.nD.i,d=this.nD.S(),g=this.Uy.S(),S=this.jD(),v=this.Ls;this.g_.Un();var m=this.g_.eD;if(!m)return this;this.A_=this.A_||this.F_(m);var x=this.A_;this.T_(x);var b=ZU(i,x,v&&this.m_?"y":void 0,(function(t){return t.sizeGeometryDataVectors}));if(b.size>0&&(JU(this.NC,b,(function(t){return t.heightmapData}),(function(t){return t.heightmapDataTexture})),this.m_=!0),"phong"===g.type&&(b.size>0||S)){var k=this.NC.gl,w=this.NC.KL(iU["2D"],iU.DrawToNormalTexture({flipXZ:"rows"===this.om.dataOrder,vertexIdSource:this.NC.mI(),normalTextureType:this.NC.gl2?"uint":"ubyte",heightmapTextureType:this.NC.XL?"float":"ubyte",littleEndian:this.NC.IS_MACHINE_LITTLE_ENDIAN}));x.gridTileSizes.forEach((function(t){t.tiles.forEach((function(i){var n=i.normalmapTexture;if(n){var r={x:i.normalmapSize.secondary,y:i.normalmapSize.primary},o=r.x*r.y;e.NC.$L.zC((function(){e.NC.hI(w,(function(n,r,s,a){e.NC.TB(w).pI(s,o).uL(n("uTileDimensionsXZ"),["columns"===e.om.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===e.om.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary]).cL(n("uTileDimensions"),[t.sizeHeatmapData.primary,t.sizeHeatmapData.secondary]).uL(n("uTileStartLocationAxisXZ"),[i.startLocationAxis.x+("columns"===e.om.dataOrder&&e.M_||0),i.startLocationAxis.z+("rows"===e.om.dataOrder&&e.M_||0)]).uL(n("uTileSizeAxisXZ"),[i.sizeAxis.x,i.sizeAxis.z]).pL(n("uHeightmapTexture"),i.heightmapDataTexture,1).my(k.POINTS,o)}))}),n,r,void 0,e.As.Bt(),e.As.wr(),0)}}))}))}if(s||p||this.Ls||y){a?(this.sD=this.HI.wP(a,this.oD,this.sD),this.oD=a):(this.sD=void 0,this.HI.QL.Ts(this.oD),this.oD=void 0);var M=h&&c?{wireframeSolid:h,wireframeFillSolid:c}:void 0,A=void 0;r?A={shader:this.NC.KL(iU["3D"],iU.SurfaceGrid({axisWorldTranslation:nU(this.Y),fillColor:"uniform",interpolation:"bilinear"===d&&"bilinear",flipXZ:"rows"===this.om.dataOrder,shadingStyle:g.type,wireframe:f,instanceIdSource:this.NC.gI(),normalTextureType:this.NC.gl2?"uint":"ubyte",intensityTextureType:this.NC.XL?"float":"ubyte",heightmapTextureType:this.NC.XL?"float":"ubyte",littleEndian:this.NC.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:r},wireframe:M}:this.sD&&o&&"value"===o.getLookUpProperty()?A={shader:this.NC.KL(iU["3D"],iU.SurfaceGrid({axisWorldTranslation:nU(this.Y),fillColor:["lookup","value"],interpolation:"bilinear"===d&&"bilinear",flipXZ:"rows"===this.om.dataOrder,shadingStyle:g.type,wireframe:f,instanceIdSource:this.NC.gI(),normalTextureType:this.NC.gl2?"uint":"ubyte",intensityTextureType:this.NC.XL?"float":"ubyte",heightmapTextureType:this.NC.XL?"float":"ubyte",littleEndian:this.NC.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:o,colorLookupTexture:this.sD},wireframe:M}:this.sD&&o?A={shader:this.NC.KL(iU["3D"],iU.SurfaceGrid({axisWorldTranslation:nU(this.Y),fillColor:["lookup",o.getLookUpProperty()],interpolation:"bilinear"===d&&"bilinear",flipXZ:"rows"===this.om.dataOrder,shadingStyle:g.type,wireframe:f,instanceIdSource:this.NC.gI(),normalTextureType:this.NC.gl2?"uint":"ubyte",intensityTextureType:this.NC.XL?"float":"ubyte",heightmapTextureType:this.NC.XL?"float":"ubyte",littleEndian:this.NC.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:o,colorLookupTexture:this.sD},wireframe:M}:f&&(A={shader:this.NC.KL(iU["3D"],iU.SurfaceGrid({axisWorldTranslation:nU(this.Y),fillColor:void 0,interpolation:"bilinear"===d&&"bilinear",flipXZ:"rows"===this.om.dataOrder,shadingStyle:g.type,wireframe:f,instanceIdSource:this.NC.gI(),normalTextureType:this.NC.gl2?"uint":"ubyte",intensityTextureType:this.NC.XL?"float":"ubyte",heightmapTextureType:this.NC.XL?"float":"ubyte",littleEndian:this.NC.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:M}),this.YP=A}return this.v_.length=0,this.so=!1,this.Ls=!1,this.uo=n,this.au=l,this.Uy.i=!1,this},e.prototype.F_=function(t){var e=this,i=this.b_.gridTiles.map((function(i){var n=QU(e.NC,i.sizeHeatmapDataVectors.secondary,i.sizeHeatmapDataVectors.primary),r=t.gridTiles.find((function(t){return t.iFirstUniqueVector.primary===i.iFirstUniqueVector.primary&&t.iFirstUniqueVector.secondary===i.iFirstUniqueVector.secondary}));if(!r)throw new Error("Internal LC JS error prepare surface data 2D render data not found");return u(u({},i),{intensityDataTexture:r.intensityDataTexture,heightmapDataTexture:n,normalmap:void 0})})),n=this.b_.gridTileSizes.map((function(t){var e=i.filter((function(e){return e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary}));return u(u({},t),{tiles:e})})),r=this.NC.gL([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]),o=this.NC.gl.TRIANGLES;return{gridTiles:i,gridTileSizes:n,rectangleLocationsBuffer:r,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:o}},e.prototype.T_=function(t){var e,i=this;if("phong"===this.Uy.S().type)for(var n=0;nc||pl.max?r:l.max;else{l={min:be,max:ke},t.p_[s]=l;for(var h=0;hu?r:u,l.min=Math.min(l.min,u),l.max=Math.max(l.max,u)}}}})),this.S_={min:n,max:r},this.S_},e}(pG),FG=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n,r)||this;s.WD="disabled",s.cD=0,s.lD={};var a={min:{x:o.start.x,z:o.start.z},max:{x:"rows"===o.scrollDimension?o.start.x+(o.columns-1)*o.step.x:o.start.x,z:"columns"===o.scrollDimension?o.start.z+(o.rows-1)*o.step.z:o.start.z}};s.om=u(u({},o),{initialBoundaries:a,scrollDimensionSize:"columns"===o.scrollDimension?o.columns:o.rows,staticDimensionSize:"columns"===o.scrollDimension?o.rows:o.columns}),s.y_=a;var l=function(){return{shape:new IG(s.GD,Mt,Mt,s.Bs,{columns:o.columns+("columns"===o.scrollDimension?1:0),rows:o.rows+("rows"===o.scrollDimension?1:0),start:{x:0,z:0},step:o.step,dataOrder:o.scrollDimension,heatmapDataType:"intensity"}).dispose(),hasData:!1}};return s.kc=[l(),l()],s}return h(e,t),e.prototype.Un=function(t){return this.kc.forEach((function(e){e.shape.Un(t)})),this},e.prototype.zC=function(){var t=this;return this.kc.forEach((function(e){e.hasData&&(e.shape.i_=t.i_,e.shape.n_=t.n_,e.shape.e_=t.e_,e.shape.zC())})),this},e.prototype.bh=function(){return this.cD=0,this.lD={},this.y_=this.om.initialBoundaries,this.kc.forEach((function(t){t.shape.dispose(),t.shape.m_=!1,t.hasData=!1})),this},e.prototype.Sm=function(t){var e,i=this.isDisposed(),n=this.kc[0],r=this.kc[1],o=t.heightMapValues?t.heightMapValues.length:null===(e=t.intensityValues)||void 0===e?void 0:e.length,s=0;if(!o)return this;do{var a=Math.floor(this.cD/this.om.scrollDimensionSize)%this.kc.length,l=this.kc[a],h=this.cD%this.om.scrollDimensionSize,u=this.om.scrollDimensionSize-h,c=0===h,f=Math.min(u,o),p=h+f,y=h,d=y+1,g=s,S=s+f,v=this.cD>=this.om.scrollDimensionSize&&p<=this.om.scrollDimensionSize-1,m=c;if(c){var x="columns"===this.om.scrollDimension?this.om.start.x+(this.cD-1)*this.om.step.x:this.om.start.z+(this.cD-1)*this.om.step.z;l.shape.k_(x)}var b=v?0:1,k=p+(v?1:0);l.shape.x_({fill:{iFirstPrimary:b,amountPrimary:k},wireframe:{iFirstPrimary:b,amountPrimary:k,connectNext:!1}});var w=l===n?r:n,M=p+1,A=1+this.om.scrollDimensionSize-M;w.shape.x_({fill:{iFirstPrimary:M,amountPrimary:A},wireframe:{iFirstPrimary:M,amountPrimary:A-1,connectNext:!0}});var I={};if(t.heightMapValues){var F=t.heightMapValues.slice(g,S),T=!1;m&&this.lD.yValues&&(T=!0,F.splice(0,0,this.lD.yValues));var C={startPrimary:T?y:d,startSecondary:0,lengthPrimary:F.length,lengthSecondary:this.om.staticDimensionSize,values:F,type:"y"};l.shape.lm(C),l.hasData=!0,i||l.shape.restore(),I.yValues=F[f-1]}if(t.intensityValues){var D=t.intensityValues.slice(g,S),L=!1;m&&this.lD.intensityValues&&(L=!0,D.splice(0,0,this.lD.intensityValues)),C={startPrimary:L?y:d,startSecondary:0,lengthPrimary:D.length,lengthSecondary:this.om.staticDimensionSize,values:D,type:"intensity"},l.shape.fm(C),l.hasData=!0,i||l.shape.restore(),I.intensityValues=D[f-1]}this.cD+=f,s+=f,this.lD=I}while(sxe.length(h)){var u=l;l=h,h=u}var c=xe.normalize(xe.subtractVec(l,h)),f=this.DB.II(),p=this.DB.LI(),y=k(f[0],f[1],f[2]),d=k(p[0],p[1],p[2]),g=xe.addVec(xe.multiplyVec(h,y),d),S=xe.addVec(h,xe.multiply(c,1)),v=xe.addVec(xe.multiplyVec(S,y),d);return{origin:g,direction:xe.normalize(xe.subtractVec(v,g))}}},e.prototype.D_=function(t){var e=this.DB.LI(),i=this.DB.II(),n=xe.divideVec(xe.subtractVec(t,{x:e[0],y:e[1],z:e[2]}),{x:i[0],y:i[1],z:i[2]});return u(u({},t),{x:n.x,y:n.y,z:n.z})},e.prototype.__=function(t){var e=this.DB.LI(),i=this.DB.II(),n=xe.addVec(xe.multiplyVec(t,{x:i[0],y:i[1],z:i[2]}),{x:e[0],y:e[1],z:e[2]});return u(u({},t),{x:n.x,y:n.y,z:n.z})},e.prototype.Gy=function(t){return t/1e3},e.prototype.c_=function(){return.001},e.prototype.zC=function(){var t=this;this.R_=!1,this.Un();var e=this.HL.S(),i=this.i_,n=this.n_.S(),r=this.e_;if(!e||!i)throw new Error("Layer3D viewport is not defined");if(!r)throw new Error("Layer3D light location is not defined");var o=[n.x,n.y,n.z],s=[r.x,r.y,r.z];return this.gl.gl.viewport(e.x*this.gl.IB(),e.y*this.gl.IB(),e.width*this.gl.IB(),e.height*this.gl.IB()),this.AD.forEach((function(e){e.i_=i,e.n_=o,e.e_=s,t.gl.tI(e.WD),t.gl.Ky(e.Xy),e.zC()})),this.gl.tI("disabled"),this.gl.Ky(!1),this},e.prototype.dS=function(t){return this.TD(new wG(this,this.CD,this.BD,[],t))},e.prototype.ky=function(t){return this.TD(new xG(this,this.CD,this.BD,t))},e.prototype.yS=function(){return this.TD(new AG(this,this.CD,this.BD,[]))},e.prototype.oS=function(){return this.TD(new yG(this,this.CD,this.BD,[]))},e.prototype.nv=function(){return this.TD(new SG(this,this.CD,this.BD,[]))},e.prototype.hm=function(t){return this.TD(new IG(this,this.CD,this.BD,[],t))},e.prototype.ym=function(t){return this.TD(new FG(this,this.CD,this.BD,[],t))},e}(function(t){function e(e,i,n){var r=t.call(this,e,i)||this;return r.Y=n,r.R_=!0,r.z_=45,r.O_=.1,r.N_=100,r.n_=F(k(0,0,1)),r.E_=F(k(0,0,-1)),r.V_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],r.Uy=new L_,r}return h(e,t),e.prototype.I_=function(){var t=this.FD.S();if(void 0!==t){var e=t.width/t.height;if(this.G_=VH.projectionPerspective(this.z_,e,this.O_,this.N_),this.n_.i||this.E_.i){if(this.n_.i){var i=this.n_.S();this.V_[12]=i.x,this.V_[13]=i.y,this.V_[14]=i.z}if(this.E_.i){var n=this.E_.S(),r=k(0,1,0),o=xe.multiply(n,-1),s=xe.normalize(xe.cross(r,o)),a=xe.normalize(xe.cross(o,s));this.V_[0]=s.x,this.V_[1]=s.y,this.V_[2]=s.z,this.V_[4]=a.x,this.V_[5]=a.y,this.V_[6]=a.z,this.V_[8]=o.x,this.V_[9]=o.y,this.V_[10]=o.z}this.H_=VH.inverse(this.V_)}this.i_=VH.multiply(this.G_,this.H_),this.P_=VH.inverse(this.i_),this.FD.i=!1,this.n_.i=!1,this.E_.i=!1,this.R_=!0}},e.prototype.Un=function(){return this.I_(),this.L_(),this},e.prototype.setCameraLocation=function(t){return this.n_.l(t),this},e.prototype.getCameraLocation=function(){return this.n_.S()},e.prototype.setCameraDirection=function(t){return this.E_.l(xe.normalize(t)),this},e.prototype.getCameraDirection=function(){return this.E_.S()},e.prototype.setLightLocation=function(t){return this.e_=t,this},e.prototype.getLightLocation=function(){return this.e_},e.prototype.W_=function(){return!0===this.R_||this.FD.i||this.n_.i||this.E_.i},e.prototype.j_=function(){return k(this.V_[0],this.V_[1],this.V_[2])},e.prototype.U_=function(){return k(this.V_[4],this.V_[5],this.V_[6])},e}(nG)),CG=function(t){function e(e,i,n){var r,o,s;void 0===n&&(n=WY);var a=t.call(this,e,i)||this;a.kt=x(1,1),a.Y_=!1,a.X_=0,a.u_=8*Math.pow(1024,2),a.Vi=function(t){return void 0===t&&(t=!1),t&&(a.Y_=!0),void 0===a.er&&(a.er=gt.requestAnimationFrame(a.Z_)),a},a.Z_=function(t){t-a.X_>=a.Gr||-1===a.Gr?(a.X_=t,a.Y_=!1,a.rr&&a.rr(),a.er=void 0,-1!==a.Gr&&(a.er=a.Y_?gt.requestAnimationFrame(a.Z_):void 0),a.Mr(),a.sr&&a.sr()):a.er=gt.requestAnimationFrame(a.Z_)},a.UI=function(){return a.NC},a.Mr=function(){var t,e;a.cs.wt(a.kt),a.br.i&&a.NC.GL(a.br.S()),a.NC.bh();try{for(var i=c(a.tr.values()),n=i.next();!n.done;n=i.next())n.value.zC()}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return a.Ot(),a.lr(),a.Br&&a.Cr(a.Br),a},a.Fs=function(){var t,e;try{for(var i=c(a.tr.values()),n=i.next();!n.done;n=i.next())n.value.Un()}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return a.Ot(),a},a.K_=gt.document.createElement("canvas");var l,h={preserveDrawingBuffer:!0,antialias:i?i.antialias:void 0,alpha:!0,lineAntialias:!i||(!0===i.lineAntiAlias||!1===i.lineAntiAlias?i.lineAntiAlias:!1!==i.antialias)};if("webgl1"!==(null===(r=null==i?void 0:i.webgl)||void 0===r?void 0:r.version)){var u=a.K_.getContext("webgl2",h);u&&(l=new n(a.zr,{type:"webgl2",ctx:u,antialias:h.antialias,lineAntialias:h.lineAntialias}))}if(!l&&"webgl2"!==(null===(o=null==i?void 0:i.webgl)||void 0===o?void 0:o.version)){var f=a.K_.getContext("webgl",h)||a.K_.getContext("experimental-webgl",h);l=new n(a.zr,{type:"webgl1",ctx:f,antialias:h.antialias,lineAntialias:h.lineAntialias})}if(!l)throw new ct("No WebGL context available."+((null===(s=null==i?void 0:i.webgl)||void 0===s?void 0:s.version)?"\nSelected explicit target: "+i.webgl.version:""));a.NC=l,a.QL=HH(a.NC.gl);var p=a.NC.hL;if(p.length>0){var y=gt.document.createElement("div");y.innerText="LightningChart JS: Some features might not work properly, due to missing WebGL features.",y.style.cssText="position:absolute;top:0;background:red;width:100%;padding:10px;text-align:center;color:white;z-index:1;";var d=gt.document.createElement("button");d.innerText="X",d.addEventListener("click",(function(){y.parentElement&&y.parentElement.removeChild(y)})),a.mr.appendChild(y),y.appendChild(d),console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",p.join(", "))}var g=1;if(i&&i.devicePixelRatio)g=!0===i.devicePixelRatio?gt.devicePixelRatio||1:i.devicePixelRatio||1;else{var S=gt.document.head.querySelector('meta[name="viewport"]');S&&S.content.includes("width=device-width")&&(g=gt.devicePixelRatio||1)}a.NC.nI(g),a.K_.style.position="absolute",a.K_.style.top="0",a.K_.style.left="0",a.K_.style.right="0",a.K_.style.bottom="0",a.K_.style.width="100%",a.K_.style.height="100%",a.K_.style.boxSizing="content-box",a.mr.appendChild(a.K_);var v=i?i.width:void 0,m=i?i.height:void 0;a.os=a.q_(v),a.us=a.q_(m),a.J_(a.os,a.us);var b=(null==i?void 0:i.theme)||FB;return a.Q_=a.xv(0),a.cs=a.Q_.tf(a.Y).pn(b.lcjsBackgroundFillStyle||b.dashboardBackgroundFillStyle||Y).fs(b.lcjsBackgroundStrokeStyle||b.dashboardBackgroundStrokeStyle||Q).setMouseInteractions(!1).Eo({x:0,y:0}),a.yr(),a.lr(),a}return h(e,t),Object.defineProperty(e.prototype,"tR",{get:function(){return this.tr},enumerable:!1,configurable:!0}),e.prototype.Kr=function(t,e){return function(t){for(var e=t.split(",")[0].split(":")[1].split(";")[0],i=gt.atob(t.split(",")[1]),n=new Uint8Array(i.length),r=0;r=1&&this.Fi.emit("resize",[this.kt.x,this.kt.y])},e.prototype.ks=function(){t.prototype.ks.call(this),this.K_.width=1,this.K_.height=1,this.K_&&(this.mr.removeChild(this.K_),this.K_=void 0,this.mr=void 0),Array.from(this.NC.sL.values()).forEach((function(t){t.mB()})),Array.from(this.NC.oL.values()).forEach((function(t){t.dispose()})),this.NC.rL.YC(),this.NC.SI&&(this.NC.aI(this.NC.SI.buffer),this.NC.SI=void 0),this.NC.vI(),this.NC.gl=void 0},e.prototype.iR=function(t,e,i){var n=this.kt[t.toLowerCase()],r=i||this.mr["offset"+e]||n||1;return n!==r?(this.K_[e.toLowerCase()]=r*this.NC.IB(),this.kt[t.toLowerCase()]=r,this.Y[t.toLowerCase()].Nt(0,r).wt(r),1):0},e.prototype.wP=function(t,e,i){var n=this.QL,r=i;if(n.KC(t))t!==e&&(n.Ts(e),r=n.S(t),n.gh(t));else{r={};var o=this.Bt(),s={x:1,y:this.NC.SB};r.textureHeight=s.y;var a=$.d2({scaleXYConstructor:Ci}).wt(s);a.x.Nt(0,1),a.y.Nt(t.min,t.max);var l=new SU(this,a,(function(){}),(function(){}),[]);l.pn(new X({color:t.color})),t.interpolate?l.l({columns:2,rows:t.length,start:{x:0,y:t.min},end:{x:1,y:t.max},pixelate:!1}).qa((function(e,i,n){return{x:n.x,y:t.steps[e].value}})).Za((function(e){return t.steps[e].color})):l.l({columns:1,rows:t.length,start:{x:0,y:t.min},end:{x:1,y:t.max},pixelate:!0}).qa((function(e,i,n){return{x:n.x,y:e=49&&h<=54?h-49+10:h>=17&&h<=22?h-17+10:h,s|=l}return i(!(240&s),"Invalid character in "+t),r}function a(t,e,n,r){for(var o=0,s=0,a=Math.min(t.length,n),l=e;l=49?h-49+10:h>=17?h-17+10:h,i(h>=0&&s0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype.$B=function(t,e,n){if("number"==typeof t)return this.nR(t,e,n);if("object"===DG(t))return this.eR(t,e,n);"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.rR(t,r):this.sR(t,e,r),"-"===t[0]&&(this.negative=1),this.oR(),"le"===n&&this.eR(this.toArray(),e,n)},r.prototype.nR=function(t,e,n){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"===n&&this.eR(this.toArray(),e,n)},r.prototype.eR=function(t,e,n){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)s=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(r=0,o=0;r>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.oR()},r.prototype.rR=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=s(t,i,i+6),this.words[n]|=r<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);i+6!==e&&(r=s(t,e,i+6),this.words[n]|=r<>>26-o&4194303),this.oR()},r.prototype.sR=function(t,e,i){this.words=[0],this.length=1;for(var n=0,r=1;r<=67108863;r*=e)n++;n--,r=r/e|0;for(var o=t.length-i,s=o%n,l=Math.min(o,o-s)+i,h=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this.cR()},r.prototype.cR=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")]=h}catch(t){r.prototype.inspect=h}else r.prototype.inspect=h;function h(){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],f=[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 p(t,e,i){i.negative=e.negative^t.negative;var n=t.length+e.length|0;i.length=n,n=n-1|0;var r=0|t.words[0],o=0|e.words[0],s=r*o,a=67108863&s,l=s/67108864|0;i.words[0]=a;for(var h=1;h>>26,c=67108863&l,f=Math.min(h,e.length-1),p=Math.max(0,h-t.length+1);p<=f;p++){var y=h-p|0;u+=(s=(r=0|t.words[y])*(o=0|e.words[p])+c)/67108864|0,c=67108863&s}i.words[h]=0|c,l=0|u}return 0!==l?i.words[h]=0|l:i.length--,i.oR()}r.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var r=0,o=0,s=0;s>>24-r&16777215)||s!==this.length-1?u[6-l.length]+l+n:l+n,(r+=2)>=26&&(r-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],p=f[t];n="";var y=this.clone();for(y.negative=0;!y.isZero();){var d=y.modrn(p).toString(t);n=(y=y.idivn(p)).isZero()?d+n:u[h-d.length]+d+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}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)},o&&(r.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,n){this.oR();var r=this.byteLength(),o=n||Math.max(1,r);i(r<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,r),s},r.prototype.fR=function(t,e){for(var i=0,n=0,r=0,o=0;r>8&255),i>16&255),6===o?(i>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(i=0&&(t[i--]=s>>8&255),i>=0&&(t[i--]=s>>16&255),6===o?(i>=0&&(t[i--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(i>=0)for(t[i--]=n;i>=0;)t[i--]=0},Math.clz32?r.prototype.dR=function(t){return 32-Math.clz32(t)}:r.prototype.dR=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.vR=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.dR(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 n=0;nt.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),n=t%26;this.uR(e),n>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-n),this.oR()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var n=t/26|0,r=t%26;return this.uR(n+1),this.words[n]=e?this.words[n]|1<t.length?(i=this,n=t):(i=t,n=this);for(var r=0,o=0;o>>26;for(;0!==r&&o>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;ot.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.cR()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.cR();var i,n,r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,n=t):(i=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,p=0|s[1],y=8191&p,d=p>>>13,g=0|s[2],S=8191&g,v=g>>>13,m=0|s[3],x=8191&m,b=m>>>13,k=0|s[4],w=8191&k,M=k>>>13,A=0|s[5],I=8191&A,F=A>>>13,T=0|s[6],C=8191&T,D=T>>>13,L=0|s[7],P=8191&L,B=L>>>13,E=0|s[8],O=8191&E,_=E>>>13,V=0|s[9],z=8191&V,N=V>>>13,R=0|a[0],H=8191&R,Y=R>>>13,U=0|a[1],G=8191&U,X=U>>>13,W=0|a[2],j=8191&W,K=W>>>13,Z=0|a[3],q=8191&Z,Q=Z>>>13,J=0|a[4],$=8191&J,tt=J>>>13,et=0|a[5],it=8191&et,nt=et>>>13,rt=0|a[6],ot=8191&rt,st=rt>>>13,at=0|a[7],lt=8191&at,ht=at>>>13,ut=0|a[8],ct=8191&ut,ft=ut>>>13,pt=0|a[9],yt=8191&pt,dt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(h+(n=Math.imul(c,H))|0)+((8191&(r=(r=Math.imul(c,Y))+Math.imul(f,H)|0))<<13)|0;h=((o=Math.imul(f,Y))+(r>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(y,H),r=(r=Math.imul(y,Y))+Math.imul(d,H)|0,o=Math.imul(d,Y);var St=(h+(n=n+Math.imul(c,G)|0)|0)+((8191&(r=(r=r+Math.imul(c,X)|0)+Math.imul(f,G)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(S,H),r=(r=Math.imul(S,Y))+Math.imul(v,H)|0,o=Math.imul(v,Y),n=n+Math.imul(y,G)|0,r=(r=r+Math.imul(y,X)|0)+Math.imul(d,G)|0,o=o+Math.imul(d,X)|0;var vt=(h+(n=n+Math.imul(c,j)|0)|0)+((8191&(r=(r=r+Math.imul(c,K)|0)+Math.imul(f,j)|0))<<13)|0;h=((o=o+Math.imul(f,K)|0)+(r>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(x,H),r=(r=Math.imul(x,Y))+Math.imul(b,H)|0,o=Math.imul(b,Y),n=n+Math.imul(S,G)|0,r=(r=r+Math.imul(S,X)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,X)|0,n=n+Math.imul(y,j)|0,r=(r=r+Math.imul(y,K)|0)+Math.imul(d,j)|0,o=o+Math.imul(d,K)|0;var mt=(h+(n=n+Math.imul(c,q)|0)|0)+((8191&(r=(r=r+Math.imul(c,Q)|0)+Math.imul(f,q)|0))<<13)|0;h=((o=o+Math.imul(f,Q)|0)+(r>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(w,H),r=(r=Math.imul(w,Y))+Math.imul(M,H)|0,o=Math.imul(M,Y),n=n+Math.imul(x,G)|0,r=(r=r+Math.imul(x,X)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(S,j)|0,r=(r=r+Math.imul(S,K)|0)+Math.imul(v,j)|0,o=o+Math.imul(v,K)|0,n=n+Math.imul(y,q)|0,r=(r=r+Math.imul(y,Q)|0)+Math.imul(d,q)|0,o=o+Math.imul(d,Q)|0;var xt=(h+(n=n+Math.imul(c,$)|0)|0)+((8191&(r=(r=r+Math.imul(c,tt)|0)+Math.imul(f,$)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(I,H),r=(r=Math.imul(I,Y))+Math.imul(F,H)|0,o=Math.imul(F,Y),n=n+Math.imul(w,G)|0,r=(r=r+Math.imul(w,X)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(x,j)|0,r=(r=r+Math.imul(x,K)|0)+Math.imul(b,j)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(S,q)|0,r=(r=r+Math.imul(S,Q)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(y,$)|0,r=(r=r+Math.imul(y,tt)|0)+Math.imul(d,$)|0,o=o+Math.imul(d,tt)|0;var bt=(h+(n=n+Math.imul(c,it)|0)|0)+((8191&(r=(r=r+Math.imul(c,nt)|0)+Math.imul(f,it)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(r>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(C,H),r=(r=Math.imul(C,Y))+Math.imul(D,H)|0,o=Math.imul(D,Y),n=n+Math.imul(I,G)|0,r=(r=r+Math.imul(I,X)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,X)|0,n=n+Math.imul(w,j)|0,r=(r=r+Math.imul(w,K)|0)+Math.imul(M,j)|0,o=o+Math.imul(M,K)|0,n=n+Math.imul(x,q)|0,r=(r=r+Math.imul(x,Q)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,Q)|0,n=n+Math.imul(S,$)|0,r=(r=r+Math.imul(S,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(y,it)|0,r=(r=r+Math.imul(y,nt)|0)+Math.imul(d,it)|0,o=o+Math.imul(d,nt)|0;var kt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(r=(r=r+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(P,H),r=(r=Math.imul(P,Y))+Math.imul(B,H)|0,o=Math.imul(B,Y),n=n+Math.imul(C,G)|0,r=(r=r+Math.imul(C,X)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(I,j)|0,r=(r=r+Math.imul(I,K)|0)+Math.imul(F,j)|0,o=o+Math.imul(F,K)|0,n=n+Math.imul(w,q)|0,r=(r=r+Math.imul(w,Q)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,Q)|0,n=n+Math.imul(x,$)|0,r=(r=r+Math.imul(x,tt)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(S,it)|0,r=(r=r+Math.imul(S,nt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(y,ot)|0,r=(r=r+Math.imul(y,st)|0)+Math.imul(d,ot)|0,o=o+Math.imul(d,st)|0;var wt=(h+(n=n+Math.imul(c,lt)|0)|0)+((8191&(r=(r=r+Math.imul(c,ht)|0)+Math.imul(f,lt)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(O,H),r=(r=Math.imul(O,Y))+Math.imul(_,H)|0,o=Math.imul(_,Y),n=n+Math.imul(P,G)|0,r=(r=r+Math.imul(P,X)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,X)|0,n=n+Math.imul(C,j)|0,r=(r=r+Math.imul(C,K)|0)+Math.imul(D,j)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(I,q)|0,r=(r=r+Math.imul(I,Q)|0)+Math.imul(F,q)|0,o=o+Math.imul(F,Q)|0,n=n+Math.imul(w,$)|0,r=(r=r+Math.imul(w,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(x,it)|0,r=(r=r+Math.imul(x,nt)|0)+Math.imul(b,it)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(S,ot)|0,r=(r=r+Math.imul(S,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(y,lt)|0,r=(r=r+Math.imul(y,ht)|0)+Math.imul(d,lt)|0,o=o+Math.imul(d,ht)|0;var Mt=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(r=(r=r+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(r>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(z,H),r=(r=Math.imul(z,Y))+Math.imul(N,H)|0,o=Math.imul(N,Y),n=n+Math.imul(O,G)|0,r=(r=r+Math.imul(O,X)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(P,j)|0,r=(r=r+Math.imul(P,K)|0)+Math.imul(B,j)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(C,q)|0,r=(r=r+Math.imul(C,Q)|0)+Math.imul(D,q)|0,o=o+Math.imul(D,Q)|0,n=n+Math.imul(I,$)|0,r=(r=r+Math.imul(I,tt)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,tt)|0,n=n+Math.imul(w,it)|0,r=(r=r+Math.imul(w,nt)|0)+Math.imul(M,it)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(x,ot)|0,r=(r=r+Math.imul(x,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(S,lt)|0,r=(r=r+Math.imul(S,ht)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,ht)|0,n=n+Math.imul(y,ct)|0,r=(r=r+Math.imul(y,ft)|0)+Math.imul(d,ct)|0,o=o+Math.imul(d,ft)|0;var At=(h+(n=n+Math.imul(c,yt)|0)|0)+((8191&(r=(r=r+Math.imul(c,dt)|0)+Math.imul(f,yt)|0))<<13)|0;h=((o=o+Math.imul(f,dt)|0)+(r>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(z,G),r=(r=Math.imul(z,X))+Math.imul(N,G)|0,o=Math.imul(N,X),n=n+Math.imul(O,j)|0,r=(r=r+Math.imul(O,K)|0)+Math.imul(_,j)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(P,q)|0,r=(r=r+Math.imul(P,Q)|0)+Math.imul(B,q)|0,o=o+Math.imul(B,Q)|0,n=n+Math.imul(C,$)|0,r=(r=r+Math.imul(C,tt)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(I,it)|0,r=(r=r+Math.imul(I,nt)|0)+Math.imul(F,it)|0,o=o+Math.imul(F,nt)|0,n=n+Math.imul(w,ot)|0,r=(r=r+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(x,lt)|0,r=(r=r+Math.imul(x,ht)|0)+Math.imul(b,lt)|0,o=o+Math.imul(b,ht)|0,n=n+Math.imul(S,ct)|0,r=(r=r+Math.imul(S,ft)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,ft)|0;var It=(h+(n=n+Math.imul(y,yt)|0)|0)+((8191&(r=(r=r+Math.imul(y,dt)|0)+Math.imul(d,yt)|0))<<13)|0;h=((o=o+Math.imul(d,dt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(z,j),r=(r=Math.imul(z,K))+Math.imul(N,j)|0,o=Math.imul(N,K),n=n+Math.imul(O,q)|0,r=(r=r+Math.imul(O,Q)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(P,$)|0,r=(r=r+Math.imul(P,tt)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(C,it)|0,r=(r=r+Math.imul(C,nt)|0)+Math.imul(D,it)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(I,ot)|0,r=(r=r+Math.imul(I,st)|0)+Math.imul(F,ot)|0,o=o+Math.imul(F,st)|0,n=n+Math.imul(w,lt)|0,r=(r=r+Math.imul(w,ht)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(x,ct)|0,r=(r=r+Math.imul(x,ft)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,ft)|0;var Ft=(h+(n=n+Math.imul(S,yt)|0)|0)+((8191&(r=(r=r+Math.imul(S,dt)|0)+Math.imul(v,yt)|0))<<13)|0;h=((o=o+Math.imul(v,dt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,n=Math.imul(z,q),r=(r=Math.imul(z,Q))+Math.imul(N,q)|0,o=Math.imul(N,Q),n=n+Math.imul(O,$)|0,r=(r=r+Math.imul(O,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(P,it)|0,r=(r=r+Math.imul(P,nt)|0)+Math.imul(B,it)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(C,ot)|0,r=(r=r+Math.imul(C,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(I,lt)|0,r=(r=r+Math.imul(I,ht)|0)+Math.imul(F,lt)|0,o=o+Math.imul(F,ht)|0,n=n+Math.imul(w,ct)|0,r=(r=r+Math.imul(w,ft)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,ft)|0;var Tt=(h+(n=n+Math.imul(x,yt)|0)|0)+((8191&(r=(r=r+Math.imul(x,dt)|0)+Math.imul(b,yt)|0))<<13)|0;h=((o=o+Math.imul(b,dt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(z,$),r=(r=Math.imul(z,tt))+Math.imul(N,$)|0,o=Math.imul(N,tt),n=n+Math.imul(O,it)|0,r=(r=r+Math.imul(O,nt)|0)+Math.imul(_,it)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(P,ot)|0,r=(r=r+Math.imul(P,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(C,lt)|0,r=(r=r+Math.imul(C,ht)|0)+Math.imul(D,lt)|0,o=o+Math.imul(D,ht)|0,n=n+Math.imul(I,ct)|0,r=(r=r+Math.imul(I,ft)|0)+Math.imul(F,ct)|0,o=o+Math.imul(F,ft)|0;var Ct=(h+(n=n+Math.imul(w,yt)|0)|0)+((8191&(r=(r=r+Math.imul(w,dt)|0)+Math.imul(M,yt)|0))<<13)|0;h=((o=o+Math.imul(M,dt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(z,it),r=(r=Math.imul(z,nt))+Math.imul(N,it)|0,o=Math.imul(N,nt),n=n+Math.imul(O,ot)|0,r=(r=r+Math.imul(O,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(P,lt)|0,r=(r=r+Math.imul(P,ht)|0)+Math.imul(B,lt)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(C,ct)|0,r=(r=r+Math.imul(C,ft)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,ft)|0;var Dt=(h+(n=n+Math.imul(I,yt)|0)|0)+((8191&(r=(r=r+Math.imul(I,dt)|0)+Math.imul(F,yt)|0))<<13)|0;h=((o=o+Math.imul(F,dt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(z,ot),r=(r=Math.imul(z,st))+Math.imul(N,ot)|0,o=Math.imul(N,st),n=n+Math.imul(O,lt)|0,r=(r=r+Math.imul(O,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(P,ct)|0,r=(r=r+Math.imul(P,ft)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,ft)|0;var Lt=(h+(n=n+Math.imul(C,yt)|0)|0)+((8191&(r=(r=r+Math.imul(C,dt)|0)+Math.imul(D,yt)|0))<<13)|0;h=((o=o+Math.imul(D,dt)|0)+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(z,lt),r=(r=Math.imul(z,ht))+Math.imul(N,lt)|0,o=Math.imul(N,ht),n=n+Math.imul(O,ct)|0,r=(r=r+Math.imul(O,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var Pt=(h+(n=n+Math.imul(P,yt)|0)|0)+((8191&(r=(r=r+Math.imul(P,dt)|0)+Math.imul(B,yt)|0))<<13)|0;h=((o=o+Math.imul(B,dt)|0)+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(z,ct),r=(r=Math.imul(z,ft))+Math.imul(N,ct)|0,o=Math.imul(N,ft);var Bt=(h+(n=n+Math.imul(O,yt)|0)|0)+((8191&(r=(r=r+Math.imul(O,dt)|0)+Math.imul(_,yt)|0))<<13)|0;h=((o=o+Math.imul(_,dt)|0)+(r>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Et=(h+(n=Math.imul(z,yt))|0)+((8191&(r=(r=Math.imul(z,dt))+Math.imul(N,yt)|0))<<13)|0;return h=((o=Math.imul(N,dt))+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,l[0]=gt,l[1]=St,l[2]=vt,l[3]=mt,l[4]=xt,l[5]=bt,l[6]=kt,l[7]=wt,l[8]=Mt,l[9]=At,l[10]=It,l[11]=Ft,l[12]=Tt,l[13]=Ct,l[14]=Dt,l[15]=Lt,l[16]=Pt,l[17]=Bt,l[18]=Et,0!==h&&(l[19]=h,i.length++),i};function d(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var n=0,r=0,o=0;o>>26)|0)>>>26,s&=67108863}i.words[o]=a,n=s,s=r}return 0!==n?i.words[o]=n:i.length--,i.oR()}function g(t,e,i){return d(t,e,i)}Math.imul||(y=p),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):i<63?p(this,t,e):i<1024?d(this,t,e):g(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),g(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 n=0,r=0;r>=26,n+=o/67108864|0,n+=s>>>26,this.words[r]=67108863&s}return 0!==n&&(this.words[r]=n,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,n=0;n=0);var e,n=t%26,r=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e>>26-n}s&&(this.words[e]=s,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 o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==u||h>=r);h--){var c=0|this.words[h];this.words[h]=u<<26-o|c>>>o,u=c&a}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.oR()},r.prototype.ishrn=function(t,e,n){return i(0===this.negative),this.iushrn(t,e,n)},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,n=(t-e)/26,r=1<=0);var e=t%26,n=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,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)-(l/67108864|0),this.words[r+n]=67108863&o}for(;r>26,this.words[r+n]=67108863&o;if(0===a)return this.oR();for(i(-1===a),a=0,r=0;r>26,this.words[r]=67108863&o;return this.negative=1,this.oR()},r.prototype.SR=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!=(i=26-this.dR(s))&&(o=o.ushln(i),n.iushln(i),s=0|o.words[o.length-1]);var a,l=n.length-o.length;if("mod"!==e){(a=new r(null)).length=l+1,a.words=new Array(a.length);for(var h=0;h=0;c--){var f=67108864*(0|n.words[o.length+c])+(0|n.words[o.length+c-1]);for(f=Math.min(f/s|0,67108863),n.yR(o,f,c);0!==n.negative;)f--,n.negative=0,n.yR(o,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=f)}return a&&a.oR(),n.oR(),"div"!==e&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},r.prototype.divmod=function(t,e,n){return i(!t.isZero()),this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):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.SR(t,e);var o,s,a},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,n=t.ushrn(1),r=t.andln(1),o=i.cmp(n);return o<0||1===r&&0===o?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 n=(1<<26)%t,r=0,o=this.length-1;o>=0;o--)r=(n*r+(0|this.words[o]))%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 n=0,r=this.length-1;r>=0;r--){var o=(0|this.words[r])+67108864*n;this.words[r]=o/t|0,n=o%t}return this.oR(),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,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new r(1),s=new r(0),a=new r(0),l=new r(1),h=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++h;for(var u=n.clone(),c=e.clone();!e.isZero();){for(var f=0,p=1;0==(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(u),s.isub(c)),o.iushrn(1),s.iushrn(1);for(var y=0,d=1;0==(n.words[0]&d)&&y<26;++y,d<<=1);if(y>0)for(n.iushrn(y);y-- >0;)(a.isOdd()||l.isOdd())&&(a.iadd(u),l.isub(c)),a.iushrn(1),l.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a),s.isub(l)):(n.isub(e),a.isub(o),l.isub(s))}return{a,b:l,gcd:n.iushln(h)}},r.prototype.mR=function(t){i(0===t.negative),i(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new r(1),a=new r(0),l=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);for(var c=0,f=1;0==(n.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(n.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},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 n=0;e.isEven()&&i.isEven();n++)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 o=e;e=i,i=o}else if(0===r||0===i.cmpn(1))break;e.isub(i)}return i.iushln(n)},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,n=(t-e)/26,r=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.oR(),this.length>1)e=1;else{n&&(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 n=0|this.words[i],r=0|t.words[i];if(n!==r){nr&&(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 w(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).pR(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.pR=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.pR(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.gR(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.gR(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.bR(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.bR(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.bR(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.bR(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.bR(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.bR(this),this.red.pow(this,t)};var S={k256:null,p224:null,p192:null,p25519:null};function v(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.xR()}function m(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r.wR(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 M(t){w.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.mR(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)}v.prototype.xR=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.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 n=e0?i.isub(this.p):void 0!==i.strip?i.strip():i.oR(),i},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(m,v),m.prototype.split=function(t,e){for(var i=4194303,n=Math.min(t.length,9),r=0;r>>22,o=s}o>>>=22,t.words[r-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},m.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=n}return 0!==e&&(t.words[t.length++]=e),t},r.wR=function(t){if(S[t])return S[t];var e;if("k256"===t)e=new m;else if("p224"===t)e=new x;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new k}return S[t]=e,e},w.prototype.bR=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},w.prototype.gR=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")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t).pR(this):(l(t,t.umod(this.m).pR(this)),t)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).pR(this)},w.prototype.add=function(t,e){this.gR(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.pR(this)},w.prototype.iadd=function(t,e){this.gR(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this.gR(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.pR(this)},w.prototype.isub=function(t,e){this.gR(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this.bR(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this.gR(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this.gR(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var n=this.m.add(new r(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);i(!o.isZero());var a=new r(1).toRed(this),l=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new r(2*u*u).toRed(this);0!==this.pow(u,h).cmp(l);)u.redIAdd(l);for(var c=this.pow(u,o),f=this.pow(t,o.addn(1).iushrn(1)),p=this.pow(t,o),y=s;0!==p.cmp(a);){for(var d=p,g=0;0!==d.cmp(a);g++)d=d.redSqr();i(g=0;n--){for(var h=e.words[n],u=l-1;u>=0;u--){var c=h>>u&1;o!==i[0]&&(o=this.sqr(o)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===n&&0===u)&&(o=this.mul(o,i[s]),a=0,s=0)):a=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new M(t)},n(M,w),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o.pR(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).pR(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s.pR(this)},M.prototype.invm=function(t){return this.imod(t.mR(this.m).mul(this.r2)).pR(this)}}(PG,LG);var BG=PG.exports;function EG(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var i=[];if("string"!=typeof t){for(var n=0;n>8,s=255&r;o?i.push(o,s):i.push(s)}return i}var OG,_G,VG=function(t,e,i){var n=new Array(Math.max(t.bitLength(),i)+1);n.fill(0);for(var r=1<(r>>1)-1?(r>>1)-l:l,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},zG=function(t,e){var i=[[],[]];t=t.clone(),e=e.clone();for(var n=0,r=0;t.cmpn(-n)>0||e.cmpn(-r)>0;){var o=t.andln(3)+n&3,s=e.andln(3)+r&3;3===o&&(o=-1),3===s&&(s=-1);var a;a=0==(1&o)?0:3!=(l=t.andln(7)+n&7)&&5!==l||2!==s?o:-o,i[0].push(a);var l,h;h=0==(1&s)?0:3!=(l=e.andln(7)+r&7)&&5!==l||2!==o?s:-s,i[1].push(h),2*n===a+1&&(n=1-n),2*r===h+1&&(r=1-r),t.iushrn(1),e.iushrn(1)}return i},NG=function(){function t(t,e){this.type=t,this.p=new BG(e.p,16),this.red=e.prime?BG.red(e.prime):BG.mont(this.p),this.zero=new BG(0).toRed(this.red),this.one=new BG(1).toRed(this.red),this.two=new BG(2).toRed(this.red),this.n=e.n&&new BG(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.kR=new Array(4),this.MR=new Array(4),this.AR=new Array(4),this.FR=new Array(4),this.TR=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.CR=!0,this.redN=this.n.toRed(this.red))}return t.prototype.BR=function(t,e){var i=t.LR(),n=VG(e,1,this.TR),r=(1<=s;l--)a=(a<<1)+n[l];o.push(a)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),c=r;c>0;c--){for(s=0;s=0;a--){for(;a>=0&&0===o[a];a--);if(a>=0&&e++,s=s.dblp(e),a<0)break;var l=o[a];s="affine"===t.type?l>0?s.mixedAdd(r[l-1>>1]):s.mixedAdd(r[-l-1>>1].neg()):l>0?s.add(r[l-1>>1]):s.add(r[-l-1>>1].neg())}return"affine"===t.type?s.toP():s},t.prototype.OR=function(t,e,i,n,r){for(var o=this.kR,s=this.MR,a=this.AR,l=0,h=0;h=1;h-=2){var c=h-1,f=h;if(1===o[c]&&1===o[f]){var p=[e[c],null,null,e[f]];0===e[c].y.cmp(e[f].y)?(p[1]=e[c].add(e[f]),p[2]=e[c].toJ().mixedAdd(e[f].neg())):0===e[c].y.cmp(e[f].y.redNeg())?(p[1]=e[c].toJ().mixedAdd(e[f]),p[2]=e[c].add(e[f].neg())):(p[1]=e[c].toJ().mixedAdd(e[f]),p[2]=e[c].toJ().mixedAdd(e[f].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],d=zG(i[c],i[f]);l=Math.max(d[0].length,l),a[c]=new Array(l),a[f]=new Array(l);for(var g=0;g=0;h--){for(var b=0;h>=0;){var k=!0;for(g=0;g=0&&b++,m=m.dblp(b),h<0)break;for(g=0;g0?M=s[g][w-1>>1]:w<0&&(M=s[g][-w-1>>1].neg()),m="affine"===M.type?m.mixedAdd(M):m.add(M))}}for(h=0;h=Math.ceil((t.bitLength()+1)/e.step)},t.prototype.LR=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,r=0;r=0&&(o=e,s=i),n.negative&&(n=n.neg(),r=r.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:n,b:r},{a:o,b:s}]},e.prototype.HR=function(t){var e=this.endo.basis,i=e[0],n=e[1],r=n.b.mul(t).divRound(this.n),o=i.b.neg().mul(t).divRound(this.n),s=r.mul(i.a),a=o.mul(n.a),l=r.mul(i.b),h=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:l.add(h).neg()}},e.prototype.point=function(t,e,i){return new YG(this,t,e,i)},e.prototype.pointFromX=function(t,e){(t=new BG(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(0!==n.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var r=n.fromRed().isOdd();return(e&&!r||!e&&r)&&(n=n.redNeg()),this.point(t,n)},e.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,i=t.y,n=this.a.redMul(e),r=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===i.redSqr().redISub(r).cmpn(0)},e.prototype.WR=function(t,e,i){var n=this.NR,r=this.ER,o=0;for(o=0;o":""},e.prototype.isInfinity=function(){return this.inf},e.prototype.add=function(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);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var i=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)},e.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,i=this.x.redSqr(),n=t.redInvm(),r=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(n),o=r.redSqr().redISub(this.x.redAdd(this.x)),s=r.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},e.prototype.getX=function(){return this.x.fromRed()},e.prototype.getY=function(){return this.y.fromRed()},e.prototype.mul=function(t){return t=new BG(t,16),this.isInfinity()?this:this.RR(t)?this.curve.BR(this,t):this.curve.endo?this.curve.WR([this],[t]):this.curve.IR(this,t)},e.prototype.mulAdd=function(t,e,i){var n=[this,e],r=[t,i];return this.curve.endo?this.curve.WR(n,r):this.curve.OR(1,n,r,2)},e.prototype.jmulAdd=function(t,e,i){var n=[this,e],r=[t,i];return this.curve.endo?this.curve.WR(n,r,!0):this.curve.OR(1,n,r,2,!0)},e.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},e.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var i=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return e},e.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},e}(RG),UG=function(t){function e(e,i,n,r){var o=t.call(this,e,"jacobian")||this;return null===i&&null===n&&null===r?(o.x=o.curve.one,o.y=o.curve.one,o.z=new BG(0)):(o.x=new BG(i,16),o.y=new BG(n,16),o.z=new BG(r,16)),o.x.red||(o.x=o.x.toRed(o.curve.red)),o.y.red||(o.y=o.y.toRed(o.curve.red)),o.z.red||(o.z=o.z.toRed(o.curve.red)),o.zOne=o.z===o.curve.one,o}return h(e,t),e.prototype.getY=function(){throw new Error("Method not implemented.")},e.prototype.getX=function(){throw new Error("Method not implemented.")},e.prototype.pointFromX=function(t,e){throw new Error("Method not implemented.")},e.prototype.point=function(t,e,i){throw new Error("Method not implemented.")},e.prototype.jpoint=function(t,i,n){return new e(this,t,i,n)},e.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),i=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(i,n)},e.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},e.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(e),r=t.x.redMul(i),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(i.redMul(this.z)),a=n.redSub(r),l=o.redSub(s);if(0===a.cmpn(0))return 0!==l.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),u=h.redMul(a),c=n.redMul(h),f=l.redSqr().redIAdd(u).redISub(c).redISub(c),p=l.redMul(c.redISub(f)).redISub(o.redMul(u)),y=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(f,p,y)},e.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),i=this.x,n=t.x.redMul(e),r=this.y,o=t.y.redMul(e).redMul(this.z),s=i.redSub(n),a=r.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),h=l.redMul(s),u=i.redMul(l),c=a.redSqr().redIAdd(h).redISub(u).redISub(u),f=a.redMul(u.redISub(c)).redISub(r.redMul(h)),p=this.z.redMul(s);return this.curve.jpoint(c,f,p)},e.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,i=0;i=0)return!1;if(i.redIAdd(r),0===this.x.cmp(i))return!0}},e.prototype.inspect=function(){return this.isInfinity()?"":""},e.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},e}(RG),GG=function(t){this.curve=new HG(t),this.g=this.curve.g,this.n=this.curve.n},XG={};XG.PresetCurve=GG,OG="secp256k1",_G={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(XG,OG,{configurable:!0,enumerable:!0,get:function(){var t=new GG(_G);return Object.defineProperty(XG,OG,{configurable:!0,enumerable:!0,value:t}),t}});var WG=function(){function t(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.XR(e.pub,e.pubEnc)}return t.fromPublic=function(e,i,n){return i instanceof t?i:new t(e,{pub:i,pubEnc:n})},t.prototype.validate=function(){var 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"}},t.prototype.getPublic=function(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},t.prototype.XR=function(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)},t.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},t}();function jG(t,e){var i=t[e.place++];if(!(128&i))return i;var n=15&i;if(0===n||n>4)return!1;for(var r=0,o=e.place,s=0;s>>=0;return!(r<=127)&&(e.place=o,r)}var KG,ZG=function(){this.place=0},qG=function(){function t(e,i){if(e instanceof t)return e;this.ZR(e,i)||(this.r=new BG(e.r,16),this.s=new BG(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}return t.prototype.ZR=function(t,e){t=EG(t,e);var i=new ZG;if(48!==t[i.place++])return!1;var n=jG(t,i);if(!1===n)return!1;if(n+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;var r=jG(t,i);if(!1===r)return!1;var o=t.slice(i.place,r+i.place);if(i.place+=r,2!==t[i.place++])return!1;var s=jG(t,i);if(!1===s)return!1;if(t.length!==s+i.place)return!1;var a=t.slice(i.place,s+i.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new BG(o),this.s=new BG(a),this.recoveryParam=null,!0},t}(),QG=function(){function t(e){if(!(this instanceof t))return new t(e);"string"==typeof e&&(e=XG[e]),e instanceof XG.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1)}return t.prototype.keyFromPublic=function(t,e){return WG.fromPublic(this,t,e)},t.prototype.KR=function(t,e){var 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},t.prototype.verify=function(t,e,i,n){t=this.KR(new BG(t,16)),i=this.keyFromPublic(i,n);var r=(e=new qG(e,"hex")).r,o=e.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s=o.invm(this.n),a=s.mul(t).umod(this.n),l=s.mul(r).umod(this.n);if(!this.curve.CR){var h=this.g.mulAdd(a,i.getPublic(),l);return!h.isInfinity()&&0===h.getX().umod(this.n).cmp(r)}var u=this.g.jmulAdd(a,i.getPublic(),l);return!u.isInfinity()&&u.eqXToP(r)},t}(),JG={exports:{}};JG.exports=KG=KG||function(t,e){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==LG&&LG.crypto&&(i=LG.crypto),!i)try{i=e}catch(t){}var n=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}}(),o={},s=o.lib={},a=s.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)}},l=s.WordArray=a.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,n=this.sigBytes,r=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=s<<24-(n+o)%4*8}else for(o=0;o>>2]=i[o>>>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=a.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;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new l.init(i,e/2)}},c=h.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,n=[],r=0;r>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new l.init(i,e)}},f=h.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)))}},p=s.BufferedBlockAlgorithm=a.extend({reset:function(){this.YM=new l.init,this.qR=0},JR:function(t){"string"==typeof t&&(t=f.parse(t)),this.YM.concat(t),this.qR+=t.sigBytes},QR:function(e){var i,n=this.YM,r=n.words,o=n.sigBytes,s=this.blockSize,a=o/(4*s),h=(a=e?t.ceil(a):t.max((0|a)-this.$R,0))*s,u=t.min(4*h,o);if(h){for(var c=0;c>>7)^(y<<14|y>>>18)^y>>>3,g=h[p-2],S=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;h[p]=d+h[p-7]+S+h[p-16]}var v=n&r^n&o^r&o,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),x=f+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&c)+l[p]+h[p];f=c,c=u,u=a,a=s+x|0,s=o,o=r,r=n,n=x+(m+v)|0}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+o|0,i[3]=i[3]+s|0,i[4]=i[4]+a|0,i[5]=i[5]+u|0,i[6]=i[6]+c|0,i[7]=i[7]+f|0},nz:function(){var t=this.YM,i=t.words,n=8*this.qR,r=8*t.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=e.floor(n/4294967296),i[15+(r+64>>>9<<4)]=n,t.sigBytes=4*i.length,this.QR(),this.sz},clone:function(){var t=o.clone.call(this);return t.sz=this.sz.clone(),t}});i.SHA256=o.ez(u),i.HmacSHA256=o.rz(u)}(Math),t.SHA256}(JG.exports),tX={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,n=e.algo,r=n.SHA256,o=n.SHA224=r.extend({iz:function(){this.sz=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},nz:function(){var t=r.nz.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.ez(o),e.HmacSHA224=r.rz(o),t.SHA224;var e,i,n,r,o}(JG.exports),eX={exports:{}}.exports=function(t){return t.enc.Hex}(JG.exports),iX={exports:{}}.exports=function(t){return t.enc.Utf8}(JG.exports);!function(t){(function(){var e=t,i=e.lib.WordArray;function n(t,e,n){for(var r=[],o=0,s=0;s>>6-s%4*2;r[o>>>2]|=a<<24-o%4*8,o++}return i.create(r,o)}e.enc.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,n=this.oz;t.clamp();for(var r=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var l=n.charAt(64);if(l)for(;r.length%4;)r.push(l);return r.join("")},parse:function(t){var e=t.length,i=this.oz,r=this.hz;if(!r){r=this.hz=[];for(var o=0;o>>24)|4278255360&(r<<24|r>>>8)}var o=this.sz.words,s=t[e+0],l=t[e+1],p=t[e+2],y=t[e+3],d=t[e+4],g=t[e+5],S=t[e+6],v=t[e+7],m=t[e+8],x=t[e+9],b=t[e+10],k=t[e+11],w=t[e+12],M=t[e+13],A=t[e+14],I=t[e+15],F=o[0],T=o[1],C=o[2],D=o[3];F=h(F,T,C,D,s,7,a[0]),D=h(D,F,T,C,l,12,a[1]),C=h(C,D,F,T,p,17,a[2]),T=h(T,C,D,F,y,22,a[3]),F=h(F,T,C,D,d,7,a[4]),D=h(D,F,T,C,g,12,a[5]),C=h(C,D,F,T,S,17,a[6]),T=h(T,C,D,F,v,22,a[7]),F=h(F,T,C,D,m,7,a[8]),D=h(D,F,T,C,x,12,a[9]),C=h(C,D,F,T,b,17,a[10]),T=h(T,C,D,F,k,22,a[11]),F=h(F,T,C,D,w,7,a[12]),D=h(D,F,T,C,M,12,a[13]),C=h(C,D,F,T,A,17,a[14]),F=u(F,T=h(T,C,D,F,I,22,a[15]),C,D,l,5,a[16]),D=u(D,F,T,C,S,9,a[17]),C=u(C,D,F,T,k,14,a[18]),T=u(T,C,D,F,s,20,a[19]),F=u(F,T,C,D,g,5,a[20]),D=u(D,F,T,C,b,9,a[21]),C=u(C,D,F,T,I,14,a[22]),T=u(T,C,D,F,d,20,a[23]),F=u(F,T,C,D,x,5,a[24]),D=u(D,F,T,C,A,9,a[25]),C=u(C,D,F,T,y,14,a[26]),T=u(T,C,D,F,m,20,a[27]),F=u(F,T,C,D,M,5,a[28]),D=u(D,F,T,C,p,9,a[29]),C=u(C,D,F,T,v,14,a[30]),F=c(F,T=u(T,C,D,F,w,20,a[31]),C,D,g,4,a[32]),D=c(D,F,T,C,m,11,a[33]),C=c(C,D,F,T,k,16,a[34]),T=c(T,C,D,F,A,23,a[35]),F=c(F,T,C,D,l,4,a[36]),D=c(D,F,T,C,d,11,a[37]),C=c(C,D,F,T,v,16,a[38]),T=c(T,C,D,F,b,23,a[39]),F=c(F,T,C,D,M,4,a[40]),D=c(D,F,T,C,s,11,a[41]),C=c(C,D,F,T,y,16,a[42]),T=c(T,C,D,F,S,23,a[43]),F=c(F,T,C,D,x,4,a[44]),D=c(D,F,T,C,w,11,a[45]),C=c(C,D,F,T,I,16,a[46]),F=f(F,T=c(T,C,D,F,p,23,a[47]),C,D,s,6,a[48]),D=f(D,F,T,C,v,10,a[49]),C=f(C,D,F,T,A,15,a[50]),T=f(T,C,D,F,g,21,a[51]),F=f(F,T,C,D,w,6,a[52]),D=f(D,F,T,C,y,10,a[53]),C=f(C,D,F,T,b,15,a[54]),T=f(T,C,D,F,l,21,a[55]),F=f(F,T,C,D,m,6,a[56]),D=f(D,F,T,C,I,10,a[57]),C=f(C,D,F,T,S,15,a[58]),T=f(T,C,D,F,M,21,a[59]),F=f(F,T,C,D,d,6,a[60]),D=f(D,F,T,C,k,10,a[61]),C=f(C,D,F,T,p,15,a[62]),T=f(T,C,D,F,x,21,a[63]),o[0]=o[0]+F|0,o[1]=o[1]+T|0,o[2]=o[2]+C|0,o[3]=o[3]+D|0},nz:function(){var t=this.YM,i=t.words,n=8*this.qR,r=8*t.sigBytes;i[r>>>5]|=128<<24-r%32;var o=e.floor(n/4294967296),s=n;i[15+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),i[14+(r+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(i.length+1),this.QR();for(var a=this.sz,l=a.words,h=0;h<4;h++){var u=l[h];l[h]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var t=o.clone.call(this);return t.sz=this.sz.clone(),t}});function h(t,e,i,n,r,o,s){var a=t+(e&i|~e&n)+r+s;return(a<>>32-o)+e}function u(t,e,i,n,r,o,s){var a=t+(e&n|i&~n)+r+s;return(a<>>32-o)+e}function c(t,e,i,n,r,o,s){var a=t+(e^i^n)+r+s;return(a<>>32-o)+e}function f(t,e,i,n,r,o,s){var a=t+(i^(e|~n))+r+s;return(a<>>32-o)+e}i.MD5=o.ez(l),i.HmacMD5=o.rz(l)})(Math),t.MD5}(JG.exports),function(t){return i=(e=t).lib,n=i.WordArray,r=i.Hasher,o=e.algo,s=[],a=o.SHA1=r.extend({iz:function(){this.sz=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},tz:function(t,e){for(var i=this.sz.words,n=i[0],r=i[1],o=i[2],a=i[3],l=i[4],h=0;h<80;h++){if(h<16)s[h]=0|t[e+h];else{var u=s[h-3]^s[h-8]^s[h-14]^s[h-16];s[h]=u<<1|u>>>31}var c=(n<<5|n>>>27)+l+s[h];c+=h<20?1518500249+(r&o|~r&a):h<40?1859775393+(r^o^a):h<60?(r&o|r&a|o&a)-1894007588:(r^o^a)-899497514,l=a,a=o,o=r<<30|r>>>2,r=n,n=c}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+o|0,i[3]=i[3]+a|0,i[4]=i[4]+l|0},nz:function(){var t=this.YM,e=t.words,i=8*this.qR,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(n+64>>>9<<4)]=i,t.sigBytes=4*e.length,this.QR(),this.sz},clone:function(){var t=r.clone.call(this);return t.sz=this.sz.clone(),t}}),e.SHA1=r.ez(a),e.HmacSHA1=r.rz(a),t.SHA1;var e,i,n,r,o,s,a}(JG.exports),function(t){var e,i,n;i=(e=t).lib.Base,n=e.enc.Utf8,e.algo.HMAC=i.extend({init:function(t,e){t=this.az=new t.init,"string"==typeof e&&(e=n.parse(e));var i=t.blockSize,r=4*i;e.sigBytes>r&&(e=t.finalize(e)),e.clamp();for(var o=this.uz=e.clone(),s=this.cz=e.clone(),a=o.words,l=s.words,h=0;h>>2];t.sigBytes-=e}};n.BlockCipher=u.extend({cfg:u.cfg.extend({mode:p,padding:y}),reset:function(){var t;u.reset.call(this);var e=this.cfg,i=e.iv,n=e.mode;this.dz==this.fz?t=n.createEncryptor:(t=n.createDecryptor,this.$R=1),this.pz&&this.pz.gz==t?this.pz.init(this,i&&i.words):(this.pz=t.call(n,this,i&&i.words),this.pz.gz=t)},tz:function(t,e){this.pz.processBlock(t,e)},nz:function(){var t,e=this.cfg.padding;return this.dz==this.fz?(e.pad(this.YM,this.blockSize),t=this.QR(!0)):(t=this.QR(!0),e.unpad(t)),t},blockSize:4});var d=n.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),g=(i.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return(i?o.create([1398893684,1701076831]).concat(i).concat(e):e).toString(l)},parse:function(t){var e,i=l.parse(t),n=i.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=o.create(n.slice(2,4)),n.splice(0,4),i.sigBytes-=16),d.create({ciphertext:i,salt:e})}},S=n.SerializableCipher=r.extend({cfg:r.extend({format:g}),encrypt:function(t,e,i,n){n=this.cfg.extend(n);var r=t.createEncryptor(i,n),o=r.finalize(e),s=r.cfg;return d.create({ciphertext:o,key:i,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,i,n){return n=this.cfg.extend(n),e=this.bz(e,n.format),t.createDecryptor(i,n).finalize(e.ciphertext)},bz:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),v=(i.kdf={}).OpenSSL={execute:function(t,e,i,n){n||(n=o.random(8));var r=h.create({keySize:e+i}).compute(t,n),s=o.create(r.words.slice(e),4*i);return r.sigBytes=4*e,d.create({key:r,iv:s,salt:n})}},m=n.PasswordBasedCipher=S.extend({cfg:S.cfg.extend({kdf:v}),encrypt:function(t,e,i,n){var r=(n=this.cfg.extend(n)).kdf.execute(i,t.keySize,t.ivSize);n.iv=r.iv;var o=S.encrypt.call(this,t,e,r.key,n);return o.mixIn(r),o},decrypt:function(t,e,i,n){n=this.cfg.extend(n),e=this.bz(e,n.format);var r=n.kdf.execute(i,t.keySize,t.ivSize,e.salt);return n.iv=r.iv,S.decrypt.call(this,t,e,r.key,n)}})}()}(JG.exports);var nX,rX,oX={exports:{}}.exports=function(t){return function(){var e=t,i=e.lib.BlockCipher,n=e.algo,r=[],o=[],s=[],a=[],l=[],h=[],u=[],c=[],f=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,n=0;for(e=0;e<256;e++){var y=n^n<<1^n<<2^n<<3^n<<4;y=y>>>8^255&y^99,r[i]=y,o[y]=i;var d=t[i],g=t[d],S=t[g],v=257*t[y]^16843008*y;s[i]=v<<24|v>>>8,a[i]=v<<16|v>>>16,l[i]=v<<8|v>>>24,h[i]=v,v=16843009*S^65537*g^257*d^16843008*i,u[y]=v<<24|v>>>8,c[y]=v<<16|v>>>16,f[y]=v<<8|v>>>24,p[y]=v,i?(i=d^t[t[t[S^d]]],n^=t[t[n]]):i=n=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],d=n.AES=i.extend({iz:function(){if(!this.xz||this.wz!==this.vz){for(var t=this.wz=this.vz,e=t.words,i=t.sigBytes/4,n=4*((this.xz=i+6)+1),o=this.kz=[],s=0;s6&&s%i==4&&(h=r[h>>>24]<<24|r[h>>>16&255]<<16|r[h>>>8&255]<<8|r[255&h]):(h=r[(h=h<<8|h>>>24)>>>24]<<24|r[h>>>16&255]<<16|r[h>>>8&255]<<8|r[255&h],h^=y[s/i|0]<<24),o[s]=o[s-i]^h);for(var a=this.Mz=[],l=0;l>>24]]^c[r[h>>>16&255]]^f[r[h>>>8&255]]^p[r[255&h]]}}},encryptBlock:function(t,e){this.Az(t,e,this.kz,s,a,l,h,r)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this.Az(t,e,this.Mz,u,c,f,p,o),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},Az:function(t,e,i,n,r,o,s,a){for(var l=this.xz,h=t[e]^i[0],u=t[e+1]^i[1],c=t[e+2]^i[2],f=t[e+3]^i[3],p=4,y=1;y>>24]^r[u>>>16&255]^o[c>>>8&255]^s[255&f]^i[p++],g=n[u>>>24]^r[c>>>16&255]^o[f>>>8&255]^s[255&h]^i[p++],S=n[c>>>24]^r[f>>>16&255]^o[h>>>8&255]^s[255&u]^i[p++],v=n[f>>>24]^r[h>>>16&255]^o[u>>>8&255]^s[255&c]^i[p++];h=d,u=g,c=S,f=v}d=(a[h>>>24]<<24|a[u>>>16&255]<<16|a[c>>>8&255]<<8|a[255&f])^i[p++],g=(a[u>>>24]<<24|a[c>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^i[p++],S=(a[c>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&u])^i[p++],v=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[u>>>8&255]<<8|a[255&c])^i[p++],t[e]=d,t[e+1]=g,t[e+2]=S,t[e+3]=v},keySize:8});e.AES=i.ez(d)}(),t.AES}(JG.exports),sX={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.yz,n=i.blockSize,r=this.Sz,o=this.Fz;r&&(o=this.Fz=r.slice(0),this.Sz=void 0);var s=o.slice(0);i.encryptBlock(s,0),o[n-1]=o[n-1]+1|0;for(var a=0;a0;)e.Tr(n),n=e.Ss()-1;var r=e.xv(),o=e.Bt(),s=(t||"LICENSE_ERROR").toLowerCase().split("_").join(" ");s=(i?hX(0,0,1,2,1,23,1,24,25,1):"")+s.charAt(0).toUpperCase()+s.substr(1),r.tf(e.Y).pn(new G({color:B(0,0,0)})).fs(Q).wt(o).Eo(m(0,0)),r.pe(e.Y).Sn(s).Eo({x:o.x/2,y:o.y/2}).Io(20).pn(new G({color:B(255,0,0)})),e.Mr(),Object.freeze(e),Object.freeze(_B)},SX=function(t,e,i){e?(t[hX(-1,17)](hX(-1,19),i),t[hX(-1,17)](hX(-1,20),i),t[hX(-1,17)](hX(-1,21),i),t[hX(-1,17)](hX(-1,22),i)):(t[hX(-1,18)](hX(-1,19),i),t[hX(-1,18)](hX(-1,20),i),t[hX(-1,18)](hX(-1,21),i),t[hX(-1,18)](hX(-1,22),i))},vX=function(t){var i,n,r,o=function(){};if(new gt.Image instanceof gt.HTMLImageElement){(a=new gt.Image).src=EH,n=new _H({source:a,fitMode:e.ImageFitMode.Stretch});var s=new gt.Image;s.src=BH,r=new _H({source:s,fitMode:e.ImageFitMode.Stretch})}else if(gt.lcjs_setup){var a;(a=new gt.Image).src=EH;var l=gt.lcjs_setup(a.naturalWidth,a.naturalHeight);l.getContext("2d").drawImage(a,0,0),n=new _H({source:l,fitMode:e.ImageFitMode.Stretch}),r=n}else n=new G({color:E("#f00")}),r=n;var h=function(e){var o=e.Y.pi();if(e.Of&&(e.Tz&&(r?e.Of.pn(r):gt.requestAnimationFrame((function(){return h(e)}))),e.Tz||(n?e.Of.pn(n):gt.requestAnimationFrame((function(){return h(e)})))),e.Of){var s=(e.Tz,150),a=(e.Tz,31),l=e.Y.x.getInnerEnd()-(3+s)*o.x,u=e.Y.y.getInnerStart()+3*o.y;e.Of.Eo({x:l,y:u}).wt({x:s*o.x,y:a*o.y})}!1===e.Tz&&(2610!==EH.length&&gX(hX(0,36,1,38,5),t,!1),"M"!==EH[429]&&gX(hX(0,36,1,38,5),t,!1)),!0===e.Tz&&(3958!==BH.length&&gX(hX(0,36,1,38,5),t,!1),"2"!==BH[638]&&gX(hX(0,36,1,38,5),t,!1)),i&&i.Vi()};return i=t.xv(Number.MAX_SAFE_INTEGER),function(r){var s,a,l={Y:r,Tz:!1,Cz:function(){s=gt.setTimeout((function(){a=t.Sr(e.MouseStyles.Point),void 0!==l.Of&&(l.Of.setMouseClickEventHandler(mX),l.Of.setTouchEndEventHandler(mX)),l.Tz=!0,h(l)}),3e3)},Bz:function(){gt.clearTimeout(s),t.pr(a),void 0!==l.Of&&(l.Of.setMouseClickEventHandler(o),l.Of.setTouchEndEventHandler(o)),l.Tz=!1,h(l)}};return function(t){t.Of&&t.Of.dispose(),i&&(t.Of=i.tf(t.Y).pn(n).setMouseInteractions(!0).setMouseClickEventHandler(o).setTouchEndEventHandler(o).fs(Q),t.Cz&&t.Of.setMouseEnterEventHandler(t.Cz),t.Bz&&t.Of.setMouseLeaveEventHandler(t.Bz),h(t))}(l),{Un:function(){return h(l)},ks:function(){return function(t){t.Of&&(t.Of.dispose(),t.Of=void 0,t.Cz=function(){},t.Bz=function(){})}(l)}}}},mX=function(){return gt.open("https://www.arction.com/lightningchart-js/")},xX=function(t,e,i){return function(n){var r=t(i,n),o=e?vX(r):void 0,s=new LH(r.zr,n,r,r.ks.bind(r),o);return r.vs((function(){return s.zC()})).ds((function(){return s.Ot()})).Vi(),s}},bX=function(t,e){t.vs((function(){e.Xu()})).ds((function(){return e.Ot()})).Vi()},kX=function(t,e,i){return function(n){var r=t(i,n),o=e?vX(r):void 0,s=new ZO(r.zr,IH(r)(0),$,r.ks.bind(r),o);return bX(r,s),s}},wX=function(t,e,i){return function(n){var r=t(i,n),o=e?vX(r):void 0,s=new wH(r.zr,IH(r)(0),$,r.ks.bind(r),o,n);return bX(r,s),s}},MX=function(t,e,i){return function(n){var r=t(i,n),o=e?vX(r):void 0,s=new DN(r.zr,IH(r)(0),$,r.ks.bind(r),o,n);return bX(r,s),s}},AX=function(t,e,i){return function(n){var r=t(i,n),o=e?vX(r):void 0,s=new Ez(r.zr,IH(r)(0),$,r.ks.bind(r),o,n);return bX(r,s),s}},IX=function(t,e,i){return function(n){var r=t(i,n),o=e?vX(r):void 0,s=new(n&&n.type?n.type:b_)(r.zr,IH(r)(0),$,r.ks.bind(r),o,void 0,n&&n.theme?n.theme:FB,n&&n.disableAnimations);return bX(r,s),s}},FX=function(t,e,i){return function(n){var r=t(i,n),o=e?vX(r):void 0,s=new(n&&n.type?n.type:nN)(r.zr,IH(r)(0),$,r.ks.bind(r),o,void 0,n&&n.theme?n.theme:FB,n&&n.disableAnimations);return bX(r,s),s}},TX=function(t,e,i){return function(n){var r=t(i,n),o=e?vX(r):void 0,s=new(n&&n.type?n.type:Wz)(r.zr,IH(r)(0),$,r.ks.bind(r),o,void 0,n&&n.theme?n.theme:FB,n&&n.disableAnimations);return bX(r,s),s}},CX=function(t,e,i){return function(n){var r=t(i,n),o=e?vX(r):void 0,s=new(n&&n.type?n.type:fN)(r.zr,IH(r)(0),$,r.ks.bind(r),o,void 0,n&&n.theme?n.theme:FB,!(!n||!n.disableAnimations));return bX(r,s),s}},DX=function(t,e,i){return function(n){var r=t(i,n),o=e?vX(r):void 0,s=new zV(r.zr,IH(r)(0),$,r.ks.bind(r),o,n,void 0);return bX(r,s),s}},LX=function(t,e,i){return function(n){var r=t(i,n),o=e?vX(r):void 0,s=new sV(r.zr,IH(r)(0),$,r.ks.bind(r),o,void 0,n);return bX(r,s),s}},PX={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"}},BX={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"}},EX={"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"}},OX={"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"}},_X={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:"TODO"}},VX={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"}},zX={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"}},NX={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"}},RX={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"}},HX={World:VX,USA:zX,NorthAmerica:NX,SouthAmerica:RX,Canada:OX,Europe:_X,Asia:BX,Africa:PX,Australia:EX},YX={Solid:nN},UX={None:KE,Rectangle:eO,Circle:iO,Diamond:nO,Pointer:rO},GX={Rectangle:eO,Circle:iO,Diamond:nO},XX={XY:gz},WX={XY:dz,Spider:AV,Map:TV,Polar:AV},jX={None:ZE,UIRectangle:eO,UICircle:iO,UIDiamond:nO};e.AbstractAxisTick=ji,e.Animation=Yi,e.AnimationEasings=Hi,e.Animator=Ui,e.AreaRangeSeries=JR,e.AreaSeries=XR,e.AreaSeriesBipolar=ZR,e.AreaSeriesMonopolar=WR,e.AreaSeriesNegative=KR,e.AreaSeriesPositive=jR,e.AreaSeriesTypes=qR,e.AuroraBorealisTheme=_h,e.AutoCursor2DBuilder=bV,e.AutoCursorBuilders=WX,e.AutoCursorXYBuilder=fz,e.AutoFitStrategies=pV,e.AutoFitStrategy=uV,e.Axis=YO,e.Axis3D=T_,e.AxisScrollStrategies=Li,e.AxisTickStrategies=Pi,e.Band=zE,e.BasicSeries=Tz,e.BasicSeries3D=V_,e.BlueSciFiTheme=tf,e.BorderedPicture=QE,e.BoxAndWhiskers=YN,e.BoxFigure=HN,e.BoxSeries=YR,e.BoxSeries3D=z_,e.Button=kO,e.Chart=QO,e.Chart3D=sV,e.ChartComponent=_E,e.ChartMarker=mz,e.ChartMarker2D=xz,e.ChartMarkerXY=bz,e.ChartWithCursor=VV,e.ChartWithSeries=J_,e.ChartXY=wH,e.ClassicTheme=cf,e.Color=L,e.ColorCSS=function(t){try{if(t.startsWith("rgba")){var e=t.substr(5).slice(0,-1),i=JSON.parse("["+e+"]");return B(i[0],i[1],i[2],255*i[3])}if(t.startsWith("rgb"))return e=t.substr(4).slice(0,-1),i=JSON.parse("["+e+"]"),B(i[0],i[1],i[2]);if(t.startsWith("hsl")){var n=function(t,e,i){e/=100,i/=100;var n=(1-Math.abs(2*i-1))*e,r=t/60,o=n*(1-Math.abs(r%2-1)),s=[];isNaN(t)?s=[0,0,0]:r<=1?s=[n,o,0]:r<=2?s=[o,n,0]:r<=3?s=[0,n,o]:r<=4?s=[0,o,n]:r<=5?s=[o,0,n]:r<=6&&(s=[n,0,o]);var a=i-.5*n;return[Math.round(255*(s[0]+a)),Math.round(255*(s[1]+a)),Math.round(255*(s[2]+a))]}((i=t.substr(4).slice(0,-1).split(",").map(parseFloat))[0],i[1],i[2]);return B(n[0],n[1],n[2])}return t.startsWith("#")||t.startsWith("0x")?E(t):E(function(t){var e=_[t.toLowerCase()];if(e)return e;throw new Error("Unknown color code: "+t)}(t))}catch(t){}return console.warn("ColorCSS parsing error: "+t),E("#fff")},e.ColorHEX=E,e.ColorHSV=O,e.ColorPalettes=jn,e.ColorRGBA=B,e.ColorShadingStyles=O_,e.ConstantLine=NE,e.CursorBuilder=xV,e.CursorBuilderXY=cz,e.CustomTick=BE,e.CustomizableFigure=NN,e.DarkGradientTheme=Af,e.DarkTheme=Ro,e.Dashboard=LH,e.DataPatterns=fR,e.DateTimeTickStrategy=xn,e.DateTimeUnits=dn,e.DefaultCameraStrategy=tV,e.EllipseFigure=bR,e.EllipseSeries=kR,e.EmptyAxisTickStrategy=Ei,e.EmptyFill=H,e.EmptyPointMarker=ZE,e.EmptyPoints3D=qi,e.EmptyUIElement=jE,e.Figure=VN,e.FigureSeries=zN,e.FontSettings=Ki,e.FormattingFunctions=Mi,e.FreeFormPattern=$N,e.FunnelChart=Uz,e.FunnelChartTypes=Kz,e.FunnelChartWithLabelsInsideSlices=jz,e.FunnelChartWithLabelsOnSides=Wz,e.FunnelSlice=zz,e.GaugeChart=Zz,e.GaugeChartTypes=YX,e.GaugeSlice=Qz,e.GenericAxis=Wi,e.GreenTheme=ay,e.HeatmapGridSeries=aH,e.HeatmapGridSeriesIntensityValues=lH,e.HeatmapScrollingGridSeries=hH,e.HeatmapScrollingGridSeriesIntensityValues=uH,e.Highlighter=VE,e.HorizontalPattern=rR,e.HorizontalProgressivePattern=oR,e.HorizontalRegressivePattern=sR,e.ImageFill=_H,e.IndividualPointFill=X,e.IntensityGridSeries=iH,e.IntensityMeshSeries=nH,e.IntensitySeries=tH,e.IntensitySeriesTypes=rH,e.InternalAutoCursor=vV,e.InternalAutoCursorXY=uz,e.InternalCustomTick=EE,e.InternalFunnelSlice=Nz,e.InternalPieSlice=r_,e.InternalPolarAxisRadial=WV,e.InternalPyramidSlice=oN,e.InternalResultTable=gV,e.InternalSolidGaugeSlice=$z,e.InternalStaticCursor=mV,e.InternalStaticCursorXY=hz,e.InternalTableContentBuilder=dV,e.InternalUIElement=LE,e.InternalUILUTRange=AO,e.LUT=R,e.LavenderGradientTheme=Cy,e.LavenderTheme=yy,e.LegendBoxBuilders=zO,e.LightGradientTheme=Uy,e.LightGreenTheme=Sg,e.LightPurpleTheme=XS,e.LightRedTheme=qP,e.LightTheme=fa,e.LineAndPointSeries3D=N_,e.LineSeries=yR,e.LineSeries3D=R_,e.LineStyle=Z,e.LinearGradientFill=K,e.LinearGradientFillPalette=rt,e.LipstickTheme=_v,e.MapChart=zV,e.MapRegions=HX,e.MapRegionsAfrica=PX,e.MapRegionsAsia=BX,e.MapRegionsAustralia=EX,e.MapRegionsCanada=OX,e.MapRegionsEurope=_X,e.MapRegionsNorthAmerica=NX,e.MapRegionsSouthAmerica=RX,e.MapRegionsUSA=zX,e.MapRegionsWorld=VX,e.MapTypes=DV,e.MarkerBuilders=XX,e.MonochromeTheme=ub,e.NewSurfaceGridSeries3D=rV,e.NightTheme=Bw,e.NumericTickStrategy=In,e.OHLCBar=XN,e.OHLCCandleStick=GN,e.OHLCFigure=UN,e.OHLCFigures=WN,e.OHLCSeries=VR,e.OHLCSeriesTraditional=zR,e.OHLCSeriesTypes=RR,e.OHLCSeriesWithAutomaticPacking=NR,e.OnScreenMenu=oH,e.OnScreenMenuAnimationsButton=mL,e.OnScreenMenuButton=cL,e.OnScreenMenuButtonIconsDark=zn,e.OnScreenMenuButtonIconsLight=Vn,e.OnScreenMenuControlBase=hL,e.OnScreenMenuCustomButton=bL,e.OnScreenMenuOsmToggleButton=kL,e.OnScreenMenuToggleButton=fL,e.OnScreenMenuZoomInButton=pL,e.OnScreenMenuZoomInXButton=yL,e.OnScreenMenuZoomInYButton=dL,e.OnScreenMenuZoomOutButton=gL,e.OnScreenMenuZoomOutXButton=SL,e.OnScreenMenuZoomOutYButton=vL,e.OnScreenMenuZoomToFitButton=xL,e.PalettedFill=W,e.Panel=jO,e.PhongShadingStyle=B_,e.Picture=qE,e.PieChart=l_,e.PieChartTypes=w_,e.PieChartWithLabelsInsideSlices=k_,e.PieChartWithLabelsOnSides=b_,e.PieSlice=n_,e.PixelatedPoints3D=$i,e.PointCloudSeries3D=G_,e.PointLineSeries=ZN,e.PointLineSeries3D=H_,e.PointMarkers=jX,e.PointSeries=$R,e.PointSeries3D=U_,e.PointSeriesTypes3D=X_,e.PointStyle3D=tn,e.PolarAreaSeries=Lz,e.PolarAreaSeriesInterior=Pz,e.PolarAxis=YV,e.PolarAxisAmplitude=GV,e.PolarAxisTick=UV,e.PolarChart=Ez,e.PolarLineSeries=rz,e.PolarPointLineSeries=oz,e.PolarPointSeries=sz,e.PolarPolygon=az,e.PolarPolygonSeries=Dz,e.PolarSector=ZV,e.PolarSeries=JV,e.PolygonFigure=SR,e.PolygonSeries=vR,e.ProgressivePattern=eR,e.PurpleTheme=dA,e.PyramidChart=hN,e.PyramidChartTypes=yN,e.PyramidChartWithLabelsInsideSlices=pN,e.PyramidChartWithLabelsOnSides=fN,e.PyramidSlice=rN,e.RadialGauge=qz,e.RadialGradientFill=j,e.RadialGradientFillPalette=nt,e.Rainbow=iF,e.RangeSeries=UR,e.RaspberryTheme=cv,e.RectangleFigure=dR,e.RectangleSeries=gR,e.RedTheme=VT,e.SegmentFigure=mR,e.SegmentSeries=xR,e.Series2D=QV,e.Series3D=__,e.SeriesMarkerXY=kz,e.SeriesXY=wz,e.SimpleFigureSeries=RN,e.SimpleShadingStyle=L_,e.Slice=e_,e.SliceLabelFormatters=t_,e.SliceSorters=$O,e.SolidFill=G,e.SolidFillPalette=it,e.SolidGauge=nN,e.SolidGaugeSlice=Jz,e.SolidLine=J,e.SpiderAxis=mN,e.SpiderChart=DN,e.SpiderSeries=bN,e.SplineSeries=JN,e.StaticCursor2DBuilder=kV,e.StaticCursorXYBuilder=pz,e.StepSeries=pR,e.SunsetTheme=lL,e.SurfaceGridSeries3D=K_,e.SurfaceMeshSeries3D=Z_,e.SurfaceScrollingGridSeries3D=oV,e.SurfaceSeries3D=W_,e.SurfaceSeriesTypes3D=q_,e.TableContentBuilder=yV,e.Themes=IB,e.Tick=NO,e.Tick3D=C_,e.TickStyle=rn,e.TimeFormattingFunctions=En,e.TimeTickStrategy=_n,e.TriangulatedPoints3D=Ji,e.UIBackgrounds=UX,e.UIButtonPictures=GX,e.UICircle=iO,e.UIColumnGrid=uO,e.UIDiamond=nO,e.UIElementBuilders=VO,e.UIElementColumn=lO,e.UIElementLine=sO,e.UIElementRow=aO,e.UIElementWithBackground=PE,e.UIEmptyBackground=KE,e.UILabel=$E,e.UILabelAndTick=PO,e.UILayoutBuilders=aV,e.UILayoutGap=oO,e.UILegendBoxPanel=lV,e.UIObject=FE,e.UIOrigins=JP,e.UIPanel=ZO,e.UIPointer=rO,e.UIPolygon=JE,e.UIRectangle=eO,e.UIRowGrid=cO,e.VerticalPattern=hR,e.VerticalProgressivePattern=uR,e.VerticalRegressivePattern=cR,e.VisibleFill=U,e.VisibleTicks=on,e.ZoomBandChart=AH,e.customComplexTheme=function(t,e){var i,n,r=e,o={};if(r.font){var s=new Ki({family:r.font});o={chartTitleFont:s,spiderScaleLabelFont:s,spiderAxisLabelFont:s,sliceLabelFont:s,axisTitleFont:s,axisLabelFont:s,axisNumericTickStrategy:t.numericTickStrategy.setMajorTickStyle((function(t){return t.setLabelFont(s)})).setExtremeTickStyle((function(t){return t instanceof on&&t.setLabelFont(s),t})).setMinorTickStyle((function(t){return t instanceof on&&t.setLabelFont(s),t})),axisDateTimeTickStrategy:t.dateTimeTickStrategy.setMajorTickStyle((function(t){return t.setLabelFont(s)})).setGreatTickStyle((function(t){return t instanceof on&&t.setLabelFont(s),t})).setMinorTickStyle((function(t){return t instanceof on&&t.setLabelFont(s),t})),uiFont:s}}var a={dashboardBackgroundFillStyle:r.dashboard&&r.dashboard.fill?ef("fill",r.dashboard.fill):void 0,dashboardSplitterStyle:r.dashboard&&r.dashboard.splitter?ef("line",r.dashboard.splitter,10):void 0,chartTitleFillStyle:r.chart&&r.chart.title?ef("fill",r.chart.title):void 0,seriesBackgroundFillStyle:r.chart&&r.chart.backGroundFill?ef("fill",r.chart.backGroundFill):void 0,panelBackgroundFillStyle:r.chart&&r.chart.panelFill?ef("fill",r.chart.panelFill):void 0,spiderSeriesFillStyle:r.spider&&r.spider.fill?ef("fill",r.spider.fill):void 0,spiderWebStyle:r.spider&&r.spider.web?ef("line",r.spider.web):void 0,spiderAxisStyle:r.spider&&r.spider.axis?ef("line",r.spider.axis,3):void 0,spiderAxisNibStyle:r.spider&&r.spider.axisNib?ef("line",r.spider.axisNib,2):void 0,spiderSeriesStrokeStyle:r.spider&&r.spider.stroke?ef("line",r.spider.stroke,2):void 0,spiderAxisLabelFillStyle:r.spider&&r.spider.axisLabel?ef("fill",r.spider.axisLabel):void 0,spiderScaleLabelFillStyle:r.spider&&r.spider.seriesLabel?ef("fill",r.spider.seriesLabel):void 0,sliceLabelConnectorStyle:r.sliceChart&&r.sliceChart.connector?ef("line",r.sliceChart.connector):void 0,sliceLabelFillStyle:r.sliceChart&&r.sliceChart.label?ef("fill",r.sliceChart.label):void 0,gaugeBackgroundStrokeStyle:r.gauge&&r.gauge.stroke?ef("line",r.gauge.stroke):void 0,gaugeBackgroundFillStyle:r.gauge&&r.gauge.backgroundFill?ef("fill",r.gauge.backgroundFill):void 0,gaugeSliceFillStyle:r.gauge&&r.gauge.sliceFill?ef("fill",r.gauge.sliceFill):void 0,axisTitleFillStyle:r.axis&&r.axis.title?ef("fill",r.axis.title):void 0,axisStyle:r.axis&&r.axis.axes?ef("line",r.axis.axes,3):void 0,axisOverlayStyle:r.axis&&r.axis.overlay?ef("line",r.axis.overlay):void 0,numericTickStrategy:r.axis&&r.axis.tick&&r.axis.grid&&r.axis.label?t.numericTickStrategy.setMajorTickStyle((function(t){return t.setLabelFillStyle(ef("fill",r.axis.label)).setGridStrokeStyle(ef("line",r.axis.grid)).setTickStyle(ef("line",r.axis.tick))})):void 0,dateTimeTickStrategy:r.axis&&r.axis.tick&&r.axis.grid&&r.axis.label?t.dateTimeTickStrategy.setMajorTickStyle((function(t){return t.setLabelFillStyle(ef("fill",r.axis.label)).setGridStrokeStyle(ef("line",r.axis.grid)).setTickStyle(ef("line",r.axis.tick))})):void 0,axisNibStyle:r.axis&&r.axis.nib?ef("line",r.axis.nib,3):void 0,axisNibOverlayStyle:r.axis&&r.axis.nibOverlay?ef("fill",r.axis.nibOverlay):void 0,bandFillStyle:r.band&&r.band.fill?ef("fill",r.band.fill):void 0,constantLineStrokeStyle:r.constantline&&r.constantline.stroke?ef("fill",r.constantline.stroke,5):void 0,seriesFillStyle:r.series&&r.series.fill?ef("fill",r.series.fill):void 0,seriesStrokeStyle:r.series&&r.series.stroke?ef("line",r.series.stroke):void 0,seriesPointFillStyle:r.series&&r.series.pointFill?ef("fill",r.series.pointFill):void 0,mountainsFillStyle:r.mountains&&r.mountains.fill?ef("fill",r.mountains.fill):void 0,mountainsStrokeStyle:r.mountains&&r.mountains.stroke?ef("line",r.mountains.stroke):void 0,mountainsInvertedFillStyle:r.mountains&&r.mountains.invertedFill?ef("fill",r.mountains.invertedFill):void 0,mountainsInvertedStrokeStyle:r.mountains&&r.mountains.invertedStroke?ef("line",r.mountains.invertedStroke):void 0,candleStickStyle:r.candlestick&&r.candlestick.fill?ef("line",r.candlestick.fill):void 0,candleStickPositiveStyle:r.candlestick&&r.candlestick.positive?ef("fill",r.candlestick.positive):void 0,candleStickNegativeStyle:r.candlestick&&r.candlestick.negative?ef("fill",r.candlestick.negative):void 0,boxFigureStyle:r.box&&r.box.fill?ef("fill",r.box.fill):void 0,boxFigureStrokeStyle:r.box&&r.box.stroke?ef("line",r.box.stroke,3):void 0,boxFigureLineStyle:r.box&&r.box.line?ef("line",r.box.line,3):void 0,boxFigureMedianLineStyle:r.box&&r.box.median?ef("line",r.box.median,5):void 0,pointMarkerFillStyle:r.point&&r.point.fill?ef("fill",r.point.fill):void 0,pointMarkerStrokeStyle:r.point&&r.point.stroke?ef("line",r.point.stroke):void 0,pointMarkerHorizontalGridStrokeStyle:r.point&&r.point.horizontalGrid?ef("line",r.point.horizontalGrid):void 0,pointMarkerVerticalGridStrokeStyle:r.point&&r.point.verticalGrid?ef("line",r.point.verticalGrid):void 0,pointMarkerTextFillStyle:r.point&&r.point.text?ef("fill",r.point.text):void 0,resultTableFillStyle:r.result&&r.result.fill?ef("fill",r.result.fill):void 0,resultTableStrokeStyle:r.result&&r.result.stroke?ef("line",r.result.stroke):void 0,resultTableTextFillStyle:r.result&&r.result.text?ef("fill",r.result.text):void 0,uiBackgroundFillStyle:r.ui&&r.ui.fill?ef("fill",r.ui.fill):void 0,uiBackgroundStrokeStyle:r.ui&&r.ui.stroke?ef("line",r.ui.stroke):void 0,uiTextFillStyle:r.ui&&r.ui.text?ef("fill",r.ui.text):void 0,uiButtonFillStyle:r.ui&&r.ui.button?ef("fill",r.ui.button):void 0,customTickMarkerFillStyle:r.customTick&&r.customTick.fill?ef("fill",r.customTick.fill):void 0,customTickGridStrokeStyle:r.customTick&&r.customTick.grid?ef("line",r.customTick.grid,3):void 0,customTickMarkerStrokeStyle:r.customTick&&r.customTick.stroke?ef("line",r.customTick.stroke,1):void 0};try{for(var l=c(Object.entries(a)),h=l.next();!h.done;h=l.next()){var p=f(h.value,2),y=p[0];void 0===p[1]&&delete a[y]}}catch(t){i={error:t}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(i)throw i.error}}return u(u(u({},t),o),a)},e.customSimpleTheme=function(t,e,i,n){void 0===i&&(i=Ro);var r,o,s,a=new G({color:t}),l=new G({color:t.getLighter()}),h=new G({color:t.getDarker()}),c=!0,f={};e?(s=new G({color:e}),r=new G({color:e.getLighter()}),o=new G({color:e.getDarker()})):(r=l,o=h,s=a);var p=i.seriesBackgroundFillStyle instanceof G?i.seriesBackgroundFillStyle.getColor():new L({});(p.getR()>180||p.getG()>180||p.getB()>180)&&(c=!1);var y={chartTitleFillStyle:a,uiTextFillStyle:s,uiButtonFillStyle:a,uiBackgroundStrokeStyle:new J({fillStyle:a}),sliceLabelFillStyle:c?l:h,sliceLabelConnectorStyle:new J({fillStyle:c?r:o}),spiderScaleLabelFillStyle:a,spiderAxisLabelFillStyle:c?l:h,spiderSeriesFillStyle:r,spiderSeriesStrokeStyle:new J({fillStyle:s,thickness:2}),seriesPointFillStyle:o,seriesStrokeStyle:new J({fillStyle:s,thickness:1}),seriesFillStyle:s,axisLabelFillStyle:c?l:h,numericTickStrategy:i.numericTickStrategy.setMajorTickStyle((function(t){return t.setLabelFillStyle(c?l:h)})).setExtremeTickStyle((function(t){return t instanceof on&&t.setLabelFillStyle(c?l:h),t})).setMinorTickStyle((function(e){return e instanceof on&&e.setLabelFillStyle(new G(c?{color:t.getDarker()}:{color:t.getLighter()})),e})),dateTimeTickStrategy:i.dateTimeTickStrategy.setMajorTickStyle((function(t){return t.setLabelFillStyle(c?l:h)})).setMinorTickStyle((function(e){return e instanceof on&&e.setLabelFillStyle(new G(c?{color:t.getDarker()}:{color:t.getLighter()})),e})),axisTitleFillStyle:c?o:r,resultTableTextFillStyle:c?r:o,resultTableStrokeStyle:new J({fillStyle:c?h:l}),customTickMarkerStrokeStyle:new J({fillStyle:c?h:l}),mountainsFillStyle:s,mountainsInvertedFillStyle:c?h:l,mountainsStrokeStyle:new J({fillStyle:c?r:o}),mountainsInvertedStrokeStyle:new J({fillStyle:c?l:h}),gaugeSliceFillStyle:s,pointMarkerTextFillStyle:a};if(n){var d=new Ki({family:n});f={chartTitleFont:d,spiderScaleLabelFont:d,spiderAxisLabelFont:d,sliceLabelFont:d,axisTitleFont:d,axisLabelFont:d,axisNumericTickStrategyFont:y.numericTickStrategy.setMajorTickStyle((function(t){return t.setLabelFont(d)})).setExtremeTickStyle((function(t){return t instanceof on&&t.setLabelFont(d),t})).setMinorTickStyle((function(t){return t instanceof on&&t.setLabelFont(d),t})),axisDateTimeTickStrategyFont:y.dateTimeTickStrategy.setMajorTickStyle((function(t){return t.setLabelFont(d)})).setGreatTickStyle((function(t){return t instanceof on&&t.setLabelFont(d),t})).setMinorTickStyle((function(t){return t instanceof on&&t.setLabelFont(d),t})),uiFont:d}}return u(u(u({},i),y),f)},e.customTheme=nf,e.defaultOsmBackgroundColor=sB,e.emptyFill=Y,e.emptyLine=Q,e.emptyPoints3D=Qi,e.emptyTick=an,e.formatLongitudeLatitude=HV,e.lightningChart=function(t,e){var i="object"==typeof t?t.license:t,n="object"==typeof t?t.licenseInformation:e,r="object"==typeof t?t:void 0,o=new cX;return o.e=i||"",rX||(rX=function(t){var e=!1,i=!1,n=!1,r="",o="";try{if(nX){var s=function(t){if(t){var e=t.split("-");return 4===e.length?e[1].startsWith("m")?2:1:0}}(nX);1===s?(n=!function(t){if("0001"===t.slice(0,4))return function(t){var e,i="";try{var n=t.split("-"),r=n[1],o=n[2],s=n[3];if(!dX(o,s))throw new Error(hX(0,21,1,2,1,7,1,12,5));var a=eX.parse(o);i=oX.decrypt({ciphertext:eX.parse(r)},a,{mode:sX,padding:aX,iv:eX.parse("00000000000000000000000000000001")}).toString(iX)}catch(t){throw new Error(hX(0,21,1,2,1,7,1,12,5))}try{e=JSON.parse(i)}catch(t){throw new Error(hX(0,21,1,2,1,7,1,12,5))}if(void 0===e[hX(-1,5)]||null===e[hX(-1,4)]||!e[hX(-1,9)])throw new Error(hX(0,21,1,2,1,7,1,12,5));var l=parseInt(hX(-3,0),10)||Number(parseInt(hX(-3,0),10));if(e[hX(-1,5)]-1)return!0;if(t[hX(-1,8)]===fX[hX(-1,6)][hX(-1,7)])return!1;throw new Error(hX(0,14,1,20,5))}(e)}catch(t){throw new Error(hX(0,14,1,22,5))}return h}(t);throw new Error(hX(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}(nX),e=!0):2===s?(function(t,e){if("0001"!==t.slice(0,4))throw new Error(hX(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5));!function(t,e){if(!e)throw new Error(hX(0,39,1,40,1,41,5));var i=t.split("-"),n=i[1].slice(1),r=i[2],o=i[3];if(!dX(n+"-"+r,o))throw new Error(hX(0,21,1,2,1,7,1,12,5));for(var s=Uint8Array.from(yX(r,2)),a=0,l=s.length-1;l>0;l-=1)a+=s[l]*Math.pow(2,8*l);if(a<(parseInt(hX(-3,0),10)||Number(parseInt(hX(-3,0),10))))throw new Error(hX(0,21,1,2,1,3,1,4,5));var h=Int32Array.from(yX(n,8)),u=$G(e[hX(-1,31)]).toString(eX),c=Int32Array.from(yX(u,8)),f=$G(e[hX(-1,32)]).toString(eX),p=Int32Array.from(yX(f,8)),y=new Int32Array(c.length);for(l=0;l>>1:e>>>1;i[n]=e}for(var o=-1,s=0;s>>8^i[255&(o^t[s])];return(-1^o)>>>0}(n.slice(0,36));new DataView(o.buffer).setUint32(0,s,!0);for(var a=n.slice(28,34),l=0,h=a.length-1;h>0;h-=1)l+=a[h]*Math.pow(2,8*h);if(l<(parseInt(hX(-3,0),10)||Number(parseInt(hX(-3,0),10))))throw new Error(hX(0,0,1,2,1,3,1,4,5));if(!r.every((function(t,e){return o[e]===t})))throw new Error(hX(0,0,1,2,1,7,1,12,5))}(nX))}else uX=!0}catch(t){r=t.message,console.error(t)}var a=!(r||uX||e||i),l=function(){var t=new(fX[hX(-1,0)]);return t.open(hX(0,26),hX(-2,0)),t.setRequestHeader(hX(-1,24),hX(-1,25)),t.withCredentials=!0,t}();if(a){var h=void 0;try{h=parseInt(nX?nX.split("-")[1]:Math.floor(1e6*Math.random()).toString(),16)}catch(t){h=Math.floor(1e6*Math.random())}var u=Math.floor(1e6*Math.random());o=(h^u).toString();var c={},f="",p="",y="";nX=nX||"";for(var d=hX(-4,0),g=0;g{i.r(e),i.d(e,{DataGenerator:()=>h,DataHost:()=>l,Stream:()=>a,createDeltaFunctionGenerator:()=>x,createOHLCGenerator:()=>v,createParametricFunctionGenerator:()=>I,createProgressiveFunctionGenerator:()=>y,createProgressiveRandomGenerator:()=>u,createProgressiveTraceGenerator:()=>f,createSampledDataGenerator:()=>M,createSpectrumDataGenerator:()=>C,createTraceGenerator:()=>g,createWaterDropDataGenerator:()=>P,createWhiteNoiseGenerator:()=>k});var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},n(t,e)};function r(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var o=function(){return o=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0||-1===this.batchesLeft)&&i.length>0&&(this.data=this.data.concat(i.map((function(e){return t.infiniteReset(e)}))),i.length0||-1===this.batchesLeft||-2===this.batchesLeft&&this.data.length>0;return this.continueHandler&&(t=!0===this.continueHandler()),t},t.prototype.runStream=function(){var t=this.checkStreamContinue();if(this.data&&this.data.length>0&&t){if(this.streamHandler){var e=this.consume();this.streamHandler(e)}setTimeout(this.runStream,this.interval)}else this.streamActive=!1;this.batchesLeft>0&&this.batchesLeft--},t.prototype.activateStream=function(){this.streamActive||(this.streamActive=!0,this.runStream())},t.prototype.push=function(t){Array.isArray(t)?this.data=this.data.concat(t):this.data.push(t),this.activateStream()},t.prototype.map=function(e){return this.outputStream=new t(o(o({},this.options),{repeat:!1}),this.infiniteReset),this.mapHandler=e,this.streamHandler=this._map,this.activateStream(),this.outputStream},t.prototype._map=function(t){if(this.mapHandler&&this.outputStream){var e=t.map(this.mapHandler);this.outputStream.push(e)}},t.prototype.forEach=function(t){this.forEachHandler=t,this.streamHandler=this._forEach,this.activateStream()},t.prototype._forEach=function(t){this.forEachHandler&&t.forEach(this.forEachHandler)},t}(),l=function(){function t(t,e){this.data=[],this.derivativeDataHosts=[],this.promisesToResolve=[],this.streamsToPush=[],this.infiniteReset=this.infiniteReset.bind(this),this.infiniteResetHandler=t;var i={interval:e.interval,batchSize:e.batchSize,repeat:void 0!==e.repeat&&e.repeat};this.streamOptions=Object.freeze(i)}return t.prototype.toStream=function(){var t=new a(this.streamOptions,this.infiniteReset);return this.frozenData?t.push(this.frozenData):this.streamsToPush.push(t),t},t.prototype.toPromise=function(){var t=this;return this.frozenData?Promise.resolve(this.frozenData):new Promise((function(e){t.promisesToResolve.push(e)}))},t.prototype.infiniteReset=function(t){return this.infiniteResetHandler(t,this.frozenData?this.frozenData:[])},t.prototype.push=function(t){var e,i;if(!this.frozenData)if(Array.isArray(t))try{for(var n=function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),r=n.next();!r.done;r=n.next()){var o=r.value;this.data.push(o)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}else this.data.push(t)},t.prototype.setData=function(t){this.data=t},t.prototype.freeze=function(){var t=this;this.frozenData||(this.frozenData=this.data,setTimeout((function(){t.promisesToResolve.forEach((function(e){return e(t.frozenData)})),t.promisesToResolve=[]}),0),setTimeout((function(){t.streamsToPush.forEach((function(e){return e.push(t.frozenData||[])})),t.streamsToPush=[]}),0),setTimeout((function(){t.handleDerivativeDataHosts()}),0),this.data=[])},t.prototype.getPointCount=function(){return this.frozenData?this.frozenData.length:0},t.prototype.handleDerivativeDataHosts=function(){var t=this;this.frozenData&&this.derivativeDataHosts.length>0&&(this.derivativeDataHosts.forEach((function(e){t.frozenData&&e.setData(t.frozenData),e.freeze()})),this.derivativeDataHosts=[])},t.prototype.setStreamInterval=function(e){var i=new t(this.infiniteResetHandler,o(o({},this.streamOptions),{interval:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t.prototype.setStreamBatchSize=function(e){var i=new t(this.infiniteResetHandler,o(o({},this.streamOptions),{batchSize:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t.prototype.setStreamRepeat=function(e){var i=new t(this.infiniteResetHandler,o(o({},this.streamOptions),{repeat:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t}();if("undefined"!=typeof window&&window.performance&&window.performance.now)s=window.performance.now.bind(window.performance);else try{s=Object(function(){var t=new Error("Cannot find module 'perf_hooks'");throw t.code="MODULE_NOT_FOUND",t}())}catch(t){throw new Error('Failed to detect "performance.now" API')}var h=function(){function t(t){this.options=t}return t.prototype.generate=function(){var t=new l(this.infiniteReset,{interval:500,batchSize:10,repeat:!1}),e=this.getPointCount(),i=this.generateChunks.bind(this,0,e,t);return setTimeout(i,0),t},t.prototype.generateChunks=function(t,e,i){for(var n=s(),r=[],o=0;s()-n<15&&t.5?this.offset+e:this.offset-e}return this.offset+this.options.dataMax>1?this.offset=1-this.options.dataMax:this.offset<0&&(this.offset=0),{x:t,y:this.offset+Math.random()*this.options.dataMax}},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(h);function f(){return new p({numberOfPoints:1e3})}var p=function(t){function e(e){var i=t.call(this,e)||this;i.previousPoint={x:0,y:0};var n={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(n),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(o(o({},this.options),{numberOfPoints:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e={x:t,y:this.previousPoint.y+2*(Math.random()-.5)};return this.previousPoint=e,e},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(h);function y(){return new d({samplingFunction:function(t){return t*t},start:0,end:100,step:1})}var d=function(t){function e(e){var i=t.call(this,e)||this;i.x=i.options.start;var n={samplingFunction:e.samplingFunction,start:e.start,end:e.end,step:e.step};return i.options=Object.freeze(n),i.numberOfPoints=Math.ceil(Math.abs(n.end-n.start)/n.step),i}return r(e,t),e.prototype.setSamplingFunction=function(t){return new e(o(o({},this.options),{samplingFunction:t}))},e.prototype.setStart=function(t){return new e(o(o({},this.options),{start:t}))},e.prototype.setEnd=function(t){return new e(o(o({},this.options),{end:t}))},e.prototype.setStep=function(t){return new e(o(o({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.x,y:this.options.samplingFunction(this.x)};return this.x=this.x+this.options.step,t},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length*(e[e.length-1].x-e[e.length-2].x),y:t.y}},e}(h);function g(){return new S({numberOfPoints:1e3})}var S=function(t){function e(e){var i=t.call(this,e)||this;i.previous={x:0,y:0};var n={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(n),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(o(o({},this.options),{numberOfPoints:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.previous.x+2*(Math.random()-.5),y:this.previous.y+2*(Math.random()-.5)};return this.previous=t,t},e.prototype.infiniteReset=function(t,e){return{x:t.x+e[e.length-1].x,y:t.y+e[e.length-1].y}},e}(h);function v(){return new m({numberOfPoints:1e3,startTimestamp:0,dataFreq:1,start:100,volatility:.1})}var m=function(t){function e(e){var i=t.call(this,e)||this;return i.prevPoint=[i.options.startTimestamp,i.options.start,i.options.start,i.options.start,i.options.start],i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(o(o({},this.options),{numberOfPoints:t}))},e.prototype.setStartTimestamp=function(t){return new e(o(o({},this.options),{startTimestamp:t}))},e.prototype.setDataFrequency=function(t){return new e(o(o({},this.options),{dataFreq:t}))},e.prototype.setStart=function(t){return new e(o(o({},this.options),{start:t}))},e.prototype.setVolatility=function(t){return new e(o(o({},this.options),{volatility:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e,i=this,n=this.options.startTimestamp+this.options.dataFreq*t,r=Math.random()>.5?1:-1,o=Array.from(Array(4)).map((function(t){var e=Math.random()*i.options.volatility*r;return i.prevPoint[4]+e<0&&(e*=-1),i.prevPoint[4]+e})).sort((function(t,e){return t-e}));return-1===r&&(o=[o[0],o[2],o[1],o[3]]),e=[n,o[1],o[3],o[0],o[2]],this.prevPoint=e,e},e.prototype.infiniteReset=function(t,e){return[t[0]+e.length*(e[e.length-1][0]-e[e.length-2][0]),t[1],t[2],t[3],t[4]]},e}(h);function x(){return new b({numberOfPoints:1e3,minGap:1,maxGap:-1,minAmplitude:.1,maxAmplitude:1,probability:.02})}var b=function(t){function e(e){var i=t.call(this,e)||this;i.lastSpike=0;var n={numberOfPoints:e.numberOfPoints,minGap:e.minGap,maxGap:e.maxGap,minAmplitude:e.minAmplitude,maxAmplitude:e.maxAmplitude,probability:e.probability};return i.options=Object.freeze(n),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(o(o({},this.options),{numberOfPoints:t}))},e.prototype.setMinGap=function(t){return new e(o(o({},this.options),{minGap:t}))},e.prototype.setMaxGap=function(t){return new e(o(o({},this.options),{maxGap:t}))},e.prototype.setMinAmplitude=function(t){return new e(o(o({},this.options),{minAmplitude:t}))},e.prototype.setMaxAmplitude=function(t){return new e(o(o({},this.options),{maxAmplitude:t}))},e.prototype.setProbability=function(t){return new e(o(o({},this.options),{probability:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e=t-this.lastSpike,i={x:t,y:0};return(e>this.options.minGap||-1===this.options.minGap)&&(e1-this.options.probability&&(i.y=Math.random()*(this.options.maxAmplitude-this.options.minAmplitude)+this.options.minAmplitude,this.lastSpike=t):e>=this.options.maxGap&&(i.y=Math.random()*(this.options.maxAmplitude-this.options.minAmplitude)+this.options.minAmplitude,this.lastSpike=t)),i},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(h);function k(){return new w({numberOfPoints:1e3})}var w=function(t){function e(e){var i=t.call(this,e)||this,n={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(n),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(this.options?o(o({},this.options),{numberOfPoints:t}):{numberOfPoints:t})},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){return{x:t,y:2*(Math.random()-.5)}},e.prototype.infiniteReset=function(t,e){return{x:t.x+e[e.length-1].x,y:t.y+e[e.length-1].y}},e}(h);function M(){return new A({inputData:[],samplingFrequency:50,step:0})}var A=function(t){function e(e){var i=t.call(this,e)||this;i.interval=1/(i.options.samplingFrequency||10);var n={inputData:e.inputData,samplingFrequency:e.samplingFrequency,step:e.step};return i.options=Object.freeze(n),i}return r(e,t),e.prototype.setInputData=function(t){return new e(o(o({},this.options),{inputData:t}))},e.prototype.setSamplingFrequency=function(t){return new e(o(o({},this.options),{samplingFrequency:t}))},e.prototype.setStep=function(t){return new e(o(o({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.options.inputData.length},e.prototype.generateDataPoint=function(t){return{timestamp:t*this.interval+t*this.options.step,data:this.options.inputData[t]}},e.prototype.infiniteReset=function(t,e){return{timestamp:t.timestamp+e[e.length-1].timestamp,data:t.data}},e}(h);function I(){return new F({xFunction:function(t){return 3*Math.cos(3*t)},yFunction:function(t){return 3*Math.sin(4*t)},start:0,end:1e3,step:.5})}var F=function(t){function e(e){var i=t.call(this,e)||this;i.t=i.options.start;var n={xFunction:e.xFunction,yFunction:e.yFunction,start:e.start,end:e.end,step:e.step};return i.options=Object.freeze(n),i.numberOfPoints=Math.ceil(Math.abs(n.end-n.start)/n.step),i}return r(e,t),e.prototype.setXFunction=function(t){return new e(o(o({},this.options),{xFunction:t}))},e.prototype.setYFunction=function(t){return new e(o(o({},this.options),{yFunction:t}))},e.prototype.setStart=function(t){return new e(o(o({},this.options),{start:t}))},e.prototype.setEnd=function(t){return new e(o(o({},this.options),{end:t}))},e.prototype.setStep=function(t){return new e(o(o({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.options.xFunction(this.t),y:this.options.yFunction(this.t)};return this.t=this.t+this.options.step,t},e.prototype.infiniteReset=function(t,e){return{x:t.x,y:t.y}},e}(h),T={numberOfSamples:1e3,sampleSize:10,variation:10,frequencyStability:1,narrowFactor1:8,narrowFactor2:24};function C(){return new D(T)}var D=function(t){function e(e){var i=t.call(this,e)||this,n={sampleSize:void 0!==e.sampleSize?e.sampleSize:T.sampleSize,numberOfSamples:void 0!==e.numberOfSamples?e.numberOfSamples:T.numberOfSamples,variation:void 0!==e.variation?e.variation:T.variation,frequencyStability:void 0!==e.frequencyStability?e.frequencyStability:T.frequencyStability,narrowFactor1:void 0!==e.narrowFactor1?e.narrowFactor1:T.narrowFactor1,narrowFactor2:void 0!==e.narrowFactor2?e.narrowFactor2:T.narrowFactor2};return i.options=Object.freeze(n),i}return r(e,t),e.prototype.setNumberOfSamples=function(t){return new e(o(o({},this.options),{numberOfSamples:t}))},e.prototype.setSampleSize=function(t){return new e(o(o({},this.options),{sampleSize:t}))},e.prototype.setVariation=function(t){return new e(o(o({},this.options),{variation:t}))},e.prototype.setFrequencyStability=function(t){return new e(o(o({},this.options),{frequencyStability:t}))},e.prototype.setNarrowFactor1=function(t){return new e(o(o({},this.options),{narrowFactor1:t}))},e.prototype.setNarrowFactor2=function(t){return new e(o(o({},this.options),{narrowFactor2:t}))},e.prototype.getPointCount=function(){return this.options.numberOfSamples},e.prototype.generateDataPoint=function(t){for(var e=100,i=this.options.variation,n=this.options.sampleSize,r=this.options.frequencyStability,o=n/8,s=n/2,a=new Array(n),l=0;ln&&(o=n),(s+=(Math.random()-.5)*i/r/100*n)<0&&(s=0),s>n&&(s=n);var y,d=e/3*2,g=d/(p*p)*this.options.narrowFactor1,S=50/(p*p)*this.options.narrowFactor2;for(l=0;le&&(h=e),(u=50-(f=.8*l-s)*f*S)<0&&(u=0),u>e&&(u=e),y=h+u,y+=y*(Math.random()-.5)*i/10,a[l]=(a[l]+y)/2,a[l]<0&&(a[l]=0),a[l]>e&&(a[l]=e),a[l]=.02*a[l];return a},e.prototype.infiniteReset=function(t,e){return t.slice()},e}(h),L={rows:10,columns:10,rowPositionsNormalized:[.2,.5,.7],columnPositionsNormalized:[.6,.5,.3],amplitudes:[15,50,3],offsetLevel:47,volatility:25};function P(){return new B(L)}var B=function(){function t(t){var e={rows:void 0!==t.rows?t.rows:L.rows,columns:void 0!==t.columns?t.columns:L.columns,rowPositionsNormalized:void 0!==t.rowPositionsNormalized?t.rowPositionsNormalized:L.rowPositionsNormalized,columnPositionsNormalized:void 0!==t.columnPositionsNormalized?t.columnPositionsNormalized:L.columnPositionsNormalized,amplitudes:void 0!==t.amplitudes?t.amplitudes:L.amplitudes,offsetLevel:void 0!==t.offsetLevel?t.offsetLevel:L.offsetLevel,volatility:void 0!==t.volatility?t.volatility:L.volatility};this.options=Object.freeze(e)}return t.prototype.setRows=function(e){return new t(o(o({},this.options),{rows:e}))},t.prototype.setColumns=function(e){return new t(o(o({},this.options),{columns:e}))},t.prototype.setWaterDrops=function(e){var i=e.map((function(t){return t.rowNormalized})),n=e.map((function(t){return t.columnNormalized})),r=e.map((function(t){return t.amplitude}));return new t(o(o({},this.options),{rowPositionsNormalized:i,columnPositionsNormalized:n,amplitudes:r}))},t.prototype.setOffsetLevel=function(e){return new t(o(o({},this.options),{offsetLevel:e}))},t.prototype.setVolatility=function(e){return new t(o(o({},this.options),{volatility:e}))},t.prototype.generate=function(){var t=this;return new Promise((function(e){return i=t,n=void 0,o=function(){var t,i,n,r,o,s,a,l,h,u,c,f,p,y,d,g,S,v,m;return function(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&d%1e3==0&&Date.now()-y>=15?[4,new Promise((function(t){return setTimeout(t,0)}))]:[3,4]):[3,5];case 3:x.sent(),y=Date.now(),x.label=4;case 4:return v++,m+=f,[3,2];case 5:return g++,S+=p,[3,1];case 6:return e(c),[2]}}))},new((r=void 0)||(r=Promise))((function(t,e){function s(t){try{l(o.next(t))}catch(t){e(t)}}function a(t){try{l(o.throw(t))}catch(t){e(t)}}function l(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(s,a)}l((o=o.apply(i,n||[])).next())}));var i,n,r,o}))},t}()},187:t=>{function e(t,e,o){o=o||2;var s,a,l,c,f,y,d,g=e&&e.length,S=g?e[0]*o:t.length,v=i(t,0,S,o,!0),m=[];if(!v||v.next===v.prev)return m;if(g&&(v=function(t,e,r,o){var s,a,l,c=[];for(s=0,a=e.length;s80*o){s=l=t[0],a=c=t[1];for(var x=o;xl&&(l=f),y>c&&(c=y);d=0!==(d=Math.max(l-s,c-a))?1/d:0}return r(v,m,o,s,a,d),m}function i(t,e,i,n,r){var o,s;if(r===I(t,e,i,n)>0)for(o=e;o=e;o-=n)s=w(o,t[o],t[o+1],s);return s&&S(s,s.next)&&(M(s),s=s.next),s}function n(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!S(n,n.next)&&0!==g(n.prev,n,n.next))n=n.next;else{if(M(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function r(t,e,i,h,u,c,p){if(t){!p&&c&&function(t,e,i,n){var r=t;do{null===r.z&&(r.z=f(r.x,r.y,e,i,n)),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,n,r,o,s,a,l,h=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,n=i,a=0,e=0;e0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,h*=2}while(s>1)}(r)}(t,h,u,c);for(var y,d,g=t;t.prev!==t.next;)if(y=t.prev,d=t.next,c?s(t,h,u,c):o(t))e.push(y.i/i),e.push(t.i/i),e.push(d.i/i),M(t),t=d.next,g=d.next;else if((t=d)===g){p?1===p?r(t=a(n(t),e,i),e,i,h,u,c,2):2===p&&l(t,e,i,h,u,c):r(n(t),e,i,h,u,c,1);break}}}function o(t){var e=t.prev,i=t,n=t.next;if(g(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(y(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&g(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function s(t,e,i,n){var r=t.prev,o=t,s=t.next;if(g(r,o,s)>=0)return!1;for(var a=r.xo.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,u=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,c=f(a,l,e,i,n),p=f(h,u,e,i,n),d=t.prevZ,S=t.nextZ;d&&d.z>=c&&S&&S.z<=p;){if(d!==t.prev&&d!==t.next&&y(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&g(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,S!==t.prev&&S!==t.next&&y(r.x,r.y,o.x,o.y,s.x,s.y,S.x,S.y)&&g(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&y(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&g(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;S&&S.z<=p;){if(S!==t.prev&&S!==t.next&&y(r.x,r.y,o.x,o.y,s.x,s.y,S.x,S.y)&&g(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function a(t,e,i){var r=t;do{var o=r.prev,s=r.next.next;!S(o,s)&&v(o,r,r.next,s)&&b(o,s)&&b(s,o)&&(e.push(o.i/i),e.push(r.i/i),e.push(s.i/i),M(r),M(r.next),r=t=s),r=r.next}while(r!==t);return n(r)}function l(t,e,i,o,s,a){var l=t;do{for(var h=l.next.next;h!==l.prev;){if(l.i!==h.i&&d(l,h)){var u=k(l,h);return l=n(l,l.next),u=n(u,u.next),r(l,e,i,o,s,a),void r(u,e,i,o,s,a)}h=h.next}l=l.next}while(l!==t)}function h(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,n=e,r=t.x,o=t.y,s=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>s){if(s=a,a===r){if(o===n.y)return n;if(o===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&r!==n.x&&y(oi.x||n.x===i.x&&c(i,n)))&&(i=n,p=l)),n=n.next}while(n!==h);return i}(t,e);if(!i)return e;var r=k(i,t),o=n(i,i.next);return n(r,r.next),e===i?o:e}function c(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function f(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{(e.x=0&&(t-s)*(n-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(r-s)*(n-a)>=0}function d(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&&v(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,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||S(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function S(t,e){return t.x===e.x&&t.y===e.y}function v(t,e,i,n){var r=x(g(t,e,i)),o=x(g(t,e,n)),s=x(g(i,n,t)),a=x(g(i,n,e));return r!==o&&s!==a||!(0!==r||!m(t,i,e))||!(0!==o||!m(t,n,e))||!(0!==s||!m(i,t,n))||!(0!==a||!m(i,e,n))}function m(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 x(t){return t>0?1:t<0?-1:0}function b(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function k(t,e){var i=new A(t.i,t.x,t.y),n=new A(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function w(t,e,i,n){var r=new A(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function M(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 A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(t,e,i,n){for(var r=0,o=e,s=i-n;o0&&(n+=t[r-1].length,i.holes.push(n))}return i}},369:(t,e,i)=>{i.r(e),i.d(e,{default:()=>wn,Collection:()=>w,Iterable:()=>kn,List:()=>ni,Map:()=>Be,OrderedMap:()=>Si,OrderedSet:()=>on,Range:()=>Hi,Record:()=>un,Repeat:()=>Sn,Seq:()=>X,Set:()=>Ei,Stack:()=>wi,fromJS:()=>vn,get:()=>ne,getIn:()=>Yi,has:()=>ie,hasIn:()=>Gi,hash:()=>ct,is:()=>at,isAssociative:()=>k,isCollection:()=>S,isImmutable:()=>L,isIndexed:()=>b,isKeyed:()=>m,isList:()=>ii,isMap:()=>rt,isOrdered:()=>B,isOrderedMap:()=>ot,isOrderedSet:()=>Di,isPlainObject:()=>$t,isRecord:()=>D,isSeq:()=>T,isSet:()=>Ci,isStack:()=>ki,isValueObject:()=>st,merge:()=>me,mergeDeep:()=>be,mergeDeepWith:()=>ke,mergeWith:()=>xe,remove:()=>oe,removeIn:()=>ce,set:()=>se,setIn:()=>he,update:()=>pe,updateIn:()=>ae,version:()=>bn});var n=32,r=31,o={};function s(t){t&&(t.value=!0)}function a(){}function l(t){return void 0===t.size&&(t.size=t.__iterate(u)),t.size}function h(t,e){if("number"!=typeof e){var i=e>>>0;if(""+i!==e||4294967295===i)return NaN;e=i}return e<0?l(t)+e:e}function u(){return!0}function c(t,e,i){return(0===t&&!d(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function f(t,e){return y(t,e,0)}function p(t,e){return y(t,e,e)}function y(t,e,i){return void 0===t?i:d(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function d(t){return t<0||0===t&&1/t==-1/0}var g="@@__IMMUTABLE_ITERABLE__@@";function S(t){return Boolean(t&&t[g])}var v="@@__IMMUTABLE_KEYED__@@";function m(t){return Boolean(t&&t[v])}var x="@@__IMMUTABLE_INDEXED__@@";function b(t){return Boolean(t&&t[x])}function k(t){return m(t)||b(t)}var w=function(t){return S(t)?t:X(t)},M=function(t){function e(t){return m(t)?t:W(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),A=function(t){function e(t){return b(t)?t:j(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 S(t)&&!k(t)?t:K(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w);w.Keyed=M,w.Indexed=A,w.Set=I;var F="@@__IMMUTABLE_SEQ__@@";function T(t){return Boolean(t&&t[F])}var C="@@__IMMUTABLE_RECORD__@@";function D(t){return Boolean(t&&t[C])}function L(t){return S(t)||D(t)}var P="@@__IMMUTABLE_ORDERED__@@";function B(t){return Boolean(t&&t[P])}var E="function"==typeof Symbol&&Symbol.iterator,O=E||"@@iterator",_=function(t){this.next=t};function V(t,e,i,n){var r=0===t?e:1===t?i:[e,i];return n?n.value=r:n={value:r,done:!1},n}function z(){return{value:void 0,done:!0}}function N(t){return!!Array.isArray(t)||!!Y(t)}function R(t){return t&&"function"==typeof t.next}function H(t){var e=Y(t);return e&&e.call(t)}function Y(t){var e=t&&(E&&t[E]||t["@@iterator"]);if("function"==typeof e)return e}_.prototype.toString=function(){return"[Iterator]"},_.KEYS=0,_.VALUES=1,_.ENTRIES=2,_.prototype.inspect=_.prototype.toSource=function(){return this.toString()},_.prototype[O]=function(){return this};var U=Object.prototype.hasOwnProperty;function G(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 X=function(t){function e(t){return null==t?$():L(t)?t.toSeq():function(t){var e,i,n=it(t);if(n)return(i=Y(e=t))&&i===e.entries?n.fromEntrySeq():function(t){var e=Y(t);return e&&e===t.keys}(t)?n.toSetSeq():n;if("object"==typeof t)return new q(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 n=i.length,r=0;r!==n;){var o=i[e?n-++r:r++];if(!1===t(o[1],o[0],this))break}return r}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var i=this._cache;if(i){var n=i.length,r=0;return new _((function(){if(r===n)return{value:void 0,done:!0};var o=i[e?n-++r:r++];return V(t,o[0],o[1])}))}return this.__iteratorUncached(t,e)},e}(w),W=function(t){function e(t){return null==t?$().toKeyedSeq():S(t)?m(t)?t.toSeq():t.fromEntrySeq():D(t)?t.toSeq():tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(X),j=function(t){function e(t){return null==t?$():S(t)?m(t)?t.entrySeq():t.toIndexedSeq():D(t)?t.toSeq().entrySeq():et(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}(X),K=function(t){function e(t){return(S(t)&&!k(t)?t:j(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(X);X.isSeq=T,X.Keyed=W,X.Set=K,X.Indexed=j,X.prototype[F]=!0;var Z=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[h(this,t)]:e},e.prototype.__iterate=function(t,e){for(var i=this._array,n=i.length,r=0;r!==n;){var o=e?n-++r:r++;if(!1===t(i[o],o,this))break}return r},e.prototype.__iterator=function(t,e){var i=this._array,n=i.length,r=0;return new _((function(){if(r===n)return{value:void 0,done:!0};var o=e?n-++r:r++;return V(t,o,i[o])}))},e}(j),q=function(t){function e(t){var e=Object.keys(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 U.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var i=this._object,n=this._keys,r=n.length,o=0;o!==r;){var s=n[e?r-++o:o++];if(!1===t(i[s],s,this))break}return o},e.prototype.__iterator=function(t,e){var i=this._object,n=this._keys,r=n.length,o=0;return new _((function(){if(o===r)return{value:void 0,done:!0};var s=n[e?r-++o:o++];return V(t,s,i[s])}))},e}(W);q.prototype[P]=!0;var Q,J=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=H(this._collection),n=0;if(R(i))for(var r;!(r=i.next()).done&&!1!==t(r.value,n++,this););return n},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var i=H(this._collection);if(!R(i))return new _(z);var n=0;return new _((function(){var e=i.next();return e.done?e:V(t,n++,e.value)}))},e}(j);function $(){return Q||(Q=new Z([]))}function tt(t){var e=it(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new q(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function et(t){var e=it(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function it(t){return G(t)?new Z(t):N(t)?new J(t):void 0}var nt="@@__IMMUTABLE_MAP__@@";function rt(t){return Boolean(t&&t[nt])}function ot(t){return rt(t)&&B(t)}function st(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function at(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!!(st(t)&&st(e)&&t.equals(e))}var lt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var i=65535&(t|=0),n=65535&(e|=0);return i*n+((t>>>16)*n+i*(e>>>16)<<16>>>0)|0};function ht(t){return t>>>1&1073741824|3221225471&t}var ut=Object.prototype.valueOf;function ct(t){if(null==t)return ft(t);if("function"==typeof t.hashCode)return ht(t.hashCode(t));var e,i,n,r=(e=t).valueOf!==ut&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return ft(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 ht(e)}(r);case"string":return r.length>kt?(void 0===(n=At[i=r])&&(n=pt(i),Mt===wt&&(Mt=0,At={}),Mt++,At[i]=n),n):pt(r);case"object":case"function":return function(t){var e;if(vt&&void 0!==(e=St.get(t)))return e;if(void 0!==(e=t[bt]))return e;if(!dt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[bt]))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=gt(),vt)St.set(t,e);else{if(void 0!==yt&&!1===yt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(dt)Object.defineProperty(t,bt,{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[bt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[bt]=e}}return e}(r);case"symbol":return function(t){var e=mt[t];return void 0!==e||(e=gt(),mt[t]=e),e}(r);default:if("function"==typeof r.toString)return pt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function ft(t){return null===t?1108378658:1108378659}function pt(t){for(var e=0,i=0;i=0&&(u.get=function(e,i){return(e=h(this,e))>=0&&ea)return{value:void 0,done:!0};var t=r.next();return n||1===e||t.done?t:V(e,l-1,0===e?void 0:t.value[1],t)}))},u}function Ot(t,e,i,n){var r=Xt(t);return r.__iterateUncached=function(r,o){var s=this;if(o)return this.cacheResult().__iterate(r,o);var a=!0,l=0;return t.__iterate((function(t,o,h){if(!a||!(a=e.call(i,t,o,h)))return l++,r(t,n?o:l-1,s)})),l},r.__iteratorUncached=function(r,o){var s=this;if(o)return this.cacheResult().__iterator(r,o);var a=t.__iterator(2,o),l=!0,h=0;return new _((function(){var t,o,u;do{if((t=a.next()).done)return n||1===r?t:V(r,h++,0===r?void 0:t.value[1],t);var c=t.value;o=c[0],u=c[1],l&&(l=e.call(i,u,o,s))}while(l);return 2===r?t:V(r,o,u,t)}))},r}function _t(t,e){var i=m(t),n=[t].concat(e).map((function(t){return S(t)?i&&(t=M(t)):t=i?tt(t):et(Array.isArray(t)?t:[t]),t})).filter((function(t){return 0!==t.size}));if(0===n.length)return t;if(1===n.length){var r=n[0];if(r===t||i&&m(r)||b(t)&&b(r))return r}var o=new Z(n);return i?o=o.toKeyedSeq():b(t)||(o=o.toSetSeq()),(o=o.flatten(!0)).size=n.reduce((function(t,e){if(void 0!==t){var i=e.size;if(void 0!==i)return t+i}}),0),o}function Vt(t,e,i){var n=Xt(t);return n.__iterateUncached=function(r,o){if(o)return this.cacheResult().__iterate(r,o);var s=0,a=!1;return function t(l,h){l.__iterate((function(o,l){return(!e||h0}function Ht(t,e,i,n){var r=Xt(t),o=new Z(i).map((function(t){return t.size}));return r.size=n?o.max():o.min(),r.__iterate=function(t,e){for(var i,n=this.__iterator(1,e),r=0;!(i=n.next()).done&&!1!==t(i.value,r++,this););return r},r.__iteratorUncached=function(t,r){var o=i.map((function(t){return t=w(t),H(r?t.reverse():t)})),s=0,a=!1;return new _((function(){var i;return a||(i=o.map((function(t){return t.next()})),a=n?i.every((function(t){return t.done})):i.some((function(t){return t.done}))),a?{value:void 0,done:!0}:V(t,s++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function Yt(t,e){return t===e?t:T(t)?e:t.constructor(e)}function Ut(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Gt(t){return m(t)?M:b(t)?A:I}function Xt(t){return Object.create((m(t)?W:b(t)?j:K).prototype)}function Wt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):X.prototype.cacheResult.call(this)}function jt(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 ve(this,e,t)}function ve(t,e,i){for(var n=[],r=0;r0;)e[i]=arguments[i+1];return Me(t,e)}function xe(t,e){for(var i=[],n=arguments.length-2;n-- >0;)i[n]=arguments[n+2];return Me(e,i,t)}function be(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return we(t,e)}function ke(t,e){for(var i=[],n=arguments.length-2;n-- >0;)i[n]=arguments[n+2];return we(e,i,t)}function we(t,e,i){return Me(t,e,function(t){return function e(i,n,r){return te(i)&&te(n)&&(o=n,s=X(i),a=X(o),b(s)===b(a)&&m(s)===m(a))?Me(i,[n],e):t?t(i,n,r):n;var o,s,a}}(i))}function Me(t,e,i){if(!te(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(L(t))return"function"==typeof i&&t.mergeWith?t.mergeWith.apply(t,[i].concat(e)):t.merge?t.merge.apply(t,e):t.concat.apply(t,e);for(var n=Array.isArray(t),r=t,o=n?A:M,s=n?function(e){r===t&&(r=re(r)),r.push(e)}:function(e,n){var o=U.call(r,n),s=o&&i?i(r[n],e,n):e;o&&s===r[n]||(r===t&&(r=re(r)),r[n]=s)},a=0;a0;)e[i]=arguments[i+1];return we(this,e,t)}function Fe(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return ae(this,t,Xe(),(function(t){return Me(t,e)}))}function Te(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return ae(this,t,Xe(),(function(t){return we(t,e)}))}function Ce(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function De(){return this.__ownerID?this:this.__ensureOwner(new a)}function Le(){return this.__ensureOwner()}function Pe(){return this.__altered}var Be=function(t){function e(e){return null==e?Xe():rt(e)&&!B(e)?e:Xe().withMutations((function(i){var n=t(e);qt(n.size),n.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 Xe().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 We(this,t,e)},e.prototype.remove=function(t){return We(this,t,o)},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):Xe()},e.prototype.sort=function(t){return Si(zt(this,t))},e.prototype.sortBy=function(t,e){return Si(zt(this,e,t))},e.prototype.map=function(t,e){var i=this;return this.withMutations((function(n){n.forEach((function(r,o){n.set(o,t.call(e,r,o,i))}))}))},e.prototype.__iterator=function(t,e){return new He(this,t,e)},e.prototype.__iterate=function(t,e){var i=this,n=0;return this._root&&this._root.iterate((function(e){return n++,t(e[1],e[0],i)}),e),n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ge(this.size,this._root,t,this.__hash):0===this.size?Xe():(this.__ownerID=t,this.__altered=!1,this)},e}(M);Be.isMap=rt;var Ee=Be.prototype;Ee[nt]=!0,Ee.delete=Ee.remove,Ee.removeAll=Ee.deleteAll,Ee.setIn=ue,Ee.removeIn=Ee.deleteIn=fe,Ee.update=ye,Ee.updateIn=de,Ee.merge=Ee.concat=ge,Ee.mergeWith=Se,Ee.mergeDeep=Ae,Ee.mergeDeepWith=Ie,Ee.mergeIn=Fe,Ee.mergeDeepIn=Te,Ee.withMutations=Ce,Ee.wasAltered=Pe,Ee.asImmutable=Le,Ee["@@transducer/init"]=Ee.asMutable=De,Ee["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ee["@@transducer/result"]=function(t){return t.asImmutable()};var Oe=function(t,e){this.ownerID=t,this.entries=e};Oe.prototype.get=function(t,e,i,n){for(var r=this.entries,o=0,s=r.length;o=Je)return function(t,e,i,n){t||(t=new a);for(var r=new Ne(t,ct(i),[i,n]),o=0;o>>t)&r),s=this.bitmap;return 0==(s&o)?n:this.nodes[qe(s&o-1)].get(t+5,e,i,n)},_e.prototype.update=function(t,e,i,s,a,l,h){void 0===i&&(i=ct(s));var u=(0===e?i:i>>>e)&r,c=1<=$e)return function(t,e,i,r,o){for(var s=0,a=new Array(n),l=0;0!==i;l++,i>>>=1)a[l]=1&i?e[s++]:void 0;return a[r]=o,new Ve(t,s+1,a)}(t,d,f,u,S);if(p&&!S&&2===d.length&&Ke(d[1^y]))return d[1^y];if(p&&S&&1===d.length&&Ke(S))return S;var v=t&&t===this.ownerID,m=p?S?f:f^c:f|c,x=p?S?Qe(d,y,S,v):function(t,e,i){var n=t.length-1;if(i&&e===n)return t.pop(),t;for(var r=new Array(n),o=0,s=0;s>>t)&r,s=this.nodes[o];return s?s.get(t+5,e,i,n):n},Ve.prototype.update=function(t,e,i,n,s,a,l){void 0===i&&(i=ct(n));var h=(0===e?i:i>>>e)&r,u=s===o,c=this.nodes,f=c[h];if(u&&!f)return this;var p=je(f,t,e+5,i,n,s,a,l);if(p===f)return this;var y=this.count;if(f){if(!p&&--y>>i)&r,l=(0===i?n:n>>>i)&r,h=a===l?[Ze(t,e,i+5,n,o)]:(s=new Ne(e,n,o),a>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function Qe(t,e,i,n){var r=n?t:Kt(t);return r[e]=i,r}var Je=8,$e=16,ti=8,ei="@@__IMMUTABLE_LIST__@@";function ii(t){return Boolean(t&&t[ei])}var ni=function(t){function e(e){var i=ui();if(null==e)return i;if(ii(e))return e;var r=t(e),o=r.size;return 0===o?i:(qt(o),o>0&&o=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?yi(t,e).set(0,i):yi(t,0,e+1).set(e,i)}));e+=t._origin;var n=t._tail,r=t._root,o={value:!1};return e>=di(t._capacity)?n=ci(n,t.__ownerID,0,e,i,o):r=ci(r,t.__ownerID,t._level,e,i,o),o.value?t.__ownerID?(t._root=r,t._tail=n,t.__hash=void 0,t.__altered=!0,t):hi(t._origin,t._capacity,t._level,r,n):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=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):ui()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){yi(i,0,e+t.length);for(var n=0;n>>e&r;if(n>=this.array.length)return new oi([],t);var o,s=0===n;if(e>0){var a=this.array[n];if((o=a&&a.removeBefore(t,e-5,i))===a&&s)return this}if(s&&!o)return this;var l=fi(this,t);if(!s)for(var h=0;h>>e&r;if(o>=this.array.length)return this;if(e>0){var s=this.array[o];if((n=s&&s.removeAfter(t,e-5,i))===s&&o===this.array.length-1)return this}var a=fi(this,t);return a.array.splice(o+1),n&&(a.array[o]=n),a};var si,ai={};function li(t,e){var i=t._origin,r=t._capacity,o=di(r),s=t._tail;return function t(a,l,h){return 0===l?function(t,a){var l=a===o?s&&s.array:t&&t.array,h=a>i?0:i-a,u=r-a;return u>n&&(u=n),function(){if(h===u)return ai;var t=e?--u:h++;return l&&l[t]}}(a,h):function(o,s,a){var l,h=o&&o.array,u=a>i?0:i-a>>s,c=1+(r-a>>s);return c>n&&(c=n),function(){for(;;){if(l){var i=l();if(i!==ai)return i;l=null}if(u===c)return ai;var n=e?--c:u++;l=t(h&&h[n],s-5,a+(n<>>i&r,u=t&&h0){var c=t&&t.array[h],f=ci(c,e,i-5,n,o,a);return f===c?t:((l=fi(t,e)).array[h]=f,l)}return u&&t.array[h]===o?t:(a&&s(a),l=fi(t,e),void 0===o&&h===l.array.length-1?l.array.pop():l.array[h]=o,l)}function fi(t,e){return e&&t&&e===t.ownerID?t:new oi(t?t.array.slice():[],e)}function pi(t,e){if(e>=di(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>n&r],n-=5;return i}}function yi(t,e,i){void 0!==e&&(e|=0),void 0!==i&&(i|=0);var n=t.__ownerID||new a,o=t._origin,s=t._capacity,l=o+e,h=void 0===i?s:i<0?s+i:o+i;if(l===o&&h===s)return t;if(l>=h)return t.clear();for(var u=t._level,c=t._root,f=0;l+f<0;)c=new oi(c&&c.array.length?[void 0,c]:[],n),f+=1<<(u+=5);f&&(l+=f,o+=f,h+=f,s+=f);for(var p=di(s),y=di(h);y>=1<p?new oi([],n):d;if(d&&y>p&&l5;v-=5){var m=p>>>v&r;S=S.array[m]=fi(S.array[m],n)}S.array[p>>>5&r]=d}if(h=y)l-=y,h-=y,u=5,c=null,g=g&&g.removeBefore(n,0,l);else if(l>o||y>>u&r;if(x!==y>>>u&r)break;x&&(f+=(1<o&&(c=c.removeBefore(n,u,l-f)),c&&y>>5<<5}var gi,Si=function(t){function e(t){return null==t?mi():ot(t)?t:mi().withMutations((function(e){var i=M(t);qt(i.size),i.forEach((function(t,i){return e.set(i,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("OrderedMap {","}")},e.prototype.get=function(t,e){var i=this._map.get(t);return void 0!==i?this._list.get(i)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):mi()},e.prototype.set=function(t,e){return xi(this,t,e)},e.prototype.remove=function(t){return xi(this,t,o)},e.prototype.__iterate=function(t,e){var i=this;return this._list.__iterate((function(e){return e&&t(e[1],e[0],i)}),e)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),i=this._list.__ensureOwner(t);return t?vi(e,i,t,this.__hash):0===this.size?mi():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=i,this)},e}(Be);function vi(t,e,i,n){var r=Object.create(Si.prototype);return r.size=t?t.size:0,r._map=t,r._list=e,r.__ownerID=i,r.__hash=n,r.__altered=!1,r}function mi(){return gi||(gi=vi(Xe(),ui()))}function xi(t,e,i){var r,s,a=t._map,l=t._list,h=a.get(e),u=void 0!==h;if(i===o){if(!u)return t;l.size>=n&&l.size>=2*a.size?(r=(s=l.filter((function(t,e){return void 0!==t&&h!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(r.__ownerID=s.__ownerID=t.__ownerID)):(r=a.remove(e),s=h===l.size-1?l.pop():l.set(h,void 0))}else if(u){if(i===l.get(h)[1])return t;r=a,s=l.set(h,[e,i])}else r=a.set(e,l.size),s=l.set(l.size,[e,i]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=s,t.__hash=void 0,t.__altered=!0,t):vi(r,s)}Si.isOrderedMap=ot,Si.prototype[P]=!0,Si.prototype.delete=Si.prototype.remove;var bi="@@__IMMUTABLE_STACK__@@";function ki(t){return Boolean(t&&t[bi])}var wi=function(t){function e(t){return null==t?Fi():ki(t)?t:Fi().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=h(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,n=arguments.length-1;n>=0;n--)i={value:t[n],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;qt(e.size);var i=this.size,n=this._head;return e.__iterate((function(t){i++,n={value:t,next:n}}),!0),this.__ownerID?(this.size=i,this._head=n,this.__hash=void 0,this.__altered=!0,this):Ii(i,n)},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):Fi()},e.prototype.slice=function(e,i){if(c(e,i,this.size))return this;var n=f(e,this.size);if(p(i,this.size)!==this.size)return t.prototype.slice.call(this,e,i);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):Ii(r,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ii(this.size,this._head,t,this.__hash):0===this.size?Fi():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var i=this;if(e)return new Z(this.toArray()).__iterate((function(e,n){return t(e,n,i)}),e);for(var n=0,r=this._head;r&&!1!==t(r.value,n++,this);)r=r.next;return n},e.prototype.__iterator=function(t,e){if(e)return new Z(this.toArray()).__iterator(t,e);var i=0,n=this._head;return new _((function(){if(n){var e=n.value;return n=n.next,V(t,i++,e)}return{value:void 0,done:!0}}))},e}(A);wi.isStack=ki;var Mi,Ai=wi.prototype;function Ii(t,e,i,n){var r=Object.create(Ai);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=n,r.__altered=!1,r}function Fi(){return Mi||(Mi=Ii(0))}Ai[bi]=!0,Ai.shift=Ai.pop,Ai.unshift=Ai.push,Ai.unshiftAll=Ai.pushAll,Ai.withMutations=Ce,Ai.wasAltered=Pe,Ai.asImmutable=Le,Ai["@@transducer/init"]=Ai.asMutable=De,Ai["@@transducer/step"]=function(t,e){return t.unshift(e)},Ai["@@transducer/result"]=function(t){return t.asImmutable()};var Ti="@@__IMMUTABLE_SET__@@";function Ci(t){return Boolean(t&&t[Ti])}function Di(t){return Ci(t)&&B(t)}function Li(t,e){if(t===e)return!0;if(!S(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||m(t)!==m(e)||b(t)!==b(e)||B(t)!==B(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!k(t);if(B(t)){var n=t.entries();return e.every((function(t,e){var r=n.next().value;return r&&at(r[1],t)&&(i||at(r[0],e))}))&&n.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 s=t;t=e,e=s}var a=!0,l=e.__iterate((function(e,n){if(i?!t.has(e):r?!at(e,t.get(n,o)):!at(t.get(n,o),e))return a=!1,!1}));return a&&t.size===l}function Pi(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 Bi(t){if(!t||"object"!=typeof t)return t;if(!S(t)){if(!te(t))return t;t=X(t)}if(m(t)){var e={};return t.__iterate((function(t,i){e[i]=Bi(t)})),e}var i=[];return t.__iterate((function(t){i.push(Bi(t))})),i}var Ei=function(t){function e(e){return null==e?Ni():Ci(e)&&!B(e)?e:Ni().withMutations((function(i){var n=t(e);qt(n.size),n.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(M(t).keySeq())},e.intersect=function(t){return(t=w(t).toArray()).length?_i.intersect.apply(e(t.pop()),t):Ni()},e.union=function(t){return(t=w(t).toArray()).length?_i.union.apply(e(t.pop()),t):Ni()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Vi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Vi(this,this._map.remove(t))},e.prototype.clear=function(){return Vi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,n=!1,r=Vi(this,this._map.mapEntries((function(r){var o=r[1],s=t.call(e,o,o,i);return s!==o&&(n=!0),[s,s]}),e));return n?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 n=0;n=0&&e=0&&i>>-15,461845907),e=lt(e<<13|e>>>-13,5),e=lt((e=(e+3864292196|0)^t)^e>>>16,2246822507),ht((e=lt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){n=31*n+rn(ct(t),ct(e))|0}:function(t,e){n=n+rn(ct(t),ct(e))|0}:e?function(t){n=31*n+ct(t)|0}:function(t){n=n+ct(t)|0}),n)}(this))}});var Wi=w.prototype;Wi[g]=!0,Wi[O]=Wi.values,Wi.toJSON=Wi.toArray,Wi.__toStringMapper=ee,Wi.inspect=Wi.toSource=function(){return this.toString()},Wi.chain=Wi.flatMap,Wi.contains=Wi.includes,Pi(M,{flip:function(){return Yt(this,Dt(this))},mapEntries:function(t,e){var i=this,n=0;return Yt(this,this.toSeq().map((function(r,o){return t.call(e,[o,r],n++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return Yt(this,this.toSeq().flip().map((function(n,r){return t.call(e,n,r,i)})).flip())}});var ji=M.prototype;ji[v]=!0,ji[O]=Wi.entries,ji.toJSON=Xi,ji.__toStringMapper=function(t,e){return ee(e)+": "+ee(t)},Pi(A,{toKeyedSeq:function(){return new It(this,!1)},filter:function(t,e){return Yt(this,Bt(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 Yt(this,Pt(this,!1))},slice:function(t,e){return Yt(this,Et(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=f(t,t<0?this.count():this.size);var n=this.slice(0,t);return Yt(this,1===i?n:n.concat(Kt(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 Yt(this,Vt(this,t,!1))},get:function(t,e){return(t=h(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=h(this,t))>=0&&(void 0!==this.size?this.size===1/0||te?-1:0}function rn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}Zi.has=Wi.includes,Zi.contains=Zi.includes,Zi.keys=Zi.values,Pi(W,ji),Pi(j,Ki),Pi(K,Zi);var on=function(t){function e(t){return null==t?hn():Di(t)?t:hn().withMutations((function(e){var i=I(t);qt(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(M(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Ei);on.isOrderedSet=Di;var sn,an=on.prototype;function ln(t,e){var i=Object.create(an);return i.size=t?t.size:0,i._map=t,i.__ownerID=e,i}function hn(){return sn||(sn=ln(mi()))}an[P]=!0,an.zip=Ki.zip,an.zipWith=Ki.zipWith,an.zipAll=Ki.zipAll,an.__empty=hn,an.__make=ln;var un=function(t,e){var i;!function(t){if(D(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(L(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var n=function(o){var s=this;if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!i){i=!0;var a=Object.keys(t),l=r._indices={};r._name=e,r._keys=a,r._defaultValues=t;for(var h=0;h2?[]:void 0,{"":t})}function mn(t,e,i,n,r,o){if("string"!=typeof i&&!L(i)&&(G(i)||N(i)||$t(i))){if(~t.indexOf(i))throw new TypeError("Cannot convert circular structure to Immutable");t.push(i),r&&""!==n&&r.push(n);var s=e.call(o,n,X(i).map((function(n,o){return mn(t,e,n,o,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),s}return i}function xn(t,e){return b(e)?e.toList():m(e)?e.toMap():e.toSet()}var bn="4.0.0",kn=w;const wn={version:bn,Collection:w,Iterable:w,Seq:X,Map:Be,OrderedMap:Si,List:ni,Stack:wi,Set:Ei,OrderedSet:on,Record:un,Range:Hi,Repeat:Sn,is:at,fromJS:vn,hash:ct,isImmutable:L,isCollection:S,isKeyed:m,isIndexed:b,isAssociative:k,isOrdered:B,isValueObject:st,isPlainObject:$t,isSeq:T,isList:ii,isMap:rt,isOrderedMap:ot,isStack:ki,isSet:Ci,isOrderedSet:Di,isRecord:D,get:ne,getIn:Yi,has:ie,hasIn:Gi,merge:me,mergeDeep:be,mergeWith:xe,mergeDeepWith:ke,remove:oe,removeIn:ce,set:se,setIn:he,update:pe,updateIn:ae}}}]); \ No newline at end of file diff --git a/js/vendor.ba735447f654cc2bc66a.bundle.js b/js/vendor.ba735447f654cc2bc66a.bundle.js new file mode 100644 index 0000000..07c70ae --- /dev/null +++ b/js/vendor.ba735447f654cc2bc66a.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see vendor.ba735447f654cc2bc66a.bundle.js.LICENSE.txt */ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[736],{102:(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{i.r(e),i.d(e,{DataGenerator:()=>l,DataHost:()=>a,Stream:()=>h,createDeltaFunctionGenerator:()=>v,createOHLCGenerator:()=>x,createParametricFunctionGenerator:()=>T,createProgressiveFunctionGenerator:()=>g,createProgressiveRandomGenerator:()=>u,createProgressiveTraceGenerator:()=>d,createSampledDataGenerator:()=>w,createSpectrumDataGenerator:()=>k,createTraceGenerator:()=>p,createWaterDropDataGenerator:()=>P,createWhiteNoiseGenerator:()=>M});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)e.hasOwnProperty(i)&&(t[i]=e[i])},s(t,e)};function r(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var n=function(){return n=Object.assign||function(t){for(var e,i=1,s=arguments.length;i0||-1===this.batchesLeft)&&i.length>0&&(this.data=this.data.concat(i.map((function(e){return t.infiniteReset(e)}))),i.length0||-1===this.batchesLeft||-2===this.batchesLeft&&this.data.length>0;return this.continueHandler&&(t=!0===this.continueHandler()),t},t.prototype.runStream=function(){var t=this.checkStreamContinue();if(this.data&&this.data.length>0&&t){if(this.streamHandler){var e=this.consume();this.streamHandler(e)}setTimeout(this.runStream,this.interval)}else this.streamActive=!1;this.batchesLeft>0&&this.batchesLeft--},t.prototype.activateStream=function(){this.streamActive||(this.streamActive=!0,this.runStream())},t.prototype.push=function(t){Array.isArray(t)?this.data=this.data.concat(t):this.data.push(t),this.activateStream()},t.prototype.map=function(e){return this.outputStream=new t(n(n({},this.options),{repeat:!1}),this.infiniteReset),this.mapHandler=e,this.streamHandler=this._map,this.activateStream(),this.outputStream},t.prototype._map=function(t){if(this.mapHandler&&this.outputStream){var e=t.map(this.mapHandler);this.outputStream.push(e)}},t.prototype.forEach=function(t){this.forEachHandler=t,this.streamHandler=this._forEach,this.activateStream()},t.prototype._forEach=function(t){this.forEachHandler&&t.forEach(this.forEachHandler)},t}(),a=function(){function t(t,e){this.data=[],this.derivativeDataHosts=[],this.promisesToResolve=[],this.streamsToPush=[],this.infiniteReset=this.infiniteReset.bind(this),this.infiniteResetHandler=t;var i={interval:e.interval,batchSize:e.batchSize,repeat:void 0!==e.repeat&&e.repeat};this.streamOptions=Object.freeze(i)}return t.prototype.toStream=function(){var t=new h(this.streamOptions,this.infiniteReset);return this.frozenData?t.push(this.frozenData):this.streamsToPush.push(t),t},t.prototype.toPromise=function(){var t=this;return this.frozenData?Promise.resolve(this.frozenData):new Promise((function(e){t.promisesToResolve.push(e)}))},t.prototype.infiniteReset=function(t){return this.infiniteResetHandler(t,this.frozenData?this.frozenData:[])},t.prototype.push=function(t){var e,i;if(!this.frozenData)if(Array.isArray(t))try{for(var s=function(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.")}(t),r=s.next();!r.done;r=s.next()){var n=r.value;this.data.push(n)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}else this.data.push(t)},t.prototype.setData=function(t){this.data=t},t.prototype.freeze=function(){var t=this;this.frozenData||(this.frozenData=this.data,setTimeout((function(){t.promisesToResolve.forEach((function(e){return e(t.frozenData)})),t.promisesToResolve=[]}),0),setTimeout((function(){t.streamsToPush.forEach((function(e){return e.push(t.frozenData||[])})),t.streamsToPush=[]}),0),setTimeout((function(){t.handleDerivativeDataHosts()}),0),this.data=[])},t.prototype.getPointCount=function(){return this.frozenData?this.frozenData.length:0},t.prototype.handleDerivativeDataHosts=function(){var t=this;this.frozenData&&this.derivativeDataHosts.length>0&&(this.derivativeDataHosts.forEach((function(e){t.frozenData&&e.setData(t.frozenData),e.freeze()})),this.derivativeDataHosts=[])},t.prototype.setStreamInterval=function(e){var i=new t(this.infiniteResetHandler,n(n({},this.streamOptions),{interval:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t.prototype.setStreamBatchSize=function(e){var i=new t(this.infiniteResetHandler,n(n({},this.streamOptions),{batchSize:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t.prototype.setStreamRepeat=function(e){var i=new t(this.infiniteResetHandler,n(n({},this.streamOptions),{repeat:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t}();if("undefined"!=typeof window&&window.performance&&window.performance.now)o=window.performance.now.bind(window.performance);else try{o=Object(function(){var t=new Error("Cannot find module 'perf_hooks'");throw t.code="MODULE_NOT_FOUND",t}())}catch(t){throw new Error('Failed to detect "performance.now" API')}var l=function(){function t(t){this.options=t}return t.prototype.generate=function(){var t=new a(this.infiniteReset,{interval:500,batchSize:10,repeat:!1}),e=this.getPointCount(),i=this.generateChunks.bind(this,0,e,t);return setTimeout(i,0),t},t.prototype.generateChunks=function(t,e,i){for(var s=o(),r=[],n=0;o()-s<15&&t.5?this.offset+e:this.offset-e}return this.offset+this.options.dataMax>1?this.offset=1-this.options.dataMax:this.offset<0&&(this.offset=0),{x:t,y:this.offset+Math.random()*this.options.dataMax}},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(l);function d(){return new f({numberOfPoints:1e3})}var f=function(t){function e(e){var i=t.call(this,e)||this;i.previousPoint={x:0,y:0};var s={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e={x:t,y:this.previousPoint.y+2*(Math.random()-.5)};return this.previousPoint=e,e},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(l);function g(){return new m({samplingFunction:function(t){return t*t},start:0,end:100,step:1})}var m=function(t){function e(e){var i=t.call(this,e)||this;i.x=i.options.start;var s={samplingFunction:e.samplingFunction,start:e.start,end:e.end,step:e.step};return i.options=Object.freeze(s),i.numberOfPoints=Math.ceil(Math.abs(s.end-s.start)/s.step),i}return r(e,t),e.prototype.setSamplingFunction=function(t){return new e(n(n({},this.options),{samplingFunction:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setEnd=function(t){return new e(n(n({},this.options),{end:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.x,y:this.options.samplingFunction(this.x)};return this.x=this.x+this.options.step,t},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length*(e[e.length-1].x-e[e.length-2].x),y:t.y}},e}(l);function p(){return new y({numberOfPoints:1e3})}var y=function(t){function e(e){var i=t.call(this,e)||this;i.previous={x:0,y:0};var s={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.previous.x+2*(Math.random()-.5),y:this.previous.y+2*(Math.random()-.5)};return this.previous=t,t},e.prototype.infiniteReset=function(t,e){return{x:t.x+e[e.length-1].x,y:t.y+e[e.length-1].y}},e}(l);function x(){return new S({numberOfPoints:1e3,startTimestamp:0,dataFreq:1,start:100,volatility:.1})}var S=function(t){function e(e){var i=t.call(this,e)||this;return i.prevPoint=[i.options.startTimestamp,i.options.start,i.options.start,i.options.start,i.options.start],i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.setStartTimestamp=function(t){return new e(n(n({},this.options),{startTimestamp:t}))},e.prototype.setDataFrequency=function(t){return new e(n(n({},this.options),{dataFreq:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setVolatility=function(t){return new e(n(n({},this.options),{volatility:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e,i=this,s=this.options.startTimestamp+this.options.dataFreq*t,r=Math.random()>.5?1:-1,n=Array.from(Array(4)).map((function(t){var e=Math.random()*i.options.volatility*r;return i.prevPoint[4]+e<0&&(e*=-1),i.prevPoint[4]+e})).sort((function(t,e){return t-e}));return-1===r&&(n=[n[0],n[2],n[1],n[3]]),e=[s,n[1],n[3],n[0],n[2]],this.prevPoint=e,e},e.prototype.infiniteReset=function(t,e){return[t[0]+e.length*(e[e.length-1][0]-e[e.length-2][0]),t[1],t[2],t[3],t[4]]},e}(l);function v(){return new b({numberOfPoints:1e3,minGap:1,maxGap:-1,minAmplitude:.1,maxAmplitude:1,probability:.02})}var b=function(t){function e(e){var i=t.call(this,e)||this;i.lastSpike=0;var s={numberOfPoints:e.numberOfPoints,minGap:e.minGap,maxGap:e.maxGap,minAmplitude:e.minAmplitude,maxAmplitude:e.maxAmplitude,probability:e.probability};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.setMinGap=function(t){return new e(n(n({},this.options),{minGap:t}))},e.prototype.setMaxGap=function(t){return new e(n(n({},this.options),{maxGap:t}))},e.prototype.setMinAmplitude=function(t){return new e(n(n({},this.options),{minAmplitude:t}))},e.prototype.setMaxAmplitude=function(t){return new e(n(n({},this.options),{maxAmplitude:t}))},e.prototype.setProbability=function(t){return new e(n(n({},this.options),{probability:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e=t-this.lastSpike,i={x:t,y:0};return(e>this.options.minGap||-1===this.options.minGap)&&(e1-this.options.probability&&(i.y=Math.random()*(this.options.maxAmplitude-this.options.minAmplitude)+this.options.minAmplitude,this.lastSpike=t):e>=this.options.maxGap&&(i.y=Math.random()*(this.options.maxAmplitude-this.options.minAmplitude)+this.options.minAmplitude,this.lastSpike=t)),i},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(l);function M(){return new A({numberOfPoints:1e3})}var A=function(t){function e(e){var i=t.call(this,e)||this,s={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(this.options?n(n({},this.options),{numberOfPoints:t}):{numberOfPoints:t})},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){return{x:t,y:2*(Math.random()-.5)}},e.prototype.infiniteReset=function(t,e){return{x:t.x+e[e.length-1].x,y:t.y+e[e.length-1].y}},e}(l);function w(){return new D({inputData:[],samplingFrequency:50,step:0})}var D=function(t){function e(e){var i=t.call(this,e)||this;i.interval=1/(i.options.samplingFrequency||10);var s={inputData:e.inputData,samplingFrequency:e.samplingFrequency,step:e.step};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setInputData=function(t){return new e(n(n({},this.options),{inputData:t}))},e.prototype.setSamplingFrequency=function(t){return new e(n(n({},this.options),{samplingFrequency:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.options.inputData.length},e.prototype.generateDataPoint=function(t){return{timestamp:t*this.interval+t*this.options.step,data:this.options.inputData[t]}},e.prototype.infiniteReset=function(t,e){return{timestamp:t.timestamp+e[e.length-1].timestamp,data:t.data}},e}(l);function T(){return new E({xFunction:function(t){return 3*Math.cos(3*t)},yFunction:function(t){return 3*Math.sin(4*t)},start:0,end:1e3,step:.5})}var E=function(t){function e(e){var i=t.call(this,e)||this;i.t=i.options.start;var s={xFunction:e.xFunction,yFunction:e.yFunction,start:e.start,end:e.end,step:e.step};return i.options=Object.freeze(s),i.numberOfPoints=Math.ceil(Math.abs(s.end-s.start)/s.step),i}return r(e,t),e.prototype.setXFunction=function(t){return new e(n(n({},this.options),{xFunction:t}))},e.prototype.setYFunction=function(t){return new e(n(n({},this.options),{yFunction:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setEnd=function(t){return new e(n(n({},this.options),{end:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.options.xFunction(this.t),y:this.options.yFunction(this.t)};return this.t=this.t+this.options.step,t},e.prototype.infiniteReset=function(t,e){return{x:t.x,y:t.y}},e}(l),B={numberOfSamples:1e3,sampleSize:10,variation:10,frequencyStability:1,narrowFactor1:8,narrowFactor2:24};function k(){return new I(B)}var I=function(t){function e(e){var i=t.call(this,e)||this,s={sampleSize:void 0!==e.sampleSize?e.sampleSize:B.sampleSize,numberOfSamples:void 0!==e.numberOfSamples?e.numberOfSamples:B.numberOfSamples,variation:void 0!==e.variation?e.variation:B.variation,frequencyStability:void 0!==e.frequencyStability?e.frequencyStability:B.frequencyStability,narrowFactor1:void 0!==e.narrowFactor1?e.narrowFactor1:B.narrowFactor1,narrowFactor2:void 0!==e.narrowFactor2?e.narrowFactor2:B.narrowFactor2};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfSamples=function(t){return new e(n(n({},this.options),{numberOfSamples:t}))},e.prototype.setSampleSize=function(t){return new e(n(n({},this.options),{sampleSize:t}))},e.prototype.setVariation=function(t){return new e(n(n({},this.options),{variation:t}))},e.prototype.setFrequencyStability=function(t){return new e(n(n({},this.options),{frequencyStability:t}))},e.prototype.setNarrowFactor1=function(t){return new e(n(n({},this.options),{narrowFactor1:t}))},e.prototype.setNarrowFactor2=function(t){return new e(n(n({},this.options),{narrowFactor2:t}))},e.prototype.getPointCount=function(){return this.options.numberOfSamples},e.prototype.generateDataPoint=function(t){for(var e=100,i=this.options.variation,s=this.options.sampleSize,r=this.options.frequencyStability,n=s/8,o=s/2,h=new Array(s),a=0;as&&(n=s),(o+=(Math.random()-.5)*i/r/100*s)<0&&(o=0),o>s&&(o=s);var g,m=e/3*2,p=m/(f*f)*this.options.narrowFactor1,y=50/(f*f)*this.options.narrowFactor2;for(a=0;ae&&(l=e),(u=50-(d=.8*a-o)*d*y)<0&&(u=0),u>e&&(u=e),g=l+u,g+=g*(Math.random()-.5)*i/10,h[a]=(h[a]+g)/2,h[a]<0&&(h[a]=0),h[a]>e&&(h[a]=e),h[a]=.02*h[a];return h},e.prototype.infiniteReset=function(t,e){return t.slice()},e}(l),C={rows:10,columns:10,rowPositionsNormalized:[.2,.5,.7],columnPositionsNormalized:[.6,.5,.3],amplitudes:[15,50,3],offsetLevel:47,volatility:25};function P(){return new L(C)}var L=function(){function t(t){var e={rows:void 0!==t.rows?t.rows:C.rows,columns:void 0!==t.columns?t.columns:C.columns,rowPositionsNormalized:void 0!==t.rowPositionsNormalized?t.rowPositionsNormalized:C.rowPositionsNormalized,columnPositionsNormalized:void 0!==t.columnPositionsNormalized?t.columnPositionsNormalized:C.columnPositionsNormalized,amplitudes:void 0!==t.amplitudes?t.amplitudes:C.amplitudes,offsetLevel:void 0!==t.offsetLevel?t.offsetLevel:C.offsetLevel,volatility:void 0!==t.volatility?t.volatility:C.volatility};this.options=Object.freeze(e)}return t.prototype.setRows=function(e){return new t(n(n({},this.options),{rows:e}))},t.prototype.setColumns=function(e){return new t(n(n({},this.options),{columns:e}))},t.prototype.setWaterDrops=function(e){var i=e.map((function(t){return t.rowNormalized})),s=e.map((function(t){return t.columnNormalized})),r=e.map((function(t){return t.amplitude}));return new t(n(n({},this.options),{rowPositionsNormalized:i,columnPositionsNormalized:s,amplitudes:r}))},t.prototype.setOffsetLevel=function(e){return new t(n(n({},this.options),{offsetLevel:e}))},t.prototype.setVolatility=function(e){return new t(n(n({},this.options),{volatility:e}))},t.prototype.generate=function(){var t=this;return new Promise((function(e){return i=t,s=void 0,n=function(){var t,i,s,r,n,o,h,a,l,u,c,d,f,g,m,p,y,x,S;return function(t,e){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:h(0),throw:h(1),return:h(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function h(n){return function(h){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]0&&m%1e3==0&&Date.now()-g>=15?[4,new Promise((function(t){return setTimeout(t,0)}))]:[3,4]):[3,5];case 3:v.sent(),g=Date.now(),v.label=4;case 4:return x++,S+=d,[3,2];case 5:return p++,y+=f,[3,1];case 6:return e(c),[2]}}))},new((r=void 0)||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function h(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(o,h)}a((n=n.apply(i,s||[])).next())}));var i,s,r,n}))},t}()},187:t=>{function e(t,e,s){s=s||2;var n,o,h,a,c,d,g,m=e&&e.length,p=m?e[0]*s:t.length,y=i(t,0,p,s,!0),x=[];if(!y||y.next===y.prev)return x;if(m&&(y=function(t,e,s,r){var n,o,h,a=[];for(n=0,o=e.length;n80*s){n=h=t[0],o=a=t[1];for(var S=s;Sh&&(h=c),d>a&&(a=d);g=0!==(g=Math.max(h-n,a-o))?32767/g:0}return r(y,x,s,n,o,g,0),x}function i(t,e,i,s,r){var n,o;if(r===T(t,e,i,s)>0)for(n=e;n=e;n-=s)o=A(n,t[n],t[n+1],o);return o&&y(o,o.next)&&(w(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!y(s,s.next)&&0!==p(s.prev,s,s.next))s=s.next;else{if(w(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function r(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var r=t;do{0===r.z&&(r.z=d(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,s,r,n,o,h,a,l=1;do{for(i=t,t=null,n=null,o=0;i;){for(o++,s=i,h=0,e=0;e0||a>0&&s;)0!==h&&(0===a||!s||i.z<=s.z)?(r=i,i=i.nextZ,h--):(r=s,s=s.nextZ,a--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(o>1)}(r)}(t,l,u,c);for(var g,m,p=t;t.prev!==t.next;)if(g=t.prev,m=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),w(t),t=m.next,p=m.next;else if((t=m)===p){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(p(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,o=s.x,h=e.y,a=i.y,l=s.y,u=rn?r>o?r:o:n>o?n:o,f=h>a?h>l?h:l:a>l?a:l,m=s.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=f&&g(r,h,n,a,o,l,m.x,m.y)&&p(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(p(r,n,o)>=0)return!1;for(var h=r.x,a=n.x,l=o.x,u=r.y,c=n.y,f=o.y,m=ha?h>l?h:l:a>l?a:l,S=u>c?u>f?u:f:c>f?c:f,v=d(m,y,e,i,s),b=d(x,S,e,i,s),M=t.prevZ,A=t.nextZ;M&&M.z>=v&&A&&A.z<=b;){if(M.x>=m&&M.x<=x&&M.y>=y&&M.y<=S&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&p(M.prev,M,M.next)>=0)return!1;if(M=M.prevZ,A.x>=m&&A.x<=x&&A.y>=y&&A.y<=S&&A!==r&&A!==o&&g(h,u,a,c,l,f,A.x,A.y)&&p(A.prev,A,A.next)>=0)return!1;A=A.nextZ}for(;M&&M.z>=v;){if(M.x>=m&&M.x<=x&&M.y>=y&&M.y<=S&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&p(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;A&&A.z<=b;){if(A.x>=m&&A.x<=x&&A.y>=y&&A.y<=S&&A!==r&&A!==o&&g(h,u,a,c,l,f,A.x,A.y)&&p(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;!y(n,o)&&x(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),w(r),w(r.next),r=t=o),r=r.next}while(r!==t);return s(r)}function a(t,e,i,n,o,h){var a=t;do{for(var l=a.next.next;l!==a.prev;){if(a.i!==l.i&&m(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 p(t.prev,t,e.prev)<0&&p(e.next,t,t.next)<0}function d(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(n-h)&&(t-o)*(s-h)>=(i-o)*(e-h)&&(i-o)*(n-h)>=(r-o)*(s-h)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(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)&&(p(t.prev,t,e.prev)||p(t,e.prev,e))||y(t,e)&&p(t.prev,t,t.next)>0&&p(e.prev,e,e.next)>0)}function p(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,s){var r=v(p(t,e,i)),n=v(p(t,e,s)),o=v(p(i,s,t)),h=v(p(i,s,e));return r!==n&&o!==h||!(0!==r||!S(t,i,e))||!(0!==n||!S(t,s,e))||!(0!==o||!S(i,t,s))||!(0!==h||!S(i,e,s))}function S(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function v(t){return t>0?1:t<0?-1:0}function b(t,e){return p(t.prev,t,t.next)<0?p(t,e,t.next)>=0&&p(t,t.prev,e)>=0:p(t,e,t.prev)<0||p(t,t.next,e)<0}function M(t,e){var i=new D(t.i,t.x,t.y),s=new D(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 D(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function w(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function D(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(t,e,i,s){for(var r=0,n=e,o=i-s;n0&&(s+=t[r-1].length,i.holes.push(s))}return i}},369:(t,e,i)=>{i.r(e),i.d(e,{Collection:()=>D,Iterable:()=>Ts,List:()=>ai,Map:()=>ze,OrderedMap:()=>Mi,OrderedSet:()=>ls,Range:()=>qi,Record:()=>gs,Repeat:()=>bs,Seq:()=>K,Set:()=>Vi,Stack:()=>Bi,default:()=>Es,fromJS:()=>Ms,get:()=>ae,getIn:()=>Xi,has:()=>he,hasIn:()=>ji,hash:()=>yt,is:()=>ft,isAssociative:()=>w,isCollection:()=>S,isImmutable:()=>L,isIndexed:()=>A,isKeyed:()=>b,isList:()=>hi,isMap:()=>ut,isOrdered:()=>F,isOrderedMap:()=>ct,isOrderedSet:()=>Fi,isPlainObject:()=>re,isRecord:()=>P,isSeq:()=>I,isSet:()=>Ri,isStack:()=>Ei,isValueObject:()=>dt,merge:()=>we,mergeDeep:()=>Te,mergeDeepWith:()=>Ee,mergeWith:()=>De,remove:()=>ue,removeIn:()=>pe,set:()=>ce,setIn:()=>ge,update:()=>xe,updateIn:()=>de,version:()=>Ds});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&&!y(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function g(t,e){return p(t,e,0)}function m(t,e){return p(t,e,e)}function p(t,e,i){return void 0===t?i:y(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function y(t){return t<0||0===t&&1/t==-1/0}var x="@@__IMMUTABLE_ITERABLE__@@";function S(t){return Boolean(t&&t[x])}var v="@@__IMMUTABLE_KEYED__@@";function b(t){return Boolean(t&&t[v])}var M="@@__IMMUTABLE_INDEXED__@@";function A(t){return Boolean(t&&t[M])}function w(t){return b(t)||A(t)}var D=function(t){return S(t)?t:K(t)},T=function(t){function e(t){return b(t)?t:J(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(D),E=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}(D),B=function(t){function e(t){return S(t)&&!w(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(D);D.Keyed=T,D.Indexed=E,D.Set=B;var k="@@__IMMUTABLE_SEQ__@@";function I(t){return Boolean(t&&t[k])}var C="@@__IMMUTABLE_RECORD__@@";function P(t){return Boolean(t&&t[C])}function L(t){return S(t)||P(t)}var R="@@__IMMUTABLE_ORDERED__@@";function F(t){return Boolean(t&&t[R])}var _=0,O=1,z=2,V="function"==typeof Symbol&&Symbol.iterator,N="@@iterator",G=V||N,U=function(t){this.next=t};function H(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 Y(t){return!!Array.isArray(t)||!!$(t)}function q(t){return t&&"function"==typeof t.next}function X(t){var e=$(t);return e&&e.call(t)}function $(t){var e=t&&(V&&t[V]||t[N]);if("function"==typeof e)return e}U.prototype.toString=function(){return"[Iterator]"},U.KEYS=_,U.VALUES=O,U.ENTRIES=z,U.prototype.inspect=U.prototype.toSource=function(){return this.toString()},U.prototype[G]=function(){return this};var j=Object.prototype.hasOwnProperty;function Z(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():L(t)?t.toSeq():function(t){var e,i,s=at(t);if(s)return(i=$(e=t))&&i===e.entries?s.fromEntrySeq():function(t){var e=$(t);return e&&e===t.keys}(t)?s.toSetSeq():s;if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var i=this._cache;if(i){for(var s=i.length,r=0;r!==s;){var n=i[e?s-++r:r++];if(!1===t(n[1],n[0],this))break}return r}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var i=this._cache;if(i){var s=i.length,r=0;return new U((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return H(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(D),J=function(t){function e(t){return null==t?nt().toKeyedSeq():S(t)?b(t)?t.toSeq():t.fromEntrySeq():P(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():S(t)?b(t)?t.entrySeq():t.toIndexedSeq():P(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(S(t)&&!w(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=I,K.Keyed=J,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 U((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return H(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 j.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 U((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return H(t,o,i[o])}))},e}(J);it.prototype[R]=!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=X(this._collection),s=0;if(q(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=X(this._collection);if(!q(i))return new U(W);var s=0;return new U((function(){var e=i.next();return e.done?e:H(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 Z(t)?new et(t):Y(t)?new rt(t):void 0}var lt="@@__IMMUTABLE_MAP__@@";function ut(t){return Boolean(t&&t[lt])}function ct(t){return ut(t)&&F(t)}function dt(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function ft(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(dt(t)&&dt(e)&&t.equals(e))}var gt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var i=65535&(t|=0),s=65535&(e|=0);return i*s+((t>>>16)*s+i*(e>>>16)<<16>>>0)|0};function mt(t){return t>>>1&1073741824|3221225471&t}var pt=Object.prototype.valueOf;function yt(t){if(null==t)return xt(t);if("function"==typeof t.hashCode)return mt(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==pt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return xt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return mt(e)}(r);case"string":return r.length>Bt?(void 0===(s=Ct[i=r])&&(s=St(i),It===kt&&(It=0,Ct={}),It++,Ct[i]=s),s):St(r);case"object":case"function":return function(t){var e;if(wt&&void 0!==(e=At.get(t)))return e;if(void 0!==(e=t[Et]))return e;if(!bt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Et]))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(),wt)At.set(t,e);else{if(void 0!==vt&&!1===vt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(bt)Object.defineProperty(t,Et,{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[Et]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Et]=e}}return e}(r);case"symbol":return function(t){var e=Dt[t];return void 0!==e||(e=Mt(),Dt[t]=e),e}(r);default:if("function"==typeof r.toString)return St(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function xt(t){return null===t?1108378658:1108378659}function St(t){for(var e=0,i=0;i=0&&(l.get=function(e,i){return(e=c(this,e))>=0&&eh)return{value:void 0,done:!0};var t=r.next();return s||e===O||t.done?t:H(e,a-1,e===_?void 0:t.value[1],t)}))},l}function Gt(t,e,i,s){var r=Zt(t);return r.__iterateUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterate(r,n);var h=!0,a=0;return t.__iterate((function(t,n,l){if(!h||!(h=e.call(i,t,n,l)))return a++,r(t,s?n:a-1,o)})),a},r.__iteratorUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterator(r,n);var h=t.__iterator(z,n),a=!0,l=0;return new U((function(){var t,n,u;do{if((t=h.next()).done)return s||r===O?t:H(r,l++,r===_?void 0:t.value[1],t);var c=t.value;n=c[0],u=c[1],a&&(a=e.call(i,u,n,o))}while(a);return r===z?t:H(r,n,u,t)}))},r}function Ut(t,e,i){var s=Zt(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 qt(t,e,i,s){var r=Zt(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=D(t),X(r?t.reverse():t)})),o=0,h=!1;return new U((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}:H(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function Xt(t,e){return t===e?t:I(t)?e:t.constructor(e)}function $t(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function jt(t){return b(t)?T:A(t)?E:B}function Zt(t){return Object.create((b(t)?J: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 Jt(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 De(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return ke(e,i,t)}function Te(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Be(t,e)}function Ee(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Be(e,i,t)}function Be(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)&&b(o)===b(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(L(t))return"function"==typeof i&&t.mergeWith?t.mergeWith.apply(t,[i].concat(e)):t.merge?t.merge.apply(t,e):t.concat.apply(t,e);for(var s=Array.isArray(t),r=t,n=s?E:T,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=j.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 Be(this,e,t)}function Pe(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Ze(),(function(t){return ke(t,e)}))}function Le(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Ze(),(function(t){return Be(t,e)}))}function Re(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Fe(){return this.__ownerID?this:this.__ensureOwner(new l)}function _e(){return this.__ensureOwner()}function Oe(){return this.__altered}var ze=function(t){function e(e){return null==e?Ze():ut(e)&&!F(e)?e:Ze().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 Ze().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=D(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):Ze()},e.prototype.sort=function(t){return Mi(Ht(this,t))},e.prototype.sortBy=function(t,e){return Mi(Ht(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 qe(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?je(this.size,this._root,t,this.__hash):0===this.size?Ze():(this.__ownerID=t,this.__altered=!1,this)},e}(T);ze.isMap=ut;var Ve=ze.prototype;Ve[lt]=!0,Ve[s]=Ve.remove,Ve.removeAll=Ve.deleteAll,Ve.setIn=me,Ve.removeIn=Ve.deleteIn=ye,Ve.update=Se,Ve.updateIn=ve,Ve.merge=Ve.concat=be,Ve.mergeWith=Me,Ve.mergeDeep=Ie,Ve.mergeDeepWith=Ce,Ve.mergeIn=Pe,Ve.mergeDeepIn=Le,Ve.withMutations=Re,Ve.wasAltered=Oe,Ve.asImmutable=_e,Ve["@@transducer/init"]=Ve.asMutable=Fe,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,yt(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)},Ge.prototype.update=function(t,e,i,s,a,l,u){void 0===i&&(i=yt(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 Ue(t,o+1,h)}(t,p,f,c,x);if(g&&!x&&2===p.length&&Qe(p[1^m]))return p[1^m];if(g&&x&&1===p.length&&Qe(x))return x;var S=t&&t===this.ownerID,v=g?x?f:f^d:f|d,b=g?x?ii(p,m,x,S):function(t,e,i){var s=t.length-1;if(i&&e===s)return t.pop(),t;for(var r=new Array(s),n=0,o=0;o>>t)&o,h=this.nodes[n];return h?h.get(t+r,e,i,s):s},Ue.prototype.update=function(t,e,i,s,n,a,l){void 0===i&&(i=yt(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=Je(f,t,e+r,i,s,n,a,l);if(g===f)return this;var m=this.count;if(f){if(!g&&--m>>i)&o,l=(0===i?s:s>>>i)&o,u=a===l?[ti(t,e,i+r,s,n)]:(h=new 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=mi();if(null==e)return i;if(hi(e))return e;var s=t(e),o=s.size;return 0===o?i:(ee(o),o>0&&o=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?Si(t,e).set(0,i):Si(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=vi(t._capacity)?s=pi(s,t.__ownerID,0,e,i,n):r=pi(r,t.__ownerID,t._level,e,i,n),n.value?t.__ownerID?(t._root=r,t._tail=s,t.__hash=void 0,t.__altered=!0,t):gi(t._origin,t._capacity,t._level,r,s):t}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=r,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):mi()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){Si(i,0,e+t.length);for(var s=0;s>>e&o;if(s>=this.array.length)return new ui([],t);var n,h=0===s;if(e>0){var a=this.array[s];if((n=a&&a.removeBefore(t,e-r,i))===a&&h)return this}if(h&&!n)return this;var l=yi(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=yi(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=vi(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=pi(d,e,i-r,s,n,h);return f===d?t:((l=yi(t,e)).array[u]=f,l)}return c&&t.array[u]===n?t:(h&&a(h),l=yi(t,e),void 0===n&&u===l.array.length-1?l.array.pop():l.array[u]=n,l)}function yi(t,e){return e&&t&&e===t.ownerID?t:new ui(t?t.array.slice():[],e)}function xi(t,e){if(e>=vi(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&o],s-=r;return i}}function Si(t,e,i){void 0!==e&&(e|=0),void 0!==i&&(i|=0);var s=t.__ownerID||new l,n=t._origin,h=t._capacity,a=n+e,u=void 0===i?h:i<0?h+i:n+i;if(a===n&&u===h)return t;if(a>=u)return t.clear();for(var c=t._level,d=t._root,f=0;a+f<0;)d=new ui(d&&d.array.length?[void 0,d]:[],s),f+=1<<(c+=r);f&&(a+=f,n+=f,u+=f,h+=f);for(var g=vi(h),m=vi(u);m>=1<g?new ui([],s):p;if(p&&m>g&&ar;S-=r){var v=g>>>S&o;x=x.array[v]=yi(x.array[v],s)}x.array[g>>>r&o]=p}if(u=m)a-=m,u-=m,c=r,d=null,y=y&&y.removeBefore(s,0,a);else if(a>n||m>>c&o;if(b!==m>>>c&o)break;b&&(f+=(1<n&&(d=d.removeBefore(s,c,a-f)),d&&m>>r<=n&&a.size>=2*o.size?(s=(r=a.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=r.__ownerID=t.__ownerID)):(s=o.remove(e),r=l===a.size-1?a.pop():a.set(l,void 0))}else if(u){if(i===a.get(l)[1])return t;s=o,r=a.set(l,[e,i])}else s=o.set(e,a.size),r=a.set(a.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=r,t.__hash=void 0,t.__altered=!0,t):Ai(s,r)}Mi.isOrderedMap=ct,Mi.prototype[R]=!0,Mi.prototype[s]=Mi.prototype.remove;var Ti="@@__IMMUTABLE_STACK__@@";function Ei(t){return Boolean(t&&t[Ti])}var Bi=function(t){function e(t){return null==t?Pi():Ei(t)?t:Pi().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):Ci(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&Ei(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):Ci(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):Pi()},e.prototype.slice=function(e,i){if(f(e,i,this.size))return this;var s=g(e,this.size);if(m(i,this.size)!==this.size)return t.prototype.slice.call(this,e,i);for(var r=this.size-s,n=this._head;s--;)n=n.next;return this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Ci(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ci(this.size,this._head,t,this.__hash):0===this.size?Pi():(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 U((function(){if(s){var e=s.value;return s=s.next,H(t,i++,e)}return{value:void 0,done:!0}}))},e}(E);Bi.isStack=Ei;var ki,Ii=Bi.prototype;function Ci(t,e,i,s){var r=Object.create(Ii);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Pi(){return ki||(ki=Ci(0))}Ii[Ti]=!0,Ii.shift=Ii.pop,Ii.unshift=Ii.push,Ii.unshiftAll=Ii.pushAll,Ii.withMutations=Re,Ii.wasAltered=Oe,Ii.asImmutable=_e,Ii["@@transducer/init"]=Ii.asMutable=Fe,Ii["@@transducer/step"]=function(t,e){return t.unshift(e)},Ii["@@transducer/result"]=function(t){return t.asImmutable()};var Li="@@__IMMUTABLE_SET__@@";function Ri(t){return Boolean(t&&t[Li])}function Fi(t){return Ri(t)&&F(t)}function _i(t,e){if(t===e)return!0;if(!S(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||b(t)!==b(e)||A(t)!==A(e)||F(t)!==F(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!w(t);if(F(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 zi(t){if(!t||"object"!=typeof t)return t;if(!S(t)){if(!ne(t))return t;t=K(t)}if(b(t)){var e={};return t.__iterate((function(t,i){e[i]=zi(t)})),e}var i=[];return t.__iterate((function(t){i.push(zi(t))})),i}var Vi=function(t){function e(e){return null==e?Wi():Ri(e)&&!F(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(T(t).keySeq())},e.intersect=function(t){return(t=D(t).toArray()).length?Gi.intersect.apply(e(t.pop()),t):Wi()},e.union=function(t){return(t=D(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 Ui(this,this._map.set(t,t))},e.prototype.remove=function(t){return Ui(this,this._map.remove(t))},e.prototype.clear=function(){return Ui(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Ui(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=mt((e=gt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+as(yt(t),yt(e))|0}:function(t,e){s=s+as(yt(t),yt(e))|0}:e?function(t){s=31*s+yt(t)|0}:function(t){s=s+yt(t)|0}),s)}(this))}});var Ki=D.prototype;Ki[x]=!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(T,{flip:function(){return Xt(this,_t(this))},mapEntries:function(t,e){var i=this,s=0;return Xt(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return Xt(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var Ji=T.prototype;Ji[v]=!0,Ji[G]=Ki.entries,Ji.toJSON=Zi,Ji.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Oi(E,{toKeyedSeq:function(){return new Pt(this,!1)},filter:function(t,e){return Xt(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 Xt(this,zt(this,!1))},slice:function(t,e){return Xt(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 Xt(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 Xt(this,Ut(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=Ki.includes,ts.contains=ts.includes,ts.keys=ts.values,Oi(J,Ji),Oi(Q,Qi),Oi(tt,ts);var ls=function(t){function e(t){return null==t?fs():Fi(t)?t:fs().withMutations((function(e){var i=B(t);ee(i.size),i.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(T(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Vi);ls.isOrderedSet=Fi;var us,cs=ls.prototype;function ds(t,e){var i=Object.create(cs);return i.size=t?t.size:0,i._map=t,i.__ownerID=e,i}function fs(){return us||(us=ds(wi()))}cs[R]=!0,cs.zip=Qi.zip,cs.zipWith=Qi.zipWith,cs.zipAll=Qi.zipAll,cs.__empty=fs,cs.__make=ds;var gs=function(t,e){var i;!function(t){if(P(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(L(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var s=function(n){var o=this;if(n instanceof s)return n;if(!(this instanceof s))return new s(n);if(!i){i=!0;var h=Object.keys(t),a=r._indices={};r._name=e,r._keys=h,r._defaultValues=t;for(var l=0;l2?[]:void 0,{"":t})}function As(t,e,i,s,r,n){if("string"!=typeof i&&!L(i)&&(Z(i)||Y(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 As(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():b(e)?e.toMap():e.toSet()}var Ds="4.2.4",Ts=D;const Es={version:Ds,Collection:D,Iterable:D,Seq:K,Map:ze,OrderedMap:Mi,List:ai,Stack:Bi,Set:Vi,OrderedSet:ls,Record:gs,Range:qi,Repeat:bs,is:ft,fromJS:Ms,hash:yt,isImmutable:L,isCollection:S,isKeyed:b,isIndexed:A,isAssociative:w,isOrdered:F,isValueObject:dt,isPlainObject:re,isSeq:I,isList:hi,isMap:ut,isOrderedMap:ct,isStack:Ei,isSet:Ri,isOrderedSet:Fi,isRecord:P,get:ae,getIn:Xi,has:he,hasIn:ji,merge:we,mergeDeep:Te,mergeWith:De,mergeDeepWith:Ee,remove:ue,removeIn:pe,set:ce,setIn:ge,update:xe,updateIn:de}},475:(t,e,i)=>{Object.defineProperty(e,"i",{value:!0});var s=i(369),r=i(102),n=i(187),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]},m=(t,e)=>({min:t,max:e}),p=(t,e,i,s)=>({x:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(s)}),y=(t,e=!0)=>new l(t,e),x=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),S=x,v=(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({r:1,g:1,b:1,a:1});class M 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._||(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,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}`)}},D=(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})},T={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},E=new M({}),B=A(0,0,0,0),k=(t,e)=>t.value-e.value,I=s.Record({steps:[],title:"",units:"",interpolate:!0,color:A(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1}),C=t=>{const{steps:e}=t,i=e.length;e.sort(k);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 P extends I{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,C(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.map((t=>`${t.value},${t.color.toString()}`)).join(",")}`}setSteps(t){return this.merge(C({...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({});class R extends L{constructor(){super(...arguments),this.type="fillstyle"}toString(){return"emptyFill"}}const F=new R,_=s.Record({color:A(255,255,255)});class O extends _{constructor(){super(...arguments),this.type="fillstyle"}}class z extends O{constructor(t){super(t)}toString(){return`solidFill:${this.color.toString()}`}setColor(t){return t instanceof M?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))}}class V extends O{constructor(t){super(t)}toString(){return`individualPointFill:${this.color.toString()}`}setFallbackColor(t){return t instanceof M?this.set("color",t):this.set("color",t(this.get("color")))}getFallbackColor(){return this.get("color")}}const N=s.Record({lut:new P({steps:[]}),lookUpProperty:"value"});class G extends N{constructor(t){super(t),this.type="fillstyle"}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")}}const U={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=Jt(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.F)&&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)))}L(){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 H(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.F=!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(St):this.values.map(St)}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.L(),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=gt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=U.linear)=>(r,n,h=t)=>{const a=new H(r,n,h,e,i).start();return s||(s=gt.requestAnimationFrame(o)),a}};var Y,q;e.GradientShape=void 0,(Y=e.GradientShape||(e.GradientShape={})).circle="circle",Y.ellipse="ellipse",e.GradientExtent=void 0,(q=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",q.closestCorner="closest-corner",q.farthestSide="farthest-side",q.farthestCorner="farthest-corner";const X=s.Record({stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class $ extends X{constructor(t){if(super(t),this.type="fillstyle",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 j=s.Record({stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],angle:0});class Z extends j{constructor(t){if(super(t),this.type="fillstyle",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?oi(t):t)}getAngle(t){return t?ni(this.get("angle")):this.get("angle")}}const K=s.Record({}),J=new class extends K{constructor(){super(...arguments),this.type="linestyle",this.lineType="empty",this.thickness=0}setThickness(t){return this}getThickness(){return 0}O(){return 0}setFillStyle(t){return this}getFillStyle(){return F}},Q=s.Record({fillStyle:new z({color:A(255,255,255)}),thickness:1});class tt extends Q{constructor(t){super(t),this.type="linestyle",this.lineType="solid"}setFillStyle(t){return"function"==typeof t?this.set("fillStyle",t(this.getFillStyle())):this.set("fillStyle",t)}getFillStyle(){return this.get("fillStyle")}setThickness(t){return"function"==typeof t?this.set("thickness",t(this.getThickness())):this.set("thickness",t)}getThickness(){return this.get("thickness")}O(){const t=this.getThickness();return t<0?1:t}}class et{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new it,this.y=new it,this.z=new it,this.P=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Ie,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(Ie,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}H(t){return this.P.on("cell-resize",t)}W(t){return this.P.off(t,"cell-resize")}}class it extends a{constructor(){super(...arguments),this.U=0,this.$=10,this.Y=1}X(){return this.o=!1,this}j(){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.Y=t,this.K(),this}J(t){return t/this.Y}K(){const t=this.J(this.$-this.U),e=this.Y;void 0!==this.tt&&!1!==Mt(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 et({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},rt=(t,e,i)=>e===i?t:i.ot(e.ut(t)),nt=(t,e,i)=>{if(e===i)return t;const s=e instanceof Di?e.x:e.x instanceof Di?e.x.x:e.x.ct,r=e instanceof Di?e.y:e.y instanceof Di?e.y.y:e.y.ct,n=i instanceof Di?i.x:i.x instanceof Di?i.x.x:i.x.ct,o=i instanceof Di?i.y:i.y instanceof Di?i.y.y:i.y.ct;return{...t,x:rt(t.x,s,n),y:rt(t.y,r,o)}},ot=(...t)=>{if(0===t.length)return{remove:bt};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 ht extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,ht.prototype)}}class at extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&>.alert(s),Object.setPrototypeOf(this,at.prototype)}}class lt extends at{constructor(t){super(t),Object.setPrototypeOf(this,lt.prototype)}}var ut,ct,dt,ft;e.UISpace=void 0,(ut=e.UISpace||(e.UISpace={}))[ut.Content=0]="Content",ut[ut.PaddedContent=1]="PaddedContent",ut[ut.PaddedBackground=2]="PaddedBackground",ut[ut.Everything=3]="Everything",e.UIVisibilityModes=void 0,(ct=e.UIVisibilityModes||(e.UIVisibilityModes={}))[ct.never=0]="never",ct[ct.always=1]="always",ct[ct.whenHovered=2]="whenHovered",ct[ct.whenDragged=3]="whenDragged",ct[ct.whenNotDragged=4]="whenNotDragged",ct[ct.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(dt=e.UIDraggingModes||(e.UIDraggingModes={}))[dt.notDraggable=0]="notDraggable",dt[dt.draggable=1]="draggable",dt[dt.onlyHorizontal=2]="onlyHorizontal",dt[dt.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(ft=e.UIDirections||(e.UIDirections={}))[ft.Up=0]="Up",ft[ft.Right=1]="Right",ft[ft.Down=2]="Down",ft[ft.Left=3]="Left";const gt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},mt=(t,e)=>t.x===e.x&&t.y===e.y,pt=t=>t!==Me&&t!==Ae&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,yt=(t,e)=>Math.min(t,e.y),xt=(t,e)=>Math.max(t,e.y),St=t=>t[1],vt=t=>t.dispose(),bt=()=>{},Mt=(t,e)=>t===e,At=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),wt=t=>Array.prototype.concat.apply([],t),Dt=(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)]},Et=(t,e)=>{for(;e;)t.push(t.shift()),e-=1},Bt=t=>{const e=[];for(const i of t)e.push(i.slice());return e},kt=(t,e)=>void 0!==t?t:e,It=t=>t.ft(),Ct=t=>t.yt(),Pt=t=>t.St(),Lt=t=>t.xt(),Rt=t=>t.min.x,Ft=t=>t.max.x,_t=t=>t.min.y,Ot=t=>t.max.y,zt=(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),Gt=u(1,0),Ut=u(0,-1),Ht=u(-1,0),Wt=u(0,0),Yt=t=>{switch(t){case e.UIDirections.Up:return Nt;case e.UIDirections.Right:return Gt;case e.UIDirections.Down:return Ut;case e.UIDirections.Left:return Ht;default:return Wt}},qt=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Xt=t=>{t.stopPropagation(),t.preventDefault()},$t=(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)},Kt=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},Qt=Jt(Math.E),te=(t,e)=>{const i=e[t];return i?i():void 0},ee=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;ihi(Je(t,i))-hi(Je(e,i))))},ie=(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:A(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())),re=t=>255===t.getA()?t:t.setA(255),ne=(()=>{const t=A(0,0,0);return i=>(i=re(i),new $({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:se(i,t,.5)}]}))})(),oe=(()=>{const t=t=>{var e;if(t){if(t instanceof z){if(0===t.getColor().getA())return;return t.getColor()}if(t instanceof $||t instanceof Z){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}}};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;t instanceof tt&&r.push(t.getFillStyle())}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()?ne(o):(o=re(o),h=re(h),new Z({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?ne(e):i.uiButtonFillStyle}var o,h;e.setButtonOffFillStyle(new z({color:A(255,255,255,0)})).setButtonOffStrokeStyle(i.uiButtonStrokeStyle).setButtonOnFillStyle(n).setButtonOnStrokeStyle(J)}})(),he=t=>{const e=t;if(e instanceof G)return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},ae=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},le=(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,ce=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),de=(t,e)=>e(),fe=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to support@lightningchart.com or Stack Overflow with tag [lightningchart]");new z({color:A(255,255,255,1)});const ge=t=>t===we||t.min.x===we.min.x&&t.max.x===we.max.x&&t.min.y===we.min.y&&t.max.y===we.max.y,me=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,pe=(t,e)=>{throw new Error(e)},ye=()=>{const t=W((()=>{}));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)||U.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)}},xe=t=>{let e;return()=>e||(e=t(),e)},Se=t=>{if(t===J)return 0;const e=t.getThickness();return e<0?1:1*e},ve=(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/lightningchart-js-api-documentation/\nand read section "What is LightningChart JS Resources not found error?"`;if(s.shouldCrash)throw gt.alert(r),new Error(r);gt.console.warn(r)},be={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=>be.divide(t,be.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(be.dot(t,e)/(be.length(t)*be.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=be.dot(e,t),o=be.cross(e,t);return be.addVec(be.multiply(t,s),be.addVec(be.multiply(e,(1-s)*n),be.multiply(o,r)))},lerp:(t,e,i)=>(i=At(i,0,1),be.addVec(be.multiply(t,1-i),be.multiply(e,i))),equals:(t,e)=>Mt(t.x,e.x)&&Mt(t.y,e.y)&&Mt(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)})},Me=Number.MAX_SAFE_INTEGER,Ae=-Number.MAX_SAFE_INTEGER,we=m(u(Me,Me),u(Ae,Ae)),De=m(f(Me,Me,Me),f(Ae,Ae,Ae)),Te=(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))},Ee=(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),ke=(t,e)=>m(u(Math.max(Math.min(t[0].x,t[2].x),Math.min(e[0].x,e[2].x)),Math.max(Math.min(t[0].y,t[2].y),Math.min(e[0].y,e[2].y))),u(Math.min(Math.max(t[0].x,t[2].x),Math.max(e[0].x,e[2].x)),Math.min(Math.max(t[0].y,t[2].y),Math.max(e[0].y,e[2].y)))),Ie=(t,e)=>e+t,Ce=(t,e,i)=>{const s=Je(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=Je(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)},Pe=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,Le=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},Re=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},Fe=(t,e,i)=>{const s=Re(e,i);if(0===s)return[Re(t,e),e];let r=ii(Je(t,e),Je(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[Re(t,n),n]},_e=(t,e,i)=>Ke(t,Ze(Je(e,t),i)),Oe=(t,e,i)=>be.addVec(t,be.multiply(be.subtractVec(e,t),i));function ze(t){const e=t.length;if(e>0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y;for(let o=0;oi&&(i=e.x),e.xr&&(r=e.y),e.y0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y,o=t[0].z,h=t[0].z;for(let a=0;ai&&(i=e.x),e.xr&&(r=e.y),e.yo&&(o=e.z),e.zm(u(t.min.xe.max.x?t.max.x:e.max.x,t.max.y>e.max.y?t.max.y:e.max.y)),Ge=(t,e)=>m(f(t.min.xe.max.x?t.max.x:e.max.x,t.max.y>e.max.y?t.max.y:e.max.y,t.max.z>e.max.z?t.max.z:e.max.z));function Ue(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 He=(t,e,i,s)=>u((t.x+e.x+i.x+s.x)/4,(t.y+e.y+i.y+s.y)/4),We=(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)},ri=(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 ni(t){return t*Math.PI/180}function oi(t){return 180*t/Math.PI}function hi(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function ai(t){return u(Math.cos(t),Math.sin(t))}function li(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 ui=(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)},ci=(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 di{constructor(){this.bt=!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}X(){return this.bt=!1,this}j(){return this.bt=!0,this}}class fi extends di{constructor(t,e,i,s){if(super(),this.vt=!0,this.Mt=!0,this._t=[0,0],this.At=!0,this.wt=t,this.kt=e,this.Ct=i,this.Tt=t,this.It=e,s){const t=s.R(this.Ft.bind(this));this.Ft(s.M()),this.Pt=()=>s.N(t)}}q(t){return this.Y=t,this.Mt=!0,this}Dt(t){return this._t=t.map(Math.abs),this.At=!0,this}Bt(){return this.wt/this.Ct*this.Y+this._t[0]}Lt(){return(this.wt+this.kt)/this.Ct*this.Y-this._t[1]}Ot(){return this.getCellSize()-this.Rt()}Et(){return this.Y}getCellSize(){return this.zt(this.Y)}Rt(){return this._t[0]+this._t[1]}Vt(){return this._t}Ft(t){this.Ct=t.reduce(Ie,0),this.wt=t.reduce(((t,e,i)=>i>=this.Tt?t:t+e),0),this.kt=t.reduce(((t,e,i)=>i>=this.Tt&&ixi;return!n&&!o||!!r&&(e>t?{start:n?yi:t,end:o?xi:e}:{start:o?xi:t,end:n?yi:e})}ut(t){const e=this.Bt(),i=this.Lt(),s=Math.max(t,yi);return e+(this.Gt.function(s)-this.Ht.scaleStartLog)/this.Ht.scaleIntervalLog*(i-e)}ot(t){const e=this.Bt(),i=(t-e)/(this.Lt()-e),s=this.Ht.scaleStartLog+i*this.Ht.scaleIntervalLog;return this.Gt.number**s}Nt(){this.Gt&&this.Wt()}Z(t,e){return super.Z(t,e),this.Gt&&this.Wt(),this}Dt(t){return super.Dt(t),this.Gt&&this.Wt(),this}q(t){return super.q(t),this.Gt&&this.Wt(),this}Ut(t){return this.Gt={internal:t,function:mi(t),number:pi(t)},this}$t(){return this.Gt.internal}Yt(t,e){const i=this.ut(t)+e;return this.ot(i)}get Xt(){return this.Mt||this.bt||this.At||this.vt}Wt(){const t=this.Gt.function(this.U),e=this.Gt.function(this.$)-t,i=2*this.Bt()/this.Y-1,s=2*this.Lt()/this.Y-1-i;return this.Ht={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.Ht}jt(){return this.Ht}}const mi=t=>"e"===t?Qt:Jt(t),pi=t=>"e"===t?Math.E:t,yi=.9*1e-9,xi=1.1*10**32,Si=["K","M","B","T"],vi=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Te(s,10),0);return t.toFixed(r)},bi={Numeric:(t,e)=>vi(t,e.getInnerStart(),e.getInnerEnd()),NumericUnits:(t,e)=>{const i=Math.abs(e.getInnerEnd()-e.getInnerStart()),s=t<0;t=Math.abs(t);const r=Te(t,1e3),n=1e3**r;let o="",h="";if(i>=1e3&&t>=1e3){const e=10**(Te(i,10)-1),a=Math.round(t/e)*e/n;let l=r;for(;l>0;){const t=Math.min(l,Si.length)-1;h=Si[t]+h,l-=t+1}o=(s?"-":"")+a}else{let e=String(Math.floor(t));for(let t=1;t<=r;t+=1){const i=e.length-(3*t+(t-1));e=`${e.substring(0,i)} ${e.substring(i,e.length)}`}o=(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-Te(i,10)):"")}return o+=h,o}},Mi=(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 Ai extends fi{constructor(t,e,i,s){super(t,e,i,s),this.Zt=!1,this.Xt=!1,this.Kt=0,this.Y=1e3,this.Z(0,10),this.K()}rt(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.Zt){const i=((t,e,i)=>{const s=((t,e)=>{if(eAe&&tAe){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}}Nt(){this.K()}ut(t){return this.Bt()+(t-this.U)/(this.$-this.U)*(this.Lt()-this.Bt())}ot(t){return this.U+(t-this.Bt())/(this.Lt()-this.Bt())*(this.$-this.U)}Z(t,e){return super.Z(t,e),this.K(),this}Dt(t){return super.Dt(t),this.K(),this}q(t){return super.q(t),this.qt=wi(this.$-this.U,this._t,this.Y,this.kt,this.Ct),this.K(),this}Jt(){return this.Zt=!0,this}Qt(){return this.Zt}ti(){return Math.abs(this.ii)}si(){return this.ti()/this.qt}ei(){return this.hi}ri(){return this.ni}getPixelSize(){return this.qt}jt(){return this.Ht}j(){return super.j(),this.Xt=!0,this}X(){return super.X(),this.Xt=!1,this}oi(t,e=bi.Numeric){return e(t,this)}ai(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}li(t){return wi(t,this._t,this.Y,this.kt,this.Ct)}K(){let t=this.U,e=this.$,i=0;this.Zt&&(t=0,e=this.$-this.U,i=this.U);const s=e-t,r=wi(s,this._t,this.Y,this.kt,this.Ct);this.ni=t-this._t[0]*r,this.hi=e+this._t[1]*r;const n=this.hi-this.ni,o=n-this.ii,h=Math.abs(o/r),a=s-this.Kt,l=Math.abs(a/r);(!this.Ht||h>=.4||l>=.4)&&(this.Kt=s,this.ii=n,this.qt=r,this.Xt=!0);const u=this.ii*this.Ct/(2*this.kt),c=-(this.ni-this.ii*this.wt/this.kt)-u,d=2*this.Bt()/this.Y-1,f=2*this.Lt()/this.Y-1-d;this.Ht={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}Yt(t,e){return t+this.qt*e}}const wi=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Di{ui(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}X(){return this.x.X(),this.y.X(),this}j(){return this.x.j(),this.y.j(),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}Et(){return u(this.x.Et(),this.y.Et())}ci(t){return this.x.Dt(t),this}di(t){return this.y.Dt(t),this}Rt(){return u(this.x.Rt(),this.y.Rt())}fi(t,e){return this.x.Z(t,e),this}gi(t,e){return this.y.Z(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.Rt(),y:e-this.y.Rt()}}pi(){return this.x.Xt||this.y.Xt}}class Ti extends Di{constructor(){super(...arguments),this.mi="LinearScaleXY"}nt(t,e,i,s){return this.x=new Ai(t.x,e.x,i.x,s?s.x:void 0),this.y=new Ai(t.y,e.y,i.y,s?s.y:void 0),this}Qt(){return this.x.Qt()||this.y.Qt()}yi(){return u(this.x.getPixelSize(),this.y.getPixelSize())}jt(){return{x:this.x.jt(),y:this.y.jt()}}Yt(t,e){const i=this.yi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Si(t,e,i,s){const r=this.yi(),n=$e(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 Ei extends Di{constructor(){super(...arguments),this.mi="MixedScaleXY"}Qt(){return!1}Yt(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)}}Si(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=Xe(Je(n,r)),h=$e(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)}}jt(){const t=this.x.jt(),e=this.y.jt();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 Bi={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?Bi.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Bi.progressive.start(t,e,i,s)+(e-t)},regressive:{start:(t,e,i,s)=>e>t?ie>t?Bi.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.xi,Ci=t=>void 0!==t.bi,Pi={vi:bi.Numeric},Li=(t,e)=>[t,e],Ri=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{Mt(t,0)&&(t=0),Mt(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},Oi=(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)}},zi=(t,e)=>{if(e.has(t))return e.get(t);const i=ze(t._i.Mi());return e.set(t,i),i},Vi=t=>{const e=new Map;if(t!==Pi){for(const i of t.Ai)e.set(i,new Map);for(const i of t.wi)e.set(i,new Map)}return e};class Ni{constructor(t,e,i,s,n,o,h){this.P=new r.Eventer,this.ki=Pi,this.Ci=ki.Empty,this.Ti=new Map,this.Ii=new Map,this.Fi=Bi.fitting,this.Pi=!0,this.Di=W((()=>this.chart.Li.Bi()))(300,U.linear),this.Oi=!0,this.Ri=!0,this.Ei=!1,this.zi=Ae,this.Vi=!1,this.Ni=!1,this.Gi=Ae,this.Hi=Ae,this.Wi=Ae,this.Ui={},this.$i=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.Ti.get(e),l=(t?t.get(a):void 0)||this.Yi(a,e);l.Xi=!1;const u=this.ji(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.Zi=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.qi!==i||!!t.find((t=>t===e)))).map((t=>Ee(e,zi(t,a))?t:void 0)),m=y.some((t=>void 0!==t))}else m=!1;if(m){let t=!0;const e=y.filter((t=>void 0!==t));if(t&&i.Ji&&e.every((t=>Ii(t.qi)))&&(t=!1),t&&i.Ji&&i.Ji.Qi&&!1===i.Ji.Qi(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.ki.vi(t,this.ct),this.ts=([t,e])=>{this.ss(t,e)},this.chart=t,this.es=e,this.hs=s,this.rs=o,this.ct=i,this.ns=h,"logarithmic"===h.type&&this.setAnimationZoom(U.logarithmic(pi(h.base))),this.os=o.numeric,this.setTickStrategy("Numeric"),this.ls=i.getInnerStart(),this.us=i.getInnerEnd(),n&&this.setAnimationsEnabled(!1)}getTitle(){return this.ds.cs()}setTitle(t){return this.ds.fs(t),this.chart.Li.Bi(),this}getTitleFillStyle(){return this.ds.gs()}setTitleFillStyle(t){return this.ds.ps(t),this.chart.Li.Bi(),this}getTitleFont(){return this.ds.ys()}setTitleFont(t){return this.ds.Ss(t),this.chart.Li.Bi(),this}setTitleRotation(t){return this.ds.xs(t),this.chart.Li.Bi(),this}getTitleRotation(){return this.ds.bs()}setTitleEffect(t){return this.Ms.vs(t),this.chart.Li.Bi(),this}getTitleEffect(){return this.Ms._s()}setTickStrategy(t,e){if(this.As(),"Empty"===t)this.ki=Pi,this.Ci=t;else if("Numeric"===t){"Numeric"!==this.Ci&&(this.os=this.rs.numeric);const i=e||(t=>t);this.os=i(this.os),this.ki=this.os.ws(this.ns),this.Ci=t}else if("DateTime"===t){"DateTime"!==this.Ci&&(this.os=this.rs.datetime);const i=e||(t=>t);this.os=i(this.os),this.ki=this.os.ws(this.ns),this.Ci=t}else if("Time"===t){"Time"!==this.Ci&&(this.os=this.rs.time);const i=e||(t=>t);this.os=i(this.os),this.ki=this.os.ws(this.ns),this.Ci=t}return this.Ii.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Ii=Vi(this.ki),this.chart.Li.Bi(),this}getTickStrategy(){return this.Ci}ks(){return this.ki}Cs(t){this.ki=t,this.Ii.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Ii=Vi(this.ki),this.chart.Li.Bi()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.dt(void 0!==e?e:this.ls,void 0!==i?i:this.us,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.us-this.ls),void 0!==this.ki.Ts&&this.ki.Ts>o){const i=(e+t)/2,s=this.ki.Ts/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.ki.Is&&this.ki.Ise?-1:1);n={start:i-s,end:i+s}}const h=this.ct.rt(n.start,n.end,this.ls,this.us,!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 pe(0,""),this}if(this.Fs&&this.Fs.finishAll(!1),this.Di&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.Fs||this.Fs.isOver()?this.Di:this.Fs.NextAnimation.bind(this);this.Fs=e([[this.ls,n.start],[this.us,n.end]],this.ts,t),this.Fs.onAnimationEnd((()=>{this.Fs=void 0,a&&(this.Wi=gt.performance.now())})),this.Fs.onAnimationEnd((()=>this.setStopped(s)))}else this.ss(n.start,n.end),s&&this.setStopped(!0),a&&(this.Wi=gt.performance.now());return this}getInterval(){return{start:this.ls,end:this.us}}setStopped(t){return t===this.Ei||(t&&(this.Fs&&this.Fs.finishAll(!1),this.Fs=void 0),this.Ei=t,this.P.emit("stoppedStateChanged",this,this.Ei),this.zi=gt.performance.now(),this.chart.Li.Bi()),this}getStopped(){return this.Ei}onStoppedStateChanged(t){return this.P.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.P.off(t,"stoppedStateChanged")}fit(t,e=!1){const i=this.Ps(!1);if(i){const s=this.us>=this.ls,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.Fi=t,this.chart.Li.Bi(),this}getScrollStrategy(){return this.Fi}setAnimationScroll(t){return this.Pi=Boolean(t),this.chart.Li.Bi(),this}setAnimationZoom(t,e=300){return this.Fs&&(this.Fs.finishAll(!1),this.Fs=void 0),this.Di=t?W((()=>this.chart.Li.Bi()))(e,t):void 0,this}setAnimationsEnabled(t){return this.Oi=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(U.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.Oi}setVisible(t){const e=this.Ri!==t;return this.Ri=t,this.ds.setVisible(t),this.Ds((e=>{e._i.setVisible(t)})),e&&this.P.emit("visibleStateChanged",this,this.Ri),this}getVisible(){return this.Ri}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")}Bs(t,e){const i=new Map;if(this.ki===Pi)return this.As(),i;e=e||new Map;const s=this.Ls(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.Ui.physicalAxisSize=h;const a=Ui(this.ki,r,n,this.ls,this.us,h),l=[];if(this.Os(),l.push(...this.Rs(this.ki,r,n,a,e,t,i)),this.Es(this.ki,r,n,a,e,t,l,i),this.zs(),a)for(const[t,e]of this.Ii){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.Ui.min=r,this.Ui.max=n,this.Ui.scaleInterval=o,this.Ui.physicalAxisSize=h,i}Vs(t){const e=t.qi.Ns;t._i.fs(e(t.u,this.ct)).Gs()}Hs(t,e){const i=e.Ws;t._i.ps(i.getLabelFillStyle()).Ss(i.getLabelFont()).xs(i.getLabelRotation())}Yi(t,e){const i=this.Ii.get(e);let s=i.get(t);s?(i.delete(t),s.qi=e,s.Us(!0)):s=this.$s(t,e);const r=this.Ti.get(e)||new Map;return r.set(t,s),this.Ti.set(e,r),this.Hs(s,e),s}ji(t,e){const i=this.Ys(t,e);return this.Vs(t),i}Rs(t,e,i,s,r,n,o){const h=[];for(const a of t.Ai){const t=s.get(a);for(const s of t){if(si)continue;const t=this.Ti.get(a),l=(t?t.get(s):void 0)||this.Yi(s,a),u=this.ji(l,n),c=zi(l,r);h.find((t=>Ee(c,zi(t,r))))&&l._i.setVisible(!1),l.Xi=!1,o.set(l,u),h.push(l)}}return h}Es(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.wi){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.Ji){y=!1;break}const t=u.Ji.Xs;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const p=this.Zi(m.filter((t=>a.some((e=>Mt(t.u,e))))),g,u,d,n,h,e,i,r,o,l);!0!==p?t=t.concat(p):(d+=1,f=-1,t=[])}p=t,m.forEach((e=>{t.find((t=>t===e))||this.js(e)}))}if(l=p,!y)break}}js(t){const e=this.Ti.get(t.qi);null==e||e.delete(t.u);const i=this.Ii.get(t.qi);i&&i.has(t.u)?t.dispose():i&&(t.Us(!1),i.set(t.u,t))}Ds(t){for(const e of this.Ti.values())for(const i of e.values())t(i)}Zs(t,e){for(const i of this.Ti.values())for(const s of i.values())e=t(e,s);return e}As(){this.Ti.forEach(((t,e)=>{t.forEach((t=>this.js(t)))})),this.Ti.clear()}Os(){for(const t of this.Ti.values())for(const e of t.values())e.Xi=!0}zs(){for(const t of this.Ti.values())for(const[e,i]of t.entries())i.Xi&&(i.dispose(),t.delete(e))}Ls(){const t=this.ct.getInnerStart()this.ct.getInnerStart()?this.ct.getInnerEnd():this.ct.getInnerStart();return m(t,e)}Ki(t,e){return!(t.Xi||0===t._i.cs().length||Ii(e)&&!0!==e.Ks)}qs(t,e){return this.ki===Pi||(this.ki.Ai.forEach((i=>{e=t(e,i.Ws)})),this.ki.wi.forEach((i=>{(t=>void 0!==t.Ns)(i)&&(e=t(e,i.Ws))}))),e}Ps(t){let e;for(const t of this.Js()){if(!t.Qs())continue;const i=this.es.te(t),s=this.es.ie(t);if(void 0!==i&&pt(i)&&void 0!==s&&pt(s)){if("logarithmic"===this.ns.type){let t;if(Math.sign(i)!==Math.sign(s)&&(t=`Logarithmic series data range must be either > 0 or < 0 (encountered [${i}, ${s}])`),0!==i&&0!==s||(t=`Logarithmic series data range is not defined at 0 (encountered [${i}, ${s}])`),t)throw gt.alert(t),new Error(t)}e?(e.min=Math.min(e.min,i),e.max=Math.max(e.max,s)):e=m(i,s)}}if(e&&pt(e.min)&&pt(e.max)){if(Mt(e.min,e.max)){if(t)return;return{min:e.min-1,max:e.max+1}}return e}}se(){let t=0;for(const e of this.Js()){if(!e.Qs())continue;const i=this.es.ee(e);i&&(t=Math.max(t,i))}return t}he(){const t=this.Js(),e=this.Vi;let i=!1;if(0!==t.length&&this.Fi&&!this.Ei){const t=this.Ps(!0);if(t){const e=this.ls,s=this.us;let r=this.Fi.start(e,s,t.min,t.max),n=this.Fi.end(e,s,t.min,t.max);const o=!1===Mt(e,r),h=!1===Mt(s,n);if(r=o?r:e,n=h?n:s,o||h){let t=!1;if(this.Pi)if(this.Pi){t=!0;const a=o?this.re(e,r):e,l=h?this.re(s,n):s;if(!0===this.ss(a,l,{allowClamping:!1})&&(o&&!1===Mt(a,r)||h&&!1===Mt(l,n))){this.chart.Li.Bi(!0),i=!0;let t=Math.abs(n-r)/Math.abs(a-l);t<1&&(t=1/t),this.Ni=t>=1.4}}else t=!1;t||this.ss(r,n)}}}i?(this.Vi!==i&&(this.Vi=i,this.Gi=gt.performance.now()),this.ne&&(clearTimeout(this.ne),this.ne=void 0)):!0===e&&void 0===this.ne&&(this.Ni=!1,this.ne=setTimeout((()=>{!1!==this.Vi&&(this.Vi=!1,this.Gi=gt.performance.now()),this.ne=void 0,this.chart.Li.Bi()}),200))}ss(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.us-this.ls);if(void 0!==this.ki.Ts&&this.ki.Ts>o){const i=(e+t)/2,o=(s?this.ki.Ts/2:h/2)*(t>e?-1:1);r={start:i-o,end:i+o},n=!1}if(void 0!==this.ki.Is&&this.ki.Ise?-1:1);r={start:i-o,end:i+o},n=!1}let a=this.ct.rt(r.start,r.end,this.ls,this.us,s);if(!1===a)return!1;!0!==a&&(r=a);const l=this.se(),u=this.oe(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.ls,this.us,!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.ls=r.start,this.us=r.end,this.P.emit("scaleChange",this,r.start,r.end),this.Hi=gt.performance.now(),this.chart.Li.Bi(),n)}ae(){return this.Vi}le(){return void 0!==this.Fs}}class Gi{constructor(t,e,i,s,r=i.ue(s).setMouseInteractions(!1)){this.Xi=!1,this.ce=!1,this.de=[],this.qi=t,this.u=e,this.fe=i,this.ge=s,this._i=r,this.de.push(r)}Us(t){this.de.forEach((e=>e.setVisible(t)))}dispose(){return this.ce||(this.ce=!0,this.de.forEach((t=>t.dispose()))),this}}const Ui=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.Ai){let t=n.pe(e,i,s,r);t=Hi(t),o.set(n,t)}let h;for(const s of t.wi){let t;if(void 0===h)t=s.pe(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.me&&s.me>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),Wi=s.Record({size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class Yi extends Wi{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 qi=new Yi,Xi=new class{},$i=s.Record({shape:"sphere",size:10,fillStyle:new z,wireframeStyle:J});class ji extends $i{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 Zi=s.Record({size:5,fillStyle:new z});class Ki extends Zi{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 Ji={Triangulated:ji,Pixelated:Ki};class Qi{constructor(t){this.ye=new Map,this.Li=t}Se(t,e,i){const s=i.animationEnabled;this.ye.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.ye.delete(t),t.offDispose(r)}))}xe(t,e){const i=this.ye.get(t);i&&(i.curUnanimatedHighlightValue=me(e),this.Li.Bi())}be(t){const e=this.ye.get(t);return e?e.curUnanimatedHighlightValue:0}ve(t,e){const i=this.ye.get(t);i&&(i.animationEnabled=e)}Me(t){const e=this.ye.get(t);return!!e&&e.animationEnabled}Gs(t){let e=!1;this.ye.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.Li.Bi(!0)}}const ts=new Map,es=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=ts.get(o);return h||(h=((t,e)=>({font:t,properties:e}))(o,{size:e,family:i,style:r,variant:n,weight:s}),ts.set(o,h)),h};var is,ss;!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"}(is||(is={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(ss||(ss={}));const rs=t=>({container:t._e,scale:t.ct,setMouseStyle:(e,i)=>t.Ae(e,i),restoreMouseStyle:e=>t.we(e),clientLocation2Engine:(e,i)=>t.ke(e,i),engineLocation2Client:(e,i)=>t.Ce(e,i),captureFrame:(e,i)=>t.Te(e,i),renderFrame:(e,i,s=!1)=>t.Ie(e,i,s),layout:()=>{t.Fe(),t.Pe()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.De(e,i)}),ns=[];let os;const hs=()=>{if(void 0!==os){const t=gt.getComputedStyle(gt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));os.style.height=gt.innerHeight-e+"px",(()=>{for(let t=0;tthis.Bi()),60),this.Oe=u(0,0),this.Re=void 0,this.Ee=()=>{},this.ze=()=>{},this.Ve=[],this.Ne=-1,this.Ge=[],this.He=!0,this.ce=!1,this.Pe=()=>{const{bottom:t,left:e}=this.We().getBoundingClientRect();return this.Oe=u(Math.floor(e),Math.floor(t)),this},this.Fe=()=>{this.Ue&&this.Ue()},this.Ae=(t,e)=>{if(!e){this._e.style.cursor=t;const e=this.Ne;return this.Ne+=1,this.Ge.push([e,t]),e}return this.we(e),this.Ae(t)},this.we=t=>{const e=t?this.Ge.findIndex((e=>e[0]===t)):-1;e>=0?(this.Ge.splice(e,1),this.Ge.length>0?this._e.style.cursor=this.Ge[this.Ge.length-1][1]:this._e.style.cursor="default"):(this.Ge.push([0,"default"]),this._e.style.cursor="default")},this.$e=t=>(this.Ye.S(t),this),this.Xe=()=>this.Ye.M(),this.je=()=>{this.Ee&&this.Ee(),this.Ze(),this.Ke(),this.ze&&this.ze()},this.qe=t=>(this.Be.set(t.Je(),t),this.Be=new Map([...this.Be.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.Qe=t=>(this.Be.delete(t),this),this.X=()=>(this.Ye.o=!1,this),this.j=()=>(this.Ye.o=!0,this),this.th=t=>{if(!this.He)return;const e=this.ih,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.ke(t.clientX,t.clientY),r=this.sh(t,{x:t.clientX,y:t.clientY});if(this.eh&&r!==this.eh&&!this.hh){this.eh.rh=!1;const e=this.eh.oh;e&&e(this.eh,t)}if(r&&r.getMouseInteractions()&&!this.hh)if(r.rh){if(!i){const e=r.ah;e&&e(r,t)}}else{r.rh=!0;const e=r.lh;e&&e(r,t)}if(this.hh){const i=this.hh.entity.uh,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.hh.entity,t,this.hh.button,this.hh.startLocation,s)}this.dh=t,this.ih=t,this.fh=s,this.eh=r},this.gh=t=>{if(this.He=!1,this.fh=void 0,this.dh=t,this.ih=void 0,this.hh){const e=this.hh.entity.ph;e&&e(this.hh.entity,t,this.hh.button,this.hh.startLocation),this.hh.entity.rh=!1;const i=this.hh.entity.oh;i&&i(this.hh.entity,t),this.hh=void 0}if(this.mh){const e=this.mh.entity.yh;e&&e(this.mh.entity,t),this.mh=void 0}if(this.eh){this.eh.rh=!1;const e=this.eh.oh;e&&e(this.eh,t),this.eh=void 0}},this.Sh=t=>{this.He=!0,this.dh=t},this.xh=()=>this.fh,this.hs=t.theme,this.bh=e.bh,this.Mh={_h:e._h,Ah:e.Ah,wh:e.wh,kh:e.kh,Ch:e.Ch,Th:e.Th,Ih:t&&t.overrideInteractionMouseButtons?t.overrideInteractionMouseButtons:void 0,Fh:t&&void 0!==t.resourcesBaseUrl&&null!==t.resourcesBaseUrl?t.resourcesBaseUrl:`${gt.location.origin}/resources`,Ph:!t||!("warnings"in t)||"boolean"!=typeof t.warnings||t.warnings,Dh:(()=>{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})(),Bh:void 0===(null==t?void 0:t.interactable)||t.interactable,Lh:void 0===t.textPixelSnappingEnabled||t.textPixelSnappingEnabled};const i=t?t.container:void 0;if(i){if("string"==typeof i){const t=gt.document.getElementById(i);if(!t)throw new Error(`Container "${i}" doesn't exist.`);this._e=t}else this._e=i;gt.addEventListener("resize",this.Fe),this.Ve.push((()=>{gt.removeEventListener("resize",this.Fe)}))}else{if(void 0===os){const t=gt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",gt.document.body.appendChild(t),os=t,gt.addEventListener("resize",hs)}let t=1;for(;null!==gt.document.getElementById(`chart-${t}`);)t+=1;this._e=gt.document.createElement("div"),this._e.id=`chart-${t}`,this._e.style.flex="1",os.appendChild(this._e),hs(),ns.push(this.Fe),this.Ve.push((()=>{os&&os.removeChild(this._e),ns.includes(this.Fe)&&ns.splice(ns.indexOf(this.Fe),1),0===ns.length&&os&&(gt.document.body.removeChild(os),os=void 0,gt.removeEventListener("resize",hs))}))}if(gt.ResizeObserver){const t=t=>{for(const e of t)e.target===this._e&&this.Fe()};this.Oh=new gt.ResizeObserver(t.bind(this)),this.Oh.observe(this._e)}""===this._e.style.position&&(this._e.style.position="relative"),this._e.style.boxSizing="content-box",this._e.addEventListener("fullscreenchange",this.Fe),this._e.addEventListener("webkitfullscreenchange",this.Fe);const s=t?t.maxFps:void 0;this.Rh=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._e.onwheel=this.Eh(is.wheel),this._e.oncontextmenu=this.Eh(is.contextmenu),this._e.onclick=this.Eh(is.click),this._e.ondblclick=this.Eh(is.dbclick),this._e.onlostpointercapture=()=>{o=!1},this._e.ontouchmove=t=>{o&&t.preventDefault()},this._e.onpointerover=h(),this._e.onpointerenter=h(this.Sh),this._e.onpointerdown=h(this.Eh(is.mouseDown),this.zh(ss.touchStart)),this._e.onpointermove=h(this.th,this.zh(ss.touchMove)),this._e.onpointerup=h(this.Eh(is.mouseUp),this.zh(ss.touchEnd)),this._e.onpointercancel=h(),this._e.onpointerout=h(),this._e.onpointerleave=h(this.gh,this.zh(ss.touchEnd)),!gt.requestAnimationFrame||!gt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");gt.addEventListener("scroll",this.Pe),this.Ye=y(new M({r:0,g:0,b:0,a:0})),this.Vh=new Qi(this)}Nh(){return this.Gh}Hh(){return this.Wh}setBackgroundFillStyle(t){return this.Uh.ps(t),this}getBackgroundFillStyle(){return this.Uh.gs()}setBackgroundStrokeStyle(t){return this.Uh.$h(t),this}getBackgroundStrokeStyle(){return this.Uh.Yh()}Xh(t){return this.ze=t,this}jh(t){return this.Ee=t,this}Zh(t){return this.Be.get(t)}Kh(){return Array.from(this.Be.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}Eh(t){return e=>this.qh(t,e)}qh(t,e){if(!this.He)return;t===is.contextmenu&&Xt(e);const i=this.ke(e.clientX,e.clientY),s=this.sh(e,{x:e.clientX,y:e.clientY});if(t===is.mouseUp){if(this.hh){const t=this.hh.entity.ph;if(t&&t(this.hh.entity,e,this.hh.button,this.hh.startLocation),s!==this.hh.entity){this.hh.entity.rh=!1;const t=this.hh.entity.oh;t&&t(this.hh.entity,e)}this.hh=void 0}if(this.mh){const t=this.mh.entity.getMouseInteractions()&&this.mh.entity.yh;t&&t(this.mh.entity,e),this.mh=void 0}}else if(s&&s.getMouseInteractions()){const i=t===is.click?s.Jh:t===is.dbclick?s.Qh:t===is.mouseDown?s.tr:t===is.wheel?s.ir:t===is.contextmenu?s.sr:void 0;if(i&&i(s,e),t===is.mouseDown){this.mh={entity:s,event:e};const t=this.mh.event.button,i=s.er;i&&i(s,e,t),this.hh={entity:s,button:t,startLocation:u(e.clientX,e.clientY)}}}this.dh=e,this.fh=i,this.eh=s}zh(t){return e=>this.hr(t,e)}hr(t,e){const i=e.interactions.length;if(this.rr=e,this.nr){const s=t===ss.touchMove?this.nr.ar:t===ss.touchEnd?this.nr.lr:t===ss.touchStart?this.nr.ur:void 0;s&&s(this.nr,e),t===ss.touchEnd&&0===i&&(this.nr.rh=!1,this.nr=void 0)}else if(t===ss.touchStart){for(let t=0;t{t()})),this.Ve.length=0,this.Re&>.cancelAnimationFrame(this.Re)}ke(t,e){return u(t-this.Oe.x,this.Oe.y-e)}Ce(t,e){return u(t+this.Oe.x,this.Oe.y-e)}}const cs=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=Ze(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=Ze(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=Ze(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=Ze(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?ps.Nearest:"nearest-x"===t?ps.NearestX:"nearest-y"===t?ps.NearestY:void 0;return void 0!==e?e:ps.NearestX},xs=(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===ps.Nearest)return Ss(t,e,n,o,c,d);if(i===ps.NearestX||i===ps.NearestY){if("boolean"==typeof l&&("x"===a&&i===ps.NearestX||"y"===a&&i===ps.NearestY))return Ms(t,nt(e,o,n),a,l,c,d);if(i===ps.NearestX)return vs(t,nt(e,o,n),h,c,d);if(i===ps.NearestY)return bs(t,nt(e,o,n),h,c,d)}},Ss=(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=nt(r,i,s),n=(t.x-e.x)**2+(t.y-e.y)**2;n{if(e.xi.max.x)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.x>e.x?s.x-e.x:e.x-s.x;r{if(e.yi.max.y)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.y>e.y?s.y-e.y:e.y-s.y;r{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,m=Math.floor((r+n)/2),p=n,y=-1;for(;;){const e=h-(o?t[m].x:t[m].y);if(e*(s?-1:1)>0)g=Math.min(m+1,p),y=Math.floor((g+p)/2);else{if(0===Math.abs(e))return m;p=Math.max(m-1,g),y=Math.floor((g+p)/2)}if(y===m){const i=m>r?Math.abs(h-(o?t[m-1].x:t[m-1].y)):Me,s=m{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,m=Math.floor((r+n)/2),p=n,y=-1;for(;;){const i=h-(o?t[m].x:t[m].y);if(i*(s?-1:1)>0)g=Math.min(m+1,p),y=Math.floor((g+p)/2);else{if(0===Math.abs(i))return{a:m,b:m,lerpAmount:0};p=Math.max(m-1,g),y=Math.floor((g+p)/2)}if(y===m){if(i*(s?-1:1)<0&&m>r){const i=t[m-1],s=t[m];return{a:m-1,b:m,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(mthis.P.on("dispose",t),this.offDispose=t=>this.P.off(t,"dispose"),this.Li=t,this.vr=e,this.Mr=i,this._r=ws,ws+=1,this.Ar=t.hs.highlightColorOffset}wr(t){return void 0!==this.Mr.find((e=>e.type===t))}kr(t,e){var i;return!!this.wr(t)&&!0===e(null===(i=this.Mr.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.ce||(this.rh&&this.oh&&this.oh(this),this.ce=!0,this.vr(this),this.P.emit("dispose",this)),this}setVisible(t){const e=this.Ri;return this.Ri=t,!t&&e&&(this.rh&&this.oh&&this.oh(this),this.rh=!1),this}getVisible(){return this.Ri}setMouseInteractions(t){const e=this.pr.M();return this.pr.S(t),t||(e&&this.rh&&this.oh&&this.oh(this),this.rh=!1),this}getMouseInteractions(){return this.pr.M()}getIsUnderMouse(){return this.rh}getIsGrabbed(){return this.yr}setMouseMoveEventHandler(t){return this.ah=t,this}setMouseEnterEventHandler(t){return this.lh=t,this}setMouseLeaveEventHandler(t){return this.oh=t,this}setMouseClickEventHandler(t){return this.Jh=t,this}setMouseDoubleClickEventHandler(t){return this.Qh=t,this}setMouseDownEventHandler(t){return this.tr=t,this}setMouseUpEventHandler(t){return this.yh=t,this}setMouseWheelEventHandler(t){return this.ir=t,this}setMouseContextMenuEventHandler(t){return this.sr=t,this}setMouseDragEventHandler(t){return this.uh=t,this}setMouseDragStartEventHandler(t){return this.er=t,this}setMouseDragStopEventHandler(t){return this.ph=t,this}setTouchStartEventHandler(t){return this.ur=t,this}setTouchMoveEventHandler(t){return this.ar=t,this}setTouchEndEventHandler(t){return this.lr=t,this}Cr(t){return this.Sr=t,this}Tr(){return this.Sr?this.Sr:Ts}Ir(t){return this.br=t,this}Fr(){return this.br}Pr(t){return this.Ar=t,this}Dr(){return this.Ar}}const Ts=m(u(0,0),u(0,0));class Es extends Ds{constructor(t,e,i,s){super(t,i,s),this.Br=0,this.Lr=e,this.Lr.Or=!0}Rr(t){return this.Br===t||(this.Br=t,this.Lr.Or=!0),this}Er(){return this.Br}}class Bs extends Es{constructor(t,e,i,s,r){super(t,e,s,r),this.zr=!0,this.ct=i}}const ks=(t,e,i)=>{if(i instanceof Ti){const s=i.yi(),r=Qe(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return m(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return m(i.Yt(u(t.min.x,t.min.y),Ze(e,-1)),i.Yt(u(t.max.x,t.max.y),e))},Is=(t,e)=>"function"==typeof e?e(t):e,Cs=(t,e)=>!t||t!==e,Ps=(t,e)=>t===F&&e!==F,Ls=t=>t!==F;class Rs extends Bs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vr=ls.fillStyle,this.Li=t}ps(t){return this.Vr=Is(this.Vr,t),this}gs(){return this.Vr}Nr(){return Cs(this.Gr,this.Vr)}Hr(){return Ps(this.Gr,this.Vr)}Wr(){return Ls(this.Vr)}Ur(t){this.Gr=t}}class Fs extends Rs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.$r=ls.lineStyle,this.Li=t}$h(t){return this.$r="function"==typeof t?t(this.$r):t,this}Yh(){return this.$r}Yr(){return!this.Xr||this.Xr!==this.$r}jr(t){return!this.Xr||this.Xr.getThickness()!==t}Wr(){return this.$r!==J||super.Wr()}Hr(){return(this.$r!==J||this.Vr!==F)&&this.Xr===J&&this.Gr===F}Zr(t){this.Xr=t}}class _s extends Rs{constructor(t,e,i,s,r,n=y(5)){super(t,e,i,s,r),this.size=y(5),this.size=n}q(t){return this.size.S(t),this}}class Os extends Rs{constructor(t,e,i,s,r,n=y(ls.font)){super(t,e,i,s,r),this.Kr=y(""),this.qr=y(u(0,0)),this.Jr=y(0),this.Qr=y(0),this.tn=y(u(0,0)),this.sn=y(0),this.en=y(qi),this.hn=u(0,0),this._t=y(x(1,1,1,1)),this.rn=y(S(4,4,4,4)),this.font=y(ls.font),this.nn=!1,this.font=n}Wr(){return Ls(this.Vr)&&this.Kr.M().length>0}Hr(){return!1===this.nn&&this.Wr()}fs(t){return this.Kr.S(t),this}cs(){return this.Kr.M()}Ss(t){return t instanceof Yi?this.en.S(t):this.en.S(t(this.en.M())),this}ys(){return this.en.M()}an(t){return this.en.S(this.en.M().setFamily(t)),this}ln(){return this.en.M().getFamily()}un(t){return this.en.S(this.en.M().setSize(t)),this}cn(){return this.en.M().getSize()}dn(t){return this.en.S(this.en.M().setWeight(t)),this}fn(){return this.en.M().getWeight()}gn(t){return this.en.S(this.en.M().setStyle(t)),this}pn(){return this.en.M().getStyle()}mn(t){return this.en.S(this.en.M().setVariant(t)),this}yn(){return this.en.M().getVariant()}Sn(t){return this.qr.S(t),this}xn(){return this.qr.M()}xs(t){return this.sn.S(t),this}bs(){return this.sn.M()}bn(t,e){return this.tn.S(u(t,e)),this}vn(){return this.tn.M()}Mn(t){return this.Qr.S(t),this}_n(){return this.Qr.M()}An(t){return this.Jr.S(t),this}wn(){return this.Jr.M()}kn(t){return this.Qr.S(t.x),this.Jr.S(t.y),this}Cn(t){return this._t.S(t),this}Tn(){return this._t.M()}In(t){return this.rn.S(t),this}Fn(){return this.rn.M()}}class zs extends _s{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,y(o)),this.Pn=[],this.Dn=y(e.PointShape.Square),this.sn=y(0),this.Bn=y(!1),this.Ln=y(!1),this.On=y(!1),this.Rn=we,this.En=0,this.zn=[],this.Vn=0,this.Nn=we,this.Gn=ps.Nearest,this.Hn=!1}Wn(t){return this.Gn=t,this}Un(){return this.zn}$n(){return this.Pn}Yn(t){return this.Dn.S(t),this}xs(t){return this.sn.S(t),this}Xn(t){return this.Bn.S(t),this}jn(t){return this.Ln.S(t),this}Zn(t){return this.On.S(t),this}Kn(t,e){return Array.isArray(t)||(t=[t]),this.Vn+=t.length,this.zn=ie(this.zn,t,{canReturnB:!0}),this.Nn&&(this.Nn=e?Ne(this.Nn,e):void 0),this}qn(){return this.Hn=!0,this.Pn.length=0,this.En=0,this.Rn=we,this.zn=[],this.Vn=0,this}Jn(){return this.En}Qn(){return this.Vn}}class Vs extends Fs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.qr=y(u(0,0)),this.Y=y(u(100,100)),this.sn=y(0),this.hn=y(u(0,0)),this.io=!1}Gs(){return this.so(),this}Sn(t){const e=this.qr.M();return t.x===e.x&&t.y===e.y||(this.qr.S(t),this.so()),this}xn(){return this.qr.M()}eo(t){const e=this.qr.M();return t!==e.x&&(this.qr.S(u(t,e.y)),this.so()),this}ho(t){const e=this.qr.M();return t!==e.y&&(this.qr.S(u(e.x,t)),this.so()),this}q(t){const e=this.Y.M();return t.x===e.x&&t.y===e.y||(this.Y.S(u(t.x,t.y)),this.so()),this}Et(){return this.Y.M()}ro(t){const e=this.Y.M();return t!==e.x&&(this.Y.S(u(t,e.y)),this.so()),this}no(t){const e=this.Y.M();return t!==e.x&&(this.Y.S(u(e.x,t)),this.so()),this}xs(t){return this.sn.S(t),this}bs(){return this.sn.M()}oo(t){const e=this.hn.M();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.io=!1,this.so()):(this.io=!0,this.hn.S(t))),this}so(){if(!this.io){const t=this.qr.M(),e=this.Y.M(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.hn.M();i.x===s.x&&i.y===s.y||this.hn.S(i)}}}class Ns extends Fs{constructor(){super(...arguments),this.Pn=[],this.qr=y(u(0,0)),this.Rn=we,this.ao=!1}lo(t){return t=Kt(t),this.Pn=t,this.ao=!0,this}uo(){return this.Pn}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return 0}do(){return 0}}class Gs extends Ns{}class Us extends Rs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fo=new Array,this.po=new Array,this.mo=y({type:"disabled",packager:(t,e,i)=>t.slice()}),this.Rn=we,this.yo=0,this.So=!1,this.zn=[Array(),Array()],this.xo=!1,this.bo=(new z).setColor(A(42,171,240)),this.Hn=!1,this.vo=!1,this.Mo=!1}Kn(t,e){const i=this.yo-1,s=i>0&&!this.xo;let[r,n]=s?[[this.fo[i]],[this.po[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=ie(r,e,{canReturnB:!0}),n=ie(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.xo?(this.zn[0]=ie(this.zn[0],r,{canReturnB:!0}),this.zn[1]=ie(this.zn[1],n,{canReturnB:!0})):(this.zn=[r,n],this.xo=!0),this.Rn=Ne(this.Rn,e||Ne(ze(r),ze(n))),this}qn(){return this.Hn=!0,this.fo.length=0,this.po.length=0,this.yo=0,this.Rn=we,this}$n(){return[this.fo,this.po]}Un(){return[this.zn[0],this.zn[1]]}_o(t){return this.mo.S(t),this}Ao(){return this.mo.M()}wo(t){return this.bo="function"==typeof t?t(this.bo):t,this}ko(){return this.bo}Jn(){return this.yo-(Number(this.vo)+Number(this.Mo))}Qn(){return this.zn.length}Co(t){return this.vo=t,this}To(){return this.vo}Io(t){return this.Mo=t,this}Fo(){return this.Mo}Hr(){return this.Gr===F&&this.Po===F&&(this.Vr!==F||this.bo!==F)}Do(t){this.Po=t}Wr(){return this.bo!==F||super.Wr()}Nr(){return super.Nr()||!this.Po||this.Po!==this.bo}}class Hs extends Fs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.qr=y(u(0,0)),this.Bo=y(0),this.hi=y(360),this.Lo=y(100),this.Oo=y(100),this.Ro=y(0),this.Eo=y(void 0),this.zo=u(0,0),this.Vo=u(0,0),this.No=u(0,0)}Go(){return this.Lo.M()}Ho(){return this.Oo.M()}xn(){return this.qr.M()}Wo(){return this.Bo.M()}ei(){return this.hi.M()}Uo(){return this.Ro.M()}$o(){return this.Eo.M()}Yo(){return this.zo}Xo(){return this.Vo}jo(){return this.No}Sn(t){return this.qr.S(t),this}Zo(t){return this.Bo.S(t),this}Ko(t){return this.hi.S(t),this}qo(t){return this.Oo.S(t),this.Lo.S(t),this}Jo(t){return this.Lo.S(t),this}Qo(t){return this.Oo.S(t),this}ta(t){return this.Ro.S(t<0?0:t),this}ia(t){return this.Eo.S(void 0!==t&&t<=0?void 0:t),this}}var Ws;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(Ws||(Ws={}));class Ys extends Bs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.sa=ls.lineStyle,this.engine=t}ea(t){return this.sa=((t,e)=>"function"==typeof e?e(t):e)(this.sa,t),this}ha(){return this.sa}Yr(){return((t,e)=>!t||t!==e)(this.ra,this.sa)}na(t){return((t,e)=>!t||t.getThickness()!==e)(this.ra,t)}Hr(){return((t,e)=>t===J&&e!==J)(this.ra,this.sa)}Wr(){return(t=>t!==J&&t.getFillStyle()!==F)(this.sa)}oa(t){this.ra=t}}class qs extends Ys{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ni=u(0,0),this.hi=u(0,0),this.aa=!1}S({min:t,max:e}){return this.aa=!0,this.ni=t,this.hi=e,this}ri(){return this.ni}ei(){return this.hi}la(t){return this.aa=!0,this.ni=t,this}Ko(t){return this.aa=!0,this.hi=t,this}}class Xs extends Ys{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ua=[],this.aa=!1}Kn(t,e){return this.ua.push(t),this.ua.push(e),this.aa=!0,this}qn(){return this.ua.length=0,this.aa=!0,this}}class $s extends Ys{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ca=[],this.Rn=we,this.zn=new Array,this.En=0,this.Gn=ps.NearestX,this.Hn=!1,this.da=y(void 0),this.vo=!1,this.Mo=!1}fa(t){return this.da.S(t),this}ga(){return this.da.M()}Un(){return this.zn}$n(){return this.ca}Wn(t){return this.Gn=t,this}qn(){return this.Hn=!0,this.ca.length=0,this.En=0,this.zn=[],this.Rn=we,this}Jn(){return this.En-(Number(this.vo)+Number(this.Mo))}Qn(){return this.zn.length}Co(t){return this.vo=t,this}To(){return this.vo}Io(t){return this.Mo=t,this}Fo(){return this.Mo}}class js extends Rs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.yo=0,this.pa=0,this.Y=y({x:0,y:0}),this.ma=y({x:0,y:0}),this.ya=y({x:0,y:0}),this.ni={x:0,y:0},this.hi={x:0,y:0},this.Sa=!0,this.xa=!0,this.ba=!0,this.Rn=we,this.va=!0,this.Ma=F}_a(t){return this.Ma=Is(this.Ma,t),this}Aa(){return this.Ma}S(t){return Zs.S(this,t,((t,e)=>({x:t,y:e}))),this}wa(){return Zs.wa(this)}ka(){return Zs.ka(this)}xn(){return Zs.xn(this)}Qn(){return Zs.Qn(this)}Ca(t,e,i){return Zs.Ca(this,t,e,i),this}Ta(t,e,i){return Zs.Ta(this,t,e,i),this}Ia(t,e){return Zs.Ia(this,t,e),this}Fa(t,e){return Zs.Fa(this,t,e),this}Pa(t,e){return Zs.Pa(this,t,e),this}qn(){return Zs.qn(this,((t,e)=>({x:t,y:e}))),this}Da(){return Zs.Da(this)}Ba(){return Zs.Ba(this)}La(){return Zs.La(this)}Jn(){return Zs.Jn(this)}Hr(){return Zs.Hr(this)}Wr(){return Zs.Wr(this)}Oa(){return this.Ra}Ea(){return this.za}}const Zs={S(t,e,i){t.Sa=!0,t.xa=!0,t.ba=!0;const{start:s}=e,{end:r}=e,{rows:n}=e,{columns:o}=e;t.va=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.ma.S(h),t.ni={...s},t.hi={...r},t.Y.S(Je(r,s)),Zs.Va(t,i)},Va(t,e){const i=t.ma.M();if(i.x>0&&i.y>0){t.Ra?t.Ra.length=0:t.Ra=[];const s=t.va?Ke(i,{x:1,y:1}):{x:i.x,y:i.y};t.ya.S(s),t.Ra=Array.from(Array(s.y)).map((()=>Array(s.x))),t.za=Array.from(Array(i.y)).map((()=>Array(i.x))),Zs.Na(t,i,s,e),t.yo=s.x*s.y,t.pa=i.x*i.y}else t.Ra=void 0,t.ya.S({x:0,y:0})},Na(t,e,i,s){const r=t.ni,n=t.hi,o=t.Ra,h=t.za;if(o){const e=i.x,h=i.y,{x:a,y:l}=t.Y.M(),u={x:a/(e-1),y:l/(h-1)};for(let t=0;tt.ma.o||t.ya.o,ka(t){const e=t.ma.M();return{columns:e.x,rows:e.y}},xn(t){const e=t.ni,i=t.hi;return{start:{x:e.x,y:e.y},end:{x:i.x,y:i.y}}},Qn(t){throw new Error("Method not implemented.")},Ca(t,e,i,s){const r="geometry"===i||"y"===i?t.Ra:t.za;if(r){const n=t.ya.M();if("y"===i){const t=Bt(r);for(let i=0;iEt(t,e)));const o=r===t.Ra?t.ya.M():t.ma.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.yo,Jn:t=>t.pa,Hr:t=>Ps(t.Gr,t.Vr)||Ps(t.Wa,t.Ma),Wr:t=>Ls(t.Vr)||Ls(t.Ma)};class Ks{constructor(t,e){this.Fh=t,this.Ua=e,this.$a=e.rows*Er,this.Ya=e.columns*Br}}var Js,Qs;e.OnScreenMenuButtonType=void 0,(Js=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[Js.ZoomIn=0]="ZoomIn",Js[Js.ZoomInX=1]="ZoomInX",Js[Js.ZoomInY=2]="ZoomInY",Js[Js.ZoomOut=3]="ZoomOut",Js[Js.ZoomOutX=4]="ZoomOutX",Js[Js.ZoomOutY=5]="ZoomOutY",Js[Js.ZoomToFit=6]="ZoomToFit",Js[Js.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(Qs=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[Qs.Circle=0]="Circle",Qs[Qs.Rectangle=1]="Rectangle",Qs[Qs.RoundedRectangle=2]="RoundedRectangle";const tr={x:-43,y:0},er={x:-65,y:0},ir={x:-86,y:0},sr={x:-107,y:-1},rr={x:-128,y:-3},nr={x:-150,y:0},or={x:-171,y:0},hr={x:-276,y:0},ar={x:-298,y:0},lr={x:0,y:0},ur={x:-21,y:0};class cr extends Ks{constructor(t,e,i,s){super(t,i),this.Xa=gt.document.createElement("button"),this.ja=gt.document.createElement("div"),this.Za=gt.document.createElement("label"),this.Ua=i,this.Ka=e,this.qa=s}Ja(t,e,i,s){this.Qa(t,s),this.tl(),this.il(e),this.sl(),this.Za.textContent=i||"";const r=gt.document.createElement("div");this.el(r),this.Xa.onclick=this.onClick.bind(this),r.appendChild(this.ja),r.appendChild(this.Za),this.Xa.appendChild(r)}sl(){this.Xa.style.cursor="pointer"}el(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}il(t){"string"==typeof t?(this.ja.style.backgroundImage=`url(${t})`,this.ja.style.backgroundSize="100%",this.ja.style.backgroundRepeat="no-repeat",this.ja.style.backgroundPosition="center",this.ja.style.width="20px",this.ja.style.height="20px"):this.applyStyleForSprite(t),this.ja.style.margin="auto"}tl(){switch(this.Ka){case e.OnScreenMenuButtonShape.RoundedRectangle:this.Xa.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.Xa.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.Xa.style.borderRadius="31px"}}Qa(t,e){this.Xa.style.width=`${this.Ya.toString()}px`,this.Xa.style.height=`${this.$a.toString()}px`,this.Xa.style.backgroundColor=t,this.Xa.style.opacity=e||kr,this.Xa.style.alignItems="center",this.Xa.style.border="2px solid #707070",this.Xa.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.ja.style.backgroundImage=`url(${this.Fh}/${Ir})`,this.ja.style.backgroundPositionX=`${t.x}px`,this.ja.style.backgroundPositionY=`${t.y}px`,this.ja.style.backgroundSize="1600%",this.ja.style.backgroundRepeat="no-repeat",this.ja.style.width="20px",this.ja.style.height="20px"}hl(t){return t.appendChild(this.Xa),t}rl(){return this.Xa}}class dr extends cr{constructor(t,e,i,s){super(t,e,i,s),this.nl="",this.ol="",this.al=!1,this.qa=s}ll(){this.ul(),this.onToggledStateAction()}cl(){this.dl(),this.onInitialStateAction()}dl(){this.fl(this.nl)}ul(){this.fl(this.ol)}fl(t){"string"==typeof t?this.ja.style.background=t:(this.ja.style.backgroundImage=`url(${this.Fh}/${Ir})`,this.ja.style.backgroundPositionX=`${t.x}px`,this.ja.style.backgroundPositionY=`${t.y}px`)}onClick(){this.al?this.cl():this.ll(),this.al=!this.al}}class fr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),tr)}onClick(){const t=this.qa.pl();t&&this.qa.zoom(t,{x:-1,y:-1})}}class gr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),sr)}onClick(){const t=this.qa.pl();t&&this.qa.zoom(t,{x:-1,y:0})}}class mr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),nr)}onClick(){const t=this.qa.pl();t&&this.qa.zoom(t,{x:0,y:-1})}}class pr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),er)}onClick(){const t=this.qa.pl();t&&this.qa.zoom(t,{x:1,y:1})}}class yr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),rr)}onClick(){const t=this.qa.pl();t&&this.qa.zoom(t,{x:1,y:0})}}class xr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),or)}onClick(){const t=this.qa.pl();t&&this.qa.zoom(t,{x:0,y:1})}}class Sr extends dr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.nl=hr,this.ol=ar,this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),this.nl)}onToggledStateAction(){this.qa.setAnimationsEnabled(!1)}onInitialStateAction(){this.qa.setAnimationsEnabled(!0)}}class vr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),ir)}onClick(){this.qa.forEachAxis((t=>{t.fit(!0)}))}}class br extends cr{constructor(t,e,i){super(t,e.shape||Cr,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.Ja(r,n,o,h),this.ml=e.action}onClick(){this.ml(this.qa)}}class Mr extends dr{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.qa=i,this.yl=s,this.nl=ur,this.ol=lr,this.Ja(Pr,this.nl)}dl(){this.fl(this.nl),this.Xa.style.backgroundColor=Pr,this.Xa.style.border="2px solid #707070",this.Xa.style.margin="0px"}ul(){this.fl(this.ol),this.Xa.style.background="#FECC00 0% 0% no-repeat padding-box",this.Xa.style.border="10px solid #BCBCBC12",this.Xa.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.yl)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.yl)||void 0===t||t.style.setProperty("display","none")}}var Ar;e.MouseStyles=void 0,(Ar=e.MouseStyles||(e.MouseStyles={})).Move="move",Ar.ResizeColumn="col-resize",Ar.ResizeRow="row-resize",Ar.Horizontal="ew-resize",Ar.Vertical="ns-resize",Ar.NorthWest="nw-resize",Ar.NorthEast="ne-resize",Ar.Copy="copy",Ar.CrossHair="crosshair",Ar.Default="default",Ar.Help="help",Ar.Restricted="not-allowed",Ar.None="none",Ar.Point="pointer",Ar.Text="text",Ar.Wait="wait",Ar.ZoomIn="zoom-in",Ar.ZoomOut="zoom-out";const wr={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)},Dr=new z({color:A(255,255,255,0)}),Tr=new tt({thickness:1,fillStyle:Dr}),Er=60,Br=60,kr="1.0",Ir="osm/osm-sprite-transparent.png",Cr=e.OnScreenMenuButtonShape.Circle,Pr="#363636";var Lr;e.OSMPosition=void 0,(Lr=e.OSMPosition||(e.OSMPosition={}))[Lr.TopRight=0]="TopRight",Lr[Lr.TopLeft=1]="TopLeft",Lr[Lr.BottomLeft=2]="BottomLeft",Lr[Lr.BottomRight=3]="BottomRight";const Rr=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.vl?(this.bl.splice(t,1),t-=1):this.bl[t].state&&(s=!0);return this.xl?0===e.interactions.length&&(this.bl.push({state:!1,time:i}),this.xl=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.bl.push({state:!0,time:i}),s=!0,this.xl=!0),s}Gs(t,e,i){if(i){const i=this.bl.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Ml(t,e),this.bl.length=0)}}},Or=class{constructor(t,e,i,s=1,r=100){this._l=t,this.Al=e,this.wl=i,this.kl=s,this.Cl=r}Sl(t,e){const i=e.interactions.length;if(i===this.kl){if(void 0!==this.Tl)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=Rr(t);let s=0;for(let r=0;r{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 Nr{constructor(){this.Ri=!0,this.P=new r.Eventer,this.Bl=0,this.Ll=(t,e)=>{0===this.Bl&&this.P.emit("mouseEnter",this,e),this.Bl+=1},this.Ol=(t,e)=>{this.Bl-=1,this.Bl<1&&(this.P.emit("mouseLeave",this,e),this.Bl=0)},this.Rl=(t,e)=>{this.P.emit("mouseClick",this,e)},this.El=(t,e)=>{this.P.emit("mouseDoubleClick",this,e)},this.zl=(t,e)=>{this.P.emit("mouseDown",this,e)},this.Vl=(t,e)=>{this.P.emit("mouseUp",this,e)},this.Nl=(t,e)=>{this.P.emit("mouseMove",this,e)},this.Gl=(t,e,i)=>{this.P.emit("mouseDragStart",this,e,i)},this.Hl=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.Wl=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.Ul=(t,e)=>{this.P.emit("mouseWheel",this,e)},this.$l=(t,e)=>{this.Bl+=1,this.P.emit("touchStart",this,e)},this.Yl=(t,e)=>{this.P.emit("touchMove",this,e)},this.Xl=(t,e)=>{this.Bl-=1,this.P.emit("touchEnd",this,e)},this.jl=t=>(t instanceof Bs?t.setMouseEnterEventHandler(this.Ll).setMouseLeaveEventHandler(this.Ol).setMouseClickEventHandler(this.Rl).setMouseDoubleClickEventHandler(this.El).setMouseDownEventHandler(this.zl).setMouseUpEventHandler(this.Vl).setMouseMoveEventHandler(this.Nl).setMouseDragEventHandler(this.Hl).setMouseDragStartEventHandler(this.Gl).setMouseDragStopEventHandler(this.Wl).setMouseWheelEventHandler(this.Ul).setTouchStartEventHandler(this.$l).setTouchMoveEventHandler(this.Yl).setTouchEndEventHandler(this.Xl):(t.onMouseEnter(this.Ll),t.onMouseLeave(this.Ol),t.onMouseClick(this.Rl),t.onMouseDoubleClick(this.El),t.onMouseDown(this.zl),t.onMouseUp(this.Vl),t.onMouseMove(this.Nl),t.onMouseDrag(this.Hl),t.onMouseDragStart(this.Gl),t.onMouseDragStop(this.Wl),t.onMouseWheel(this.Ul),t.onTouchStart(this.$l),t.onTouchMove(this.Yl),t.onTouchEnd(this.Xl)),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.Bl>0}setVisible(t){const e=this.Ri!==t;return this.Ri=t,e&&this.P.emit("visibleStateChanged",this,this.Ri),this}getVisible(){return this.Ri}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}const Gr=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.Yt(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.Yt({x:o.x.getInnerStart(),y:o.y.getInnerStart()},Qe({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.Yt({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},Qe({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),Xt(s)}},Ur=(t,e,i,s,r)=>{Gr(t,r,e)},Hr=(t,e,i,s,r)=>{Gr(t,s,r)};class Wr extends Nr{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.ce=!1,this.Zl=void 0,this.Kl=void 0,this.ql=Vr,this.Jl=void 0,this.Ql=()=>{const t="function"==typeof this.ql?this.ql(this):this.ql;t&&(this.Kl=this.Lr.Li.Ae(t))},this.tu=()=>{this.Lr.Li.we(this.Kl)},this._t=x(0,0,0,0),this.Lr=t,this.renderingScale=e,this.scale=i,this.vr=s,this.hs=r,this.Lr.Bi(),this.onMouseEnter(this.Ql),this.onMouseLeave(this.tu),this.onMouseDrag(Ur);const n=Fr(new Or(bt,Hr,bt));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.hs=r}setEffect(t){return this.iu=this.iu||this.Lr.Li.iu.su(this,{eu:{shapes:this.hu()}}),this.iu.eu.vs(t),this}getEffect(){return!!this.iu&&this.iu.eu._s()}setAutoDispose(t){return this.Jl=t,this.Lr.Bi(),this}getAutoDispose(){return this.Jl}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this._t.left+this._t.right),this.size.y+(this._t.bottom+this._t.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this._t="object"==typeof t?v(this._t,t):{left:t,top:t,right:t,bottom:t},this.Lr.Bi(),this}getMargin(){return this._t}ru(){if(this.Jl){const t=this.size,e=this.renderingScale.Et(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.Jl.type&&i.x>=this.Jl.maxWidth||"max-height"===this.Jl.type&&i.y>=this.Jl.maxHeight)&&this.dispose()}return this}Gs(){return this}dispose(){return this.ce||(this.Lr.Bi(),this.ce=!0,this.vr(this),this.P.emit("dispose",this)),this}setVisible(t){return super.setVisible(t),this.Lr.Bi(),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setPosition(t){return this.position=t,this.Lr.Bi(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.Yt(this.position,Qe({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.Yt(r,Qe({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.Yt(r,{x:this._t.left,y:this._t.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.Yt(n,Qe({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Lr.Bi(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Zl=t,this.Lr.Bi(),this}getDraggingMode(){return void 0!==this.Zl?this.Zl:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.ql=t,this}getMouseStyle(){return this.ql}}class Yr extends Wr{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.rn=x(),this.nu=0,this.Lr=t,this.ou=s,this.backgroundElement=new this.ou(this.Lr,this.renderingScale,this.scale,bt,n),this.jl(this.backgroundElement)}hu(){return this.backgroundElement.hu()}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}ru(){return super.ru(),this.ce||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).ru(),this}Gs(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.au(t).Gs(),super.Gs()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.rn="object"==typeof t?v(this.rn,t):{left:t,top:t,right:t,bottom:t},this.Lr.Bi(),this}getPadding(){return this.rn}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.rn.left+this.rn.right,i.y+this.rn.bottom+this.rn.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.lu()+this.backgroundElement.uu(),i.y+this.backgroundElement.cu()+this.backgroundElement.du())),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.Yt(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.Yt(n,Qe({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.Yt(n,{x:this.backgroundElement.lu(),y:this.backgroundElement.cu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.Yt(o,Qe({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.Yt(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.Yt(a,Qe({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.nu}setHighlight(t){return this.nu=me(t),this.backgroundElement.setHighlight(t),this.P.emit("highlight",t),this}}const qr=t=>"setBackground"in t;class Xr extends Nr{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.u=0,this.fu=1,this.gu=!0,this.pu=new Yi,this.mu=!0,this.ce=!1,this.axisScale=s,this.renderingScale=r,this.yu=o,this.Su=h,this.xu=a,this.vr=l,this.bu=e,this.vu=i,this.Mu=this.jl(this.bu._u(this.renderingScale)),this.hs=u,this.Au=this.jl(this.xu.wu(this.vu,this.renderingScale,n,bt,this.hs,!1).setOrigin(Yt(this.Su)).setDirection(this.Su)),this.axis=t,this.setMouseInteractions(!1),"major"===this.Au.ku?this.Mu.ea(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.Au.ku?this.Mu.ea(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.Au.ku&&this.Mu.ea(u.cursorGridStrokeStyleX)}setValue(t){return this.u=t,this.vu.Bi(),this.P.emit("valueChange",this.u),this}getValue(){return this.u}setTextFormatter(t){return this.Cu=t,this.vu.Bi(),this}setTickLength(t){return this.Au.setPointerLength(t),this.bu.Bi(),this}getTickLength(){return this.Au.getPointerLength()}setTickLabelPadding(t){return this.Au.setTickLabelPadding(t),this.bu.Bi(),this}setTickLabelRotation(t){return this.Au.setTextRotation(t),this.bu.Bi(),this}getTickLabelRotation(){return this.Au.getTextRotation()}getTickLabelPadding(){return this.Au.getTickLabelPadding()}setGridStrokeLength(t){return this.fu=t,this.bu.Bi(),this}getGridStrokeLength(){return this.fu}setGridStrokeStyle(t){return this.Mu.ea(t),this.bu.Bi(),this}getGridStrokeStyle(){return this.Mu.ha()}dispose(){return this.ce||(this.ce=!0,this.Mu.dispose(),this.Au.dispose(),this.vr(this),this.bu.Li.Bi(),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.gu=t,this.vu.Bi(),this}getMarkerVisible(){return this.gu}setMarker(t){return t(this.Au),this.vu.Bi(),this}getMarker(){return this.Au}setMouseInteractions(t){return this.Au.setMouseInteractions(t),this.Mu.setMouseInteractions(t),this}getMouseInteractions(){return this.Mu.getMouseInteractions()}setAllocatesAxisSpace(t){return this.mu=t,this.vu.Bi(),this}getAllocatesAxisSpace(){return this.mu}isInScale(){return Pe(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 $r extends Xr{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.Tu=!1,this.vr=a,this.bu=e,this.vu=i}dispose(){return this.Tu=!1,super.dispose()}update(){return this}plot(t,e,i,s){if(this.isInScale()&&this.getVisible()){this.Tu=!1;const r=rt(this.u,this.axisScale,this.yu.getWidth(this.renderingScale));this.Mu.setVisible(!0).la(this.yu.toPoint(r,t)).Ko(this.yu.toPoint(r,t-(i+e*this.fu))),this.gu?(this.Cu&&this.Au.setText(this.Cu(this.u,this)),this.Au.setVisible(!0).setPosition(this.yu.toPoint(r,s))):this.Au.setVisible(!1)}else this.Mu.setVisible(!1),this.Au.setVisible(!1);return this.Au.Gs().ru(),this}Iu(){const t=this.Au.Gs().getSize();return this.yu.getHeight(t)}}var jr;e.HighlightModes=void 0,(jr=e.HighlightModes||(e.HighlightModes={}))[jr.noHighlighting=0]="noHighlighting",jr[jr.onHover=1]="onHover",jr[jr.onHoverIndividual=2]="onHoverIndividual";class Zr{constructor(t,i,s,n){this.Fu=!0,this.Pu=e.HighlightModes.onHover,this.ce=!1,this.Ri=!0,this.Du=0,this.P=new r.Eventer,this.Bu=[],this.Lu=(t,e)=>{this.setVisible(e)},this.Ou=()=>this.setHighlight(1),this.Ru=()=>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.Eu=(t,e)=>{0===this.Du&&this.P.emit("mouseEnter",this,e),this.zu()},this.Vu=(t,e)=>{1===this.Du&&this.P.emit("mouseLeave",this,e),this.Nu()},this.Gu=(t,e)=>{this.P.emit("mouseMove",this,e),this.Hu()},this.Wu=(t,e)=>this.P.emit("mouseClick",this,e),this.Uu=(t,e)=>this.P.emit("mouseDoubleClick",this,e),this.$u=(t,e)=>this.P.emit("mouseDown",this,e),this.Yu=(t,e)=>this.P.emit("mouseUp",this,e),this.Xu=(t,e,i)=>{this.P.emit("mouseDragStart",this,e,i)},this.ju=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.Zu=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.Ku=(t,e)=>{this.P.emit("mouseWheel",this,e)},this.qu=(t,e)=>{this.P.emit("touchStart",this,e),this.zu()},this.Ju=(t,e)=>{this.P.emit("touchMove",this,e),this.Hu()},this.Qu=(t,e)=>{this.P.emit("touchEnd",this,e),this.Nu()},this.qa=t,this.tc=i,this.hs=s,this.de=new Map,this.ic=n,this.iu=this.ic.su(this,{sc:{themeEffectEnabled:this.hs.effectsText},hc:{}}),this.qa.Li.Vh.Se(this,(t=>{this.de.forEach(((e,i)=>i.Ir(t))),this.Bu.forEach((e=>{e.setHighlight(t)}))}),{animationEnabled:this.qa.getAnimationsEnabled()})}rc(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.de.set(t,{isText:s});const r=Array.from(this.de);this.iu.sc.nc(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.iu.hc.nc(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Fu).setVisible(this.Ri).Ir(this.getHighlight()),i&&t.setMouseEnterEventHandler(this.Eu).setMouseLeaveEventHandler(this.Vu).setMouseClickEventHandler(this.Wu).setMouseDoubleClickEventHandler(this.Uu).setMouseDownEventHandler(this.$u).setMouseUpEventHandler(this.Yu).setMouseMoveEventHandler(this.Gu).setMouseDragStartEventHandler(this.Xu).setMouseDragEventHandler(this.ju).setMouseDragStopEventHandler(this.Zu).setMouseWheelEventHandler(this.Ku).setTouchStartEventHandler(this.qu).setTouchMoveEventHandler(this.Ju).setTouchEndEventHandler(this.Qu)}oc(t){this.de.delete(t)}setEffect(t){return this.iu.sc.vs(t&&this.hs.effectsText),this.iu.hc.vs(t),this.qa.Li.Bi(),this}getEffect(){return this.iu.sc._s()||this.iu.hc._s()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setName(t){return this.ac=t,this.Bu.forEach((t=>t.setText(this.ac))),this}getName(){return this.ac}dispose(){return this.ce||(this.ce=!0,this.de.forEach(((t,e)=>e.dispose())),this.tc(this),this.Bu.forEach((t=>{t.dispose()})),this.Bu.length=0,this.P.emit("dispose",this),this.qa.Li.Bi()),this}setVisible(t){return t===this.Ri||(this.Ri=t,this.de.forEach(((e,i)=>i.setVisible(t))),this.Bu.forEach((e=>e.setOn(t))),this.P.emit("visibleStateChanged",this,this.Ri),this.qa.Li.Bi()),this}getVisible(){return this.Ri}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}setHighlight(t){return this.qa.Li.Vh.xe(this,t),this.P.emit("highlight",t),this}getHighlight(){return this.qa.Li.Vh.be(this)}setAnimationHighlight(t){return this.qa.Li.Vh.ve(this,t),this}getAnimationHighlight(){return this.qa.Li.Vh.Me(this)}setMouseInteractions(t){return this.Fu=t,this.de.forEach(((e,i)=>i.setMouseInteractions(t))),this.qa.Li.Bi(),this}getMouseInteractions(){return this.Fu}getIsUnderMouse(){return this.Du>0}setHighlightOnHover(t){return this.Pu=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Pu!==e.HighlightModes.noHighlighting}attach(t,e=!0){t.setText(this.ac),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.Lu),t.setLocked(!e),t.onMouseEnter(this.Ou),t.onMouseLeave(this.Ru),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),this.Bu.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")}zu(t=1){this.Du+=t,this.Du===t&&this.Pu===e.HighlightModes.onHover&&this.setHighlight(!0)}Nu(t=1){this.Du=Math.max(0,this.Du-t),0===this.Du&&this.Pu===e.HighlightModes.onHover&&this.setHighlight(!1)}Hu(){}}class Kr extends Zr{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Lr=t,this.axis=s,this.ct=r,this.lc=n,this.uc()}}class Jr extends Kr{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.ac="Band",this.cc=0,this.dc=0,this.Vr=this.hs.bandFillStyle,this.$r=this.hs.bandStrokeStyle,this.fc=this.Lr.gc(this.ct).ps(this.Vr).$h(this.$r).Ir(this.getHighlight()),this.rc(this.fc)}setValueStart(t){return this.cc=t,this.P.emit("valueChange",this,this.cc,this.dc),this.Lr.Bi(),this}getValueStart(){return this.cc}setValueEnd(t){return this.dc=t,this.P.emit("valueChange",this,this.cc,this.dc),this.Lr.Bi(),this}getValueEnd(){return this.dc}setFillStyle(t){this.Vr="function"==typeof t?t(this.Vr):t;const e=this.Vr;return this.fc.ps(e),this.Lr.Bi(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){this.$r="function"==typeof t?t(this.$r):t;const e=this.$r;return this.fc.$h(e),this.Lr.Bi(),this}getStrokeStyle(){return this.$r}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}ru(){return this.fc.Sn(this.lc.toVec2(this.cc,this.lc.getHeight(this.ct).getInnerStart())).q(this.lc.toVec2(this.dc-this.cc,this.lc.getHeight(this.ct).getInnerInterval())),this}attach(t,e){return super.attach(t,e),oe(t,this.hs,{fill:this.Vr,stroke:this.$r}),this}mc(t,e){t.Ir(e),this.Lr.Bi()}uc(){let t,i;const s=(e,s)=>{const r=nt(this.Lr.Li.ke(s.x,s.y),this.Lr.Li.ct,this.ct),n=this.lc.getWidth(r),o=this.axis.ct.ut(this.cc),h=this.axis.ct.ut(this.dc),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.lc.getWidth(n);t?(this.cc=this.axis.ct.Yt(this.cc,h),this.dc=this.axis.ct.Yt(this.dc,h)):i?this.cc=this.axis.ct.Yt(this.cc,h):this.dc=this.axis.ct.Yt(this.dc,h),Xt(o),this.P.emit("valueChange",this,this.cc,this.dc),this.Lr.Bi()};this.onMouseMove(((i,r)=>{s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.lc.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.yc=this.qa.engine.setMouseStyle(n,this.yc)})),this.onMouseLeave((()=>{this.qa.engine.restoreMouseStyle(this.yc),this.yc=void 0})),this.onMouseDrag(((t,e,i,s,n)=>{0===i&&r(0,0,0,n,e)}));const n=Fr(new Or(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Qr extends Kr{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.ac="Constant Line",this.u=0,this.$r=this.hs.constantLineStrokeStyle,this.Sc=!0,this.xc=this.Lr._u(this.ct).ea(this.$r).Ir(this.getHighlight()),this.rc(this.xc)}setValue(t){return this.u=t,this.P.emit("valueChange",this,this.u),this.Lr.Bi(),this}getValue(){return this.u}setStrokeStyle(t){this.$r="function"==typeof t?t(this.$r):t;const e=this.$r;return this.xc.ea(e),this.Lr.Bi(),this}getStrokeStyle(){return this.$r}setInteractionMoveByDragging(t){return this.Sc=t,this}getInteractionMoveByDragging(){return this.Sc}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}ru(){return this.xc.la(this.lc.toVec2(this.u,this.lc.getHeight(this.ct).getInnerStart())).Ko(this.lc.toVec2(this.u,this.lc.getHeight(this.ct).getInnerEnd())),this}attach(t,e){return super.attach(t,e),oe(t,this.hs,{stroke:this.$r}),this}mc(t,e){t.Ir(e),this.Lr.Bi()}uc(){const t=(t,e)=>{this.Sc&&(this.u=this.axis.ct.Yt(this.u,this.lc.getWidth(e)),this.P.emit("valueChange",this,this.u),this.Lr.Bi(),Xt(t))};this.onMouseMove((()=>{if(this.Sc){const t=this.lc.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.yc=this.qa.engine.setMouseStyle(t,this.yc)}})),this.onMouseLeave((()=>{this.Sc&&(this.qa.engine.restoreMouseStyle(this.yc),this.yc=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this.Sc&&0===s&&t(i,n)}));const i=Fr(new Or(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const tn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),en=(t,e)=>(oe(t.setButtonOffSize(e.uiButtonSize).setButtonOnSize(e.uiButtonSize),e,{fill:e.uiButtonFillStyle}),t),sn=(t,e,i)=>{i&&qr(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},rn={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}},nn={background:void 0,setBackground(t){return{...this,background:t}}},on={wu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return sn(o,r,n),o}},hn={wu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return sn(o,r,n),o}};class an extends Wr{constructor(){super(...arguments),this.bc=!0}ru(){return super.ru(),this}setMouseInteractions(t){return this.bc=t,this}getMouseInteractions(){return this.bc}hu(){return[]}}class ln extends an{onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}au(t){return this.size=t,this}lu(){return 0}uu(){return 0}du(){return 0}cu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return F}setStrokeStyle(){return this}getStrokeStyle(){return J}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class un extends ln{constructor(){super(...arguments),this.setSize=this.au.bind(this)}}class cn extends Wr{constructor(){super(...arguments),this.Vr=F,this.P=new r.Eventer,this.nu=0}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}hu(){return[this.Dn]}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.Dn.ps(this.Vr),this.Lr.Bi(),this}getFillStyle(){return this.Vr}getHighlight(){return this.nu}setHighlight(t){return this.nu=t,this.Dn.Ir(t),this.P.emit("highlight",t),this.Lr.Bi(),this}setMouseInteractions(t){return this.Dn.setMouseInteractions(t),this}getMouseInteractions(){return this.Dn.getMouseInteractions()}dispose(){return super.dispose(),this.Dn.dispose(),this}setVisible(t){return super.setVisible(t),this.Dn.setVisible(t),this}}class dn extends cn{constructor(){super(...arguments),this.$r=J}setStrokeStyle(t){return this.$r="function"==typeof t?t(this.$r):t,this.Dn.$h(this.$r),this.Lr.Bi(),this}getStrokeStyle(){return this.$r}}class fn extends dn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Lr=t,this.Dn=this.Lr.vc(this.renderingScale,Ws.Simple).$h(this.getStrokeStyle()).ps(this.getFillStyle()).setVisible(!1),this.jl(this.Dn)}Mc(){const t=this._c();if(t.length>2){const e=ze(t),i=u(e.max.x-e.min.x,e.max.y-e.min.y);this.setContentSize(i);const s=t.map((t=>{const s=Ke(t,Ze(e.min,-1));return this.scale.Yt(this.position,Ke(s,Qe(Ze(Ke(this.origin,u(1,1)),-.5),i)))})).map((t=>nt(t,this.scale,this.renderingScale)));this.Dn.lo(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.Dn&&this.Dn.setVisible(!1),this.setContentSize(u(0,0))}ru(){return super.ru(),this.ce||this.Mc(),this}Gs(){return this.Mc(),super.Gs()}setVisible(t){return super.setVisible(t),this.Dn.setVisible(t),this}}class gn extends cn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Kr="label",this.Dn=this.Lr.ue(this.renderingScale).ps(this.Vr).fs(this.Kr),this.jl(this.Dn)}ru(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=nt(t,this.scale,this.renderingScale);return this.Dn.Sn(i),this}Gs(){this.Dn.Gs();const t=0===this.Kr.length?u(0,0):this.Dn.Ac();return this.setContentSize(t),super.Gs()}setText(t){return this.Kr=t,this.Dn.fs(this.Kr),this.Lr.Bi(),this}getText(){return this.Kr}setFont(t){return this.Dn.Ss(t),this.Lr.Bi(),this}getFont(){return this.Dn.ys()}setTextRotation(t){return this.Dn.xs(t),this.Lr.Bi(),this}getTextRotation(){return this.Dn.bs()}}const mn={...rn,...on,uiElement:gn};class pn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.au.bind(this),this.setSize=this.fitTo,this.Dn=this.Lr.gc(e).ps(this.Vr).$h(this.getStrokeStyle()),this.jl(this.Dn)}ru(){const t=ze([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>nt(t,this.scale,this.renderingScale)))),i={x:t.max.x-t.min.x,y:t.max.y-t.min.y};return this.Dn.q(i).Sn(nt(this.getPosition(u(-1,-1),e.UISpace.Content),this.scale,this.renderingScale)),this}au(t){return this.setContentSize(t),this.Lr.Bi(),this}lu(){return 0}uu(){return 0}du(){return 0}cu(){return 0}}class yn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.wc=u(0,0),this.setSize=this.fitTo.bind(this),this.Dn=t.kc(e).Zo(0).Ko(360).ps(this.Vr).$h(this.getStrokeStyle()),this.jl(this.Dn)}ru(){const t=this.getSize(e.UISpace.Content).x/2;return this.Dn.Jo(t*this.renderingScale.yi().x).Qo(t*this.renderingScale.yi().y).Sn(nt(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).ia(255).Gs(),this}au(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.wc=t,this.Lr.Bi(),this}lu(){return(this.getSize(e.UISpace.Content).x-this.wc.x)/2}uu(){return(this.getSize(e.UISpace.Content).x-this.wc.x)/2}du(){return(this.getSize(e.UISpace.Content).y-this.wc.y)/2}cu(){return(this.getSize(e.UISpace.Content).y-this.wc.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.wc=t,this}}class xn extends fn{constructor(t,e,i,s,r){super(t,e,i,Ws.Simple,s,r),this.Cc=y(u(0,0)),this.Tc=!1,this.setSize=this.fitTo.bind(this),this.Lr=t,this.Mc()}_c(){const t=this.Cc.M();if(this.Tc){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.Cc.M().x*this.Cc.M().x/4+this.Cc.M().y*this.Cc.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=Ke(r,Ke(i,s)),o=Ke(n,Ke(s,Ze(i,-1)));return[r,n,o,Je(o,Ke(i,s))]}au(t){return this.Cc.S(t),this.Tc=!1,this.Lr.Bi(),this}lu(){return this.Tc?0:(this.getSize(e.UISpace.Content).x-this.Cc.M().x)/2}uu(){return this.Tc?0:(this.getSize(e.UISpace.Content).x-this.Cc.M().x)/2}du(){return this.Tc?0:(this.getSize(e.UISpace.Content).y-this.Cc.M().y)/2}cu(){return this.Tc?0:(this.getSize(e.UISpace.Content).y-this.Cc.M().y)/2}fitTo(t){return this.Cc.S(t),this.Tc=!0,this.Lr.Bi(),this}}class Sn extends fn{constructor(t,i,s,r,n){super(t,i,s,Ws.Simple,r,n),this.Ic=y(u(0,0)),this.Fc=y(10),this.Pc=y(void 0),this.Su=y(e.UIDirections.Right),this.Mc()}setDirection(t){return this.Su.S(t),this.Lr.Bi(),this}getDirection(){return this.Su.M()}setPointerLength(t){return this.Fc.S(t),this.Lr.Bi(),this}getPointerLength(){return this.Fc.M()}setPointerAngle(t){return this.Pc.S(t),this.Lr.Bi(),this}getPointerAngle(){let t=this.Pc.M();if(void 0===t){const e=this.Dc();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)}au(t){return this.Ic.S(t),this.Lr.Bi(),this}Bc(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}Lc(){return qt(this.Su.M())?this.Ic.M().x:this.Ic.M().y}Dc(){return qt(this.Su.M())?this.Ic.M().y:this.Ic.M().x}lu(){switch(this.Su.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.Bc()-this.Dc());default:return 0}}uu(){switch(this.Su.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.Bc()-this.Dc());default:return 0}}du(){switch(this.Su.M()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Bc()-this.Dc());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}cu(){switch(this.Su.M()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Bc()-this.Dc());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}_c(){const t=Yt(this.Su.M()),e=$e(u(0,0),t),i=this.getPointerLength(),s=this.Bc(),r=this.Lc(),n=this.Dc();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=Ke(Ke(o,Ze(t,-i)),Ze(e,s/2)),a=Ke(h,Ze(e,(n-s)/2)),l=Ke(a,Ze(t,-r)),c=Ke(Ke(o,Ze(t,-i)),Ze(e,-s/2)),d=Ke(c,Ze(e,-(n-s)/2)),f=Ke(d,Ze(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:Mt(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class vn extends an{setSize(t){return this.setContentSize(t),this.Lr.Bi(),this}}class bn extends Yr{constructor(){super(...arguments),this.Oc=[],this.Rc=0,this.Ec=t=>{const e=this.Oc.indexOf(t);e>=0&&this.Oc.splice(e,1)}}getMembers(){return this.Oc}getMemberCount(){return this.Oc.length}setMinimumSize(t){return this.zc=t,this.Lr.Bi(),this}getMinimumSize(){return this.zc}addElement(t,e=-1){const i=t.wu(this.Lr,this.renderingScale,this.scale,this.Ec,this.hs,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.Oc.splice(e,0,i):this.Oc.push(i),i.setVisible(this.getVisible()),this.jl(i),this.ce&&(de(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.Oc.slice().forEach(vt),this}setVisible(t){return super.setVisible(t),this.Oc.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.Rc)/i:0;return this.Oc.reduce(((e,i)=>i instanceof vn?this.scale.Yt({x:e,y:t.y},{x:s+i.getSize().x,y:0}).x:i.setOrigin(u(-1,1)).setPosition(u(e,t.y)).ru().getPosition(u(1,0)).x),t.x),this}Gs(){for(let t=0;tt+ +(e instanceof vn)),0),s=i>0?(this.size.y-this.Rc)/i:0;return this.Oc.reduce(((e,i)=>i instanceof vn?this.scale.Yt({x:t.x,y:e},{x:0,y:-(s+i.getSize().y)}).y:i.setOrigin(u(-1,1)).setPosition(u(t.x,e)).ru().getPosition(u(0,-1)).y),t.y),this}Gs(){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},Cn=In("Text",[]),Pn={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()}},Ln={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()}},Rn={...rn,...nn,background:pn,wu(t,e,i,s,r,n){const o=new Mn(t,e,i,this.background,s,r),h=o.addElement(mn,void 0),a=Object.assign(o,kn,{setTextLabel:h},Cn,{stylableTexts:[h]});return sn(a,r,n),this.applyStylers(a,r)}}.addStyler(tn),Fn={...rn,...nn,background:Sn,wu(t,i,s,r,n,o){const h=new Mn(t,i,s,this.background,r,n),a=h.addElement(mn,void 0),l=h.getBackground(),u=Object.assign(h,kn,{setTextLabel:a},Cn,{stylableTexts:[a]},Ln,{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.ku="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))),sn(u,n,o),this.applyStylers(u,n)}};class _n extends Wr{constructor(t,e,i,s,n,o,h){super(t,e,i,o,h),this.xl=!1,this.P=new r.Eventer,this.getOn=()=>this.xl,this.Nc=this.jl(new s(this.Lr,this.renderingScale,this.scale,bt,h)),this.Gc=this.jl(new n(this.Lr,this.renderingScale,this.scale,bt,h))}hu(){return[...this.Nc.hu(),...this.Gc.hu()]}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setOn(t){return this.xl=t,this.Lr.Bi(),this}setOffFillStyle(t){return this.Nc.setFillStyle(t),this}getOffFillStyle(){return this.Nc.getFillStyle()}setOffStrokeStyle(t){return this.Nc.setStrokeStyle(t),this}getOffStrokeStyle(){return this.Nc.getStrokeStyle()}setOffSize(t){return this.Nc.fitTo("number"==typeof t?u(t,t):t),this}getOffSize(){return this.Nc.getSize()}setOnFillStyle(t){return this.Gc.setFillStyle(t),this}getOnFillStyle(){return this.Gc.getFillStyle()}setOnStrokeStyle(t){return this.Gc.setStrokeStyle(t),this}getOnStrokeStyle(){return this.Gc.getStrokeStyle()}setOnSize(t){return this.Gc.fitTo("number"==typeof t?u(t,t):t),this}getOnSize(){return this.Gc.getSize()}ru(){return super.ru(),this.xl?(this.Nc.setVisible(!1),this.Gc.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).ru()):(this.Nc.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).ru(),this.Gc.setVisible(!1)),this}Gs(){const t=this.Nc.Gs().getSize(),e=this.Gc.Gs().getSize();return this.setContentSize(u(Math.max(t.x,e.x),Math.max(t.y,e.y))),super.Gs()}dispose(){return super.dispose(),this.Nc.dispose(),this.Gc.dispose(),this}setMouseInteractions(t){return this.Gc.setMouseInteractions(t),this.Nc.setMouseInteractions(t),this}getMouseInteractions(){return this.Gc.getMouseInteractions()}setHighlight(t){const e=me(t);return this.Gc.setHighlight(e),this.Nc.setHighlight(e),this.P.emit("highlight",t),this.Lr.Bi(),this}getHighlight(){return this.Gc.getHighlight()}}const On={...rn,uiElement:_n,pictureOff:yn,pictureOn:yn,setPictureOff(t){return{...this,pictureOff:t}},setPictureOn(t){return{...this,pictureOn:t}},wu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.pictureOff,this.pictureOn,s,r),r);return sn(o,r,n),o}},zn={...rn,...nn,background:pn,buttonBuilder:On,setPictureOff(t){return{...this,buttonBuilder:this.buttonBuilder.setPictureOff(t)}},setPictureOn(t){return{...this,buttonBuilder:this.buttonBuilder.setPictureOn(t)}},wu(t,i,s,r,n,o){const h=new Mn(t,i,s,this.background,r,n),a=h.addElement(En);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(En);u.addGap();const c=u.addElement(mn);u.addGap(),h.addGap();const d=Object.assign(h,kn,{setTextLabel:c},Cn,{stylableTexts:[c]},Pn,{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}),sn(d,n,o),this.applyStylers(d,n)}}.addStyler(tn).addStyler(en);class Vn extends Wr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Hc=[],this.Wc=2,this.Uc="",this.$c=(t,e)=>void 0!==t.label?t.label:vi(t.value,e.min,e.max),this.Yc=0,this.Xc=0,this.jc=!1,this.Lr=t,this.Zc=n,this.Kc=this.jl(t.gc(e).$h(J)),this.qc=this.jl(t.ue(e).ps(r.uiTextFillStyle).Ss(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.Jc=140,this.Qc=25):(this.Jc=160,this.Qc=15)}hu(){return[this.Kc,this.qc]}td(t){this.sd=t;const e=Un(t,"vertical"===this.Zc?0:90,this.jc);return this.Kc.ps(e),this.Lr.Bi(),this}ed(){return this.sd}hd(t){return this.Jc=t,this.Lr.Bi(),this}rd(){return this.Jc}nd(t){return this.Qc=t,this.Lr.Bi(),this}od(){return this.Qc}ad(t){return this.Uc=t,this.Lr.Bi(),this}ld(){return this.Uc}ud(t){return this.$c=t,this.Lr.Bi(),this}setLUTDisplayProportionalSteps(t){if(this.jc=t,this.sd){const t=Un(this.sd,"vertical"===this.Zc?0:90,this.jc);this.Kc.ps(t)}return this.Lr.Bi(),this}getLUTDisplayProportionalSteps(){return this.jc}setFillStyle(t){return this.qc.ps(t),this.Lr.Bi(),this}getFillStyle(){return this.qc.gs()}setFont(t){return this.qc.Ss(t),this.Lr.Bi(),this}getFont(){return this.qc.ys()}setTextRotation(t){return this.Xc=t,this.qc.xs(t),this.Lr.Bi(),this}getTextRotation(){return this.qc.bs()}ru(){var t,i,s,r;if(super.ru(),this.ce)return this;const n=this.sd;if(n){const o=this.renderingScale.yi(),h=n.min,a=n.max;if("vertical"===this.Zc){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=Ke(s,{x:this.Kc.Et().x+this.Wc*o.x,y:0}),l={x:r.x,y:r.y+(this.Uc.length>0?this.Yc*o.y+this.qc.Et().y:0)+.5*((null===(t=this.Hc[0])||void 0===t?void 0:t.Et().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Hc[this.Hc.length-1])||void 0===i?void 0:i.Et().y)||0)};this.Kc.Sn({x:s.x,y:l.y}),this.qc.kn({x:-1,y:-1}).Sn(r),n.getSteps().forEach(((t,e)=>{const i=_e(l,u,this.jc?!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.Hc[e].kn({x:-1,y:0}).Sn(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.Hc.reduce(((t,e)=>Math.max(t,e.Et().y)),0),u=Ke(t,{x:.5*((null===(s=this.Hc[0])||void 0===s?void 0:s.Et().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Hc[this.Hc.length-1])||void 0===r?void 0:r.Et().x)||0)+(this.Uc.length>0?this.Yc*o.x+this.qc.Et().x:0)),y:u.y},f={x:u.x,y:u.y+this.Wc*o.y};this.Kc.Sn(f),this.qc.kn({x:1,y:1}).Sn(c),n.getSteps().forEach(((t,e)=>{const i=_e(u,d,this.jc?!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.Hc[e].kn({x:0,y:1}).Sn(i)}))}}return this}Gs(){if(this.sd&&this.getVisible()){const t=this.sd.getSteps();for(let e=this.Hc.length;eMath.max(t,e.Gs().Ac().x)),0),this.qc.Gs().Ac().x),s=(this.Uc.length>0?this.Yc+this.qc.Gs().Ac().y:0)+e+.5*this.Hc[0].Gs().Ac().y+.5*this.Hc[this.Hc.length-1].Gs().Ac().y;this.setContentSize({x:i,y:s})}else{const t=this.Jc,e=this.Qc;this.Kc.q({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Uc.length>0?this.Yc+this.qc.Gs().Ac().x:0,.5*this.Hc[this.Hc.length-1].Gs().Ac().x),s=t+.5*this.Hc[0].Gs().Ac().x+i,r=e+this.Wc+this.Hc.reduce(((t,e)=>Math.max(t,e.Gs().Ac().y)),0);this.setContentSize({x:s,y:r})}}else this.Hc.forEach((t=>t.dispose())),this.Hc.length=0,this.qc.setVisible(!1),this.Kc.setVisible(!1),this.setContentSize({x:0,y:0});return super.Gs()}dispose(){return super.dispose(),this.Kc.dispose(),this.Hc.forEach(vt),this.qc.dispose(),this}setMouseInteractions(t){return this.Kc.setMouseInteractions(t),this}getMouseInteractions(){return this.Kc.getMouseInteractions()}}const Nn={lutElement:{},setLUT(t){return this.lutElement.td(t),this},getLUT(){return this.lutElement.ed()},setLUTLength(t){return this.lutElement.hd(t),this},getLUTLength(){return this.lutElement.rd()},setLUTThickness(t){return this.lutElement.nd(t),this},getLUTThickness(){return this.lutElement.od()},setLookUpUnit(t){return this.lutElement.ad(t),this},getLookUpUnit(){return this.lutElement.ld()},setLUTStepValueFormatter(t){return this.lutElement.ud(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},Gn={...rn,...nn,background:pn,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},wu(t,e,i,s,r,n){const o=new An(t,e,i,this.background,s,r),h=o.addElement({wu:()=>new Vn(t,e,i,bt,r,this.alignment)}),a=Object.assign(o,Cn,{stylableTexts:[h]},Nn,{lutElement:h});return sn(a,r,n),this.applyStylers(a,r)}}.addStyler(tn),Un=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new Z({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 Vn(t,i,s,bt,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,kn,{setTextLabel:c},Cn,{stylableTexts:[c,d]},In("LUTText",[d]),Pn,{button:l},Nn,{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(tn).addStyler(en),Wn={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 mo?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.ed&&t.ed();let r=i;r||(r=s?Hn.setAlignment(this.alignment):zn);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.dd().forEach((t=>this.addAttachable(t,e,i))),this},addDashboard(t,e,i){return t.getCells().filter((t=>t.panel instanceof mo)).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}},Yn={alignment:"vertical",layoutBuilder:En,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Bn:En}},getAlignment(){return this.alignment},titleBuilder:Rn,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},qn={...rn,...nn,...Yn,background:pn,wu(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).wu(t,e,i,s,r,!1);let h=Object.assign(o,Wn,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.ce});h.entries=[];const a=h.addElement("horizontal"===this.alignment?En:Bn),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}),sn(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class Xn extends Wr{constructor(t,i,s,r,n){super(t,i,s,r,n),this.fd=10,this.gd=e.UIDirections.Up,this.pd=0,this.ku="major",this.Kr=this.jl(t.ue(this.renderingScale)),this.xc=this.jl(t._u(this.renderingScale))}hu(){return[this.Kr]}ru(){if(super.ru(),this.ce)return this;const t=nt(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.Yt(t,{x:this.gd===e.UIDirections.Right?-this.fd:this.gd===e.UIDirections.Left?this.fd:0,y:this.gd===e.UIDirections.Up?-this.fd:this.gd===e.UIDirections.Down?this.fd:0}),s=this.renderingScale.Yt(i,{x:this.gd===e.UIDirections.Right?-this.pd:this.gd===e.UIDirections.Left?this.pd:0,y:this.gd===e.UIDirections.Up?-this.pd:this.gd===e.UIDirections.Down?this.pd:0});return this.xc.la(t).Ko(i),this.Kr.Sn(s).kn(this.gd===e.UIDirections.Up?{x:0,y:1}:this.gd===e.UIDirections.Down?{x:0,y:-1}:this.gd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Gs(){const t=this.xc.ha(),i=t instanceof tt?t.getThickness():0;return this.size=this.gd===e.UIDirections.Left||this.gd===e.UIDirections.Right?{x:this.fd+this.pd+this.Kr.Gs().Ac().x,y:i}:{y:this.fd+this.pd+this.Kr.Gs().Ac().y,x:i},super.Gs()}dispose(){return super.dispose(),this.Kr.dispose(),this.xc.dispose(),this}setVisible(t){return super.setVisible(t),this.Kr.setVisible(t),this.xc.setVisible(t),this}setMouseInteractions(t){return this.Kr.setMouseInteractions(t),this.xc.setMouseInteractions(t),this}getMouseInteractions(){return this.Kr.getMouseInteractions()}getText(){return this.Kr.cs()}setTextFillStyle(t){return this.Kr.ps(t),this.Lr.Bi(),this}getTextFillStyle(){return this.Kr.gs()}setTextFont(t){return this.Kr.Ss(t),this}setTextRotation(t){return this.Kr.xs(t),this}getTextRotation(){return this.Kr.bs()}getTextFont(){return this.Kr.ys()}setText(t){return this.Kr.fs(t),this.Lr.Bi(),this}setDirection(t){return this.gd=t,this.Lr.Bi(),this}getDirection(){return this.gd}setPointerLength(t){return this.fd=t,this.Lr.Bi(),this}getPointerLength(){return this.fd}setTickLabelPadding(t){return this.pd=t,this.Lr.Bi(),this}getTickLabelPadding(){return this.pd}setTickStyle(t){return this.xc.ea(t),this.Lr.Bi(),this}getTickStyle(){return this.xc.ha()}}const $n={...rn,wu(t,e,i,s,r,n){const o=new Xn(t,e,i,s,r);return sn(o,r,n),this.applyStylers(o,r)}}.addStyler(tn),jn=$n.addStyler(((t,e)=>(t.ku="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)))),Zn=$n.addStyler(((t,e)=>(t.ku="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)))),Kn=zn.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),Jn=qn.setAlignment("horizontal"),Qn=qn.setAlignment("vertical"),to={TextBox:Rn,CheckBox:zn,ButtonBox:Kn,PointableTextBox:Fn,AxisTickMajor:jn,AxisTickMinor:Zn,LUTRange:Gn},eo={HorizontalLegendBox:Jn,VerticalLegendBox:Qn};class io extends Gi{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this.md=r,this.yd=n}}const so=(t,e,i)=>At(t+.1*(e-t)+.5*i.getPixelSize()*Math.sign(e-t),t,e),ro=(t,e,i)=>{const s=i.ut(t),r=i.ut(e);return At(i.ot(s+.1*(r-s)+.5*Math.sign(r-s)),t,e)};class no extends Ni{constructor(t,i,s,n,o,h,a,l,c,d,f,g,m,p,y,x,S){var v;super(f,d,l,y,x,{numeric:d.getWidth({x:y.xAxisNumericTicks,y:y.yAxisNumericTicks}),datetime:d.getWidth({x:y.xAxisDateTimeTicks,y:y.yAxisDateTimeTicks}),time:d.getWidth({x:y.xAxisTimeTicks,y:y.yAxisTimeTicks})},S),this.Sd=new Map,this.xd=void 0,this.bd=0,this.vd=[],this.Md=[],this.Fi=Bi.fitting,this._d=!0,this.Ad=0,this.wd=8,this.kd=void 0,this.Cd=void 0,this.Td=20,this.Id=1,this.Fd=!0,this.Pd=!0,this.Dd=!0,this.Bd=!0,this.Ld=!0,this.Od=!0,this.Rd=!0,this.Ed=!0,this.zd=!0,this.Vd=!0,this.Nd=this.es.defaultDragMouseStyle,this.Gd=this.es.defaultDragMouseStyle,this.Hd=this.es.defaultDragMouseStyle,this.Wd=this.es.defaultDragMouseStyle,this.Ud=this.es.defaultDragMouseStyle,this.P=new r.Eventer,this.$d=[],this.Yd=t=>{const e=this.Md.indexOf(t);e>=0&&this.Md.splice(e,1)},this.Xd=t=>(this.Md.indexOf(t)<0&&this.Md.push(t),this.Yd),this.qu=(t,e)=>this.P.emit("axisAreaTouch",this,e),this.jd=Zt(this.$d),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.Zd=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().Iu()):t,this.Kd=t=>{const e=this.vd.indexOf(t);-1!==e&&this.vd.splice(e,1)},this.qd=(t,e)=>{this.P.emit("axisAreaDoubleClick",this,e),this.Bd&&(this.setStopped(!1),Xt(e))},this.Jd=t=>{this.P.emit("axisAreaMouseEnter",this),(this.Pd||this.Fd||this.Dd||this.Bd)&&this.Qd(t)},this.tf=t=>{this.if(t),this.P.emit("axisAreaMouseLeave",this)},this.sf=(t,e,i)=>{var s,r;this.P.emit("axisAreaMouseDragStart",this,e,i);const n=kt(null===(s=this.chart.ef.Ih)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=kt(null===(r=this.chart.ef.Ih)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Pd?(this.hf(t),Xt(e)):i===n&&this.Fd&&(this.rf(t,h),Xt(e))},this.nf=(t,e,i,s,r)=>{var n,o;this.P.emit("axisAreaMouseDrag",this,e,i,s,r);const h=kt(null===(n=this.chart.ef.Ih)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=kt(null===(o=this.chart.ef.Ih)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Pd?(this.af(t,r),Xt(e)):i===h&&this.Fd&&(this.lf(t,s,l,r),Xt(e))},this.uf=(t,e,i,s)=>{var r,n;this.P.emit("axisAreaMouseDragStop",this,e,i,s);const o=kt(null===(r=this.chart.ef.Ih)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=kt(null===(n=this.chart.ef.Ih)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Pd?(this.cf(t),Xt(e)):i===o&&this.Fd&&(this.df(t,s,a),Xt(e)),t.getIsUnderMouse()&&(this.Pd||this.Fd||this.Dd||this.Bd)&&this.Qd(t)},this.ff=(t,e)=>{if(this.P.emit("axisAreaMouseWheel",this,e),this.Dd){this.setStopped(!0);const t=this.es.getWidth(this.gf.Li.ke(e.clientX,e.clientY)),i=this.ct.ot(t);this.zoom(i,ce(e)),Xt(e)}},this.pf=(t,e)=>this.P.emit("axisAreaMouseClick",this,e),this.mf=(t,e)=>this.P.emit("axisAreaMouseDown",this,e),this.yf=(t,e)=>this.P.emit("axisAreaMouseUp",this,e),this.Sf=(t,e)=>this.P.emit("axisAreaMouseMove",this,e),this.xf=(t,e,i)=>{this.P.emit("axisAreaTouchStart",this,i),this.Fd&&(this.Qd(t),this.rf(t,e),Xt(i))},this.bf=(t,e,i,s,r)=>{this.P.emit("axisAreaTouch",this,r),this.Fd&&(this.lf(t,e,i,s),Xt(r))},this.vf=(t,e,i,s)=>{this.P.emit("axisAreaTouchEnd",this,s),this.Fd&&(this.df(t,e,i),this.if(t),Xt(s))},this.Mf=(t,e,i,s)=>{(this.Pd||this.Dd)&&(this.Qd(t),this.hf(t),Xt(s))},this._f=(t,e,i,s,r,n)=>{if(this.Pd){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.af(t,e),Xt(n)}if(this.Dd){const t=this.gf.Li.ke(e.x,e.y),o=this.gf.Li.ke(i.x,i.y),h=Math.abs(this.es.getWidth(Je(t,s))-this.es.getWidth(Je(o,r)))-Math.abs(this.es.getWidth(t)-this.es.getWidth(o)),a=this.ct.Yt(this.ls,-h),l=this.ct.Yt(this.us,h);this.ss(a,l),Xt(n)}},this.Af=(t,e,i,s)=>{(this.Pd||this.Dd)&&(this.cf(t),this.if(t),Xt(s))},this.wf=(t,e)=>{(this.Ld||this.Od)&&this.kf(t)},this.Cf=(t,e)=>{this.Tf(t)},this.If=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Ld&&this.Ff(t,s)},this.Pf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Ld&&this.Df(t,n,s,r)},this.Bf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Ld&&this.Lf(t,n,s,r)},this.Of=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.Ld||this.Od)&&this.Rf(t,r,s),(this.Ld||this.Od)&&this.kf(t)},this.Ef=(t,e)=>{this.Od&&(this.setStopped(!0),this.zoom(this.ls,ce(e)),Xt(e))},this.zf=(t,e)=>{this.Od&&(this.setStopped(!0),this.zoom(this.us,ce(e)),Xt(e))},this.Vf=(t,e,i)=>{this.Ld&&(this.kf(t),this.Ff(t,e),Xt(i))},this.Nf=(t,e,i,s,r)=>{this.Ld&&(this.Df(t,e,i,s),Xt(r))},this.Gf=(t,e,i,s,r)=>{this.Ld&&(this.Lf(t,e,i,s),Xt(r))},this.Hf=(t,e,i,s)=>{this.Ld&&(this.Rf(t,e,i),this.Tf(t),Xt(s))},this.md=t,this.Wf=i,this.gf=s,this.Uf=o,this.$f=h,this.chart=f,this.Yf=m,this.Xf=n,this.ic=a,p(this,this.Xd),l.jf=this,this.Zf=g,this.Kf=this.Zf>50?1:-1,this.qf=(v=this.es.toPoint(0,-this.Kf),Math.abs(v.x)>=Math.abs(v.y)?v.x>=0?e.UIDirections.Right:e.UIDirections.Left:v.y>=0?e.UIDirections.Up:e.UIDirections.Down),this.Jf=c,this.Qf=this.ct instanceof Ai?(new Ti).ui(this.es.toVec2(this.ct,this.Jf)):(new Ei).ui(this.es.toVec2(this.ct,this.Jf)),this.tg=this.chart.pixelScale,this.ig=(new Ti).ui(this.es.toVec2(this.es.getWidth(this.tg),this.Jf)),this.sg=this.gf._u(this.Qf).setMouseInteractions(!1),this.eg=this.gf._u(this.Qf).setMouseInteractions(!1),this.hg=this.gf._u(this.Qf).setMouseInteractions(!1),this.rg=this.Xf.gc(this.tg).ps(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).$h(J).Pr(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.ng=this.Xf.gc(this.tg).ps(d.getWidth({x:y.xAxisZoomingBandFillStyle,y:y.yAxisZoomingBandFillStyle})).$h(d.getWidth({x:y.xAxisZoomingBandStrokeStyle,y:y.yAxisZoomingBandStrokeStyle})),this.og=this.Xf.gc(this.tg).ps(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).$h(J).Pr(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.ag=this.Xf.gc(this.tg).ps(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).$h(J).Pr(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.ds=this.Xf.ue(this.Qf).setMouseInteractions(!1).xs(this.es.getTitleTextRotation(this.Kf)),this.chart.Li.Vh.Se(this.rg,(t=>this.rg.Ir(t)),{animationEnabled:this.Oi}),this.chart.Li.Vh.Se(this.og,(t=>this.og.Ir(t)),{animationEnabled:this.Oi}),this.chart.Li.Vh.Se(this.ag,(t=>this.ag.Ir(t)),{animationEnabled:this.Oi});const b=Fr(new Or(this.xf,this.bf,this.vf,1),new zr(this.Mf,this._f,this.Af),new _r(this.qd)),M=Fr(new Or(this.Vf,this.Nf,this.Hf)),A=Fr(new Or(this.Vf,this.Gf,this.Hf));this.rg.setMouseEnterEventHandler(this.Jd).setMouseLeaveEventHandler(this.tf).setMouseDragStartEventHandler(this.sf).setMouseDragEventHandler(this.nf).setMouseDragStopEventHandler(this.uf).setMouseWheelEventHandler(this.ff).setMouseDoubleClickEventHandler(this.qd).setMouseClickEventHandler(this.pf).setMouseDownEventHandler(this.mf).setMouseUpEventHandler(this.yf).setMouseMoveEventHandler(this.Sf).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.og.setMouseEnterEventHandler(this.wf).setMouseLeaveEventHandler(this.Cf).setMouseDragStartEventHandler(this.If).setMouseDragEventHandler(this.Pf).setMouseDragStopEventHandler(this.Of).setMouseWheelEventHandler(this.Ef).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.ag.setMouseEnterEventHandler(this.wf).setMouseLeaveEventHandler(this.Cf).setMouseDragStartEventHandler(this.If).setMouseDragEventHandler(this.Bf).setMouseDragStopEventHandler(this.Of).setMouseWheelEventHandler(this.zf).setTouchStartEventHandler(A.onTouchStart).setTouchMoveEventHandler(A.onTouchMove).setTouchEndEventHandler(A.onTouchEnd),this.sg.ea(d.getWidth({x:y.xAxisStrokeStyle,y:y.yAxisStrokeStyle})),this.eg.ea(d.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.hg.ea(d.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.ds.ps(d.getWidth({x:y.xAxisTitleFillStyle,y:y.yAxisTitleFillStyle})).Ss(d.getWidth({x:y.xAxisTitleFont,y:y.yAxisTitleFont})),this.iu=a.su(this,{}),this.Ms=this.iu.lg([this.ds]).vs(y.effectsText)}ae(){return this.Vi}le(){return void 0!==this.Fs}addBand(t=!0){const e=t?this.$f:this.Uf,i=new Jr(e,this.chart,this.jd,this,this.Qf,this.es,this.hs,this.ic);return this.$d.push(i),i}addConstantLine(t=!0){const e=t?this.$f:this.Uf,i=new Qr(e,this.chart,this.jd,this,this.Qf,this.es,this.hs,this.ic);return this.$d.push(i),i}ug(t){this.$d.forEach(t)}cg(t){return this.$d.map(t)}getHighlighters(){return this.$d}setThickness(t){return"number"==typeof t?(this.dg=t,this.gg=t):"object"==typeof t&&(this.dg=t.min,this.gg=t.max),this.md.Bi(),this}getThickness(){return{min:this.dg,max:this.gg}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}Js(){return this.Md}$s(t,e){return new io(e,t,this.gf,this.Qf,this.md,this.Qf)}As(){if(this.Sd){for(const t of this.Sd)t[1].grid.dispose(),t[1].tick.dispose();this.Sd.clear()}super.As()}Ys(t,e){const{tickStart:i}=e,s=t.qi.Ws,r=i+s.getTickLength()*this.Kf+s.getTickPadding()*this.Kf;t._i.Sn(this.es.toPoint(t.u,r)).kn(this.es.toPoint(s.getLabelAlignment(),-this.Kf)).xs(s.labelRotation).setVisible(this.getVisible())}pg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.qi.Ws,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.Kf;return{gridStroke:{start:this.es.toPoint(t.u,r),end:this.es.toPoint(t.u,h)},tickStroke:{start:this.es.toPoint(t.u,n),end:this.es.toPoint(t.u,a)}}}mg(t,e,i,s){return this.md._u(this.Qf).ea(new tt({fillStyle:new z({color:D(360*(1-s))}),thickness:5})).la(this.es.toVec2(t,0)).Ko(this.es.toVec2(t,this.Kf*(50*s)))}re(t,e){return"linear"===this.ns.type?so(t,e,this.ct):ro(t,e,this.ct)}yg(t,e){return e instanceof Ai?so:ro}oe(t,e,i){if("linear"===this.ns.type){const s=this.ct.li(e-t);return{min:t-i*s,max:e+i*s}}const s=this.ct;return{min:s.Yt(t,-i),max:s.Yt(e,i)}}ru(t,e,i){const s=this.sg.ha(),r=this.ct.getInnerStart()this.ct.getInnerStart()?this.ct.getInnerEnd():this.ct.getInnerStart(),o=this.ct.Ot(),h=this.Jf.getInnerInterval(),a=s instanceof tt?s.getThickness()*this.Kf/2:0,l=this.Zf/100*h,u=l+t,c=u+a,d=h*this.Kf,f=c+a,g=this.vd.reduce(this.Zd,0);let m,p=0;if(this.ki!==Pi){const t=this.ct.Ot();this.Bs({physicalAxisSize:t,startPosition:l,gridStrokeLen:d,gridStrokeStart:u,tickStart:f});for(const[e,i]of this.Ti){let s=this.Sd.get(e);if(!s)if(e.xi)s={grid:this.md.Sg(this.Qf).setMouseInteractions(!1),tick:this.md.Sg(this.Qf).setMouseInteractions(!1)};else if("xg"in e){const t=Array.from(this.Ti.keys()).filter((t=>"xg"in t)).reverse().indexOf(e),i=this.Wf[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.Sg(this.Qf).setMouseInteractions(!1),tick:i.Sg(this.Qf).setMouseInteractions(!1)}}if(s){s.grid.qn(),s.tick.qn();for(const[e,r]of i){const e=this.pg(r,{physicalAxisSize:t,startPosition:l,gridStrokeLen:d,gridStrokeStart:u,tickStart:f});s.grid.Kn(e.gridStroke.start,e.gridStroke.end),s.tick.Kn(e.tickStroke.start,e.tickStroke.end)}s.grid.ea(e.Ws.getGridStrokeStyle()),s.tick.ea(e.Ws.getTickStyle()),this.Sd.set(e,s)}}for(const t of this.Ti.values()){let e=Ae;for(const i of t.values()){const t=i.qi.Ws,s=this.es.getHeight(i._i.Et()),r=t.getTickLength()+t.getTickPadding()+s+t.getLabelPadding();e=Math.max(e,r)}p=Math.max(p,e)}m=f+Math.max(p,g)*this.Kf}else p=0,m=f+g*this.Kf;this.sg.la(this.es.toPoint(r,c)).Ko(this.es.toPoint(n,c)),this.eg.la(this.es.toPoint(this.ct.Yt(this.ct.getInnerStart(),this.wd),c)).Ko(this.es.toPoint(this.ct.getInnerStart(),c)),this.hg.la(this.es.toPoint(this.ct.Yt(this.ct.getInnerEnd(),-this.wd),c)).Ko(this.es.toPoint(this.ct.getInnerEnd(),c));const y=this.ds&&this.ds.cs().length>0?this.es.getHeight(this.ds.Gs().Et()):0,x=m+.5*y*this.Kf;this.ds.Sn(this.es.toPoint(this.ct.Yt(this.ct.getInnerStart(),o/2),x));const S=f,v=S+this.Kf*this.bd,b=this.Ld||this.Od?Math.min(this.Td,.25*o):0,M={start:this.es.toVec2(this.ct.Yt(this.ct.getInnerStart(),b),S),end:this.es.toVec2(this.ct.Yt(this.ct.getInnerEnd(),-b),v)};if(this.xd){const e=this.Zf/100*h+t,i=-this.Kf*h-t,s={start:this.es.toVec2(this.xd.min,f+this.Kf*this.bd),end:this.es.toVec2(this.xd.max,e+i)},r=nt(s.start,this.Qf,this.tg),n=nt(s.end,this.Qf,this.tg);this.ng.Sn(r).q(Je(n,r)).setVisible(!0)}else this.ng.setVisible(!1);const A=nt(this.es.toVec2(this.ct.getInnerStart(),v),this.Qf,this.tg),w=nt(M.start,this.Qf,this.tg),D=nt(M.end,this.Qf,this.tg),T=nt(this.es.toVec2(this.ct.getInnerEnd(),S),this.Qf,this.tg);this.rg.Sn(w).q(Je(D,w)),this.og.Sn(A).q(Je(w,A)),this.ag.Sn(D).q(Je(T,D));for(const e of this.vd)e.update().plot(u,d,t,f);for(const t of this.$d)t.ru();const E=(s instanceof tt?s.getThickness():0)+Math.max(p,g)+(this.ds&&this.ds.cs().length>0?y+this.Ad:0);return this.bd=At(E,void 0!==this.dg?this.dg:0,void 0!==this.gg?this.gg:Me),this}bg(t){const e=this.sg.ha(),i=e instanceof tt?e.getThickness()*this.Kf/2:0,s=this.Jf.getInnerInterval(),r=this.Zf/100*s+t,n=r+i,o=s*this.Kf,h=n+i;for(const e of this.vd)e.update().plot(r,o,t,h);for(const t of this.$d)t.ru()}vg(){return this.bd}Mg(t,e){e=e||to.AxisTickMajor;const i=new $r(this,t?this.md:this.Xf,this.Xf,this.ct,this.ig,this.ig,this.es,this.qf,this.Kd,this.hs,e).setTextFormatter(this.formatValue);return this.vd.push(i),i}Qd(t){this.chart.Li.Vh.xe(t,1),this.kd=t.Li.Ae(this.Nd,this.kd)}if(t){this.chart.Li.Vh.xe(t,0),t.Li.we(this.kd)}hf(t){this.setStopped(!0),t.Li.we(this.kd)}af(t,e){const i=-this.es.getWidth(e);this.pan(i),this.kd=t.Li.Ae(this.Gd,this.kd)}pan(t){const e=this.ls,i=this.us,s=this.ct.Yt(e,t),r=this.ct.Yt(i,t);this.ss(s,r,{allowClamping:!1})}zoom(t,e){const i=this.ct.ut(this.ls),s=this.ct.ut(this.us),r=this.ct.ut(t),n=At((r-i)/(s-i),0,1),o=.2*this.ct.Ot(),h=n*this.Id*o*-e,a=(1-n)*this.Id*o*e,l=this.ct.Yt(this.ls,h),u=this.ct.Yt(this.us,a);this.ss(l,u)}cf(t){this.xd=void 0,t.Li.we(this.kd)}rf(t,e){this.setStopped(!0),t.Li.we(this.kd),this.chart.Li.Vh.xe(this.rg,0)}lf(t,e,i,s){const r=nt(this.gf.Li.ke(i.x,i.y),this.gf.Li.ct,this.Qf),n=At(this.es.getWidth(r),this.ls,this.us),o=this.es.getWidth(nt(this.gf.Li.ke(e.x,e.y),this.gf.Li.ct,this.Qf)),h=Pe(this.es.getHeight(r),this.es.getHeight(nt(this.rg.xn(),this.tg,this.Qf)),this.es.getHeight(nt(Ke(this.rg.xn(),this.rg.Et()),this.tg,this.Qf)));Math.abs(this.ct.ut(n)-this.ct.ut(o))>10&&h?(this.xd=m(Math.min(n,o),Math.max(n,o)),this.kd=t.Li.Ae(this.Hd,this.kd)):(this.xd=void 0,this.kd=t.Li.Ae(this.Nd,this.kd)),this.gf.Bi()}df(t,e,i){if(this.xd){const t=this.xd.min,e=this.xd.max,i=this.us{e.Us(t)}));for(const e of this.Sd.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.md.Bi(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.Oi),this}}const oo=(t,e)=>t instanceof gi||e instanceof gi?(new Ei).ui(t,e):(new Ti).ui(t,e),ho=(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(gt.navigator.msSaveBlob)gt.navigator.msSaveBlob(r,e);else{const t=gt.document.createElement("a");gt.document.body.appendChild(t);const i=gt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{gt.URL.revokeObjectURL(i),gt.document.body.removeChild(t)}),0)}},ao=(t,i,s,r,n,o)=>{const h=t.wu(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},lo=t=>{if(t instanceof Di)return t;const e=t.x instanceof no?t.x.ct:t.x.x,i=t.y instanceof no?t.y.ct:t.y.y;return oo(e,i)};class uo{constructor(t,e,i,s,n,o,h,a){this._g=[],this.Ag=[],this.P=new r.Eventer,this.wg=void 0,this.kg=void 0,this.Cg=void 0,this._t=x(0,0,0,0),this.ce=!1,this.Tg=()=>{this.Ig=!0,this.Fg.Bi()},this.Pg=t=>e=>{const i=this._g.indexOf(e);-1!==i&&this._g.splice(i,1),this.Li.Bi(),t.G()},this.Dg=t=>{const e=this.Ag.indexOf(t);-1!==e&&this.Ag.splice(e,1),this.Li.Bi()},this.Ig=!0,this.onResize=t=>this.P.on("resize",t),this.offResize=t=>this.P.off(t,"resize"),this.ef=t,this.Bg=i,this.Fg=s,this.removePanel=n,this.hs=e.Li.hs;const l=e.Li.Et();this.uiScale=i.d2({scaleXYConstructor:Ti}).fi(0,100).gi(0,100).q(l),this.pixelScale=i.d2({scaleXYConstructor:Ti}).fi(0,this.uiScale.x.getCellSize()).gi(0,this.uiScale.y.getCellSize()).q(l),this.engine=e.Li.Lg,this.Li=e.Li.Og,this.iu=this.Li.iu.su(this,{}),this.Rg=()=>e.Eg("unidentified ui"),this.zg=e.Vg(),this.Ng=this.Fg.gc(this.uiScale).Sn(u(0,0)).q(u(100,100)).ps(o).$h(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)));const c=e.Li.cr(this.Tg);if(this.Gg=e.Li.dr.bind(e.Li,c),a){const t=a.on(this.Tg);this.Hg=()=>a.off(t)}this.wg=n}getTheme(){return this.hs}setBackgroundFillStyle(t){return this.Ng.ps(t),this.Fg.Bi(),this}getBackgroundFillStyle(){return this.Ng.gs()}setBackgroundStrokeStyle(t){return this.Ng.$h(t),this.Fg.Bi(),this}getBackgroundStrokeStyle(){return this.Ng.Yh()}Wg(t){return this._g.push(t),this.Li.Bi(),t}Ug(t){return this.Ag.push(t),this.Li.Bi(),t}addUIElement(t=Rn,e=this.uiScale){e=lo(e);const i=this.Rg();return this.Wg(ao(t,i,this.uiScale,e,this.Pg(i),this.hs))}addLegendBox(t=qn,i=this.uiScale){i=lo(i);const s=this.Ug(ao(t,this.zg,this.uiScale,i,this.Dg,this.hs));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(wr.RightCenter).setPosition({x:100,y:50}):s.setOrigin(wr.CenterBottom).setPosition(this.uiScale.Yt({x:50,y:0},{x:0,y:3}))),s}dispose(){return this.ce||(this.ce=!0,this.Gg&&this.Gg(),this.Hg&&this.Hg(),co(this.uiScale),co(this.pixelScale),this.kg&&this.kg(),this.Fg.G(),this.zg.G(),this._g.slice().forEach((t=>{t.dispose()})),this.Ag.slice().forEach((t=>{t.dispose()})),this.Li.Bi(),this.wg&&this.wg(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 ho(this.engine,t,e,i),this}Cn(t){this._t=t,this.Tg()}X(){return this.pixelScale.X(),this.uiScale.X(),this}j(){return this.pixelScale.j(),this.uiScale.j(),this}ru(){if(this.Ig){const t=this.Fg.Li.Et(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=[this._t.left,this._t.right],r=[this._t.bottom,this._t.top];this.uiScale.ci(s),this.uiScale.di(r);const n=this.uiScale.getInnerIntervalPixels();this.pixelScale.fi(0,n.x).ci(s).gi(0,n.y).di(r),this.P.emit("resize",this,n.x,n.y,e,i)}this.Ig=!1}$g(){for(let t=0;t{t.Pt&&t.Pt()};class fo extends uo{constructor(t,e,i,s,r,n){super(t,e,i,e.Xg("uipanel bg",0),s,e.Li.hs.uiPanelBackgroundFillStyle,e.Li.hs.uiPanelBackgroundStrokeStyle,n),this.Yg(r,this.pixelScale)}setMinimumSize(t){return this.zc=t,this.Li.Bi(),this}getMinimumSize(){return this.zc}ru(){super.ru(),super.$g()}}const go=x(10,10,10,10);class mo extends uo{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,n,o,h,c),this.jg={},this.rn=go,this.Oi=!0,this.Zg=r,this.Kg=this.Zg.ue(this.uiScale).fs("Chart").Sn(u(50,100)).kn(u(0,1)).Ss(a).ps(l).setMouseInteractions(!1),this.qg=this.iu.lg([this.Kg]).vs(this.hs.effectsText)}setAnimationsEnabled(t){return this.Oi=t,this}getAnimationsEnabled(){return this.Oi}setTitle(t){return this.Kg.fs(t),this.Li.Bi(),this}getTitle(){return this.Kg.cs()}getTitleSize(){return this.Kg.Gs().Ac()}setTitleFillStyle(t){return this.Kg.ps(t),this.Tg(),this}getTitleFillStyle(){return this.Kg.gs()}setTitleFont(t){return this.Kg.Ss(t),this.Tg(),this}getTitleFont(){return this.Kg.ys()}setTitleRotation(t){return this.Kg.xs(t),this.Li.Bi(),this}getTitleRotation(){return this.Kg.bs()}setTitleEffect(t){return this.qg.vs(t),this.Li.Bi(),this}getTitleEffect(){return this.qg._s()}setTitleMargin(t){var e,i;return this.jg="object"==typeof t?this.jg?(e=this.jg,{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.Tg(),this}getTitleMargin(){return this.jg}setPadding(t){return this.rn="object"==typeof t?v(this.rn,t):{left:t,top:t,right:t,bottom:t},this.Tg(),this}getPadding(){return this.rn}Jg(t){const e=t.Qg(),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.Zg.G(),this}}const po={tp:(t,e)=>t.gs()!==F&&0!==t.cs().length&&t.getVisible()?t.Gs().Ac().y+(void 0!==e.top?e.top:10)+(void 0!==e.bottom?e.bottom:0):0,ip(t,e){t.Sn(u(50,100)).Cn({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var yo;e.SliceLabelIndices=void 0,(yo=e.SliceLabelIndices||(e.SliceLabelIndices={}))[yo.LabelsInsideSlices=0]="LabelsInsideSlices",yo[yo.LabelsOnSides=1]="LabelsOnSides";const xo={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},So={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class vo extends Zr{constructor(){super(...arguments),this.ac="Slice",this.u=0}}const bo=(t,e)=>{Xt(e),t.setExploded(!t.getExploded())};class Mo extends vo{}class Ao extends Mo{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.sp=!1,this.ep=F,this.hp=F,this.rp=this.u,this.np=this.sp?1:0,this.op=this.getVisible(),this.ap=W((()=>this.qa.Li.Bi())),this.lp=W((()=>this.qa.Li.Bi())),this.up=()=>{this.cp=void 0},this.dp=()=>{this.fp=void 0},this.index=t,this.qa=s,this.scale=r,this.tc=n,this.gp=e.kc(r).Ir(this.getHighlight()),this.rc(this.gp),this._i=i.ue(r).Ir(this.getHighlight()),this.rc(this._i,{isText:!0}),this.onMouseClick(bo),this.onTouchEnd(bo)}setValue(t){return this.qa.getAnimationsEnabled()?this.op&&this.pp(this.rp,t):this.rp=t,this.u=t,this.qa.Li.Bi(),this}getValue(){return this.u}setExploded(t){if(t&&!1===this.qa.getMultipleSliceExplosion()){const t=this.qa.getSlices();for(let e=0;e{this.np=t,this.qa.Li.Bi()})),this.fp.onEveryAnimationEnd(this.dp),this.sp=!this.sp):!1!==this.qa.getMultipleSliceExplosion()||t?(this.np=this.sp?0:1,this.sp=!this.sp):(this.np=0,this.sp=!this.sp),this.qa.Li.Bi(),this}getExploded(){return this.sp}setVisible(t){return this.op=t,!1===t?this.qa.getAnimationsEnabled()&&this.rp>0?(this.cp&&(this.cp.finish(!1),this.cp=void 0),this.pp(this.rp,0,(()=>super.setVisible(!1)))):(this.rp=0,super.setVisible(!1)):this.qa.getAnimationsEnabled()?(this.cp&&(this.cp.finish(!1),this.cp=void 0),super.setVisible(!0),this.pp(this.rp,this.u)):(this.rp=this.u,super.setVisible(!0)),this}pp(t,e,i){this.cp=this.ap(300,U.ease)([[t,e]],(([t])=>{this.rp=t,this.qa.Li.Bi()})),this.cp.onEveryAnimationEnd(this.up),i&&this.cp.onAnimationEnd(i)}setStyle(t,e,i,s){this.ep=t,this.hp=i,this.gp.ps(this.ep).$h(e),this._i.ps(this.hp).Ss(s);for(let t=0;tKe(e,Ze(ai(.5*(t.Wo()+t.ei())*Math.PI/180),i)),Do=(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.mp.indexOf(t);e>=0&&(this.mp.splice(e,1),this.Ip())},this.ef.Ah||this.ef._h||this.Li.bh(7),this.Fp=e.Pp("pieChart bottom",0),this.Dp=e.Pp("pieChart top",1),this.Kg.fs("Pie Chart"),this.Yg(r,this.pixelScale),this.onBackgroundMouseDoubleClick(To);const h=Fr(new _r(To));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}addSlice(t,e){const i=new Ao(this._p,this.Fp,this.Dp,this,this.pixelScale,this.Tp,this.hs,this.Li.iu);this._p+=1,i.setName(t);const s=this.Oi;return this.Oi=!1,i.setValue(e),this.Oi=s,i.setEffect(this.kp),this.Bp(i),this.mp.push(i),this.Ip(),i.setHighlightOnHover(this.bp),i}addSlices(t){const e=[];for(let i=0;ie.iu.hc.vs(t))),this.Li.Bi(),this}getSliceEffect(){return this.kp}setSliceSorter(t){return this.yp=t,this.mp=this.mp.sort(this.yp),this.Li.Bi(),this}getSliceSorter(){return this.yp}setLabelFillStyle(t){this.Mp="function"==typeof t?t(this.Mp):t;for(let t=0;te.iu.sc.vs(t))),this.Li.Bi(),this}getLabelEffect(){return this.Cp}setLabelFormatter(t){return this.Lp=t,this.Li.Bi(),this}getLabelFormatter(){return this.Lp}setSliceHighlightOnHover(t){return this.bp=t,this.mp.forEach((e=>e.setHighlightOnHover(t))),this}ru(){super.ru(),po.ip(this.Kg,this.jg),super.$g();const t=po.tp(this.Kg,this.jg),e=u(this.pixelScale.x.getInnerInterval()-(this.rn.left+this.rn.right),this.pixelScale.y.getInnerInterval()-(this.rn.bottom+this.rn.top+t)),i=u(this.rn.left+e.x/2,this.rn.bottom+e.y/2);if(this.sd){const t=this.sd;this.mp.forEach((e=>{this.Bp(e,new z({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.mp[t].gp.setVisible(e),this.mp[t]._i.setVisible(e)}this.mp=this.mp.sort(this.yp);const s=this.mp.filter((t=>t.getAnimatedValue()>0));let r=0;for(let t=0;t0?o/r:0);var o;for(let t=0;tt.dispose())),this}}const Bo={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},ko=(...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 Io;!function(t){t[t.TopRight=0]="TopRight",t[t.TopLeft=1]="TopLeft",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight"}(Io||(Io={}));const Co=(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.gp,a=t._i,l=wo(h,i,s+n+o),c=ri(a.xn().y,l,i);return[l,c,u(a.xn().x-e*(n+a.Et().x),c.y)]},Lo=(...t)=>e=>{const i=(t=>{let e=.5*(t.gp.Wo()+t.gp.ei());for(e%=360;e<0;)e+=360;return e<=90?Io.TopRight:e<180?Io.TopLeft:e<270?Io.BottomLeft:Io.BottomRight})(e);return t.includes(i)},Ro=Lo(Io.BottomLeft,Io.TopLeft),Fo=Lo(Io.BottomRight,Io.TopRight),_o=Lo(Io.TopLeft,Io.TopRight),Oo=Lo(Io.BottomLeft,Io.BottomRight);class zo extends Eo{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Lp=So.NamePlusValue,this.Rp=5,this.Ep=5,this.zp=[],this.Vp=this.hs.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.Vp=t;for(let t=0;tt.getXMin(),ie:t=>t.getXMax(),ee:t=>t.Wp().x,$p:t=>t.x,Yp:(t,e)=>({x:t.x,y:e.y,z:e.z}),gd:f(0,-1,0),Xp: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)}}},Uo={te:t=>t.getYMin(),ie:t=>t.getYMax(),ee:t=>t.Wp().y,$p:t=>t.y,Yp:(t,e)=>({x:e.x,y:t.y,z:e.z}),gd:f(-1,0,0),Xp: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)}}},Ho={te:t=>t.getZMin(),ie:t=>t.getZMax(),ee:t=>t.Wp().z,$p:t=>t.z,Yp:(t,e)=>({x:e.x,y:e.y,z:t.z}),gd:f(1,0,0),Xp: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)}}},Wo=t=>{if(t instanceof tt){const e=t.getThickness(),i=t.getFillStyle();if(i instanceof z)return 1===e?Xi:new ji({size:e,fillStyle:i,shape:"sphere"})}return Xi};class Yo extends Ni{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.$p({x:t.Li.hs.xAxis3DNumericTicks,y:t.Li.hs.yAxis3DNumericTicks,z:t.Li.hs.zAxis3DNumericTicks}),datetime:e.$p({x:t.Li.hs.xAxis3DDateTimeTicks,y:t.Li.hs.yAxis3DDateTimeTicks,z:t.Li.hs.zAxis3DDateTimeTicks}),time:e.$p({x:t.Li.hs.xAxis3DTimeTicks,y:t.Li.hs.yAxis3DTimeTicks,z:t.Li.hs.zAxis3DTimeTicks})},{type:"linear"}),this.Sd=new Map,this.jp=()=>{},this.Zp=()=>{},this.Kp=()=>{},this.qp=()=>{},this.Jp=r,this.Qp=n,this.tm=o,this.im=this.Jp.ct;const l=this.es.$p({x:this.hs.xAxis3DStrokeStyle,y:this.hs.yAxis3DStrokeStyle,z:this.hs.zAxis3DStrokeStyle});this.sm=this.Jp.Gp([Bo.InternalUI]).ea(l).hm(Wo(l)).setMouseInteractions(!1),this.ds=this.Qp.ue(this.tm).setMouseInteractions(!1).ps(e.$p({x:t.Li.hs.xAxis3DTitleFillStyle,y:t.Li.hs.yAxis3DTitleFillStyle,z:t.Li.hs.zAxis3DTitleFillStyle})).Ss(e.$p({x:t.Li.hs.xAxis3DTitleFont,y:t.Li.hs.yAxis3DTitleFont,z:t.Li.hs.zAxis3DTitleFont})),this.iu=a,this.Ms=this.iu.lg([this.ds]).vs(s.effectsText),this.sm.setMouseEnterEventHandler(this.jp).setMouseLeaveEventHandler(this.Zp).setMouseDragEventHandler(this.Kp).setMouseDragStopEventHandler(this.qp),i.jf=this}setStrokeStyle(t){return this.sm.ea(t).hm(Wo(this.sm.ha())),this.chart.Li.Bi(),this}getStrokeStyle(){return this.sm.ha()}setMouseInteractions(t){return this}setVisible(t){this.sm.setVisible(t);for(const e of this.Sd.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.Qp.Bi(),this}Js(){return this.chart.getSeries()}rm(t){return Math.abs(this.ct.J(t)*this.Jp.nm(1))}oe(t,e,i){const s=Math.abs(this.ct.J(e-t)*this.Jp.nm(1));return{min:t-i*s,max:e+i*s}}$s(t,e){return new qo(e,t,this.Qp,this.tm,this.Jp)}Ys(t,e){const{wuSize:i,start:s,end:r,tickDirection3D:n,tickDirection2D:o}=e,h=t.qi.Ws,a=(t.u-this.ct.getInnerStart())/(this.ct.getInnerEnd()-this.ct.getInnerStart()),l=be.addVec(Oe(s,r,a),be.multiplyVec(be.multiply(n,this.Jp.nm(.5*this.sm.ha().getThickness())),i)),c=be.addVec(l,be.multiplyVec(be.multiply(n,this.Jp.nm(h.tickLength)),i)),d=this.Jp.om(c)||u(0,0),f=Ke(nt(d,this.chart.engine.scale,this.tm),Ze(o,h.tickPadding));return t._i.Sn(f).kn({x:-o.x,y:-o.y}),{posTickEnd3D:c,posTickStart3D:l,tickPositionRelative:a}}mg(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=be.addVec(Oe(r,n,h),be.multiplyVec(be.multiply(o,this.Jp.nm(.5*this.sm.ha().getThickness())),s)),l=be.addVec(a,be.multiplyVec(be.multiply(o,this.Jp.nm(10)),s)),c=this.Jp.om(a)||u(0,0),d=this.Jp.om(l)||u(0,0);return this.Qp._u(this.tm).la(c).Ko(d).ea(new tt({fillStyle:new z({color:D(120*i)}),thickness:1}))}re(t,e){return Xo(t,e,this.ct)}ru(t){const e=this.im,i=f(e.x.st(),e.y.st(),e.z.st());let s,r;this.es===Ho?(s=f(e.x.getInnerEnd(),e.y.getInnerStart(),e.z.getInnerStart()),r=f(e.x.getInnerEnd(),e.y.getInnerStart(),e.z.getInnerEnd())):(s=f(e.x.getInnerStart(),e.y.getInnerStart(),e.z.getInnerStart()),r=this.es.Yp(f(e.x.getInnerEnd(),e.y.getInnerEnd(),e.z.getInnerEnd()),s));const n=this.es.gd,o=this.Jp.om(s)||u(0,0),h=this.Jp.om(r)||u(0,0),a=Oe(s,r,.5),l=be.addVec(a,be.multiplyVec(be.multiply(n,-1),i)),c=this.Jp.om(a)||u(0,0),d=this.Jp.om(l)||u(0,0),g=Xe(Je(nt(c,this.chart.engine.scale,this.tm),nt(d,this.chart.engine.scale,this.tm)));this.sm.qn().Kn([s,r]);const{gridlinePositionA:m,gridlinePositionB:p,gridlinePositionC:y}=this.es.Xp(t),x=t=>({x:-1===t.x?this.im.x.getInnerStart():1===t.x?this.im.x.getInnerEnd():0,y:-1===t.y?this.im.y.getInnerStart():1===t.y?this.im.y.getInnerEnd():0,z:-1===t.z?this.im.z.getInnerStart():1===t.z?this.im.z.getInnerEnd():0}),S=x(m),v=x(p),b=x(y),M={physicalAxisSize:je(Je(o,h)),wuSize:i,start:s,end:r,tickDirection3D:n,tickDirection2D:g,gridlinePositionA:S,gridlinePositionB:v,gridlinePositionC:b},A=this.Bs(M);for(const[t,e]of this.Ti){let i=this.Sd.get(t);i||(i={grid:this.Jp.Sg().setMouseInteractions(!1),tick:this.Jp.Sg().setMouseInteractions(!1)}),i.grid.qn(),i.tick.qn();for(const[,t]of e){const e=this.pg(t,M,A);e.gridStroke&&i.grid.Kn(e.gridStroke),i.tick.Kn([e.tickStroke.start,e.tickStroke.end])}i.grid.ea(t.Ws.getGridStrokeStyle()),i.tick.ea(t.Ws.getTickStyle()),this.Sd.set(t,i)}const w=this.Zs(((t,e)=>{const i=e._i.Et();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),u(0,0)),D=Math.atan((h.y-o.y)/(h.x-o.x));this.ds.kn({x:0,y:0}).xs(180*-D/Math.PI);const T=be.addVec(a,be.multiplyVec(be.multiply(n,this.Jp.nm(.5*this.sm.ha().getThickness()+this.qs(((t,e)=>Math.max(t,e.tickLength)),0))),i)),E=this.Jp.om(T)||u(0,0),B=Ke(nt(E,this.chart.engine.scale,this.tm),Ke(Ke(Qe(w,g),Ze(g,this.qs(((t,e)=>Math.max(t,e.labelPadding)),0))),Qe(Ze(this.ds.Gs().Et(),.5),g)));this.ds.Sn(B),this.sm.am={overrideFollowing:!1,skipMousePicking:!1}}pg(t,e,i){const{gridlinePositionA:s,gridlinePositionB:r,gridlinePositionC:n}=e,o=i.get(t),h=o.posTickStart3D,a=o.posTickEnd3D,l=o.tickPositionRelative;let u;return Mt(l,0)||Mt(l,1)||(u=[this.isX()?{...s,x:h.x}:this.isY()?{...s,y:h.y}:this.isZ()?{...s,z:h.z}:{x:0,y:0,z:0},this.isX()?{...r,x:h.x}:this.isY()?{...r,y:h.y}:this.isZ()?{...r,z:h.z}:{x:0,y:0,z:0},this.isX()?{...n,x:h.x}:this.isY()?{...n,y:h.y}:this.isZ()?{...n,z:h.z}:{x:0,y:0,z:0}]),{gridStroke:u,tickStroke:{start:h,end:a}}}As(){if(this.Sd){for(const t of this.Sd)t[1].grid.dispose(),t[1].tick.dispose();this.Sd.clear()}super.As()}isX(){return this.es===Go}isY(){return this.es===Uo}isZ(){return this.es===Ho}}class qo extends Gi{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.md=r}}const Xo=(t,e,i)=>At(t+.1*(e-t)+Math.abs(i.st())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e));class $o{constructor(){this.type="simple"}}const jo=new $o;class Zo{constructor(t){this.type="phong",this.ambientReflection=1,this.specularReflection=.1,this.diffuseReflection=1,this.ambientColor=w("#000"),this.specularColor=w("#fff"),this.shininess=32,t&&(this.ambientReflection=Number.isNaN(Number(t.ambientReflection))?this.ambientReflection:Number(t.ambientReflection),this.specularReflection=Number.isNaN(Number(t.specularReflection))?this.specularReflection:Number(t.specularReflection),this.diffuseReflection=Number.isNaN(Number(t.diffuseReflection))?this.diffuseReflection:Number(t.diffuseReflection),this.ambientColor=t.ambientColor||this.ambientColor,this.specularColor=t.specularColor||this.specularColor,this.shininess=t.shininess||this.shininess)}}const Ko=new Zo,Jo={Simple:$o,Phong:Zo};class Qo extends Zr{constructor(t,e,i,s,r){super(t,e,s,r),this.lm=Ko,this.um=!0,this.dm=!0,this.qa=t,this.Jp=i,this.de=new Map,this.onMouseWheel(this.qa.fm),this.onMouseDrag(this.qa.gm),this.onTouchStart(this.qa.pm.onTouchStart),this.onTouchMove(this.qa.pm.onTouchMove),this.onTouchEnd(this.qa.pm.onTouchEnd)}setAutoScrollingEnabled(t){return this.um=t,this.qa.Li.Bi(),this}getAutoScrollingEnabled(){return this.um}setColorShadingStyle(t){return this.lm=t,this.de.forEach(((e,i)=>i.ym(t))),this.Jp.Bi(),this}getColorShadingStyle(){return this.lm}setDepthTestEnabled(t){return this.dm=t,this.de.forEach(((e,i)=>i.Sm(t))),this.Jp.Bi(),this}getDepthTestEnabled(){return this.dm}xm(){}ru(){}bm(){}getXMax(){const t=this.Dn;return t?t.yt():void 0}getXMin(){const t=this.Dn;return t?t.ft():void 0}getYMax(){const t=this.Dn;return t?t.xt():void 0}getYMin(){const t=this.Dn;return t?t.St():void 0}getZMax(){const t=this.Dn;return t?t.vm():void 0}getZMin(){const t=this.Dn;return t?t.Mm():void 0}Wp(){const t=this.Dn;return t?f(t.co(),t.do(),t._m()):f(0,0,0)}}class th extends Qo{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ac="Box Series 3D",this.Am=.25,this.ed=()=>he(this.Vr);const n=this.qa.getSeries().length;this.Vr=ue(this.hs.boxSeries3DFillStyle,n),this.Dn=this.Jp.km().Sm(this.dm).ps(this.Vr).wm(this.Am).Ir(this.getHighlight()),this.rc(this.Dn)}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;ihe(this.sa.getFillStyle())}setStrokeStyle(t){this.sa="function"==typeof t?t(this.sa):t;const e=this.sa;return this.Dn.ea(e),this.Jp.Bi(),this}getStrokeStyle(){return this.sa}add(t){return(t=Array.isArray(t)?t:[t])?(this.Dn.Kn(t.slice()),this.Jp.Bi(),this):this}clear(){return this.Dn.qn(),this.Du=0,this}getPointAmount(){const t=this.Dn;return t.Jn()+t.Qn()}Qs(){return this.um&&this.getPointAmount()>0&&this.getVisible()}mc(t,e){t.Ir(e),this.Jp.Bi()}attach(t,e){return super.attach(t,e),oe(t,this.hs,{stroke:this.sa}),this}}class ih extends eh{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ac="Line Series 3D";const n=this.qa.getSeries().length;this.sa=ue(s.lineSeries3DStrokeStyle,n),this.Tm=ls.pointStyle3D,this.Im(this.sa),this.Dn=this.Jp.Gp([Bo.UserSeries]).Sm(this.dm).ea(this.sa).hm(this.Tm).Ir(this.getHighlight()),this.rc(this.Dn)}setStrokeStyle(t){super.setStrokeStyle(t),this.Im(this.sa);const e=this.Tm;return this.Dn.hm(e),this}Im(t){const e=new Ji.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.Tm=e}}class sh extends eh{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ac="Point Line Series 3D",this.ed=()=>he(this.sa.getFillStyle())||he(this.Tm.getFillStyle());const n=this.qa.getSeries().length;this.sa=ue(s.pointLineSeries3DStrokeStyle,n),this.Tm=ue(s.pointLineSeries3DPointStyle,n),this.Fm(),this.Dn=this.Jp.Gp([Bo.UserSeries]).Sm(this.dm).ea(this.sa).hm(this.Tm).Ir(this.getHighlight()),this.rc(this.Dn)}setPointStyle(t){return this.Tm="function"==typeof t?t(this.Tm):t,this.Fm(),this.Dn.hm(this.Tm),this.Jp.Bi(),this}getPointStyle(){return this.Tm}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.sa,i=Math.abs(e.getThickness()),s=this.Tm;i>s.getSize()&&(this.Tm=s.setSize(i)),this.Fm();const r=this.Tm;return this.Dn.hm(r),this.Jp.Bi(),this}Fm(){const t=this.Tm,e=t.getSize();this.Tm=t.setSize(e)}mc(t,e){t.Ir(e),this.Jp.Bi()}}class rh extends Qo{constructor(t,e,i,s,r,n){super(t,e,i,s,r)}add(t){return(t=Array.isArray(t)?t:[t])?(this.Dn.Kn(t.slice()),this.Jp.Bi(),this):this}clear(){return this.Dn.qn(),this.Du=0,this}getPointAmount(){const t=this.Dn;return t.Jn()+t.Qn()}Qs(){return this.um&&this.getPointAmount()>0&&this.getVisible()}mc(t,e){t.Ir(e),this.Jp.Bi()}attach(t,e){return super.attach(t,e),oe(t,this.hs,{point3D:this.Pm}),this}}class nh extends rh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.ac="Point Series 3D",this.ed=()=>he(this.Pm.getFillStyle());const o=this.qa.getSeries().length;this.Pm=ue(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Dn=this.Jp.Bm(h).Sm(this.dm).Dm(this.Pm).Ir(this.getHighlight()),this.rc(this.Dn)}setPointStyle(t){this.Pm="function"==typeof t?t(this.Pm):t;const e=this.Pm;return this.Dn.Dm(e),this.Jp.Bi(),this}getPointStyle(){return this.Pm}}class oh extends rh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.ac="Point Cloud Series 3D",this.ed=()=>he(this.Pm.getFillStyle());const o=this.qa.getSeries().length;this.Pm=ue(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Dn=this.Jp.Bm(h).Dm(this.Pm).Ir(this.getHighlight()),this.rc(this.Dn)}setPointStyle(t){this.Pm="function"==typeof t?t(this.Pm):t;const e=this.Pm;return this.Dn.Dm(e),this.Jp.Bi(),this}getPointStyle(){return this.Pm}}const hh={Triangulated:nh,Pixelated:oh};class ah extends mo{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l,u),this.Lm=[],this.Om=0,this.Rm=t=>{const e=this.Lm.indexOf(t);e>=0&&(this.Lm.splice(e,1),this.P.emit("seriesDispose",this,t))},this.Em=()=>{this.Om+=1},this.zm=()=>{this.Om-=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.Vm=this.iu.lg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.Lm.forEach((e=>e.setAnimationHighlight(t))),this}Nm(t,e){this.Vm.nc([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.Gm.ps(t),this.Li.Bi(),this}getSeriesBackgroundFillStyle(){return this.Gm.gs()}setSeriesBackgroundStrokeStyle(t){return this.Hm.$h(t),this.Li.Bi(),this}getSeriesBackgroundStrokeStyle(){return this.Hm.Yh()}setSeriesBackgroundEffect(t){return this.Vm.vs(t),this.Li.Bi(),this}getSeriesBackgroundEffect(){return this.Vm._s()}Wm(t){this.Lm.push(t),t.onMouseEnter(this.Em),t.onMouseLeave(this.zm),void 0!==this.Um&&t.setHighlightOnHover(this.Um),this.P.emit("seriesAdded",this,t)}dd(){return this.Lm}$m(){return this.Om}setSeriesHighlightOnHover(t){return this.Um=t,this.Lm.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.Lm.slice().forEach(vt),super.dispose()}}const lh=be.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class uh{constructor(t,e,i,s){this.Ym=!0,this.Xm=!0,this.jm=2*-Math.PI/2160,this.Zm=2*Math.PI/2160,this.Km=.1,this.qm=1*Math.PI/180,this.Jm=t,this.Qm=e,this.ty=i,this.om=s}getDefaultCameraConfiguration(t){const e={direction:lh,location:be.multiply(lh,-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.iy(i,t):"wheel-zoom"===t.type?i=this.sy(i,t):"rotate+zoom"===t.type?i=this.ey(i,t):"fixed-rotate"===t.type?i=this.hy(i,t):"move"===t.type&&(i=this.ny(i,t))})),this.Ym?i=this.oy(t.boundingBox,i):this.Xm&&(i=this.ly(t.boundingBox,i)),i}iy(t,e){const{rotation:i}=e,s=t.location,r=be.multiply(be.normalize(t.location),-1),{Right:n,Up:o}=this.uy(r);let h=s;const a=this.gy(r),l=i.x*this.jm*a;h=be.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.Zm,a-this.qm);return 0!==u&&(h=be.rotateAroundAxis(h,n,u)),{location:h,direction:be.multiply(be.normalize(h),-1)}}sy(t,e){const{deltaY:i}=e;this.Ym&&this.py(!1);const s=t.location,r=be.multiply(be.normalize(s),-1),n=i*this.Km,o=be.length(s)*-n;return{direction:r,location:be.addVec(s,be.multiply(r,o))}}ey(t,e){const{rotation:i,cameraDistance:s}=e;this.Ym&&this.py(!1);let r=this.iy(t,{type:"rotate",rotation:i});const n=r.location,o=be.multiply(be.normalize(n),-1),h=be.multiply(o,-s);return r={direction:be.multiply(be.normalize(h),-1),location:h},r}hy(t,e){this.Ym&&this.py(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.uy(r),h=i.x*this.jm;let a=be.normalize(be.rotateAroundAxis(r,o,h));const l=i.y*this.Zm;return a=be.normalize(be.rotateAroundAxis(a,n,l)),{location:s,direction:a}}ny(t,e){this.Ym&&this.py(!1),this.Xm=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.uy(n);return{location:be.addVec(r,be.multiply(n,.01*s),be.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:be.multiply(be.normalize(t.cameraLocation),-1)};return this.Ym?this.oy(t.boundingBox,e):this.ly(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:be.multiply(be.normalize(t.cameraLocation),-1)};return this.Ym?this.oy(t.boundingBox,e):this.ly(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:be.multiply(be.normalize(t.cameraLocation),-1)};if(this.Ym)return this.oy(t.boundingBox,e)}oy(t,e,i){let s=e;i=void 0!==i?i:0,s=this.my(t,s,100,20,1,i,5);const r=this.gy(s.direction);return s=this.yy(s,this.Sy(t,s,100,1),r),s}my(t,e,i,s,r,n,o){return ch(n,o,(t=>({direction:e.direction,location:be.multiply(e.direction,-t)})),(e=>this.xy(t,e)),i,r,"linear",s)}Sy(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.uy(e.direction),a=this.by(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:be.normalize(be.lerp(l.direction,h,t))})),(e=>this.vy(t,e)),0,u,!0,i):dh(0,c,(t=>({location:l.location,direction:be.normalize(be.lerp(l.direction,o,t))})),(e=>this.vy(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:be.normalize(be.lerp(l.direction,n,t))})),(e=>this.My(t,e)),0,u,!0,i):dh(0,c,(t=>({location:l.location,direction:be.normalize(be.lerp(l.direction,r,t))})),(e=>this.My(t,e)),0,u,!0,i)),l}xy(t,e){const i=this.by(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}My(t,e){const i=this.by(t,!1,e);return Math.abs(i.left-i.right)}vy(t,e){const i=this.by(t,!1,e);return Math.abs(i.top-i.bottom)}by(t,e,i){const s=ze(this._y(t,e,i).map((t=>nt(t,this.Jm,this.Qm))));return{left:s.min.x,right:this.Qm.x.getInnerEnd()-s.max.x,top:this.Qm.y.getInnerEnd()-s.max.y,bottom:s.min.y}}_y(t,e,i){const s=this.ty,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.om(t,i))).filter((t=>void 0!==t))}ly(t,e){const i=be.length(e.location),s=this.Ay(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)he(this.Vr),this.lm=jo;const o=this.qa.getSeries().length;this.Vr=ue(this.hs.surfaceGridSeries3DFillStyle,o),this.Ma=ue(this.hs.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.Mh=l,this.Dn=this.Jp.ky(l).ps(this.Vr)._a(this.Ma).ym(this.lm).Ir(this.getHighlight()),this.rc(this.Dn)}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.Dn.ps(this.Vr),this.Jp.Bi(),this}getFillStyle(){return this.Vr}setWireframeStyle(t){return this.Ma="function"==typeof t?t(this.Ma):t,this.Dn._a(this.Ma),this.Jp.Bi(),this}getWireframeStyle(){return this.Dn.Aa()}setIntensityInterpolation(t){return t=t||"disabled",this.Dn.Cy(t),this.Jp.Bi(),this}getIntensityInterpolation(){return this.Dn.Ty()}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.Mh.dataOrder?t.length:t[0].length,rows:"rows"===this.Mh.dataOrder?t.length:t[0].length},i="columns"===this.Mh.dataOrder?this.Mh.columns:this.Mh.rows,s="columns"===this.Mh.dataOrder?this.Mh.rows:this.Mh.columns;if(e.x>i||e.y>s){if(!0===this.qa.ef.Ph){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Mh.columns}x${this.Mh.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;gt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.qa.ef.Ph){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Mh.columns}x${this.Mh.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.`;gt.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.qa.ef.Ph){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Mh.columns}x${this.Mh.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;gt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.qa.ef.Ph){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Mh.columns}x${this.Mh.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.`;gt.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;ehe(this.Vr),this.lm=jo;const o=this.qa.getSeries().length;this.Vr=ue(this.hs.surfaceScrollingGridSeries3DFillStyle,o),this.Ma=ue(this.hs.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.Mh=l,this.Dn=this.Jp.By(l).ps(this.Vr)._a(this.Ma).ym(this.lm).Ir(this.getHighlight()),this.rc(this.Dn)}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.Dn.ps(this.Vr),this.Jp.Bi(),this}getFillStyle(){return this.Vr}setWireframeStyle(t){return this.Ma="function"==typeof t?t(this.Ma):t,this.Dn._a(this.Ma),this.Jp.Bi(),this}getWireframeStyle(){return this.Dn.Aa()}setIntensityInterpolation(t){return t=t||"disabled",this.Dn.Cy(t),this.Jp.Bi(),this}getIntensityInterpolation(){return this.Dn.Ty()}clear(){return this.Dn.qn(),this.Jp.Bi(),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.Mh.scrollDimension?this.Mh.rows:this.Mh.columns;if(i>s-1){if(!0===this.qa.ef.Ph){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.Mh.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;gt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.qa.ef.Ph){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.Mh.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;gt.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.Dn.Ly({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.Jp.Bi(),this}setCullMode(t){return this.Dn.Py("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.Dn.Dy()}xm(){}ru(){}bm(){}Qs(){return this.um&&this.getVisible()}mc(t,e){t.Ir(e),this.Jp.Bi()}}class mh extends ah{constructor(t,e,i,s,r,n,o){let h;super(t,e,i,e.Xg("chart3D bg",0),e.Eg("chart3D ui"),s,e.Li.hs.chart3DBackgroundFillStyle,e.Li.hs.chart3DBackgroundStrokeStyle,e.Li.hs.chart3DTitleFont,e.Li.hs.chart3DTitleFillStyle,n),this.Oy=1,this.Ry=[],this.Ey=2,this.zy=!0,this.Vy=!0,this.Ny=!0,this.Gy=0,this.axes={id:"axes",chart:this},this.world={id:"world",chart:this},this.Ve=[],this.Ue=()=>{const t=this.Jp.Hy();this.Uy.Wy(t),this.$y.Wy(t);const e=this.Yy.viewportChanged(this.Xy());e&&this.jy(e),this.Li.Bi()},this.gm=(t,e,i,s,r)=>{if(this.Ny){const t=r;this.Ry.push({type:"rotate",rotation:t}),this.Li.Bi(),Xt(e)}},this.fm=(t,e)=>{if(this.Vy){if(this.zy)Math.sign(this.Gy)!==Math.sign(e.deltaY)?this.Gy=ce(e):this.Gy+=ce(e);else{const t=ce(e);this.Ry.push({type:"wheel-zoom",deltaY:t})}this.Li.Bi(),Xt(e)}},this.ef.Ah||this.ef._h||this.Li.bh(1),this.Kg.fs("Chart3D"),this.Zy=i.d3(),this.Zy.x.Z(-1,1),this.Zy.y.Z(-1,1),this.Zy.z.Z(-1,1),this.Jp=e.Ky("chart3D layer3D",0,this.Zy),this.Uy=e.qy("chart3D series bg",0),this.$y=e.Pp("chart3D axis ui",1),this.Jy={x:new Yo(this,Go,this.Zy.x,this.hs,this.Jp,this.$y,this.pixelScale,!1,this.iu),y:new Yo(this,Uo,this.Zy.y,this.hs,this.Jp,this.$y,this.pixelScale,!1,this.iu),z:new Yo(this,Ho,this.Zy.z,this.hs,this.Jp,this.$y,this.pixelScale,!1,this.iu)},this.Qy=this.Jp.Gp([Bo.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.hs.chart3DBoundingBoxStrokeStyle),this.Gm=this.Uy.vc(this.engine.scale,Ws.Simple).ps(this.hs.chart3DSeriesBackgroundFillStyle).$h(J).setMouseInteractions(!0),this.Hm=this.Uy.vc(this.engine.scale,Ws.Simple).ps(F).$h(this.hs.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Nm(this.Gm,this.Hm),this.tS({x:1,y:1,z:1},!0),this.Yy=new uh(this.engine.scale,this.pixelScale,this.Zy,((t,e)=>(e&&this.jy(e),this.Jp.om(t)))),this.iS=this.Yy.getDefaultCameraConfiguration(this.sS(this.eS)),this.jy(this.iS),this.pm=Fr(new zr(((t,e,i)=>{h={locationOne:e,locationTwo:i,cameraLocation:this.Jp.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.Ny&&!this.Vy)return;const o=(h.locationOne.x-h.locationTwo.x)**2+(h.locationOne.y-h.locationTwo.y)**2,a=(e.x-i.x)**2+(e.y-i.y)**2,l=be.length(h.cameraLocation),c=o/a*l,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.Ry.push({type:"rotate+zoom",rotation:this.Ny?d:{x:0,y:0},cameraDistance:this.Vy?c:l}),this.Li.Bi(),Xt(n)}),(t=>{})),new Or((t=>{}),((t,e,i,s,r)=>{if(this.Ny){const t=s;this.Ry.push({type:"rotate",rotation:t}),this.Li.Bi(),Xt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.pm.onTouchStart),this.onBackgroundTouchMove(this.pm.onTouchMove),this.onBackgroundTouchEnd(this.pm.onTouchEnd),this.onSeriesBackgroundTouchStart(this.pm.onTouchStart),this.onSeriesBackgroundTouchMove(this.pm.onTouchMove),this.onSeriesBackgroundTouchEnd(this.pm.onTouchEnd),this.onBackgroundMouseDrag(this.gm),this.onBackgroundMouseWheel(this.fm),this.onBackgroundMouseDown(((t,e)=>{Xt(e)})),this.onSeriesBackgroundMouseDrag(this.gm),this.onSeriesBackgroundMouseWheel(this.fm),this.onSeriesBackgroundMouseDown(((t,e)=>{Xt(e)})),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.onResize(this.Ue),this.Ue(),this.Yg(r,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||nh)(this,this.Rm,this.Jp,this.hs,this.Li.iu,t);return this.Wm(e),e}addLineSeries(){const t=new ih(this,this.Rm,this.Jp,this.hs,this.Li.iu);return this.Wm(t),t}addPointLineSeries(){const t=new sh(this,this.Rm,this.Jp,this.hs,this.Li.iu);return this.Wm(t),t}addSurfaceGridSeries(t){const e=new fh(this,this.Rm,this.Jp,t,this.hs,this.Li.iu);return this.Wm(e),e}addSurfaceScrollingGridSeries(t){const e=new gh(this,this.Rm,this.Jp,t,this.hs,this.Li.iu);return this.Wm(e),e}addBoxSeries(){const t=new th(this,this.Rm,this.Jp,this.hs,this.Li.iu);return this.Wm(t),t}getDefaultAxisX(){return this.Jy.x}getDefaultAxisY(){return this.Jy.y}getDefaultAxisZ(){return this.Jy.z}getDefaultAxes(){return[this.Jy.x,this.Jy.y,this.Jy.z]}setCameraLocation(t){let e={location:t,direction:be.normalize(be.multiply(t,-1))};const i=this.Yy.cameraLocationChanged(this.Xy(e));return i&&(e=i),this.jy(e),this.Li.Bi(),this}getCameraLocation(){return this.Jp.getCameraLocation()}getCameraDirection(){return this.Jp.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.Yy.py(t);const e=this.Yy.cameraLocationChanged(this.Xy());return e&&this.jy(e),this}getCameraAutomaticFittingEnabled(){return this.Yy.wy()}onCameraChange(t){return this.P.on("cameraChange",t)}offCameraChange(t){return this.P.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.Qy.ea(t).hm(Wo(this.Qy.ha())),this.Jp.Bi(),this}getBoundingBoxStrokeStyle(){return this.Qy.ha()}setBoundingBox(t){return this.tS(t,!1),this}tS(t,e){this.eS=t;const i=this.sS(t);if(this.Zy.x.q(i.x),this.Zy.y.q(i.y),this.Zy.z.q(-i.z),!e){const t=this.Yy.boundingBoxChanged(this.Xy());t&&this.jy(t)}this.Li.Bi()}getBoundingBox(){return this.eS}ru(){const t=gt.performance.now();if(po.ip(this.Kg,this.jg),0!==this.Gy){const e=this.hS?t-this.hS:1e3/60,i=this.Gy*e*.006;this.Ry.push({type:"wheel-zoom",deltaY:i}),this.Gy=Math.sign(this.Gy)*Math.max(Math.abs(this.Gy)-.01*e,0),0!==this.Gy?(this.Li.Bi(!0),this.hS=t):this.hS=void 0}const e=this.getCameraDirection();if(this.Ry.length>0){const t=this.Yy.applyCameraInteractions(this.Xy(),this.Ry);t&&this.jy(t),this.Ry.length=0}this.rS&&be.equals(this.rS.location,this.iS.location)&&be.equals(this.rS.direction,this.iS.direction)||this.P.emit("cameraChange",this,this.getCameraLocation()),this.rS=this.iS,super.ru();for(let t=0;tthis.Jp.om(t))),o=this.Jp.om(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=ee(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.Ve.length=0,this.Zy.G(),this.Jp.G(),this.$y.G(),this.Uy.G(),super.dispose()}X(){return this.Zy.x.X(),this.Zy.y.X(),this.Zy.z.X(),super.X()}j(){return super.j()}jy(t){this.Jp.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(be.addVec(t.location,be.multiply(t.direction,-this.Ey))),this.iS=t,this.Li.Bi()}sS(t){return be.divide(t,be.length(t)/this.Oy)}Xy(t=this.iS){return{boundingBox:this.sS(this.eS),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.Vy=t,this}getMouseInteractionZoom(){return this.Vy}setMouseInteractionRotate(t){return this.Ny=t,this}getMouseInteractionRotate(){return this.Ny}forEachAxis(t){return t(this.Jy.x),t(this.Jy.y),t(this.Jy.z),this}getMinimumSize(){}getSeries(){return this.Lm}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.zy=!!t,this}getAnimationZoom(){return this.zy}}const ph={Column:En,Row:Bn};class yh extends fo{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.nS=new Map,this.oS=this.addUIElement(ph.Row).setPosition({x:0,y:100}).setOrigin(wr.LeftTop).setBackground((t=>t.setFillStyle(F).setStrokeStyle(J)))}add(t,e){return(t instanceof mo?[t]:t instanceof fd?t.getCells().filter((t=>t.panel instanceof mo)).map((t=>t.panel)):[]).forEach((t=>{const i=this.oS.addElement(eo.VerticalLegendBox).setBackground((t=>t.setFillStyle(F).setStrokeStyle(J))).add(t,e).setTitle(t.getTitle());this.nS.set(t,i)})),this.Li.Bi(),this}setLegendBoxes(t){return this.nS.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.oS.getSize()}}class xh{constructor(t,e){this.aS=t,this.lS=e}alter(t){this.uS=void 0!==this.uS?this.uS:this.lS(),this.cS=t,this.aS(t)}resetValue(){void 0!==this.cS&&(void 0!==this.uS&&this.isAltered()&&this.aS(this.uS),this.uS=void 0,this.cS=void 0)}getNormalValue(){return void 0!==this.uS?this.uS:this.lS()}isAltered(){return void 0!==this.cS&&this.lS()===this.cS}}class Sh{constructor(t,e){this.dS=[],this.fS=t,this.ct=e}update(){return this.fS.getVisible()?!(this.gS()&&(!this.pS()||(this.resetTable(),this.fS.Gs(),this.gS()))&&(this.mS(),this.fS.Gs(),this.gS()&&(this.resetTable(),this.fS.Gs(),1))):(this.pS()&&this.resetTable(),!0)}pS(){for(let t=0;t{const s=nt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=nt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.fS,this.ct)}yS(){return((t,i)=>{const s=nt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=nt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.fS,this.ct)}SS(){return((t,i)=>{const s=nt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=nt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.fS,this.ct)}xS(t){return this.dS.push(t),t}}class vh extends Sh{constructor(){super(...arguments),this.hn=this.xS(new xh((t=>this.fS.setOrigin(t)),(()=>this.fS.getOrigin())))}mS(){const t=this.hn.getNormalValue(),e=u(this.yS()?-t.x:t.x,this.SS()?-t.y:t.y);this.hn.alter(e)}}class bh extends Sh{constructor(t,e,i,s){super(t,e),this.bS=this.xS(new xh((t=>this.fS.setTextFont((e=>e.setSize(t)))),(()=>this.fS.getTextFont().getSize()))),this.vS=i,this.MS=s}mS(){const t=this.bS.getNormalValue(),e=this.vS;if(enew vh(t,e),FontSize:(t=5,e=5)=>(i,s)=>new bh(i,s,t,e)};class Ah{constructor(){this._S=[]}addRow(...t){return this._S.push(t),this}}class wh extends Ah{wu(){const t=this._S;return this._S=[],t}AS(){return this._S.length=0,this}}class Dh extends Dn{constructor(){super(...arguments),this.pu=this.hs.cursorResultTableTextFont,this.Xc=0,this.wS=this.hs.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(mn,void 0);else{const e=h[n];e instanceof vn?(r.getMembers()[n].dispose(),t=r.addElement(mn,n)):t=e}t.setFont(this.pu).setFillStyle(this.wS).setText(o).setTextRotation(this.Xc)}else{for(let t=h.length;t=h.length?r.addGap(void 0,void 0):h[n]instanceof gn&&(r.getMembers()[n].dispose(),r.addGap(void 0,n))}}}}return this.Lr.Bi(),this}setTextFillStyle(t){this.wS="function"==typeof t?t(this.wS):t;for(let t=0;tt.setFillStyle(n.cursorResultTableFillStyle).setStrokeStyle(n.cursorResultTableStrokeStyle))).setTextFillStyle(n.cursorResultTableTextFillStyle).setTextFont(n.cursorResultTableTextFont),this.BS=Mh.Flip(this.fS,this.scale)}dispose(){return this.DS.dispose(),this.fS.dispose(),this}pointAt(t){return this.qr=t.series.scale===this.scale?t.location:nt(t.location,t.series.scale,this.scale),this.DS.setPosition(this.qr),this.fS.setPosition(this.qr).setContent(t.resultTableContent),this.Lr.Bi(),this}getPosition(){return this.qr}setVisible(t){return this.Ri=t,this.Lr.Bi(),this}getVisible(){return this.Ri}setPointMarkerVisible(t){return this.CS=t,this.Lr.Bi(),this}getPointMarkerVisible(){return this.CS}setPointMarker(t){return t(this.DS),this.Lr.Bi(),this}getPointMarker(){return this.DS}setResultTableVisible(t){return this.TS=t,this.Lr.Bi(),this}getResultTableVisible(){return this.TS}setResultTable(t){return t(this.fS),this.Lr.Bi(),this}getResultTable(){return this.fS}setAutoFitStrategy(t){return this.BS&&this.BS.resetTable(),this.BS=t?t(this.fS,this.Lr.Li.ct):void 0,this.Lr.Bi(),this}getAutoFitStrategy(){return void 0!==this.BS}ru(){return this.BS&&this.BS.update(),this.fS.setVisible(this.IS&&this.Ri&&this.TS),this.DS.setVisible(this.IS&&this.Ri&&this.CS),this.DS.ru(),this.fS.ru(),this}Gs(){return this.DS.Gs(),this.fS.Gs(),this.IS=((t,e,i=e)=>{const s=e!==i?nt(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.qr,this.scale),this}}class Eh extends Th{constructor(){super(...arguments),this.LS=!1}pointAt(t){return this.OS(t.fillStyle),super.pointAt(t)}OS(t){t&&this.LS&&this.fS.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.LS=t,this.Lr.Bi(),this}getResultTableAutoTextStyle(){return this.LS}}class Bh extends Th{setPosition(t){return this.qr=t,this.DS.setPosition(t),this.fS.setPosition(t),this.Lr.Bi(),this}}class kh{constructor(t,e,i=[]){this.RS=[],this.ES=(t,e)=>(this.RS.forEach((i=>i(t,e))),t),this.FS=t,this.PS=e,this.RS=i}}class Ih extends kh{constructor(){super(...arguments),this.zS=(t,e,i,s)=>this.ES(new Eh(t,e,i,this.FS,this.PS,s),s),this.addStyler=t=>new Ih(this.FS,this.PS,this.RS.map((t=>t)).concat(t)),this.setPointMarker=t=>new Ih(t,this.PS,this.RS.map((t=>t))),this.setResultTableBackground=t=>new Ih(this.FS,t,this.RS.map((t=>t)))}}class Ch extends kh{constructor(){super(...arguments),this.VS=(t,e,i,s)=>this.ES(new Bh(t,e,i,this.FS,this.PS,s),s),this.addStyler=t=>new Ch(this.FS,this.PS,this.RS.map((t=>t)).concat(t)),this.setPointMarker=t=>new Ch(t,this.PS,this.RS.map((t=>t))),this.setResultTableBackground=t=>new Ch(this.FS,t,this.RS.map((t=>t)))}}const Ph=t=>t.setPointMarker((t=>t.setSize(u(5,5)).setOrigin(u(0,0)))).setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),Lh=(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)));new Ih(pn,pn,[Ph]);const Rh=new Ih(pn,Sn,[Ph,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof Sn&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),Fh=Rh;new Ch(xn,pn,[Lh,t=>t.setResultTableVisible(!1)]);const _h=new Ch(un,pn,[Lh,t=>t.setResultTable((t=>t.setOrigin(wr.LeftBottom)))]),Oh=(t,e,i,s,r)=>({location:t,scale:e,resultTableContent:i,series:s,fillStyle:r}),zh={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},Vh=(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(),Nh=(t,e)=>{let i=e.geometry;return i=Gh(t,e,i),i=Uh(t,e,i),i},Gh=(t,e,i)=>{if(t===zh.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===zh.USA&&("alaska"===s?r={translate:{x:55,y:-25},scale:{x:.16,y:.16}}:"hawaii"===s&&(r={translate:{x:48,y:7},scale:{x:1,y:1}})),r){const{translate:t,scale:n}=r,o=ze(wt(i)),h=[];for(let e=0;e{this.Lm.includes(t)||(this.Lm.push(t),this.P.emit("seriesAdded",this,t))},this.HS=i.WS();const d=()=>{this.NS!==e.AutoCursorModes.disabled&&this.Li.Bi()},f=()=>{this.NS!==e.AutoCursorModes.disabled&&this.Li.Bi()},g=()=>{this.NS!==e.AutoCursorModes.disabled&&this.Li.Bi()},m=()=>{this.NS!==e.AutoCursorModes.disabled&&this.Li.Bi()},p=()=>{this.NS!==e.AutoCursorModes.disabled&&this.Li.Bi()},y=()=>{this.NS!==e.AutoCursorModes.disabled&&this.Li.Bi()};this.onSeriesBackgroundMouseEnter(d),this.onSeriesBackgroundMouseMove(f),this.onSeriesBackgroundMouseLeave(g),this.onSeriesBackgroundTouchStart(m),this.onSeriesBackgroundTouchMove(p),this.onSeriesBackgroundTouchEnd(y),this.US(((t,e)=>{const i=e.onMouseEnter(d),s=e.onMouseMove(f),r=e.onMouseLeave(g),n=e.onTouchStart(m),o=e.onTouchMove(p),h=e.onTouchEnd(y),a=this.$S(((t,l)=>{l===e&&(e.offMouseEnter(i),e.offMouseMove(s),e.offMouseLeave(r),e.offTouchStart(n),e.offTouchMove(o),e.offTouchEnd(h)),this.YS(a)}))}))}setAutoCursor(t){return this.XS&&t(this.XS),this.Li.Bi(),this}getAutoCursor(){return this.XS}setAutoCursorMode(t){return this.NS=t,this.Li.Bi(),this}getAutoCursorMode(){return this.NS}jS(t){if(t.xthis.uiScale.x.Lt()||t.ythis.uiScale.y.Lt())return;let e,i=Number.MAX_VALUE;for(const s of this.Lm)if(s.getCursorEnabled()&&s.getVisible()){const r=s.jS(t,!1);if(r){const s=nt(r.location,r.scale,this.engine.scale),n=Le(t,s);Number.isNaN(n)||e&&!(nt.getIsUnderMouse())),r=this.Gm.getIsUnderMouse();this.NS===e.AutoCursorModes.snapToClosest?(r||void 0!==s)&&(i=t&&this.jS(t)):this.NS===e.AutoCursorModes.onHover&&void 0!==s&&s.getCursorEnabled()&&(i=t&&s.jS(t,!0))}i?this.XS.pointAt(i).setVisible(!0):this.XS.setVisible(!1),this.XS.Gs().ru()}US(t){return this.P.on("seriesAdded",t)}KS(t){return this.P.off(t)}$S(t){return this.P.on("seriesDispose",t)}YS(t){return this.P.off(t)}dispose(){return this.HS.G(),this.XS.dispose(),super.dispose()}}class Xh extends mo{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Xg("mapChart bg",0),i.Eg("mapChart ui"),r,i.Li.hs.mapChartBackgroundFillStyle,i.Li.hs.mapChartBackgroundStrokeStyle,i.Li.hs.mapChartTitleFont,i.Li.hs.mapChartTitleFillStyle,h),this.qS=[],this.JS=[],this.QS=[],this.ct=this.Bg.d2({scaleXYConstructor:Ti}),this.Fu=!0,this.Vr=this.hs.mapChartFillStyle,this.$r=this.hs.mapChartStrokeStyle,this.tx=this.hs.mapChartOutlierRegionFillStyle,this.ix=this.hs.mapChartOutlierRegionStrokeStyle,this.sx=this.hs.mapChartSeparateRegionFillStyle,this.hx=this.hs.mapChartSeparateRegionStrokeStyle,this.nu=0,this.nx=e.AutoCursorModes.onHover,this.ox=$h,this.Oi=!1,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.lx&>.setTimeout((()=>t())),e},this.onViewChange=t=>this.P.on("viewChange",t),this.ux=(t,e,i,s,r)=>{this.ct.x.q(s).Dt([this._t.left+this.rn.left,this._t.right+this.rn.right]),this.ct.y.q(r).Dt([this._t.bottom+this.rn.bottom,this._t.top+this.rn.top+po.tp(this.Kg,this.jg)]),this.gx&&this.mx(this.yx,this.ct,this.gx)},this.Eu=(t,i,s,r)=>{this.nx!==e.AutoCursorModes.disabled&&(this.Sx(t,s,r),Xt(i)),this.P.emit("mouseEnter",this,i)},this.Vu=(t,e,i,s)=>{this.xx(t,i,s),this.P.emit("mouseLeave",this,e),e&&Xt(e)},this.Gu=(t,i,s,r)=>{this.nx!==e.AutoCursorModes.disabled&&(this.Sx(t,s,r),Xt(i)),this.P.emit("mouseMove",this,i)},this.Wu=(t,e)=>this.P.emit("mouseClick",this,e),this.Uu=(t,e)=>this.P.emit("mouseDoubleClick",this,e),this.$u=(t,e)=>this.P.emit("mouseDown",this,e),this.Yu=(t,e)=>this.P.emit("mouseUp",this,e),this.Xu=(t,e,i)=>{this.P.emit("mouseDragStart",this,e,i)},this.ju=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.Zu=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.Ku=(t,e)=>{this.P.emit("mouseWheel",this,e)},this.qu=(t,e,i,s)=>{this.bx=this.engine.clientLocation2Engine(e.clientX,e.clientY),this.Sx(t,i,s),this.P.emit("touchStart",this,e),Xt(e)},this.Ju=(t,e,i,s)=>{this.bx=this.engine.clientLocation2Engine(e.clientX,e.clientY),this.Sx(t,i,s),this.P.emit("touchMove",this,e),Xt(e)},this.Qu=(t,e,i,s)=>{this.bx=void 0,this.xx(t,i,s),this.P.emit("touchEnd",this,e),Xt(e)},this.ef.Ah||this.ef._h||this.Li.bh(3),this.vx=i.Pp("mapChart plotting",0),this.onResize(this.ux),this.Kg.fs("Map Chart");const a=kt(o?o.autoCursorBuilder:void 0,_h);this.Mx=a.VS(i.WS(),this.ct,this.ct,this.hs).setVisible(!1),this._x=this.iu.lg(),this.Yg(n,this.uiScale);const l=kt(o&&o.type,zh.World);this.yx=l,this.Ax(l).then((()=>{this.P.emit("mapDataReady")}))}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.wx(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){return this.$r="function"==typeof t?t(this.$r):t,this.wx(),this}getStrokeStyle(){return this.$r}setEffect(t){return this._x.vs(t),this.Li.Bi(),this}getEffect(){return this._x._s()}setOutlierRegionFillStyle(t){return this.tx="function"==typeof t?t(this.tx):t,this.JS.forEach((t=>t.ps(this.tx))),this.Li.Bi(),this}getOutlierRegionFillStyle(){return this.tx}setOutlierRegionStrokeStyle(t){return this.ix="function"==typeof t?t(this.ix):t,this.JS.forEach((t=>t.$h(this.ix))),this.Li.Bi(),this}getOutlierRegionStrokeStyle(){return this.ix}setSeparateRegionFillStyle(t){return this.sx="function"==typeof t?t(this.sx):t,this.QS.forEach((t=>t.ps(this.sx))),this.Li.Bi(),this}getSeparateRegionFillStyle(){return this.sx}setSeparateRegionStrokeStyle(t){return this.hx="function"==typeof t?t(this.hx):t,this.QS.forEach((t=>t.$h(this.hx))),this.Li.Bi(),this}getSeparateRegionStrokeStyle(){return this.hx}invalidateRegionValues(t){if(!this.lx||!this.kx)return this.Cx=this.Cx||[],this.Cx.push(t),this;const e=this.Vr,i=e instanceof G;if("function"==typeof t)for(let s=0;st.setMouseInteractions(this.Fu))),this}getMouseInteractions(){return this.Fu}offMapDataReady(t){return this.P.off(t,"mapDataReady")}offViewChange(t){return this.P.off(t,"viewChange")}async Ax(t){const e=await((t,e)=>{let i;if(t===zh.World)i="countries_world.json";else if(t===zh.NorthAmerica)i="countries_northAmerica.json";else if(t===zh.SouthAmerica)i="countries_southAmerica.json";else if(t===zh.Africa)i="countries_africa.json";else if(t===zh.Europe)i="countries_europe.json";else if(t===zh.Asia)i="countries_asia.json";else if(t===zh.USA)i="states_usa.json";else if(t===zh.Canada)i="territoriesProvinces_canada.json";else{if(t!==zh.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw gt.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return gt.fetch(s).then((t=>t.json())).catch((t=>{ve(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.ef.Fh);this.kx=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=Hh[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry){const t=this.vx.vc(this.ct,Ws.Simple).lo(e).setMouseInteractions(this.Fu).ps(this.tx).$h(this.ix);this.JS.push(t)}if(t===zh.USA){const t=25.8,e=29.7;this.QS.push(this.vx.gc(this.ct).setMouseInteractions(!1).ps(this.sx).$h(this.hx).Sn({x:-126,y:t}).q({x:10,y:e-t}),this.vx.gc(this.ct).setMouseInteractions(!1).ps(this.sx).$h(this.hx).Sn({x:-113,y:t}).q({x:7,y:e-t}))}for(let s=0;sthis.Eu(e,i,r,s))).setMouseLeaveEventHandler(((t,i)=>this.Vu(e,i,r,s))).setMouseClickEventHandler(this.Wu).setMouseDoubleClickEventHandler(this.Uu).setMouseDownEventHandler(this.$u).setMouseUpEventHandler(this.Yu).setMouseMoveEventHandler(((t,i)=>this.Gu(e,i,r,s))).setMouseDragStartEventHandler(this.Xu).setMouseDragEventHandler(this.ju).setMouseDragStopEventHandler(this.Zu).setMouseWheelEventHandler(this.Ku).setTouchStartEventHandler(((t,i)=>this.qu(e,i,r,s))).setTouchMoveEventHandler(((t,i)=>this.Ju(e,i,r,s))).setTouchEndEventHandler(((t,i)=>this.Qu(e,i,r,s))),n.push(e)}this.qS.push(n)}if(this._x.nc(this.qS.flat()),this.wx(),this.gx=i,this.mx(t,this.ct,i),this.lx=e,this.Cx){for(const t of this.Cx)this.invalidateRegionValues(t);this.Cx=void 0}this.ru()}mx(t,e,i){const s=Wh[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.Vt(),a=this.ct.y.Vt();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]}})}Ix(t){for(let e=0;ei.ps(t).$h(e)));this.Li.Bi()}Tx(t,e,i){const s=void 0!==e?i.getColors(e):i.getFallbackColor(),r=new z({color:s});for(const e of t)e.ps(r)}Sx(t,e,i){this.Fx={polygon:t,region:e,iRegion:i},this.Li.Bi()}xx(t,e,i){this.Fx&&t===this.Fx.polygon&&(this.Fx=void 0,this.Li.Bi())}setAnimationsEnabled(t){return this.Oi=!t,this}getAnimationsEnabled(){return this.Oi}getMinimumSize(){}dd(){return[this]}ru(){super.ru(),super.$g(),po.ip(this.Kg,this.jg);const t=p(this.ct.x.Bt(),this.ct.y.Bt(),this.ct.x.Ot(),this.ct.y.Ot());this.vx.Wy(t);const e=this.Li.xh()||this.bx;if(this.Fx&&e){const t=this.kx&&this.kx[this.Fx.iRegion];let i=nt(e,this.engine.scale,this.ct);i={x:At(i.x,this.ct.x.getInnerStart(),this.ct.x.getInnerEnd()),y:At(i.y,this.ct.y.getInnerStart(),this.ct.y.getInnerEnd())};let s=i.x,r=i.y;const n=this.Fx.region.transform;this.Fx.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.Mx.setPosition(i).setVisible(!0).getResultTable().setContent(this.ox(new wh,this.Fx.region,t,s,r,this).wu())}else this.Mx.setVisible(!1);return this.Mx.Gs().ru(),this}dispose(){return this.vx.G(),this.Mx.dispose(),co(this.ct),super.dispose()}X(){return super.X(),this.ct.X(),this}j(){return super.j(),this.ct.j(),this}ed(){return he(this.Vr)}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((()=>{})),t.onMouseLeave((()=>{})),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),oe(t,this.hs,{fill:this.Vr}),this}}const $h=(t,e,i,s,r,n)=>(t.addRow(`${e.name}`).addRow(jh(s,r)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),jh=(t,e)=>{const i=t>0,s=e>0;return`${[le(Math.abs(0|t),2),"° ",le(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[le(Math.abs(0|e),2),"° ",le(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`};class Zh extends Ni{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.Px(i),s,r,{numeric:e.Dx({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.Dx({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.Dx({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.Bx=n,this.Lx=o,this.Ox=h,this.iu=a,this.Rx=i,this.Ex=e.Dx({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.ds=h.ue(i).setMouseInteractions(!1).Ss(e.Dx({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).ps(e.Dx({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Ms=this.iu.lg([this.ds]).vs(s.effectsText)}setStrokeStyle(t){return this.Ex="function"==typeof t?t(this.Ex):t,this.Lx.Bi(),this}getStrokeStyle(){return this.Ex}$s(t,e){return new Kh(e,t,this.Rx,this.Ox,this.Ox,this.zx(this.Bx,this.Rx),this.Ox._u(this.Rx).setMouseInteractions(!1))}Ys(t,e){const i=this.Vx(this.Rx,t);this.Nx&&!1===this.Nx(t)?t._i.setVisible(!1):t._i.setVisible(!0).Sn(Ke(this.Gx(this.Rx,t.u),i.padding)).kn(i.alignment).xs(i.rotation).bn(i.offset.x,i.offset.y),this.Hx(this.Rx,t.Wx,t.Ux,t)}setMouseInteractions(t){return this}ru(){this.Bs({physicalAxisSize:0});const t=this.Zs(((t,e)=>{const i=e.qi.Ws,s=.5*this.Ex.getThickness()+i.tickLength+i.tickPadding+Math.abs(e._i.Gs().Et().y/this.Rx.yi().y)+i.labelPadding;return Math.max(t,s)}),0);return this.$x(this.Rx,this.Ex,t),this.Yx(this.Rx,this.ds,t),t}}class Kh extends io{constructor(t,e,i,s,r,n,o,h){super(t,e,s,i,r,i,h),this.Wx=n,this.Ux=o,n.setMouseInteractions(!1),this.de.push(n,o)}}class Jh extends Zh{constructor(t,e,i,s,r,n,o,h,a){super(t,Qh,e,i,s,r,n,o,h),this.sm=this.Lx._u(this.Rx).setMouseInteractions(!1),this.Xx=a,this.setScrollStrategy(Bi.expansion),this.setTickStrategy(ki.Numeric),this.setTitle("Amplitude")}Js(){return this.Xx()}re(t,e){return so(t,e,this.Rx.y)}oe(t,e,i){const s=2*(e-t),r=this.Rx.x.li(s);return{min:t-i*r,max:e+i*r}}Gx(t,e){return{x:t.jx()?e-t.Zx().start:t.Zx().start-e,y:0}}zx(t,e){return t.kc(e)}Hx(t,e,i,s){const r=s.qi.Ws,n=t.jx()?s.u-t.Zx().start:t.Zx().start-s.u;Mt(s.u,t.Zx().start)||Mt(s.u,t.Zx().end)?e.setVisible(!1):e.setVisible(!0).Zo(0).Ko(360).ia(void 0).ta(0).qo(n).ia(60).ps(F).$h(r.gridStrokeStyle);const o=.5*this.Ex.getThickness();i.la({x:n,y:-o*t.yi().y}).Ko({x:n,y:-(o+r.tickLength)*t.yi().y}).ea(r.tickStyle)}Vx(t,e){const i=e.qi.Ws;return{alignment:{x:0,y:1},padding:{x:0,y:t.yi().y*-(.5*this.Ex.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}$x(t,e,i){const s=t.jx()?t.Zx().end-t.Zx().start:t.Zx().start-t.Zx().end;this.sm.la({x:0,y:0}).Ko({x:s,y:0}).ea(e)}Yx(t,e,i){const s=t.jx()?(t.Zx().start+t.Zx().end)/2-t.Zx().start:t.Zx().start-(t.Zx().start+t.Zx().end)/2;e.kn({x:0,y:1}).Sn({x:s,y:-i*t.yi().y})}}const Qh={te:t=>t.getAmplitudeMin(),ie:t=>t.getAmplitudeMax(),ee:t=>{},Px:t=>({getInnerStart:()=>t.Zx().start,getInnerEnd:()=>t.Zx().end,Z:(e,i)=>t.Kx(e,i),rt:(e,i,s,r,n)=>t.y.rt(e,i,s,r,n)}),Dx:t=>t.amplitude};class ta extends Zh{constructor(t,e,i,s,r,n,o,h){super(t,ia,e,i,s,r,n,o,h),this.qx=90,this.Jx=12,this.Qx=ea,this.sm=this.Lx.kc(this.Rx).setMouseInteractions(!1),this.Nx=t=>{let e=180*(t.u-this.Rx.tb())/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.Fi=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.qx)}setTickStyle(t){return this.ib="function"==typeof t?t(this.ib):t,this.sb(),this.Lx.Bi(),this}getTickStyle(){return this.ib}setTickFormattingFunction(t){return this.Qx=t,this.sb(),this.Lx.Bi(),this}getTickFormattingFunction(){return this.Qx}setClockwise(t){this.Rx.eb(t);const e=this.qx*Math.PI/180;return t?this.Rx.hb(e+Math.PI/2):this.Rx.hb(e-Math.PI/2),this.Lx.Bi(),this}getClockwise(){return!this.Rx.rb()}setNorth(t){for(;t<0;)t+=360;t%=360,this.qx=t;const e=t*Math.PI/180;return this.getClockwise()?this.Rx.hb(e+Math.PI/2):this.Rx.hb(e-Math.PI/2),this.Lx.Bi(),this}getNorth(){return 180*this.Rx.tb()/Math.PI}setDivision(t){return this.Jx=t,this.sb(),this.Lx.Bi(),this}getDivision(){return this.Jx}Js(){return[]}re(t,e){return e}oe(t,e,i){return{min:t,max:e}}Gx(t,e){const i=t.rb()?1:-1,s=t.tb(),r=t.jx()?t.Zx().end-t.Zx().start:t.Zx().start-t.Zx().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}zx(t,e){return t._u(e)}Hx(t,e,i,s){const r=this.ib,n=t.rb()?1:-1,o=t.tb(),h=(s.u-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.jx()?t.Zx().end-t.Zx().start:t.Zx().start-t.Zx().end,c={x:a*u,y:l*u};e.la({x:0,y:0}).Ko(c);const d={x:c.x+a*r.tickLength*t.yi().x,y:c.y+l*r.tickLength*t.yi().y};i.la(c).Ko(d),e.ea(r.gridStrokeStyle),i.ea(r.tickStyle)}Vx(t,e){const i=this.ib,s=t.rb()?1:-1,r=t.tb();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.yi().x,l=Math.sin(o)*h*t.yi().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}$x(t,e,i){const s=t.jx()?t.Zx().end-t.Zx().start:t.Zx().start-t.Zx().end;this.sm.Zo(0).Ko(360).ta(0).qo(s+.5*e.getThickness()*t.yi().x).ia(60).ps(F).$h(e)}Yx(t,e,i){const s=t.tb(),r=this.Vx(t,{u:0+s}),n=t.jx()?t.Zx().end-t.Zx().start:t.Zx().start-t.Zx().end;e.kn(r.alignment).xs(r.rotation).bn(r.offset.x,r.offset.y).Sn(Ke({x:n,y:0},r.padding))}sb(){this.Cs({Ai:[],wi:[{_i:"Radial ticks",xg:0,Ws:this.ib,Ns:this.Qx,pe:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Jx;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},Ji:{Xs:()=>{},Qi:()=>!1},me:void 0}],vi:ea,Ts:void 0,Is:void 0})}}const ea=(t,e,i)=>(180*t/Math.PI).toFixed(0),ia={te:t=>{},ie:t=>{},ee:t=>{},Px:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,Z:(t,e)=>{},rt:(e,i,s,r,n)=>t.x.rt(e,i,s,r,n)}),Dx:t=>t.radial};class sa extends Zr{constructor(t,e,i,s,r,n){super(e,i,r,n),this.ac="Sector",this.nb=0,this.ob=1*Math.PI/2,this.ab=void 0,this.lb=void 0,this.Lr=t,this.Rx=s,this.gp=this.Lr.kc(this.Rx).Ir(this.getHighlight()),this.rc(this.gp),this.Vr=r.polarSectorFillStyle,this.$r=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.nb=At(t,0,360),this.Lr.Bi(),this}getAngleStart(){return this.nb}setAngleEnd(t){return this.ob=At(t,0,360),this.Lr.Bi(),this}getAngleEnd(){return this.ob}setAmplitudeStart(t){return this.ab=t,this.Lr.Bi(),this}getAmplitudeStart(){return this.ab}setAmplitudeEnd(t){return this.lb=t,this.Lr.Bi(),this}getAmplitudeEnd(){return this.lb}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.Lr.Bi(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){return this.$r="function"==typeof t?t(this.$r):t,this.Lr.Bi(),this}getStrokeStyle(){return this.$r}ru(){const t=this.Rx.Zx(),e=180*this.Rx.tb()/Math.PI,i=void 0!==this.ab?At(this.ab,t.start,t.end):t.start,s=void 0!==this.lb?At(this.lb,t.start,t.end):t.end,r=this.Rx.jx()?i-t.start:t.start-i,n=this.Rx.jx()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.Rx.rb()?1:-1,l=Math.abs(this.ob-this.nb);this.gp.Zo((this.nb-e)*a).Ko((this.ob-e)*a).ta(100*o/h).qo(h).ps(this.Vr).$h(this.$r).ia(Math.ceil(l/2))}mc(t,e){t.Ir(e),this.Lr.Bi()}attach(t,e=!0){return super.attach(t,e),oe(t,this.hs,{fill:this.Vr,stroke:this.$r}),this}}class ra extends Zr{constructor(){super(...arguments),this.um=!0,this.ub=!0}setAutoScrollingEnabled(t){return this.um=t,this.qa.Li.Bi(),this}getAutoScrollingEnabled(){return this.um}xm(){}ru(){}bm(){}setCursorEnabled(t){return this.ub=t,this}getCursorEnabled(){return this.ub}}class na extends ra{constructor(t,e,i,s,r,n){super(e,i,r,n),this.ox=oa,this.Lr=t,this.qa=e,this.scale=s}getAmplitudeMin(){return this.cb?this.cb.min:void 0}getAmplitudeMax(){return this.cb?this.cb.max:void 0}setCursorResultTableFormatter(t){return this.ox=t,this.qa.Li.Bi(),this}getCursorResultTableFormatter(){return this.ox}setCursorEnabled(t){return super.setCursorEnabled(t)}}const oa=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(s)),ha=(t,e,i)=>t*(1-i)+e*i,aa=(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=ha(i.value,r.value,n),c=ha(e.value,s.value,h);return ha(c,u,l)},la=(t,e)=>{const i=[],s=e.Zx().start,r=e.Zx().end,n=e.jx(),o=e.rb()?1:-1,h=e.tb(),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=At(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},ua=t=>{const e={min:Me,max:Ae};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},ca=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),da=(t,e)=>{let i=hi(t);for(e.rb()||(i*=-1),i+=180*e.tb()/Math.PI;i<0;)i+=360;i%=360;const s=je(t),r=e.Zx(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:ha(r.start,r.end,s/n)}};class fa extends na{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.ac="Line Series",this.fb=[],this.gb=!1,this.pb=!1;const o=this.qa.getSeries().length;this.sa=ue(this.hs.polarLineSeriesStrokeStyle,o),this.mb=t.Gp(s,void 0,[Bo.UserSeries]).ea(this.sa).Ir(this.getHighlight()).Wn(ps.Nearest),this.rc(this.mb)}setData(t){return this.fb=ca(t),this.gb=!0,this.cb=ua(this.fb),this.Lr.Bi(),this}setStrokeStyle(t){this.sa="function"==typeof t?t(this.sa):t;const e=this.sa;return this.mb.ea(e),this.Lr.Bi(),this}getStrokeStyle(){return this.sa}setConnectDataAutomaticallyEnabled(t){return this.pb=t,this.Lr.Bi(),this}getConnectDataAutomaticallyEnabled(){return this.pb}Qs(){return this.um&&this.fb.length>0&&this.getVisible()}mc(t,e){t.Ir(e),this.Lr.Bi()}jS(t,e){return this.yb(t,this.mb)}solveNearestFromScreen(t){return this.yb(t,this.mb)}yb(t,e){const i=e.Sb(t);if(!i)return;const{angle:s,amplitude:r}=da(i,this.scale);return Oh(i,this.scale,this.ox(new wh,this,s,r,this.qa.getAmplitudeAxis().formatValue).wu(),this,this.sa.getFillStyle())}ru(){if(this.gb||this.scale.xb()){const t=la(this.fb,this.scale),e=ze(t);this.pb?(t.push({...t[0]}),this.mb.Io(!0)):this.mb.Io(!1),this.mb.qn().Kn(t).Cr(e),this.gb=!1,this.mb.Gs()}}attach(t,e=!0){return super.attach(t,e),oe(t,this.hs,{stroke:this.sa}),this}}class ga extends na{constructor(t,i,s,r,n,o){super(t,i,s,r,n,o),this.ac="Point Line Series",this.fb=[],this.gb=!1,this.pb=!1,this.bb=3,this.sn=0,this.vb=e.PointShape.Circle;const h=this.qa.getSeries().length;this.Vr=ue(this.hs.polarPointLineSeriesFillStyle,h),this.sa=ue(this.hs.polarPointLineSeriesStrokeStyle,h),this.mb=t.Gp(r,void 0,[Bo.UserSeries]).ea(this.sa).Ir(this.getHighlight()).Wn(ps.Nearest),this.rc(this.mb),this.Mb=t.Bm(r).ps(this.Vr).Yn(this.vb).q(this.bb).Ir(this.getHighlight()).Wn(ps.Nearest),this.rc(this.Mb)}setData(t){return this.fb=ca(t),this.gb=!0,this.cb=ua(this.fb),this.Lr.Bi(),this}setStrokeStyle(t){this.sa="function"==typeof t?t(this.sa):t;const e=this.sa;return this.mb.ea(e),this.Lr.Bi(),this}getStrokeStyle(){return this.sa}setPointFillStyle(t){this.Vr="function"==typeof t?t(this.Vr):t;const e=this.Vr;return this.Mb.ps(e),this.Lr.Bi(),this}getPointFillStyle(){return this.Vr}setPointSize(t){return this.bb=t,this.Mb.q(t),this.Lr.Bi(),this}getPointSize(){return this.bb}setPointShape(t){return this.vb=t,this.Mb.Yn(this.vb),this}getPointShape(){return this.vb}setPointRotation(t){return this.sn=t,this.Mb.xs(t),this.Lr.Bi(),this}getPointRotation(){return this.sn}setConnectDataAutomaticallyEnabled(t){return this.pb=t,this.Lr.Bi(),this}getConnectDataAutomaticallyEnabled(){return this.pb}Qs(){return this.um&&this.fb.length>0&&this.getVisible()}mc(t,e){t.Ir(e),this.Lr.Bi()}jS(t,e){return this.yb(t,this.mb)}solveNearestFromScreen(t){return this.yb(t,this.mb)}yb(t,e){const i=e instanceof zs?e.jS(t):e.Sb(t);if(!i)return;const{angle:s,amplitude:r}=da(i,this.scale);return Oh(i,this.scale,this.ox(new wh,this,s,r,this.qa.getAmplitudeAxis().formatValue).wu(),this,"color"in i&&this.Vr instanceof V?new z({color:i.color}):this.Vr)}ru(){if(this.gb||this.scale.xb()){const t=la(this.fb,this.scale),e=ze(t);this.pb?(t.push({...t[0]}),this.mb.Io(!0)):this.mb.Io(!1),this.mb.qn().Kn(t).Cr(e),this.Mb.qn().Kn(t).Cr(e),this.gb=!1,this.mb.Gs(),this.Mb.Gs()}}}class ma extends na{constructor(t,i,s,r,n,o){super(t,i,s,r,n,o),this.ac="Point Series",this.fb=[],this.gb=!1,this.bb=3,this.sn=0,this.vb=e.PointShape.Circle;const h=this.qa.getSeries().length;this.Vr=ue(this.hs.polarPointSeriesFillStyle,h),this.Mb=t.Bm(r).ps(this.Vr).Yn(this.vb).q(this.bb).Ir(this.getHighlight()).Wn(ps.Nearest),this.rc(this.Mb)}setData(t){return this.fb=ca(t),this.gb=!0,this.cb=ua(this.fb),this.Lr.Bi(),this}setPointFillStyle(t){this.Vr="function"==typeof t?t(this.Vr):t;const e=this.Vr;return this.Mb.ps(e),this.Lr.Bi(),this}getPointFillStyle(){return this.Vr}setPointSize(t){return this.bb=t,this.Mb.q(t),this.Lr.Bi(),this}getPointSize(){return this.bb}setPointShape(t){return this.vb=t,this.Mb.Yn(this.vb),this}getPointShape(){return this.vb}setPointRotation(t){return this.sn=t,this.Mb.xs(t),this.Lr.Bi(),this}getPointRotation(){return this.sn}Qs(){return this.um&&this.fb.length>0&&this.getVisible()}mc(t,e){t.Ir(e),this.Lr.Bi()}jS(t,e){const i=this.Mb.jS(t);if(!i)return;const{angle:s,amplitude:r}=da(i,this.scale);return Oh(i,this.scale,this.ox(new wh,this,s,r,this.qa.getAmplitudeAxis().formatValue).wu(),this,"color"in i&&this.Vr instanceof V?new z({color:i.color}):this.Vr)}solveNearestFromScreen(t){return this.jS(t,!1)}ru(){if(this.gb||this.scale.xb()){const t=la(this.fb,this.scale),e=ze(t);this.Mb.qn().Kn(t).Cr(e),this.gb=!1,this.Mb.Gs()}}attach(t,e=!0){return super.attach(t,e),oe(t,this.hs,{fill:this.Vr}),this}}class pa{constructor(t,e,i,s){this.P=new r.Eventer,this._b=!1,this.qa=t,this.Ab=e,this.Lm=i,this.Dn=s}setGeometry(t){return this.wb=t,this._b=!0,this.qa.Li.Bi(),this}getGeometry(){return this.wb}setMouseInteractions(t){return this.Dn.setMouseInteractions(t),this}dispose(){return this.Dn.dispose(),this.Ab(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.Dn.getVisible()!==t;return this.Dn.setVisible(t),e&&this.P.emit("visibleStateChanged",this,t),this.qa.Li.Bi(),this}getVisible(){return this.Dn.getVisible()}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}const ya=(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.Kf&&(n=1-n),1===e.Kf&&(o=1-o),u(o,n)};class xa extends Bh{constructor(t,e,i,s,r,n,o,h,a){super(t,e,oo(i.ct,s.ct),r,n,a),this.kb=!1,this.Cb=!1,this.Tb=!0,this.Ib=!0,this.Fb=!1,this.Pb=!1,this.setGridStrokeYStyle=t=>(this.Db.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.Db.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.Bb=o,this.Lb=h,this.Ob=this.axisX.Mg(!1,this.Bb).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.Db=this.axisY.Mg(!1,this.Lb).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.Ob.dispose(),this.Db.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(nt(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.Ob.setValue(t.x),this.Db.setValue(t.y);const e=ya(u(this.Ob.getValue(),this.Db.getValue()),this.axisX,this.axisY);return this.Ob.setGridStrokeLength(this.Fb?e.x:1),this.Db.setGridStrokeLength(this.Pb?e.y:1),this}ru(){this.Ob.setVisible(this.Ri&&this.IS).setMarkerVisible(this.Ri&&this.IS&&this.kb),this.Db.setVisible(this.Ri&&this.IS).setMarkerVisible(this.Ri&&this.IS&&this.Cb);const t=ya(u(this.Ob.getValue(),this.Db.getValue()),this.axisX,this.axisY);return this.Ob.setGridStrokeLength(this.Fb?t.x:1),this.Db.setGridStrokeLength(this.Pb?t.y:1),super.ru()}setGridStrokeXCut(t){return this.Fb=t,this.Lr.Bi(),this}getGridStrokeXCut(){return this.Fb}setGridStrokeYCut(t){return this.Pb=t,this.Lr.Bi(),this}getGridStrokeYCut(){return this.Pb}setGridStrokeXStyle(t){return this.Ob.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.Ob.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.kb=t,this.Lr.Bi(),this}getTickMarkerXVisible(){return this.kb}setTickMarkerYVisible(t){return this.Cb=t,this.Lr.Bi(),this}getTickMarkerYVisible(){return this.Cb}setTickMarkerX(t){return this.Ob.setMarker(t),this}setTickMarkerY(t){return this.Db.setMarker(t),this}getTickMarkerX(){return this.Ob.getMarker()}getTickMarkerY(){return this.Db.getMarker()}}class Sa extends Eh{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,h),this.Fb=!1,this.Pb=!1,this.Rb=!1,this.Eb=!1,this.zb=new Map,this.Vb=new Map,this.kb=!0,this.Cb=!0,this.FS=s,this.PS=r,this.Bb=n,this.Lb=o,this.Nb=h.cursorGridStrokeStyleX,this.Gb=h.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.zb.forEach((t=>t.dispose())),this.Vb.forEach((t=>t.dispose())),this.Hb=void 0,this.Wb=void 0,this}ru(){return this.Hb&&this.Hb.setVisible(this.Ri&&this.IS).setMarkerVisible(this.Ri&&this.IS&&this.kb),this.Wb&&this.Wb.setVisible(this.Ri&&this.IS).setMarkerVisible(this.Ri&&this.IS&&this.Cb),super.ru()}pointAt(t){const{location:e}=t,{series:i}=t,{axisX:s}=i,{axisY:r}=i,n=this.Yi(s,!0),o=this.Yi(r,!1);n!==this.Hb&&this.Hb&&this.Hb.setVisible(!1),o!==this.Wb&&this.Wb&&this.Wb.setVisible(!1),n.setValue(e.x),o.setValue(e.y);const h=ya(u(e.x,e.y),s,r);return n.setGridStrokeLength(this.Fb?h.x:1),o.setGridStrokeLength(this.Pb?h.y:1),this.Hb=n,this.Wb=o,super.pointAt(t)}OS(t){if(super.OS(t),t){const e=e=>e.setTextFillStyle(t);this.Hb&&this.Rb&&this.Hb.setMarker(e),this.Wb&&this.Eb&&this.Wb.setMarker(e)}}Yi(t,e){let i=(e?this.zb:this.Vb).get(t);return i||(e?(i=t.Mg(!1,this.Bb),this.zb.set(t,i)):(i=t.Mg(!1,this.Lb),this.Vb.set(t,i)),this.Hs(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}Hs(t,e){const i=e?this.Nb:this.Gb;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.kb:this.Cb)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.Fb=t,this.Lr.Bi(),this}getGridStrokeXCut(){return this.Fb}setGridStrokeYCut(t){return this.Pb=t,this.Lr.Bi(),this}getGridStrokeYCut(){return this.Pb}setGridStrokeXStyle(t){return this.Nb=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.zb.forEach((t=>t.setGridStrokeStyle(this.Nb))),this}getGridStrokeXStyle(){return this.Nb}setGridStrokeYStyle(t){return this.Gb=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.Vb.forEach((t=>t.setGridStrokeStyle(this.Gb))),this}getGridStrokeYStyle(){return this.Gb}setTickMarkerXVisible(t){return this.kb=t,this.Lr.Bi(),this}getTickMarkerXVisible(){return this.kb}setTickMarkerYVisible(t){return this.Cb=t,this.Lr.Bi(),this}getTickMarkerYVisible(){return this.Cb}setTickMarkerX(t){return this.zb.forEach((e=>e.setMarker(t))),this.Bb=this.Bb.addStyler(t),this.Lr.Bi(),this}setTickMarkerY(t){return this.Vb.forEach((e=>e.setMarker(t))),this.Lb=this.Lb.addStyler(t),this.Lr.Bi(),this}setTickMarkerXAutoTextStyle(t){return this.Rb=t,this.Lr.Bi(),this}getTickMarkerXAutoTextStyle(){return this.Rb}setTickMarkerYAutoTextStyle(t){return this.Eb=t,this.Lr.Bi(),this}getTickMarkerYAutoTextStyle(){return this.Eb}}class va extends kh{constructor(t,e,i,s,r){super(t,e,r),this.FS=t,this.PS=e,this.Bb=i,this.Lb=s,this.RS=r}}class ba extends va{constructor(){super(...arguments),this.zS=(t,e,i,s)=>this.ES(new Sa(t,e,i,this.FS,this.PS,this.Bb,this.Lb,s),s),this.addStyler=t=>new ba(this.FS,this.PS,this.Bb,this.Lb,this.RS.map((t=>t)).concat(t)),this.setPointMarker=t=>new ba(t,this.PS,this.Bb,this.Lb,this.RS.map((t=>t))),this.setResultTableBackground=t=>new ba(this.FS,t,this.Bb,this.Lb,this.RS.map((t=>t)))}}class Ma extends va{constructor(){super(...arguments),this.VS=(t,e,i,s,r)=>this.ES(new xa(t,e,i,s,this.FS,this.PS,this.Bb,this.Lb,r),r),this.addStyler=t=>new Ma(this.FS,this.PS,this.Bb,this.Lb,this.RS.map((t=>t)).concat(t)),this.setPointMarker=t=>new Ma(t,this.PS,this.Bb,this.Lb,this.RS.map((t=>t))),this.setResultTableBackground=t=>new Ma(this.FS,t,this.Bb,this.Lb,this.RS.map((t=>t)))}}const Aa=new ba(pn,pn,to.PointableTextBox,to.PointableTextBox,[(t,e)=>{Ph(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),qr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),qr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),wa=new Ma(xn,pn,to.PointableTextBox,to.PointableTextBox,[(t,e)=>{Lh(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),qr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),qr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Da=(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}},Ta=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class Ea{constructor(t,i,s,n,o,h){this.Ub=e.UIVisibilityModes.always,this.$b=e.UIVisibilityModes.always,this.pr=!0,this.ce=!1,this.Yb=!1,this.Xb=!1,this.qr=u(0,0),this.Zl=e.UIDraggingModes.draggable,this.Kl=void 0,this.P=new r.Eventer,this.Ri=!0,this.jb=(t,i,s)=>{this.Yb=!0,this.Lr.Bi();const r=this.Zl===e.UIDraggingModes.notDraggable?this.Zl:s||this.Zl;this.Kl=this.Lr.Li.Ae(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.Zb=()=>{this.Yb=!1,this.Lr.Bi(),this.Lr.Li.we(this.Kl)},this.Kb=(t,e)=>{this.Xb=!0,Xt(e),this.Lr.Bi()},this.qb=(t,i)=>{if(this.Zl!==e.UIDraggingModes.notDraggable){const s=i||this.Zl,r=nt(this.Lr.Li.ke(t.x,t.y),this.Lr.Li.ct,this.scale),n=u(s!==e.UIDraggingModes.onlyVertical?Ta(r.x,this.scale.x):this.qr.x,s!==e.UIDraggingModes.onlyHorizontal?Ta(r.y,this.scale.y):this.qr.y);return this.setPosition(n),!0}return!1},this.Jb=(t,e)=>{this.Xb=!1,Xt(e),this.Lr.Bi()},this.onDispose=t=>this.P.on("dispose",t),this.offDispose=t=>this.P.off(t,"dispose"),this.Lr=t,this.renderingScale=i,this.scale=s,this.Mx=n,this.Qb=o,this.hs=h;const a=n.getPointMarker().setMouseInteractions(!0);a.onMouseEnter(this.jb),a.onMouseLeave(this.Zb),a.onMouseDragStart(this.Kb),a.onMouseDrag(((t,e)=>this.qb(u(e.clientX,e.clientY))&&Xt(e))),a.onMouseDragStop(this.Jb),a.onTouchStart(this.Kb),a.onTouchMove(((t,e)=>this.qb(u(e.clientX,e.clientY))&&Xt(e))),a.onTouchEnd(this.Jb),n.getResultTable().setMouseInteractions(!0),this.setPosition(this.qr)}setPosition(t){return this.qr=t,this.Mx.setPosition(t),this.P.emit("positionChange",this,this.qr),this}getPosition(){return this.qr}onPositionChange(t){return this.P.on("positionChange",t)}offPositionChange(t){return this.P.off(t,"positionChange")}setPointMarkerVisibility(t){return this.Ub=t,this.Lr.Bi(),this}getPointMarkerVisibility(){return this.Ub}setResultTableVisibility(t){return this.$b=t,this.Lr.Bi(),this}getResultTableVisibility(){return this.$b}setMouseInteractions(t){return this.pr=t,this.Mx.getPointMarker().setMouseInteractions(t),this.Mx.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.pr}setAutoFitStrategy(t){return this.Mx.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.Mx.getAutoFitStrategy()}isAttached(){return!0}ru(){const t=this.isAttached();return Da(this.Ub,this.Yb,this.Xb)?this.Mx.setPointMarkerVisible(!0):this.Mx.setPointMarkerVisible(!1),t&&Da(this.$b,this.Yb,this.Xb)?this.Mx.setResultTableVisible(!0):this.Mx.setResultTableVisible(!1),this.Mx.ru(),this}Gs(){return this.Mx.Gs(),this}pointAt(t){return this.Mx.pointAt(t),this}dispose(){return this.ce||(this.ce=!0,this.Qb(this),this.Mx.dispose(),this.P.emit("dispose")),this}setVisible(t){const e=this.Ri!==t;return this.Ri=t,this.Mx.setVisible(t),e&&this.P.emit("visibleStateChanged",this,this.Ri),this}getVisible(){return this.Ri}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}setPointMarker(t){return this.Mx.setPointMarker(t),this}getPointMarker(){return this.Mx.getPointMarker()}setResultTable(t){return this.Mx.setResultTable(t),this}getResultTable(){return this.Mx.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Zl=t,this.Lr.Bi(),this}getDraggingMode(){return this.Zl}}class Ba extends Ea{constructor(t,i,s,r,n,o,h){super(t,i,oo(s.ct,r.ct),n.VS(t,i,s,r,h),o,h),this.tv=e.UIVisibilityModes.always,this.sv=e.UIVisibilityModes.always,this.ev=e.UIVisibilityModes.always,this.hv=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.Mx.getGridStrokeXStyle(),this.gridStrokeStyleY=this.Mx.getGridStrokeYStyle(),this.Lr=t,this.axisX=s,this.axisY=r,this.Qb=o;const a=this.Mx.getTickMarkerX().setMouseInteractions(!0);a.onMouseEnter(((t,i)=>this.jb(t,i,e.UIDraggingModes.onlyHorizontal))),a.onMouseLeave(this.Zb),a.onMouseDragStart(this.Kb),a.onMouseDrag(((t,i)=>this.qb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Xt(i))),a.onMouseDragStop(this.Jb),a.onTouchStart(this.Kb),a.onTouchMove(((t,i)=>this.qb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Xt(i)));const l=this.Mx.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.jb(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.Zb),l.onMouseDragStart(this.Kb),l.onMouseDrag(((t,i)=>this.qb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Xt(i))),l.onMouseDragStop(this.Jb),l.onTouchStart(this.Kb),l.onTouchMove(((t,i)=>this.qb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Xt(i)))}ru(){const t=this.isAttached();return this.Ri&&t&&Da(this.ev,this.Yb,this.Xb)?this.Mx.setTickMarkerXVisible(!0):this.Mx.setTickMarkerXVisible(!1),this.Ri&&t&&Da(this.hv,this.Yb,this.Xb)?this.Mx.setTickMarkerYVisible(!0):this.Mx.setTickMarkerYVisible(!1),this.Mx.setGridStrokeXStyle(this.Ri&&t&&Da(this.tv,this.Yb,this.Xb)?this.gridStrokeStyleX:J),this.Mx.setGridStrokeYStyle(this.Ri&&t&&Da(this.sv,this.Yb,this.Xb)?this.gridStrokeStyleY:J),super.ru()}setGridStrokeXVisibility(t){return this.tv=t,this.Lr.Bi(),this}getGridStrokeXVisibility(){return this.tv}setGridStrokeYVisibility(t){return this.sv=t,this.Lr.Bi(),this}getGridStrokeYVisibility(){return this.sv}setTickMarkerXVisibility(t){return this.ev=t,this.Lr.Bi(),this}getTickMarkerXVisibility(){return this.ev}setTickMarkerYVisibility(t){return this.hv=t,this.Lr.Bi(),this}getTickMarkerYVisibility(){return this.hv}setGridStrokeXCut(t){return this.Mx.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.Mx.getGridStrokeXCut()}setGridStrokeYCut(t){return this.Mx.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.Mx.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.Mx.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.Mx.getGridStrokeYStyle()}setTickMarkerX(t){return this.Mx.setTickMarkerX(t),this}getTickMarkerX(){return this.Mx.getTickMarkerX()}setTickMarkerY(t){return this.Mx.setTickMarkerY(t),this}getTickMarkerY(){return this.Mx.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.Mx.getTickMarkerX().setMouseInteractions(t),this.Mx.getTickMarkerY().setMouseInteractions(t),this}}class ka extends Ba{}class Ia extends ka{constructor(t,e,i,s,r,n){super(t,e,i.axisX,i.axisY,s,r,n),this.rv=!1,this.Lr=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.rv=!1,this.Lr.Bi(),this}Gs(){if(!this.rv){const t=this.owningSeries.solveNearestFromScreen(nt(this.qr,this.scale,this.Lr.Li.ct));t?(this.qr=nt(t.location,this.owningSeries.scale,this.scale),this.Mx.pointAt(t),this.rv=!0):this.Mx.setPosition(this.qr)}return super.Gs()}isAttached(){return this.rv}}class Ca extends ra{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.nv=[],this.addMarker=(t=wa)=>{const e=new Ia(this.ov(),this.qa.uiScale,this,t,this.removeMarker,this.hs);return this.nv.push(e),e},this.removeMarker=t=>{const e=this.nv.indexOf(t);-1!==e&&this.nv.splice(e,1)},this.de=new Map,this.chart=t,this.Lr=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.ov=h,this.scale=oo(s.ct,r.ct),this.av=t.lv,t.lv+=1,this.uv(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.cv),this.onMouseLeave(this.chart.dv),this.onMouseWheel(this.chart.fm),this.onMouseDragStart(this.chart.fv),this.onMouseDrag(this.chart.gm),this.onMouseDragStop(this.chart.gv),this.onTouchStart(this.chart.pm.onTouchStart),this.onTouchMove(this.chart.pm.onTouchMove),this.onTouchEnd(this.chart.pm.onTouchEnd)}attacheAxis(){this.pv=this.axisXAttachHandler(this),this.mv=this.axisYAttachHandler(this)}ru(){super.ru();for(let t=0;t{e.Rr(this.av)})),this.qa.Li.Bi(),this}dispose(){return super.dispose(),this.nv.slice().forEach((t=>t.dispose())),this.pv(this),this.mv(this),this}yv(){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 _a extends Ca{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,i,s,r,n,o,h,a,u,c),this.Sv=[],this.ca=[],this.xv=0,this.rh=!1,this.Pu=e.HighlightModes.onHover,this.ox=Fa,this.bv=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.xv=void 0!==e&&e>0?e:0,this.Lr.Bi(),this}add(t){if(Array.isArray(t)?this.vv(t):this.vv([t]),this.ca.length>0){const t=this.ca[this.ca.length-1];this.Mv={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.Mv?this.Mv.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.Jn()+e.Qn()),this.ca.length)}clear(){this._v=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.bv.getXMax(this.Sv,this._v)||0}getXMin(){return this.bv.getXMin(this.Sv,this._v)||0}getYMax(){return this.bv.getYMax(this.Sv,this._v)||0}getYMin(){return this.bv.getYMin(this.Sv,this._v)||0}Wp(){const t=u(0,0);for(const e of this.Sv)t.x=Math.max(t.x,e.co()),t.y=Math.max(t.y,e.do());return t}Av(t,e,i,s){this.bv.Av(t,e,i,s,this.scale,(t=>{this.oc(t)}))}xm(){super.xm();const t=this.Sv.length;this.wv&&this.Av(this.Sv,this.getPointAmount(),this.wv,this.xv),t!==this.Sv.length&&this.yv()}ru(){super.ru();const t=this.getBoundaries();this.ca.length>0&&(this.kv(this.ca),this.ca=[]);for(const e of this.Sv)e.Cr(t);return super.ru()}bm(){super.bm(),this._v=void 0,this.ca.length=0}vv(t){0!==t.length&&(this._v?this._v=Ne(this._v,ze(t)):this._v=ze(t),this.P.emit("dataAdd",this,t,this._v),this.ca=ie(this.ca,t,{canReturnB:!1}),this.Lr.Bi())}Cv(){return La(this.Sv)}Tv(t){return this.P.on("dataAdd",t)}Iv(t){return this.P.off(t)}Fv(t){return this.P.on("dataClear",t)}Pv(t){return this.P.off(t)}}const Oa=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;h{const e=this.Bv.indexOf(t);e>=0&&this.Bv.splice(e,1);const i=this.Dv.findIndex((e=>e===t.Dn));i>=0&&this.Dv.splice(i,1),this.oc(t.Dn),this.Lr.Bi()};const o=this.qa.getSeries().length;this.Vr=ue(this.hs.polarPolygonSeriesFillStyle,o),this.$r=ue(this.hs.polarPolygonSeriesStrokeStyle,o)}addPolygon(){const t=new pa(this.qa,this.Lv,this,this.Ov());return this.Bv.push(t),t}setFillStyle(t){this.Vr="function"==typeof t?t(this.Vr):t;const e=this.Vr;for(const t of this.Dv)t.ps(e);return this.Lr.Bi(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){this.$r="function"==typeof t?t(this.$r):t;const e=this.$r;for(const t of this.Dv)t.$h(e);return this.Lr.Bi(),this}getStrokeStyle(){return this.$r}Qs(){return this.um&&void 0!==this.Bv.find((t=>void 0!==t.Rv))&&this.getVisible()}ru(){this.Bv.forEach((t=>{(t._b||this.scale.xb())&&t.Ev&&(t.Dn.lo(la(t.Ev,this.scale)),t._b=!1,t.Dn.Gs())}))}xm(){super.xm();const t=m(Me,Ae);this.Bv.forEach((e=>{if(!e.wb)return;const i=!e._b&&e.Ev?e.Ev:ca(e.wb);e.Ev=i;const s=!e._b&&e.Rv?e.Rv:ua(i);e.Rv=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.cb=t}mc(t,e){t.Ir(e),this.Lr.Bi()}jS(t,e){const i=Oa(t,this.Dv,((t,e)=>{const i=t.jS(e);if(i)return nt(i,this.scale,t.Li.ct)}),Le);if(!i)return;const s=nt(i[0],i[1].Li.ct,this.scale),r=this.zv(i[1]);if(!r)return;const{angle:n,amplitude:o}=da(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.ox(new wh,this,n,o,this.qa.getAmplitudeAxis().formatValue).wu(),series:this,fillStyle:this.Vr,polarPolygon:r}}solveNearestFromScreen(t){return this.jS(t,!1)}attach(t,e=!0){return super.attach(t,e),oe(t,this.hs,{fill:this.Vr,stroke:this.$r}),this}Ov(){const t=this.Lr.vc(this.scale,Ws.Simple).ps(this.Vr).$h(this.$r).Ir(this.getHighlight());return this.Dv.push(t),this.rc(t),t}zv(t){return this.Bv.find((e=>e.Dn===t))}}class Va extends na{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.ac="Area Series",this.fb=[],this.gb=!1,this.pb=!1,this.Vv=!1;const o=this.qa.getSeries().length;this.Vr=ue(this.hs.polarAreaSeriesFillStyle,o),this.$r=ue(this.hs.polarAreaSeriesStrokeStyle,o)}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),oe(t,this.hs,{fill:this.Vr,stroke:this.$r}),this}}class Na extends Va{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Nv=this.Lr.vc(this.scale,Ws.Simple).Ir(this.getHighlight()),this.rc(this.Nv)}ru(){if(this.gb||this.scale.xb()){const t=this.fb,e=!0===this.pb?la(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(Mt(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;!Mt(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.Gv.start}eb(t){this.Hv=t,this.Xv=!0}rb(){return!1===this.Hv}hb(t){this.Wv=t,this.Xv=!0}tb(){return this.Wv}Qt(){return!1}nt(t,e,i,s){return this.x=new Ai(t.x,e.x,i.x,s?s.x:void 0),this.y=new Ai(t.y,e.y,i.y,s?s.y:void 0),this}jt(){return this.Ht}xb(){return this.Yv}Kv(){return this.Xv}pi(){return this.Xt}yi(){return this.jv}X(){return this.o=!1,this.Xt=!1,this.Yv=!1,this.Xv=!1,this}j(){return this.o=!0,this.Xt=!0,this.Yv=!0,this.Xv=!0,this}q(t,e){return"object"==typeof t?(this.Y.x=t.x,this.Y.y=t.y):(this.Y.x=t,this.Y.y=e),this.Zv(),this}ci(t){return this.Uv=t,this.Zv(),this}di(t){return this.$v=t,this.Zv(),this}Rt(){return u(this.Uv[0]+this.Uv[1],this.$v[0]+this.$v[1])}Et(){return this.Y}Zv(){const t=this.Gv,e=u(this.x.zt(this.Y.x),this.y.zt(this.Y.y)),i=this.Uv[0]+this.Uv[1],s=this.$v[0]+this.$v[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.Uv[0]+Math.max((r-2*o)/2,0),this.Uv[1]+Math.max((r-2*o)/2,0)],a=[this.$v[0]+Math.max((n-2*o)/2,0),this.$v[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.q(this.Y.x).Dt(h).Z(-l,l),this.y.q(this.Y.y).Dt(a).Z(-l,l),this.jv={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.Ht={x:this.x.jt(),y:this.y.jt()},this.j()}Yt(t,e){const i=this.yi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Si(t,e,i,s){const r=this.yi(),n=$e(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 Ua extends qh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Xg("polarChart bg",0),i.Eg("polarChart ui"),r,i.Li.hs.polarChartBackgroundFillStyle,i.Li.hs.polarChartBackgroundStrokeStyle,i.Li.hs.polarChartTitleFont,i.Li.hs.polarChartTitleFillStyle,h),this.NS=e.AutoCursorModes.snapToClosest,this.$d=[],this.pr=!0,this.qv=(t,e,i,s,r)=>{this.Rx.q(s,r)},this.jd=Zt(this.$d),this.Jv=t=>{this.$d.push(t)},this.Qv=()=>this.Lm,this.ef.Ah||this.ef._h||this.Li.bh(4),this.tM=i.qy("polarChart series bg",0),this.iM=i.Pp("polarChart axis gridlines",0),this.sM=i.Pp("polarChart series",1),this.eM=i.Pp("polarChart axis lines",2),this.hM=i.Pp("polarChart axis ticks",3),this.Rx=s.d2({scaleXYConstructor:Ga}),this.onResize(this.qv),this.Kg.fs("Polar Chart");const a=kt(o?o.autoCursorBuilder:void 0,Fh);this.XS=a.zS(this.HS,this.uiScale,this.uiScale,this.hs),this.Gm=this.tM.kc(this.Rx).ps(this.hs.polarChartSeriesBackgroundFillStyle).$h(J).Zo(0).Ko(360).ta(0),this.Hm=this.tM.kc(this.Rx).ps(F).$h(this.hs.polarChartSeriesBackgroundStrokeStyle).Zo(0).Ko(360).ta(0),super.Nm(this.Gm,this.Hm),this.Yg(n,this.pixelScale),this.rM=new Jh(this,this.Rx,this.hs,!(!o||!0!==o.disableAnimations),this.iM,this.eM,this.hM,this.iu,this.Qv),this.nM=new ta(this,this.Rx,this.hs,!(!o||!0!==o.disableAnimations),this.iM,this.eM,this.hM,this.iu),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1)}addLineSeries(){const t=new fa(this.sM,this,this.Rm,this.Rx,this.hs,this.Li.iu);return this.Wm(t),t}addPointSeries(){const t=new ma(this.sM,this,this.Rm,this.Rx,this.hs,this.Li.iu);return this.Wm(t),t}addPointLineSeries(){const t=new ga(this.sM,this,this.Rm,this.Rx,this.hs,this.Li.iu);return this.Wm(t),t}addAreaSeries(){const t=new Na(this.sM,this,this.Rm,this.Rx,this.hs,this.Li.iu);return this.Wm(t),t}addPolygonSeries(){const t=new za(this.sM,this,this.Rm,this.Rx,this.hs,this.Li.iu);return this.Wm(t),t}getSeries(){return this.Lm}addSector(){const t=new sa(this.sM,this,this.jd,this.Rx,this.hs,this.Li.iu);return this.Jv(t),t}getAmplitudeAxis(){return this.rM}getRadialAxis(){return this.nM}ru(){var t,e;super.ru(),po.ip(this.Kg,this.jg);for(const t of this.Lm)t.xm();this.rM.he(),this.nM.he();for(const t of this.Lm)t.ru();for(let t=1;t<=2;t+=1){const e=this.rM.ru(),i=this.nM.ru(),s=po.tp(this.Kg,this.jg),r=[this.rn.left+i,this.rn.right+i],n=[this.rn.bottom+i,this.rn.top+i+s];this.Rx.ci(r).di(n);const o=4;if(!(!this.oM||Math.abs(this.oM.amplitude-e)>=o||Math.abs(this.oM.radial-i)>=o)||1!==t){this.oM={amplitude:e,radial:i};break}}const i=this.Rx.Zx().start,s=this.Rx.Zx().end,r=this.Rx.jx()?((null===(t=this.oM)||void 0===t?void 0:t.radial)||0)*this.Rx.x.getPixelSize()+s-i:((null===(e=this.oM)||void 0===e?void 0:e.radial)||0)*this.Rx.x.getPixelSize()+i-s;this.Gm.qo(r).ia(360),this.Hm.qo(r).ia(360);for(const t of this.$d)t.ru();this.ZS(!1);for(const t of this.Lm)t.bm();return super.$g(),this.aM(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.rM.setAnimationsEnabled(t),this.nM.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.pr=t,this}getMouseInteractions(){return this.pr}getMinimumSize(){return u(Ha,Ha)}aM(){}forEachAxis(t){return t(this.rM),t(this.nM),this}dispose(){return this.tM.G(),this.iM.G(),this.sM.G(),this.eM.G(),this.hM.G(),this.$d.slice().forEach((t=>t.dispose())),super.dispose()}dd(){return[...this.Lm,...this.$d]}}const Ha=300;class Wa extends vo{}class Ya extends Wa{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.ac="Slice",this.u=0,this.sp=!1,this.lM=F,this.hp=F,this.rp=this.u,this.ap=W((()=>this.qa.Li.Bi())),this.up=()=>{this.cp=void 0},this.index=t,this.qa=s,this.scale=r,this.tc=n,this.Nv=e.vc(r,Ws.Simple).Ir(this.getHighlight()),this.rc(this.Nv),this._i=i.ue(r).Ir(this.getHighlight()),this.rc(this._i,{isText:!0})}setValue(t){return this.qa.getAnimationsEnabled()?this.getVisible()&&this.pp(this.rp,t):this.rp=t,this.u=t,this.qa.Li.Bi(),this}getValue(){return this.u}setVisible(t){return!1===t?this.qa.getAnimationsEnabled()&&this.rp>0?(this.cp&&(this.cp.finish(!1),this.cp=void 0),this.pp(this.rp,0,(()=>super.setVisible(!1)))):(this.rp=0,super.setVisible(!1)):this.qa.getAnimationsEnabled()?(this.cp&&(this.cp.finish(!1),this.cp=void 0),super.setVisible(!0),this.pp(this.rp,this.u)):(this.rp=this.u,super.setVisible(!0)),this}pp(t,e,i){this.cp=this.ap(300,U.ease)([[t,e]],(([t])=>{this.rp=t,this.qa.Li.Bi()})),this.cp.onEveryAnimationEnd(this.up),i&&this.cp.onAnimationEnd(i)}setStyle(t,e,i,s){this.lM=t,this.hp=i,this.Nv.ps(this.lM).$h(e),this._i.ps(this.hp).Ss(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},$a=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=Xa(i,r.x),s=Xa(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},m={x:0,y:n.bottom},p=0,y=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:m.x-x*o,y:m.y-o}),v=(i+c/u*(s-i))/2,g={x:a-v,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-S:S}`,10)},m={x:a+v,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&m.x>g.x&&y.Nv.lo([g,d,f,m])}};class ja extends mo{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Xg("funnelChart bg",0),i.Eg("funnelChart ui"),r,i.Li.hs.funnelChartBackgroundFillStyle,i.Li.hs.funnelChartBackgroundStrokeStyle,i.Li.hs.funnelChartTitleFont,i.Li.hs.funnelChartTitleFillStyle,o),this.mp=[],this.yp=xo.None,this.bp=!0,this._p=0,this.uM=80,this.cM=20,this.dM=0,this.fM=e.FunnelSliceModes.VariableHeight,this.kp=!0,this.Tp=t=>{const e=this.mp.indexOf(t);e>=0&&(this.mp.splice(e,1),this.Ip())},this.ef.Ah||this.ef._h||this.Li.bh(5),this.Cp=this.hs.effectsText,this.Fp=i.Pp("funnelChart bottom",0),this.Dp=i.Pp("funnelChart top",1),this.Kg.fs("Funnel Chart"),this.Sp=this.hs.funnelChartSliceFillStylePalette,this.xp=this.hs.funnelChartSliceStrokeStyle,this.vp=this.hs.funnelChartSliceLabelFont,this.Mp=this.hs.funnelChartSliceLabelFillStyle,h&&this.setAnimationsEnabled(!1),this.Yg(n,this.pixelScale)}addSlice(t,e){const i=new Ya(this._p,this.Fp,this.Dp,this,this.pixelScale,this.Tp,this.hs,this.Li.iu);return this._p+=1,i.setName(t),i.setValue(e),i.iu.sc.vs(this.Cp),i.iu.hc.vs(this.kp),this.mp.push(i),this.Li.Bi(),i.setHighlightOnHover(this.bp),i}addSlices(t){const e=[];for(let i=0;ie.iu.hc.vs(t))),this.Li.Bi(),this}getSliceEffect(){return this.kp}setSliceSorter(t){return this.yp=t,this.mp=this.mp.sort(this.yp),this.Li.Bi(),this}getSliceSorter(){return this.yp}setLabelFillStyle(t){return this.Mp="function"==typeof t?t(this.Mp):t,this.Li.Bi(),this}getLabelFillStyle(){return this.Mp}setLabelFont(t){return this.vp="function"==typeof t?t(this.vp):t,this.Li.Bi(),this}getLabelFont(){return this.vp}setLabelEffect(t){return this.Cp=t,this.mp.forEach((e=>e.iu.sc.vs(t))),this.Li.Bi(),this}getLabelEffect(){return this.Cp}setLabelFormatter(t){return this.Lp=t,this.Li.Bi(),this}getLabelFormatter(){return this.Lp}setSliceHighlightOnHover(t){return this.bp=t,this.mp.forEach((e=>e.setHighlightOnHover(t))),this}ru(){super.ru(),po.ip(this.Kg,this.jg),super.$g();const t=po.tp(this.Kg,this.jg),e=u(this.pixelScale.x.getInnerInterval()-(this.rn.left+this.rn.right),this.pixelScale.y.getInnerInterval()-(this.rn.bottom+this.rn.top+t)),i=u(this.rn.left+e.x/2,this.rn.bottom+e.y/2);this.mp=this.mp.sort(this.yp);for(let t=0,{length:e}=this.mp;tt.getAnimatedValue()>0));let r=0;for(let t=0;t0?o/r:0);var o;for(let t=0;tt.dispose())),super.dispose()}}const Za=(t,i,s)=>{const r=t.uo();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}}},Ka=t=>{const e=t.uo();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 Ja extends ja{constructor(){super(...arguments),this.Lp=So.NamePlusValue,this.Rp=10,this.gM=e.FunnelLabelSide.Left,this.pM=e.SliceLabelIndices.LabelsOnSides,this.zp=[],this.Vp=this.hs.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Vp=t;for(let t=0;t{const e=this.mp.indexOf(t);e>=0&&this.mp.splice(e,1)},this.ef.Ah||this.ef._h||this.Li.bh(6),this.Lr=e.Pp("gaugeChart layer",0),this.Dp=e.Pp("gaugeChart top layer",1),this.Kg.fs("Gauge Chart"),this.Yg(r,this.pixelScale);const h=Fr();this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}dispose(){return this.Lr.G(),this.Dp.G(),this.mp.slice().forEach((t=>t.dispose())),super.dispose()}}class rl extends sl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Vo=90,this.No=-270,this.SM={min:this.Vo,max:this.No},this.xM=W((()=>this.Lr.Bi())),this.bM=()=>{this.vM=void 0},this.MM=e.Pp("radialGaugeChart bg arc",2),this._M=this.Lr.kc(this.pixelScale).ps(this.hs.gaugeChartEmptyGaugeFillStyle).$h(this.hs.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.Vo,s=this.No,r=this.SM;return this.getAnimationsEnabled()?this.AM(r,{min:t,max:e}):(r.min=t,r.max=e,this.Vo=t,this.No=e),this.P.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.Li.Bi(),this}getAngleInterval(){return{min:this.Vo,max:this.No}}setGaugeFillStyle(t){return this._M.ps(t),this.Li.Bi(),this}setGaugeStrokeStyle(t){return this._M.$h(t),this.Li.Bi(),this}AM(t,e,i){this.vM=this.xM(1e3,U.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.SM={min:t,max:e},this.Vo=t,this.No=e,this.Lr.Bi()})),this.vM.onEveryAnimationEnd(this.bM),i&&this.vM.onAnimationEnd(i)}onAngleIntervalChange(t){return this.P.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.P.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.MM.G(),this}}class nl extends vo{wM(t){return this.P.on("valueChange",t)}kM(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){oe(t,this.hs,{fill:this.CM})}}class ol extends nl{onValueChange(t){return this.wM(t)}onIntervalChange(t){return this.kM(t)}}class hl extends ol{constructor(t,e,i,s,r,n,o){super(i,r,n,o),this.Vo=0,this.No=0,this.TM=0,this.IM=0,this.FM=0,this.PM=100,this.DM=!0,this.rp=this.u,this.op=this.getVisible(),this.ap=ye(),this.BM=t=>{this.rp=t,this.qa.Li.Bi()},this.LM=t,this.fe=e,this.qa=i,this.scale=s,this.CM=this.hs.gaugeChartGaugeFillStyle,this.gp=t.kc(s).ps(this.CM).$h(J).Ir(this.getHighlight()),this.rc(this.gp),this.OM=e.ue(s).Ir(this.getHighlight()),this.rc(this.OM,{isText:!0}),this.RM=e.ue(s).Ir(this.getHighlight()),this.rc(this.RM,{isText:!0}),this._i=e.ue(s).Ir(this.getHighlight()),this.rc(this._i,{isText:!0}),this.OM.ps(n.gaugeChartIntervalLabelsFillStyle).Ss(n.gaugeChartIntervalLabelsFont),this.RM.ps(n.gaugeChartIntervalLabelsFillStyle).Ss(n.gaugeChartIntervalLabelsFont),this._i.ps(n.gaugeChartValueLabelFillStyle).Ss(n.gaugeChartValueLabelFont),this.setName("Gauge Slice")}ru(){const t=this.qa.getDataLabelFormatter(),e=this.Vo/90r&&(i=r);const n=this.No-e*this.IM,o=this.Vo+e*this.TM,h=this.PM-this.FM,a=(0!==h?(n-o)/h:1/0)*(i-this.FM);this.gp.Zo(o).Ko(o+a);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>r}):t.format(i);this._i.fs(l)}EM(){const t=this.qa.getIntervalLabelFormatter(),e="function"==typeof t?t(this.FM,{getInnerStart:()=>this.FM,getInnerEnd:()=>this.PM}):t.format(this.FM);return this.OM.fs(e).Gs(),this.OM.Et()}zM(){const t=this.qa.getIntervalLabelFormatter(),e="function"==typeof t?t(this.PM,{getInnerStart:()=>this.FM,getInnerEnd:()=>this.PM}):t.format(this.PM);return this.RM.fs(e).Gs(),this.RM.Et()}setName(t){return super.setName(t),this.qa.Li.Bi(),this}setValue(t){const e=this.u;return this.qa.getAnimationsEnabled()?this.op&&this.ap(e,t,this.BM):this.rp=t,this.u=t,this.P.emit("valueChange",this,e,t),this.qa.Li.Bi(),this}getValue(){return this.u}setVisible(t){return this.op=t,!1===t?this.qa.getAnimationsEnabled()&&this.rp>0?this.ap(this.rp,0,this.BM,{onCompleted:()=>super.setVisible(!1)}):(this.rp=0,super.setVisible(!1)):this.qa.getAnimationsEnabled()?(super.setVisible(!0),this.ap(this.rp,this.u,this.BM)):(this.rp=this.u,super.setVisible(!0)),this}setInterval(t,e){const i=this.FM,s=this.PM;return this.P.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.FM=t,this.PM=e,this.qa.Li.Bi(),this}setIntervalLabelsFont(t){return this.OM.Ss(t),this.RM.Ss(t),this.qa.Li.Bi(),this}getIntervalLabelsFont(){return this.OM.ys()}setIntervalLabelsFillStyle(t){return this.OM.ps(t),this.RM.ps(t),this.qa.Li.Bi(),this}getIntervalLabelsFillStyle(){return this.OM.gs()}setIntervalLabelsVisible(t){return t?(this.OM.setVisible(!0),this.RM.setVisible(!0)):(this.OM.setVisible(!1),this.RM.setVisible(!1)),this.DM=t,this}getIntervalLabelsVisible(){return this.DM}setAngleInterval(t,e){return this.Vo=t,this.No=e,this.qa.Li.Bi(),this}setMinAngle(t){return this.Vo=t,this.qa.Li.Bi(),this}setMaxAngle(t){return this.No=t,this.qa.Li.Bi(),this}setMarginInDegrees(t=this.TM,e=this.IM){return t!==this.TM&&(this.TM=t),e!==this.IM&&(this.IM=e),this.qa.Li.Bi(),this}setFillStyle(t){this.CM="function"==typeof t?t(this.CM):t;const e=this.CM;this.gp.ps(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 ll extends rl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Qc=20,this.GM=new Intl.NumberFormat,this.HM=new Intl.NumberFormat,this.WM=!1,this.UM=5;const h=new hl(this.Lr,this.Dp,this,this.pixelScale,this.Tp,this.hs,this.Li.iu);this.$M=h,this.mp.push(h),this.setPadding(10)}ru(){super.ru(),po.ip(this.Kg,this.jg),super.$g();const t=po.tp(this.Kg,this.jg),e=ze([this.$M.EM(),this.$M.zM()]),i=u(this.pixelScale.x.getInnerInterval()-(this.rn.left+this.rn.right+2*e.max.x),this.pixelScale.y.getInnerInterval()-(this.rn.bottom+this.rn.top+2*e.max.y+t)),s=Math.max(.5*Math.min(i.x,i.y),0),r=u(this.rn.left+e.max.x+.5*i.x,this.rn.bottom+e.max.y+.5*i.y),n=this.WM?this.YM(r,s):r,o=this._M.$r.getThickness(),h=s-.5*o,a=s-this.Qc;let l=a/s*100;l=l>100||l<0?99:l;const c=100*(1-(this.Qc-o)/s);this.XM(n,a)&&(this._M.qo(s).ta(l),this.$M.gp.qo(h).ta(c));const d=.5*(f=s,(g=this.No-this.Vo)/(2*Math.PI*f*(g/360))*o);var f,g;this._M.Zo(this.Vo).Ko(this.No).Sn(n),this.$M.gp.Sn(n),this.$M._i.Sn(n),this.sd&&this.$M.setFillStyle(new z({color:this.sd.getColors(this.$M.getAnimatedValue())})),this.$M.setMinAngle(this.Vo).setMaxAngle(this.No).setMarginInDegrees(d,d).ru();const m=this._M.Go();if(this.$M.getIntervalLabelsVisible()){this.jM(this.Vo,this.No,n,m+this.UM);const t=this.$M.OM.Gs().Mi(),e=this.$M.RM.Gs().Mi();Be(t,e)&&this.ZM(t,e,n,m+this.UM)}}XM(t,e){const i=Ze(this.$M._i.Gs().Et(),.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]}YM(t,e){const[i]=al(t,this.Vo,this.No,e,e),s=ze(i),r=.5*(s.max.x-s.min.x),n=.5*(s.max.y-s.min.y);return Ke(Je(t,u(s.min.x+r,s.min.y+n)),t)}jM(t,e,i,s){const r=ni(t),n=ni(e);this.$M.OM.Sn(Ye(u(i.x+s,i.y),i,-r)),this.$M.RM.Sn(Ye(u(i.x+s,i.y),i,-n)),this.$M.OM.kn(u(-Math.cos(r),-Math.sin(r))),this.$M.RM.kn(u(-Math.cos(n),-Math.sin(n)))}getDefaultSlice(){return this.$M}setAutoScaling(t){return this.WM=t,this.Li.Bi(),this}getAutoScaling(){return this.WM}setDataLabelFormatter(t){return this.HM=t,this.Li.Bi(),this}getDataLabelFormatter(){return this.HM}setIntervalLabelFormatter(t){return this.GM=t,this.Li.Bi(),this}getIntervalLabelFormatter(){return this.GM}setIntervalLabelPadding(t){return this.UM=t,this.Li.Bi(),this}getIntervalLabelPadding(){return this.UM}setThickness(t){return this.Qc=t,this}setLUT(t){return this.sd=t,this.Li.Bi(),this}setDataLabelFont(t){return this.$M._i.Ss(t),this.Li.Bi(),this}getDataLabelFont(){return this.$M._i.ys()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.$M.VM(t),this.Li.Bi(),this}getDataLabelFillStyle(){return this.$M.NM()}dd(){return this.mp}dispose(){return this.$M.dispose(),super.dispose()}}class ul extends vo{}class cl extends ul{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.ac="Slice",this.u=0,this.sp=!1,this.lM=F,this.hp=F,this.rp=this.u,this.ap=W((()=>this.qa.Li.Bi())),this.up=()=>{this.cp=void 0},this.index=t,this.qa=s,this.scale=r,this.tc=n,this.Nv=e.vc(r,Ws.Simple).Ir(this.getHighlight()),this.rc(this.Nv),this._i=i.ue(r).Ir(this.getHighlight()),this.rc(this._i,{isText:!0})}setValue(t){return this.qa.getAnimationsEnabled()?this.getVisible()&&this.pp(this.rp,t):this.rp=t,this.u=t,this.qa.Li.Bi(),this}getValue(){return this.u}setVisible(t){return!1===t?this.qa.getAnimationsEnabled()&&this.rp>0?(this.cp&&(this.cp.finish(!1),this.cp=void 0),this.pp(this.rp,0,(()=>super.setVisible(!1)))):(this.rp=0,super.setVisible(!1)):this.qa.getAnimationsEnabled()?(this.cp&&(this.cp.finish(!1),this.cp=void 0),super.setVisible(!0),this.pp(this.rp,this.u)):(this.rp=this.u,super.setVisible(!0)),this}pp(t,e,i){this.cp=this.ap(300,U.ease)([[t,e]],(([t])=>{this.rp=t,this.qa.Li.Bi()})),this.cp.onEveryAnimationEnd(this.up),i&&this.cp.onAnimationEnd(i)}setStyle(t,e,i,s){this.lM=t,this.hp=i,this.Nv.ps(this.lM).$h(e),this._i.ps(this.hp).Ss(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},fl=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=dl(i,r.x),s=dl(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},m={x:0,y:n.bottom},p=0,y=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:m.x-x*o,y:m.y-o}),v=(i+c/u*(s-i))/2,g={x:a-v,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-S:S}`,10)},m={x:a+v,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&m.x>=g.x&&y.Nv.lo([g,d,f,m])}};class gl extends mo{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Xg("pyramidChart bg",0),i.Eg("pyramidChart ui"),r,i.Li.hs.pyramidChartBackgroundFillStyle,i.Li.hs.pyramidChartBackgroundStrokeStyle,i.Li.hs.pyramidChartTitleFont,i.Li.hs.pyramidChartTitleFillStyle,o),this.mp=[],this.yp=xo.None,this.Sp=this.hs.pyramidChartSliceFillStylePalette,this.xp=this.hs.pyramidChartSliceStrokeStyle,this.bp=!0,this.vp=this.hs.pyramidChartSliceLabelFont,this.Mp=this.hs.pyramidChartSliceLabelFillStyle,this._p=0,this.uM=0,this.cM=80,this.dM=0,this.fM=e.PyramidSliceModes.VariableHeight,this.kp=!0,this.Tp=t=>{const e=this.mp.indexOf(t);e>=0&&(this.mp.splice(e,1),this.Ip())},this.ef.Ah||this.ef._h||this.Li.bh(8),this.Cp=this.hs.effectsText,this.Fp=i.Pp("pyramidChart bottom",0),this.Dp=i.Pp("pyramidChart top",1),this.Kg.fs("Pyramid Chart"),h&&this.setAnimationsEnabled(!1),this.Yg(n,this.pixelScale)}addSlice(t,e){const i=new cl(this._p,this.Fp,this.Dp,this,this.pixelScale,this.Tp,this.hs,this.Li.iu);return this._p+=1,i.setName(t),i.setValue(e),i.iu.sc.vs(this.Cp),i.iu.hc.vs(this.kp),this.mp.push(i),this.Li.Bi(),i}addSlices(t){const e=[];for(let i=0;ie.iu.hc.vs(t))),this.Li.Bi(),this}getSliceEffect(){return this.kp}setSliceSorter(t){return this.yp=t,this.mp=this.mp.sort(this.yp),this.Li.Bi(),this}getSliceSorter(){return this.yp}setLabelFillStyle(t){return this.Mp="function"==typeof t?t(this.Mp):t,this.Li.Bi(),this}getLabelFillStyle(){return this.Mp}setLabelFont(t){return this.vp="function"==typeof t?t(this.vp):t,this.Li.Bi(),this}getLabelFont(){return this.vp}setLabelEffect(t){return this.Cp=t,this.mp.forEach((e=>e.iu.sc.vs(t))),this.Li.Bi(),this}getLabelEffect(){return this.Cp}setLabelFormatter(t){return this.Lp=t,this.Li.Bi(),this}getLabelFormatter(){return this.Lp}setSliceHighlightOnHover(t){return this.bp=t,this.mp.forEach((e=>e.setHighlightOnHover(t))),this}ru(){super.ru(),po.ip(this.Kg,this.jg),super.$g();const t=po.tp(this.Kg,this.jg),e=u(this.pixelScale.x.getInnerInterval()-(this.rn.left+this.rn.right),this.pixelScale.y.getInnerInterval()-(this.rn.bottom+this.rn.top+t)),i=u(this.rn.left+e.x/2,this.rn.bottom+e.y/2);this.mp=this.mp.sort(this.yp);for(let t=0,{length:e}=this.mp;tt.getAnimatedValue()>0));let r=0;for(let t=0;t0?o/r:0);var o;for(let t=0;tt.dispose())),super.dispose()}}const ml=(t,i,s)=>{const r=t.uo();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}}},pl=t=>{const e=t.uo();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 yl extends gl{constructor(){super(...arguments),this.Lp=So.NamePlusValue,this.Rp=10,this.gM=e.PyramidLabelSide.Left,this.pM=e.SliceLabelIndices.LabelsOnSides,this.zp=[],this.Vp=this.hs.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Vp=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),Ml=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Al;e.SpiderWebMode=void 0,(Al=e.SpiderWebMode||(e.SpiderWebMode={}))[Al.Normal=0]="Normal",Al[Al.Circle=1]="Circle";class wl{constructor(t,e,i,s,n,o,h,a){this.P=new r.Eventer,this.qM=t,this.fe=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.JM=h,this.QM=a,this.t_=this.qM._u(this.scale).setMouseInteractions(!1),this.i_=this.fe.ue(this.scale).fs(this.tag).setMouseInteractions(!1),this.s_=this.JM(this,this.fe.Gp(this.scale,void 0,[Bo.InternalUI])).ea(this.chart.getNibStyle()),this.QM.nc([this.i_])}Op(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.i_.setVisible(!0).Sn(Ke(c,u(h.paddingX,h.paddingY))).Mn(h.alignmentX).An(h.alignmentY):this.i_.setVisible(!1)}getLabelSize(){return this.i_.Ss(this.chart.getAxisLabelFont()).ps(this.chart.getAxisLabelStyle()).Gs().Et()}dispose(){this.t_&&this.t_.dispose(),this.i_&&this.i_.dispose(),this.s_&&this.s_.dispose()}}const Dl=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Axis:","",s).addRow("Value:","",r(i));class Tl extends ra{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,l,u,c),this.ac="Spider Series",this.ca=new Map,this.Pu=e.HighlightModes.onHover,this.ox=Dl,this.bb=8,this.sn=0,this.e_=ye(),this.h_={},this.r_={},this.op=this.getVisible(),this.n_=1,this.o_=((t,e)=>{const i=W((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||U.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.n_=t,this.Lr.Li.Bi()}),(t=>{super.setVisible(t)})),this.qa=t,this.Lr=i,this.vb=r,this.a_=n,this.Jy=o,this.l_=h,this.u_=a,this.scale=s;const d=this.qa.getSeries().length;this.c_=ue(u.spiderSeriesFillStyle,d),this.d_=ue(u.spiderSeriesStrokeStyle,d),this.f_=ue(u.spiderSeriesPointFillStyle,d)}Qs(){return this.um&&this.ca.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.e_(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.ca.set(s,r+t*(e-r)),this.Lr.Li.Bi()}))}),{easing:this.h_.easing,durationMs:this.h_.durationMs,onStart:()=>{i=new Map(this.ca)}})}else for(let e=0;e=3&&(this.Nv||(this.Nv=this.Lr.vc(this.scale,Ws.Simple).$h(this.d_).ps(this.c_).Ir(this.getHighlight()),this.rc(this.Nv)),this.Nv.lo(t),this.Mb||(this.Mb=this.Lr.Bm(this.scale).q(this.bb).Yn(this.vb).xs(this.sn).ps(this.f_).Ir(this.getHighlight()),this.rc(this.Mb)),this.Mb.qn().Kn(t))}}attach(t,e=!0){return super.attach(t,e),oe(t,this.hs,{fill:this.c_,stroke:this.d_}),this}g_(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},Bl=t=>ze(t.i_.Mi()),kl=t=>ze(t.Mi()),Il=(t,i,s,r)=>t.ta(0).Sn(s).Zo(90).Ko(-270).ia(i===e.SpiderWebMode.Circle?void 0:r.length),Cl={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Pl={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Ll=()=>{Pl.alignmentX=0,Pl.alignmentY=0,Pl.paddingX=0,Pl.paddingY=0};class Rl extends qh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Xg("spiderChart bg",0),i.Eg("spiderChart ui"),r,i.Li.hs.spiderChartBackgroundFillStyle,i.Li.hs.spiderChartBackgroundStrokeStyle,i.Li.hs.spiderChartTitleFont,i.Li.hs.spiderChartTitleFillStyle,h),this.NS=e.AutoCursorModes.onHover,this.rn=x(20,20,20,20),this.axisScale=st.d1({scale1DConstructor:Ai,dimension:"x"}).Z(0,1),this.Jy=[],this.p_=[],this.m_=[],this.y_=Bi.expansion,this.S_=!0,this.x_=Ml,this.b_=bl,this.pr=!0,this.v_=e.SpiderWebMode.Normal,this.M_=4,this.__=this.hs.spiderChartWebStyle,this.A_=this.hs.spiderChartScaleLabelFillStyle,this.w_=this.hs.spiderChartScaleLabelFont,this.k_=5,this.C_=this.hs.spiderChartAxisLabelFillStyle,this.T_=this.hs.spiderChartAxisLabelFont,this.I_=5,this.F_=this.hs.spiderChartAxisStrokeStyle,this.P_=this.hs.spiderChartAxisNibStrokeStyle,this.wd=10,this.D_=x(),this.hasAxis=t=>this.Jy.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.oi(t,bi.Numeric),this.B_=()=>(t=>{const e=t.length;for(let i=0;ithis.O_.kc(this.pixelScale).setMouseInteractions(!1),this.R_=t=>t.dispose(),this.E_=()=>this.gf.ue(this.pixelScale).setMouseInteractions(!1),this.z_=t=>t.dispose(),this.V_=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.N_=(t,e)=>{let i,s;const r=()=>{void 0!==this.G_&&this.G_.finish(),i=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.y_,this.y_=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.Jy.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=El(a,this.Jy.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=je(Je(t.t_.ri(),t.t_.ei())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.Z(i.min,l),Xt(o),this.Li.Bi()}},o=()=>{if(i=void 0,void 0!==s)if(this.Oi){const t=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.H_(),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.G_=this.Fg.Li.Le(300,U.ease)([[0,1]],(([e])=>{this.axisScale.Z(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.G_.onAnimationEnd((()=>{this.G_=void 0,this.y_=i}))}else this.y_=s}else this.y_=s;s=void 0};e.setMouseEnterEventHandler(this.W_).setMouseLeaveEventHandler(this.U_).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=Fr(new Or(((t,e,i)=>{this.W_(t),r(),Xt(i)}),n,((t,e,i,s)=>{this.U_(t),o(),Xt(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.Y_=t=>{this.S_&&!this.hasAxis(t)&&this.addAxis(t)},this.l_=(t,e)=>{for(const i of this.Jy)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return _e(i.t_.ri(),i.t_.ei(),t)}},this.u_=t=>{if(0===this.Jy.length)return;const e=Je(nt(t,this.engine.scale,this.pixelScale),this.Jy[0].t_.ri()),i=Math.atan2(e.y,e.x);let s,r=Me;for(const t of this.Jy){const e=Je(t.t_.ei(),t.t_.ri()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.pr&&(t.ea(this.P_),this.Zg.Bi())},this.U_=t=>{t.ea(this.P_),this.Zg.Bi()},this.ef.Ah||this.ef._h||this.Li.bh(9),this.tM=i.qy("spiderChart series bg",0),this.O_=i.Pp("spiderChart web shapes",0),this.X_=i.Pp("spiderChart axis bg",1),this.vx=i.Pp("spiderChart plotting",2),this.gf=i.Pp("spiderChart fg",3),this.QM=this.iu.lg().vs(this.hs.effectsText),this.Kg.fs("Spider Chart");const a=kt(o?o.autoCursorBuilder:void 0,Rh);this.XS=a.zS(this.HS,this.uiScale,this.uiScale,this.hs),this.Gm=this.tM.kc(this.pixelScale).ps(this.hs.spiderChartSeriesBackgroundFillStyle).$h(J).Zo(90).Ko(-270).ta(0),this.Hm=this.tM.kc(this.pixelScale).ps(F).$h(this.hs.spiderChartSeriesBackgroundStrokeStyle).Zo(90).Ko(-270).ta(0),super.Nm(this.Gm,this.Hm),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.Yg(n,this.pixelScale)}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new wl(this.X_,this.gf,this.pixelScale,this,t,this.axisScale,this.N_,this.QM);this.Jy.push(e)}}else t&&this.Jy.push(t);return this.QM.nc(this.Jy.map((t=>t.i_))),this.Zg.Bi(),this}addSeries(t=e.PointShape.Circle){const i=new Tl(this,this.vx,this.pixelScale,t,this.Y_,this.Jy,this.l_,this.u_,this.Rm,this.hs,this.Li.iu);return this.Wm(i),i}getSeriesCount(){return this.Lm.length}getSeries(){return this.Lm}setWebMode(t){return this.v_=t,this.Zg.Bi(),this}getWebMode(){return this.v_}setWebCount(t){return this.M_=t,this.Zg.Bi(),this}getWebCount(){return this.M_}setWebStyle(t){return this.__="function"==typeof t?t(this.__):t,this.Zg.Bi(),this}getWebStyle(){return this.__}setScaleLabelStyle(t){return this.A_="function"==typeof t?t(this.A_):t,this.Zg.Bi(),this}getScaleLabelStyle(){return this.A_}setScaleLabelFont(t){return this.w_="function"==typeof t?t(this.w_):t,this.Zg.Bi(),this}getScaleLabelFont(){return this.w_}setScaleLabelPadding(t){return this.k_=t,this.Zg.Bi(),this}getScaleLabelPadding(){return this.k_}setScaleLabelStrategy(t){return this.x_=t,this.Zg.Bi(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.Zg.Bi(),this}setAxisLabelStyle(t){return this.C_="function"==typeof t?t(this.C_):t,this.Zg.Bi(),this}getAxisLabelStyle(){return this.C_}setAxisLabelFont(t){return this.T_="function"==typeof t?t(this.T_):t,this.Zg.Bi(),this}getAxisLabelFont(){return this.T_}setAxisLabelEffect(t){return this.QM.vs(t),this.Li.Bi(),this}getAxisLabelEffect(){return this.QM._s()}setAxisLabelPadding(t){return this.I_=t,this.Zg.Bi(),this}getAxisLabelPadding(){return this.I_}setAxisLabelStrategy(t){return this.b_=t,this.Zg.Bi(),this}setAxisStyle(t){return this.F_="function"==typeof t?t(this.F_):t,this.Zg.Bi(),this}getAxisStyle(){return this.F_}setNibStyle(t){return this.P_="function"==typeof t?t(this.P_):t,this.Zg.Bi(),this}getNibStyle(){return this.P_}setNibLength(t){return this.wd=t,this.Zg.Bi(),this}getNibLength(){return this.wd}setAutoAxis(t){return this.S_=t,this}getAutoAxis(){return this.S_}setMouseInteractions(t){return this.pr=t,this}getMouseInteractions(){return this.pr}setAxisScrollStrategy(t){return this.y_=t,this.Zg.Bi(),this}getAxisScrollStrategy(){return this.y_}setAxisInterval(t,e=0){return this.axisScale.Z(e,t),this.Zg.Bi(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}ru(){super.ru(),po.ip(this.Kg,this.jg);const t=this.Jy.length,e=po.tp(this.Kg,this.jg),i=u(this.pixelScale.x.getInnerInterval()-(this.rn.left+this.rn.right),this.pixelScale.y.getInnerInterval()-(this.rn.bottom+this.rn.top+e)),s=((t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}))(0,0,0,0);if(void 0!==this.b_){const e=Math.min(i.x,i.y)/2;for(let i=0;i0?s.right=Math.max(s.right,l.x+.5*(1-a.alignmentX)*h.x-e):s.left=Math.max(s.left,-l.x+.5*(a.alignmentX+1)*h.x-e),o>0?s.top=Math.max(s.top,l.y+.5*(1-a.alignmentY)*h.y-e):s.bottom=Math.max(s.bottom,-l.y+.5*(a.alignmentY+1)*h.y-e)}}if(this.y_){const t=this.H_();if(void 0!==t){const e=this.y_.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.y_.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.Z(e,i)}}const r=u(this.pixelScale.x.getInnerStart()+(s.left+this.pixelScale.x.getInnerInterval()-s.right)/2,this.pixelScale.y.getInnerStart()+(s.bottom+this.pixelScale.y.getInnerInterval()-s.top)/2),n=Math.min(i.x/2-(s.left+s.right)/2,i.y/2-(s.bottom+s.top)/2);this.D_=x(this._t.left+this.rn.left+s.left,this._t.top+this.rn.top+e+s.top,this._t.right+this.rn.right+s.right,this._t.bottom+this.rn.bottom+s.bottom),this.Op(r,n);for(const t of this.Lm)t.xm();for(const t of this.Lm)t.ru();super.$g(),this.ZS(!1);for(const t of this.Lm)t.bm()}dispose(){return this.tM.G(),this.O_.G(),this.X_.G(),this.vx.G(),this.gf.G(),super.dispose()}getMinimumSize(){return u(this.D_.left+this.D_.right+100,this.D_.bottom+this.D_.top+100)}Op(t,e){const i=this.Jy.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];Il(h,i,s,n);const u=r*((l+1)/e);h.qo(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=_e(n,o[a],s);e.Sn(Ke(c,u(p.paddingX,p.paddingY))).Mn(p.alignmentX).An(p.alignmentY).fs(l(s))}}}for(let e=f;e1;for(const s of this.Jy)for(const r of this.Lm){const n=r.getValue(s.tag,i);void 0!==n&&(t=void 0===t?n:Math.min(t,n),e=void 0===e?n:Math.max(e,n))}if(void 0!==t&&void 0!==e)return m(t,e)}}const Fl={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},_l={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},Ol={defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,te:t=>t.getXMin(),ie:t=>t.getXMax(),ee:t=>t.Wp().x},zl={defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,te:t=>t.getYMin(),ie:t=>t.getYMax(),ee:t=>t.Wp().y},Vl={...Fl,...Ol},Nl={..._l,...zl};class Gl extends Nr{constructor(t,e,i,s){super(),this.de=[],this.nu=0,this.bc=!0,this.P=new r.Eventer,this.j_=t=>(this.de.push(t),this.jl(t),t.setMouseInteractions(this.bc),t),this.getHighlight=()=>this.nu,this.Lr=t,this.scale=e,this.Z_=i,this.hs=s}K_(){return this.de}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}dispose(){return this.de.forEach(vt),this.Z_&&this.Z_(this),this.Lr.Li.Bi(),this.P.emit("dispose",this),this}setVisible(t){return super.setVisible(t),this.de.forEach((e=>e.setVisible(t))),this.Lr.Li.Bi(),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setHighlight(t){return this.nu=me(t),this.Lr.Bi(),this}setMouseInteractions(t){this.bc=t;for(let t=0;t{t.K_().forEach((t=>this.oc(t)));const e=this.q_.findIndex((e=>e===t));e>=0&&this.q_.splice(e,1),this.Lr.Bi()}}clear(){return this.q_.slice().forEach(vt),this.q_.length=0,this.Du=0,this.Lr.Bi(),this}J_(t,e){void 0!==e?this.q_.splice(e,0,t):this.q_.push(t),t.K_().forEach((t=>this.rc(t,{setEventHandlers:!1}))),t.onMouseEnter(((t,e)=>this.Eu(t,e))),t.onMouseLeave(((t,e)=>this.Vu(t,e))),t.onMouseClick(((t,e)=>this.Wu(t,e))),t.onMouseDoubleClick(((t,e)=>this.Uu(t,e))),t.onMouseDown(((t,e)=>this.$u(t,e))),t.onMouseUp(((t,e)=>this.Yu(t,e))),t.onMouseMove(((t,e)=>this.Gu(t,e))),t.onMouseDragStart(((t,e,i)=>this.Xu(t,e,i))),t.onMouseDrag(((t,e,i,s,r)=>this.ju(t,e,i,s,r))),t.onMouseDragStop(((t,e,i,s)=>this.Zu(t,e,i,s))),t.onMouseWheel(((t,e)=>this.Ku(t,e))),t.onTouchStart(((t,e)=>this.qu(t,e))),t.onTouchMove(((t,e)=>this.Ju(t,e))),t.onTouchEnd(((t,e)=>this.Qu(t,e))),this.Lr.Bi()}mc(t,e){t.setHighlight(e)}Q_(t){return this.q_.find((e=>e.K_().includes(t)))}setCursorEnabled(t){return super.setCursorEnabled(t)}}class Hl extends Gl{}class Wl extends Ul{constructor(){super(...arguments),this.tA=void 0,this.iA=()=>{this.tA=void 0}}Qs(){return this.um&&this.q_.length>0&&this.getVisible()}setDefaultStyle(t){this.sA=t,this.q_.forEach(t),t(this.eA);for(let t=0;tt.getVisible()&&t.getIsUnderMouse())):this.q_.filter((t=>t.getVisible())),this.rA,Le);if(void 0!==i)return{location:nt(i[0],this.Lr.Li.ct,this.scale),scale:this.scale,resultTableContent:this.ox(new wh,this,i[1]).wu(),series:this,fillStyle:i[1].getDominantStyle(),figure:i[1]}}solveNearestFromScreen(t){return this.jS(t,!1)}J_(t){super.J_(t),this.sA&&this.sA(t)}clear(){return this.tA=void 0,super.clear()}getXMax(){return this.tA||(this.tA=this.nA()),this.tA.max.x}getXMin(){return this.tA||(this.tA=this.nA()),this.tA.min.x}getYMax(){return this.tA||(this.tA=this.nA()),this.tA.max.y}getYMin(){return this.tA||(this.tA=this.nA()),this.tA.min.y}Wp(){return u(0,0)}nA(){const t=m(c(Me,Me),c(Ae,Ae));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)},tu=(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=Xe(Je(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]=Ke(Ze(r,l),f[1]),f[2]=Je(f[2],Ze(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.Sv.length>0){const e=this.Sv[this.Sv.length-1];if(t.length>0){const i=e.$n(),s=e.Un(),r=i.length+s.length-+e.To();if(r>=this.wv){const n=s.length>0?s[s.length-1]:i[e.To()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.Kn(o,m(u(o.x,o.y),u(o.x,o.y))).Io(!0),this.zA([o].concat(t)).Co(!0)}else e.Kn(t,this._v)}}else t.length>0&&this.zA(t)},this.VA=t=>{if(this.RA.length>0){const e=this.RA[this.RA.length-1];t.length>0&&((e.$n().length+e.Un().length)*this.OA>=this.wv?this.NA(t):e.Kn(t))}else t.length>0&&this.NA(t)},this.GA=(t,e)=>{const i=t.jS(e);if(i)return nt(i,this.scale,this.Lr.Li.ct)},this.HA=(t,e)=>{const i=t.WA(e);if(i)return nt(i,this.scale,this.Lr.Li.ct)},this.vb=l,this.UA=f,this.$A=ue(c.pointLineSeriesFillStyle,g),this.sa=ue(this.hs.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}Cv(){return La(this.RA)}setStrokeStyle(t){this.sa="function"==typeof t?t(this.sa):t;const e=this.sa;for(let t=0;te.setVisible(t))),this}setCursorInterpolationEnabled(t){return this.BA=t,this.Lr.Li.Bi(),this}getCursorInterpolationEnabled(){return this.BA}setCursorSolveBasis(t){return this.LA=t,this.Sv.forEach((e=>e.Wn(ys(t)))),this.RA.forEach((e=>e.Wn(ys(t)))),this.Lr.Bi(),this}getCursorSolveBasis(){return this.LA}ed(){return he(this.$A)||he(this.sa.getFillStyle())}uv(t){}mc(t,e){t.Ir(e),this.Lr.Bi()}kv(t){const e=this.Sv.length>0?this.Sv[this.Sv.length-1].$n().length+this.Sv[this.Sv.length-1].Un().length-+this.Sv[this.Sv.length-1].To():void 0;Pa(t,e,this.wv,this.EA),Pa(t,e,this.wv,this.VA)}NA(t,e){const i=this.Lr.Bm(this.scale).Kn(t,e).setMouseInteractions(this.Fu).ps(this.$A).Yn(this.vb).q(this.bb).xs(this.sn).Xn(this.Bn).jn(this.Ln).Zn(this.On).Wn(ys(this.LA)).Ir(this.getHighlight());return this.rc(i),this.RA.push(i),i}zA(t,e){const i=this.Lr.Gp(this.scale,void 0,[Bo.UserSeries,...this.UA]).Kn(t,e).setMouseInteractions(this.Fu).ea(this.sa).Wn(ys(this.LA)).Ir(this.getHighlight());return this.rc(i),this.Sv.push(i),i}attach(t,e=!0){return oe(t,this.hs,{stroke:this.sa,fill:this.$A}),super.attach(t,e)}getPointAmount(){return this.RA.reduce(((t,e)=>t+e.Jn()+e.Qn()),this.ca.length)}clear(){super.clear();for(let t=0;t{this.oc(t)}))}jS(t,e,i=this.BA){const s=i?Oa(t,e?this.Sv.filter((t=>t.getIsUnderMouse())):this.Sv,this.HA,"nearest-x"===this.LA?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.LA?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):Oa(t,e?this.RA.filter((t=>t.getIsUnderMouse())):this.RA,this.GA,"nearest-x"===this.LA?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.LA?(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=nt(s[0],this.Lr.Li.ct,this.scale),e=s[1]instanceof $s?s[1].ha():s[1].gs(),i=e instanceof tt?e.getFillStyle():void 0,r=e instanceof V?s[0].color?new z({color:s[0].color}):new z({color:e.getFallbackColor()}):e;return Oh(t,this.scale,this.ox(new wh,this,t.x,t.y,t).wu(),this,i||r)}}solveNearestFromScreen(t,e=this.BA){return this.jS(t,!1,e)}}const iu=(t,e)=>t.Un().length>=e?t.Un().slice(-e):Array.prototype.concat(t.$n(),t.Un()).slice(-e),su=(t,e,i)=>{const s=Array.prototype.concat(t.$n(),t.Un()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.qn().Kn(s).Gs()};class ru extends eu{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.ac="Spline Series",this.OA=32,this.wv=8e3,this.YA=t=>{if(0===t.length)return;const e=this.RA.length;if(e>0){const i=e>1,s=this.RA[e-1];if(i){const i=Array.prototype.concat(s.$n(),s.Un()),r=i.length;if(32*r>=this.wv){const i=iu(s,3),r=Array.prototype.concat(i,t),n=tu(r,32);su(this.Sv[e-1],n,32),this.zA(n.slice(66))}else if(r<5){const s=this.RA[e-2],r=iu(s,3),n=Array.prototype.concat(r,i,t),o=tu(n,32),h=this.Sv[e-1],a=o.slice(66);h.qn().Kn(a).Gs()}else{const i=this.Sv[e-1],r=Array.prototype.concat(i.$n(),i.Un()),n=iu(s,4),o=Array.prototype.concat(n,t),h=tu(o,32),a=r.slice(0,-66).concat(h.slice(33));i.qn().Kn(a).Gs()}}else{const i=Array.prototype.concat(s.$n(),s.Un()),r=i.length,n=this.Sv[e-1];if(32*r>=this.wv){const e=iu(s,3),i=Array.prototype.concat(e,t),r=tu(i,32);su(this.Sv[0],r,32),this.zA(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=tu(e,32);n.qn().Kn(s).Gs()}else n.Kn(t)}}else{const e=t.length>0?tu(t,32):t,i=ze(e);this.zA(e,i)}this.VA(t)}}setCursorInterpolationEnabled(t){return super.setCursorInterpolationEnabled(t)}kv(t){const e=this.RA.length,i=this.RA.length>0?this.RA[e-1].$n().length+this.RA[e-1].Un().length:void 0;Pa(t,i,Math.ceil(this.wv/this.OA),this.YA)}solveNearestFromScreen(t,e=this.BA){if(e)return super.solveNearestFromScreen(t,e);const i=Oa(t,this.RA,this.GA,"nearest-x"===this.LA?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.LA?(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=nt(i[0],this.Lr.Li.ct,this.scale);return Oh(t,this.scale,this.ox(new wh,this,t.x,t.y,t).wu(),this,i[1].gs())}}}class nu{constructor(){this.mi="FreeformPattern",this.mo={type:"disabled",packager:(t,e,i)=>t.slice()}}Av(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}},hu=s.Record({mo:{type:"disabled",packager:(t,e,i)=>t.slice()}});class au extends hu{Av(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.jA(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.St();return t?Math.min(i,t):i},uu=(t,e)=>{const i=e.xt();return t?Math.max(i,t):i};class cu extends au{XA(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(uu,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(lu,e?e.min.y:void 0)}}const du=(t,e)=>{const i=e.ft();return t?Math.min(i,t):i},fu=(t,e)=>{const i=e.yt();return t?Math.max(i,t):i};class gu extends au{XA(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(fu,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(du,e?e.min.x:void 0)}}const mu={horizontalProgressive:new class extends cu{constructor(){super({mo:cs()}),this.mi="HorizontalProgressivePattern"}jA(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].yt():void 0}getXMin(t=[],e){return t.length>0&&t[0].Jn()>0?t[0].ft():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",cs(ou(t)))}},horizontalRegressive:new class extends cu{constructor(){super({mo:ds()}),this.mi="HorizontalRegressivePattern"}jA(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].Jn()>0?t[0].yt():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].ft():void 0}setPrecision(t){return this.set("_columnPackaging",ds(ou(t)))}},verticalProgressive:new class extends gu{constructor(){super({mo:fs()}),this.mi="VerticalProgressivePattern"}jA(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].xt():void 0}getYMin(t=[],e){return t.length>0&&t[0].Jn()>0?t[0].St():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",fs(ou(t)))}},verticalRegressive:new class extends gu{constructor(){super({mo:gs()}),this.mi="VerticalRegressivePattern"}jA(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].Jn()>0?t[0].xt():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].St():void 0}setPrecision(t){return this.set("_columnPackaging",gs(ou(t)))}},freeform:new nu};class pu extends eu{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g){super(t,e,i,s,r,n,o,h,mu.horizontalProgressive,a,c,d,f,g),this.ac="Step Series",this.EA=t=>{const e=this.Sv.length>0?this.Sv[this.Sv.length-1].$n().length+this.Sv[this.Sv.length-1].Un().length:void 0;Pa(t,e,this.wv,this.ZA)},this.ZA=t=>{const e=t.length;if(this.Sv.length>0){const i=this.Sv[this.Sv.length-1];if(e>0){const e=i.$n(),s=i.Un(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Jl([r].concat(t),this.KA);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.wv?(i.Kn(o,m(u(o.x,o.y),u(o.x,o.y))).Io(!0),this.zA(h).Co(!0),this.NA(t)):i.Kn(h)}}else e>0&&this.zA(Jl(t,this.KA));this.VA(t)},this.KA=l,void 0===this.UA.find((t=>"DataPattern"===t.type))&&this.UA.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class yu extends _a{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.Sv=[],this.ac="Line Series",this.BA=!0,this.wv=void 0,this.LA="nearest-x",this.da=void 0,this.ed=()=>he(this.sa.getFillStyle()),this.qA=(t,e)=>{const i=t.Sb(e);if(i)return nt(i,this.scale,this.Lr.Li.ct)},this.HA=(t,e)=>{const i=t.WA(e);if(i)return nt(i,this.scale,this.Lr.Li.ct)},this.UA=c,this.Mh=f,this.sa=ue(this.hs.lineSeriesStrokeStyle,d),this.JA={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.sa="function"==typeof t?t(this.sa):t;const e=this.sa;for(let t=0;tt.fa(this.da))),this.Lr.Bi(),this}setCursorInterpolationEnabled(t){return this.BA=t,this.Lr.Li.Bi(),this}getCursorInterpolationEnabled(){return this.BA}setCursorSolveBasis(t){return this.LA=t,this.Sv.forEach((e=>e.Wn(ys(t)))),this.Lr.Bi(),this}getCursorSolveBasis(){return this.LA}uv(t){}kv(t){let e=this.Sv[0];e||(e=this.zA(),this.Sv.push(e),this.rc(e)),e.Kn(t)}zA(){return this.Lr.Gp(this.scale,this.JA,[Bo.UserSeries,...this.UA]).ea(this.sa).fa(this.da).Wn(ys(this.LA)).Ir(this.getHighlight())}attach(t,e=!0){return oe(t,this.hs,{stroke:this.sa}),super.attach(t,e)}mc(t,e){t.Ir(e),this.Lr.Bi()}Av(t,e,i,s){}jS(t,e,i=this.BA){const s=Oa(t,e?this.Sv.filter((t=>t.getIsUnderMouse())):this.Sv,i?this.HA:this.qA,"nearest-x"===this.LA?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.LA?(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=nt(s[0],this.Lr.Li.ct,this.scale),e=s[1].ha();return Oh(t,this.scale,this.ox(new wh,this,t.x,t.y,t).wu(),this,e instanceof tt?e.getFillStyle():void 0)}}solveNearestFromScreen(t,e=this.BA){return this.jS(t,!1,e)}}class xu extends Hl{constructor(t,e,i,s,r,n){super(t,e,i,r),this.QA={x:0,y:0,width:0,height:0},this.tw={x1:0,y1:0,x2:0,y2:0},this.Rn=m(u(0,0),u(0,0)),this.Vr=ue(r.rectangleSeriesFillStyle,n),this.Lr=t,this.iA=s,this.scale=e,this.$r=ue(r.rectangleSeriesStrokeStyle,n),this.fc=this.j_(this.Lr.gc(this.scale)).ps(this.Vr).$h(this.$r)}getBoundaries(){return this.Rn}setDimensions(t){return"x"in t?(this.QA=t,this.tw={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.tw=t,this.QA={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.fc.Sn(u(this.QA.x,this.QA.y)).q(u(this.QA.width,this.QA.height)),this.Rn=ze([this.QA,u(this.QA.x+this.QA.width,this.QA.y+this.QA.height)]),this.iA(),this.Lr.Bi(),this}getDimensionsPositionAndSize(){return this.QA}getDimensionsTwoPoints(){return this.tw}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.fc.ps(this.Vr),this.Lr.Bi(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){return this.$r="function"==typeof t?t(this.$r):t,this.fc.$h(this.$r),this.Lr.Bi(),this}getStrokeStyle(){return this.$r}getDominantStyle(){return this.fc.gs()}}class Su extends Wl{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.ac="Rectangle Series",this.ox=(t,e,i)=>{const s=i.getDimensionsPositionAndSize();return t.addRow(e.ac).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.rA=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return nt(i,this.scale,this.Lr.Li.ct)},this.iw=c,this.eA=new xu(this.Lr,this.scale,bt,bt,this.hs,this.iw).dispose()}uv(t){}add(t){const e=new xu(this.Lr,this.scale,this.Z_,this.iA,this.hs,this.iw).setDimensions(t);return this.J_(e),e}}class vu extends Hl{constructor(t,e,i,s,r,n){super(t,e,i,r),this.sw=[],this.Rn=we,this.Lr=t,this.scale=e,this.iA=s,this.Vr=ue(r.polygonSeriesFillStyle,n),this.$r=ue(r.polygonSeriesStrokeStyle,n),this.Nv=this.j_(this.Lr.vc(this.scale,Ws.Simple)).$h(this.$r).ps(this.Vr)}getBoundaries(){return this.Rn}setDimensions(t){return this.sw=t,this.Nv.lo(this.sw),this.Rn=ze(this.sw),this.iA(),this.Lr.Bi(),this}getDimensions(){return this.sw}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.Nv.ps(this.Vr),this.Lr.Bi(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){return this.$r="function"==typeof t?t(this.$r):t,this.Nv.$h(this.$r),this.Lr.Bi(),this}getStrokeStyle(){return this.$r}getDominantStyle(){return this.Nv.gs()}}class bu extends Wl{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.ac="Polygon Series",this.ox=(t,e,i)=>t.addRow(e.getName()),this.rA=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return nt(i,this.scale,this.Lr.Li.ct)},this.iw=c,this.eA=new vu(this.Lr,this.scale,bt,bt,this.hs,this.iw).dispose()}uv(t){if(!(t instanceof Ti))throw new Error("PolygonSeries can only be attached to a pair of Linear Axes.")}add(t){const e=new vu(this.Lr,this.scale,this.Z_,this.iA,this.hs,this.iw).setDimensions(t);return this.J_(e),e}}class Mu extends Hl{constructor(t,e,i,s,r,n){super(t,e,i,r),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.Rn=m(u(0,0),u(0,0)),this.xc=this.j_(this.Lr._u(this.scale)),this.hs=r,this.Lr=t,this.scale=e,this.iA=s,this.Vr=ue(r.segmentSeriesStrokeStyle,n),this.xc.ea(this.Vr)}getBoundaries(){return this.Rn}setDimensions(t){return this.dimensions=t,this.xc.la(u(t.startX,t.startY)).Ko(u(t.endX,t.endY)),this.Rn=m(u(Math.min(t.startX,t.endX),Math.min(t.startY,t.endY)),u(Math.max(t.startX,t.endX),Math.max(t.startY,t.endY))),this.iA(),this.Lr.Bi(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.xc.ea(this.Vr),this.Lr.Bi(),this}getStrokeStyle(){return this.Vr}getDominantStyle(){const t=this.xc.ha();return t!==J?t.getFillStyle():F}}class Au extends Wl{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.ac="Segment Series",this.ox=(t,e,i)=>t.addRow(e.ac).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.rA=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return nt(i,this.scale,this.Lr.Li.ct)},this.iw=c,this.eA=new Mu(this.Lr,this.scale,bt,bt,this.hs,this.iw).dispose()}uv(t){}add(t){const e=new Mu(this.Lr,this.scale,this.Z_,this.iA,this.hs,this.iw).setDimensions(t);return this.J_(e),e}}class wu extends Hl{constructor(t,e,i,s,r,n){super(t,e,i,r),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.Rn=m(u(0,0),u(0,0)),this.ew=this.j_(this.Lr.kc(this.scale)).ia(50),this.Lr=t,this.scale=e,this.iA=s,this.Vr=ue(r.ellipseSeriesFillStyle,n),this.$r=ue(r.ellipseSeriesStrokeStyle,n),this.ew.ps(this.Vr).$h(this.$r)}getBoundaries(){return this.Rn}setDimensions(t){return this.dimensions=t,this.ew.Sn(u(t.x,t.y)).Jo(t.radiusX).Qo(t.radiusY),this.Rn=m(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.iA(),this.Lr.Bi(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.ew.ps(this.Vr),this.Lr.Bi(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){return this.$r="function"==typeof t?t(this.$r):t,this.ew.$h(this.$r),this.Lr.Bi(),this}getStrokeStyle(){return this.$r}getDominantStyle(){return this.ew.gs()}}class Du extends Wl{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.ac="Ellipse Series",this.ox=(t,e,i)=>t.addRow(e.ac).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.rA=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return nt(i,this.scale,this.Lr.Li.ct)},this.iw=c,this.eA=new wu(this.Lr,this.scale,bt,bt,this.hs,this.iw).dispose()}uv(t){if(!(t instanceof Ti||t instanceof Ei))throw new Error("EllipseSeries only supports Linear Axes")}add(t){const e=new wu(this.Lr,this.scale,this.Z_,this.iA,this.hs,this.iw).setDimensions(t);return this.J_(e),e}}function Tu(t,e){return t===e?0:tthis.Kn(t))):this.Kn(t))}lw(t){return!!this.root&&(this.uw(t),this.contentEquals(t,this.root.value))}cw(t,e){return this.hw(((i,s)=>i&&t.call(e,s)),!0)}dw(t,e){return this.hw(((i,s)=>{t.call(e,s)}),void 0)}M(t){if(this.root&&(this.uw(t),this.contentEquals(t,this.root.value)))return this.root}Kn(t){const e=new Bu(t);if(!this.root)return this.root=e,this.length+=1,e;if(this.uw(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.nw()):(e.left=this.root,e.right=this.root.right,this.root.right=null,this.root.nw()),e.nw(),this.root=e,this.length+=1,e}}fw(t){if(this.root&&(this.uw(t),this.contentEquals(t,this.root.value))){if(this.root.left){const{right:e}=this.root;this.root=this.root.left,this.uw(t),this.root.right=e}else this.root=this.root.right;return this.length-=1,this.root&&this.root.nw(),!0}return!1}gw(){if(this.root){let t=this.root;for(;t.right;)t=t.right;return t}}pw(){if(this.root){let t=this.root;for(;t.left;)t=t.left;return t}}mw(t){if(this.root)return this.uw(t),this.contentCompare(this.root.value,t)>0?this.root.aw():this.root}yw(t){if(this.root)return this.uw(t),this.contentCompare(this.root.value,t)>=0?this.root.aw():this.root}Sw(t){if(this.root)return this.uw(t),this.contentCompare(this.root.value,t)>=0?this.root:this.root.ow()}xw(t){if(this.root)return this.uw(t),this.contentCompare(this.root.value,t)<=0?this.root.ow():this.root}bw(t){t instanceof Array?t.forEach((t=>this.Kn(t))):this.Kn(t)}uw(t){let e,i,s,r,n,o;if(this.root){for(e=new Bu,i=e,s=e,o=new Bu,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.nw(),r.right=n,r.nw(),n=r,!n.left))break;r=new Bu,r.right=n,r.left=o.left,o.left=r,s.left=n,s.nw(),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.nw(),r.left=n,r.nw(),n=r,!n.right))break;r=new Bu,r.left=n,r.right=o.right,o.right=r,i.right=n,i.nw(),i=n,n=n.right}}for(i.right=n.left,i.nw(),s.left=n.right,s.nw(),n.left=e.right,n.right=e.left;o.left;)o.left.right.nw(),o.left=o.left.left;for(;o.right;)o.right.left.nw(),o.right=o.right.right;n.nw(),this.root=n}}hw(t,e,i){return this.root&&(e=this.root.hw(t,e,0,i,this)),e}rw(t,e,i){return this.root&&(e=this.root.rw(t,e,this.length-1,i,this)),e}qn(){this.root=null,this.length=0}Mw(t,e){let i,s=this.pw();for(;s;){const r=this.xw(s.value);t.call(e,i?i.value:void 0,s.value,r?r.value:void 0),i=s,s=r}}_w(t,e,i){let s,r=this.pw(),n=0;for(;r;){const o=this.xw(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 Iu{constructor(t,e){this.key=t,this.value=e}equals(t){return Eu(this.key,t.key)&&Eu(this.value,t.value)}compare(t){return Tu(this.key,t.key)}}class Cu{constructor(t,e=Eu,i=Tu){this.length=0,this.contentEquals=e,this.contentCompare=i,this.store=new ku(void 0,((t,i)=>e(t.key,i.key)),((t,e)=>i(t.key,e.key))),t&&(Array.isArray(t)?t.forEach((t=>this.Kn(t.key,t.value))):this.Kn(t.key,t.value))}M(t){const e=this.store.M(new Iu(t,void 0));return e?e.value.value:void 0}S(t,e){const i=new Iu(t,e),s=this.store.M(i);if(s)return s.value.value=e,s;const r=this.store.Kn(i);return this.length+=1,r}Kn(t,e){return this.S(t,e)}lw(t){return this.store.lw(new Iu(t,void 0))}qn(){this.store.qn(),this.length=0}hw(t,e,i){return this.store.hw(((e,s)=>t.call(i,e,s.value,s.key,this)),e,this.store)}rw(t,e,i){return this.store.rw(((e,s)=>t.call(i,e,s.value,s.key,this)),e,this.store)}fw(t){const e=new Iu(t,void 0);return!!this.store.lw(e)&&(this.store.fw(e),this.length--,!0)}dw(t,e){return this.hw(((i,s,r)=>{t.call(e,s,r)}),void 0)}Aw(t){return this.store.M(new Iu(t,void 0))||void 0}Mw(t,e){let i,s=this.store.pw();for(;s;){const r=this.store.xw(s.value);t.call(e,i?i.value.value:void 0,s.value.value,r?r.value.value:void 0),i=s,s=r}}_w(t,e,i){let s,r=this.store.pw(),n=0;for(;r;){const o=this.store.xw(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}gw(){return this.store.gw()}pw(){return this.store.pw()}mw(t){return this.store.mw(new Iu(t,void 0))}yw(t){return this.store.yw(new Iu(t,void 0))}Sw(t){return this.store.Sw(new Iu(t,void 0))}xw(t){return this.store.xw(new Iu(t,void 0))}}const Pu={minGapNew:1.75,minGapSplit:2,maxGapFuse:1.5},Lu=(t,e)=>Math.min(t,e[3]),Ru=(t,e)=>Math.max(t,e[2]),Fu=(t,e)=>{const i=t.length;if(!(i<2))return[e,t[0].y,t.reduce(xt,Ae),t.reduce(yt,Me),t[i-1].y]},_u=(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},Ou=(t,e)=>{if(t.length>0)return e>0?t[t.length-1]:t[0]},zu=(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 Vu extends Ul{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.ac="OHLC Series",this.ww=new Cu,this.tA=m(c(Me,Me),c(Ae,Ae)),this.kw=0,this.Cw=5,this.Tw=Pu,this.da=void 0,this.Iw=void 0,this.Fw=void 0,this.Pw=!0,this.Pu=e.HighlightModes.onHover,this.ox=zu,this.Dw=l,this.Bw=u,this.Lw=new this.Dw(this.Lr,this.scale,bt,!0,this.hs).dispose(),this.Ow=new this.Bw(this.Lr,this.scale,bt,!1,this.hs).dispose()}uv(t){if(!(t.x instanceof Ai))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.Rw=t.x}setStyle(t){return this.Ew=t,this.zw(),this.Lr.Bi(),this}setPositiveStyle(t){return this.Vw=t,this.zw(),this.Lr.Bi(),this}setNegativeStyle(t){return this.Nw=t,this.zw(),this.Lr.Bi(),this}setFigureWidth(t){return this.Cw=t,this.Lr.Bi(),this}getFigureWidth(){return this.Cw}setFigureAutoFitting(t){return this.Tw=t?Pu:void 0,this.Lr.Bi(),this}getFigureAutoFitting(){return void 0!==this.Tw}Gw(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}Hw(t,e,i,s){const r=(t=>t[4]>=t[1])(t),n=new(r?this.Dw:this.Bw)(this.Lr,this.scale,this.Z_,r,this.hs);return this.J_(n,s),this.Ww(n),this.mc(n,this.getHighlight()),n.AA(t[0],t[1],t[2],t[3],t[4],e).ro(i),n}Uw(t){const e=this.kw;return this.kw+=1,this.ww.S(e,t),this.Pw=!0,this.P.emit("dataAdd",this,[t],void 0),e}zw(){this.q_.forEach((t=>{this.Ew&&this.Ew(t),t.positive&&this.Vw?this.Vw(t):!t.positive&&this.Nw&&this.Nw(t)}))}Ww(t){this.Ew&&this.Ew(t),t.positive&&this.Vw?this.Vw(t):!t.positive&&this.Nw&&this.Nw(t)}$w(t){return t*this.Rw.getPixelSize()}Yw(t){return t/this.Rw.getPixelSize()}Xw(t){if(!Array.isArray(t))return this.ww.M(t);if(this.ww.M(t[0])&&this.ww.M(t[t.length-1])){let e=0;const i=this.ww.M(t[0])[1];let s=Ae,r=Me;const n=this.ww.M(t[t.length-1])[4];for(let i=0;i1){const e=t>0?this.q_.length-1:0;this.q_[e].dispose()}let s;do{s=!1;const r=Ou(this.q_,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.ww.M(a);if(!s)break;if(!this.Gw(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.Hw(h,u,e,i),s=!0}}}while(s)}Av(t){var e;if(t&&"maxDataPointCount"in t){const e=t.maxDataPointCount;if(e&&this.ww.length>e){const t=this.kw-1,i=this.ww.store.pw();if(i){for(let s=t-e;s>=i.value.key;s-=1)this.ww.fw(s);let s=!0;this.tA.min.y=Me,this.tA.max.y=Ae;for(let i=1+t-e;i<=t;i+=1){const t=this.ww.M(i);t&&(this.tA.min.y=Math.min(this.tA.min.y,t[3]),this.tA.max.y=Math.max(this.tA.max.y,t[2]),s&&(this.tA.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.kw-1;let n=this.ww.store.pw();if(n){const t=n.value.key;let o;for(let t=n.value.key;t<=r&&!((null===(e=this.ww.M(t))||void 0===e?void 0:e[0])>=s);t+=1)o=t;if(void 0!==o&&o-t>=1e3&&this.ww.length-(o-t)>=i){for(let e=o;e>=t;e-=1)this.ww.fw(e);n=this.ww.store.pw();let e=!0;if(this.tA.min.y=Me,this.tA.max.y=Ae,n)for(let t=n.value.key;t<=r;t+=1){const i=this.ww.M(t);i&&(this.tA.min.y=Math.min(this.tA.min.y,i[3]),this.tA.max.y=Math.max(this.tA.max.y,i[2]),e&&(this.tA.min.x=i[0],e=!1))}}}}return this}setDataCleaning(t){return this.da=t,this.Lr.Bi(),this}bm(){super.bm(),this.Av(this.da);const t=this.Rw.getPixelSize(),e=this.Iw,i=m(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd()),s=this.Fw,r=this.$w(this.Cw),n=!s||i.max-i.min!=s.max-s.min,o=this.q_.length;if(!s||i.min>s.min)for(let t=0;t=0;t-=1){const e=this.q_[t];if(this.Gw(e.getPosition(),r))break;e.dispose()}if(0===this.q_.length&&this.ww.length>0)for(let t=0;t0){const o=this.Tw?r*this.Tw.minGapNew:0;if((n||!s||i.mins.max)&&(this.jw(1,r,o),this.Pw=!0),this.Tw){const i=r*this.Tw.maxGapFuse,s=r*this.Tw.minGapSplit;if(void 0===e||t!==e||this.Pw){let t,e;do{t=!1;for(let e=0;e1){const o=i.getPosition(),h=e>0?this.q_[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.Xw(n),l=this.Xw(h);void 0!==a&&this.Hw(a,n,r,e),void 0!==l&&this.Hw(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.ox(new wh,this,t).wu(),series:this,fillStyle:t.getDominantStyle(),ohlcSegment:t}}if(i>0){const e=nt(t,this.Lr.Li.ct,this.scale);let s;for(let t=0;te.x+r.kA())break;if(n>=e.x){const o=t>0?e.x-this.q_[t-1].getPosition():Number.MAX_VALUE,h=n-e.x,a=t{t.push(e)})),t}Tv(t){return this.P.on("dataAdd",t)}Iv(t){return this.P.off(t)}Fv(t){return this.P.on("dataClear",t)}Pv(t){return this.P.off(t)}attach(t,e){return super.attach(t,e),oe(t,this.hs,{fill:this.Lw.getDominantStyle(),fill2:this.Ow.getDominantStyle(),behavior:{colorStep:!0}}),this}}class Nu extends Vu{add(t){if(t.length>0){if(Array.isArray(t[0])){const e=t;for(let t=0;t0&&this.getVisible()}}class Gu extends Vu{constructor(){super(...arguments),this.ca=[]}Qs(){return this.um&&(this.ww.length>0||this.ca.length>0)&&this.getVisible()}add(t){Array.isArray(t)?this.addPoints(t):this.addPoint(t);const e=this.ca[this.ca.length-1];return this.Mv=e?{x:e.x,y:e.y}:void 0,this}addPoint(t){return this.ca.push(t),this.Lr.Bi(),this.tA.min.x=Math.min(this.tA.min.x,t.x),this.tA.max.x=Math.max(this.tA.max.x,t.x),this.tA.min.y=Math.min(this.tA.min.y,t.y),this.tA.max.y=Math.max(this.tA.max.y,t.y),this}addPoints(t){return t.length>0&&(this.ca=this.ca.concat(t),this.Lr.Bi(),this.tA.min.x=Math.min(this.tA.min.x,t[0].x),this.tA.max.x=Math.max(this.tA.max.x,t[t.length-1].x),this.tA.min.y=t.reduce(yt,this.tA.min.y),this.tA.max.y=t.reduce(xt,this.tA.max.y)),this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.Mv?this.Mv.x+e:0),this.add(Ra(t,e,s)),this}bm(){if(this.Av(this.da),this.ca.length>0){let t;if(void 0!==this.Zw)t=this.Zw;else{const e=this.Tw?this.Tw.minGapNew:1;t=this.$w(this.Cw*e)}const e=void 0!==this.Kw?this.Kw:this.ca[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=Fu(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.ca,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 Wu extends Wl{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.ac="Box Series",this.ox=Hu,this.rA=t=>nt(this.lc.toPoint((t.start+t.end)/2,t.median),this.scale,this.Lr.Li.ct),this.qw=a,this.lc=l,this.eA=new this.qw(this.Lr,this.scale,this.Z_,this.lc,0,0,0,0,0,0,0,this.hs).dispose()}uv(t){if(!(t instanceof Ti||t instanceof Ei))throw new Error("BoxSeries only supports Linear Axes")}add(t){const e=new this.qw(this.Lr,this.scale,this.Z_,this.lc,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.hs),i=e.boundaries;return this.tA=this.tA?Ne(this.tA,i):i,this.Lr.Bi(),this.J_(e),e}}class Yu extends Ca{constructor(){super(...arguments),this.Sv=[],this.ca=[],this.Jw=[],this.Qw=[],this.rh=!1,this.wv=1e3,this.xv=0,this.Pu=e.HighlightModes.onHover,this.mo={type:"disabled",packager:(t,e,i)=>t.slice()},this.BA=!0,this.tk=[],this.ik=[],this.sk=!1,this.ed=()=>he(this.ek)||he(this.hk),this.rk=t=>{const e=t.length;if(this.Sv.length>0){const i=this.Sv.length-1,s=this.Sv[i];if(e>0){const[e,i]=s.$n(),[r,n]=s.Un();if((r?e.length+r.length:e.length)>=this.wv){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=si(a,o,u(t[0].position,t[0].high)).y,c=si(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.Kn(f,m(u(a,c),u(a,l))).Io(!0),this.nk([f].concat(t)).Co(!0)}else s.Kn(t)}}else e>0&&this.nk(t)},this.ak=t=>{const e=this.tk,i=t.length;if(this.tk.length>0){if(i>0){const i=e[e.length-1],s=i.$n(),r=i.Un();if(s.length+r.length>=this.wv){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=si(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.Kn(a,m(u(o,h),u(o,h))).Io(!0),e.push(this.lk([a].concat(t),this._v).Co(!0))}else i.Kn(t)}}else i>0&&e.push(this.lk(t))},this.uk=t=>{const e=this.ik,i=t.length;if(this.ik.length>0){if(i>0){const i=e[e.length-1],s=i.$n(),r=i.Un();if(s.length+r.length>=this.wv){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=si(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.Kn(a,m(u(o,h),u(o,h))).Io(!0),e.push(this.ck([a].concat(t)).Co(!0))}else i.Kn(t)}}else i>0&&e.push(this.ck(t))},this.dk=(t,e)=>{const i=t.Sb(e);if(i)return[nt(i[0],this.scale,this.Lr.Li.ct),nt(i[1],this.scale,this.Lr.Li.ct)]},this.fk=(t,e)=>{const i=t.WA(e);if(i)return[nt(i[0],this.scale,this.Lr.Li.ct),nt(i[1],this.scale,this.Lr.Li.ct)]}}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.xv=void 0!==e&&e>0?e:0,this.Lr.Bi(),this}clear(){for(let t=0;tt+e.Jn()+e.Qn()),this.ca.length)}setCursorInterpolationEnabled(t){return this.BA=t,this.Lr.Li.Bi(),this}getCursorInterpolationEnabled(){return this.BA}setCursorResultTableFormatter(t){return this.ox=t,this.qa.Li.Bi(),this}setCursorEnabled(t){return super.setCursorEnabled(t)}getCursorResultTableFormatter(){return this.ox}getXMax(){return zt(this.Sv,Ct,Math.max,Ft,this._v)}getXMin(){return zt(this.Sv,It,Math.min,Rt,this._v)}getYMax(){return zt(this.Sv,Lt,Math.max,Ot,this._v)}getYMin(){return zt(this.Sv,Pt,Math.min,_t,this._v)}Wp(){const t=u(0,0);for(const e of this.Sv)t.x=Math.max(t.x,e.co()),t.y=Math.max(t.y,e.do());return t}Qs(){return this.um&&this.getPointAmount()>0&&this.getVisible()}uv(t){}vv(t,e,i){this.ca=ie(this.ca,t,{canReturnB:!1}),this.Jw=ie(this.Jw,e,{canReturnB:!1}),this.Qw=ie(this.Qw,i,{canReturnB:!1}),this.Lr.Bi()}gk(t,e,i,s){this.pk(e,i,s),this.vv(Array.isArray(t)?t:[t],e,i)}pk(t,e,i){const s=Ne(ze(t),ze(e));this._v?this._v=Ne(this._v,s):this._v=s,i&&(this._v=Ne(this._v,i))}jA(){const t=this.Sv.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.Sv[this.Sv.length-1]:void 0,i=e?e.$n()[0].length+(e.Un()[0]?e.Un()[0].length:0):void 0;Pa(t,i,this.wv,this.rk)}yk(t){const e=this.tk.length>0?this.tk[this.tk.length-1].$n().length+this.tk[this.tk.length-1].Un().length:void 0;Pa(t,e,this.wv,this.ak)}Sk(t,e){const i=this.tk.length>0?this.tk[this.tk.length-1].$n().length+this.tk[this.tk.length-1].Un().length:void 0;Pa(t,i,this.wv,this.ak),Pa(e,i,this.wv,this.uk)}nk(t,e){const i=this.Lr.xk(this.scale).Kn(t,e).ps(this.ek).wo(this.hk)._o(this.mo).Ir(this.getHighlight());return this.Sv.push(i),this.rc(i),i}bk(t,e,i){const s=this.Lr.Gp(this.scale,void 0,[Bo.UserSeries]).Kn(t,i).setMouseInteractions(!1).ea(e).Ir(this.getHighlight());return this.rc(s),s}lk(t,e){return this.bk(t,this.vk,e)}ck(t,e){return this.bk(t,this.Mk,e)}_k(t){this.ek="function"==typeof t?t(this.ek):t;const e=this.ek;for(let t=0;t0){const t=this.Sv.length,e=this.jA();this.Av(this.Sv,this.wv,this.xv,e);const i=this.Sv.length;this.tk.length>0&&this.Av(this.tk,this.wv,this.xv,e),this.ik.length>0&&this.Av(this.ik,this.wv,this.xv,e),t!==i&&this.yv(),this.sk=!0}}ru(){if(super.ru(),this.ca.length>0&&(this.mk(this.ca),this.Pk(this.Jw,this.Qw),this.sk=!0),this.sk){const t=this.getBoundaries();for(const e of this.Sv)e.Cr(t);for(const e of this.tk)e.Cr(t);for(const e of this.ik)e.Cr(t)}}bm(){this._v=void 0,this.ca.length=0,this.Jw.length=0,this.Qw.length=0}jS(t,e,i=this.BA){const s=((t,e,i)=>{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.getIsUnderMouse())):this.Sv,i?this.fk:this.dk);if(void 0!==s&&void 0!==s[0]){const t=nt(s[0][0],this.Lr.Li.ct,this.scale),e=nt(s[0][1],this.Lr.Li.ct,this.scale);return Oh(t,this.scale,this.ox(new wh,this,t.x,t.y,e.y).wu(),this,s[1].gs())}}solveNearestFromScreen(t,e=this.BA){return this.jS(t,!1,e)}}const qu=(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 Xu extends Yu{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.ac="Area Series",this.ox=qu,this.Dk=a}add(t){const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.Bk(e),[i,s]=this.Lk(t);this.gk(t,i,s,m(u(Me,this.Dk),u(Ae,this.Dk)));const r=this.ca[this.ca.length-1];this.Mv=r?{position:r.position,high:r.high,low:r.low}:void 0,this.P.emit("dataAdd",this,e,this._v)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.Mv?this.Mv.position+e:0),this.add(Ra(t,e,s)),this}Tv(t){return this.P.on("dataAdd",t)}Iv(t){return this.P.off(t)}Fv(t){return this.P.on("dataClear",t)}Pv(t){return this.P.off(t)}}class $u extends Xu{constructor(){super(...arguments),this.Mk=J}Pk(t){return this.yk(t)}Lk(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&&Vt(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=ui(u(Ae,n),u(Me,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}Cv(){return La(this.Sv,(t=>t[0]||[]))}setFillStyle(t){return this._k(t),this}getFillStyle(){return this.wk()}attach(t,e=!0){return oe(t,this.hs,{fill:this.ek,stroke:this.vk}),super.attach(t,e)}}class Zu extends $u{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.ek=F,this.hk=ue(this.hs.areaSeriesNegativeFillStyle,c),this.vk=ue(this.hs.areaSeriesNegativeStrokeStyle,c)}Bk(t){return this.zk(t)}zk(t){const e=[];return 1===t.length?this.Rk(t[0],e):this.Ek(t,e),e}Rk(t,e,i=0){const s=this.Dk;return e[i]=t.y>s?d(t.x,s,s):d(t.x,t.y,s),i+1}Ek(t,e,i=0){let s=0;const r=t.length-1,n=this.Dk;for(;sn){const t=ui(u(Ae,n),u(Me,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&&Vt(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=ui(u(Ae,n),u(Me,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}Cv(){return La(this.Sv,(t=>t[1]))}setFillStyle(t){return this.Ak(t),this}getFillStyle(){return this.ko()}attach(t,e=!0){return oe(t,this.hs,{fill:this.hk,stroke:this.vk}),super.attach(t,e)}}class Ku extends Xu{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.ek=ue(this.hs.areaSeriesBipolarHighFillStyle,c),this.vk=ue(this.hs.areaSeriesBipolarHighStrokeStyle,c),this.hk=ue(this.hs.areaSeriesBipolarLowFillStyle,c),this.Mk=ue(this.hs.areaSeriesBipolarLowStrokeStyle,c)}Bk(t){return this.Vk(t)}Pk(t,e){return this.Sk(t,e)}Vk(t){let e=0;const i=[],s=t.length,r=this.Dk;return s>0&&(this.Nk&&(this.Nk.y<=r&&r<=t[0].y||this.Nk.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.Nk.x+t[0].x),r,r),e+=1),this.Nk=t[s-1],1===s?this.Rk(t[0],i,e):this.Ek(t,i)),i}Rk(t,e,i=0){return e[i]=d(t.x,t.y,this.Dk),i+1}Ek(t,e){let i=0,s=0;const r=t.length-1,n=this.Dk;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:ha(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}Lk(t){const e=t.length,i=Array(e),s=Array(e),r=this.Dk;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._k(t),this}setNegativeFillStyle(t){return this.Ak(t),this}setPositiveStrokeStyle(t){return this.kk(t),this}setNegativeStrokeStyle(t){return this.Ck(t),this}getPositiveFillStyle(){return this.wk()}getNegativeFillStyle(){return this.ko()}getPositiveStrokeStyle(){return this.Tk()}getNegativeStrokeStyle(){return this.Ik()}attach(t,e=!0){return oe(t,this.hs,{fill:this.ek,fill2:this.hk,behavior:{colorStep:!0}}),super.attach(t,e)}}const Ju={Positive:ju,Negative:Zu,Bipolar:Ku},Qu=(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 tc extends Yu{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.ac="Area Range Series",this.ox=Qu;const c=u;this.ek=ue(this.hs.areaRangeSeriesFillStyle,c),this.vk=ue(this.hs.areaRangeSeriesStrokeStyle,c),this.hk=ue(this.hs.areaRangeSeriesFillStyleInverted,c),this.Mk=ue(this.hs.areaRangeSeriesStrokeStyleInverted,c)}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.gk(t,i,s);const r=this.ca[this.ca.length-1];return this.Mv=r?{position:r.position,high:r.high,low:r.low}:void 0,this.P.emit("dataAdd",this,e,this._v),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.Mv?this.Mv.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.jS(e);if(i)return nt(i,this.scale,this.Lr.Li.ct)},this.vb=a,this.Vr=ue(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}ed(){return he(this.Vr)}uv(t){}attach(t,e=!0){return oe(t,this.hs,{fill:this.Vr}),super.attach(t,e)}mc(t,e){t.Ir(e),this.Lr.Bi()}setPointFillStyle(t){this.Vr="function"==typeof t?t(this.Vr):t;const e=this.Vr;for(let t=0;tt.getIsUnderMouse())):this.Sv,this.GA,Le);if(void 0!==i){const t=nt(i[0],this.Lr.Li.ct,this.scale),e=i[1].gs(),s=e instanceof V?i[0].color?new z({color:i[0].color}):new z({color:e.getFallbackColor()}):e;return Oh(t,this.scale,this.ox(new wh,this,t.x,t.y,t).wu(),this,s)}}solveNearestFromScreen(t){return this.jS(t,!1)}setCursorResultTableFormatter(t){return super.setCursorResultTableFormatter(t)}}class ic{constructor(t,e,i,s){this.Gk=!1,this.P=new r.Eventer,this.chart=i,this.Hk=s,this.Fh=t.Fh,this.Ka=s||Cr,this.Wk=gt.document.createElement("div"),this.Wk.style.position="absolute",this.Wk.style.pointerEvents="none",gt.document.body.append(this.Wk);const n=()=>{const t=i.engine.container.getBoundingClientRect();this.Wk.style.left=`${t.left}px`,this.Wk.style.top=`${t.top}px`,this.Wk.style.width=`${t.width}px`,this.Wk.style.height=`${t.height}px`};n(),i.onResize(n),this.Uk(this.Wk),this.$k(),this.Yk(),this.Xk(),this.jk(e),this.chart.Zk().push(this)}Uk(t){this.Kk=gt.document.createElement("div"),this.Kk.style.pointerEvents="all",t.append(this.Kk),this.qk=gt.document.createElement("div"),this.Jk=new Mr(this.Fh,this.Ka,this.chart,this.qk),this.Qk=gt.document.createElement("table"),this.Qk.style.borderSpacing="0",this.Kk.appendChild(this.Jk.rl()),this.Kk.appendChild(this.qk),this.qk.appendChild(this.Qk)}Yk(){let t=0,e=0,i=0,s=0,r=!1;this.Gk=!1,this.Kk.onmousedown=n=>{n=n||gt.event,i=n.clientX,s=n.clientY,r=!0,gt.document.onmouseup=t=>{this.Gk?this.Kk.addEventListener("click",Xt,!0):this.Kk.removeEventListener("click",Xt,!0),r=!1,this.Gk=!1,gt.document.onmouseup=null,gt.document.onmousemove=null},gt.document.onmousemove=n=>{n=n||gt.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.Gk=!0,this.Kk.style.top=this.Kk.offsetTop-e+"px",this.Kk.style.left=this.Kk.offsetLeft-t+"px",this.Kk.style.removeProperty("right"),this.Kk.style.removeProperty("bottom"))}}}Xk(){let t=0,e=0,i=0,s=0,r=!1;this.Kk.ontouchstart=n=>{n=n||gt.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.Kk.ontouchend=()=>{r=!1,gt.document.ontouchend=null,gt.document.ontouchmove=null},this.Kk.ontouchmove=n=>{r&&(Xt(n),n=n||gt.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.Kk.style.top=this.Kk.offsetTop-e+"px",this.Kk.style.left=this.Kk.offsetLeft-t+"px",this.Kk.style.removeProperty("right"),this.Kk.style.removeProperty("bottom"))}}}$k(){this.Kk.style.setProperty("top","10px"),this.Kk.style.setProperty("left","10px"),this.Kk.style.position="absolute",this.Kk.style.display="flex",this.Kk.style.alignItems="flex-start",this.qk.style.setProperty("display","none")}removePositionProperty(){this.Kk.style.removeProperty("top"),this.Kk.style.removeProperty("left"),this.Kk.style.removeProperty("bottom"),this.Kk.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.Kk.style.setProperty("bottom","10px"),this.Kk.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.Kk.style.setProperty("top","10px"),this.Kk.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.Kk.style.setProperty("bottom","10px"),this.Kk.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.Kk.style.setProperty("top","10px"),this.Kk.style.setProperty("right","10px")}}jk(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 rc extends Ca{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.ac="Heatmap Grid Series",this.ox=sc,this.BA=!1,this.sC=a,this.hs=l;const d=c;this.Vr=ue(l.heatmapGridSeriesFillStyle,d),this.Ma=ue(this.hs.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},m={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows,start:f,step:g};this.Mh=m,this.eC=this.Lr.hC(this.scale,[],m).ps(this.Vr)._a(this.Ma).Ir(this.getHighlight()),this.rc(this.eC),this.setHighlightOnHover(!1)}clear(){return this.eC.qn(),this.Lr.Bi(),this.P.emit("dataClear",this),this}setWireframeStyle(t){return this.Ma="function"==typeof t?t(this.Ma):t,this.eC._a(this.Ma),this.Lr.Bi(),this.P.emit("styleChange",this),this}getWireframeStyle(){return this.Ma}setCursorInterpolationEnabled(t){return this.BA=t,this.Lr.Li.Bi(),this}getCursorInterpolationEnabled(){return this.BA}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.eC.Cy(t),this.Lr.Bi(),this.P.emit("styleChange",this),this}getIntensityInterpolation(){return this.eC.Ty()}Qs(){return this.um&&this.getVisible()}ed(){return he(this.Vr)}attach(t,e){return super.attach(t,e),oe(t,this.hs,{fill:this.Vr}),this}rC(t){this.eC.rC().forEach((e=>{t.eC.Iy(e)}))}Pv(t){return this.P.off(t)}Fv(t){return this.P.on("dataClear",t)}nC(t){return this.P.on("styleChange",t)}oC(t){return this.P.off(t)}jS(t,e,i=this.BA){const s=nt(t,this.Lr.Li.ct,this.scale),r=e?this.eC.getIsUnderMouse()?this.eC:void 0:this.eC;if(!r)return;const n=i?r.aC(s):r.jS(s);return n?Oh(n,this.scale,this.ox(new wh,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).wu(),this):void 0}solveNearestFromScreen(t,e=this.BA){return this.jS(t,!1,e)}getXMax(){const t=this.eC;return t?t.yt():void 0}getXMin(){const t=this.eC;return t?t.ft():void 0}getYMax(){const t=this.eC;return t?t.xt():void 0}getYMin(){const t=this.eC;return t?t.St():void 0}Wp(){const t=u(0,0);return t.x=Math.max(t.x,this.eC.co()),t.y=Math.max(t.y,this.eC.do()),t}uv(t){if(!(t instanceof Ti))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Ti&&t.Qt())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}mc(t,e){t.Ir(e),this.Lr.Bi()}ru(){return super.ru(),this.eC.Cr(this.getBoundaries()),this}}class nc extends rc{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.ox=sc}invalidateIntensityValues(t){if(Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Mh.dataOrder?t.length:t[0].length,rows:"rows"===this.Mh.dataOrder?t.length:t[0].length},i="columns"===this.Mh.dataOrder?this.Mh.columns:this.Mh.rows,s="columns"===this.Mh.dataOrder?this.Mh.rows:this.Mh.columns;if(e.x>i||e.y>s){if(!0===this.chart.ef.Ph){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Mh.columns}x${this.Mh.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;gt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.ef.Ph){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Mh.columns}x${this.Mh.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.`;gt.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.eC.Iy({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.Lr.Bi(),this}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.eC.ps(this.Vr),this.P.emit("styleChange",this),this.Lr.Bi(),this}getFillStyle(){return this.Vr}setCursorResultTableFormatter(t){return this.ox=t,this.qa.Li.Bi(),this}getCursorResultTableFormatter(){return this.ox}lC(t){return this.P.on("invalidateIntensity",t)}uC(t){return this.P.off(t)}}class oc extends Ca{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.ac="Scrolling Heatmap Grid Series",this.ox=sc,this.BA=!1;const d=c;this.Vr=ue(l.heatmapScrollingGridSeriesFillStyle,d),this.Ma=ue(this.hs.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",start:{x:0,y:0},step:{x:1,y:1},...a};this.Mh=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.cC=this.Lr.dC(this.scale,g,f).ps(this.Vr)._a(this.Ma).Ir(this.getHighlight()),this.rc(this.cC),this.setHighlightOnHover(!1)}clear(){return this.cC.qn(),this.Lr.Bi(),this}setWireframeStyle(t){return this.Ma="function"==typeof t?t(this.Ma):t,this.cC._a(this.Ma),this.Lr.Bi(),this}getWireframeStyle(){return this.Ma}setPixelInterpolationMode(t){return t=t||"disabled",this.cC.Cy(t),this.Lr.Bi(),this}getPixelInterpolationMode(){return this.cC.Ty()}setCursorInterpolationEnabled(t){return this.BA=t,this.Lr.Li.Bi(),this}getCursorInterpolationEnabled(){return this.BA}setCursorEnabled(t){return super.setCursorEnabled(t)}setDataCleaning(t){return this.cC.fa(t),this.Lr.Bi(),this}Qs(){return this.um&&this.getVisible()}ed(){return he(this.Vr)}attach(t,e){return super.attach(t,e),oe(t,this.hs,{fill:this.Vr}),this}ps(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.cC.ps(this.Vr),this.Lr.Bi(),this}jS(t,e,i=this.BA){const s=nt(t,this.Lr.Li.ct,this.scale),r=e?this.cC.getIsUnderMouse()?this.cC:void 0:this.cC;if(!r)return;const n=i?r.aC(s):r.jS(s);return n?Oh(n,this.scale,this.ox(new wh,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).wu(),this):void 0}solveNearestFromScreen(t,e=this.BA){return this.jS(t,!1,e)}uv(t){if(!(t instanceof Ti))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Ti&&t.Qt())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.cC.yt()||0}getXMin(){return this.cC.ft()||0}getYMax(){return this.cC.xt()||0}getYMin(){return this.cC.St()||0}Wp(){const t=u(0,0);return t.x=Math.max(t.x,this.cC.co()),t.y=Math.max(t.y,this.cC.do()),t}mc(t,e){t.Ir(e),this.Lr.Bi()}}class hc extends oc{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.ox=sc}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.Mh.scrollDimension?t.length:t[0].length,"rows"===this.Mh.scrollDimension?t.length:t[0].length,0+i-1),r=this.Mh.resolution-1;if(s>r){if(!0===this.chart.ef.Ph){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.Mh.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;gt.console.warn(t)}const s=[];for(let i=0;i(e,i)=>t.forEach((t=>t.forEach((t=>{t.ct.q(e),t.Jf.q(i)})))),lc=(t,e)=>{const i=t.indexOf(e);-1!==i&&t.splice(i,1)},uc=u(10,10);var cc;e.AxisPosition=void 0,(cc=e.AxisPosition||(e.AxisPosition={}))[cc.Top=0]="Top",cc[cc.Bottom=1]="Bottom",cc[cc.Left=2]="Left",cc[cc.Right=3]="Right";const dc=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),fc=t=>t.he(),gc=t=>t.setStopped(!0),mc=t=>t.getChartInteractionFitByDrag()?t.fit(!0).setStopped(!1):void 0,pc=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}},yc=(t,e)=>{const i="linear-highPrecision"===t.ns.type||"linear-highPrecision"===e.ns.type,s="logarithmic"===t.ns.type||"logarithmic"===e.ns.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.ns.type}, y: ${e.ns.type})`;throw new Error(i)}};var xc,Sc,vc,bc;!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"}(xc||(xc={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(Sc||(Sc={})),function(t){t[t.axisUi=0]="axisUi"}(vc||(vc={}));class Mc extends qh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Xg("chartXY bg",0),i.Eg("chartXY ui"),r,i.Li.hs.chartXYBackgroundFillStyle,i.Li.hs.chartXYBackgroundStrokeStyle,i.Li.hs.chartXYTitleFont,i.Li.hs.chartXYTitleFillStyle,h),this.fC=this.Bg.d2({scaleXYConstructor:Ti}),this.gC=[],this.pC=[],this.mC=[],this.yC=[],this.SC=new Map,this.xC=!0,this.bC=!0,this.vC=!0,this.Id=2,this.MC=!0,this._C=!0,this.AC=[],this.wC=this.Zg.gc(this.fC).ps(F).$h(J).setMouseInteractions(!1),this.kC=this.Zg._u(this.fC).ea(J).setMouseInteractions(!1),this.CC=this.Zg._u(this.fC).ea(J).setMouseInteractions(!1),this.TC=this.hs.chartXYZoomingRectangleFillStyle,this.IC=this.hs.chartXYZoomingRectangleStrokeStyle,this.FC=this.hs.chartXYFittingRectangleFillStyle,this.PC=this.hs.chartXYFittingRectangleStrokeStyle,this.DC=e.MouseStyles.Default,this.BC=e.MouseStyles.Move,this.LC=e.MouseStyles.ZoomIn,this.OC=e.MouseStyles.Default,this.RC=void 0,this.EC=Ac,this.lv=0,this.zC=ac(this.pC,this.gC),this.VC=ac(this.mC,this.yC),this.NC=(t,e,i,s,r)=>{this.zC(s,r),this.VC(r,s),this.fC.q(s,r);const n=this.pC.map((t=>t.vg())),o=this.gC.map((t=>t.vg())),h=this.mC.map((t=>t.vg())),a=this.yC.map((t=>t.vg())),l=n.reduce(Ie,0),c=o.reduce(Ie,0),d=h.reduce(Ie,0),f=a.reduce(Ie,0),g=this.GC(d,f,c,l),m=this.fC.x.getCellSize()-(g.left+g.right),p=this.fC.y.getCellSize()-(g.bottom+g.top),y=[g.left,g.right],x=[g.bottom,g.top];this.fC.x.Z(0,m),this.fC.y.Z(0,p),this.fC.ci(y),this.fC.di(x),this.Gm.q(u(m,p));for(let t=0;t{this.SC.set(t,e)},this.Yf=t=>{this.pC.includes(t)?lc(this.pC,t):this.gC.includes(t)?lc(this.gC,t):this.mC.includes(t)?lc(this.mC,t):this.yC.includes(t)&&lc(this.yC,t),this.SC.delete(t),this.Li.Bi()},this.WC=(t=!1)=>{const e=t=>(e,i,s,r)=>(i.ru(e,s,r.length),e+i.vg()*t),i=this.pC.reduce(e(-1),0),s=this.gC.reduce(e(1),0),r=this.mC.reduce(e(-1),0),n=this.yC.reduce(e(1),0),o=this.GC(r,n,s,i),h=this.fC.x.getCellSize()-(o.left+o.right),a=this.fC.y.getCellSize()-(o.bottom+o.top),l=[o.left,o.right],c=[o.bottom,o.top];this.fC.x.Z(0,h),this.fC.y.Z(0,a),this.fC.x.Dt(l),this.fC.y.Dt(c);for(const t of this.pC)t.ct.Dt(l);for(const t of this.gC)t.ct.Dt(l);for(const t of this.mC)t.ct.Dt(c);for(const t of this.yC)t.ct.Dt(c);if((!this.oM||Math.abs(this.oM.bottom-i)>=4||Math.abs(this.oM.left-r)>=4||Math.abs(this.oM.right-n)>=4||Math.abs(this.oM.top-s)>=4)&&!t)return void this.WC(!0);this.oM={bottom:i,left:r,top:s,right:n},this.Gm.Sn(u(0,0)).q(u(h,a)),this.Hm.Sn(u(0,0)).q(u(h,a));const d=this.getDefaultAxisX(),f=this.getDefaultAxisY();if(!d||!f)return;const g=p(d.ct.Bt(),f.ct.Bt(),d.ct.Ot(),f.ct.Ot());this.vx.Wy(g),this.Uf.Wy(g),this.$f.Wy(g),this.Cg&&this.Cg();const m=t=>(e,i,s,r)=>(i.bg(e),e+i.vg()*t);return this.pC.reduce(m(-1),0),this.gC.reduce(m(1),0),this.mC.reduce(m(-1),0),this.yC.reduce(m(1),0),g},this.addAreaSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();yc(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Ju.Positive)(this,this.Rm,this.vx,e,i,this.UC(e),this.UC(i),this.Rg,s,this.hs,this.Li.iu,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lm.length);return this.Wm(r),r},this.addAreaRangeSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();yc(e,i);const s=new tc(this,this.Rm,this.vx,e,i,this.UC(e),this.UC(i),this.Rg,this.hs,this.Li.iu,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lm.length);return this.Wm(s),s},this.$C=!1,this.YC=!1,this.cv=()=>{(this.xC||this.bC)&&(this.RC=this.engine.setMouseStyle(this.DC))},this.dv=()=>{this.$C=!1,this.engine.restoreMouseStyle(this.RC)},this.fv=(t,e,i)=>{var s,r;const n=kt(null===(s=this.ef.Ih)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=kt(null===(r=this.ef.Ih)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.RC);const h=this.Zg.Li.ke(e.clientX,e.clientY);i===n&&(this.xC||this.bC)?(this.XC(t,h),Xt(e)):i===o&&this.MC&&(this.RC=this.engine.setMouseStyle(this.BC),this.YC=!0,Xt(e))},this.gm=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=kt(null===(n=this.ef.Ih)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=kt(null===(o=this.ef.Ih)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.xC||this.bC)?(this.jC(t,s,h),Xt(e)):i===l&&this.MC&&(this.ZC(Ze(r,-1)),Xt(e)),this.Zg.Bi()},this.gv=(t,e,i,s)=>{var r,n;const o=kt(null===(r=this.ef.Ih)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=kt(null===(n=this.ef.Ih)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.xC||this.bC)){const i=u(e.clientX,e.clientY);this.KC(t,s,i),Xt(e)}else i===h&&this.MC&&Xt(e);this.engine.restoreMouseStyle(this.RC),this.Gm.getIsUnderMouse()&&(this.RC=this.engine.setMouseStyle(this.DC)),this.$C=!1,this.YC=!1},this.fm=(t,e)=>{if(this.vC){const t=this.Zg.Li.ke(e.clientX,e.clientY);this.qC(t,u(ce(e),ce(e))),Xt(e)}},this.JC=(t,e,i,s)=>{},this.QC=(t,e,i,s,r,n)=>{if(this.MC){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.ZC(t),Xt(n),this.YC=!0}if(this.vC){const t=this.engine.clientLocation2Engine(e.x,e.y),o=this.engine.clientLocation2Engine(i.x,i.y),h=Je(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.Yt(t.getInterval().start,-h.x),t.ct.Yt(t.getInterval().end,h.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.dt(t.ct.Yt(t.getInterval().start,-h.y),t.ct.Yt(t.getInterval().end,h.y),!1,!0,"interactionZoom")})),Xt(n),this.$C=!0}},this.tT=(t,e,i,s)=>{this.YC=!1,this.$C=!1},this.iT=(t,e,i)=>{(this.bC||this.xC)&&(this.XC(t,e),Xt(i))},this.sT=(t,e,i,s,r)=>{(this.bC||this.xC)&&(this.jC(t,e,i),Xt(r))},this.eT=(t,e,i,s)=>{(this.bC||this.xC)&&(this.KC(t,e,i),Xt(s))},this.ef.Ah||this.ef._h||this.Li.bh(0),this.setPadding({right:24}),this.tM=i.qy("chartXY series bg",xc.seriesBackground),this.hT=[xc.gridLine0,xc.gridLine1,xc.gridLine2].map((t=>i.qy(`chartXY gridline #${t}`,t))),this.Uf=i.qy("chartXY highlighters below",xc.highlightersBelow),this.vx=i.Pp("chartXY plotting",Sc.plotting),this.$f=i.Pp("chartXY highlighters above",Sc.highlightersAbove),this.gf=i.Pp("chartXY fg",Sc.fg),this.rT=i.nT("chartXY axisUi",vc.axisUi),this.fC.x.Z(0,this.uiScale.x.getCellSize()-(this._t.left+this._t.right+this.rn.left+this.rn.right)),this.fC.y.Z(0,this.uiScale.y.getCellSize()-(this._t.bottom+this._t.top+this.rn.bottom+this.rn.top)),this.fC.q(this.uiScale.Et().x,this.uiScale.Et().y),this.Gm=this.tM.gc(this.fC).ps(this.hs.chartXYSeriesBackgroundFillStyle).$h(J),this.Hm=this.$f.gc(this.fC).ps(F).$h(this.hs.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Nm(this.Gm,this.Hm),this.setSeriesBackgroundEffect(!1);const a=kt(o?o.autoCursorBuilder:void 0,Aa);this.XS=a.zS(this.HS,this.fC,this.fC,this.hs),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.NC),this.Kg.fs("ChartXY"),this.pm=Fr(new Or(this.iT,this.sT,this.eT,1),new zr(this.JC,this.QC,this.tT)),this.onSeriesBackgroundMouseEnter(this.cv),this.onSeriesBackgroundMouseLeave(this.dv),this.onSeriesBackgroundMouseWheel(this.fm),this.onSeriesBackgroundMouseDragStart(this.fv),this.onSeriesBackgroundMouseDrag(this.gm),this.onSeriesBackgroundMouseDragStop(this.gv),this.onSeriesBackgroundTouchStart(this.pm.onTouchStart),this.onSeriesBackgroundTouchMove(this.pm.onTouchMove),this.onSeriesBackgroundTouchEnd(this.pm.onTouchEnd),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.Yg(n,this.fC)}getMinimumSize(){const t={x:0,y:0};t.x+=this._t.left+this._t.right+this.rn.left+this.rn.right,t.y+=this._t.top+this._t.bottom+this.rn.top+this.rn.bottom;const e=this.Kg.Gs().Ac(),i=v(wc(this.EC||Ac),this.jg);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.vg())})),this.forEachAxisY((t=>{s.y=Math.max(s.y,t.vg())})),t.x+=s.x,t.y+=s.y,t.x+=uc.x,t.y+=uc.y,t}getSeries(){return this.Lm}addChartMarkerXY(t=wa,e,i){const s=this.Rg(),r=new ka(s,this.uiScale,e||this.getDefaultAxisX(),i||this.getDefaultAxisY(),t,this.Pg(s),this.hs);return this.Wg(r),r}addAxisX(t){const{opposite:e,type:i}=pc(t);let s;s="linear"===i.type?this.Bg.d1({dimension:"x",scale1DConstructor:Ai}):"linear-highPrecision"===i.type?this.Bg.d1({dimension:"x",scale1DConstructor:Ai}).Jt():this.Bg.d1({dimension:"x",scale1DConstructor:gi}).Ut(i.base),s.q(this.fC.x.Et());const r=e?this.gC:this.pC,n=new no(this.Uf,this.hT,this.gf,this.rT,this.Uf,this.$f,this.Li.iu,s,this.fC.y,Vl,this,e?100:0,this.Yf,this.HC,this.hs,!this.Oi,i);return r.push(n),this.Zg.Bi(),n}addAxisY(t){const{opposite:e,type:i}=pc(t);let s;s="linear"===i.type?this.Bg.d1({dimension:"y",scale1DConstructor:Ai}):"linear-highPrecision"===i.type?this.Bg.d1({dimension:"y",scale1DConstructor:Ai}).Jt():this.Bg.d1({dimension:"y",scale1DConstructor:gi}).Ut(i.base),s.q(this.fC.y.Et());const r=e?this.yC:this.mC,n=new no(this.Uf,this.hT,this.gf,this.rT,this.Uf,this.$f,this.Li.iu,s,this.fC.x,Nl,this,e?100:0,this.Yf,this.HC,this.hs,!this.Oi,i);return r.push(n),this.Zg.Bi(),n}dispose(){return this.tM.G(),this.vx.G(),this.gf.G(),this.rT.G(),this.hT.forEach((t=>t.G())),this.$f.G(),this.Uf.G(),this.Zk().forEach((t=>t.dispose())),co(this.fC),this.forEachAxis((t=>{t.dispose()})),this.Lm.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){return this.pC[0]?this.pC[0]:this.gC[0]}getDefaultAxisY(){return this.mC[0]?this.mC[0]:this.yC[0]}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):dc;return wt(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.gC;case e.AxisPosition.Bottom:return this.pC;case e.AxisPosition.Left:return this.mC;case e.AxisPosition.Right:return this.yC}})))}oT(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.pC.slice().forEach(t),this.gC.slice().forEach(t)}forEachAxisY(t){this.mC.slice().forEach(t),this.yC.slice().forEach(t)}setTitlePosition(t){return this.EC=t,this.Li.Bi(),this}getTitlePosition(){return this.EC}GC(t,e,i,s){const r=this.EC||Ac;let n,o=v(wc(r),this.jg);this.getTitleFillStyle()===F||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.Kg.Gs().Ac();const h=Math.abs(s)+this.rn.bottom+this._t.bottom,a=Math.abs(i)+this.rn.top+this._t.top,l={left:Math.abs(t)+this.rn.left+this._t.left,right:Math.abs(e)+this.rn.right+this._t.right,top:a,bottom:h},u=this.uiScale.yi(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=Dc(r,u,l,n,o,this.rn);return this.Kg.Sn(f).Mn(c).An(d),g}ru(){super.ru();for(const t of this.Lm)t.xm();for(const t of this.Lm)t.ru();this.forEachAxis(fc);let t=!1;this.forEachAxis((e=>{(e.ae()||e.le())&&(t=!0)}));const e=this.$C||this.YC||!this._C&&t;this.ZS(e),this.WC(),super.$g();for(const t of this.Lm)t.bm()}X(){for(let t=0;t=10;n&&a&&o.x===s.x&&this.xC?(this.$C=!0,this.wC.ps(this.TC).$h(this.IC),this.kC.ea(J),this.CC.ea(J),this.RC=this.engine.setMouseStyle(this.LC,this.RC)):n&&a&&h.x===s.x&&this.bC?(this.$C=!0,this.wC.ps(this.FC).$h(this.PC),this.kC.ea(this.PC).la(s).Ko(r),this.CC.ea(this.PC).la(u(s.x,r.y)).Ko(u(r.x,s.y)),this.RC=this.engine.setMouseStyle(this.OC,this.RC)):(this.$C=!1,this.wC.$h(J).ps(F),this.kC.ea(J),this.CC.ea(J),this.engine.restoreMouseStyle(this.RC)),this.Zg.Bi()}KC(t,e,i){if(this.$C){const t=nt(this.engine.clientLocation2Engine(i.x,i.y),this.Zg.Li.ct,this.fC),s=Pe(t.x,this.fC.x.getInnerStart(),this.fC.x.getInnerEnd())&&Pe(t.y,this.fC.y.getInnerStart(),this.fC.y.getInnerEnd()),r=i.x>=e.x?"zoom":"fit",n=this.wC.xn(),o=Ke(n,this.wC.Et()),h=Math.min(this.wC.Et().x,this.wC.Et().y)>=10;s&&h&&"zoom"===r&&this.xC?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=nt(n,this.fC,t.Qf).x,i=nt(o,this.fC,t.Qf).x;t.dt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=nt(n,this.fC,t.Qf).y,i=nt(o,this.fC,t.Qf).y;t.dt(e,i,!0,!0,"interactionSetInterval")}}))):s&&h&&"fit"===r&&this.bC&&this.forEachAxis(mc)}this.wC.$h(J).ps(F),this.kC.ea(J),this.CC.ea(J),this.Zg.Bi()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}ZC(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(gc),this.forEachAxisX((i=>{i.zoom(i.ct.ot(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.ct.ot(t.y),e.y)}))}qC(t,e){this.forEachAxis(gc),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}dd(){const t=[];return this.forEachAxis((e=>e.ug((e=>t.push(e))))),super.dd().concat(t)}Zk(){return this.AC}pl(){return this.Jg(this.vx)}setAutoCursorEnabledDuringAxisAnimation(t){return this._C=t,this}getAutoCursorEnabledDuringAxisAnimation(){return this._C}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}}e.ChartXYTitlePositionOptions=void 0,(bc=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",bc.RightTop="right-top",bc.LeftTop="left-top",bc.CenterBottom="center-bottom",bc.RightBottom="right-bottom",bc.LeftBottom="left-bottom",bc.SeriesCenterTop="series-center-top",bc.SeriesRightTop="series-right-top",bc.SeriesLeftTop="series-left-top",bc.SeriesCenterBottom="series-center-bottom",bc.SeriesRightBottom="series-right-bottom",bc.SeriesLeftBottom="series-left-bottom";const Ac=e.ChartXYTitlePositionOptions.CenterTop,wc=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 pe(0,`Unexpected ChartXY title position selection ${t}`)},Dc=(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 pe(0,`Unexpected ChartXY title position selection ${t}`)},Tc=t=>t instanceof _a||t instanceof Xu||t instanceof tc||t instanceof nc||t instanceof Vu||t instanceof pu;class Ec{constructor(t,i,s,n,o,h,a,l,u){this.P=new r.Eventer,this.aT=new Map,this.Lm=new Map,this.lT=({series:t},e)=>{this.uT&&(e instanceof tc||e instanceof pu||e instanceof nc||e instanceof _a||e instanceof Xu||e instanceof Vu)&&this.uT(t,e)},this.cT=t=>{const e=t.map((t=>t.ns.type));if(1!==[...new Set(e)].length)throw new Error("All ZoomBandChart axes must be of the same type")},this.dT=(t,e,i)=>{0!==this.Lm.size&&void 0!==[...this.Lm.values()].find((({series:t})=>!0===t.getVisible()))||this.fT.dt(e,i,!1,!1,"zoomBandChart")},this.ef=t,this.gT=n,this.attachedAxes=Array.isArray(o)?o:[o],this.cT(this.attachedAxes);const c=this.attachedAxes[0].chart.oT(this.attachedAxes[0])||"x";this.pT=c,this.yu="x"===c?Fl:_l;const d=this.attachedAxes[0].onIntervalChange(this.dT);this.mT=()=>this.attachedAxes[0].offIntervalChange(d);const f=this.yu.toVec2("linear"===(g=this.attachedAxes[0].ns).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 m=f.x,p=f.y;this.yT=new Mc(t,i,s,bt,a,{...l,defaultAxisX:m,defaultAxisY:p},u).setTitle("Zoom Band Chart").setMouseInteractions(!1).setAutoCursorMode(e.AutoCursorModes.disabled),this.engine=this.yT.engine;const y=this.yT.getDefaultAxisX().setMouseInteractions(!1),x=this.yT.getDefaultAxisY().setMouseInteractions(!1);this.fT=this.yu.getWidth({x:y,y:x}).setScrollStrategy(Bi.fitting).setAnimationScroll(!1),this.ST(this.yu.getHeight({x:y,y:x})),this.fT.Cs(this.attachedAxes[0].ks()),this.band=this.fT.addBand(h),this.xT(this.band,this.attachedAxes);for(let t=0;t{t.chart.US(((t,e)=>{("x"===c?e.axisX:e.axisY)===this.attachedAxes[0]&&Tc(e)&&this.Xd(e)})),t.chart.$S(((t,e)=>{var i;if(this.Lm.has(e)){const t=null===(i=this.Lm.get(e))||void 0===i?void 0:i.series;t&&t.dispose()}}))}))}disposeSeries(t){const e=this.Lm.get(t);if(e){const{clearReferences:i}=e;i(),this.Lm.delete(t),e.series.dispose();const s=this.yu.getHeight({x:t.axisX,y:t.axisY}),r=this.aT.get(s);r&&0===r.Js().length&&r!==this.yu.getHeight({x:this.yT.getDefaultAxisX(),y:this.yT.getDefaultAxisY()})&&(this.aT.delete(s),r.dispose())}return this}setSeriesStyle(t){return this.uT=t,this.Lm.forEach(this.lT),this}getDefaultAxisX(){return this.yT.getDefaultAxisX()}getDefaultAxisY(){return this.yT.getDefaultAxisY()}ST(t){t.setTickStrategy(ki.Empty).setMouseInteractions(!1).setNibStyle(J).setStrokeStyle(J)}xT(t,e){t.setValueStart(e[0].getInterval().start).setValueEnd(e[0].getInterval().end);let i,s,r=!1,n=!1;e.length>1&&ot(...e),e[0].onIntervalChange(((e,i,o)=>{if(r)return;n=!0;const h=gt.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=gt.performance.now();i=h,e[0].dt(s,o,!1,!0,"zoomBandChart"),requestAnimationFrame((()=>requestAnimationFrame((()=>{i!==h||(r=!1)}))))}))}Xd(t){var e;const i=this.yu.getHeight({x:t.axisX,y:t.axisY});let s=this.aT.get(i);s||(0===this.aT.size?s=this.yu.getHeight({x:this.yT.getDefaultAxisX(),y:this.yT.getDefaultAxisY()}):(s=this.yu.getHeight({x:this.yT.addAxisX.bind(this.yT),y:this.yT.addAxisY.bind(this.yT)})(),this.ST(s))),this.aT.set(i,s);const r=this.yu.getWidth({x:this.fT,y:s}),n=this.yu.getHeight({x:this.fT,y:s});let o,h;if(t instanceof tc){o=this.yT.addAreaRangeSeries({xAxis:r,yAxis:n});const e=o;e.add(t.Cv());const i=t.Tv(((t,i,s)=>e.add(i))),s=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.Iv(i),t.offVisibleStateChanged(s)}}else if(t instanceof pu){const e=t.KA;o=this.yT.addStepSeries({mode:e,xAxis:r,yAxis:n});const i=o;i.add(t.Cv());const s=t.Tv(((t,e,s)=>i.add(e))),a=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.Iv(s),t.offVisibleStateChanged(a)}}else if(t instanceof nc){const e={...t.sC,xAxis:void 0,yAxis:void 0},i=this.yT.addHeatmapGridSeries(e);o=i;const s=()=>{i.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};s();const r=t.nC(s);t.rC(i);const n=t.lC(((t,e)=>{i.invalidateIntensityValues(e)})),a=t.onVisibleStateChanged(((t,e)=>{i.setVisible(e)}));h=()=>{t.oC(r),t.uC(n),t.offVisibleStateChanged(a)}}else{const i={};t instanceof yu&&(i.dataPattern=null===(e=t.Mh)||void 0===e?void 0:e.dataPattern);const r=this.yT.addLineSeries({...i,xAxis:this.yu.getWidth({x:this.fT,y:s}),yAxis:this.yu.getHeight({x:this.fT,y:s})});if(o=r,t instanceof Vu){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.Iv(i),t.offVisibleStateChanged(s)}}else{r.add(t.Cv());const e=t.Tv(((t,e)=>r.add(e))),i=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.Iv(e),t.offVisibleStateChanged(i)}}}t.onHighlight(((t=!0)=>{o.setHighlight(t)})),o.setMouseInteractions(!1),this.lT({series:o},t);const a=t.Fv((()=>{o.clear()})),l=h;h=()=>{t.Pv(a),l()},this.Lm.set(t,{series:o,clearReferences:h})}Cn(t){this.yT.Cn(t)}getMinimumSize(){return this.yT.getMinimumSize()}X(){return this.yT.X()}j(){return this.yT.j()}ru(){const t=Array.from(new Set(this.attachedAxes.map((t=>t.chart))).values());if("x"===this.pT){const e=t.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=0===t.Zf?t.vg():0})),Math.max(t,i)}),0),i=t.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=100===t.Zf?t.vg():0})),Math.max(t,i)}),0),s=t.reduce(((t,e)=>Math.max(t,e.getPadding().left)),0),r=t.reduce(((t,e)=>Math.max(t,e.getPadding().right)),0);this.getDefaultAxisY().setThickness(e),this.yT.setPadding({left:s,right:r+i})}else{const e=t.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=0===t.Zf?t.vg():0})),Math.max(t,i)}),0),i=t.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=100===t.Zf?t.vg():0})),Math.max(t,i)}),0),s=t.reduce(((t,e)=>Math.max(t,e.getPadding().bottom)),0),r=t.reduce(((t,e)=>Math.max(t,e.getPadding().top)),0);this.getDefaultAxisX().setThickness(e),this.yT.setPadding({bottom:s,top:r+i})}return this.yT.ru()}getTheme(){return this.yT.getTheme()}setTitle(t){return this.yT.setTitle(t),this}getTitle(){return this.yT.getTitle()}setTitleFillStyle(t){return this.yT.setTitleFillStyle(t),this}getTitleFillStyle(){return this.yT.getTitleFillStyle()}setTitleFont(t){return this.yT.setTitleFont(t),this}getTitleFont(){return this.yT.getTitleFont()}setTitleMargin(t){return this.yT.setTitleMargin(t),this}getTitleMargin(){return this.yT.getTitleMargin()}setPadding(t){return this.yT.setPadding(t),this}getPadding(){return this.yT.getPadding()}setBackgroundFillStyle(t){return this.yT.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.yT.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.yT.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.yT.getBackgroundStrokeStyle()}addUIElement(t,e){return this.yT.addUIElement(t,e)}addLegendBox(t,e){return this.yT.addLegendBox(t,e)}saveToFile(t,e,i){return this.yT.saveToFile(t,e,i),this}dispose(){return this.yT.dispose(),this.band.dispose(),this.aT.clear(),this.Lm.clear(),this.gT(this),this}onDispose(t){return this.yT.onDispose((()=>t(this)))}offDispose(t){return this.yT.offDispose(t)}}const Bc=(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{bT:()=>{const e=t.vT("dashboard ui",h+a);return a+=1,e},MT:()=>t.vT("dashboard legend",41e4),_T: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{Li:t,Xg:(e,i)=>{const s=h+i;return t.vT(e,s)},qy:(e,i)=>{const s=a+i;return t.vT(e,s)},Pp:(e,i)=>{const s=l+i;return t.vT(e,s)},Ky:(e,i,s)=>{const r=l+i;return t.AT(e,r,s)},nT:(e,i)=>{const s=u+i;return t.vT(e,s)},Eg:e=>{const i=c+d,s=t.vT(e,i);return d+=1,s},Vg:()=>t.vT("panel legend",400002+e),WS:()=>t.vT("panel cursor",500001+e)}}}};class kc{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 Ic={Ei:!1,zi:0,Vi:!1,Gi:0,Ni:!1,Hi:0,Wi:0,Fi:Bi.fitting};class Cc{constructor(t){this.wT=[],this.kT=t}CT(){let t=this.wT.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.kT()},this.wT.push(t)),t.isFree=!1,t.shape}TT(){this.wT.forEach((t=>{t.isFree=!0}))}IT(){this.wT.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.wT.splice(this.wT.indexOf(t),1)}))}}const Pc=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))},Lc=(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&&Uc(t,e,u,n,o,h),"spark-bar"===a&&Hc({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&Hc({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&Wc(t,e,u,n,o,h),"spark-pie"===a&&Yc(t,e,u,n,o,h)},Rc=(t,e,i,s)=>({x:_c(t.x,e.x,i.x,s),y:Oc(t.y,e.y,i.y,s)}),Fc=(t,e,i,s)=>({position:_c(t.position,e.x,i.x,s),high:Oc(t.high,e.y,i.y,s),low:Oc(t.low,e.y,i.y,s)}),_c=(t,e,i,s)=>{const r=At(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},Oc=(t,e,i,s)=>{const r=At(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},zc=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&Vc(a,e,i,r,n,o,h),"axis-band"===a.type&&Nc(a,i,r,n,o,h),"constant-line"===a.type&&Gc(a,i,s,r,n,o,h)},Vc=(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=Rc(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.CT().qn().Yn(void 0!==u?u:e.PointShape.Circle).xs(d||0).q(c||5).ps(l||h.sparkPointChartFillStyle).Kn(f)},Nc=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(Ae,Me),f=u(Ae,Me);"x"===o&&(d=Rc({x:h,y:Ae},e,i,s),f=Rc({x:a,y:Me},e,i,s)),"y"===o&&(d=Rc({x:Ae,y:h},e,i,s),f=Rc({x:Me,y:a},e,i,s));const g=s[0],m=s[1],p=At(d.x,g.x,g.x+m.x),y=At(d.y,g.y,g.y+m.y),x=At(f.x,g.x,g.x+m.x),S=At(f.y,g.y,g.y+m.y);r.rect.CT().eo(p).ho(y).q(u(x-p,S-y)).ps(l||n.sparkChartBandFillStyle).$h(c||n.sparkChartBandStrokeStyle).$h(J)},Gc=(t,e,i,s,r,n,o)=>{const{axis:h,value:a,strokeStyle:l}=t,c=a||0,d=e.y,f=i.y,g=e.x,m=i.x,p=[];if("y"===h&&d<=c&&c<=f){const t=Rc(u(g,c),{x:g,y:d},s,r),e=Rc(u(m,c),{x:g,y:d},s,r);p.push([t,e])}if("x"===h&&g<=c&&c<=m){const t=Rc(u(c,d),{x:g,y:d},s,r),e=Rc(u(c,f),{x:g,y:d},s,r);p.push([t,e])}p.length>0&&n.line.CT().ea(l||o.sparkChartConstantLineStrokeStyle).la(p[0][0]).Ko(p[0][1])},Uc=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.Ph&>.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 support@lightningchart.com. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let u=Me,c=Ae,d=Me,f=Ae;for(let t=0;tRc(t,{x:u,y:d},g,i)));e.lineSet.CT().Ir(n).ea(o||s.sparkLineChartStrokeStyle).qn().Kn(m),a&&zc(a,m,{x:u,y:d},{x:c,y:f},g,i,e,s)},Hc=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,threshold:l,winFillStyle:u,lossFillStyle:c}=t,d=t.barSize||1,f=t.gap||1,g=t.winLoss,m=l||0,p=f/d*1;let y=Me,x=Ae;if(g)y=-1,x=1;else for(const t of o)y=Math.min(y,t),x=Math.max(x,t);const S={x:0,y:g?-1:Math.min(0,y)},v={x:1*o.length+(o.length-1)*p,y:g?2:Math.max(x,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*p,y:g?t>=m?1:0:t},r=Rc({x:1*e+e*p,y:g?t>=m?0:-1:0},S,v,i),n=Rc(s,S,v,i);return{value:t,position:r,width:n.x-r.x,height:n.y-r.y}})).forEach((t=>{var i;e.rect.CT().Ir(n).Sn(t.position).no(t.height).ro(t.width).ps((i=t.value,g?(i>=m?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).$h(a||s.sparkBarChartStrokeStyle)}))},Wc=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.Ph&>.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 support@lightningchart.com. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let c=Me,f=Ae,g=Me,m=Ae;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=Rc(u(50,50),{x:0,y:0},{x:100,y:100},i),f=i[1],g=f.x<=f.y?f.x/2:f.y/2;let m=90;a.forEach(((t,i)=>{const r=t/c*360;e.arc.CT().Ir(n).Sn(d).qo(g).ta(0).Zo(m).Ko(m+r).ps(l[i]||ue(s.sparkPieChartFillStyle,i)).$h(h||s.sparkPieChartStrokeStyle),m+=r}))};var qc,Xc,$c;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(qc||(qc={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(Xc||(Xc={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}($c||($c={}));class jc extends Nr{constructor(t,e,i,s,r){super(),this.xl=!1,this.QA={x:0,y:0,height:20,width:20},this.FT={x:10,y:10},this.Lr=t,this.PT=r,this.DT=new pn(t,e,i,bt,s).setMouseInteractions(!0),this.BT=t.vc(e,Ws.Simple).ps(s.dataGridScrollBarButtonArrowFillStyle).$h(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.jl(this),this.DT.onMouseEnter((t=>t.setHighlight(1))),this.DT.onMouseLeave((t=>t.setHighlight(0)))}LT(){switch(this.PT){case $c.Up:this.BT.lo([{x:this.QA.x,y:this.QA.y+this.FT.y/2},{x:this.QA.x+this.FT.x/2,y:this.QA.y-this.FT.y/2},{x:this.QA.x-this.FT.x/2,y:this.QA.y-this.FT.y/2}]);break;case $c.Down:this.BT.lo([{x:this.QA.x-this.FT.x/2,y:this.QA.y+this.FT.y/2},{x:this.QA.x+this.FT.x/2,y:this.QA.y+this.FT.y/2},{x:this.QA.x,y:this.QA.y-this.FT.y/2}]);break;case $c.Left:this.BT.lo([{x:this.QA.x-this.FT.x/2,y:this.QA.y},{x:this.QA.x+this.FT.x/2,y:this.QA.y+this.FT.y/2},{x:this.QA.x+this.FT.x/2,y:this.QA.y-this.FT.y/2}]);break;case $c.Right:this.BT.lo([{x:this.QA.x-this.FT.x/2,y:this.QA.y+this.FT.y/2},{x:this.QA.x+this.FT.x/2,y:this.QA.y},{x:this.QA.x-this.FT.x/2,y:this.QA.y-this.FT.y/2}])}}Sn(t){return this.QA.x=t.x,this.QA.y=t.y,this}xn(){return u(this.QA.x,this.QA.y)}q(t){return this.QA.height=t.x,this.QA.width=t.y,this}Et(){return{x:this.QA.height,y:this.QA.width}}onMouseDown(t){return this.DT.onMouseDown(t)}onMouseUp(t){return this.DT.onMouseUp(t)}setFillStyle(t){return this.DT.setFillStyle(t),this}getFillStyle(){return this.DT.getFillStyle()}setStrokeStyle(t){return this.DT.setStrokeStyle(t),this}getStrokeStyle(){return this.DT.getStrokeStyle()}ru(){return this.DT.ru(),this.LT(),this}Gs(){return this.DT.setSize(u(this.QA.height,this.QA.width)).setPosition(u(this.QA.x,this.QA.y)),this}setVisible(t){return this.DT.setVisible(t),this.BT.setVisible(t),this}dispose(){return this.DT.dispose(),this.BT.dispose(),this}setMouseInteractions(t){return this.DT.setMouseInteractions(t),this}getMouseInteractions(){return this.DT.getMouseInteractions()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}getHighlight(){return this.DT.getHighlight()}setHighlight(t){return this.DT.setHighlight(me(t)),this.P.emit("highlight",Boolean(t)),this.Lr.Bi(),this}}const Zc=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class Kc{constructor(t,i,s,n,o,h,a){this.Cc={x:0,y:0},this.QA={x:0,y:0,height:0,width:0},this.P=new r.Eventer,this.OT={min:u(0,0),max:u(0,0)},this.Yb=!1,this.Xb=!1,this.RT={x:0,y:0},this.Kl=void 0,this.ET=u(0,0),this.zT={x:0,y:0},this.VT=0,this.NT=15,this.jb=(t,i,s)=>{this.Yb=!0,this.gf.Bi();const r=this.GT.getDraggingMode(),n=this.GT.getDraggingMode()===e.UIDraggingModes.notDraggable?r:s||r;this.Kl=this.gf.Li.Ae(n===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:n===e.UIDraggingModes.draggable?e.MouseStyles.Move:n===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical),this.HT&&clearInterval(this.HT)},this.Zb=()=>{this.Yb=!1,this.gf.Bi(),this.gf.Li.we(this.Kl)},this.Kb=t=>(this.Xb=!0,this.RT=nt(this.gf.Li.ke(t.x,t.y),this.gf.Li.ct,this.scale),!0),this.WT=(t,e)=>(this.UT(e),this.HT=setInterval((()=>this.UT(e)),300),!0),this.$T=()=>(clearInterval(this.HT),!0),this.qb=(t,i)=>{const s=this.GT.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=nt(this.gf.Li.ke(t.x,t.y),this.gf.Li.ct,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?Zc(n.x,this.scale.x):this.QA.x,r!==e.UIDraggingModes.onlyHorizontal?Zc(n.y,this.scale.y):this.QA.y),h=u(o.x-this.RT.x,o.y-this.RT.y),a=u(this.GT.getPosition().x+h.x,this.GT.getPosition().y+h.y),l=this.YT(a),c={x:Math.abs(this.ET.x-l.x),y:Math.abs(this.ET.y-l.y)};return this.XT(c),this.zT.y>h.y&&(this.RT=n),this.ru(),!0}return!1},this.Jb=(t,e)=>{this.Xb=!1,Xt(e),this.gf.Bi()},this.gf=t,this.Fg=i,this.scale=n,this.contentScale=o,this.jT=a,this.ZT=new jc(t,s,n,h,a===qc.UpToDown?$c.Up:$c.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.KT=new jc(t,s,n,h,a===qc.UpToDown?$c.Down:$c.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.GT=new pn(t,s,n,bt,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===qc.UpToDown?e.UIDraggingModes.onlyVertical:a===qc.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.qT=new pn(i,s,n,bt,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.GT.onMouseEnter(this.jb),this.GT.onMouseLeave(this.Zb),this.GT.onMouseDragStart(((t,e)=>this.Kb(u(e.clientX,e.clientY))&&Xt(e))),this.GT.onMouseDrag(((t,e)=>this.qb(u(e.clientX,e.clientY))&&Xt(e))),this.GT.onMouseDragStop(this.Jb),this.GT.onTouchStart(((t,e)=>this.Kb(u(e.clientX,e.clientY))&&Xt(e))),this.GT.onTouchMove(((t,e)=>this.qb(u(e.clientX,e.clientY))&&Xt(e))),this.GT.onTouchEnd(this.Jb),this.ZT.onMouseDown(((t,e)=>this.WT(t,e)&&Xt(e))),this.KT.onMouseDown(((t,e)=>this.WT(t,e)&&Xt(e))),this.ZT.onMouseUp(((t,e)=>this.$T()&&Xt(e))),this.KT.onMouseUp(((t,e)=>this.$T()&&Xt(e))),this.qT.onMouseWheel(((t,e)=>this.JT(e))),this.GT.onMouseWheel(((t,e)=>this.JT(e))),this.qT.onMouseDown(((t,e)=>this.WT(t,e)&&Xt(e))),this.qT.onMouseUp(((t,e)=>this.$T()&&Xt(e)))}QT(t){return this.QA=t,this}ro(t){return this.QA.width=t,this}kA(){return this.QA.width}tI(t){return this.ET=t,this}iI(t){return this.Cc=t,this}sI(){return this.Cc}eI(t){return this.NT=t,this}hI(){return this.jT}rI(t){let e;switch(this.jT){case qc.UpToDown:return e=t>0?Math.min(this.ET.y-this.OT.max.y,this.zT.y+t):Math.max(0,this.zT.y+t),e!==this.zT.y&&(this.XT({x:0,y:e}),this.ru(),!0);case qc.LeftToRight:return e=Math.min(this.OT.max.x-this.ET.x,this.zT.x+t),e!==this.zT.x&&(this.XT({y:0,x:e}),this.ru(),!0);default:return!1}}nI(t){let e;switch(this.jT){case qc.UpToDown:return e=Math.max(0,this.zT.y-t),e!==this.zT.y&&(this.XT({x:0,y:e}),this.ru(),!0);case qc.LeftToRight:return e=t>0?Math.max(0,this.zT.x-t):Math.min(this.OT.max.x-this.ET.x,this.zT.x-t),e!==this.zT.x&&(this.XT({x:e,y:0}),this.ru(),!0);default:return!0}}oI(t){switch(this.jT){case qc.UpToDown:return this.P.on("scrollY",t);case qc.LeftToRight:return this.P.on("scrollX",t)}return this.P.on("scrollY",t)}YT(t){switch(this.jT){case qc.UpToDown:if(t.y>this.OT.min.y)return u(t.x,this.OT.min.y);if(t.ythis.OT.max.x)return u(this.OT.max.x,t.y)}return t}JT(t){t.deltaY>0&&this.aI()&&Xt(t),t.deltaY<0&&this.lI()&&Xt(t)}UT(t){const e=nt(this.gf.Li.ke(t.clientX,t.clientY),this.gf.Li.ct,this.scale);let i;const s=this.GT.getPosition(),r=this.GT.getSize();this.uI(e,s,r)?clearInterval(this.HT):(i=this.jT===qc.UpToDown?u(0,e.y-s.y>0?this.NT:-this.NT):u(s.x-e.x>0?this.NT:-this.NT,0),(i.x>0||i.y>0)&&this.cI(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.dI(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}uI(t,e,i){return this.jT===qc.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.QA.height?Math.min(this.ET.y-this.OT.max.y,this.zT.y+t):0,e!==this.zT.y&&(this.XT({x:0,y:e}),this.ru(),!0)}case qc.LeftToRight:{const e=Math.min(this.OT.max.x-this.ET.x,this.zT.x+t);return e!==this.zT.x&&(this.XT({y:0,x:e}),this.ru(),!0)}default:return!1}}lI(){return this.cI(this.NT)}aI(){return this.dI(this.NT)}XT(t){if(t.x===this.zT.x&&t.y===this.zT.y)return;let e;switch(this.zT=t,this.jT){case qc.UpToDown:e=this.zT.y*this.VT*this.contentScale.yi().y,this.P.emit("scrollY",Xc.Vertical,e),this.gf.Li.Bi();break;case qc.LeftToRight:e=this.zT.x*this.VT*this.contentScale.yi().x,this.P.emit("scrollX",Xc.Horizontal,e)}}setVisible(t){return this.ZT.setVisible(t),this.KT.setVisible(t),this.qT.setVisible(t),this.GT.setVisible(t),this}dispose(){return this.ZT.dispose(),this.KT.dispose(),this.qT.dispose(),this.GT.dispose(),this.HT&&clearInterval(this.HT),this}Gs(){switch(this.gI(),this.pI(),this.jT){case qc.UpToDown:this.ZT.Sn({x:this.QA.x,y:this.QA.y+this.QA.height-this.ZT.Et().x/2}).q(u(this.QA.width,this.QA.width)).Gs(),this.KT.Sn({x:this.QA.x,y:this.QA.y+10}).q(u(this.QA.width,this.QA.width)).Gs(),this.qT.setSize({x:this.QA.width,y:this.QA.height-2*this.ZT.Et().x}).setPosition({x:this.QA.x,y:this.QA.y+this.KT.Et().y+this.qT.getSize().y/2}),this.GT.setSize(u(this.QA.width,this.mI())),this.ET={x:this.QA.x,y:this.ZT.xn().y-this.ZT.Et().y/2-this.GT.getSize().y/2},this.fI({min:{x:this.QA.x,y:this.ZT.xn().y-this.ZT.Et().y/2-this.GT.getSize().y/2},max:{x:this.QA.x,y:this.KT.xn().y+this.KT.Et().x/2+this.GT.getSize().y/2}});break;case qc.LeftToRight:this.ZT.Sn({x:this.QA.x,y:this.QA.y}).q(u(this.QA.height,this.QA.height)).Gs(),this.KT.Sn({x:this.QA.x+this.QA.width-this.KT.Et().x,y:this.QA.y}).q(u(this.QA.height,this.QA.height)).Gs(),this.qT.setSize({y:this.QA.height,x:this.QA.width-2*this.ZT.Et().y}).setPosition({x:this.QA.x+this.ZT.Et().x/2+this.qT.getSize().x/2,y:this.QA.y}),this.GT.setSize(u(this.mI(),this.QA.height)),this.ET={x:this.ZT.xn().x+this.ZT.Et().x/2+this.GT.getSize().x/2,y:this.QA.y},this.fI({min:{x:this.ZT.xn().x+this.ZT.Et().x/2+this.GT.getSize().x/2,y:this.QA.y},max:{x:this.KT.xn().x-this.KT.Et().x/2-this.GT.getSize().x/2,y:this.QA.y}})}return this.yI(),this}gI(){switch(this.jT){case qc.UpToDown:this.SI()||this.setVisible(!1),this.SI()&&this.setVisible(!0);break;case qc.LeftToRight:this.xI()||this.setVisible(!1),this.xI()&&this.setVisible(!0)}}pI(){switch(this.jT){case qc.UpToDown:this.SI()||this.XT({x:0,y:0});break;case qc.LeftToRight:this.xI()||this.XT({x:0,y:0})}}SI(){return this.Cc.x>this.QA.height}xI(){return this.Cc.y>this.QA.width}mI(){switch(this.jT){case qc.UpToDown:return this.QA.height*(this.QA.height-2*this.ZT.Et().x)/this.Cc.x;case qc.LeftToRight:return this.QA.width*(this.QA.width-2*this.ZT.Et().y)/this.Cc.y;default:return 0}}yI(){switch(this.jT){case qc.UpToDown:this.VT=(this.Cc.x-this.QA.height)/(this.OT.min.y-this.OT.max.y);break;case qc.LeftToRight:this.VT=(this.Cc.y-this.QA.width)/(this.OT.max.x-this.OT.min.x)}}ru(){switch(this.ZT.ru(),this.KT.ru(),this.qT.ru(),this.jT){case qc.UpToDown:this.GT.setPosition({x:this.QA.x,y:this.ZT.xn().y-this.ZT.Et().y/2-this.GT.getSize().y/2-this.zT.y}).ru();break;case qc.LeftToRight:this.GT.setPosition({y:this.QA.y,x:this.ZT.xn().x+this.ZT.Et().x/2+this.GT.getSize().x/2+this.zT.x}).ru()}return this}}class Jc{constructor(t,e,i,s,r,n,o){switch(this.gf=t,this.Fg=e,this.scale=s,this.contentScale=r,o){case Xc.Vertical:this.bI=this.vI(i,n,qc.UpToDown);break;case Xc.Horizontal:this.MI=this.vI(i,n,qc.LeftToRight);break;case Xc.Both:this.bI=this.vI(i,n,qc.UpToDown),this.MI=this.vI(i,n,qc.LeftToRight)}this._I=Fr(new Or(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.MI)||void 0===n?void 0:n.nI(s.x))&&Xt(r),0!==s.y&&(null===(o=this.bI)||void 0===o?void 0:o.rI(s.y))&&Xt(r)})))}vI(t,e,i){return new Kc(this.gf,this.Fg,t,this.scale,this.contentScale,e,i)}kA(){return 20}iI(t){var e,i;return null===(e=this.bI)||void 0===e||e.iI(t),null===(i=this.MI)||void 0===i||i.iI(t),this}AI(t){var e;return null===(e=this.MI)||void 0===e||e.eI(t),this}wI(t){var e;return null===(e=this.bI)||void 0===e||e.eI(t),this}kI(t){const e=this.bI;return e&&e.JT(t),this}CI(t){return this._I.onTouchStart(this,t),this}TI(t){return this._I.onTouchMove(this,t),this}II(t){return this._I.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.MI)||void 0===e||e.oI(t),null===(i=this.bI)||void 0===i||i.oI(t),this}dispose(){var t,e;return null===(t=this.bI)||void 0===t||t.dispose(),null===(e=this.MI)||void 0===e||e.dispose(),this}ru(){var t,e;return null===(t=this.bI)||void 0===t||t.ru(),null===(e=this.MI)||void 0===e||e.ru(),this}Gs(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.bI)||void 0===t||t.QT({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.MI)||void 0===e||e.QT({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.bI)||void 0===i||i.Gs(),null===(s=this.MI)||void 0===s||s.Gs(),this}}const Qc=s.Record({width:void 0,height:void 0,FI:void 0,DI:bt,BI:bt});class td extends Qc{constructor(t,e,i,s){super({...s,FI:t,DI:e,BI:i})}dispose(){return this.BI(this),this}setWidth(t){const e=this.set("width",t);return this.DI(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this.DI(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this.DI(i),i}Et(){if(!this.FI)return{x:0,y:0};const t=this.FI.width,e=this.FI.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}}}var ed;e.ImageFitMode=void 0,(ed=e.ImageFitMode||(e.ImageFitMode={}))[ed.Fill=0]="Fill",ed[ed.Fit=1]="Fit",ed[ed.Stretch=2]="Stretch",ed[ed.Center=3]="Center",ed[ed.Tile=4]="Tile";const id=s.Record({source:void 0,surroundingColor:A(0,0,0,0),sourceMissingColor:A(0,0,0,0),fitMode:e.ImageFitMode.Fill});class sd extends id{constructor(t){super(t),this.type="fillstyle"}setSource(t){return this.set("source",t)}getSource(){return this.get("source")}setSurroundingColor(t){return t instanceof M?this.set("surroundingColor",t):this.set("surroundingColor",t(this.get("surroundingColor")))}getSurroundingColor(){return this.get("surroundingColor")}setSourceMissingColor(t){return t instanceof M?this.set("sourceMissingColor",t):this.set("sourceMissingColor",t(this.get("sourceMissingColor")))}getSourceMissingColor(){return this.get("sourceMissingColor")}setFitMode(t){return this.set("fitMode",t)}getFitMode(){return this.get("fitMode")}}class rd extends mo{constructor(t,e,i,s,r,n){super(t,e,i,e.Xg("dataGrid bg",0),e.Eg("dataGrid ui"),s,e.Li.hs.dataGridBackgroundFillStyle,e.Li.hs.dataGridBackgroundStrokeStyle,e.Li.hs.dataGridTitleFont,e.Li.hs.dataGridTitleFillStyle,n),this.LI=[],this.OI=[],this.RI=[],this.EI=new Map,this.zI=!0,this.VI=!0,this.NI=!0,this.GI=!0,this.HI=!0,this.WI=!0,this.UI=!0,this.$I=!0,this.YI=!0,this.XI=!0,this.jI=!0,this.ZI=!0,this.KI=!0,this.qI=!0,this.JI=!0,this.QI=!0,this.tF=new Set,this.iF=new Set,this.sF=!0,this.eF=!0,this.hF=(t,e)=>{t.borders=void 0===e?ld:{...t.borders,...e},this.rF(t),this.ZI=!0,this.Li.Bi()},this.rF=t=>{t.borders&&(!1===t.borders.top&&this.nF(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.oF,bottom:!1}})),!1===t.borders.bottom&&this.nF(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.oF,top:!1}})),!1===t.borders.left&&this.nF(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.oF,right:!1}})),!1===t.borders.right&&this.nF(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.oF,left:!1}})),!0===t.borders.top&&this.nF(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.oF,bottom:!0}})),!0===t.borders.bottom&&this.nF(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.oF,top:!0}})),!0===t.borders.left&&this.nF(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.oF,right:!0}})),!0===t.borders.right&&this.nF(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.oF,left:!0}})))},this.aF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseEnter,i,e)},this.lF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseLeave,i,e)},this.uF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseClick,i,e)},this.cF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseDoubleClick,i,e)},this.dF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseDown,i,e)},this.fF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseUp,i,e)},this.gF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseMove,i,e)},this.pF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseDrag,i,e)},this.mF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseDragStart,i,e)},this.yF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseDragStop,i,e)},this.SF=(t,e)=>{const i=this.EI.get(t);i&&(this.P.emit(nd.cellMouseWheel,i,e),!e.defaultPrevented&&this.sF&&this.xF.kI(e))},this.bF=(t,e)=>{const i=this.EI.get(t);i&&(this.P.emit(nd.cellTouchStart,i,e),!e.defaultPrevented&&this.eF&&this.xF.CI(e))},this.vF=(t,e)=>{const i=this.EI.get(t);i&&(this.P.emit(nd.cellTouchMove,i,e),!e.defaultPrevented&&this.eF&&this.xF.TI(e))},this.MF=(t,e)=>{const i=this.EI.get(t);i&&(this.P.emit(nd.cellTouchEnd,i,e),!e.defaultPrevented&&this.eF&&this.xF.II(e))},this.ef._h||this.ef.wh||this.Li.bh(2),this.Kg.fs("Data Grid"),this._F=i.d2({scaleXYConstructor:Ti}),this._F.x.jf=Ic,this.AF=i.d2({scaleXYConstructor:Ti}),this.wF={x:0,y:0},this.kF=this.hs.dataGridTextFont,this.CF=this.hs.dataGridTextFillStyle,this.oF={top:!0,bottom:!0,left:!0,right:!0},this.TF=this.hs.dataGridCellBackgroundFillStyle,this.IF=this.hs.dataGridBorderStrokeStyle,this.FF="left-center",this.PF={left:5,right:5,bottom:5,top:5},this.DF=e.qy("dataGrid grid bg",0),this.BF=e.qy("dataGrid cell bg",1),this.LF=e.Pp("dataGrid cell content",0),this.OF=e.Pp("dataGrid scrollbar bg",1),this.RF=e.Pp("dataGrid scrollbar fg",2),this.xF=this.EF(),this.onBackgroundMouseWheel(((t,e)=>{this.sF&&this.xF.kI(e)})),this.onBackgroundTouchStart(((t,e)=>{this.eF&&this.xF.CI(e)})),this.onBackgroundTouchMove(((t,e)=>{this.eF&&this.xF.TI(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.eF&&this.xF.II(e)})),this.zF=this.DF.gc(this._F).ps(this.hs.dataGridBackgroundFillStyle).$h(J).setMouseInteractions(!1),this.VF=this.LF.Sg(this._F).setMouseInteractions(!1),this.NF=new Cc((()=>this.BF.gc(this._F).setMouseInteractions(!0).setMouseEnterEventHandler(this.aF).setMouseLeaveEventHandler(this.lF).setMouseClickEventHandler(this.uF).setMouseDoubleClickEventHandler(this.cF).setMouseDownEventHandler(this.dF).setMouseUpEventHandler(this.fF).setMouseMoveEventHandler(this.gF).setMouseDragEventHandler(this.pF).setMouseDragStartEventHandler(this.mF).setMouseDragStopEventHandler(this.yF).setMouseWheelEventHandler(this.SF).setTouchStartEventHandler(this.bF).setTouchMoveEventHandler(this.vF).setTouchEndEventHandler(this.MF))),this.GF=new Cc((()=>this.LF.gc(this._F).setMouseInteractions(!1))),this.HF=new Cc((()=>this.LF.ue(this._F).setMouseInteractions(!1)));const o=new Cc((()=>this.LF.Gp(this._F,{},[Bo.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),h=new Cc((()=>this.LF._u(this._F).setMouseInteractions(!1))),a=new Cc((()=>this.LF.Bm(this._F).setMouseInteractions(!1))),l=new Cc((()=>this.LF.gc(this._F).setMouseInteractions(!1))),u=new Cc((()=>this.LF.xk(this._F).setMouseInteractions(!1))),c=new Cc((()=>this.LF.kc(this._F).setMouseInteractions(!1)));this.WF={lineSet:o,line:h,pointSet:a,rect:l,junction:u,arc:c},this.UF=()=>{o.TT(),h.TT(),a.TT(),l.TT(),u.TT(),c.TT()},this.$F=()=>{this.NF.IT(),this.GF.IT(),this.HF.IT(),o.IT(),h.IT(),a.IT(),l.IT(),u.IT(),c.IT()},this.Yg(r,this.uiScale),this.onResize((()=>{this.zI=!0,this.Li.Bi(),this._F.q(this.pixelScale.Et()),this.AF.q(this.pixelScale.Et())})),this.YF=this.iu.lg([this.zF])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}dd(){return[]}dispose(){return super.dispose(),this.DF.G(),this.BF.G(),this.LF.G(),this.OF.G(),this.RF.G(),co(this._F),co(this.AF),this.xF.dispose(),this}X(){return super.X(),this._F.X(),this.AF.X(),this}j(){return super.j(),this._F.j(),this.AF.j(),this}setBackgroundEffect(t){return this.YF.vs(t),this.Li.Bi(),this}getBackgroundEffect(){return this.YF._s()}setInteractionScrollOnWheel(t){return this.sF=t,this}getInteractionScrollOnWheel(){return this.sF}setInteractionPanOnTouch(t){return this.eF=t,this}getInteractionPanOnTouch(){return this.eF}onCellMouseEnter(t){return this.P.on(nd.cellMouseEnter,t)}offCellMouseEnter(t){return this.P.off(t)}onCellMouseLeave(t){return this.P.on(nd.cellMouseLeave,t)}offCellMouseLeave(t){return this.P.off(t)}onCellMouseClick(t){return this.P.on(nd.cellMouseClick,t)}offCellMouseClick(t){return this.P.off(t)}onCellMouseDoubleClick(t){return this.P.on(nd.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.P.off(t)}onCellMouseDown(t){return this.P.on(nd.cellMouseDown,t)}offCellMouseDown(t){return this.P.off(t)}onCellMouseUp(t){return this.P.on(nd.cellMouseUp,t)}offCellMouseUp(t){return this.P.off(t)}onCellMouseMove(t){return this.P.on(nd.cellMouseMove,t)}offCellMouseMove(t){return this.P.off(t)}onCellMouseDrag(t){return this.P.on(nd.cellMouseDrag,t)}offCellMouseDrag(t){return this.P.off(t)}onCellMouseDragStart(t){return this.P.on(nd.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.P.off(t)}onCellMouseDragStop(t){return this.P.on(nd.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.P.off(t)}onCellMouseWheel(t){return this.P.on(nd.cellMouseWheel,t)}offCellMouseWheel(t){return this.P.off(t)}onCellTouchStart(t){return this.P.on(nd.cellTouchStart,t)}offCellTouchStart(t){return this.P.off(t)}onCellTouchMove(t){return this.P.on(nd.cellTouchMove,t)}offCellTouchMove(t){return this.P.off(t)}onCellTouchEnd(t){return this.P.on(nd.cellTouchEnd,t)}offCellTouchEnd(t){return this.P.off(t)}setGridBackgroundFillStyle(t){return this.zF.ps(t),this.Li.Bi(),this}getGridBackgroundFillStyle(){return this.zF.gs()}setCellContent(t,e,i,s,r){if("number"==typeof i&&void 0!==s&&void 0!==r){const o=i,h=s,a=r;let l=[];for(let i=t;ie.column===t));return i||(i={column:t,min:void 0,max:void 0},this.OI.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.OI.splice(this.OI.indexOf(i),1):(i.min=e,i.max=e),this.WI=!0,this.Li.Bi(),this}setRowHeight(t,e){let i=this.RI.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.RI.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.RI.splice(this.RI.indexOf(i),1):(i.min=e,i.max=e),this.WI=!0,this.Li.Bi(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=S(e,e,e,e)),this.jF(t,(t=>this.ZF(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=S(e,e,e,e)),this.KF(t,(t=>this.ZF(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=S(i,i,i,i)),this.nF(t,e,(t=>this.ZF(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=S(t,t,t,t)),this.PF={...this.PF,...t},this.qF((t=>this.ZF(t,this.PF))),this}setCellBorders(t,e,i){return this.nF(t,e,(t=>this.hF(t,i))),this}setRowBorders(t,e){return this.KF(t,(t=>this.hF(t,e))),this}setColumnBorders(t,e){return this.jF(t,(t=>this.hF(t,e))),this}setCellsBorders(t){return this.oF=void 0===t?ld:t,this.qF((t=>this.hF(t,this.oF))),this}setCellsBorderStrokeStyle(t){return this.IF="function"==typeof t?t(this.IF):t,this.qI=!0,this.Li.Bi(),this}setColumnTextFillStyle(t,e){return this.jF(t,(t=>this.JF(t,e))),this}setRowTextFillStyle(t,e){return this.KF(t,(t=>this.JF(t,e))),this}setCellTextFillStyle(t,e,i){return this.nF(t,e,(t=>this.JF(t,i))),this}setCellsTextFillStyle(t){return this.CF="function"==typeof t?t(this.CF):t,this.qF((t=>this.JF(t,this.CF))),this}setColumnTextFont(t,e){return this.jF(t,(t=>this.QF(t,e))),this}setRowTextFont(t,e){return this.KF(t,(t=>this.QF(t,e))),this}setCellTextFont(t,e,i){return this.nF(t,e,(t=>this.QF(t,i))),this}setCellsTextFont(t){return this.kF="function"==typeof t?t(this.kF):t,this.qF((t=>this.QF(t,this.kF))),this}setColumnContentAlignment(t,e){return this.jF(t,(t=>this.tP(t,e))),this}setRowContentAlignment(t,e){return this.KF(t,(t=>this.tP(t,e))),this}setCellContentAlignment(t,e,i){return this.nF(t,e,(t=>this.tP(t,i))),this}setCellsContentAlignment(t){return this.FF=t,this.qF((t=>this.tP(t,this.FF))),this}setCellBackgroundFillStyle(t,e,i){return this.nF(t,e,(t=>this.iP(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.jF(t,(t=>this.iP(t,e))),this}setRowBackgroundFillStyle(t,e){return this.KF(t,(t=>this.iP(t,e))),this}setCellsBackgroundFillStyle(t){return this.TF="function"==typeof t?t(this.TF):t,this.qF((t=>this.iP(t,this.TF))),this}setCellHighlight(t,e,i){return this.nF(t,e,(t=>{t.highlight=me(i)})),this.KI=!0,this.Li.Bi(),this}setColumnHighlight(t,e){const i=me(e);return this.jF(t,(t=>{t.highlight=i})),this.KI=!0,this.Li.Bi(),this}setRowHighlight(t,e){const i=me(e);return this.KF(t,(t=>{t.highlight=i})),this.KI=!0,this.Li.Bi(),this}removeCell(t,e){return this.nF(t,e,(t=>this.LI.splice(this.LI.indexOf(t),1))),this.HI=!0,this.Li.Bi(),this}removeRow(t){return this.KF(t,(t=>this.LI.splice(this.LI.indexOf(t),1))),this.LI.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.HI=!0,this.Li.Bi(),this}removeColumn(t){return this.jF(t,(t=>this.LI.splice(this.LI.indexOf(t),1))),this.LI.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.HI=!0,this.Li.Bi(),this}removeCells(){return this.LI.splice(0),this.HI=!0,this.Li.Bi(),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)}ru(){super.ru(),po.ip(this.Kg,this.jg);const t=Math.round(this.IF.O()),e=t/2;let i=this.VI||this.NI||this.GI||this.HI||this.WI||this.UI||this.jI||this.ZI||this.qI||this.QI;if(i){this.LI.forEach((t=>{this.iF.add(t.column)})),this.LI.forEach((t=>{this.tF.add(t.row)})),this.HF.TT();const s=this.sP(e),r=this.eP(this.iF.size,s),n=this.hP(this.tF.size,s),o=r.reduce(Ie,0)+t,h=n.reduce(Ie,0)+t,a=new Array(r.length+1).fill(0).map(((t,e)=>r.reduce(((t,i,s)=>t+(sn.reduce(((t,i,s)=>t+(st===r[e])),e=this.rP.rowHeights.every(((t,e)=>t===n[e]));t&&e&&(i=!1)}this.rP={columnWidths:r,rowHeights:n,dataGridWidth:o,dataGridHeight:h,columnWidthsCumulative:a,rowHeightsCumulative:l,cellsContentSizes:s}}const s=i||this.NI||this.GI||this.HI||this.$I||this.YI||this.XI||this.ZI||this.KI||this.qI||this.zI||this.QI;if((s||this.JI)&&this.rP){const i=this.pixelScale.getInnerIntervalPixels(),r=po.tp(this.Kg,this.jg),n=[this.rn.left+e,this.rn.right+e],o=[this.rn.bottom+e,this.rn.top+r+e],h={x:i.x-n[0]-n[1],y:i.y-o[0]-o[1]},a=[this.rn.left,this.rn.right],l=[this.rn.bottom,this.rn.top+r],u={x:Math.round(i.x-a[0]-a[1]),y:Math.round(i.y-l[0]-l[1])},c={x:Math.ceil(e),y:Math.floor(u.y-e)};this.AF.ci(n).di(o).fi(0,h.x).gi(0,h.y),this.xF.iI({x:this.rP.dataGridHeight,y:this.rP.dataGridWidth}).Gs().ru();const d={x:Math.round(this.wF.x),y:Math.round(Math.min(0,this.wF.y))};this._F.ci(a).di(l).fi(d.x,u.x+d.x).gi(d.y,u.y+d.y),this.zF.Sn({x:c.x,y:c.y});const f={x:this._F.x.Bt(),y:this._F.y.Bt()+this.xF.kA(),width:this._F.x.Ot()+t-this.xF.kA(),height:this._F.y.Ot()+t};this.LF.Wy(f),this.BF.Wy(f),this.DF.Wy(f),s&&this.nP(c,this.rP,t)}this.$F(),this.zI=!1,this.VI=!1,this.NI=!1,this.GI=!1,this.HI=!1,this.WI=!1,this.UI=!1,this.$I=!1,this.YI=!1,this.XI=!1,this.jI=!1,this.ZI=!1,this.KI=!1,this.qI=!1,this.JI=!1,this.QI=!1}sP(t){const e=[],i={left:Math.ceil(t),right:Math.ceil(t),top:Math.ceil(t),bottom:Math.ceil(t)};for(const t of this.LI){const{content:s}=t,r={...this.PF,...t.padding};let n,o,h,a={x:0,y:0};if("string"==typeof s||"number"==typeof s){const e=String(s);n=this.HF.CT(),a=n.fs(e).Ss(t.textFont||this.kF).Gs().Ac()}if(Pc(s)&&(o=s,a={x:200,y:50}),s instanceof td){const t=this.Li.oP(s);t.aP()?(h=s,a=h.Et()):t.lP((()=>{this.QI=!0,this.Li.Bi()}))}if(n||o||h){r.top=Math.round(r.top),r.left=Math.round(r.left),r.right=Math.round(r.right),r.bottom=Math.round(r.bottom);const s={x:Math.round(a.x+r.left+r.right+i.left+i.right),y:Math.round(a.y+r.top+r.bottom+i.top+i.bottom)};e.push({cell:t,contentSize:s,text:n,sparkChart:o,icon:h,cellPadding:r,cellMargin:i})}}return e}nP(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.zF.q(c),this.VF.ea(this.IF),this.EI.clear(),this.NF.TT(),this.GF.TT(),this.UF();const d=[];for(const i of o){const{cell:r,text:n,sparkChart:o,icon:c,cellPadding:f,cellMargin:g}=i,m={column:r.column,row:r.row},p={x:t.x+a[r.column],y:t.y-u[r.row+r.rowSpan]},y={x:p.x+g.left,y:p.y+g.bottom},x={x:y.x+f.left,y:y.y+f.bottom},S={x:new Array(r.columnSpan).fill(0).reduce(((t,e,i)=>t+h[r.column+i]),0),y:new Array(r.rowSpan).fill(0).reduce(((t,e,i)=>t+l[r.row+i]),0)},v={x:S.x-g.left-g.right,y:S.y-g.top-g.bottom},b={x:v.x-f.left-f.right,y:v.y-f.top-f.bottom};if(n){const t=ad(x,b,r.contentAlignment||this.FF);n.Sn(t[0]).kn({x:t[1],y:t[2]}).ps(this.uP(r.textFillStyle||this.CF,r.content,this.CF)).Ir(r.highlight)}const M=this.uP(r.backgroundFillStyle||this.TF,r.content);if(M!==F){const t=this.NF.CT();t.Sn(p).q(S).ps(M).$h(J).Ir(r.highlight),this.EI.set(t,m)}const A=r.borders||this.oF;if(A&&hd(p,S,A,s,d),o){const t=x,e=b;Lc(o,this.WF,this._F,t,e,this.hs,this.ef,r.highlight)}if(c){const t=c.Et(),i=ad(x,b,r.contentAlignment||this.FF);this.GF.CT().Sn({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).q(t).ps(new sd({source:c.FI,fitMode:e.ImageFitMode.Stretch})).$h(J).Ir(r.highlight)}}this.VF.qn();for(const t of d)this.VF.Kn(t[0],t[1])}eP(t,e){const i=new Array(t).fill(0);for(const t of this.iF.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.OI.find((e=>e.column===t)),n=r?At(s,void 0!==r.min?r.min:Ae,void 0!==r.max?r.max:Me):s;i[t]=n}return i}hP(t,e){const i=new Array(t).fill(0);for(const t of this.tF.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.RI.find((e=>e.row===t)),n=r?At(s,void 0!==r.min?r.min:Ae,void 0!==r.max?r.max:Me):s;i[t]=n}return i}uP(t,e,i){if(t instanceof G){try{const i=Number(e);return new z({color:t.getPalette().getColors(i)})}catch(t){}return i||F}return t}JF(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.CF):e,this.XI=!0,this.Li.Bi()}QF(t,e){t.textFont="function"==typeof e?e(t.textFont||this.kF):e,this.jI=!0,this.Li.Bi()}iP(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.TF):e,this.YI=!0,this.Li.Bi()}tP(t,e){t.contentAlignment=e,this.$I=!0,this.Li.Bi()}ZF(t,e){t.padding={...t.padding,...e},this.UI=!0,this.Li.Bi()}XF(t,e,i){let s=this.nF(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.LI.push(s),this.GI=!0),"string"==typeof s.content||"number"==typeof s.content?this.VI=!0:this.NI=!0,this.Li.Bi()}qF(t){this.LI.forEach((e=>t(e)))}nF(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}jF(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)}KF(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)}EF(){return new Jc(this.RF,this.OF,this.AF,this.AF,this._F,this.hs,Xc.Both).onScroll(((t,e)=>{this.rP&&(t===Xc.Vertical&&(this.wF.y=-e),t===Xc.Horizontal&&(this.wF.x=e),this.JI=!0,this.Li.Bi())})).AI(50).wI(12)}}const nd={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 od;e.DataGridCellContentAlignmentOptions=void 0,(od=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",od.RightCenter="right-center",od.LeftCenter="left-center",od.RightTop="right-top",od.LeftTop="left-top",od.RightBottom="right-bottom",od.LeftBottom="left-bottom",od.CenterTop="center-top",od.CenterBottom="center-bottom";const hd=(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])},ad=(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 pe(0,`Unidentified DataGrid cell content alignment option: ${i}`)},ld={top:!1,bottom:!1,left:!1,right:!1},ud=(t,e)=>e?t.x:t.y,cd=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),dd=(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(ud(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&&ecd(t,h,n,e))).reduce(((t,e)=>Math.max(t,ud(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>ud(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))/ud(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class fd{constructor(t,e,i,s,n){this.ce=!1,this.LI=new Array,this.P=new r.Eventer,this.cP=[],this.Ag=[],this.dP=void 0,this.fP=!0,this.gP=!0,this.pP=!0,this.mP=([t,e])=>{this.uiScale.q(t,e),this.pixelScale.q(t,e).fi(0,this.uiScale.x.getCellSize()).gi(0,this.uiScale.y.getCellSize()),this.gP=!0,this.Li.Bi()},this.yP=[],this.SP=t=>{for(let e=0;e{const e=this.cP.indexOf(t);e>=0&&this.cP.splice(e,1)},this.Dg=t=>{const e=this.Ag.indexOf(t);e>=0&&this.Ag.splice(e,1)},this.bP=(t,e,i,s,r)=>{if(this.vP(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.LI.push(n),this.MP(n),this.fP=!0,t}throw new ht("Out of dashboard range.")},this._P=e.numberOfRows,this.AP=e.numberOfColumns,this.ef=t,this.wP=e,this.kP=s;const o=this.AP*this._P;this.CP={x:new kc(new Array(this.AP).fill(1)),y:new kc(new Array(this._P).fill(1))},this.hs=i.hs,this.TP=this.hs.dashboardSplitterStyle,this.Oi=void 0===e.disableAnimations||!e.disableAnimations,this.IP=Bc(i,o),this.FP=i.vT("dashboard splitters",400001),this.ov=()=>this.IP.bT(),this.zg=this.IP.MT(),this.iu=i.iu.su(this,{PP:{}}),this.iu.PP.vs(this.hs.effectsDashboardSplitters);const h=i.Et();this.uiScale=st.d2({scaleXYConstructor:Ti}).fi(0,100).gi(0,100).q(h),this.pixelScale=st.d2({scaleXYConstructor:Ti}).fi(0,this.uiScale.x.getCellSize()).gi(0,this.uiScale.y.getCellSize()).q(h),this.DP=i.BP.bind(i),this.LP=i.OP.bind(i),this.RP=i.EP.bind(i),this.zP=i.VP.bind(i),this.Nh=i.Nh.bind(i),this.Hh=i.Hh.bind(i),this.engine=i.Lg,this.Li=i.Og,i.cr(this.mP),i.Bi(),this.NP(),this.setAnimationsEnabled(this.Oi);const a=((t,e)=>({on:t.on.bind(t,"dashboard-resize"),off:t.off.bind(t)}))(this.P);this.createChartXY=t=>{const e=gd(t,this.wP,this.Oi);return this.bP(new Mc(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=gd(t,this.wP,this.Oi);return this.bP(new Rl(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=gd(t,this.wP,this.Oi);return this.bP(new Ua(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=gd(t,this.wP,this.Oi),i=e&&e.type?e.type:zo;return this.bP(new i(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=gd(t,this.wP,this.Oi),i=e&&e.type?e.type:ll;return this.bP(new i(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=gd(t,this.wP,this.Oi),i=e&&e.type?e.type:Ja;return this.bP(new i(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=gd(t,this.wP,this.Oi),i=t&&t.type?t.type:yl;return this.bP(new i(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=gd(t,this.wP,this.Oi);return this.bP(new fo(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=gd(t,this.wP,this.Oi);return this.bP(new yh(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=gd(t,this.wP,this.Oi),i=void 0===e.bandAboveSeries||e.bandAboveSeries;return this.bP(new Ec(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,e.axis,i,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=gd(t,this.wP,this.Oi);return this.bP(new Xh(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=gd(t,this.wP,this.Oi),i=new mh(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a,e);return this.bP(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=gd(t,this.wP,this.Oi),i=new rd(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a);return this.bP(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}GP(t,e){return t+e*this.AP}HP(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.AP:this._P,"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.AP,y:this._P},e),d3:()=>new et({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.AP,y:this._P},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.DP(t[0]),this.LP(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.RP(t[0]),this.zP(t[1]),this}getWidth(){return this.Nh()}getHeight(){return this.Hh()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.FP.Bi(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.FP.Bi(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.hs}setSplitterStyle(t){const e=this.TP;return this.TP="function"==typeof t?t(this.TP):t,this.WP(e),this}getSplitterStyle(){return this.TP}setSplitterEffect(t){return this.iu.PP.vs(t),this.Li.Bi(),this}getSplitterEffect(){return this.iu.PP._s()}setAnimationHighlight(t){return this.pP=t,this.yP.forEach((e=>this.Li.Vh.ve(e.line,t))),this}getAnimationHighlight(){return this.pP}WP(t){for(const t of this.yP)t.line.ea(this.TP);this.NP()}setColumnWidth(t,e){const i=this.CP.x.M();return t>=0&&t=e.length)throw new ht("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.CP.y.M();return t>=0&&t=e.length)throw new ht("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}UP(t,e,i){if(i&&Math.abs(t.x)>0)this.$P(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.YP(e,t.y)}this.P.emit("dashboard-resize");for(const t of this.LI)t.panel.j();this.Li.Bi()}YP(t,e){const i=dd(this.LI,this.CP.y.M(),t,e,this.pixelScale.Et(),!1);this.CP.y.S(i),this.gP=!0,this.Li.Bi()}$P(t,e){const i=dd(this.LI,this.CP.x.M(),t,e,this.pixelScale.Et(),!0);this.CP.x.S(i),this.gP=!0,this.Li.Bi()}XP(){this.yP.forEach((t=>t.line.dispose())),this.yP.length=0;for(let t=1;t<=this.AP-1;t+=1)for(let e=0;e<=this._P-1;e+=1)if(void 0!==this.LI.find((i=>Pe(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=Fr(new Or((()=>{this.jP(t)}),((e,i,s,r,n)=>{this.UP(r,t,!0),Xt(n)}),(()=>{this.ZP(t)}))),s=this.FP._u(this.pixelScale).ea(this.TP).setMouseEnterEventHandler((()=>{this.jP(t)})).setMouseLeaveEventHandler((()=>{this.ZP(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.UP(n,t,!0),Xt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.Li.Vh.Se(s,(t=>s.Ir(t)),{animationEnabled:this.pP}),this.yP.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this._P-1;t+=1)for(let e=0;e<=this.AP-1;e+=1)if(void 0!==this.LI.find((i=>Pe(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=Fr(new Or((()=>{this.KP(t)}),((e,i,s,r,n)=>{this.UP(r,t,!1),Xt(n)}),(()=>{this.qP(t)}))),s=this.FP._u(this.pixelScale).ea(this.TP).setMouseEnterEventHandler((()=>{this.KP(t)})).setMouseLeaveEventHandler((()=>{this.qP(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.UP(n,t,!1),Xt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.Li.Vh.Se(s,(t=>s.Ir(t)),{animationEnabled:this.pP}),this.yP.push({row:t,column:e,line:s,alignment:"horizontal"})}this.iu.PP.nc(this.yP.map((t=>t.line)))}JP(){const t=this.pixelScale.Et(),e=this.CP.x.M(),i=e.reduce(((t,e)=>t+e)),s=this.CP.y.M(),r=s.reduce(((t,e)=>t+e));this.yP.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.la(o).Ko(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.la(o).Ko(h)}}))}jP(t){this.yP.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.Li.Vh.xe(e.line,1),this.FP.QP(e.line))})),this.dP=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.Li.Bi()}KP(t){this.yP.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.Li.Vh.xe(e.line,1),this.FP.QP(e.line))})),this.dP=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.Li.Bi()}ZP(t){this.yP.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.Li.Vh.xe(e.line,0)})),this.engine.restoreMouseStyle(this.dP),this.Li.Bi()}qP(t){this.yP.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.Li.Vh.xe(e.line,0)})),this.engine.restoreMouseStyle(this.dP),this.Li.Bi()}setAnimationsEnabled(t){return this.Oi=t,this.getCells().filter((t=>t.panel instanceof mo)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.Oi),this}getAnimationsEnabled(){return this.Oi}getCells(){return this.LI.slice()}dispose(){return this.ce||(this.LI.slice().forEach((t=>t.panel.dispose())),this.cP.slice().forEach((t=>t.dispose())),this.Ag.slice().forEach((t=>t.dispose())),this.ce=!0,this.kP(),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 ho(this.engine,t,e,i),this}tD(){this.fP&&(this.XP(),this.fP=!1,this.gP=!0),this.gP&&(this.JP(),this.gP=!1);for(const t of this.LI)t.panel.ru();return this.cP.forEach((t=>t.Gs())),this.cP.forEach((t=>t.ru())),this.Ag.forEach((t=>t.Gs())),this.Ag.forEach((t=>t.ru())),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}j(){for(const t of this.LI)t.panel.j();return this.pixelScale.x.j(),this.pixelScale.y.j(),this.uiScale.x.j(),this.uiScale.y.j(),this}addUIElement(t=Rn,e=this.uiScale){e=lo(e);const i=ao(t,this.ov(),this.uiScale,e,this.xP,this.hs);return this.cP.push(i),i}addLegendBox(t=qn,i=this.uiScale){i=lo(i);const s=ao(t,this.zg,this.uiScale,i,this.Dg,this.hs);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.Ag.push(s),s}vP(t,e,i,s){return e>=0&&t>=0&&e+s<=this._P&&t+i<=this.AP}MP(t){const e=this.TP,i=e===J?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Cn(s)}NP(){this.uiScale.x.Dt([0,0]),this.uiScale.y.Dt([0,0]),this.pixelScale.x.Dt([0,0]),this.pixelScale.y.Dt([0,0]);for(const t of this.LI)this.MP(t);this.Li.Bi()}}const gd=(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},md="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",pd="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==",yd={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)=>yd.multiply(t,yd.translation(e,i,s)),xRotate:(t,e)=>yd.multiply(t,yd.xRotation(e)),yRotate:(t,e)=>yd.multiply(t,yd.yRotation(e)),zRotate:(t,e)=>yd.multiply(t,yd.zRotation(e)),scale:(t,e,i,s)=>yd.multiply(t,yd.scaling(e,i,s)),multiply(t,e){const i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],h=e[5],a=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],g=e[12],m=e[13],p=e[14],y=e[15],x=t[0],S=t[1],v=t[2],b=t[3],M=t[4],A=t[5],w=t[6],D=t[7],T=t[8],E=t[9],B=t[10],k=t[11],I=t[12],C=t[13],P=t[14],L=t[15],R=[];return R[0]=i*x+s*M+r*T+n*I,R[1]=i*S+s*A+r*E+n*C,R[2]=i*v+s*w+r*B+n*P,R[3]=i*b+s*D+r*k+n*L,R[4]=o*x+h*M+a*T+l*I,R[5]=o*S+h*A+a*E+l*C,R[6]=o*v+h*w+a*B+l*P,R[7]=o*b+h*D+a*k+l*L,R[8]=u*x+c*M+d*T+f*I,R[9]=u*S+c*A+d*E+f*C,R[10]=u*v+c*w+d*B+f*P,R[11]=u*b+c*D+d*k+f*L,R[12]=g*x+m*M+p*T+y*I,R[13]=g*S+m*A+p*E+y*C,R[14]=g*v+m*w+p*B+y*P,R[15]=g*b+m*D+p*k+y*L,R},inverse(t){const e=[],i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],h=t[5],a=t[6],l=t[7],u=t[8],c=t[9],d=t[10],f=t[11],g=t[12],m=t[13],p=t[14],y=t[15],x=d*y,S=p*f,v=a*y,b=p*l,M=a*f,A=d*l,w=r*y,D=p*n,T=r*f,E=d*n,B=r*l,k=a*n,I=u*m,C=g*c,P=o*m,L=g*h,R=o*c,F=u*h,_=i*m,O=g*s,z=i*c,V=u*s,N=i*h,G=o*s,U=x*h+b*c+M*m-(S*h+v*c+A*m),H=S*s+w*c+E*m-(x*s+D*c+T*m),W=v*s+D*h+B*m-(b*s+w*h+k*m),Y=A*s+T*h+k*c-(M*s+E*h+B*c),q=1/(i*U+o*H+u*W+g*Y);return e[0]=q*U,e[1]=q*H,e[2]=q*W,e[3]=q*Y,e[4]=q*(S*o+v*u+A*g-(x*o+b*u+M*g)),e[5]=q*(x*i+D*u+T*g-(S*i+w*u+E*g)),e[6]=q*(b*i+w*o+k*g-(v*i+D*o+B*g)),e[7]=q*(M*i+E*o+B*u-(A*i+T*o+k*u)),e[8]=q*(I*l+L*f+R*y-(C*l+P*f+F*y)),e[9]=q*(C*n+_*f+V*y-(I*n+O*f+z*y)),e[10]=q*(P*n+O*l+N*y-(L*n+_*l+G*y)),e[11]=q*(F*n+z*l+G*f-(R*n+V*l+N*f)),e[12]=q*(P*d+F*p+C*a-(R*p+I*a+L*d)),e[13]=q*(z*p+I*r+O*d-(_*d+V*p+C*r)),e[14]=q*(_*a+G*p+L*r-(N*p+P*r+O*a)),e[15]=q*(N*d+R*r+V*a-(z*a+G*d+F*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 xd{constructor(t){this.iD=t}}class Sd{constructor(){this.sD=new Array,this.eD=t=>(this.sD.push(t),t),this.hD=this.eD(new Map),this.rD=this.eD(new Map),this.nD=this.eD(new Map),this.oD=this.eD(new Map),this.aD=this.eD(new Map)}lD(){this.sD.forEach((t=>{t.forEach((t=>t.lD())),t.clear()}))}}class vd{constructor(t){this.uD=t,this.cD=new Map}dD(t){return!!this.cD.get(t)}M(t){const e=this.cD.get(t);return e&&e.textureInfo}Kn(t){if(t instanceof P){let e=this.cD.get(t);e&&(e={textureInfo:e.textureInfo,refs:e.refs+1},this.cD.set(t,e))}else t.textureInfo&&this.cD.set(t.lut,{textureInfo:t.textureInfo,refs:1});return this}vr(t){if(!t)return this;let e=this.cD.get(t);return e&&(e={textureInfo:e.textureInfo,refs:e.refs-1},0===e.refs?(this.uD.deleteTexture(e.textureInfo.texture),this.cD.delete(t)):this.cD.set(t,e)),this}fD(){this.cD.forEach((t=>{this.uD.deleteTexture(t.textureInfo.texture)})),this.cD.clear()}gD(t){const e=this.cD.get(t);return e?e.refs:void 0}Jc(){return this.cD.size}}const bd=t=>new vd(t);class Md{constructor(t,e){this.hn=t,this.Y=e,this.pD=!0,this.mD=null,this.yD=null}}class Ad{constructor(t){this.SD=!1,this.xD=1,this.bD=t,this.vD={hn:u(0,0),Y:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),pD:!0,mD:null,yD:null},this.MD=u(64,64),this._D=new Uint8ClampedArray(this.MD.x*this.MD.y*this.xD)}AD(t,e){if(!t.pD)return null;if(t.mD&&t.yD){const i=this.AD(t.mD,e);return null!==i?i:this.AD(t.yD,e)}const i=c(t.Y.x,t.Y.y);if(t.hn.x+t.Y.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.MD.x-t.hn.x-1),t.hn.y+t.Y.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.MD.y-t.hn.y-1),t.Y.x===e.x&&t.Y.y===e.y)return t.pD=!1,t;if(i.xt.Y.y)),h?(s=new Md(Ke(t.hn,{x:0,y:1}),u(t.Y.x,e.y)),r=new Md(Ke(t.hn,{x:0,y:e.y+1}),u(t.Y.x,t.Y.y-1-e.y))):(s=new Md(Ke(t.hn,{x:1,y:0}),u(e.x,t.Y.y)),r=new Md(Ke(t.hn,{x:e.x+1,y:0}),u(t.Y.x-1-e.x,t.Y.y))),t.mD=s,t.yD=r,this.AD(t.mD,e)}wD(t,e){const i={kD:!1,hn:null};let s=this.AD(this.vD,e);if(null===s)for(;null===s&&this.MD.xthis.bD||t.y>this.bD)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.xD);for(let i=0;i{this.iD.RD(t)})),this.DD.clear(),this}ED(t,e){const i=this.PD.get(e);if(i)return i.get(t)}zD(t,e,i){let s=this.PD.get(e);if(s||(s=new Map,this.PD.set(e,s)),s.has(t.glyph))return Dd.Success;const r=this.BD.wD(i,t.size);if(!r||!r.hn)return Dd.Fail;r.kD&&this.VD();const n=this.BD.ID(r.FD);if(!n)return Dd.Fail;let o=this.DD.get(r.FD);if(!o){const t=this.iD.gl.createTexture();if(!t)throw new at("Failed to create texture for font!");o=t,this.DD.set(r.FD,t)}const h=r.hn,a=n.MD.x,l=n.MD.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=h.x/a,m=(h.y+t.size.y)/l,p=(h.x+t.size.x)/a,y=h.y/l,x=[g,m,p,m,g,y,g,y,p,m,p,y],S=[u,c,d,c,u,f,u,f,d,c,d,f],v={origin:h,size:t.size,advanceX:t.advance,baseline:t.baseline,vertices:S,texCoords:x,packerId:r.FD,texture:o};s.set(t.glyph,v);const b=this.iD.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.MD.x,n.MD.y,0,b.LUMINANCE,b.UNSIGNED_BYTE,this.iD.ND?n._D:new Uint8Array(n._D)),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.kD?Dd.Resize:Dd.Success}VD(){this.PD.forEach((t=>{t.forEach(((e,i)=>{const s=this.BD.ID(e.packerId);if(!s)return;const r=e.origin,n=s.MD.x,o=s.MD.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 Bd=t=>(e,i)=>i%2?e:e+t;class kd{constructor(t){this.GD=new Map,this.HD=ae("font"),this.WD=new Map,this.UD=new Set,this.iD=t}OD(){return this.GD.forEach((t=>t.OD())),this.UD.clear(),this}$D(t){this.UD.add(t)}YD(t){this.UD.delete(t)}XD(t,e){const i=`${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let s=this.WD.get(i);s||(s=this.HD(),this.GD.set(s,new Ed(this.iD)),this.WD.set(i,s));const r=this.GD.get(s);if(!r)throw new at("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.Kr.o=!0})),t=-1,c=0,o=0,n=0,l.clear();continue}if(a===Dd.Fail)throw new at("Failed to create glyph");if(h=r.ED(i,d),!h)throw new at("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(Bd(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=m(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 Id 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 Cd=(...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},Pd="\nfloat roundUnsigned(float number) {\n return floor(number + 0.5);\n}",Ld="\nfloat linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}",Rd="\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 ",Fd="\nvec4 pickTexel(sampler2D textureSampler, vec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (iTexel * 2.0 + 1.0) * halfTexel);\n}",_d="\n uvec4 pickTexelUnsigned(usampler2D textureSampler, vec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (iTexel * 2.0 + 1.0) * halfTexel);\n }",Od=" \nint modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}",zd="\n#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}",Vd={"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"},Nd={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 Gd{constructor(t){this.modifiers=[],this.modifiers=t}alter(t){const e=new Gd(this.modifiers.slice());return e.modifiers.push.apply(e.modifiers,t),e}build(t){for(const e of this.modifiers)t=e(t);return t}}const Ud=(...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},Hd=t=>e=>e.replace("void main(void)",`${t}\nvoid main(void)`),Wd=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),Yd=(...t)=>e=>{for(let e=0;ei=>{for(let t=0;t{if(!a.includes(e))throw new Error(`ShaderAfter misusage (not found: "${e}", match: "${t}", result: "${a}")`)})),a},Xd=(...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},$d=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Ud(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Ud(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return Xd(`\t${r} = ${s};`)(i)},jd=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e};class Zd{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new lt(`Could not find ${this.KD()} ${this.qD()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}KD(){return this.id.toString()}qD(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class Kd extends Zd{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class Jd extends Zd{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class Qd{constructor(t,e,i,s=i.createProgram()){this.JD=new Map,this.QD=new Map,this.uD=i,this.tB=s,this.iB=`${t.KD()} vertex`,this.sB=`${e.KD()} fragment`,i.attachShader(s,t.shader),i.attachShader(s,e.shader),i.bindAttribLocation(s,0,"aPos"),i.linkProgram(s),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""}eB(t){return de(0,(()=>fe()))}hB(t){const e=this.rB(t);if(void 0===e)throw this.eB(`Could not get ${t} uniform from ${this.iB} and ${this.sB} shaders.`);return e}rB(t){const e=this.JD.get(t);if(e)return e;const i=this.uD.getUniformLocation(this.tB,t);return i?(this.JD.set(t,i),i):void 0}nB(t){const e=this.oB(t);if(void 0===e)throw this.eB(`Could not get ${t} attribute from ${this.iB} and ${this.sB} shaders.`);return e}oB(t){const e=this.QD.get(t);if(e||0===e)return e;const i=this.uD.getAttribLocation(this.tB,t);return i>=0?(this.QD.set(t,i),i):void 0}G(){this.uD.deleteProgram(this.tB)}}const tf=(t,e,i)=>()=>{t.aB=e,i&&i()};class ef{constructor(t,e){if(this.lB=0,this.uB=0,this.cB=!1,this.aB=!1,this.dB=!1,this.fB=!1,this.gB=!1,this.pB=new Set,this.mB=new Set,this.FI=e,this.uD=t,this.yB=null,this.cB=e instanceof gt.HTMLVideoElement,this.FI instanceof gt.HTMLImageElement)this.FI.addEventListener("load",(()=>{this.fB=!0,this.SB()})),this.FI.addEventListener("error",(()=>{this.gB=!0})),this.FI.complete&&(this.fB=!0,this.SB());else if(this.FI instanceof gt.HTMLVideoElement){const t=this;this.FI.addEventListener("canplay",(function(){t.uB=this.videoHeight,t.lB=this.videoWidth,t.fB=!0,t.SB()}),!0),this.FI.addEventListener("play",tf(this,!0,(()=>this.SB()))),this.FI.addEventListener("playing",tf(this,!0,(()=>this.SB()))),this.FI.addEventListener("pause",tf(this,!1)),this.FI.addEventListener("ended",tf(this,!1)),this.FI.readyState>=1&&(this.lB=this.FI.videoWidth,this.uB=this.FI.videoHeight,this.aB=!this.FI.paused,this.fB=!0,this.SB())}else this.fB=!0,this.SB()}$D(t){0===this.mB.size&&this.fB&&this.SB(),this.mB.add(t)}YD(t){this.mB.delete(t),0===this.mB.size&&this.unbindResources()}xB(t){this.pB.add(t),this.dB&&(t(),this.bB(t))}bB(t){this.pB.delete(t)}SB(){if(this.gB||this.dB||!this.fB)return;const t=this.uD.gl;if(!this.yB&&this.FI&&t){this.yB=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.yB),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.FI,o=this.lB>0?this.lB:n.width,h=this.uB>0?this.uB: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.lB=o,this.uB=h,t.bindTexture(t.TEXTURE_2D,null)}this.dB=!0,this.pB&&this.pB.forEach((t=>{t(),this.bB(t)}))}Gs(){const t=this.uD.gl;if(!this.gB&&this.dB&&this.yB){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.FI;n&&(t.bindTexture(t.TEXTURE_2D,this.yB),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}vB(){return this.yB}unbindResources(){return this.dB&&(this.yB&&(this.uD.RD(this.yB),this.yB=null),this.dB=!1),this}}class sf extends Ds{constructor(t,e,i){super(t.Li,e,i),this.dm=!0,this.am={},this.lm=y(jo),this.Lr=t,this.ct=t.ct}MB(){var t;return this.lm.o&&this.lm.M().type!==(null===(t=this._B)||void 0===t?void 0:t.type)}Sm(t){return this.dm=t,this}AB(t){return this.am=t,this}}const rf=t=>[Ud("uniform float uLookupMin","uniform float uLookupMax","uniform sampler2D uLookupTexture","uniform float uLookupTextureHeightPx"),Hd(Pd),Yd(`float texCoordY = (${t} - uLookupMin) / (uLookupMax - uLookupMin)`,"texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx)","vec4 colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY))")],nf=[Ud("uniform sampler2D uMaskTexture"),Ud("varying vec2 vMaskTextureCoord"),qd("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],of=[Ud("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;"),qd("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)")],hf=t=>void 0!==t.find((t=>t.idVertex&&t.idVertex.includes("3D"))),af=t=>void 0!==t.find((t=>{var e;return null===(e=t.idVertex)||void 0===e?void 0:e.match(/lookup:[x|y|z]/)})),lf=t=>void 0!==t.find((t=>{var e;return null===(e=t.idVertex)||void 0===e?void 0:e.match(/lookup:value/)})),uf=(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(Ud("attribute vec3 aNormal"),Yd("vec3 normal = aNormal")),"linear-highPrecision"!==n)i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&(!0!==c?s.push(Yd(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(Yd(`${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(Yd(`${r} ${t.variableNameAxisCoord}_highpart = ${t.attributeNameAxisCoord}_highpart`),Yd(`${r} ${t.variableNameAxisCoord}_lowpart = ${t.attributeNameAxisCoord}_lowpart`))}))}if(a&&a.rotation){const t=a.rotation.dataType,e=("uniform"===t?"u":"a")+"Rot";s.push(Ud(`${t} vec2 ${e}`));const i="aInstanceGeo";s.push(Yd(`vec2 rotatedGeo = vec2(${i}.x * ${e}.y + ${i}.y * ${e}.x, ${i}.y * ${e}.y - ${i}.x * ${e}.x)`))}if(a&&s.push(Ud(`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(Ud(`${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(Ud(`${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(Ud(`${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(Ud(`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(Ud(`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(Ud("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(Ud(`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(${pi(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(Ud(...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(Ud("uniform vec2 uRatioPxClip"));const t=("attribute"===a.dataType?"a":"u")+"OffsetPixels",e=!0===a.symmetric?"float":r;s.push(Ud(`${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(Ud(`${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(Ud("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(Ud(`${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(Ud("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(((t,...e)=>i=>{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})("gl_Position =",...f)),s},cf=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(qd(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(qd(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(qd(i,...t))}}return r},df={"2D":{idFeature:"2D",idVertex:"2D",idFragment:"2D",apply:t=>({defaultVertexShader:"2D",defaultFragmentShader:"FragmentShader"})},"3D":{idFeature:"3D",idVertex:"3D",idFragment:"3D",apply:t=>({defaultVertexShader:"3D",defaultFragmentShader:"FragmentShader"})},PointSize:t=>({idFeature:"PointSize",idVertex:`SizePrimitive:${Cd(t)}`,idFragment:void 0,apply:e=>{const i="uniform"===t?"u":"a";return{vertexShaderModifiers:[Ud(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Xd(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTexture;let r,n=`Color:${Cd(t)}`;const o=[],h=[];if("uniform"===i)h.push(Ud("uniform vec4 uColor"),Yd("vec4 colorFragment = uColor"),...s?nf:[]);else if("attribute"===i)r="colorAttribute",o.push($d("attribute vec4 aColor","varying vec4 vColor")),h.push(Ud("varying vec4 vColor"),Yd("vec4 colorFragment = vColor"));else if("texture"===i)r="colorTexCoord",o.push($d("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),h.push(Ud("varying vec2 vTextureCoord"),Ud("uniform sampler2D uColorTexture"),Ud("uniform vec4 uColor"),Yd("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])r="colorTexCoord",o.push($d("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1]===e.ImageFitMode.Tile?h.push(Ud("uniform sampler2D uColorTexture"),Ud("varying vec2 vTextureCoord"),Yd("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);")):h.push(Ud("uniform sampler2D uColorTexture"),Ud("varying vec2 vTextureCoord"),Ud("uniform vec4 uColor"),Yd("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)r="lookup:value",o.push($d("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,o.push($d(e,"varying float vLookupValue"))}h.push(Ud("varying float vLookupValue"),...rf("vLookupValue"))}else if(Array.isArray(i)&&"gradient"===i[0]){n=`Color:${Cd(t)}`;const e=i[1],r=e.getColorStops();e instanceof $?h.push(Ud("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Ud(...wt(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Hd(Ld),Yd("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?nf:[]):e instanceof Z&&(n=`Color:${Cd(t)}`,h.push(Ud("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Ud(...wt(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Hd(Ld),Yd("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?nf:[]))}if(!0===s){const t="maskTexture";r=r?`${r} ${t}`:`Color:${t}`,o.push($d("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return{idFeature:"Color",idVertex:r,idFragment:n,apply:t=>({vertexShaderModifiers:o,fragmentShader:"FragmentShader",fragmentShaderModifiers:h})}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let r;const n=`ColorShaded3D:${Cd(t)}`,o=[],h=[];if(o.push("phong"===i&&$d("normal","varying vec3 vNormal"),$d("posWorld","varying vec3 vPosWorld")),"uniform"===e)h.push(Ud("uniform vec4 uColorDiffuse"),Yd("vec4 colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",o.push($d("attribute vec4 aColor","varying vec4 vColor")),h.push(Ud("varying vec4 vColor"),Yd("vec4 colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",o.push($d("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,o.push($d(e,"varying float vLookupValue"))}h.push(Ud("varying float vLookupValue"),Ud("uniform float uLookupMin"),Ud("uniform float uLookupMax"),Ud("uniform float uLookupTextureHeightPx"),Ud("uniform sampler2D uLookupTexture"),Hd(Pd),Yd("float texCoordY = (vLookupValue - uLookupMin) / (uLookupMax - uLookupMin)","texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx)","vec4 colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY))"))}if(s){const t="wireframe";r=r?`${r},${t}`:t,o.push($d("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),h.push(Ud("varying vec3 vTriangleBary"),Ud("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Hd(zd),qd("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&h.push(...of),{idFeature:"ColorShaded3D",idVertex:r,idFragment:n,apply:t=>({fragmentShader:"FragmentShader",vertexShaderModifiers:o,fragmentShaderModifiers:h})}},VertexLocation:t=>({idFeature:"VertexLocation",idVertex:`VertexLocation:${Cd(t)}`,idFragment:void 0,apply:e=>{const i=[],s=hf(e),r=s?"vec3":"vec2";if("linear-highPrecision"!==t.axisWorldTranslation)!0!==t.splitPosAttribute?i.push(Ud(`attribute ${r} aPos`)):i.push(Ud("attribute float aPosX"),Ud("attribute float aPosY"),s&&Ud("attribute float aPosZ"));else{if(!0===t.splitPosAttribute)throw new Error("splitPosAttribute: true not supported with axisWorldTranslation: linear-highPrecision");i.push(Ud(`attribute ${r} aPos_highpart`),Ud(`attribute ${r} aPos_lowpart`))}return i.push(...uf(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),{vertexShaderModifiers:i}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",idVertex:`LineInstanced2D:${Cd(t)}`,idFragment:void 0,apply:e=>({vertexShaderModifiers:[Ud("uniform float uThicknessPixels"),Ud("uniform vec2 uRatioPxClip"),"linear-highPrecision"!==t.axisWorldTranslation&&Ud("attribute vec2 aLocationA"),"linear-highPrecision"!==t.axisWorldTranslation&&Ud("attribute vec2 aLocationB"),"linear-highPrecision"===t.axisWorldTranslation&&Ud("attribute vec2 aLocationA_highpart"),"linear-highPrecision"===t.axisWorldTranslation&&Ud("attribute vec2 aLocationB_highpart"),"linear-highPrecision"===t.axisWorldTranslation&&Ud("attribute vec2 aLocationA_lowpart"),"linear-highPrecision"===t.axisWorldTranslation&&Ud("attribute vec2 aLocationB_lowpart"),Ud("attribute vec2 aSegmentPosition"),Ud("attribute float aSegmentSide"),...uf(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),qd("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"),...lf(e)?[Wd("attribute float aLookupValue"),Wd("vLookupValue = aLookupValue"),Ud("attribute float aLookupValueA"),Ud("attribute float aLookupValueB"),Xd("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],...af(e)?cf(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",idVertex:`LineInstanced3D:${Cd(t)}`,idFragment:void 0,apply:e=>({defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Ud("uniform float uOffsetWU"),Ud("attribute vec3 aLocationA"),Ud("attribute vec3 aLocationB"),Ud("attribute float aSegmentPosition"),Ud("attribute float aPerpendHorizontal"),Ud("attribute float aPerpendVertical"),...uf({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},hf(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),qd("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"),...af(e)?cf({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",idVertex:"RoundedEdges3D",idFragment:void 0,apply:t=>({vertexShaderModifiers:[Ud("attribute vec3 aEdge"),Ud("uniform float uEdgeRoundness"),qd("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",idVertex:void 0,idFragment:`ColorGrid2D:${Cd(t)}`,apply:r=>({fragmentShader:"FragmentShader",fragmentShaderModifiers:[Ud("uniform sampler2D uLookupTexture","uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues","uniform float uLookupMax","uniform float uLookupMin","uniform float uLookupTextureHeightPx",Pd,"ubyte"===i&&Rd),"bilinear"===t.interpolation?Yd("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"})`,"float texCoordY = (intensityP - uLookupMin) / (uLookupMax - uLookupMin)","texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx)","vec4 colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY))"):Yd("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 intensity = "+("float"===i?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${s})`),"float texCoordY = (intensity - uLookupMin) / (uLookupMax - uLookupMin)","texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx)","vec4 colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY))")]})}},DrawToNormalTexture:t=>{const e=t.flipXZ,i=t.vertexIdSource,s=t.normalTextureType,r=t.heightmapTextureType,n=t.littleEndian;return{idFeature:"DrawToNormalTexture",idVertex:`DrawToNormalTexture:${Cd(t)}`,idFragment:`DrawToNormalTexture:${Cd(t)}`,apply:t=>{const o=[],h=[];return o.push(Ud("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",Pd,Od,Fd,"ubyte"===r&&Rd),Yd(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?"pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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?"pickTexel(uHeightmapTexture, vec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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?"pickTexel(uHeightmapTexture, vec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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?"pickTexel(uHeightmapTexture, vec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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")),h.push(Ud("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),Yd("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{vertexShaderModifiers:o,fragmentShaderModifiers:h,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",idVertex:`SurfaceGrid:${Cd(t)}`,idFragment:`SurfaceGrid:${Cd(t)}`,apply:c=>{const d=[],f=[];return d.push(Ud("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",Pd,Od,Fd,"ubyte"===a&&Rd),Yd(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?"pickTexel(uHeightmapTexture, vec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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)")),d.push(...uf({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&d.push($d("posWorld","varying vec3 vPosWorld"),..."uint"===h?[Hd(_d),Xd("vec4 normalAxisRGB = vec4(pickTexelUnsigned(uNormalmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Xd("vec4 normalAxisRGB = pickTexel(uNormalmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Xd("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),Ud("varying vec3 vNormal",..."uint"===h?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),f.push(Ud("varying vec3 vTriangleBary")),"uniform"===e?f.push(Ud("uniform vec4 uColorDiffuse"),Yd("vec4 colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]?"value"===e[1]?(d.push($d("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),f.push(Ud("uniform sampler2D uLookupTexture","uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform float uLookupMax","uniform float uLookupMin","uniform float uLookupTextureHeightPx","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp",Pd,"ubyte"===l&&Rd),"bilinear"===i?Yd("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"})`,"float texCoordY = (intensityP - uLookupMin) / (uLookupMax - uLookupMin)","texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx)","vec4 colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY))"):Yd("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 intensity = sample0.x","float texCoordY = (intensity - uLookupMin) / (uLookupMax - uLookupMin)","texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx)","vec4 colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY))"))):(d.push($d(`posAxis.${e[1]}`,"varying float vLookupValue")),f.push(Ud("varying float vLookupValue"),...rf("vLookupValue"))):void 0===e&&f.push(Yd("vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0)")),"phong"===r&&f.push(...of),n&&(d.push(Ud("attribute vec3 aTriangleBary"),$d("aTriangleBary","varying vec3 vTriangleBary")),f.push(Ud("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Hd(zd),qd("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 }"))),{vertexShaderModifiers:d,fragmentShader:"FragmentShader",fragmentShaderModifiers:f}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",idVertex:`DebugSurfaceGridNormals:${Cd(t)}`,idFragment:`DebugSurfaceGridNormals:${Cd(t)}`,apply:e=>({vertexShaderModifiers:[Ud("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",Pd,Od,Fd,"ubyte"===t.heightmapTextureType&&Rd,..."uint"===t.normalTextureType?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"]),Yd(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?"pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y01 = "+("float"===t.heightmapTextureType?"pickTexel(uHeightmapTexture, vec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y10 = "+("float"===t.heightmapTextureType?"pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y11 = "+("float"===t.heightmapTextureType?"pickTexel(uHeightmapTexture, vec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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(pickTexelUnsigned(uNormalmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)"]:["vec4 normalAxisRGB = pickTexel(uNormalmapTexture, vec2(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?[Hd(_d)]:[],...uf({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),qd("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:[Xd("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",idVertex:"OffsetTowardsCamera",idFragment:void 0,apply:t=>({vertexShaderModifiers:[Ud("uniform vec3 uCameraLoc"),qd("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:()=>({idFeature:"AliasedEdge",idVertex:"AliasedEdge",idFragment:"AliasedEdge",apply:t=>({vertexShaderModifiers:[Ud("attribute float aSegmentInside"),Ud("varying float vSegmentInside"),Ud("varying float vSegmentSide"),qd("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[jd("#extension GL_OES_standard_derivatives : enable"),Ud("uniform float uAALimit"),Ud("varying float vSegmentInside"),Ud("varying float vSegmentSide"),qd("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",idVertex:`Glow1D:${Cd(t)}`,idFragment:`Glow1D:${Cd(t)}`,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{vertexShaderModifiers:[$d("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Ud("uniform sampler2D uTexture"),Ud("varying vec2 vTextureCoord"),Ud("uniform vec2 uTextureSize"),r&&Ud("uniform vec2 uOffsetPx"),!r&&Ud("uniform sampler2D uTextureFirstGlowPass"),!r&&Ud("uniform vec4 uGlowColor"),qd("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"])]}}})};class ff{constructor(t){this.KB=[],this.iD=t}qB(t,e){((t,e,i,s)=>{const r=t.ZD(),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.wB(),l=t.kB(),u=t.CB(),c=t.TB(),d=t.IB();t.FB("disabled"),t.Sm(!1),t.PB(!1);const f=e.DB();((t,e,i)=>{const s=t.gl,r=t.ZD();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.BB(0,0,n.x,n.y),e.forEach((e=>{let i;e instanceof Es?i=e.Lr.Qg():e instanceof sf&&(i=e.Lr.Hy()),i?t.LB(i.x*r,i.y*r,i.width*r,i.height*r):t.PB(!1),e.tD(2)})),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindRenderbuffer(s.RENDERBUFFER,null),s.bindTexture(s.TEXTURE_2D,null),t.PB(!1)})(t,s,f);let g=f;const m=n+o+5,p=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;iEe(r,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),r=Ne(r,s))}while(s);e.push(r)}return e})(e.map((t=>{const e=t instanceof Es||t instanceof sf?t.Lr.OB(t):we;if(ge(e))return we;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?we:r})).filter((t=>!ge(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=ti(t.min,s),i=ti(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.RB(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.EB()),y=e.DB(f,g),x=t.zB(df["2D"],df.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),df.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.BB(0,0,i.sizeDpr.x,i.sizeDpr.y),t.VB(s,((h,a,l,u)=>(t.$D(s),n&&n(h),t.WB(h("uIsHighlighted"),0).UB(h("uHighlightColorOffset"),E).WB(h("uRenderEffectMask"),0).HB(h("uTexture"),e.texture,0).GB(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).GB(h("uScale"),i.uniforms.$B()).GB(h("uDisp"),i.uniforms.YB()).GB(h("uScaling"),[i.size.x,i.size.y]).GB(h("uTranslationAxis"),[0,0]).NB(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).Op(o.TRIANGLES,r.vertexCount,0),!0))),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,g,y,x,p,((e,i,s,r)=>(t.GB(e("uOffsetPx"),[h.x,h.y]),!0))),g=y,t.PB(l),t.XB(d);const S=t.zB(df["2D"],df.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),df.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.Li.Et().x,y:t.Li.Et().y};t.BB(0,0,o.x*t.ZD(),o.y*t.ZD());const h=st.d2({scaleXYConstructor:Ti}).q(o).fi(0,o.x).gi(0,o.y),a=new pf;a.jB(h),t.VB(i,((h,l,u,c)=>(t.$D(i),r&&r(h),t.WB(h("uIsHighlighted"),0).UB(h("uHighlightColorOffset"),E).WB(h("uRenderEffectMask"),0).HB(h("uTexture"),e.texture,0).GB(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).GB(h("uScale"),a.$B()).GB(h("uDisp"),a.YB()).GB(h("uScaling"),[o.x,o.y]).GB(h("uTranslationAxis"),[0,0]).NB(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).Op(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,S,p,((e,s,r,n)=>(t.HB(e("uTextureFirstGlowPass"),y.texture,1).UB(e("uGlowColor"),i.color),!0))),t.BB(a.x,a.y,a.width,a.height),t.FB(u),t.Sm(c),t.ZB(p.vertexBuffer)})(this.iD,this,e,t)}EB(){const t=this.iD.Li.Et();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}DB(...t){const e=this.KB,i=this.EB(),s={x:Math.ceil(i.x*this.iD.ZD()),y:Math.ceil(i.y*this.iD.ZD())},r=this.iD.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).fi(0,i.x).gi(0,i.y),n.uniforms.jB(n.scale)),n;const o=r.createTexture(),h=this.iD.JB(),a=this.iD.QB();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=st.d2({scaleXYConstructor:Ti}).q(i).fi(0,i.x).gi(0,i.y),u=new pf;u.jB(l);const c={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:l,uniforms:u};return e.push(c),c}G(){[this.KB].forEach((t=>{t.forEach((t=>{this.iD.tL(t.depthBuffer),this.iD.iL(t.frameBuffer),this.iD.RD(t.texture)})),t.length=0}))}}class gf{constructor(t,i,s,r,n=!0){this.sL=new Sd,this.eL=new Map,this.hL=new Map,this.rL=[],this.nL=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(gt.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.dm=!1,this.GB=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.oL=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.aL=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.lL=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.uL=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.cL=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.UB=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.WB=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.dL=(t,e)=>(this.gl.uniform1i(t,e),this),this.HB=(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 at("Could not bind a texture.")},this.fL=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.RB=(t,e=!1)=>{const i=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,i),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),i)return i;throw new at("Could not create vertex buffer")},this.gL=(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 at("Could not create vertex buffer")},this.pL=(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.mL=(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.yL=t=>{const e=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,e),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),e)return e;throw new at("Could not create vertex buffer")},this.SL=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 at("Could not create float buffer")},this.xL=(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.bL=(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.NB=(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.vL(s,e)}return this},this.ML=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this._L=(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.AL=(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.wL=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.Op=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.kL=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.CL=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.TL.ANGLE_instanced_arrays)return gt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.TL.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.IL=(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.TL.ANGLE_instanced_arrays)return gt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.TL.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.vL=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.TL.ANGLE_instanced_arrays)return gt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.TL.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.FL=(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.kB();n&&this.PB(!1),t(),n&&this.PB(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null)},this.PL=(t,e,i)=>{const s=gt.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.qn=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.clear(this.gl.DEPTH_BUFFER_BIT),this),this.DL=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.$D=t=>(this.gl.useProgram(t.tB),this),this.BL=!1,this.LL=[],this.Li=t,this.ef=i,this.Li=t,this.gl=s.ctx,this.OL=s.antialias,this.RL=s.lineAntialias,n&&(this.XB(!0),this.EL());const o=[];if(this.TL={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.TL).forEach((t=>{null===this.TL[t]&&o.push(t)})),"webgl2"===s.type)this.gl2={ctx:s.ctx},this.zL=!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.RL=!1),Object.keys(t).forEach((e=>{null===t[e]&&o.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.zL=!!e.OES_texture_float,this.gl1={ctx:s.ctx,TL:t,optional:e}}this.rL=o,this.LD=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.ND=this.VL(),this.zB=(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,m,p,y,x;try{const t=gt.performance.now();l=h.filter((t=>!1!==t&&void 0!==t)),u=(t=>{const e=t.map((t=>t.idVertex)).filter((t=>void 0!==t)).sort().join(" "),i=t.map((t=>t.idFragment)).filter((t=>void 0!==t)).sort().join(" ");return{vertexShaderID:e,fragmentShaderID:i,programID:`vert: ${e} frag: ${i}`}})(l);const S=r.get(u.programID);if(d="new",S)return d="existing",m=S.vertexShaderSrc,p=S.fragmentShaderSrc,S;c=((t,e,i)=>{const{programID:s,vertexShaderID:r,fragmentShaderID:n}=e;let o,h=!1,a=!1;const l=[];let u;const c=[],d=[];if(t.forEach((e=>{const r=e.apply(t,i);if(r.defaultVertexShader&&(h||(o=r.defaultVertexShader)),r.vertexShader){if(o&&h&&o!==r.vertexShader)throw new Id(`Conflicting vertex shader templates ${o} vs ${r.vertexShader}`,s,e);o=r.vertexShader,h=!0}if(r.vertexShaderModifiers)for(const t of r.vertexShaderModifiers)"function"==typeof t&&l.push(t);if(r.defaultFragmentShader&&(a||(u=r.defaultFragmentShader)),r.fragmentShader){if(u&&a&&u!==r.fragmentShader)throw new Id(`Conflicting fragment shader templates ${u} vs ${r.fragmentShader}`,s,e);u=r.fragmentShader,a=!0}if(r.fragmentShaderModifiers)for(const t of r.fragmentShaderModifiers)"function"==typeof t&&c.push(t);r.hints&&r.hints.forEach((t=>{t&&d.push(t)}))})),!o)throw new Id("No vertex shader template defined",s);if(!u)throw new Id("Fragment shader not defined",s);return{id:s,vertexShader:{id:r,template:o,modifiers:l},fragmentShader:{id:n,template:u,modifiers:c},hints:d}})(l,u,a);const v=u.vertexShaderID;let b=i.get(v);if(b)m=b.src,f="existing";else{f="new";const t=new Gd(c.vertexShader.modifiers).build(Vd[c.vertexShader.template]),{source:s,info:r}=o(t,"vertex");m=s,y=r,b=new Kd(v,s,e,r),i.set(v,b),n.vertexShaders+=1}const M=c.fragmentShader;let A;const w=M.id;if(A=s.get(w),A)p=A.src,g="existing";else{g="new";const t=Nd[M.template],i=new Gd([...M.modifiers]).build(t),{source:r,info:h}=o(i,"fragment",c.hints);p=r,x=h,A=new Jd(w,r,e,h),s.set(w,A),n.fragmentShaders+=1}const D=new Qd(b,A,e);return r.set(u.programID,D),n.programs+=1,n.totalMs+=gt.performance.now()-t,D}catch(t){throw de(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 gt.alert(t),new Error(t)}))}}})(this),this.NL=bd(this.gl),this.GL=new xf(this),this.jD=(t=>{const e=gt.document.createElement("canvas"),i=e.getContext("2d",{willReadFrequently:!0});if(!i)throw new at("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,m=0;const p=f.width;for(let t=0;t=0;t-=1){for(let e=0;e=t)return this.eO.buffer;this.eO&&(this.ZB(this.eO.buffer),this.eO=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.LL.splice(this.LL.indexOf(l),1)}))}lO(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)}}const mf=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 gt.setTimeout(o,r)};gt.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 pf{jB(t){if(t instanceof Ti||t instanceof Ga){const e=t.jt();this.uO=e.x.scaling,this.cO=-e.x.displacement,this.dO=e.y.scaling,this.fO=-e.y.displacement,this.gO=e.x.highPrecisionOffset,this.pO=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.mO=e.y.highPrecisionOffset,this.yO=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof Ei&&(this.MixedScaleXY=t.jt());return this}YB(){return[this.cO,this.fO]}$B(){return[this.uO,this.dO]}SO(){return[this.gO,this.mO]}xO(){return[this.pO,this.yO]}}class yf{constructor(){this.uO=0,this.dO=0,this.bO=0,this.cO=0,this.fO=0,this.vO=0}MO(t){return this.uO=t.st(),this.cO=t.getInnerStart()+.5*this.uO*t.et(),this}_O(t){return this.dO=t.st(),this.fO=t.getInnerStart()+.5*this.dO*t.et(),this}AO(t){return this.bO=t.st(),this.vO=t.getInnerStart()+.5*this.bO*t.et(),this}$B(){return[this.uO,this.dO,this.bO]}YB(){return[this.cO,this.fO,this.vO]}wO(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=yd.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class xf{constructor(t){this.iD=t}tD(t,e,i,s,r,n=0){const o=this.iD,h=void 0===s;if(!(s=s||o.JB()))throw new at("Could not bind a framebuffer.");const a=o.wB(),l=o.IB();o.XB(!1),o.FL((()=>{o.BB(0,0,i.x,i.y),t()}),s,e,n),h&&o.iL(s),this.iD.DL(r),this.iD.BB(a.x,a.y,a.width,a.height),o.XB(l)}}class Sf{constructor(t,e){this.kO=[],this.CO=[],this.uniform=t=>{const e=this.shader.hB(t);return this.CO.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.rB(t);return this.CO.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.nB(t);return this.kO.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.kO)this.glUtils.ML(t.location),this.glUtils.vL(t.location,0)}}class vf extends Es{constructor(t,e,i,s,r){super(t,e,i,s),this.TO=new Map,this.IO=t,this.FO=e,this.iD=t.PO(),this.DO=r,this.FO=e}OD(){return this}tD(t){if(!this.DO||0!==t||0===this.TO.size)return this;const e=Array.from(this.TO.values()).map((t=>t.BO.filter((t=>t.LO)).map((t=>t.de)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===e.length)return this;const i=this.DO;return this.iD.HL.qB(e,i),this}Gs(){return this}yt(){return 0}ft(){return 0}xt(){return 0}St(){return 0}co(){return 0}do(){return 0}su(t,e){const i={BO:[]},s=(t,e)=>{const s={de:t||[],LO:void 0===e||e};i.BO.push(s);const r={nc:t=>(s.de=t,r),vs:t=>(s.LO=t,r),_s:()=>s.LO};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={lg:s,...r};this.TO.set(t,i);const o=t.onDispose((()=>{this.TO.delete(t),t.offDispose(o)}));return n}}const bf=t=>{if(t instanceof Ti||t instanceof Ga)return t.Qt()?"linear-highPrecision":"linear";if(t instanceof Ei){const e={};return t.x instanceof gi&&(e.x={base:t.x.$t()}),t.y instanceof gi&&(e.y={base:t.y.$t()}),["logarithmic",e]}return"linear"};function Mf(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,m=d*s.y,p=c-g,y=d-m,x=g>p?[p,g]:[g,p],S=m>y?[y,m]:[m,y];let v,b,M=1,A=1;switch(r){default:case e.GradientExtent.closestSide:if(v=x[0]/c,b=S[0]/d,n===e.GradientShape.circle){const t=Math.min(v*f,b);M=t,A=t}else M=v*f,A=b;break;case e.GradientExtent.farthestSide:if(v=x[1]/c,b=S[1]/d,n===e.GradientShape.circle){const t=Math.max(v*f,b);M=t,A=t}else M=v*f,A=b;break;case e.GradientExtent.closestCorner:if(b=S[0]/d,n===e.GradientShape.circle){v=x[0]/c*f;const t=Math.sqrt(v*v+b*b);M=t,A=t}else{v=x[0]/c;const t=Math.sqrt(v*v+b*b);M=t*f,A=t}break;case e.GradientExtent.farthestCorner:if(b=S[1]/d,n===e.GradientShape.circle){v=x[1]/c*f;const t=Math.sqrt(v*v+b*b);M=t,A=t}else{v=x[1]/c;const t=Math.sqrt(v*v+b*b);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 Af(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 wf=(t,e,i)=>((t,e,i,s)=>{const r=[];let n=0;const o=Ze(e,i/2);let h,a,l,c,d=t[t.length-1],f=0;for(let i=0;i0&&(d=t[i-1]),mt(h,d)&&(d=Ke(h,Xe(Ze(Je(a,h),-1)))),mt(h,a)&&(a=Ke(h,Xe(Ze(Je(d,h),-1))));const s=ti(d,e),g=ti(h,e),m=ti(a,e),p=Xe(Je(g,s)),y=Xe(Je(m,g)),x=Ke(p,y),S=u(-x.y,x.x),v=u(-p.y,p.x),b=1/ii(S,v),M=je(S),A=Xe(Je(p,y)),w=Math.sign(ii(S,A))||1,D=Qe(S,Ze(o,b)),T=Qe(S,Ze(o,-b));if(M<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(-y.y,y.x),c=Math.sign(ii(p,S))||w,g=Qe(v,Ze(o,c)),m=Qe(l,Ze(o,c));1===w?(t=g,e=T,i=m,s=T):(t=D,e=g,i=D,s=m);const x=4*Le(d,h),M=4*Le(h,a);(b>x||b>M)&&(1===w?(t=g,e=m,i=m,s=g):(t=m,e=g,i=g,s=m));const A=Ke(h,t),E=Ke(h,e),B=Ke(h,i),k=Ke(h,s);r[n]=A,n+=1,r[n]=E,n+=1,r[n]=B,n+=1,r[n]=k,n+=1,f=4}else{const t=Ke(h,D),e=Ke(h,T);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 Df extends Hs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.OO=we,this.RO=we,this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO()}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?al(this.qr.M(),this.Bo.M(),this.hi.M(),this.Lo.M()*l/100,this.Oo.M()*l/100,a)[0]:[this.qr.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.zo=u(t,e)}else{const t=Math.floor(d/2);this.zo=u(h[t].x,h[t].y)}this.Vo=h[1];const f=h.length-1;this.No=h[f],this.Ro.M()&&(h.shift(),c.shift());let g=!1;(this.qr.o||this.Bo.o||this.hi.o||this.Lo.o||this.Oo.o||this.Ro.o||this.Eo.o||s)&&(this.RO=m(u(this.xn().x-n,this.xn().y-o),u(this.xn().x+n,this.xn().y+o)),g=!0,this.qr.o=!1,this.Bo.o=!1,this.hi.o=!1,this.Lo.o=!1,this.Oo.o=!1,this.Ro.o=!1,this.Eo.o=!1);const p=this.Nr();(g||p)&&this.Vr!==F&&(this.Ro.M()?(this.GO&&this.iD.gl.deleteBuffer(this.GO),[this.HO,this.GO,this.WO,this.UO]=this.VO(h,c)):(this.GO&&this.iD.gl.deleteBuffer(this.GO),[this.HO,this.GO,this.WO,this.UO]=this.VO(h,void 0)),this.Vr instanceof $?this.$O=Mf(this.RO,this.ct,this.Vr.getPosition(),this.Vr.getExtent(),this.Vr.getShape(),this.iD.ZD()):this.Vr instanceof Z?this.YO=Af(this.RO,this.ct,this.Vr.getAngle(!0),this.iD.ZD()):(this.$O=void 0,this.YO=void 0));const y=this.Vr instanceof z&&this.Vr,x=this.Vr instanceof Z&&this.Vr,S=this.Vr instanceof $&&this.Vr,v=y||x||S;p&&(this.XO=v?this.iD.zB(df["2D"],df.Color({dataType:this.Vr instanceof $||this.Vr instanceof Z?["gradient",this.Vr]:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.Ur(this.Vr));const b=this.$r;if(b instanceof tt&&(g||this.jr(b.getThickness())||s)){this.Ro.M()?360===i?(h.pop(),c.pop(),[this.jO,this.ZO]=this.NO(h,void 0,b.getThickness(),r),this.KO&&this.jO?this.iD.mL(this.KO,this.jO,!0):!this.KO&&this.jO?this.KO=this.iD.RB(this.jO,!0):this.KO&&!this.jO&&(this.iD.ZB(this.KO),this.KO=void 0),[this.qO,this.JO]=this.NO(c,void 0,b.getThickness(),r),this.QO&&this.qO?this.iD.mL(this.QO,this.qO,!0):!this.QO&&this.qO?this.QO=this.iD.RB(this.qO,!0):this.QO&&!this.qO&&(this.iD.ZB(this.QO),this.QO=void 0)):([this.jO,this.ZO]=this.NO(h,c,b.getThickness(),r),this.KO&&this.jO?this.iD.mL(this.KO,this.jO,!0):!this.KO&&this.jO?this.KO=this.iD.RB(this.jO,!0):this.KO&&!this.jO&&(this.iD.ZB(this.KO),this.KO=void 0),this.qO&&(this.QO&&this.iD.gl.deleteBuffer(this.QO),this.QO=void 0,this.JO=0)):(360===i&&(h.shift(),h.pop()),[this.jO,this.ZO]=this.NO(h,void 0,b.getThickness(),r),this.KO&&this.jO?this.iD.mL(this.KO,this.jO,!0):!this.KO&&this.jO?this.KO=this.iD.RB(this.jO,!0):this.KO&&!this.jO&&(this.iD.ZB(this.KO),this.KO=void 0));const t=b.getFillStyle();t instanceof $?this.tR=Mf(this.RO,this.ct,t.getPosition(),t.getExtent(),t.getShape(),this.iD.ZD()):t instanceof Z?this.iR=Af(this.RO,this.ct,t.getAngle(!0),this.iD.ZD()):(this.tR=void 0,this.iR=void 0),this.sR=t===F?void 0:this.iD.zB(df["2D"],df.Color({dataType:t instanceof $||t instanceof Z?["gradient",t]:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})),this.Zr(b)}if(g){let t=1,e=1;b instanceof tt&&(t=b.getThickness()*r.x,e=b.getThickness()*r.y),this.OO=m(u(this.RO.min.x-t,this.RO.min.y-e),u(this.RO.max.x+t,this.RO.max.y+e))}this.eR=e&&v?this.eR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.hR=e&&this.$r!==J?this.hR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0}return this}tD(t){if(this.Wr()){const e=1===t?this.eR:this.XO,i=this.Vr,s=this.GO;e&&s&&this.iD.$D(e).VB(e,((e,r,n,o)=>{if(this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).GB(o("uScaleStart_highpart"),this.JD.SO()).GB(o("uScaleStart_lowpart"),this.JD.xO()).tO(n,s,this.ct.Qt(),void 0).WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0),1===t)this.iD.UB(e("uColor"),this.zO);else if(i instanceof z)this.iD.UB(e("uColor"),i.getColor());else if(i instanceof $){if(!this.$O)return!1;this.iD.KL(n,this.$O,i)}else if(i instanceof Z){if(!this.YO)return!1;this.iD.qL(n,this.YO,i)}return this.iD.Op(this.UO,this.WO),!0}));const r=this.$r;r instanceof tt&&(void 0!==this.KO&&this.rR(t,this.KO,this.ZO,r),void 0!==this.QO&&this.rR(t,this.QO,this.JO,r))}return this}rR(t,e,i,s){const r=1===t?this.hR:this.sR,n=s.getFillStyle();r&&this.iD.$D(r).VB(r,((r,o,h,a)=>{if(this.iD.GB(r("uScale"),this.JD.$B()).GB(r("uDisp"),this.JD.YB()).tO(h,e,this.ct.Qt(),void 0).WB(r("uIsHighlighted"),1===t||2===t?0:this.br).UB(r("uHighlightColorOffset"),this.Ar).WB(r("uRenderEffectMask"),2===t?1:0),1===t)this.iD.UB(r("uColor"),this.zO);else if(n instanceof z)this.iD.UB(r("uColor"),n.getColor());else if(n instanceof $){if(!this.tR)return!1;this.iD.KL(h,this.tR,n)}else if(n instanceof Z){if(!this.iR)return!1;this.iD.qL(h,this.iR,n)}const l=s.getThickness(),u=-1===l||1===l;return this.iD.Op(u?this.iD.gl.LINE_LOOP:this.iD.gl.TRIANGLE_STRIP,i),!0}))}OD(){return this.nR&&(this.iD.ZB(this.nR),this.nR=void 0),this.oR&&(this.iD.ZB(this.oR),this.oR=void 0),this.GO&&(this.iD.ZB(this.GO),this.GO=void 0),this.KO&&(this.iD.ZB(this.KO),this.KO=void 0),this.QO&&(this.iD.ZB(this.QO),this.QO=void 0),this.XO=void 0,this.sR=void 0,this.eR=void 0,this.hR=void 0,this}yt(){return this.RO.max.x}ft(){return this.RO.min.x}xt(){return this.RO.max.y}St(){return this.RO.min.y}co(){return Se(this.$r)}do(){return Se(this.$r)}}class Tf{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}aR(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}lR(){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}uR(){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}cR(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.lR(),this}dR(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.uR(),this}fR(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new Tf).aR(t))(),Bf=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||Ef.lR(),n.push(t,e),r.push(Ef.first,Ef.second,Ef.third),h=void 0,o=void 0,r.push(Ef.third,Ef.fourth,Ef.second),a=Ef.third,Ef.uR(),l&&n.push(i,s),[o,h,a]),kf=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||Ef.lR(),o.push(t,e),r.push(Ef.first,Ef.second,Ef.third);const c=ui(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(Ef.third,Ef.fourth,Ef.fifth),l=Ef.fourth),Ef.uR(),u&&o.push(i,s),[h,a,l]},If=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||Ef.lR(),r.push(t,e),s.push(Ef.first,Ef.second,Ef.third),n=i,o=void 0,h=Ef.third,l?r.push(i):a=!0,[n,o,h,a]),Cf=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||Ef.lR(),Ef.lR()):a>0&&(Ef.lR(),u>0&&(u-=1)),n.push(t),r.push(Ef.first,Ef.second,Ef.third),a=Ef.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),Pf=(t,e=0)=>{Ef.aR(e);const[i,s]=t,r=i.length,n=[],o=[],h=[];let a,l,u=e,c=0,d=i[c],f=s[c],g=i[c],m=s[c],p=!1,y=u>0?g.y!==m.y?2:1:0;if(r>1)for(;cm.y?d.y>f.y?[a,l,u]=Bf(g,m,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=kf(g,m,d,f,o,n,h,a,l,u,t):[a,l,u,p]=If(g,m,d,o,h,a,l,u,p,t):d.y===f.y?(a=g,p&&(h.push(g),p=!1,Ef.lR()),0===h.length&&u>0&&y>0&&(y-=1)):d.y>f.y?[a,l,u,y]=Cf(g,0,d,f,n,h,a,l,u,t,y):[a,l,u,y]=Cf(g,0,d,f,o,h,a,l,u,t,y)}return[h,new Uint16Array(n),new Uint16Array(o),u,y]};class Lf extends Us{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.pR=0,this.Pn=Array(),this.mR=0,this.yR=new Uint16Array(0),this.SR=new Uint16Array(0),this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO()}Gs(){const t=this.Hr(),e=this.pr.M(),i=this.Hn;if(this.Wr()){this.JD.jB(this.ct);const s=this.ct instanceof Ei==0,r=s?this.ct.yi():void 0,n=this.Ao(),o=this.ct.pi()||t,h=i||this.mo.o||o&&"disabled"!==n.type;if(h){if(this.pR=0,this.yR=new Uint16Array(0),this.SR=new Uint16Array(0),this.Pn.length=0,this.mR=0,this.yo>1){const[t,e,i,o]=Pf([s?n.packager(this.fo,r,.5):this.fo,s?n.packager(this.po,r,.5):this.po]);this.pR=o,this.yR=e,this.SR=i,this.Pn=t,this.mR=t.length}this.mo.o=!1}if(this.xo&&this.zn[0].length>1){const[t,e]=this.zn,i=t.length,[o,h,a,l,u]=Pf([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.pR);this.pR=l;const c=o.length;for(let t=u;t0||this.yo>0?1:u;s{if(this.iD.xL(n("aPos"),e).wL(r).WB(s("uIsHighlighted"),1===t||2===t?0:this.br).UB(s("uHighlightColorOffset"),this.Ar).WB(s("uRenderEffectMask"),2===t?1:0),this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(s("uScale"),this.JD.$B()).GB(s("uDisp"),this.JD.YB()):this.ct instanceof Ei&&this.iD.GB(h("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(h("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(h("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(h("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(s("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(s("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),1===t)this.iD.UB(s("uColor"),this.zO);else if(i instanceof z)this.iD.UB(s("uColor"),i.getColor());else if(i instanceof $){if(!this.kR)return!1;this.iD.KL(o,this.kR,i)}else if(i instanceof Z){if(!this.CR)return!1;this.iD.qL(o,this.CR,i)}else i instanceof G&&this.AR&&this.iD.HB(s("uLookupTexture"),this.AR.texture,0).WB(s("uLookupMin"),i.lut.min).WB(s("uLookupMax"),i.lut.max).WB(s("uLookupTextureHeightPx"),this.AR.textureHeight);return this.iD.kL(this.DR),!0}))}const r=1===t?this.eR:this.xR;if(r&&this.TR&&this.IR){const i=this.TR,s=this.IR;this.iD.$D(r).VB(r,((r,n,o,h)=>{if(this.iD.xL(n("aPos"),i).wL(s).WB(r("uIsHighlighted"),1===t||2===t?0:this.br).UB(r("uHighlightColorOffset"),this.Ar).WB(r("uRenderEffectMask"),2===t?1:0),this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(r("uScale"),this.JD.$B()).GB(r("uDisp"),this.JD.YB()):this.ct instanceof Ei&&this.iD.GB(h("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(h("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(h("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(h("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(r("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(r("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),1===t)this.iD.UB(r("uColor"),this.zO);else if(e instanceof z)this.iD.UB(r("uColor"),e.getColor());else if(e instanceof $){if(!this.$O)return!1;this.iD.KL(o,this.$O,e)}else if(e instanceof Z){if(!this.YO)return!1;this.iD.qL(o,this.YO,e)}else e instanceof G&&this.bR&&this.iD.HB(r("uLookupTexture"),this.bR.texture,0).WB(r("uLookupMin"),e.lut.min).WB(r("uLookupMax"),e.lut.max).WB(r("uLookupTextureHeightPx"),this.bR.textureHeight);return this.iD.kL(this.FR),!0}))}}return this}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return 0}do(){return 0}Sb(t){this.Qn()>0&&this.Gs();const[e,i]=this.$n(),s=e.length>2&&e[1].x0&&this.Gs();const[e,i]=this.$n(),s=e.length;if(0===s)return;const r=this.vo?1:0,n=s-(this.Mo?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.BR;s+=1){const r=i-s*Math.PI/this.BR;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.sL.rD.get(e);return i||(i=new Rf(t,e),t.sL.rD.set(e,i),i)})(t,e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2),_f=(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.vL(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.vL(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.vL(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.vL(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.vL(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.vL(i,1),h.enableVertexAttribArray(i)}},Of=(t,e,i,s,r,n,o)=>{const h=t.PO(),{uniform:a,uniformOptional:l}=i,u=1/t.Mh.Dh,c=(r?Math.max(n,u):Math.max(n,0))+1;h.WB(a("uThicknessPixels"),c).WB(l("uAALimit"),1-(c-1)/c).GB(a("uRatioPxClip"),[2/t.Et().x,2/t.Et().y]),e.$D(i,s).Op(o)};class zf extends qs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.Rn=we,this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO(),this.VR=this.iD.RL}Gs(){const t=this.Yr(),e=this.sa,i=e instanceof tt&&e,s=i&&i.getFillStyle(),r=s instanceof z&&s,n=s instanceof Z&&s,o=s instanceof $&&s,h=s instanceof G&&s,a=i,l=r||n||o||h&&["x","y"].includes(h.getLookUpProperty())&&h,c=this.ri(),d=this.ei(),f=this.pr.M(),g=this.pr.o,p=e.getThickness();if(this.JD.jB(this.ct),this.aa&&(this.NR&&this.iD.gl.deleteBuffer(this.NR),this.NR=this.iD.RB($t([c,d],this.ct.Qt())),this.Rn=m(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.Wr()&&a&&l&&a.getThickness()>0,e=n?["gradient",n]:o?["gradient",o]:h?["lookup",h.getLookUpProperty()]:"uniform";if(this.GR=t?{type:"triangulated",shader:this.iD.zB(df["2D"],df.Color({dataType:e}),df.LineInstanced2D({axisWorldTranslation:bf(this.ct),normalSource:void 0}),this.VR?df.AliasedEdge():void 0),mousePickingShader:f?this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.LineInstanced2D({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,geometry:Ff(this.iD,p),lineStyle:i,fillStyleSolid:r,fillStyleLinearGradient:n,fillStyleRadialGradient:o,fillStylePaletted:h}:void 0,h){if(h&&h.lut.isValid){const t=h.getPalette();this.HR=this.IO.vR(t,this.WR,this.HR),this.WR=t}}else this.IO.NL.vr(this.WR),this.WR=void 0;this.eR=f&&t?this.eR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.LineInstanced2D({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0}return s instanceof $?this.tR=Mf(ks(this.Rn,{x:this.co(),y:this.do()},this.ct),this.ct,s.getPosition(),s.getExtent(),s.getShape(),this.iD.ZD()):s instanceof Z?this.iR=Af(ks(this.Rn,{x:this.co(),y:this.do()},this.ct),this.ct,s.getAngle(!0),this.iD.ZD()):(this.tR=void 0,this.iR=void 0),this.oa(e),this.aa=!1,this.pr.o=!1,this}tD(t){var e;const i=1===t?this.eR:null===(e=this.GR)||void 0===e?void 0:e.shader;if(!i)return this;const s=this.NR;if(!s)return this;const r=this.GR;if(!r)return this;const{fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a,lineStyle:l}=r;return this.iD.$D(i).VB(i,((e,i,u,c)=>{if(this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0),this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).GB(c("uScaleStart_highpart"),this.JD.SO()).GB(c("uScaleStart_lowpart"),this.JD.xO()):this.ct instanceof Ei&&this.iD.GB(c("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(c("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(c("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(c("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(e("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(e("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),1===t)this.iD.UB(e("uColor"),this.zO);else if(n)this.iD.UB(e("uColor"),n.getColor());else if(h){if(!this.tR)return!1;this.iD.KL(u,this.tR,h)}else if(o){if(!this.iR)return!1;this.iD.qL(u,this.iR,o)}else if(a){if(!this.HR)return!1;this.iD.HB(e("uLookupTexture"),this.HR.texture,0).WB(e("uLookupMin"),a.lut.min).WB(e("uLookupMax"),a.lut.max).WB(e("uLookupTextureHeightPx"),this.HR.textureHeight)}return _f(this.ct.Qt(),this.iD,s,u,this.ct.Qt()?4:2,0),Of(this.IO,r.geometry,u,this.VR&&1!==t,1===t,l.getThickness(),1),!0})),this}dispose(){return super.dispose(),this.WR&&(this.IO.NL.vr(this.WR),this.WR=void 0),this.HR=void 0,this.GR=void 0,this.NR&&(this.iD.ZB(this.NR),this.NR=void 0),this}OD(){return this}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return Se(this.sa)}do(){return Se(this.sa)}}class Vf extends Xs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.Rn=we,this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO(),this.VR=this.iD.RL,this.UR=t.Mh.Lh}Gs(){const t=this.Yr(),e=this.sa,i=this.ua,s=e instanceof tt&&e,r=s&&s.getFillStyle(),n=r instanceof z&&r,o=s,h=n,a=e.getThickness()>=0?e.getThickness():1;if(this.JD.jB(this.ct),this.aa&&(this.NR&&(this.iD.ZB(this.NR),this.NR=void 0),this.NR=this.iD.RB($t(i,this.ct.Qt())),this.Rn=ze(i)),t){const t=o&&h&&0!==a,e="uniform";this.GR=t?{type:"triangulated",shader:this.iD.zB(df["2D"],df.Color({dataType:e}),df.LineInstanced2D({axisWorldTranslation:bf(this.ct),normalSource:void 0,snapToNearestPixel:this.UR}),this.VR?df.AliasedEdge():void 0),geometry:Ff(this.iD,a),lineStyle:s,fillStyleSolid:n}:void 0}return this.oa(e),this.aa=!1,this}tD(t){if(1===t)return this;const e=this.NR;if(!e)return this;const i=this.GR;if(!i)return this;const{fillStyleSolid:s,lineStyle:r,shader:n,geometry:o}=i;return this.iD.$D(n).VB(n,((i,n,h,a)=>(this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(i("uScale"),this.JD.$B()).GB(i("uDisp"),this.JD.YB()).GB(a("uScaleStart_highpart"),this.JD.SO()).GB(a("uScaleStart_lowpart"),this.JD.xO()):this.ct instanceof Ei&&this.iD.GB(a("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(a("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(a("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(a("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(i("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(i("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),this.UR&&this.iD.GB(a("uViewportSizePx"),[this.Li.Et().x*this.iD.ZD(),this.Li.Et().y*this.iD.ZD()]),this.iD.UB(i("uColor"),s.getColor()).WB(i("uIsHighlighted"),this.br).UB(i("uHighlightColorOffset"),this.Ar).WB(i("uRenderEffectMask"),2===t?1:0),((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"),n=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,4*r*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),e.vL(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,4*r*Float32Array.BYTES_PER_ELEMENT,2*Float32Array.BYTES_PER_ELEMENT),e.vL(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,4*r*Float32Array.BYTES_PER_ELEMENT,(0+r)*Float32Array.BYTES_PER_ELEMENT),e.vL(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(n,2,h.FLOAT,!1,4*r*Float32Array.BYTES_PER_ELEMENT,(0+r+2)*Float32Array.BYTES_PER_ELEMENT),e.vL(n,1),h.enableVertexAttribArray(n)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),e.vL(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(0+r)*Float32Array.BYTES_PER_ELEMENT),e.vL(i,1),h.enableVertexAttribArray(i)}})(this.ct.Qt(),this.iD,e,h,this.ct.Qt()?4:2),Of(this.IO,o,h,this.VR,!1,r.getThickness(),this.ua.length/2),!0))),this}OD(){return this.NR&&(this.iD.ZB(this.NR),this.NR=void 0),this.GR=void 0,this}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return Se(this.sa)}do(){return Se(this.sa)}}class Nf{constructor(t,e){this.$R=!1,this.YR=!1,this.XR=!1,this.ct=t,this.jR=e,this.jR.kr("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.$R="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.$R="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.YR=!0),!0===t.regularProgressiveStep&&(this.XR=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.$R?t[0].x:t[0].y,end:"x"===this.$R?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.$R?"x"===this.$R?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.ZR=!0)}))}QR(t,e=!1){if(this.ZR||!this.$R||"linear"!==this.JR.type)return!1;!1===e&&this.tE&&(clearTimeout(this.tE),this.tE=void 0);const i="x"===this.$R?this.JR.scale.x.jf:this.JR.scale.y.jf;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.$R?r.x:r.y,"x"===this.$R?n.x:n.y,s),h=this.JR.scale,a=Math.abs("x"===this.$R?h.yi().x:h.yi().y),l=a/o,u=Math.floor(l*Gf),c=u*o,d=gt.performance.now(),f=!(d-i.Wi<500)&&(i.Ei?d-i.Hi<1e3:d-i.zi<2e3||i.Ni),g=s>2*this.KR.totalDataPointsAtTime;if(f&&!g)return this.tE=setTimeout((()=>this.iE(t)),1e3),!1;const m=u>=10,p=this.KR.enabled?this.KR.columnWidthAxis/a<1.5:void 0,y=this.KR.enabled&&u>this.KR.dataPointsPerColumn?u/this.KR.dataPointsPerColumn>=2:void 0;let x;!0===this.KR.enabled?p?y&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):x=m?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:m&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const S=!1===e;return x?(S&&(this.KR=x),!0):(S&&(this.KR={...this.KR,totalDataPointsAtTime:s}),!1)}AS(){this.sE=void 0,this.qR.length=0,this.tE&&(clearTimeout(this.tE),this.tE=void 0)}eE(t){if(0===t.length)return t;if(this.ZR||!this.$R||"linear"!==this.JR.type||!this.KR.enabled)return t;let e;e=this.qR.length>0?ie(this.qR,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.sE,h=-1,a=-1,l=0,u=0;if("x"!==this.$R||this.YR)if("x"===this.$R&&this.YR){const t=this.KR.columnWidthAxis;let c=this.sE?this.sE.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.sE=s[c-1]),s}hE(t){if(this.$R&&"linear"===this.JR.type){const e="x"===this.$R?this.JR.scale.x.jf:this.JR.scale.y.jf;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Fi===Bi.progressive||e.Fi===Bi.regressive){const e=Math.abs("x"===this.$R?this.JR.scale.x.getInnerInterval():this.JR.scale.y.getInnerInterval());if(this.KR.enabled)return 2*e/this.KR.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.$R?s.x:s.y,"x"===this.$R?r.x:r.y,i)}}}rE(t,e,i){if(!this.$R)return e;const s=i.length;let r=Ms(i,t.min,this.$R,this.YR,0,s-1);void 0===r&&(r=this.YR?s-1:0);let n=Ms(i,t.max,this.$R,this.YR,0,s-1);return void 0===n&&(n=this.YR?0:s-1),1+Math.abs(n-r)}nE(){this.tE&&(clearTimeout(this.tE),this.tE=void 0)}iE(t){this.QR(t,!0)&&this.Bi()}}class Hf extends Nf{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 Wf{constructor(t,e,i){this.oE=e,this.aE=i,this.lE=t,this.uE=[]}cE(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.lE[this.lE.length-1];do{const t=this.lE.length;let r;h||(h=this.dE(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.aE&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.lE[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.lE.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.fE()}gE(t){const e=t,i=this.lE.indexOf(e);i>=0&&this.lE.splice(i,1),e.droppedTimestamp=gt.performance.now(),this.uE.push(e)}pE(){this.lE.slice().forEach((t=>this.gE(t)))}mE(){this.lE.forEach((t=>this.oE(t))),this.uE.forEach((t=>this.oE(t))),this.lE.length=0,this.uE.length=0}dE(t,e){const i=2*t/3,s=4*t/3,r=this.uE.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.uE[r];return this.uE.splice(r,1),this.lE.push(t),t}}fE(){if(this.uE.length>5){const t=gt.performance.now();for(let e=0;e=1e4)&&(this.oE(i),this.uE.splice(e,1),e-=1)}}}}class Yf extends Nf{yE(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.SE(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.xE(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.bE(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}SE(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}bE(t,e,i,s,r,n){if(void 0===e||!this.$R)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.$R?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.$R?a.boundaries.max.x2))break;o+=1}return o}xE(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.$R){if(this.YR?"x"===this.$R?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.$R?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}vE(t,e){const i=t.reduce(((t,e)=>Ne(t,e.boundaries)),we);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.$R||this.YR?"x"===this.$R&&this.YR?i.max.x=Math.min(i.max.x,t):"y"!==this.$R||this.YR?"y"===this.$R&&this.YR&&(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 qf extends $s{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r),this.JD=new pf,this.Sv=[],this.ME=new Hf(this.ct,this),this._E=new Uf(this.ct,this,(()=>this.Li.Bi())),this.AE=new Wf(this.Sv,(t=>t.coordsBuffer&&this.iD.ZB(t.coordsBuffer)),!0),this.wE=new Yf(this.ct,this),this.FO=e,this.EO=n,this.zO=o,this.Mh=h,this.GR={type:"none"},this.iD=t.PO(),this.IO=t,this.VR=this.iD.RL;const a=this.ct.Qt(),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;s$t(e,t))(a,l);this.kE={individualLookupValuesEnabled:l,attributesPerVertex:f,attributeOffsetCoordinateLowPrecision:u,attributeOffsetCoordinateHighPrecision:c,attributeOffsetLookUpValue:d,prepareRenderData:(t,e)=>g(t,this.sa.getFillStyle())}}Gs(){const t=this.Hn,e=this.sa,i=this.Yr(),s=this.zn,r=s.length,n=r>0,o=this.pr.M(),h=this.pr.o;n&&(this.ca=ie(this.ca,s,{canReturnB:!0}),this.En+=r);let a=this.da.o;const l=this.wE.yE(this.Sv,this.da.M());if(l>0){let t=0;for(let e=0;e{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=we,t.lastDataPoint=void 0})),this.AE.pE(),u=this.ca);const c=this._E.eE(u),d=c.length;if(d>0){let t=this._E.hE(this.ca)||(this.kr("ApplicationType",(t=>"InternalUI"===t.type))?this.En:1e5);d/t>10&&(t=d/10),this.AE.cE(c,t,((t,e,i,s)=>{const r=this.ME.calculateUserDataPointsBoundaries(e);return{allocatedCoordinatesCount:t,existingDataPointsCount:this._E.rE(r,i,this.ca)-s,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.iD.gL(t*this.kE.attributesPerVertex,this.kE.prepareRenderData(e,i)),lastDataPoint:e[i-1]}}),((t,e,i,s)=>{const r=Ne(t.boundaries,this.ME.calculateUserDataPointsBoundaries(e)),n=this._E.rE(r,t.existingCoordinatesCount+i,this.ca)-(t.jointPointsCount+s);this.iD.pL(t.coordsBuffer,t.existingCoordinatesCount*this.kE.attributesPerVertex,this.kE.prepareRenderData(e,i)),t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}a&&(this.Rn=this.wE.vE(this.Sv,this.da.M())),this.JD.jB(this.ct);const f=e instanceof tt&&e,g=f&&f.getThickness(),m=f&&f.getFillStyle(),p=m instanceof z&&m,y=m instanceof Z&&m,x=m instanceof $&&m,S=m instanceof G&&m,v=p||y||x||S,b=this.kE.individualLookupValuesEnabled;if(x?this.tR=Mf(this.Tr(),this.ct,x.getPosition(),x.getExtent(),x.getShape(),this.iD.ZD()):y?this.iR=Af(this.Tr(),this.ct,y.getAngle(!0),this.iD.ZD()):(this.tR=void 0,this.iR=void 0),i||h){if(S&&"value"===S.getLookUpProperty()&&!b){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw gt.alert(t),new Error(t)}if(v&&f&&!1!==g){const t=-1===g?"primitive":"triangulated",e=y?["gradient",y]:x?["gradient",x]:S?["lookup",S.getLookUpProperty()]:"uniform";this.GR="primitive"===t?{type:t,shader:this.iD.zB(df["2D"],df.Color({dataType:e}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})),mousePickingShader:o?this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,lineStyle:f,fillStyleSolid:p,fillStyleLinearGradient:y,fillStyleRadialGradient:x,fillStylePaletted:S}:"triangulated"===t?{type:t,shader:this.iD.zB(df["2D"],df.Color({dataType:e}),df.LineInstanced2D({axisWorldTranslation:bf(this.ct),normalSource:void 0}),this.VR?df.AliasedEdge():void 0),mousePickingShader:o?this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.LineInstanced2D({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,geometry:Ff(this.iD,g),lineStyle:f,fillStyleSolid:p,fillStyleLinearGradient:y,fillStyleRadialGradient:x,fillStylePaletted:S}:{type:"none"}}else this.GR={type:"none"};if(S){if(S&&S.lut.isValid){const t=S.getPalette();this.HR=this.IO.vR(t,this.WR,this.HR),this.WR=t}}else this.IO.NL.vr(this.WR),this.WR=void 0}return this.oa(e),this.Hn=!1,this.zn=[],this.pr.o=!1,this.da.o=!1,this}tD(t){const e=this.iD.gl,i=this.GR;if(!i||"none"===i.type)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const{lineStyle:r,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}=i;return this.iD.$D(s).VB(s,((s,l,u,c)=>{let d=!1;if(this.iD.WB(s("uIsHighlighted"),1===t||2===t?0:this.br).UB(s("uHighlightColorOffset"),this.Ar).WB(s("uRenderEffectMask"),2===t?1:0),this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(s("uScale"),this.JD.$B()).GB(s("uDisp"),this.JD.YB()).GB(c("uScaleStart_highpart"),this.JD.SO()).GB(c("uScaleStart_lowpart"),this.JD.xO()):this.ct instanceof Ei&&this.iD.GB(c("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(c("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(c("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(c("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(s("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(s("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),1===t)this.iD.UB(s("uColor"),this.zO);else if(n)this.iD.UB(s("uColor"),n.getColor());else if(h){if(!this.tR)return!1;this.iD.KL(u,this.tR,h)}else if(o){if(!this.iR)return!1;this.iD.qL(u,this.iR,o)}else if(a){if(!this.HR)return!1;this.iD.HB(s("uLookupTexture"),this.HR.texture,0).WB(s("uLookupMin"),a.lut.min).WB(s("uLookupMax"),a.lut.max).WB(s("uLookupTextureHeightPx"),this.HR.textureHeight)}return this.ME.renderVisibleOnly(this.Sv,(s=>{const{coordsBuffer:n}=s;if(n){if(e.bindBuffer(e.ARRAY_BUFFER,n),"triangulated"===i.type)this.ct.Qt()||void 0===this.kE.attributeOffsetCoordinateLowPrecision?this.ct.Qt()&&void 0!==this.kE.attributeOffsetCoordinateHighPrecision&&_f(!0,this.iD,n,u,this.kE.attributesPerVertex,this.kE.attributeOffsetCoordinateHighPrecision):_f(!1,this.iD,n,u,this.kE.attributesPerVertex,this.kE.attributeOffsetCoordinateLowPrecision);else if(this.ct.Qt()||void 0===this.kE.attributeOffsetCoordinateLowPrecision){if(this.ct.Qt()&&void 0!==this.kE.attributeOffsetCoordinateHighPrecision){const t=l("aPos_highpart");e.vertexAttribPointer(t,2,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetCoordinateHighPrecision*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t);const i=l("aPos_lowpart");e.vertexAttribPointer(i,2,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.kE.attributeOffsetCoordinateHighPrecision+2)*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(i)}}else{const t=l("aPos");e.vertexAttribPointer(t,2,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetCoordinateLowPrecision*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}if(a&&"value"===a.lookUpProperty&&void 0!==this.kE.attributeOffsetLookUpValue&&1!==t)if("triangulated"===i.type){const t=l("aLookupValueA");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.iD.vL(t,1),e.enableVertexAttribArray(t);const i=l("aLookupValueB");e.vertexAttribPointer(i,1,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.kE.attributeOffsetLookUpValue+this.kE.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.iD.vL(i,1),e.enableVertexAttribArray(i)}else{const t=l("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}"triangulated"===i.type?Of(this.IO,i.geometry,u,this.VR&&1!==t,1===t,r.getThickness(),s.existingCoordinatesCount-1):this.iD.Op(e.LINE_STRIP,s.existingCoordinatesCount,0),d=!0}})),e.bindBuffer(e.ARRAY_BUFFER,null),d})),this}Kn(t,e){return Array.isArray(t)||(t=[t]),this.zn=ie(this.zn,t,{canReturnB:!0}),this.Rn=Ne(this.Rn,e||this.ME.calculateUserDataPointsBoundaries(t)),this}qn(){return super.qn(),this}dispose(){return super.dispose(),this._E.nE(),this.WR&&(this.IO.NL.vr(this.WR),this.WR=void 0),this.GR={type:"none"},this.HR=void 0,this}OD(){return this.AE.mE(),this}Sb(t){this.Qn()>0&&this.Gs();const e=this.$n(),i=xs(e,t,this.Gn,this.vo,this.Mo,this.ct,this.engine.ct,this.Rn,this.ME.$R,this.ME.YR);return void 0!==i?e[i]:void 0}WA(t){this.Qn()>0&&this.Gs();const e=this.$n(),i=e.length;if(0===i)return;const s=this.vo?1:0,r=i-(this.Mo?2:1);if(this.Gn===ps.Nearest){let s,r,n=Me;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 Xf(t,e)},jf=t=>{const e=[u(-.5,-.5),u(-.5,.5),u(.5,-.5),u(.5,-.5),u(-.5,.5),u(.5,.5)];return new Xf(t,e)},Zf=(t,e,i)=>{let s=e.sL.hD.get(t);return s||(s=i(e),e.sL.hD.set(t,s)),s};class Kf extends zs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.OO=m(c(Ae,Ae),c(Me,Me)),this.FE=[],this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO()}Gs(){const t=this.pr.M(),i=this.pr.o,s=this.zn,r=s.length,n=r>0,o=this.Dn.M(),h=this.Vr,a=this.size.M(),l=this.ct.pi(),c=this.size.o||this.Dn.o,d=this.Hn||s&&s.length>0,f=l||c;if(n){this.Pn=ie(this.Pn,s,{canReturnB:!0}),this.En+=r;const t=this.FE[this.FE.length-1];let e=t?{ni:t.ni,hi:t.hi,tA:{max:{x:t.tA.max.x,y:t.tA.max.y},min:{x:t.tA.min.x,y:t.tA.min.y}},PE:{max:{x:t.PE.max.x,y:t.PE.max.y},min:{x:t.PE.min.x,y:t.PE.min.y}}}:void 0,i=s.length;if(!e){const t={ni:0,hi:s.length>=1e3?1e3:s.length};t.tA=ze(s.slice(0,t.hi)),t.PE=ks(t.tA,{x:a,y:a},this.ct),this.FE[0]=t,e=t,i=s.length-(t.hi||0)}if(e&&i)if(e.hi-e.ni+i<1e3)e.hi+=e.hi-e.ni+i,e.tA=ze(s.slice(e.ni,e.hi)),e.PE=ks(e.tA,{x:a,y:a},this.ct),this.FE[this.FE.length-1]=e;else{if(e.hi-e.ni<1e3){const t={ni:e.ni,hi:e.ni+1e3};t.tA=ze(s.slice(t.ni,t.hi)),t.PE=ks(t.tA,{x:a,y:a},this.ct),this.FE[this.FE.length-1]=t}let t=e.hi;for(;tthis.Pn.length?this.Pn.length:t+1e3};e.tA=ze(s.slice(e.ni,e.hi)),e.PE=ks(e.tA,{x:a,y:a},this.ct),t=e.hi,this.FE[this.FE.length]=e}}}if(n||this.Hn){this.Rn=this.Nn?Ne(this.Rn,this.Nn):Ne(this.Rn,ze(this.Pn));const t=$t(this.Pn,this.ct.Qt());this.DE=this.En,this.BE=this.iD.RB(t)}if(this.JD.jB(this.ct),c||this.Nr()||i){const e=this.Bn.M()?"attribute":"uniform",i=a<=1&&df.PointSize(e),s=df.VertexLocation({offset:a>1?{dataType:e,sizeUnit:"px",symmetric:!0,rotation:(this.Ln.M()||this.sn.M()%360!=0)&&{dataType:this.Ln.M()?"attribute":"uniform"}}:void 0,axisWorldTranslation:bf(this.ct),normalSource:void 0}),r=this.Vr instanceof z&&this.Vr,n=this.Vr instanceof $&&this.Vr,o=this.Vr instanceof Z&&this.Vr,h=this.Vr instanceof G&&this.Vr,l=this.Vr instanceof V&&this.Vr,u=r||n||o||h||l;this.tB=u?this.iD.zB(df["2D"],i,s,r?df.Color({dataType:"uniform"}):l?df.Color({dataType:"attribute"}):h?df.Color({dataType:["lookup",h.getLookUpProperty()]}):n?df.Color({dataType:["gradient",n]}):o?df.Color({dataType:["gradient",o]}):void 0):void 0,this.eR=t&&u?this.iD.zB(df["2D"],i,s,df.Color({dataType:"uniform"})):void 0}if(h!==F?f&&(this.LE&&(this.LE=void 0),a>1||h instanceof V?a<=1?this.zR=this.iD.gl.POINTS:o===e.PointShape.Triangle?(this.LE=Zf(e.PointShape.Triangle,this.iD,$f),this.zR=this.iD.gl.TRIANGLES):o===e.PointShape.Circle?(this.LE=Zf(e.PointShape.Circle,this.iD,(t=>((t,e)=>{const i=function(t=25){return al(u(0,0),0,360,.5,.5,t)[0]}(24);return new Xf(t,i)})(t))),this.zR=this.iD.gl.TRIANGLE_FAN):o===e.PointShape.Square?(this.LE=Zf(e.PointShape.Square,this.iD,jf),this.zR=this.iD.gl.TRIANGLES):this.zR=this.iD.gl.POINTS:this.zR=this.iD.gl.POINTS):this.LE&&(this.LE=void 0),d||this.Nr()){const t=this.Pn.length;if(h instanceof V&&this.DE&&this.DE>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=ni(this.sn.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 Ti||this.ct instanceof Ga?this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).GB(o("uScaleStart_highpart"),this.JD.SO()).GB(o("uScaleStart_lowpart"),this.JD.xO()):this.ct instanceof Ei&&this.iD.GB(o("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(o("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(o("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(o("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(e("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(e("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),this.iD.tO(n,i,this.ct.Qt(),this.LE?1:void 0).WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).WB(o("uDevicePixelRatio"),this.iD.ZD()),this.LE){const t=r("aInstanceGeo");this.iD.xL(t,this.LE._D).vL(t,0)}if(1===t)this.iD.UB(e("uColor"),this.zO);else if(this.Vr instanceof z)this.iD.UB(e("uColor"),this.Vr.getColor());else if(this.Vr instanceof V&&this.OE){const t=r("aColor");this.iD._L(t,this.OE),this.zR!==this.iD.gl.POINTS&&this.iD.vL(t,1)}else if(this.Vr instanceof G&&this.HR){if("value"===this.Vr.getLookUpProperty()&&this.zE){const t=r("aLookupValue");this.iD.AL(t,this.zE),this.zR!==this.iD.gl.POINTS&&this.iD.vL(t,1)}this.iD.HB(e("uLookupTexture"),this.HR.texture,0).WB(e("uLookupMin"),this.Vr.lut.min).WB(e("uLookupMax"),this.Vr.lut.max).WB(e("uLookupTextureHeightPx"),this.HR.textureHeight)}else if(this.Vr instanceof $){if(!this.$O)return!1;this.iD.KL(n,this.$O,this.Vr)}else if(this.Vr instanceof Z){if(!this.YO)return!1;this.iD.qL(n,this.YO,this.Vr)}if(this.RE&&this.zR!==this.iD.gl.POINTS){const t=r("aOffsetPixels");this.iD.AL(t,this.RE),this.zR!==this.iD.gl.POINTS&&this.iD.vL(t,1)}else if(this.zR!==this.iD.gl.POINTS){const t=e("uOffsetPixels");this.iD.WB(t,this.size.M())}if(this.EE&&this.zR!==this.iD.gl.POINTS){const t=r("aRot");this.iD.xL(t,this.EE),this.zR!==this.iD.gl.POINTS&&this.iD.vL(t,1)}else if(this.zR!==this.iD.gl.POINTS&&this.sn.M()%360!=0){const t=ni(this.sn.M()),i=Math.sin(t),s=Math.cos(t);this.iD.GB(e("uRot"),[i,s])}if(this.zR===this.iD.gl.POINTS)this.iD.WB(e("uPointSize"),this.size.M());else{const t={x:2/this.Li.Et().x,y:2/this.Li.Et().y};this.iD.GB(e("uRatioPxClip"),[t.x,t.y])}let h=!1;return this.zR===this.iD.gl.POINTS?(this.iD.Op(this.zR,s),h=!0):this.LE&&(this.iD.CL(this.zR,0,this.LE.IE,s),h=!0),h})))}return this}jS(t){this.Qn()>0&&this.Gs();const e=this.$n(),i=xs(e,t,this.Gn,!1,!1,this.ct,this.Li.ct,this.Rn,void 0,void 0);return void 0!==i?e[i]:void 0}ps(t){return super.ps(t)}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return.5*this.size.M()}do(){return.5*this.size.M()}qn(){return super.qn(),this.FE=[],this}OD(){return this.BE&&(this.iD.ZB(this.BE),this.BE=void 0),this.LE&&(this.LE=void 0),this.OE&&(this.iD.gl.deleteBuffer(this.OE),this.OE=void 0),this.EE&&(this.iD.ZB(this.EE),this.EE=void 0),this.zE&&(this.iD.ZB(this.zE),this.zE=void 0),this}}class Jf extends Vs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.VE=we,this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO(),this.FO=e}Gs(){super.Gs();const t=this.pr.M(),e=this.Nr(),i=this.qr.o||this.Y.o||this.sn.o||this.hn.o,s=this.$r,r=this.Yr(),n=s.getThickness(),o=this.jr(n),h=this.sn.M();this.JD.jB(this.ct);const a=this.ct.pi();if(i||a){const t=this.Y.M();this.Pn=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]=Ye(n[0],r,t),n[1]=Ye(n[1],r,t),n[2]=Ye(n[2],r,t),n[3]=Ye(n[3],r,t)}return n}(this.qr.M(),t.x,t.y,h,this.hn.M()),this.GO&&this.iD.gl.deleteBuffer(this.GO);const e=$t(this.Pn,this.ct.Qt());this.GO=this.iD.RB(e),this.WO=this.Pn.length}this.VE=ze(this.Pn);const l=this.Vr instanceof z&&this.Vr,c=this.Vr instanceof $&&this.Vr,d=this.Vr instanceof Z&&this.Vr,f=this.Vr instanceof sd&&this.Vr,g=l||c||d||f;if(e&&(this.XO=g?this.iD.zB(df["2D"],l&&df.Color({dataType:"uniform"}),d&&df.Color({dataType:["gradient",d]}),c&&df.Color({dataType:["gradient",c]}),f&&df.Color({dataType:["image",f.getFitMode()]}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0),c?this.$O=Mf(this.Sr||this.VE,this.ct,c.getPosition(),c.getExtent(),c.getShape(),this.iD.ZD()):d?this.YO=Af(this.Sr||this.VE,this.ct,d.getAngle(!0),this.iD.ZD()):(this.$O=void 0,this.YO=void 0),f){const t=f.getSource();if((!this.NE||e)&&t){this.NE&&(this.NE.texture.YD(this),this.iD.ZB(this.NE.texCoordsBuffer));const e=this.iD.JL(t);e.$D(this),this.NE={texture:e,texCoordsBuffer:this.iD.RB([]),sourceMissingTexture:this.iD.XL(new Uint8Array(Object.values(f.getSourceMissingColor().toJS()).map((t=>255*t))),this.iD.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{this.NE&&f&&(this.GE(),this.Li.Bi())}},e.xB(this.NE.textureReadyCallback),this.GE()}this.NE&&this.NE.texture.dB&&this.NE.texture.cB&&this.NE.texture.aB&&(this.NE.texture.Gs(),this.Li.Bi()),(a||i)&&this.NE&&this.NE.texture.dB&&this.GE()}else this.NE&&(this.NE.texture.YD(this),this.iD.ZB(this.NE.texCoordsBuffer),this.NE=void 0);if(i||o||a&&1!==n){if(1===n||-1===n)[this.jO,this.HE]=[this.Pn,void 0];else{const t=this.ct;[this.jO,this.HE]=t instanceof Ei?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.Si(s,r,h,-h),i.Si(r,s,-h,-h),i.Si(o,n,-h,-h),i.Si(n,o,h,-h),i.Si(s,r,-h,h),i.Si(r,s,h,h),i.Si(o,n,h,h),i.Si(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.Pn,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=Xe(qe(r,s)),l=Xe(qe(o,s)),c=ei(a),d=ei(l);return[[Ke(s,Ke(Ze(c,h.x),Ze(d,h.y))),Ke(r,Ke(Ze(a,h.x),Ze(d,h.y))),Ke(o,Ke(Ze(c,h.x),Ze(l,h.y))),Ke(n,Ke(Ze(a,h.x),Ze(l,h.y))),Ke(s,Ke(Ze(a,h.x),Ze(l,h.y))),Ke(r,Ke(Ze(c,h.x),Ze(l,h.y))),Ke(o,Ke(Ze(a,h.x),Ze(d,h.y))),Ke(n,Ke(Ze(c,h.x),Ze(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.Pn,t.yi(),n)}this.KO&&this.iD.gl.deleteBuffer(this.KO),this.RR&&this.iD.gl.deleteBuffer(this.RR),this.KO=this.iD.RB($t(this.jO,this.ct.Qt())),this.HE?(this.RR=this.iD.yL(new Uint16Array(this.HE)),this.ZO=this.HE.length):(this.RR=void 0,this.ZO=this.jO.length)}const m=s instanceof tt&&s,p=m&&m.getFillStyle(),y=p&&p instanceof Z&&p,x=p&&p instanceof $&&p,S=m,v=p&&p instanceof z&&p||y||x;return r&&(this.sR=S&&v?this.iD.zB(df["2D"],df.Color({dataType:x?["gradient",x]:y?["gradient",y]:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0),x?this.tR=Mf(this.VE,this.ct,x.getPosition(),x.getExtent(),x.getShape(),this.iD.ZD()):y?this.iR=Af(this.VE,this.ct,y.getAngle(!0),this.iD.ZD()):(this.tR=void 0,this.iR=void 0),this.eR=t&&g?this.eR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.hR=t&&this.$r!==J?this.hR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.Ur(this.Vr),this.Zr(s),this.qr.o=!1,this.sn.o=!1,this.Y.o=!1,this.hn.o=!1,this}GE(){if(this.NE&&this.Vr instanceof sd){const t=nt(this.xn(),this.ct,this.Li.ct),i=Je(nt(Ke(this.xn(),this.Et()),this.ct,this.Li.ct),t);this.NE.texCoordsBuffer&&this.iD.ZB(this.NE.texCoordsBuffer),this.NE.texCoordsBuffer=this.iD.RB(((t,i,s,r,n)=>{const o=Math.min(s/t,r/i),h=t*o,a=i*o,l=s/h,u=r/a,c=h/s,d=a/r;let f=0,g=1,m=0,p=1;switch(n){case e.ImageFitMode.Fill:u{if(this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).GB(h("uScaleStart_highpart"),this.JD.SO()).GB(h("uScaleStart_lowpart"),this.JD.xO()):this.ct instanceof Ei&&this.iD.GB(h("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(h("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(h("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(h("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(e("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(e("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),1===t)this.iD.UB(e("uColor"),this.zO);else if(r instanceof z)this.iD.UB(e("uColor"),r.getColor());else if(r instanceof $){if(!this.$O)return!1;this.iD.KL(o,this.$O,r)}else if(r instanceof Z){if(!this.YO)return!1;this.iD.qL(o,this.YO,r)}else if(r instanceof sd){if(!this.NE)return!1;const t=this.NE&&this.NE.texture.vB();this.iD.UB(h("uColor"),r.getSurroundingColor()).HB(e("uColorTexture"),t||this.NE.sourceMissingTexture,0).NB(this.NE.texCoordsBuffer,void 0,{location:n("aTextureCoord"),size:2}).fL(r.fitMode)}return this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).tO(o,i,this.ct.Qt(),void 0).Op(this.iD.gl.TRIANGLE_FAN,s),!0})));const n=1===t?this.hR:this.sR,o=this.$r,h=this.KO;n&&h&&o instanceof tt&&(this.iD.$D(n),this.iD.VB(n,((e,i,s,r)=>{this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).GB(r("uScaleStart_highpart"),this.JD.SO()).GB(r("uScaleStart_lowpart"),this.JD.xO()):this.ct instanceof Ei&&this.iD.GB(r("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(r("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(r("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(r("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(e("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(e("uViewportSize"),this.JD.MixedScaleXY.uViewportSize);const n=o.getFillStyle();if(1===t)this.iD.UB(e("uColor"),this.zO);else if(n instanceof z)this.iD.UB(e("uColor"),n.getColor());else if(n instanceof $){if(!this.tR)return!1;this.iD.KL(s,this.tR,n)}else if(n instanceof Z){if(!this.iR)return!1;this.iD.qL(s,this.iR,n)}return this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).tO(s,h,this.ct.Qt(),void 0),this.RR?this.iD.wL(this.RR).kL(this.ZO):this.iD.Op(this.iD.gl.LINE_LOOP,this.ZO),!0})))}return this}OD(){return this.RR&&(this.iD.ZB(this.RR),this.RR=void 0),this.GO&&(this.iD.ZB(this.GO),this.GO=void 0),this.KO&&(this.iD.ZB(this.KO),this.KO=void 0),this.NE&&(this.NE.texture.YD(this),this.NE.texture.bB(this.NE.textureReadyCallback),this.iD.RD(this.NE.sourceMissingTexture),this.iD.ZB(this.NE.texCoordsBuffer),this.NE=void 0),this.XO=void 0,this.sR=void 0,this.eR=void 0,this.hR=void 0,this}yt(){return Math.max(this.qr.M().x,this.qr.M().x+this.Y.M().x)}ft(){return Math.min(this.qr.M().x,this.qr.M().x+this.Y.M().x)}xt(){return Math.max(this.qr.M().y,this.qr.M().y+this.Y.M().y)}St(){return Math.min(this.qr.M().y,this.qr.M().y+this.Y.M().y)}co(){return Se(this.$r)}do(){return Se(this.$r)}}class Qf extends Gs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO(),this.FO=e}jS(t){let e,i=Number.MAX_VALUE;for(const s of this.Pn){const r=Le(nt(s,this.ct,this.Li.ct),t);r=3,r=this.$r,n=this.Yr(),o=r.getThickness(),a=this.jr(o);this.JD.jB(this.ct),this.jv=this.ct.yi();const l=this.ct.pi();if(i&&(this.Rn=ze(this.Pn)),i&&(this.GO&&(this.iD.gl.deleteBuffer(this.GO),this.GO=void 0),s)){const t=$t(this.Pn,this.ct.Qt());this.GO=this.iD.RB(t),this.WE=new Uint16Array(h.default(t)),this.UE&&this.iD.gl.deleteBuffer(this.UE),this.UE=this.iD.yL(this.WE),this.WO=this.WE.length}const u=this.Vr instanceof z&&this.Vr,c=this.Vr instanceof G&&this.Vr,d=this.Vr instanceof $&&this.Vr,f=this.Vr instanceof Z&&this.Vr,g=u||c&&"value"!==c.getLookUpProperty()&&c||f||d;if(e){if(c){const t=c.getPalette();this.HR=this.IO.vR(t,this.WR,this.HR),this.WR=t}else this.IO.NL.vr(this.WR),this.WR=void 0;this.XO=g?this.iD.zB(df["2D"],u&&df.Color({dataType:"uniform"}),f&&df.Color({dataType:["gradient",f]}),d&&df.Color({dataType:["gradient",d]}),c&&df.Color({dataType:["lookup",c.getLookUpProperty()]}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0}if(d?this.$O=Mf(this.Sr||this.Rn,this.ct,d.getPosition(),d.getExtent(),d.getShape(),this.iD.ZD()):f?this.YO=Af(this.Sr||this.Rn,this.ct,f.getAngle(!0),this.iD.ZD()):(this.$O=void 0,this.YO=void 0),(i||a||l&&1!==o)&&(this.KO&&(this.iD.ZB(this.KO),this.KO=void 0),s)){const t=1===o||-1===o?this.Pn:wf(this.Pn,this.jv,o);this.jO=$t(t,this.ct.Qt()),this.KO=this.iD.RB(this.jO,!0),this.ZO=t.length}const m=r instanceof tt&&r,p=m&&m.getFillStyle(),y=p&&p instanceof Z&&p,x=p&&p instanceof $&&p,S=m,v=p&&p instanceof z&&p||y||x;return n&&(this.sR=S&&v?this.iD.zB(df["2D"],df.Color({dataType:x?["gradient",x]:y?["gradient",y]:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0),x?this.tR=Mf(this.Sr||this.Rn,this.ct,x.getPosition(),x.getExtent(),x.getShape(),this.iD.ZD()):y?this.iR=Af(this.Sr||this.Rn,this.ct,y.getAngle(!0),this.iD.ZD()):(this.tR=void 0,this.iR=void 0),this.eR=t&&g?this.eR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.hR=t&&this.$r!==J?this.eR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.ao=!1,this.Ur(this.Vr),this.Zr(r),this}tD(t){if(this.Wr()){const e=this.Vr,i=1===t?this.eR:this.XO,s=this.GO,r=this.WO;i&&s&&r&&this.iD.$D(i).VB(i,((i,r,n,o)=>{if(this.iD.GB(i("uScale"),this.JD.$B()).GB(i("uDisp"),this.JD.YB()).GB(o("uScaleStart_highpart"),this.JD.SO()).GB(o("uScaleStart_lowpart"),this.JD.xO()).tO(n,s,this.ct.Qt(),void 0).wL(this.UE).WB(i("uIsHighlighted"),1===t||2===t?0:this.br).UB(i("uHighlightColorOffset"),this.Ar).WB(i("uRenderEffectMask"),2===t?1:0),1===t)this.iD.UB(i("uColor"),this.zO);else if(e instanceof z)this.iD.UB(i("uColor"),e.getColor());else if(e instanceof $){if(!this.$O)return!1;this.iD.KL(n,this.$O,e)}else if(e instanceof Z){if(!this.YO)return!1;this.iD.qL(n,this.YO,e)}else e instanceof G&&this.HR&&this.iD.WB(i("uLookupMin"),e.lut.min).WB(i("uLookupMax"),e.lut.max).WB(i("uLookupTextureHeightPx"),this.HR.textureHeight).HB(i("uLookupTexture"),this.HR.texture,0);return this.iD.kL(this.WO),!0}));const n=1===t?this.hR:this.sR,o=this.$r,h=this.KO,a=this.ZO;n&&h&&a&&this.iD.$D(n).VB(n,((e,i,s,r)=>{this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).tO(s,h,this.ct.Qt(),void 0);const n=o.getFillStyle();if(1===t)this.iD.UB(e("uColor"),this.zO);else if(n instanceof z)this.iD.UB(e("uColor"),n.getColor());else if(n instanceof $){if(!this.tR)return!1;this.iD.KL(s,this.tR,n)}else if(n instanceof Z){if(!this.iR)return!1;this.iD.qL(s,this.iR,n)}const a=o.getThickness(),l=-1===a||1===a;return this.iD.Op(l?this.iD.gl.LINE_LOOP:this.iD.gl.TRIANGLE_STRIP,this.ZO),!0}))}return this}OD(){return this.UE&&(this.iD.ZB(this.UE),this.UE=void 0),this.GO&&(this.iD.ZB(this.GO),this.GO=void 0),this.KO&&(this.iD.ZB(this.KO),this.KO=void 0),this.XO=void 0,this.sR=void 0,this.eR=void 0,this.hR=void 0,this.HR=void 0,this}}const tg=(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},ig=(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=ke(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.XL(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.XL(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.XL(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},ng=(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 og extends Rs{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.$E=y("bilinear"),this.Ma=ls.lineStyle,this.engine=t,this.Rn=m({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.Mh={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}Cy(t){return this.$E.S(t),this}Ty(){return this.$E.M()}_a(t){return this.Ma="function"==typeof t?t(this.Ma):t,this}Aa(){return this.Ma}}class hg extends og{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.JD=new pf,this.GR={},this.YE=[],this.XE=!1,this.Hn=!1,this.jE=tg,this.IO=t,this.FO=e,this.EO=o,this.zO=h,this.iD=t.PO(),this.FO=e;const a=Math.min(this.iD.LD,2048),l={x:Math.min(a,this.Mh.primaryDimensionVectorsCount),y:Math.min(a,this.Mh.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.Mh,l,this.jE),c=u.gridTiles.map((t=>{const e="columns"===this.Mh.dataOrder?{x:this.Mh.start.x+this.Mh.step.x*t.iFirstVector.primary,y:this.Mh.start.y+this.Mh.step.y*t.iFirstVector.secondary}:{x:this.Mh.start.x+this.Mh.step.x*t.iFirstVector.secondary,y:this.Mh.start.y+this.Mh.step.y*t.iFirstVector.primary},i="columns"===this.Mh.dataOrder?{x:this.Mh.step.x*t.sizeHeatmapDataVectors.primary,y:this.Mh.step.y*t.sizeHeatmapDataVectors.secondary}:{x:this.Mh.step.x*t.sizeHeatmapDataVectors.secondary,y:this.Mh.step.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.Mh.dataOrder?{x:this.Mh.start.x+this.Mh.step.x*t.iFirstUniqueVector.primary,y:this.Mh.start.y+this.Mh.step.y*t.iFirstUniqueVector.secondary}:{x:this.Mh.start.x+this.Mh.step.x*t.iFirstUniqueVector.secondary,y:this.Mh.start.y+this.Mh.step.y*t.iFirstUniqueVector.primary},r="columns"===this.Mh.dataOrder?{x:this.Mh.step.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.Mh.step.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.Mh.step.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.Mh.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.ZE={gridTiles:c,gridTileSizes:d}}Gs(){const t=this.YE,e=this.Vr,i=this.Nr(),s=this.Ma,r=s!==this.Wa,n=e instanceof G&&e,o=e instanceof z&&e,h=n&&n.getPalette(),a=this.$E.o,l=this.$E.M(),u=this.Hn,c=this.pr.M();this.KE=this.KE||this.qE();const d=this.KE,f=ig(t,d,u?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));f.size>0&&(ng(this.iD,f,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.XE=!0),this.JD.jB(this.ct);const g=this.GR;if((i||a)&&(h?(this.JE=this.IO.vR(h,this.QE,this.JE),this.QE=h):(this.JE=void 0,this.IO.NL.vr(this.QE),this.QE=void 0),g.tile=n&&this.JE?{renderMode:"paletted",fillStylePaletted:n,colorLookupTexture:this.JE,shader:this.iD.zB(df["2D"],df.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===l&&"bilinear",flipXY:"rows"===this.Mh.dataOrder,intensityTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN}),df.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:bf(this.ct),flipXY:"rows"===this.Mh.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:bf(this.ct),flipXY:"rows"===this.Mh.dataOrder,normalSource:void 0}))}:void 0),r){const t=s instanceof tt&&s,e=t&&t.getFillStyle(),i=e instanceof z&&e;g.wireframe=t&&i?-1===t.getThickness()?{renderMode:"primitive",shader:this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Mh.dataOrder,axisWorldTranslation:bf(this.ct),normalSource:void 0})),fillStyleSolid:i}:{renderMode:"triangulated",shader:this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Mh.dataOrder,axisWorldTranslation:bf(this.ct),normalSource:void 0})),geometry:Ff(this.iD,1),solidLine:t,fillStyleSolid:i}:void 0,g.wireframe?this.tz=this.tz||this.iz():this.tz&&(this.iD.ZB(this.tz.wireframeCoordinatesBuffer),this.tz=void 0)}return g.mousePicking=c?this.GR.mousePicking||{shader:this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:bf(this.ct),flipXY:"rows"===this.Mh.dataOrder,normalSource:void 0}))}:void 0,this.GR=g,this.Hn=!1,this.YE.length=0,this.Ur(e),this.Wa=s,this.$E.o=!1,this}qE(){const t=this.ZE.gridTiles.map((t=>{const e=rg(this.iD,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e}})),e=this.ZE.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.iD.RB([0,0,1,0,0,1,1,1]),s=this.iD.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}iz(){const t=this.Mh.primaryDimensionVectorsCount+1+this.Mh.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{if(1===t)this.iD.UB(e("uColor"),this.zO);else if("solid"===i.renderMode){const{fillStyleSolid:t}=i;this.iD.UB(e("uColor"),t.getColor())}return this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).NB(s.rectangleLocationsBuffer,void 0,{location:r("aPos"),size:2}).GB(e("uScaling"),[this.Mh.step.x*this.Mh.columns,this.Mh.step.y*this.Mh.rows]).GB(e("uTranslationAxis"),[this.Mh.start.x,this.Mh.start.y]).Op(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),!0}));else if("paletted"===i.renderMode){const{colorLookupTexture:r,fillStylePaletted:n}=i;this.iD.VB(e,((i,o,h)=>{let l=!1;var u,c;return this.iD.$D(e).GB(i("uScale"),this.JD.$B()).GB(i("uDisp"),this.JD.YB()).HB(i("uLookupTexture"),r.texture,0).WB(i("uLookupMin"),n.getPalette().min).WB(i("uLookupMax"),n.getPalette().max).WB(i("uLookupTextureHeightPx"),r.textureHeight).NB(s.rectangleLocationsBuffer,void 0,{location:o("aPos"),size:2}).WB(i("uIsHighlighted"),this.br).UB(i("uHighlightColorOffset"),this.Ar).WB(i("uRenderEffectMask"),2===t?1:0),u=t=>{this.iD.GB(i("uTileDimensions"),["columns"===this.Mh.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.Mh.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},c=(t,e)=>{let r;const n=this.iD.ZD();if("bilinear"===this.$E.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.iD.aL(i("uTileBounds"),r).GB(i("uScaling"),[t.renderSizeAxis.x,t.renderSizeAxis.y]).GB(i("uTranslationAxis"),[t.startRenderLocationAxis.x,t.startRenderLocationAxis.y]).HB(i("uTileIntensityValues"),t.intensityDataTexture,1).Op(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),l=!0},s.gridTileSizes.forEach((t=>{u(t),t.tiles.forEach((t=>{c(t)}))})),l}))}}const n=this.tz,o=this.GR.wireframe,h=1===t||null==o?void 0:o.shader;if(n&&o&&h&&"primitive"===o.renderMode){const e=h,{fillStyleSolid:i}=o;this.iD.$D(e).VB(e,((e,s,r)=>((this.ct instanceof Ti||this.ct instanceof Ga)&&this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()),this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).UB(e("uColor"),i.getColor()).NB(n.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).GB(e("uScaling"),[this.Mh.step.x,this.Mh.step.y]).GB(e("uTranslationAxis"),[this.Mh.start.x,this.Mh.start.y]).Op(this.iD.gl.LINES,2*n.wireframeSegmentsLength),!0)))}else if(n&&o&&"triangulated"===o.renderMode){const{shader:e,geometry:i,solidLine:s,fillStyleSolid:r}=o;this.iD.$D(e).VB(e,((e,o,h)=>((this.ct instanceof Ti||this.ct instanceof Ga)&&this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()),this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).UB(e("uColor"),r.getColor()).WB(e("uThicknessPixels"),s.getThickness()).GB(e("uRatioPxClip"),[2/this.Li.Et().x,2/this.Li.Et().y]).NB(n.wireframeCoordinatesBuffer,1,{location:o("aLocationA"),size:2},{location:o("aLocationB"),size:2}).GB(e("uScaling"),[this.Mh.step.x,this.Mh.step.y]).GB(e("uTranslationAxis"),[this.Mh.start.x,this.Mh.start.y]),i.$D(h,!1).Op(n.wireframeSegmentsLength),!0)))}return this}Iy(t){return this.YE.push(t),sg(this.ZE.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this}qn(){return this.XE&&(this.ZE.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.Hn=!0,this.XE=!1),this}dispose(){super.dispose(),this.IO.NL.vr(this.QE),this.QE=void 0,this.JE=void 0;const t=this.KE;t&&(t.gridTiles.forEach((t=>{this.iD.RD(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.iD.ZB(t.rectangleLocationsBuffer)),this.KE=void 0;const e=this.tz;return e&&this.iD.ZB(e.wireframeCoordinatesBuffer),this.tz=void 0,this.GR={},this}OD(){return this.dispose(),this}jS(t){const e=t,i="columns"===this.Mh.dataOrder?e.x:e.y,s="columns"===this.Mh.dataOrder?e.y:e.x,r="columns"===this.Mh.dataOrder?this.Mh.start.x:this.Mh.start.y,n="columns"===this.Mh.dataOrder?this.Mh.start.y:this.Mh.start.x;let o=(i-r)/("columns"===this.Mh.dataOrder?this.Mh.step.x:this.Mh.step.y),h=(s-n)/("columns"===this.Mh.dataOrder?this.Mh.step.y:this.Mh.step.x);o=Math.floor(At(o,0,this.Mh.primaryDimensionVectorsCount-1)),h=Math.floor(At(h,0,this.Mh.secondaryDimensionVectorsCount-1));const a=this.sz(o,h),l="columns"===this.Mh.dataOrder?{x:this.Mh.start.x+(o+.5)*this.Mh.step.x,y:this.Mh.start.y+(h+.5)*this.Mh.step.y}:{x:this.Mh.start.x+(h+.5)*this.Mh.step.x,y:this.Mh.start.y+(o+.5)*this.Mh.step.y},u="columns"===this.Mh.dataOrder?o:h,c="columns"===this.Mh.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}aC(t){if(t.xthis.Rn.max.x||t.ythis.Rn.max.y)return;const e=t,i="columns"===this.Mh.dataOrder?e.x:e.y,s="columns"===this.Mh.dataOrder?e.y:e.x,r="columns"===this.Mh.dataOrder?this.Mh.start.x:this.Mh.start.y,n="columns"===this.Mh.dataOrder?this.Mh.start.y:this.Mh.start.x,o="columns"===this.Mh.dataOrder?this.Mh.step.x:this.Mh.step.y,h="columns"===this.Mh.dataOrder?this.Mh.step.y:this.Mh.step.x,a=At((i-r)/o-.5,0,this.Mh.primaryDimensionVectorsCount-1),l=At((s-n)/h-.5,0,this.Mh.secondaryDimensionVectorsCount-1),u=At(Math.ceil(a)-1,0,this.Mh.primaryDimensionVectorsCount-1),c=At(Math.ceil(l)-1,0,this.Mh.secondaryDimensionVectorsCount-1),d={point:{x:u,y:c},value:this.sz(u,c)},f={point:{x:u,y:c+1},value:this.sz(u,c+1)},g={point:{x:u+1,y:c},value:this.sz(u+1,c)},m={point:{x:u+1,y:c+1},value:this.sz(u+1,c+1)},p=aa({x:a,y:l},d,f,g,m);if(void 0===p)return;const y=At(Math.floor(a+.5),0,this.Mh.primaryDimensionVectorsCount-1),x=At(Math.floor(l+.5),0,this.Mh.secondaryDimensionVectorsCount-1),S="columns"===this.Mh.dataOrder?y:x,v="columns"===this.Mh.dataOrder?x:y,b=t;return{x:b.x,y:b.y,column:S,row:v,cellValue:p}}sz(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}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return 0}do(){return 0}rC(){const t=[];return this.ZE.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.Sv[0].boundaries.min.x:Me:this.Rn.min.y=this.Sv.length>0?this.Sv[0].boundaries.min.y:Me}return this.Sv.forEach((t=>t.shape.Gs())),this.da.o=!1,this}tD(t){return this.Sv.forEach((e=>e.shape.tD(t))),this}Ly(t){if(0===t.length)return this;let e=0;const i=this.hz.dataPerSegment,s=t.length;do{let r=this.Sv[this.Sv.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this.Mh.scrollDimension?i:this.Mh.resolution,rows:"rows"===this.Mh.scrollDimension?i:this.Mh.resolution,heatmapDataType:this.Mh.heatmapDataType,dataOrder:this.Mh.scrollDimension,step:this.Mh.step,start:"columns"===this.Mh.scrollDimension?{x:this.Mh.start.x+this.Mh.step.x*this.ez,y:this.Mh.start.y}:{x:this.Mh.start.x,y:this.Mh.start.y+this.Mh.step.y*this.ez}};this.Sv.length>0&&(t.start="columns"===this.Mh.scrollDimension?{x:t.start.x-1*this.Mh.step.x,y:t.start.y}:{x:t.start.x,y:t.start.y-1*this.Mh.step.y},o=!0);const e=new hg(this.IO,this.FO,this.ct,bt,[],t,this.EO,this.zO).Cy(this.$E.M()).ps(this.Vr)._a(this.Ma);r={shape:e,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.ez,hasJoint:!1,boundaries:e.Rn},this.Sv.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.Mh.resolution};o&&(u.values.unshift(this.rz),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.Iy(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),r.boundaries=r.shape.Rn,this.rz=l[l.length-1],this.ez+=a,e+=a}while(e{t.shape.dispose().OD()})),this.Sv.length=0,this.Rn=this.Mh.initialBoundaries,this.ez=0,this.rz=void 0,this}ps(t){return super.ps(t),this.Sv.forEach((t=>t.shape.ps(this.Vr))),this}_a(t){return super._a(t),this.Sv.forEach((t=>t.shape._a(this.Ma))),this}Cy(t){return super.Cy(t),this.Sv.forEach((e=>e.shape.Cy(t))),this}dispose(){return super.dispose(),this.Sv.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.Sv.forEach((e=>e.shape.setVisible(t))),this}OD(){return this.Sv.forEach((t=>t.shape.OD())),this}jS(t){const e=nt(t,this.ct,this.engine.ct),i=this.Sv.reduce(((i,s)=>{const r=s.shape.jS(t);if(r){const t=Re(nt(r,this.ct,this.engine.ct),e);if(void 0===i||t=this.ez||"rows"===this.Mh.scrollDimension&&e>=this.ez)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}aC(t){const e=nt(t,this.ct,this.engine.ct),i=this.Sv.reduce(((i,s)=>{const r=s.shape.aC(t);if(r){const t=Re(nt(r,this.ct,this.engine.ct),e);if(void 0===i||t=this.ez||"rows"===this.Mh.scrollDimension&&e>=this.ez)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return 0}do(){return 0}Ir(t){return super.Ir(t),this.Sv.forEach((e=>e.shape.Ir(t))),this}}const ug={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)=>ug.multiply(t,ug.translation(e,i)),rotate:(t,e)=>ug.multiply(t,ug.rotation(e)),scale:(t,e,i)=>ug.multiply(t,ug.scaling(e,i)),multiply(t,e){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],h=t[5],a=t[6],l=t[7],u=t[8],c=e[0],d=e[1],f=e[2],g=e[3],m=e[4],p=e[5],y=e[6],x=e[7],S=e[8];return[c*i+d*n+f*a,c*s+d*o+f*l,c*r+d*h+f*u,g*i+m*n+p*a,g*s+m*o+p*l,g*r+m*h+p*u,y*i+x*n+S*a,y*s+x*o+S*l,y*r+x*h+S*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class cg extends Os{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.nz=[],this.JD=new pf,this.oz=[u(0,0),u(0,0),u(0,0),u(0,0)],this.az=m(u(0,0),u(0,0)),this.lz=m(u(0,0),u(0,0)),this.uz=u(0,0),this.cz=u(0,0),this.jv=u(0,0),this.dz=u(0,0),this.fz=0,this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO(),this.FO=e,this.UR=t.Mh.Lh}Gs(){const t=this.Wr(),e=this.Hr(),i=this.pr.M();if(t){const t=this.iD,s=this.iD.ZD();if(this.JD.jB(this.ct),this.en.o){this.gz&&this.gz.YD(this),this.font.S(es(this.en.M()));const t=this.font.M();this.gz=this.iD.ys(t.properties.family),this.gz.$D(this)}const r=this.font.o,n=r||this.Kr.o;if(n&&this.gz){const e=this.font.M();[this.pz,this.lz]=this.gz.XD(this.Kr.M(),e.properties),this.nz.forEach((e=>{e.texCoordBuff&&t.ZB(e.texCoordBuff),e.vertexBuff&&t.ZB(e.vertexBuff)})),this.nz=this.pz.map((e=>({texCoordBuff:t.RB(e.texCoords,!1),texture:e.texture,info:e}))),this.en.o=!1,this.font.o=!1,this.Kr.o=!1}const o=this.ct.pi()||e,h=this.qr.o||this.Qr.o||this.Jr.o||this.tn.o||this.rn.o||this._t.o||n||o,a=this.rn.M(),l=Ze(u(this.Qr.M()+1,this.Jr.M()+1),.5);if(h&&this.pz&&(this.uz=u(-(a.left*s+this.lz.max.x-this.lz.min.x+a.right*s)*l.x-this.lz.min.x+a.right*s,-(a.bottom*s+this.lz.max.y-this.lz.min.y+a.top*s)*l.y-this.lz.min.y+a.top*s)),(h||o||this.sn.o||this.Nr())&&this.Vr!==F){if(this.pz){const e=Ke(this.qr.M(),this.tn.M()),i=nt(e,this.ct,this.Li.ct),r=Ze(i,s);this.dz=r;const o=ni(this.sn.M());this.fz=o,n&&this.nz.forEach((e=>{const i=e.info;i&&(e.vertexBuffLen=i.vertices.length/2,e.vertexBuff?t.mL(e.vertexBuff,i.vertices,!0):e.vertexBuff=t.RB(i.vertices,!0))}));const h=this._t.M(),c=[Ke(Ye(u((this.lz.min.x+(-h.left-a.left)*s+this.uz.x)/s,(this.lz.max.y+(h.top+a.top)*s+this.uz.y)/s),this.hn,o),i),Ke(Ye(u((this.lz.max.x+(h.right+a.right)*s+this.uz.x)/s,(this.lz.max.y+(h.top+a.top)*s+this.uz.y)/s),this.hn,o),i),Ke(Ye(u((this.lz.max.x+(h.right+a.right)*s+this.uz.x)/s,(this.lz.min.y+(-h.bottom-a.bottom)*s+this.uz.y)/s),this.hn,o),i),Ke(Ye(u((this.lz.min.x+(-h.left-a.left)*s+this.uz.x)/s,(this.lz.min.y+(-h.bottom-a.bottom)*s+this.uz.y)/s),this.hn,o),i)];this.oz=[nt(c[0],this.Li.ct,this.ct),nt(c[1],this.Li.ct,this.ct),nt(c[2],this.Li.ct,this.ct),nt(c[3],this.Li.ct,this.ct)];const d=ze(c);this.cz=u(-(d.max.x-d.min.x)*s*l.x-d.min.x*s+this.dz.x,-(d.max.y-d.min.y)*s*l.y-d.min.y*s+this.dz.y),this.mz=Je(d.max,d.min);const f=ze(this.oz),g=this.ct.Yt(f.min,this.cz),m=this.ct.Yt(f.max,this.cz);this.az=ze([g,m])}this.Vr instanceof $?this.$O=Mf(this.az,this.ct,this.Vr.getPosition(),this.Vr.getExtent(),this.Vr.getShape(),this.iD.ZD()):this.Vr instanceof Z?this.YO=Af(this.az,this.ct,this.Vr.getAngle(!0),this.iD.ZD()):(this.$O=void 0,this.YO=void 0)}const c=this.Vr instanceof z&&this.Vr,d=this.Vr instanceof $&&this.Vr,f=this.Vr instanceof Z&&this.Vr,g=c||d||f;(this.Nr()||r)&&(this.tB=g?this.iD.zB(df["2D"],df.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.UR}),df.Color({dataType:d?["gradient",d]:f?["gradient",f]:"uniform",maskTexture:!0})):void 0),this.yz=i&&g?this.yz||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.UR})):void 0,this.qr.o=!1,this.Qr.o=!1,this.Jr.o=!1,this.tn.o=!1,this.sn.o=!1,this.Ur(this.Vr)}return this.nn=t,this}tD(t){if(this.Wr()){const e=1===t?this.yz:this.tB;if(!e||0===this.nz.length)return this;const i=this.iD.gl.drawingBufferWidth,s=this.iD.gl.drawingBufferHeight;let r=ug.projection(i,s,-1);const n=ug.translation(this.uz.x,this.uz.y),o=ug.translation(this.cz.x,this.cz.y);r=ug.translate(r,this.dz.x,this.dz.y),r=ug.multiply(r,o),r=ug.rotate(r,this.fz),r=ug.multiply(r,n),1===t&&(r=ug.scale(r,this.lz.max.x,this.lz.max.y)),this.iD.$D(e).VB(e,((e,i,s,n)=>{if(this.iD.uL(e("uMatrix"),r).WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0),this.UR&&this.iD.GB(n("uViewportSizePx"),[this.Li.Et().x*this.iD.ZD(),this.Li.Et().y*this.iD.ZD()]),1===t)this.iD.UB(e("uColor"),this.zO);else if(this.Vr instanceof z)this.iD.UB(e("uColor"),this.Vr.getColor());else if(this.Vr instanceof $&&this.$O){this.iD.GB(e("uCenter"),this.$O.center).GB(e("uDistance"),this.$O.distance).aL(e("uBounds"),this.$O.bounds).WB(e("uAspect"),this.$O.aspectRatio);const t=this.Vr.getColorStops();for(let i=0;i{this.iD.xL(i("aPos"),t.vertexBuff).xL(i("aMaskTextureCoord"),t.texCoordBuff).HB(e("uMaskTexture"),t.texture,0).Op(this.iD.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return this}Mi(){return this.Wr()?this.oz:[]}Ac(){return this.Wr()&&this.mz?this.mz:u(0,0)}Et(){if(this.Wr()&&this.az){const t=this.az;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}OD(){return this.nz.forEach((t=>{t.texCoordBuff&&this.iD.ZB(t.texCoordBuff),t.vertexBuff&&this.iD.ZB(t.vertexBuff)})),this.nz=[],this.gz&&this.gz.YD(this),this}yt(){return this.az.max.x}ft(){return this.az.min.x}xt(){return this.az.max.y}St(){return this.az.min.y}co(){return 0}do(){return 0}}class dg{constructor(t,e,i){this.Sz=new Set,this.xz=t=>(this.Sz.add(t),t),this.bz=t=>(this.Sz.delete(t),t.OD(),this),this.Li=t,this.Br=e,this.vz=i}QP(t){this.Sz.delete(t)&&this.Sz.add(t)}G(){for(const t of this.Sz)t.OD().dispose();this.Li.Qe(this.Br)}Bi(){return this.Li.Bi(),this}Je(){return this.Br}}class fg extends dg{constructor(){super(...arguments),this.Mz=y(void 0),this.Or=!1}Wy(t){return this.Mz.S(t),this}Qg(){return this.Mz.M()}}class gg extends fg{constructor(t,e,i){super(t,e,i),this.IO=t,this.gl=t.PO(),this._z=this.Sz}OB(t){const e=t instanceof Bs&&t;if(!e)return we;const i=e.ft(),s=e.yt(),r=e.St(),n=e.xt();if(i===Me||s===Ae||r===Me||n===Ae)return we;const o=e.co(),h=e.do(),a=ks({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.ct),l={min:nt(a.min,e.ct,t.Li.ct),max:nt(a.max,e.ct,t.Li.ct)},u=this.Mz.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.xt.Er()-e.Er()));this.Sz.clear();for(const e of t)this.Sz.add(e)}for(const t of this.Sz)t.Gs();return this}tD(t,e){const i=this.Mz.M();if(i&&this.gl.LB(i.x*this.gl.ZD()*e,i.y*this.gl.ZD()*e,i.width*this.gl.ZD()*e,i.height*this.gl.ZD()*e),1!==t)for(const e of this.Sz)e.getVisible()&&e.tD(t);else for(const e of this.Sz)e.getMouseInteractions()&&e.getVisible()&&e.tD(t);return this.gl.PB(!1),this}}class mg extends xd{constructor(t){super(t)}}class pg extends mg{constructor(t){super(t),this.Tz="attribute";const{vertices:e,drawSize:i,drawMode:s}=yg(t.gl);this._D=t.RB(e),this.ER=i,this.zR=s}Op(t,e,i,s){return this.iD.NB(this._D,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}).CL(this.zR,0,this.ER,e),this}lD(){this.iD.ZB(this._D)}}const yg=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 xg extends mg{constructor(t,e){super(t),this.Tz="attribute",this.Iz=e;const{vertices:i,indices:s}=Sg();this._D=t.RB(i),this.RR=t.yL(s),this.ER=s.length,this.zR=t.gl.TRIANGLES}Op(t,e,i,s){return this.iD.NB(this._D,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).wL(this.RR).WB(t.uniform("uEdgeRoundness"),this.Iz/2).IL(this.zR,this.ER,0,e),this}lD(){this.iD.ZB(this._D),this.iD.ZB(this.RR)}Fz(t){return this.Iz=t,this}Pz(){return this.Iz}}const Sg=()=>{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=be.multiply(o,-1),l=be.multiply(h,-1),u=i;e[i]={thicknessDirection:be.addVec(t,o,h),edge:be.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:be.addVec(t,a,h),edge:be.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:be.addVec(t,a,l),edge:be.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:be.addVec(t,o,l),edge:be.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=be.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=be.normalize(be.lerp(t,n.direction,o)),a=Math.PI/2-be.angle(h,t),l=be.addVec(be.multiply(be.multiply(n.direction,-1),1-Math.cos(a)),be.multiply(be.multiply(t,-1),1-Math.sin(a)),be.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.sL.aD.get(e);return i||(i=void 0!==e&&e>0?new xg(t,At(e,0,1)):new pg(t),t.sL.aD.set(e,i),i)};class bg extends sf{ym(t){return this._B=this.lm.M(),this.lm.S(t),this}Py(t){return this.Dz=t,this}Dy(){return this.Dz}}class Mg extends bg{constructor(t,e,i,s,r){super(t,e,i),this.Bz=t,this.EO=s,this.zO=r,this.IO=t.IO,this.iD=this.IO.PO()}}class Ag extends Mg{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Dz="cull-back",this.Rn=De,this.Lz={},this.Oz=[],this.Vr=ls.fillStyle,this.lm.S(Ko)}Gs(t){const e=this.Oz,i=this.Vr,s=i!==F,r=this.Rz,n=this.Nr()||this.Ez!==r,o=this.MB(),h=this.pr.M(),a=this.pr.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.zz||0;let r=s;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.Lz[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.TE&&i.set(this.TE),this.TE=i,this.Vz=e,this.Nz=s*t}const d=i instanceof V?i.getFallbackColor():void 0;for(const i of e){const e=i.id,s=void 0!==e&&this.Lz[e],r=[i.xCenter,i.yCenter,i.zCenter,i.xSize,i.ySize,i.zSize,i.color?i.color.r:d?d.r:void 0,i.color?i.color.g:d?d.g:void 0,i.color?i.color.b:d?d.b:void 0,i.color?i.color.a:d?d.a:void 0,i.value];if(s){for(let e=0;e0){const e=m({x:Me,y:Me,z:Me},{x:Ae,y:Ae,z:Ae});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.Rn=e}this.zz=r,this.Oz.length=0}return this.Ur(i),this.Ez=r,this.lm.o=!1,this.pr.o=!1,this}tD(t){const e=1===t?this.yz:this.tB,i=this.Gz,s=this.OR,r=this.Vr,n=this.zz,o=this.lm.M();return e&&s&&void 0!==n&&this.iD.VB(e,((h,a,l)=>{let u=!1;const c=a("aPos"),d=a("aOffsetAxis");this.iD.$D(e).lL(h("uScale"),this.Bz.JD.$B()).lL(h("uDisp"),this.Bz.JD.YB()).cL(h("uViewProjectionMatrix"),this.Uz).WB(h("uIsHighlighted"),1===t||2===t?0:this.br).UB(h("uHighlightColorOffset"),this.Ar).WB(h("uRenderEffectMask"),2===t?1:0);const f={location:c,size:3},g={location:d,size:3},m={location:void 0,size:4},p={location:void 0,size:1};if(1!==t&&"phong"===o.type&&this.iD.lL(h("uCameraLoc"),this.$z).lL(h("uLightLoc"),this.Yz).WB(h("uAmbientReflection"),o.ambientReflection).WB(h("uSpecularReflection"),o.specularReflection).WB(h("uDiffuseReflection"),o.diffuseReflection).WB(h("uShininess"),o.shininess).UB(h("uLightColor"),o.specularColor).UB(h("uAmbientColor"),o.ambientColor),1===t)this.iD.UB(h("uColor"),this.zO);else if(r instanceof z)this.iD.UB(h("uColorDiffuse"),r.getColor());else if(r instanceof V){const t=a("aColor");m.location=t}else if(r instanceof G){const t=r.getLookUpProperty(),e=r.getPalette();"value"===t&&(p.location=a("aLookupValue")),this.iD.HB(h("uLookupTexture"),this.HR.texture,0).WB(h("uLookupMin"),e.min).WB(h("uLookupMax"),e.max).WB(h("uLookupTextureHeightPx"),this.HR.textureHeight)}return s&&(this.iD.NB(s,1,f,g,m,p),i.Op(l,n,"phong"===o.type&&1!==t,!1),u=!0),u})),this}OD(){return this.OR&&(this.iD.ZB(this.OR),this.OR=void 0),this.IO.NL.vr(this.WR),this.HR=void 0,this.WR=void 0,this.tB=void 0,this}Cm(t){this.Oz=ie(this.Oz,t,{canReturnB:!0})}ps(t){return this.Vr=Is(this.Vr,t),this}gs(){return this.Vr}wm(t){return this.Rz=void 0!==t&&t>0?At(t,0,1):void 0,this}Wz(){return this.Rz}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}vm(){return this.Rn.max.z}Mm(){return this.Rn.min.z}co(){return 0}do(){return 0}_m(){return 0}Nr(){return Cs(this.Gr,this.Vr)}Ur(t){this.Gr=t}}class wg extends xd{constructor(t,e){super(t),this.Tz="custom",this.BR=e;const{vertices:i,drawSize:s}=this.LR();this.OR=t.RB(i),this.ER=s}$D(t){return this.iD.NB(this.OR,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Op(t){return this.iD.CL(this.iD.gl.TRIANGLE_STRIP,0,this.ER,t),this}LR(){const t=this.BR,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}}lD(){this.iD.ZB(this.OR)}}const Dg=(t,e=16)=>{let i=t.sL.nD.get(e);return i||(i=new wg(t,e),t.sL.nD.set(e,i),i)};class Tg extends Mg{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Dz="cull-back",this.Xz=De,this.ua=[],this.jz=!1,this.sa=ls.lineStyle,this.lm.S(jo)}Gs(t){const e=this.jz,i=this.sa,s=this.ra!==i,r=this.MB(),n=e;if(e){this.Zz&&(this.iD.ZB(this.Zz),this.Zz=void 0);const t=jt(this.ua);this.Zz=this.iD.RB(t)}if(n&&(this.Xz=Ve(this.ua)),s||r){const t=8,e=i instanceof tt&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.GR=void 0,e instanceof z&&("primitive"===s?this.GR={type:s,shader:this.iD.zB(df["3D"],df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0}),df.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.GR={type:s,shader:this.iD.zB(df["3D"],df.ColorShaded3D({dataType:"uniform",shadingStyle:this.lm.M().type}),df.LineInstanced3D({axisWorldTranslation:bf(this.ct)})),geometry:Dg(this.iD,t),fillStyle:e}))}return this.jz=!1,this.ra=i,this.lm.o=!1,this}tD(t){if(1===t)return this;const e=this.iD.gl,i=this.GR,s=this.Zz,r=this.sa,n=this.lm.M();if(i&&s&&r instanceof tt)switch(i.type){case"instanced":{const o=.5*this.Lr.nm(r.thickness),h=i.fillStyle.getColor(),a=i.shader,l=i.geometry;this.iD.VB(a,((i,r,u)=>{this.iD.$D(a).lL(i("uScale"),this.Bz.JD.$B()).lL(i("uDisp"),this.Bz.JD.YB()).cL(i("uViewProjectionMatrix"),this.Uz).UB(i("uColorDiffuse"),h).WB(i("uOffsetWU"),o).WB(i("uIsHighlighted"),this.br).UB(i("uHighlightColorOffset"),this.Ar).WB(i("uRenderEffectMask"),2===t?1:0),"phong"===n.type&&this.iD.lL(i("uCameraLoc"),this.$z).lL(i("uLightLoc"),this.Yz).WB(i("uAmbientReflection"),n.ambientReflection).WB(i("uSpecularReflection"),n.specularReflection).WB(i("uDiffuseReflection"),n.diffuseReflection).WB(i("uShininess"),n.shininess).UB(i("uLightColor"),n.specularColor).UB(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.iD.vL(c,1),e.enableVertexAttribArray(c),e.vertexAttribPointer(d,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.iD.vL(d,1),e.enableVertexAttribArray(d),l.$D(u).Op(this.ua.length/2),!0}));break}case"primitive":{const n=r instanceof tt?r.getFillStyle():void 0,o=n&&n instanceof z?n.getColor():void 0;if(o){const r=i.shader;this.iD.VB(r,((i,n)=>(this.iD.$D(r).lL(i("uScale"),this.Bz.JD.$B()).lL(i("uDisp"),this.Bz.JD.YB()).cL(i("uViewProjectionMatrix"),this.Uz).UB(i("uColor"),o).WB(i("uIsHighlighted"),this.br).UB(i("uHighlightColorOffset"),this.Ar).WB(i("uRenderEffectMask"),2===t?1:0).NB(s,void 0,{location:n("aPos"),size:3}).Op(e.LINES,this.ua.length),!0)))}break}}return this}Kn(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.iD.ef.Ph&&s>i.length&>.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}}lD(){this.iD.ZB(this.OR)}}const Bg=(t,e)=>{const i=Math.round(e);i<3&&de(0,bt);const s=i;let r=t.sL.oD.get(Array.from(t.sL.oD.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new Eg(t,i,s),t.sL.oD.set({sectors:i,stacks:s},r),r)};class kg extends Mg{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Dz="cull-back",this.Sv=[],this.GR={},this.AE=new Wf(this.Sv,(t=>t.vertexBuffer&&this.iD.ZB(t.vertexBuffer)),!0),this.ca=[],this.En=0,this.zn=[],this.Vn=0,this.Rn=De,this.Nn=De,this.Hn=!1,this.sa=ls.lineStyle,this.Tm=ls.pointStyle3D,this.lm.S(Ko),this.kE={attributesPerVertex:3,prepareRenderData:(t,e)=>jt(t)}}Gs(t){const e=this.Hn,i=this.zn,s=this.Vn,r=s>0,n=this.sa,o=n!==this.ra,h=this.Tm,a=h!==this.Jz,l=this.MB(),u=this.pr.o,c=this.pr.M();this.Nn&&(this.Rn=Ge(this.Rn,this.Nn),this.Nn=void 0),r&&(this.ca=ie(this.ca,i,{canReturnB:!0}),this.En+=s);let d=i,f=s;if(e&&(this.Sv.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=De})),this.AE.pE(),d=this.ca,f=this.En),f>0){const t=1e5,e=Math.floor(this.IO.Qz/(this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.kr("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=At(i,t,e);this.AE.cE(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:De,vertexBuffer:this.iD.gL(t*this.kE.attributesPerVertex,this.kE.prepareRenderData(e,i))})),((t,e,i,s)=>{this.iD.pL(t.vertexBuffer,t.existingCoordinatesCount*this.kE.attributesPerVertex,this.kE.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=n instanceof tt&&n,i=e&&e.getFillStyle(),s=i instanceof z&&i,r=i instanceof G&&i,o=s||r,a=h instanceof ji&&h.getSize(),l=h instanceof ji&&h.getFillStyle(),u=l instanceof z&&l,d=l instanceof G&&l,f=u||d,g=h instanceof ji&&h.getWireframeStyle(),m=g&&g instanceof tt&&g,p=m&&m.getFillStyle(),y=p&&p instanceof z&&p,x=n.getThickness()<0||1===n.getThickness()&&this.kr("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",S=r?["lookup",r.getLookUpProperty()]:"uniform";if("primitive"===x&&o?t.lines={type:"primitive",fillStyleSolid:s,fillStylePaletted:r,shader:this.iD.zB(df["3D"],df.Color({dataType:S}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})),mousePicking:c?{shader:this.iD.zB(df["3D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0}))}:void 0}:"instanced"===x&&e&&o&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:s,fillStylePaletted:r,shader:this.iD.zB(df["3D"],df.ColorShaded3D({dataType:S,shadingStyle:this.lm.M().type}),df.LineInstanced3D({axisWorldTranslation:bf(this.ct)})),geometry:Ig(this.iD,e.getThickness()),mousePicking:c?{shader:this.iD.zB(df["3D"],df.Color({dataType:"uniform"}),df.LineInstanced3D({axisWorldTranslation:bf(this.ct)}))}:void 0}),t.markers=void 0,f){const e=te(h.getShape(),{cube:()=>vg(this.iD),sphere:()=>Cg(this.iD,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof a&&a,pointSizeAxis:"object"==typeof a&&a,fillStyleSolid:u,fillStylePaletted:d,shader:this.iD.zB(df["3D"],df.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty()]:"uniform",shadingStyle:this.lm.M().type,wireframe:!1!==y}),df.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof a?"nwu":"axis",symmetric:"number"==typeof a,halved:!0},axisWorldTranslation:bf(this.ct),normalSource:e.Tz})),mousePicking:c?{shader:this.iD.zB(df["3D"],df.Color({dataType:"uniform"}),df.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof a?"nwu":"axis",symmetric:"number"==typeof a,halved:!0},axisWorldTranslation:bf(this.ct),normalSource:void 0}))}:void 0,wireframe:m&&y&&{thickness:m.getThickness(),fillStyleSolid:y}}}if(this.GR=t,r){if(r&&r.lut.isValid){const t=r.getPalette();this.tV=this.IO.vR(t,this.iV,this.tV),this.iV=t}}else this.IO.NL.vr(this.iV),this.iV=void 0;if(d){if(d&&d.lut.isValid){const t=d.getPalette();this.sV=this.IO.vR(t,this.eV,this.sV),this.eV=t}}else this.IO.NL.vr(this.eV),this.eV=void 0}return this.Hn=!1,this.zn=[],this.Vn=0,this.ra=n,this.Jz=h,this.lm.o=!1,this.pr.o=!1,this}tD(t){var e,i;const s=this.iD.gl,{lines:r,markers:n}=this.GR,o=this.lm.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.iD.VB(e,((r,h,u)=>{let c=!1;return this.iD.$D(e).lL(r("uScale"),this.Bz.JD.$B()).lL(r("uDisp"),this.Bz.JD.YB()).cL(r("uViewProjectionMatrix"),this.Uz).WB(r("uOffsetWU"),this.Lr.nm(n.getThickness())).WB(r("uIsHighlighted"),1===t||2===t?0:this.br).UB(r("uHighlightColorOffset"),this.Ar).WB(r("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.iD.lL(r("uCameraLoc"),this.$z).lL(r("uLightLoc"),this.Yz).WB(r("uAmbientReflection"),o.ambientReflection).WB(r("uSpecularReflection"),o.specularReflection).WB(r("uDiffuseReflection"),o.diffuseReflection).WB(r("uShininess"),o.shininess).UB(r("uLightColor"),o.specularColor).UB(r("uAmbientColor"),o.ambientColor),1===t?this.iD.UB(r("uColor"),this.zO):a?this.iD.UB(r("uColorDiffuse"),a.getColor()):l&&this.tV&&this.iD.HB(r("uLookupTexture"),this.tV.texture,0).WB(r("uLookupMin"),l.lut.min).WB(r("uLookupMax"),l.lut.max).WB(r("uLookupTextureHeightPx"),this.tV.textureHeight),this.Sv.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.iD.vL(e,1),s.enableVertexAttribArray(e),s.vertexAttribPointer(r,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.iD.vL(r,1),s.enableVertexAttribArray(r),i.$D(u).Op(t.existingCoordinatesCount-1),c=!0})),c}))}if(r&&h&&"primitive"===r.type){const e=h,{fillStyleSolid:i,fillStylePaletted:n}=r;this.iD.VB(e,((r,o)=>{let h=!1;return this.iD.$D(e).lL(r("uScale"),this.Bz.JD.$B()).lL(r("uDisp"),this.Bz.JD.YB()).cL(r("uViewProjectionMatrix"),this.Uz).WB(r("uIsHighlighted"),1===t||2===t?0:this.br).UB(r("uHighlightColorOffset"),this.Ar).WB(r("uRenderEffectMask"),2===t?1:0),1===t?this.iD.UB(r("uColor"),this.zO):i?this.iD.UB(r("uColor"),i.getColor()):n&&this.tV&&this.iD.HB(r("uLookupTexture"),this.tV.texture,0).WB(r("uLookupMin"),n.lut.min).WB(r("uLookupMax"),n.lut.max).WB(r("uLookupTextureHeightPx"),this.tV.textureHeight),this.Sv.forEach((t=>{this.iD.NB(t.vertexBuffer,void 0,{location:o("aPos"),size:3}).Op(s.LINE_STRIP,t.existingCoordinatesCount),h=!0})),h}))}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.iD.VB(e,((n,a,c,d)=>{let f=!1;return this.iD.$D(e).lL(n("uScale"),this.Bz.JD.$B()).lL(n("uDisp"),this.Bz.JD.YB()).cL(n("uViewProjectionMatrix"),this.Uz).WB(d("uRatioNwuWu"),this.Bz.hV()).WB(n("uIsHighlighted"),1===t||2===t?0:this.br).UB(n("uHighlightColorOffset"),this.Ar).WB(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.iD.lL(n("uCameraLoc"),this.$z).lL(n("uLightLoc"),this.Yz).WB(n("uAmbientReflection"),o.ambientReflection).WB(n("uSpecularReflection"),o.specularReflection).WB(n("uDiffuseReflection"),o.diffuseReflection).WB(n("uShininess"),o.shininess).UB(n("uLightColor"),o.specularColor).UB(n("uAmbientColor"),o.ambientColor),1===t?this.iD.UB(n("uColor"),this.zO):s?this.iD.UB(n("uColorDiffuse"),s.getColor()):r&&this.sV&&this.iD.HB(n("uLookupTexture"),this.sV.texture,0).WB(n("uLookupMin"),r.lut.min).WB(n("uLookupMax"),r.lut.max).WB(n("uLookupTextureHeightPx"),this.sV.textureHeight),u&&1!==t&&this.iD.WB(n("uWireframeThickness"),u.thickness).UB(n("uWireframeColor"),u.fillStyleSolid.getColor()),!1!==h&&this.iD.lL(n("uOffsetAxis"),[h.x,h.y,h.z]),!1!==l&&this.iD.WB(n("uOffsetNWU"),l),this.Sv.forEach((e=>{this.iD.NB(e.vertexBuffer,1,{location:a("aPos"),size:3}),i.Op(c,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(u)&&1!==t),f=!0})),f}))}return this}Kn(t,e){Array.isArray(t)||(t=[t]),this.zn=ie(this.zn,t,{canReturnB:!0}),this.Vn+=t.length;const i=e||Ve(t);return this.Nn=this.Nn?Ge(this.Nn,i):i,this}ea(t){return this.sa="function"==typeof t?t(this.sa):t,this}ha(){return this.sa}hm(t){return this.Tm="function"==typeof t?t(this.Tm):t,this}rV(){return this.Tm}yt(){return this.Nn?Math.max(this.Nn.max.x,this.Rn.max.x):this.Rn.max.x}ft(){return this.Nn?Math.min(this.Nn.min.x,this.Rn.min.x):this.Rn.min.x}xt(){return this.Nn?Math.max(this.Nn.max.y,this.Rn.max.y):this.Rn.max.y}St(){return this.Nn?Math.min(this.Nn.min.y,this.Rn.min.y):this.Rn.min.y}vm(){return this.Nn?Math.max(this.Nn.max.z,this.Rn.max.z):this.Rn.max.z}Mm(){return this.Nn?Math.min(this.Nn.min.z,this.Rn.min.z):this.Rn.min.z}co(){return Se(this.sa)}do(){return Se(this.sa)}_m(){return Se(this.sa)}$n(){return this.ca}Un(){return this.zn}Jn(){return this.En}Qn(){return this.Vn}qn(){return this.Hn=!0,this.ca.length=0,this.En=0,this.zn=[],this.Vn=0,this.Rn=De,this.Nn=void 0,this}dispose(){return super.dispose(),this.AE.mE(),this.GR={},this.iV&&(this.IO.NL.vr(this.iV),this.iV=void 0),this.tV=void 0,this.eV&&(this.IO.NL.vr(this.eV),this.eV=void 0),this.sV=void 0,this}OD(){return this.dispose(),this}}const Ig=(t,e)=>Dg(t,e>50?20:e>20?16:e>10?12:e>5?8:6),Cg=(t,e)=>{const i=e.getSize();return Bg(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class Pg extends Mg{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Dz="cull-back",this.Sv=[],this.AE=new Wf(this.Sv,(t=>t.vertexBuffer&&this.iD.ZB(t.vertexBuffer)),!1),this.ca=[],this.En=0,this.zn=[],this.Vn=0,this.Rn=De,this.Nn=De,this.Hn=!1,this.Mh=n,this.Pm=ls.pointStyle3D,this.lm.S(Ko);const o=!0===(null==n?void 0:n.individualPointColorEnabled),h=!0===(null==n?void 0:n.individualPointSizeEnabled),a=!0===(null==n?void 0:n.individualLookupValuesEnabled),l=!0===(null==n?void 0:n.individualPointSizeAxisEnabled);let u,c,d,f,g=0;g+=3,o&&(u=g,g+=4),h&&(c=g,g+=1),a&&(d=g,g+=1),l&&(f=g,g+=3);const m=((t,e,i,s)=>t||e||i||s?!t||e||i||s?t||!e||i||s?t||e||!i||s?t||e||i||!s?(r,n,o)=>{const h=3+(t?4:0)+(e?1:0)+(i?1:0)+(s?3:0),a=r.length,l=new Float32Array(a*h);let u=0,c=u;for(let t=0;t((t,e)=>{const i=e&&e.getSize();let s={x:1,y:1,z:1};"object"==typeof i&&(s=i);const r=t.length,n=new Float32Array(6*r);let o=0;for(let e=0;e(t=>{const e=t.length,i=new Float32Array(4*e);for(let s=0,r=0;s((t,e)=>{const i=e&&e.getSize();let s=1;"number"==typeof i&&(s=i);const r=t.length,n=new Float32Array(4*r);for(let e=0,i=0;e((t,e)=>{const i=e&&e instanceof V&&e.getFallbackColor()||E,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;ejt(t))(o,h,a,l);this.kE={individualPointColorEnabled:o,individualPointSizeEnabled:h,individualLookupValuesEnabled:a,individualPointSizeAxisEnabled:l,attributesPerVertex:g,attributeOffsetCoordinate:0,attributeOffsetColor:u,attributeOffsetSize:c,attributeOffsetLookUpValue:d,attributeOffsetPointSize3D:f,prepareRenderData:(t,e)=>m(t,this.Pm,this.Pm.fillStyle)}}Gs(t){const e=this.Hn,i=this.zn,s=this.Vn,r=s>0,n=this.Pm,o=this.Pm!==this.nV,h=this.pr.M(),a=this.pr.o,l=this.MB();this.Nn&&(this.Rn=Ge(this.Rn,this.Nn),this.Nn=void 0),r&&(this.ca=ie(this.ca,i,{canReturnB:!0}),this.En+=s);let u=i,c=s;if(e&&(this.Sv.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=De})),this.AE.pE(),u=this.ca,c=this.En),c>0){const t=Math.floor(this.IO.Qz/(this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=At(c,1e5,t);this.AE.cE(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:De,vertexBuffer:this.iD.gL(t*this.kE.attributesPerVertex,this.kE.prepareRenderData(e,i))})),((t,e,i)=>{this.iD.pL(t.vertexBuffer,t.existingCoordinatesCount*this.kE.attributesPerVertex,this.kE.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.kE.individualPointColorEnabled,r=this.kE.individualPointSizeEnabled,o=this.kE.individualPointSizeAxisEnabled,a=this.kE.individualLookupValuesEnabled,l=i instanceof z&&i,u=i instanceof V&&i,c=i instanceof G&&i,d=i===F&&F;if(u&&!s){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw gt.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 gt.alert(t),new Error(t)}const f=n instanceof ji&&n,g=f&&f.getWireframeStyle(),m=g&&g instanceof tt&&g,p=m&&m.getFillStyle(),y=p&&p instanceof z&&p;if(l||u||c||y){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(n instanceof ji){const o=te(n.getShape(),{cube:()=>vg(this.iD),sphere:()=>Lg(this.iD,n,r)});t={type:"instanced",shader:this.iD.zB(df["3D"],df.ColorShaded3D({dataType:i,shadingStyle:this.lm.M().type,wireframe:!1!==y}),df.VertexLocation({offset:{dataType:f,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:bf(this.ct),normalSource:o.Tz})),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.iD.zB(df["3D"],df.Color({dataType:"uniform"}),df.VertexLocation({offset:{dataType:f,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:bf(this.ct),normalSource:void 0})),geometry:o,wireframe:m&&y&&{thickness:m.getThickness()<0?1:m.getThickness(),fillStyleSolid:y}}}else n instanceof Ki&&"number"==typeof e&&(t={type:"primitive",shader:this.iD.zB(df["3D"],df.PointSize(f),df.Color({dataType:i}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:s,fillStyleSolid:l,fillStyleIndividual:u,fillStylePalette:c,mousePickingShader:h&&this.iD.zB(df["3D"],df.PointSize(f),df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0}))})}if(this.GR=t,i instanceof G){const t=i.getPalette();this.JE=this.IO.vR(t,this.WR,this.JE),this.WR=t}else this.JE=void 0,this.IO.NL.vr(this.WR),this.WR=void 0}return this.Hn=!1,this.zn=[],this.Vn=0,this.nV=n,this.lm.o=!1,this}tD(t){const e=this.iD.gl,i=this.GR;if(!i)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const r=this.lm.M(),{fillStyleSolid:n,fillStylePalette:o,useIndividualPointSize:h}=i,a="instanced"===i.type&&i.useIndividualPointSize3D,l="instanced"===i.type&&i.wireframe;return this.iD.VB(s,((u,c,d,f)=>{let g=!1;if(this.iD.$D(s).lL(u("uScale"),this.Bz.JD.$B()).lL(u("uDisp"),this.Bz.JD.YB()).cL(u("uViewProjectionMatrix"),this.Uz).WB(u("uIsHighlighted"),1===t||2===t?0:this.br).UB(u("uHighlightColorOffset"),this.Ar).WB(u("uRenderEffectMask"),2===t?1:0),"instanced"===i.type){const{pointSizeAxis:t,pointSizeNWU:e}=i;!1!==t&&!1===a&&this.iD.lL(u("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===h&&this.iD.WB(u("uOffsetNWU"),e).WB(f("uRatioNwuWu"),this.Bz.hV())}else if("primitive"===i.type){const{pointSizePixels:t}=i;h||this.iD.WB(u("uPointSize"),t).WB(u("uDevicePixelRatio"),this.iD.ZD())}return 1===t?this.iD.UB(u("uColor"),this.zO):("instanced"===i.type?("phong"===r.type&&this.iD.lL(u("uCameraLoc"),this.$z).lL(u("uLightLoc"),this.Yz).WB(u("uAmbientReflection"),r.ambientReflection).WB(u("uSpecularReflection"),r.specularReflection).WB(u("uDiffuseReflection"),r.diffuseReflection).WB(u("uShininess"),r.shininess).UB(u("uLightColor"),r.specularColor).UB(u("uAmbientColor"),r.ambientColor),l&&this.iD.WB(u("uWireframeThickness"),l.thickness).UB(u("uWireframeColor"),l.fillStyleSolid.getColor()),n&&this.iD.UB(u("uColorDiffuse"),n.getColor()),i.fillStyleEmpty&&this.iD.UB(u("uColorDiffuse"),B)):"primitive"===i.type&&n&&this.iD.UB(u("uColor"),n.getColor()),o&&this.JE&&this.iD.HB(u("uLookupTexture"),this.JE.texture,0).WB(u("uLookupMin"),o.lut.min).WB(u("uLookupMax"),o.lut.max).WB(u("uLookupTextureHeightPx"),this.JE.textureHeight)),this.Sv.forEach(((s,n)=>{e.bindBuffer(e.ARRAY_BUFFER,s.vertexBuffer);const o=c("aPos");if(e.vertexAttribPointer(o,3,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.iD.vL(o,1),e.enableVertexAttribArray(o),i.fillStyleIndividual&&void 0!==this.kE.attributeOffsetColor&&1!==t){const t=c("aColor");e.vertexAttribPointer(t,4,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.iD.vL(t,1),e.enableVertexAttribArray(t)}if(h&&void 0!==this.kE.attributeOffsetSize){"instanced"===i.type?this.iD.WB(f("uRatioNwuWu"),this.Bz.hV()):"primitive"===i.type&&this.iD.WB(u("uDevicePixelRatio"),this.iD.ZD());const t=c("instanced"===i.type?"aOffsetNWU":"aPointSize");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.iD.vL(t,1),e.enableVertexAttribArray(t)}if(a&&void 0!==this.kE.attributeOffsetPointSize3D&&"instanced"===i.type){const t=c("aOffsetAxis");e.vertexAttribPointer(t,3,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.iD.vL(t,1),e.enableVertexAttribArray(t)}if(i.fillStylePalette&&"value"===i.fillStylePalette.getLookUpProperty()&&void 0!==this.kE.attributeOffsetLookUpValue&&1!==t){const t=c("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.iD.vL(t,1),e.enableVertexAttribArray(t)}"instanced"===i.type?(i.geometry.Op(d,s.existingCoordinatesCount,"phong"===r.type&&1!==t,Boolean(l)&&1!==t),g=!0):"primitive"===i.type&&(this.iD.Op(e.POINTS,s.existingCoordinatesCount),g=!0)})),g})),this}Kn(t,e){Array.isArray(t)||(t=[t]),this.zn=ie(this.zn,t,{canReturnB:!0}),this.Vn+=t.length;const i=e||Ve(t);return this.Nn=this.Nn?Ge(this.Nn,i):i,this}Dm(t){return this.Pm="function"==typeof t?t(this.Pm):t,this}oV(){return this.Pm}yt(){return this.Nn?Math.max(this.Nn.max.x,this.Rn.max.x):this.Rn.max.x}ft(){return this.Nn?Math.min(this.Nn.min.x,this.Rn.min.x):this.Rn.min.x}xt(){return this.Nn?Math.max(this.Nn.max.y,this.Rn.max.y):this.Rn.max.y}St(){return this.Nn?Math.min(this.Nn.min.y,this.Rn.min.y):this.Rn.min.y}vm(){return this.Nn?Math.max(this.Nn.max.z,this.Rn.max.z):this.Rn.max.z}Mm(){return this.Nn?Math.min(this.Nn.min.z,this.Rn.min.z):this.Rn.min.z}co(){const t=this.Pm,e=t.getSize();return"number"==typeof e?t instanceof ji?e/2:t instanceof Ki?5:0:0}do(){return this.co()}_m(){return this.co()}$n(){return this.ca}Un(){return this.zn}Jn(){return this.En}Qn(){return this.Vn}qn(){return this.Hn=!0,this.ca.length=0,this.En=0,this.zn=[],this.Vn=0,this.Rn=De,this.Nn=void 0,this}dispose(){return super.dispose(),this.AE.mE(),this.IO.NL.vr(this.WR),this.WR=void 0,this.JE=void 0,this.GR=void 0,this}OD(){return this.dispose(),this}}const Lg=(t,e,i)=>{const s=e.getSize();return Bg(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class Rg extends Mg{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Dz="disabled",this.Vr=ls.fillStyle,this.Ma=ls.lineStyle,this.$E=y("bilinear"),this.aV=[],this.lV=De,this.uV=void 0,this.GR={},this.cV=!1,this.lm.S(jo);const o="columns"===s.dataOrder?s.columns:s.rows,h="columns"===s.dataOrder?s.rows:s.columns;this.Mh={...s,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h},this.lV={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.dV=new Array(this.Mh.primaryDimensionVectorsCount).fill(void 0),this.eC=new hg(this.IO,t.IO.fV,t.Li.ct,bt,[],{...this.Mh,start:{x:0,y:0},step:{x:1,y:1}},-1,E)._a(J),this.eC.jE=eg;const a=this.eC.ZE.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,r=t.iFirstUniqueVector,n="columns"===this.Mh.dataOrder?{x:this.Mh.step.x*(t.sizeHeatmapDataVectors.primary-1),z:this.Mh.step.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.Mh.step.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.Mh.step.z*(t.sizeHeatmapDataVectors.primary-1)},o="columns"===this.Mh.dataOrder?{x:this.Mh.start.x+this.Mh.step.x*t.iFirstVector.primary,z:this.Mh.start.z+this.Mh.step.z*t.iFirstVector.secondary}:{x:this.Mh.start.x+this.Mh.step.x*t.iFirstVector.secondary,z:this.Mh.start.z+this.Mh.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.eC.ZE.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.gV={gridTiles:a,gridTileSizes:l,largestGridTileSize:u}}pV(t){this.mV=t,this.uV=void 0}yV(t){"columns"===this.Mh.dataOrder?(this.lV.min.x=Math.min(this.Mh.start.x,this.Mh.start.x+(this.Mh.columns-1)*this.Mh.step.x)+t,this.lV.max.x=Math.max(this.Mh.start.x,this.Mh.start.x+(this.Mh.columns-1)*this.Mh.step.x)+t):(this.lV.min.z=Math.min(this.Mh.start.z,this.Mh.start.z+(this.Mh.rows-1)*this.Mh.step.z)+t,this.lV.max.z=Math.max(this.Mh.start.z,this.Mh.start.z+(this.Mh.rows-1)*this.Mh.step.z)+t),this.SV=t}Gs(t){const e=this.aV,i=this.Vr,s=i instanceof z&&i,r=i instanceof G&&i,n=Cs(this.Gr,i),o=r&&r.getPalette(),h=this.Ma,a=h instanceof tt&&h,l=a&&a.getFillStyle(),u=l&&l instanceof z&&l,c=!1!==u,d=h!==this.Wa,f=this.$E.o,g=this.$E.M(),m=this.lm.M(),p=this.MB(),y=this.pr.M();this.eC.Gs();const x=this.eC.KE;if(!x)return this;this.xV=this.xV||this.bV(x);const S=this.xV;this.vV(S);const v=ig(e,S,void 0,(t=>t.sizeGeometryDataVectors));if(v.size>0&&(ng(this.iD,v,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.cV=!0),"phong"===m.type&&(v.size>0||p)){const t=this.iD.gl,e=this.iD.zB(df["2D"],df.DrawToNormalTexture({flipXZ:"rows"===this.Mh.dataOrder,vertexIdSource:this.iD.hO(),normalTextureType:this.iD.gl2?"uint":"ubyte",heightmapTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN}));S.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.iD.GL.tD((()=>{this.iD.VB(e,((r,n,h,a)=>(this.iD.$D(e).rO(h,o).GB(r("uTileDimensionsXZ"),["columns"===this.Mh.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.Mh.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).oL(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).GB(r("uTileStartLocationAxisXZ"),[s.startLocationAxis.x+("columns"===this.Mh.dataOrder&&this.SV||0),s.startLocationAxis.z+("rows"===this.Mh.dataOrder&&this.SV||0)]).GB(r("uTileSizeAxisXZ"),[s.sizeAxis.x,s.sizeAxis.z]).HB(r("uHeightmapTexture"),s.heightmapDataTexture,1).Op(t.POINTS,o),!0)))}),r,n,void 0,this.Li.Xe(),0)}))}))}const b=this.GR;if(n||d||f){o?(this.JE=this.IO.vR(o,this.QE,this.JE),this.QE=o):(this.JE=void 0,this.IO.NL.vr(this.QE),this.QE=void 0);const t=a&&u?{wireframeSolid:a,wireframeFillSolid:u}:void 0;s?b.surface={shader:this.iD.zB(df["3D"],df.SurfaceGrid({axisWorldTranslation:bf(this.ct),fillColor:"uniform",interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Mh.dataOrder,shadingStyle:m.type,wireframe:c,instanceIdSource:this.iD.nO(),normalTextureType:this.iD.gl2?"uint":"ubyte",intensityTextureType:this.iD.zL?"float":"ubyte",heightmapTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:this.JE&&r&&"value"===r.getLookUpProperty()?b.surface={shader:this.iD.zB(df["3D"],df.SurfaceGrid({axisWorldTranslation:bf(this.ct),fillColor:["lookup","value"],interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Mh.dataOrder,shadingStyle:m.type,wireframe:c,instanceIdSource:this.iD.nO(),normalTextureType:this.iD.gl2?"uint":"ubyte",intensityTextureType:this.iD.zL?"float":"ubyte",heightmapTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r,colorLookupTexture:this.JE},wireframe:t}:this.JE&&r?b.surface={shader:this.iD.zB(df["3D"],df.SurfaceGrid({axisWorldTranslation:bf(this.ct),fillColor:["lookup",r.getLookUpProperty()],interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Mh.dataOrder,shadingStyle:m.type,wireframe:c,instanceIdSource:this.iD.nO(),normalTextureType:this.iD.gl2?"uint":"ubyte",intensityTextureType:this.iD.zL?"float":"ubyte",heightmapTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r,colorLookupTexture:this.JE},wireframe:t}:c&&(b.surface={shader:this.iD.zB(df["3D"],df.SurfaceGrid({axisWorldTranslation:bf(this.ct),fillColor:void 0,interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Mh.dataOrder,shadingStyle:m.type,wireframe:c,instanceIdSource:this.iD.nO(),normalTextureType:this.iD.gl2?"uint":"ubyte",intensityTextureType:this.iD.zL?"float":"ubyte",heightmapTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return b.mousePicking=y?this.GR.mousePicking||{shader:this.iD.zB(df["3D"],df.SurfaceGrid({axisWorldTranslation:bf(this.ct),fillColor:"uniform",interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Mh.dataOrder,shadingStyle:"simple",wireframe:!1,instanceIdSource:this.iD.nO(),normalTextureType:this.iD.gl2?"uint":"ubyte",intensityTextureType:this.iD.zL?"float":"ubyte",heightmapTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.GR=b,this.aV.length=0,this.Gr=i,this.Wa=h,this.lm.o=!1,this}bV(t){const e=this.gV.gridTiles.map((e=>{const i=rg(this.iD,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.gV.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.iD.RB([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.iD.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}vV(t){var e;if("phong"===this.lm.M().type)for(let i=0;i{t.normalmapTexture&&(this.iD.RD(t.normalmapTexture),t.normalmapTexture=void 0)}))}tD(t){var e,i,s,r;const n=this.iD.gl,o=this.xV;if(!o)return this;const h=this.lm.M(),a=this.GR,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.iD.VB(l,((e,i,s,r)=>{let a=!1;if(this.iD.$D(l).oO(s,this.gV.largestGridTileSize.cells).lL(e("uScale"),this.Bz.JD.$B()).lL(e("uDisp"),this.Bz.JD.YB()).cL(e("uViewProjectionMatrix"),this.Uz).WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===h.type&&this.iD.lL(e("uCameraLoc"),this.$z).lL(e("uLightLoc"),this.Yz).WB(e("uAmbientReflection"),h.ambientReflection).WB(e("uSpecularReflection"),h.specularReflection).WB(e("uDiffuseReflection"),h.diffuseReflection).WB(e("uShininess"),h.shininess).UB(e("uLightColor"),h.specularColor).UB(e("uAmbientColor"),h.ambientColor),u)){const{wireframeFillSolid:t,wireframeSolid:i}=u,s=i.getThickness()<0?1:i.getThickness();this.iD.UB(e("uWireframeColor"),t.getColor()).WB(e("uWireframeThickness"),s)}return 1===t?this.iD.UB(e("uColorDiffuse"),this.zO):"solid"===(null==c?void 0:c.fillMode)&&this.iD.UB(e("uColorDiffuse"),c.fillStyleSolid.getColor()),o.gridTileSizes.forEach((s=>{this.iD.GB(e("uTileDimensionsXZ"),["columns"===this.Mh.dataOrder?s.sizeHeatmapData.primary:s.sizeHeatmapData.secondary,"columns"===this.Mh.dataOrder?s.sizeHeatmapData.secondary:s.sizeHeatmapData.primary]).oL(e("uTileDimensions"),[s.sizeHeatmapData.primary,s.sizeHeatmapData.secondary]),s.tiles.forEach((r=>{let h=0,l=(r.sizeHeatmapDataVectors.primary-1)*(r.sizeHeatmapDataVectors.secondary-1);if(this.mV){const t=this.mV.fill.iFirstPrimary,e=this.mV.fill.iFirstPrimary+this.mV.fill.amountPrimary-1,i=r.iFirstVector.primary,n=r.iFirstVector.primary+r.sizeHeatmapDataVectors.primary-1;if(i>e||nm(Math.max(t,i),Math.min(e,s)))(t,e,i,n);h=(o.min-r.iFirstVector.primary)*(s.sizeGeometryData.secondary-1),l=(o.max-o.min)*(s.sizeGeometryData.secondary-1)}if(!(h<0||l<=0)){if("intensity"===(null==c?void 0:c.fillMode)){const{colorLookupTexture:t,fillStylePaletted:i}=c;this.iD.HB(e("uLookupTexture"),t.texture,1).WB(e("uLookupMin"),i.getPalette().min).WB(e("uLookupMax"),i.getPalette().max).WB(e("uLookupTextureHeightPx"),t.textureHeight).HB(e("uTileIntensityValues"),r.intensityDataTexture,2).aL(e("uTileBoundsAxisXZ"),[r.startLocationAxis.x+("columns"===this.Mh.dataOrder&&this.SV||0),r.startLocationAxis.z+("rows"===this.Mh.dataOrder&&this.SV||0),r.sizeAxis.x,r.sizeAxis.z])}if("xyz"===(null==c?void 0:c.fillMode)){const{colorLookupTexture:t,fillStylePaletted:i}=c;this.iD.HB(e("uLookupTexture"),t.texture,1).WB(e("uLookupMin"),i.getPalette().min).WB(e("uLookupMax"),i.getPalette().max).WB(e("uLookupTextureHeightPx"),t.textureHeight)}1!==t&&"phong"===this.lm.M().type&&r.normalmapTexture&&this.iD.HB(e("uNormalmapTexture"),r.normalmapTexture,3),this.iD.NB(o.rectangleLocationsBuffer,0,{location:i("aGeoCellOffset"),size:2},{location:u?i("aTriangleBary"):void 0,size:3}).dL(e("uBaseInstance"),h).GB(e("uTileStartLocationAxisXZ"),[r.startLocationAxis.x+("columns"===this.Mh.dataOrder&&this.SV||0),r.startLocationAxis.z+("rows"===this.Mh.dataOrder&&this.SV||0)]).GB(e("uTileSizeAxisXZ"),[r.sizeAxis.x,r.sizeAxis.z]).HB(e("uHeightmapTexture"),r.heightmapDataTexture,0).CL(o.rectangleLocationsDrawMode,0,o.rectangleLocationsDrawLength,l),a=!0,n.bindBuffer(n.ARRAY_BUFFER,null)}}))})),a})),this}dispose(){return super.dispose(),this.eC.dispose(),this.IO.NL.vr(this.QE),this.QE=void 0,this.JE=void 0,this.xV&&(this.xV.gridTileSizes.forEach((t=>{})),this.xV.gridTiles.forEach((t=>{this.iD.RD(t.heightmapDataTexture),t.normalmapTexture&&this.iD.RD(t.normalmapTexture)})),this.iD.ZB(this.xV.rectangleLocationsBuffer),this.xV=void 0),this.GR={},this}OD(){return this.dispose(),this.eC.OD(),this}Iy(t){return this.eC.Iy(t),this}Fy(t){this.aV.push(t),sg(this.gV.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.dV[n];if(e)i=ie.max?s:e.max;else{e={min:Me,max:Ae},this.dV[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.uV={min:i,max:s},this.uV}}class Fg extends Mg{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Dz="disabled",this.ez=0,this.rz={};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.Mh={...s,initialBoundaries:o,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.lV=o;const h=()=>({shape:new Rg(this.Bz,bt,this.Mr,{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.EO,this.zO).dispose(),hasData:!1});this.Sv=[h(),h()]}Gs(t){return this.Sv.forEach((e=>{e.shape.Gs(t)})),this}tD(t){return this.Sv.forEach((e=>{e.hasData&&(e.shape.Uz=this.Uz,e.shape.$z=this.$z,e.shape.Yz=this.Yz,e.shape.tD(t))})),this}qn(){return this.ez=0,this.rz={},this.lV=this.Mh.initialBoundaries,this.Sv.forEach((t=>{t.shape.dispose(),t.shape.cV=!1,t.hasData=!1})),this}Ly(t){var e;const i=this.Sv[0],s=this.Sv[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.ez/this.Mh.scrollDimensionSize)%this.Sv.length,o=this.Sv[e],h=this.ez%this.Mh.scrollDimensionSize,a=this.Mh.scrollDimensionSize-h,l=0===h,u=Math.min(a,r),c=h+u,d=h,f=d+1,g=n,m=n+u,p=this.ez>=this.Mh.scrollDimensionSize&&c<=this.Mh.scrollDimensionSize-1,y=l;if(l){const t="columns"===this.Mh.scrollDimension?this.Mh.start.x+(this.ez-1)*this.Mh.step.x:this.Mh.start.z+(this.ez-1)*this.Mh.step.z;o.shape.yV(t)}const x=p?0:1,S=c+(p?1:0);o.shape.pV({fill:{iFirstPrimary:x,amountPrimary:S},wireframe:{iFirstPrimary:x,amountPrimary:S,connectNext:!1}});const v=o===i?s:i,b=c+1,M=1+this.Mh.scrollDimensionSize-b;v.shape.pV({fill:{iFirstPrimary:b,amountPrimary:M},wireframe:{iFirstPrimary:b,amountPrimary:M-1,connectNext:!0}});const A={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,m);let i=!1;y&&this.rz.yValues&&(i=!0,e.splice(0,0,this.rz.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Mh.staticDimensionSize,values:e,type:"y"};o.shape.Fy(s),o.hasData=!0,A.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,m);let i=!1;y&&this.rz.intensityValues&&(i=!0,e.splice(0,0,this.rz.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Mh.staticDimensionSize,values:e,type:"intensity"};o.shape.Iy(s),o.hasData=!0,A.intensityValues=e[u-1]}this.ez+=u,n+=u,this.rz=A}while(ne.shape.Cy(t))),this}Ty(){return this.Sv[0].shape.Ty()}ps(t){return this.Sv.forEach((e=>e.shape.ps(t))),this}gs(){return this.Sv[0].shape.gs()}_a(t){return this.Sv.forEach((e=>e.shape._a(t))),this}Aa(){return this.Sv[0].shape.Aa()}OD(){return this.dispose(),this.Sv.forEach((t=>t.shape.OD())),this}dispose(){return super.dispose(),this.Sv.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.Sv.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}ym(t){return super.ym(t),this.Sv.forEach((e=>e.shape.ym(t))),this}yt(){return this.lV.max.x}ft(){return this.lV.min.x}xt(){return Math.max(this.Sv[0].shape.xt(),this.Sv[1].shape.xt())}St(){return Math.min(this.Sv[0].shape.St(),this.Sv[1].shape.St())}vm(){return this.lV.max.z}Mm(){return this.lV.min.z}co(){return 0}do(){return 0}_m(){return 0}Ir(t){return super.Ir(t),this.Sv.forEach((e=>e.shape.Ir(t))),this}}class _g extends dg{constructor(t,e,i,s){super(t,e,i),this._V=45,this.AV=.1,this.wV=100,this.$z=f(0,0,1),this.kV=f(0,0,-1),this.CV=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.lm=new $o,this.ct=s}Hy(){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.Li.Et();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.$z=t,this}getCameraLocation(){return this.$z}setCameraDirection(t){return this.kV=be.normalize(t),this}getCameraDirection(){return this.kV}setLightLocation(t){return this.Yz=t,this}getLightLocation(){return this.Yz}TV(){return f(this.CV[0],this.CV[1],this.CV[2])}IV(){return f(this.CV[4],this.CV[5],this.CV[6])}}class Og extends _g{constructor(t,e,i,s){super(t,e,i,s),this.JD=new yf,this.FV=!0,this.IO=t,this.gl=t.PO(),this._z=this.Sz,this.PV=this.Li.cr((()=>{this.FV=!0})),this.DV=s.H((()=>{this.FV=!0}))}OB(t){const e=t.ft(),i=t.St(),s=t.Mm(),r=t.yt(),n=t.xt(),o=t.vm();if(e===Me||r===Ae||i===Me||n===Ae||s===Me||o===Ae)return we;const h=t.co(),a=t.do(),l=t._m(),u=Math.abs(t.Lr.nm(h)*t.ct.x.st()),c=Math.abs(t.Lr.nm(a)*t.ct.y.st()),d=Math.abs(t.Lr.nm(l)*t.ct.z.st()),f=e-u,g=r+u,m=i-c,p=n+c,y=s-d,x=o+d;let S;return[{x:f,y:m,z:y},{x:g,y:m,z:y},{x:f,y:p,z:y},{x:g,y:p,z:y},{x:f,y:m,z:x},{x:g,y:m,z:x},{x:f,y:p,z:x},{x:g,y:p,z:x}].map((e=>t.Lr.om(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};S=S?Ne(S,{min:t,max:t}):e})),S||we}Az(t){const e=Array.from(this._z.values());for(let i=0;ife()));const{viewProjectionMatrix:s}=this.BV();this.LV();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.Sz.forEach((t=>{t.Uz=s,t.$z=r,t.Yz=n,t.Gs(i)})),this}BV(){if(!this.FV&&this.Uz)return{viewProjectionMatrix:this.Uz};const t=this.Hy(),e=t.width/t.height;this.EV=yd.projectionPerspective(this._V,e,this.AV,this.wV);const i=this.$z;this.CV[12]=i.x,this.CV[13]=i.y,this.CV[14]=i.z;const s=this.kV,r=f(0,1,0),n=be.multiply(s,-1),o=be.normalize(be.cross(r,n)),h=be.normalize(be.cross(n,o));this.CV[0]=o.x,this.CV[1]=o.y,this.CV[2]=o.z,this.CV[4]=h.x,this.CV[5]=h.y,this.CV[6]=h.z,this.CV[8]=n.x,this.CV[9]=n.y,this.CV[10]=n.z,this.zV=yd.inverse(this.CV);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,m=(a.y+l.y/2)/u.y,p=yd.multiply(yd.translation(ha(-1,1,g),ha(-1,1,m),0),yd.scaling(c,d,1));return this.Uz=yd.multiply(p,yd.multiply(this.EV,this.zV)),this.VV=yd.inverse(this.Uz),this.FV=!1,{viewProjectionMatrix:this.Uz}}LV(){this.JD.MO(this.ct.x),this.JD._O(this.ct.y),this.JD.AO(this.ct.z)}tD(t,e){const i=this.gl.ZD(),s=this.Hy(),r={x:s.x*i*e,y:s.y*i*e,width:s.width*i*e,height:s.height*i*e};return this.gl.LB(r.x,r.y,r.width,r.height),this.Sz.forEach((e=>{e.getVisible()&&(this.gl.FB(e.Dz),1!==t&&this.gl.Sm(e.dm),(1!==t||e.getMouseInteractions())&&e.tD(t))})),this.gl.FB("disabled"),this.gl.Sm(!1),this.gl.PB(!1),this}setCameraLocation(t){return this.$z.x===t.x&&this.$z.y===t.y&&this.$z.z===t.z||(this.FV=!0),super.setCameraLocation(t),this}setCameraDirection(t){return this.kV.x===t.x&&this.kV.y===t.y&&this.kV.z===t.z||(this.FV=!0),super.setCameraDirection(t),this}G(){super.G(),this.Li.dr(this.PV),this.ct.W(this.DV)}Bm(t){const e=this.IO.wz();return this.xz(new Pg(this,this.bz,[],e,this.IO.kz(e),t))}Gp(t){const e=this.IO.wz();return this.xz(new kg(this,this.bz,t,e,this.IO.kz(e)))}km(){const t=this.IO.wz();return this.xz(new Ag(this,this.bz,[],t,this.IO.kz(t)))}Sg(){const t=this.IO.wz();return this.xz(new Tg(this,this.bz,[],t,this.IO.kz(t)))}ky(t){const e=this.IO.wz();return this.xz(new Rg(this,this.bz,[],t,e,this.IO.kz(e)))}By(t){const e=this.IO.wz();return this.xz(new Fg(this,this.bz,[],t,e,this.IO.kz(e)))}}const zg=(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=Dt(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=Dt(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}},Vg={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=m(c(Me,Me),c(Ae,Ae));let u=0,d=1,f=2,g=3,p=0,y=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=m(c(Me,Me),c(Ae,Ae));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=Dt(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=Dt(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.ma.o=!1,this.ya.o=!1}const t=this.WV,e=this.GV,s=this.Ra;if(o){this.Rn=we;for(const e of t)zg(s,this.va,e,Vg,void 0);let r=0;for(const s of e){s.vbo&&i.gl.deleteBuffer(s.vbo),s.ibo&&i.gl.deleteBuffer(s.ibo);const e=t[r];r+=1,s.vbo=i.RB(e.vbo),s.ibo=i.yL(e.ibo),s.length=e.length,s.lengthWireframe=e.lengthWireframe,this.Rn=Ne(this.Rn,e.boundary)}this.ba=!1}}if(this.Nr()){s instanceof G||(this.IO.NL.vr(this.WR),this.WR=void 0),this.tB=s===F?void 0:i.zB(df["2D"],df.VertexLocation({translation:"grid"===this.NV?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:bf(this.ct),normalSource:void 0}),s instanceof z?df.Color({dataType:"uniform"}):s instanceof V?df.Color({dataType:"attribute"}):s instanceof G?df.Color({dataType:["lookup",s.getLookUpProperty()]}):s instanceof $||s instanceof Z?df.Color({dataType:["gradient",s]}):void 0);const t=this.Ma;this.$V=t instanceof z?i.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({translation:"grid"===this.NV?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.Ur(s),this.Wa=this.Ma}const h=this.WV,a=this.GV,l=this.za;if(s instanceof G&&s.lut.isValid){if(this.xa){for(const t of h)Ng(l,this.va,t,Vg);let t=0;for(const e of a){e&&e.intensities&&i.gl.deleteBuffer(e.intensities);const s=h[t];t+=1,e.intensities=i.SL(s.intensities)}this.xa=!1}const t=s.getPalette();this.HR=this.IO.vR(t,this.WR,this.HR),this.WR=t}else if(s instanceof V&&(this.YV&&i.iL(this.YV),this.Sa)){for(const t of h)Gg(l,s.color,this.va,t,Vg);let t=0;for(const e of a){e.colors&&i.gl.deleteBuffer(e.colors);const s=h[t];t+=1,e.colors=i.SL(s.colors)}this.Sa=!1}s instanceof $?this.$O=Mf(this.Tr(),this.ct,s.getPosition(),s.getExtent(),s.getShape(),this.iD.ZD()):s instanceof Z?this.YO=Af(this.Tr(),this.ct,s.getAngle(!0),this.iD.ZD()):(this.$O=void 0,this.YO=void 0),this.eR=e?this.eR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({translation:"grid"===this.NV?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0}return this}tD(t){const e=this.za&&this.Ra;if(this.Wr()&&e){const e=1===t?this.eR:this.tB;if(e){const i=this.Vr,s=i instanceof z&&i,r=i instanceof G&&i,n=i instanceof V&&i,o=i instanceof $&&i,h=i instanceof Z&&i;this.iD.VB(e,((i,a,l)=>{let u=!1;this.iD.$D(e).GB(i("uScale"),this.JD.$B()).GB(i("uDisp"),this.JD.YB()).WB(i("uIsHighlighted"),1===t||2===t?0:this.br).UB(i("uHighlightColorOffset"),this.Ar).WB(i("uRenderEffectMask"),2===t?1:0),"grid"===this.NV&&this.iD.GB(i("uTranslationAxis"),[this.ni.x,this.ni.y]),1===t?this.iD.UB(i("uColor"),this.zO):s?this.iD.UB(i("uColor"),s.getColor()):r&&r.lut.isValid&&this.HR?this.iD.WB(i("uLookupMin"),r.lut.min).WB(i("uLookupMax"),r.lut.max).HB(i("uLookupTexture"),this.HR.texture,0).WB(i("uLookupTextureHeightPx"),this.HR.textureHeight):o?this.iD.KL(l,this.$O,o):h&&this.iD.qL(l,this.YO,h);for(const{vbo:e,ibo:i,colors:s,intensities:o,length:h}of this.GV)this.iD.xL(a("aPos"),e).wL(i),1!==t&&(r&&"value"===r.getLookUpProperty()&&this.iD.AL(a("aLookupValue"),o),n&&this.iD._L(a("aColor"),s)),this.iD.kL(h),u=!0;return u}))}const i=1===t?void 0:this.$V;if(i){const e=this.Ma,s=e instanceof z&&e;this.iD.VB(i,((e,r,n)=>{let o=!1;this.iD.$D(i).GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0),"grid"===this.NV&&this.iD.GB(e("uTranslationAxis"),[this.ni.x,this.ni.y]),s&&this.iD.UB(e("uColor"),s.getColor());for(const{vbo:t,ibo:e,lengthWireframe:i}of this.GV)this.iD.xL(r("aPos"),t).wL(e).kL(i,this.iD.gl.LINES),o=!0;return o}))}}return this}XV(t,e){if(this.pr.M()&&this.Rn&&this.Ra){const n="grid"===this.NV?this.ni:{x:0,y:0},o=Je(nt({x:t,y:e},this.Li.ct,this.ct),n);if(i=o,s=this.Rn.min,r=this.Rn.max,!(i.x>r.x||i.y>r.y||i.x0){for(const e of this.GV){const{vbo:i,ibo:s,colors:r,intensities:n}=e||{};i&&(t.ZB(i),e.vbo=void 0),s&&(t.ZB(s),e.ibo=void 0),r&&(t.ZB(r),e.colors=void 0),n&&(t.ZB(n),e.intensities=void 0)}this.GV.length=0}}OD(){return this.UV(),this.YV&&(this.iD.iL(this.YV),this.YV=void 0),this.IO.NL.vr(this.WR),this.HR=void 0,this}Pa(t,e){return this.NV="mesh",super.Pa(t,e)}yt(){return"grid"===this.NV?this.Rn.max.x+this.ni.x:this.Rn.max.x}ft(){return"grid"===this.NV?this.Rn.min.x+this.ni.x:this.Rn.min.x}xt(){return"grid"===this.NV?this.Rn.max.y+this.ni.y:this.Rn.max.y}St(){return"grid"===this.NV?this.Rn.min.y+this.ni.y:this.Rn.min.y}co(){return 0}do(){return 0}}class Hg extends us{constructor(t,e,i=gf){var s,r,n;super(t,e),this.Y=c(1,1),this.jV=!1,this.ZV=0,this.KV=!0,this.qV=0,this.Qz=8388608,this.Bi=(t=!1)=>(t&&(this.jV=!0),void 0===this.Re&&(this.Re=gt.requestAnimationFrame(this.JV)),this),this.JV=t=>{const e=t-this.ZV;e>=this.Rh||-1===this.Rh?(this.ZV=t,this.jV=!1,this.Ee&&this.Ee(),this.Re=void 0,-1!==this.Rh&&(this.Re=this.jV?gt.requestAnimationFrame(this.JV):void 0),this.Vh.Gs(e),this.Ze(),this.Ke(),this.ze&&this.ze()):this.Re=gt.requestAnimationFrame(this.JV)},this.QV=new Map,this.PO=()=>this.iD,this.tN=()=>{var t,e,i;const s=this.xh(),r=this.KV,n=gt.performance.now(),o=null===(t=this.iN)||void 0===t?void 0:t.sN.reduce(((t,e)=>t?e.eN&&t.eN&&e.eN>t.eN?e:t:e),void 0),h=null==o?void 0:o.eN,a=null===(e=this.dh)||void 0===e?void 0:e.timeStamp,l=null===(i=this.rr)||void 0===i?void 0:i.timeStamp;return r?(this.Bi(!0),!1):void 0===o||(void 0===o||!o.hN)&&(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.rN=()=>{var t,e;this.nN=void 0;const i=null===(e=null===(t=this.iN)||void 0===t?void 0:t.oN)||void 0===e?void 0:e.aN;void 0===i||i>=this.qV||this.lN()},this.Ke=()=>{const t=this.iD.gl,e=gt.performance.now(),i=this.Y,s=i.x>0&&i.y>0;if(this.Ye.o&&this.iD.DL(this.Ye.M()),this.iD.qn(),t.resize&&s&&t.resize(i.x*this.iD.ZD(),i.y*this.iD.ZD()),this.iD.BB(0,0,i.x*this.iD.ZD(),i.y*this.iD.ZD()),this.uN.width=i.x*this.iD.ZD(),this.uN.height=i.y*this.iD.ZD(),s)for(const t of this.Be.values())t.tD(0,1);return this.Mh.Bh&&s&&(this.nN&&(gt.clearTimeout(this.nN),this.nN=void 0),this.tN()?this.lN():this.nN=gt.setTimeout(this.rN,500)),this.X(),this.Pe(),this.ih&&this.th(this.ih),this.KV=!1,this.qV=e,this},this.Ze=()=>{const t=this.Y;if(0===t.x||0===t.y)return this;this.Uh.q(t);for(const t of this.Be.values())t.Gs();return this.X(),this},this.cN=1,this.uN=gt.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.uN.getContext("webgl2",o);t&&(h=new i(this,this.Mh,{type:"webgl2",ctx:t,antialias:o.antialias,lineAntialias:o.lineAntialias},this.hs.isDark))}if(!h&&"webgl2"!==(null===(r=null==t?void 0:t.webgl)||void 0===r?void 0:r.version)){const t=this.uN.getContext("webgl",o)||this.uN.getContext("experimental-webgl",o);h=new i(this,this.Mh,{type:"webgl1",ctx:t,antialias:o.antialias,lineAntialias:o.lineAntialias},this.hs.isDark)}if(!h)throw new at("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.iD=h,this.NL=bd(this.iD.gl);const a=this.iD.rL;if(a.length>0){const t=gt.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=gt.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),this._e.appendChild(t),t.appendChild(e),!1!==this.Mh.Ph&>.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",a.join(", "))}let l=1;if(t&&t.devicePixelRatio)l=!0===t.devicePixelRatio?gt.devicePixelRatio||1:t.devicePixelRatio||1;else{const t=gt.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(l=gt.devicePixelRatio||1)}this.iD.YL(l),this.uN.style.position="absolute",this.uN.style.top="0",this.uN.style.left="0",this.uN.style.right="0",this.uN.style.bottom="0",this.uN.style.width="100%",this.uN.style.height="100%",this.uN.style.boxSizing="content-box",this._e.appendChild(this.uN);const u=t?t.width:void 0,d=t?t.height:void 0;this.Gh=this.dN(u),this.Wh=this.dN(d),this.fN(this.Gh,this.Wh),this.fV=this.vT("engine offscreen",1e6),this.gN=this.vT("engine bg",0);const f="function"==typeof this.hs.lcjsBackgroundFillStyle?this.hs.lcjsBackgroundFillStyle(this.Mh.Fh):this.hs.lcjsBackgroundFillStyle;this.Uh=this.gN.gc(this.ct).ps(f).$h(this.hs.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Sn({x:0,y:0});const g=this.vT("engine effects",200001).Cz(this.hs.effect);this.iu=g,this.Ue(),this.Pe(),this.Lg=rs(this),this.Og={hs:this.hs,Vh:this.Vh,Bi:t=>this.Bi(t),xh:()=>this.xh(),oP:t=>this.oP(t),Mh:this.Mh,bh:t=>this.bh(t),iu:this.iu};const m=()=>{this.G()};gt.addEventListener("unload",m),this.Ve.push((()=>{gt.removeEventListener("unload",m)}))}get pN(){return this.Be}De(t,e){let i=this.QV.get(t);if(!i){const e=this.iD.JL(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.QV.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{aP:()=>e.dB,lP:t=>{e.dB?t():o.push(t)}}},this.QV.set(t,i),e.$D(this),e.xB((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new td(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}oP(t){const e=Array.from(this.QV.values()).find((e=>e.instances.has(t)));if(!e)throw de(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}sh(t,e){var i,s;const r=null===(i=this.iN)||void 0===i?void 0:i.oN;if(!r)return;const n=this.ke(e.x,e.y),o=Math.round(n.x*this.iD.ZD()),h=Math.round(n.y*this.iD.ZD());return null===(s=[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.mN(r,o+t[0]/r.yN,h+t[1]/r.yN))).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}:t}),void 0))||void 0===s?void 0:s.entity}mN(t,e,i){const s=Math.round(e*t.yN),r=Math.round(i*t.yN);if(s<0||s>=t.Y.x||r<0||r>=t.Y.y)return;const n=4*(s+r*t.Y.x),o=t.SN[n+0],h=t.SN[n+1],a=t.SN[n+2],l=t.SN[n+3];return void 0!==o&&void 0!==h&&void 0!==a&&void 0!==l?this.xN(o,h,a,l):void 0}Te(t,e){return(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=gt.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof gg))throw new Error("Unexpected Engine Layer error");return i}return this.qe(new gg(this,e,t))}AT(t,e,i){const s=this.Zh(e);if(s){if(de(0,(()=>{})),!(s instanceof Og))throw new Error("Unexpected Engine Layer error");return s}return this.qe(new Og(this,e,t,i))}Et(){return this.Y}dN(t){return t instanceof Array||(t=[t,t]),t}We(){return this.uN}lN(){var t;const e=this.iD.gl,i=gt.performance.now(),s=this.xh(),r=this.Mh.Dh,n={x:Math.ceil(this.Y.x*this.iD.ZD()*r),y:Math.ceil(this.Y.y*this.iD.ZD()*r)};this.iN||(this.iN={yN:r,bN:n,sN:[],oN:void 0});let o=this.iN.sN.find((t=>!t.hN)),h=!1;o||(h=!0,o={hN:!1,Y:n,vN:e.createTexture(),MN:this.iD.JB(),_N:this.iD.QB(),AN:new Uint8Array,eN:void 0},this.iN.sN.push(o));const a=o;(h||a.Y.x!==n.x||a.Y.y!==n.y)&&(e.bindTexture(e.TEXTURE_2D,a.vN),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.MN),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a.vN,0),e.bindRenderbuffer(e.RENDERBUFFER,a._N),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.x,n.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,a._N),a.AN=new Uint8Array(n.x*n.y*4),a.Y=n),a.hN=!0,a.eN=i,e.bindFramebuffer(e.FRAMEBUFFER,a.MN),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.iD.BB(0,0,n.x,n.y);for(const t of this.Be.values())t.tD(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.iD.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.iN){const t=this.iN.oN;if(t&&t.aN>i)return;this.iN.oN={aN:i,yN:r,Y:n,SN:a.AN,wN:s}}};l?this.iD.aO(l,a.MN,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.AN).then((()=>{this.ce||(a.hN=!1,u())})).catch((t=>{this.ce||(a.hN=!1,gt.console.warn("LightningChart JS mouse picking failed unexpectedly. This could mean that user interactions on charts are compromised.\nPlease report this issue to support@lightningchart.com"))})):(this.iD.lO(a.MN,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.AN),a.hN=!1,u())}Ue(t){const e=this.Y.x,i=this.Y.y,s=t||{x:this._e.offsetWidth,y:this._e.offsetHeight};s.x===e&&s.y===i||(this.Y=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.Y.x,this.Y.y]))}G(){super.G(),this.nN&&(gt.clearTimeout(this.nN),this.nN=void 0),this.uN.width=1,this.uN.height=1,this.uN&&(this._e.removeChild(this.uN),this.uN=void 0,this._e=void 0),this.NL.fD(),Array.from(this.iD.eL.values()).forEach((t=>{t.OD()})),Array.from(this.iD.hL.values()).forEach((t=>{t.unbindResources()})),this.iD.hL.clear(),this.iD.sL.lD(),this.iD.HL.G(),this.iD.ZB(this.iD.WL),this.iD.ZB(this.iD.UL),this.iD.eO&&(this.iD.ZB(this.iD.eO.buffer),this.iD.eO=void 0),this.iN&&(this.iN.sN.forEach((t=>{this.iD.tL(t._N),this.iD.iL(t.MN),this.iD.RD(t.vN)})),this.iN=void 0),this.iD.LL.forEach((t=>this.iD.ZB(t))),this.QV.clear(),this.iD.iO(),this.iD.gl=void 0}vR(t,e,i){const s=this.NL;let r=i;if(s.dD(t))t!==e&&(s.vr(e),r=s.M(t),s.Kn(t));else{r={};const e={x:1,y:this.iD.LD};r.textureHeight=e.y;const i=st.d2({scaleXYConstructor:Ti}).q(e);i.x.Z(0,1),i.y.Z(t.min,t.max);const n=new Ug(this,this.fV,i,(()=>{}),[],-1,E);n.ps(new V({color:t.color})),t.interpolate?n.S({columns:2,rows:t.length,start:{x:0,y:t.min},end:{x:1,y:t.max},pixelate:!1}).Pa(((e,i,s)=>({x:s.x,y:t.steps[e].value}))).Ia((e=>t.steps[e].color)):n.S({columns:1,rows:t.length,start:{x:0,y:t.min},end:{x:1,y:t.max},pixelate:!0}).Pa(((e,s,r)=>({x:r.x,y:et.steps[e].color)),r.texture=this.iD.XL(null,this.iD.gl.RGBA,!1,!t.interpolate,e,!1),this.iD.GL.tD((()=>{n.Gs(),n.tD(0)}),r.texture,e,void 0,this.Ye.M()),s.Kn({lut:t,textureInfo:r})}return r}wz(){const t=this.cN;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 support@lightningchart.com!"),this.cN=1),this.cN+=1,t}kz(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,A(i,s,r,e)}xN(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.pN.values()){const e=t.Az(r);if(e)return{entity:e.entity,entityIndex:e.index,layerIndex:t.Je()}}}}var Wg="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},Yg={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.SB(t||0,e||10,i||"be"))}var n;"object"==typeof Yg?Yg.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.SB=function(t,e,s){if("number"==typeof t)return this.kN(t,e,s);if("object"==typeof t)return this.CN(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.TN(t,r):this.IN(t,e,r),"-"===t[0]&&(this.negative=1),this.FN(),"le"===s&&this.CN(this.toArray(),e,s)},r.prototype.kN=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.CN(this.toArray(),e,s)},r.prototype.CN=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.FN()},r.prototype.TN=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.FN()},r.prototype.IN=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.ON()},r.prototype.ON=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.FN()}r.prototype.toString=function(t,e){var s;if(e=0|e||1,16===(t=t||10)||"hex"===t){s="";for(var r=0,n=0,o=0;o>>24-r&16777215)||o!==this.length-1?u[6-a.length]+a+s:a+s,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(s=n.toString(16)+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],f=d[t];s="";var g=this.clone();for(g.negative=0;!g.isZero();){var m=g.modrn(f).toString(t);s=(g=g.idivn(f)).isZero()?m+s:u[l-m.length]+m+s}for(this.isZero()&&(s="0"+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}i(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16,2)},n&&(r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)}),r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,s){this.FN();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.RN=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.zN=function(t){return 32-Math.clz32(t)}:r.prototype.zN=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.VN=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.zN(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.LN(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.FN()},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.LN(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.ON()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.ON();var i,s,r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,s=t):(i=t,s=this);for(var n=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==n&&o>26,this.words[o]=67108863&e;if(0===n&&o>>13,f=0|o[1],g=8191&f,m=f>>>13,p=0|o[2],y=8191&p,x=p>>>13,S=0|o[3],v=8191&S,b=S>>>13,M=0|o[4],A=8191&M,w=M>>>13,D=0|o[5],T=8191&D,E=D>>>13,B=0|o[6],k=8191&B,I=B>>>13,C=0|o[7],P=8191&C,L=C>>>13,R=0|o[8],F=8191&R,_=R>>>13,O=0|o[9],z=8191&O,V=O>>>13,N=0|h[0],G=8191&N,U=N>>>13,H=0|h[1],W=8191&H,Y=H>>>13,q=0|h[2],X=8191&q,$=q>>>13,j=0|h[3],Z=8191&j,K=j>>>13,J=0|h[4],Q=8191&J,tt=J>>>13,et=0|h[5],it=8191&et,st=et>>>13,rt=0|h[6],nt=8191&rt,ot=rt>>>13,ht=0|h[7],at=8191&ht,lt=ht>>>13,ut=0|h[8],ct=8191&ut,dt=ut>>>13,ft=0|h[9],gt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var pt=(l+(s=Math.imul(c,G))|0)+((8191&(r=(r=Math.imul(c,U))+Math.imul(d,G)|0))<<13)|0;l=((n=Math.imul(d,U))+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(g,G),r=(r=Math.imul(g,U))+Math.imul(m,G)|0,n=Math.imul(m,U);var yt=(l+(s=s+Math.imul(c,W)|0)|0)+((8191&(r=(r=r+Math.imul(c,Y)|0)+Math.imul(d,W)|0))<<13)|0;l=((n=n+Math.imul(d,Y)|0)+(r>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(y,G),r=(r=Math.imul(y,U))+Math.imul(x,G)|0,n=Math.imul(x,U),s=s+Math.imul(g,W)|0,r=(r=r+Math.imul(g,Y)|0)+Math.imul(m,W)|0,n=n+Math.imul(m,Y)|0;var xt=(l+(s=s+Math.imul(c,X)|0)|0)+((8191&(r=(r=r+Math.imul(c,$)|0)+Math.imul(d,X)|0))<<13)|0;l=((n=n+Math.imul(d,$)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(v,G),r=(r=Math.imul(v,U))+Math.imul(b,G)|0,n=Math.imul(b,U),s=s+Math.imul(y,W)|0,r=(r=r+Math.imul(y,Y)|0)+Math.imul(x,W)|0,n=n+Math.imul(x,Y)|0,s=s+Math.imul(g,X)|0,r=(r=r+Math.imul(g,$)|0)+Math.imul(m,X)|0,n=n+Math.imul(m,$)|0;var St=(l+(s=s+Math.imul(c,Z)|0)|0)+((8191&(r=(r=r+Math.imul(c,K)|0)+Math.imul(d,Z)|0))<<13)|0;l=((n=n+Math.imul(d,K)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(A,G),r=(r=Math.imul(A,U))+Math.imul(w,G)|0,n=Math.imul(w,U),s=s+Math.imul(v,W)|0,r=(r=r+Math.imul(v,Y)|0)+Math.imul(b,W)|0,n=n+Math.imul(b,Y)|0,s=s+Math.imul(y,X)|0,r=(r=r+Math.imul(y,$)|0)+Math.imul(x,X)|0,n=n+Math.imul(x,$)|0,s=s+Math.imul(g,Z)|0,r=(r=r+Math.imul(g,K)|0)+Math.imul(m,Z)|0,n=n+Math.imul(m,K)|0;var vt=(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)+(vt>>>26)|0,vt&=67108863,s=Math.imul(T,G),r=(r=Math.imul(T,U))+Math.imul(E,G)|0,n=Math.imul(E,U),s=s+Math.imul(A,W)|0,r=(r=r+Math.imul(A,Y)|0)+Math.imul(w,W)|0,n=n+Math.imul(w,Y)|0,s=s+Math.imul(v,X)|0,r=(r=r+Math.imul(v,$)|0)+Math.imul(b,X)|0,n=n+Math.imul(b,$)|0,s=s+Math.imul(y,Z)|0,r=(r=r+Math.imul(y,K)|0)+Math.imul(x,Z)|0,n=n+Math.imul(x,K)|0,s=s+Math.imul(g,Q)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(m,Q)|0,n=n+Math.imul(m,tt)|0;var 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(k,G),r=(r=Math.imul(k,U))+Math.imul(I,G)|0,n=Math.imul(I,U),s=s+Math.imul(T,W)|0,r=(r=r+Math.imul(T,Y)|0)+Math.imul(E,W)|0,n=n+Math.imul(E,Y)|0,s=s+Math.imul(A,X)|0,r=(r=r+Math.imul(A,$)|0)+Math.imul(w,X)|0,n=n+Math.imul(w,$)|0,s=s+Math.imul(v,Z)|0,r=(r=r+Math.imul(v,K)|0)+Math.imul(b,Z)|0,n=n+Math.imul(b,K)|0,s=s+Math.imul(y,Q)|0,r=(r=r+Math.imul(y,tt)|0)+Math.imul(x,Q)|0,n=n+Math.imul(x,tt)|0,s=s+Math.imul(g,it)|0,r=(r=r+Math.imul(g,st)|0)+Math.imul(m,it)|0,n=n+Math.imul(m,st)|0;var 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(P,G),r=(r=Math.imul(P,U))+Math.imul(L,G)|0,n=Math.imul(L,U),s=s+Math.imul(k,W)|0,r=(r=r+Math.imul(k,Y)|0)+Math.imul(I,W)|0,n=n+Math.imul(I,Y)|0,s=s+Math.imul(T,X)|0,r=(r=r+Math.imul(T,$)|0)+Math.imul(E,X)|0,n=n+Math.imul(E,$)|0,s=s+Math.imul(A,Z)|0,r=(r=r+Math.imul(A,K)|0)+Math.imul(w,Z)|0,n=n+Math.imul(w,K)|0,s=s+Math.imul(v,Q)|0,r=(r=r+Math.imul(v,tt)|0)+Math.imul(b,Q)|0,n=n+Math.imul(b,tt)|0,s=s+Math.imul(y,it)|0,r=(r=r+Math.imul(y,st)|0)+Math.imul(x,it)|0,n=n+Math.imul(x,st)|0,s=s+Math.imul(g,nt)|0,r=(r=r+Math.imul(g,ot)|0)+Math.imul(m,nt)|0,n=n+Math.imul(m,ot)|0;var 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(F,G),r=(r=Math.imul(F,U))+Math.imul(_,G)|0,n=Math.imul(_,U),s=s+Math.imul(P,W)|0,r=(r=r+Math.imul(P,Y)|0)+Math.imul(L,W)|0,n=n+Math.imul(L,Y)|0,s=s+Math.imul(k,X)|0,r=(r=r+Math.imul(k,$)|0)+Math.imul(I,X)|0,n=n+Math.imul(I,$)|0,s=s+Math.imul(T,Z)|0,r=(r=r+Math.imul(T,K)|0)+Math.imul(E,Z)|0,n=n+Math.imul(E,K)|0,s=s+Math.imul(A,Q)|0,r=(r=r+Math.imul(A,tt)|0)+Math.imul(w,Q)|0,n=n+Math.imul(w,tt)|0,s=s+Math.imul(v,it)|0,r=(r=r+Math.imul(v,st)|0)+Math.imul(b,it)|0,n=n+Math.imul(b,st)|0,s=s+Math.imul(y,nt)|0,r=(r=r+Math.imul(y,ot)|0)+Math.imul(x,nt)|0,n=n+Math.imul(x,ot)|0,s=s+Math.imul(g,at)|0,r=(r=r+Math.imul(g,lt)|0)+Math.imul(m,at)|0,n=n+Math.imul(m,lt)|0;var wt=(l+(s=s+Math.imul(c,ct)|0)|0)+((8191&(r=(r=r+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;l=((n=n+Math.imul(d,dt)|0)+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(z,G),r=(r=Math.imul(z,U))+Math.imul(V,G)|0,n=Math.imul(V,U),s=s+Math.imul(F,W)|0,r=(r=r+Math.imul(F,Y)|0)+Math.imul(_,W)|0,n=n+Math.imul(_,Y)|0,s=s+Math.imul(P,X)|0,r=(r=r+Math.imul(P,$)|0)+Math.imul(L,X)|0,n=n+Math.imul(L,$)|0,s=s+Math.imul(k,Z)|0,r=(r=r+Math.imul(k,K)|0)+Math.imul(I,Z)|0,n=n+Math.imul(I,K)|0,s=s+Math.imul(T,Q)|0,r=(r=r+Math.imul(T,tt)|0)+Math.imul(E,Q)|0,n=n+Math.imul(E,tt)|0,s=s+Math.imul(A,it)|0,r=(r=r+Math.imul(A,st)|0)+Math.imul(w,it)|0,n=n+Math.imul(w,st)|0,s=s+Math.imul(v,nt)|0,r=(r=r+Math.imul(v,ot)|0)+Math.imul(b,nt)|0,n=n+Math.imul(b,ot)|0,s=s+Math.imul(y,at)|0,r=(r=r+Math.imul(y,lt)|0)+Math.imul(x,at)|0,n=n+Math.imul(x,lt)|0,s=s+Math.imul(g,ct)|0,r=(r=r+Math.imul(g,dt)|0)+Math.imul(m,ct)|0,n=n+Math.imul(m,dt)|0;var Dt=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(r=(r=r+Math.imul(c,mt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((n=n+Math.imul(d,mt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,s=Math.imul(z,W),r=(r=Math.imul(z,Y))+Math.imul(V,W)|0,n=Math.imul(V,Y),s=s+Math.imul(F,X)|0,r=(r=r+Math.imul(F,$)|0)+Math.imul(_,X)|0,n=n+Math.imul(_,$)|0,s=s+Math.imul(P,Z)|0,r=(r=r+Math.imul(P,K)|0)+Math.imul(L,Z)|0,n=n+Math.imul(L,K)|0,s=s+Math.imul(k,Q)|0,r=(r=r+Math.imul(k,tt)|0)+Math.imul(I,Q)|0,n=n+Math.imul(I,tt)|0,s=s+Math.imul(T,it)|0,r=(r=r+Math.imul(T,st)|0)+Math.imul(E,it)|0,n=n+Math.imul(E,st)|0,s=s+Math.imul(A,nt)|0,r=(r=r+Math.imul(A,ot)|0)+Math.imul(w,nt)|0,n=n+Math.imul(w,ot)|0,s=s+Math.imul(v,at)|0,r=(r=r+Math.imul(v,lt)|0)+Math.imul(b,at)|0,n=n+Math.imul(b,lt)|0,s=s+Math.imul(y,ct)|0,r=(r=r+Math.imul(y,dt)|0)+Math.imul(x,ct)|0,n=n+Math.imul(x,dt)|0;var Tt=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(r=(r=r+Math.imul(g,mt)|0)+Math.imul(m,gt)|0))<<13)|0;l=((n=n+Math.imul(m,mt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(z,X),r=(r=Math.imul(z,$))+Math.imul(V,X)|0,n=Math.imul(V,$),s=s+Math.imul(F,Z)|0,r=(r=r+Math.imul(F,K)|0)+Math.imul(_,Z)|0,n=n+Math.imul(_,K)|0,s=s+Math.imul(P,Q)|0,r=(r=r+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,n=n+Math.imul(L,tt)|0,s=s+Math.imul(k,it)|0,r=(r=r+Math.imul(k,st)|0)+Math.imul(I,it)|0,n=n+Math.imul(I,st)|0,s=s+Math.imul(T,nt)|0,r=(r=r+Math.imul(T,ot)|0)+Math.imul(E,nt)|0,n=n+Math.imul(E,ot)|0,s=s+Math.imul(A,at)|0,r=(r=r+Math.imul(A,lt)|0)+Math.imul(w,at)|0,n=n+Math.imul(w,lt)|0,s=s+Math.imul(v,ct)|0,r=(r=r+Math.imul(v,dt)|0)+Math.imul(b,ct)|0,n=n+Math.imul(b,dt)|0;var Et=(l+(s=s+Math.imul(y,gt)|0)|0)+((8191&(r=(r=r+Math.imul(y,mt)|0)+Math.imul(x,gt)|0))<<13)|0;l=((n=n+Math.imul(x,mt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,Z),r=(r=Math.imul(z,K))+Math.imul(V,Z)|0,n=Math.imul(V,K),s=s+Math.imul(F,Q)|0,r=(r=r+Math.imul(F,tt)|0)+Math.imul(_,Q)|0,n=n+Math.imul(_,tt)|0,s=s+Math.imul(P,it)|0,r=(r=r+Math.imul(P,st)|0)+Math.imul(L,it)|0,n=n+Math.imul(L,st)|0,s=s+Math.imul(k,nt)|0,r=(r=r+Math.imul(k,ot)|0)+Math.imul(I,nt)|0,n=n+Math.imul(I,ot)|0,s=s+Math.imul(T,at)|0,r=(r=r+Math.imul(T,lt)|0)+Math.imul(E,at)|0,n=n+Math.imul(E,lt)|0,s=s+Math.imul(A,ct)|0,r=(r=r+Math.imul(A,dt)|0)+Math.imul(w,ct)|0,n=n+Math.imul(w,dt)|0;var Bt=(l+(s=s+Math.imul(v,gt)|0)|0)+((8191&(r=(r=r+Math.imul(v,mt)|0)+Math.imul(b,gt)|0))<<13)|0;l=((n=n+Math.imul(b,mt)|0)+(r>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,s=Math.imul(z,Q),r=(r=Math.imul(z,tt))+Math.imul(V,Q)|0,n=Math.imul(V,tt),s=s+Math.imul(F,it)|0,r=(r=r+Math.imul(F,st)|0)+Math.imul(_,it)|0,n=n+Math.imul(_,st)|0,s=s+Math.imul(P,nt)|0,r=(r=r+Math.imul(P,ot)|0)+Math.imul(L,nt)|0,n=n+Math.imul(L,ot)|0,s=s+Math.imul(k,at)|0,r=(r=r+Math.imul(k,lt)|0)+Math.imul(I,at)|0,n=n+Math.imul(I,lt)|0,s=s+Math.imul(T,ct)|0,r=(r=r+Math.imul(T,dt)|0)+Math.imul(E,ct)|0,n=n+Math.imul(E,dt)|0;var kt=(l+(s=s+Math.imul(A,gt)|0)|0)+((8191&(r=(r=r+Math.imul(A,mt)|0)+Math.imul(w,gt)|0))<<13)|0;l=((n=n+Math.imul(w,mt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(z,it),r=(r=Math.imul(z,st))+Math.imul(V,it)|0,n=Math.imul(V,st),s=s+Math.imul(F,nt)|0,r=(r=r+Math.imul(F,ot)|0)+Math.imul(_,nt)|0,n=n+Math.imul(_,ot)|0,s=s+Math.imul(P,at)|0,r=(r=r+Math.imul(P,lt)|0)+Math.imul(L,at)|0,n=n+Math.imul(L,lt)|0,s=s+Math.imul(k,ct)|0,r=(r=r+Math.imul(k,dt)|0)+Math.imul(I,ct)|0,n=n+Math.imul(I,dt)|0;var It=(l+(s=s+Math.imul(T,gt)|0)|0)+((8191&(r=(r=r+Math.imul(T,mt)|0)+Math.imul(E,gt)|0))<<13)|0;l=((n=n+Math.imul(E,mt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(z,nt),r=(r=Math.imul(z,ot))+Math.imul(V,nt)|0,n=Math.imul(V,ot),s=s+Math.imul(F,at)|0,r=(r=r+Math.imul(F,lt)|0)+Math.imul(_,at)|0,n=n+Math.imul(_,lt)|0,s=s+Math.imul(P,ct)|0,r=(r=r+Math.imul(P,dt)|0)+Math.imul(L,ct)|0,n=n+Math.imul(L,dt)|0;var Ct=(l+(s=s+Math.imul(k,gt)|0)|0)+((8191&(r=(r=r+Math.imul(k,mt)|0)+Math.imul(I,gt)|0))<<13)|0;l=((n=n+Math.imul(I,mt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(z,at),r=(r=Math.imul(z,lt))+Math.imul(V,at)|0,n=Math.imul(V,lt),s=s+Math.imul(F,ct)|0,r=(r=r+Math.imul(F,dt)|0)+Math.imul(_,ct)|0,n=n+Math.imul(_,dt)|0;var Pt=(l+(s=s+Math.imul(P,gt)|0)|0)+((8191&(r=(r=r+Math.imul(P,mt)|0)+Math.imul(L,gt)|0))<<13)|0;l=((n=n+Math.imul(L,mt)|0)+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,s=Math.imul(z,ct),r=(r=Math.imul(z,dt))+Math.imul(V,ct)|0,n=Math.imul(V,dt);var Lt=(l+(s=s+Math.imul(F,gt)|0)|0)+((8191&(r=(r=r+Math.imul(F,mt)|0)+Math.imul(_,gt)|0))<<13)|0;l=((n=n+Math.imul(_,mt)|0)+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Rt=(l+(s=Math.imul(z,gt))|0)+((8191&(r=(r=Math.imul(z,mt))+Math.imul(V,gt)|0))<<13)|0;return l=((n=Math.imul(V,mt))+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,a[0]=pt,a[1]=yt,a[2]=xt,a[3]=St,a[4]=vt,a[5]=bt,a[6]=Mt,a[7]=At,a[8]=wt,a[9]=Dt,a[10]=Tt,a[11]=Et,a[12]=Bt,a[13]=kt,a[14]=It,a[15]=Ct,a[16]=Pt,a[17]=Lt,a[18]=Rt,0!==l&&(a[19]=l,i.length++),i};function m(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var s=0,r=0,n=0;n>>26)|0)>>>26,o&=67108863}i.words[n]=h,s=o,o=r}return 0!==s?i.words[n]=s:i.length--,i.FN()}function p(t,e,i){return m(t,e,i)}Math.imul||(g=f),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):i<63?f(this,t,e):i<1024?m(this,t,e):p(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),p(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.FN()},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.FN();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.FN()},r.prototype.GN=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.zN(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.NN(n,d,c);0!==s.negative;)d--,s.negative=0,s.NN(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.FN(),s.FN(),"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.GN(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.FN(),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,m=1;0==(s.words[0]&m)&&g<26;++g,m<<=1);if(g>0)for(s.iushrn(g);g-- >0;)(h.isOdd()||a.isOdd())&&(h.iadd(u),a.isub(c)),h.iushrn(1),a.iushrn(1);e.cmp(s)>=0?(e.isub(s),n.isub(h),o.isub(a)):(s.isub(e),h.isub(n),a.isub(o))}return{a:h,b:a,gcd:s.iushln(l)}},r.prototype.HN=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.FN(),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).WN(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.WN=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.WN(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.UN(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.UN(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.$N(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.$N(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.$N(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.$N(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.$N(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.$N(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function x(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this.YN()}function S(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=r.XN(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function w(t){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.HN(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype.YN=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},x.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var s=e0?i.isub(this.p):void 0!==i.strip?i.strip():i.FN(),i},x.prototype.split=function(t,e){t.iushrn(this.n,0,e)},x.prototype.imulK=function(t){return t.imul(this.k)},s(S,x),S.prototype.split=function(t,e){for(var i=4194303,s=Math.min(t.length,9),r=0;r>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},S.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=r,e=s}return 0!==e&&(t.words[t.length++]=e),t},r.XN=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new S;else if("p224"===t)e=new v;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return y[t]=e,e},A.prototype.$N=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},A.prototype.UN=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")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t).WN(this):(a(t,t.umod(this.m).WN(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).WN(this)},A.prototype.add=function(t,e){this.UN(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.WN(this)},A.prototype.iadd=function(t,e){this.UN(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.UN(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.WN(this)},A.prototype.isub=function(t,e){this.UN(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.$N(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this.UN(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this.UN(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 m=f,p=0;0!==m.cmp(h);p++)m=m.redSqr();i(p=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 w(t)},s(w,A),w.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},w.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},w.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(s).iushrn(this.shift),n=r;return r.cmp(this.m)>=0?n=r.isub(this.m):r.cmpn(0)<0&&(n=r.iadd(this.m)),n.WN(this)},w.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).WN(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.WN(this)},w.prototype.invm=function(t){return this.imod(t.HN(this.m).mul(this.r2)).WN(this)}}(0,Wg);var qg=Yg.exports;function Xg(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 $g=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},jg=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 Zg{constructor(t,e){this.type=t,this.p=new qg(e.p,16),this.red=e.prime?qg.red(e.prime):qg.mont(this.p),this.zero=new qg(0).toRed(this.red),this.one=new qg(1).toRed(this.red),this.two=new qg(2).toRed(this.red),this.n=e.n&&new qg(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.jN=new Array(4),this.ZN=new Array(4),this.KN=new Array(4),this.qN=new Array(4),this.JN=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.QN=!0,this.redN=this.n.toRed(this.red))}tG(t,e){const i=t.iG(),s=$g(e,1,this.JN);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}hG(t,e,i,s,r){const n=this.jN,o=this.ZN,h=this.KN;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]=$g(i[s],n[s],this.JN),h[r]=$g(i[r],n[r],this.JN),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=jg(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)}iG(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 qg(t.a,16),b:new qg(t.b,16)}))):this.dG(i),{beta:e,lambda:i,basis:s}}cG(t){const e=t===this.p?this.red:qg.mont(t),i=new qg(2).toRed(e).redInvm(),s=i.redNeg(),r=new qg(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}dG(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 qg(1),g=new qg(0),m=new qg(0),p=new qg(1),y=0;for(;0!==c.cmpn(0);){const t=d.div(c);l=d.sub(t.mul(c)),u=m.sub(t.mul(f));const o=p.sub(t.mul(g));if(!r&&l.cmp(e)<0)i=a.neg(),s=f,r=l.neg(),n=u;else if(r&&2==++y)break;a=l,d=c,c=l,m=f,f=u,p=g,g=o}o=l.neg(),h=u;const x=r.sqr().add(n.sqr());return o.sqr().add(h.sqr()).cmp(x)>=0&&(o=i,h=s),r.negative&&(r=r.neg(),n=n.neg()),o.negative&&(o=o.neg(),h=h.neg()),[{a:r,b:n},{a:o,b:h}]}fG(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 Qg(this,t,e,i)}pointFromX(t,e){(t=new qg(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)}gG(t,e,i){const s=this.lG,r=this.uG;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 qg(t,16),this.isInfinity()?this:this.oG(t)?this.curve.tG(this,t):this.curve.endo?this.curve.gG([this],[t]):this.curve.sG(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.gG(s,r):this.curve.hG(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.gG(s,r,!0):this.curve.hG(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 tm extends Kg{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 qg(0)):(this.x=new qg(e,16),this.y=new qg(i,16),this.z=new qg(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 tm(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 em{constructor(t){this.curve=new Jg(t),this.g=this.curve.g,this.n=this.curve.n}}const im={};var sm;im.PresetCurve=em,sm={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(im,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new em(sm);return Object.defineProperty(im,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class rm{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.SG(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof rm?e:new rm(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}SG(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 nm(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 om{constructor(){this.place=0}}class hm{constructor(t,e){if(t instanceof hm)return t;this.xG(t,e)||(this.r=new qg(t.r,16),this.s=new qg(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}xG(t,e){t=Xg(t,e);const i=new om;if(48!==t[i.place++])return!1;const s=nm(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=nm(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=nm(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 qg(n),this.s=new qg(h),this.recoveryParam=null,!0}}class am{constructor(t){if(!(this instanceof am))return new am(t);"string"==typeof t&&(t=im[t]),t instanceof im.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 rm.fromPublic(this,t,e)}bG(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.bG(new qg(t,16)),i=this.keyFromPublic(i,s);const r=(e=new hm(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.QN){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 lm,um={exports:{}};um.exports=(lm=lm||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!==Wg&&Wg.crypto&&(i=Wg.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.ww=new a.init,this.vG=0},MG:function(t){"string"==typeof t&&(t=d.parse(t)),this.ww.concat(t),this.vG+=t.sigBytes},_G:function(e){var i,s=this.ww,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this.AG,0))*o,u=t.min(4*l,n);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,p=l[f-2],y=(p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10;l[f]=m+l[f-7]+y+l[f-16]}var x=s&r^s&n^r&n,S=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),v=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+v|0,o=n,n=r,r=s,s=v+(S+x)|0}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+o|0,i[4]=i[4]+h|0,i[5]=i[5]+u|0,i[6]=i[6]+c|0,i[7]=i[7]+d|0},CG:function(){var t=this.ww,i=t.words,s=8*this.vG,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._G(),this.FG},clone:function(){var t=n.clone.call(this);return t.FG=this.FG.clone(),t}});i.SHA256=n.TG(u),i.HmacSHA256=n.IG(u)}(Math),t.SHA256}(um.exports),mm={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({kG:function(){this.FG=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},CG:function(){var t=r.CG.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.TG(n),e.HmacSHA224=r.IG(n),t.SHA224;var e,i,s,r,n}(um.exports),pm={exports:{}}.exports=um.exports.enc.Hex,ym={exports:{}}.exports=um.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.PG;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.PG,r=this.DG;if(!r){r=this.DG=[];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)},PG:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(um.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({kG:function(){this.FG=new r.init([1732584193,4023233417,2562383102,271733878])},wG: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.FG.words,o=t[e+0],a=t[e+1],f=t[e+2],g=t[e+3],m=t[e+4],p=t[e+5],y=t[e+6],x=t[e+7],S=t[e+8],v=t[e+9],b=t[e+10],M=t[e+11],A=t[e+12],w=t[e+13],D=t[e+14],T=t[e+15],E=n[0],B=n[1],k=n[2],I=n[3];E=l(E,B,k,I,o,7,h[0]),I=l(I,E,B,k,a,12,h[1]),k=l(k,I,E,B,f,17,h[2]),B=l(B,k,I,E,g,22,h[3]),E=l(E,B,k,I,m,7,h[4]),I=l(I,E,B,k,p,12,h[5]),k=l(k,I,E,B,y,17,h[6]),B=l(B,k,I,E,x,22,h[7]),E=l(E,B,k,I,S,7,h[8]),I=l(I,E,B,k,v,12,h[9]),k=l(k,I,E,B,b,17,h[10]),B=l(B,k,I,E,M,22,h[11]),E=l(E,B,k,I,A,7,h[12]),I=l(I,E,B,k,w,12,h[13]),k=l(k,I,E,B,D,17,h[14]),E=u(E,B=l(B,k,I,E,T,22,h[15]),k,I,a,5,h[16]),I=u(I,E,B,k,y,9,h[17]),k=u(k,I,E,B,M,14,h[18]),B=u(B,k,I,E,o,20,h[19]),E=u(E,B,k,I,p,5,h[20]),I=u(I,E,B,k,b,9,h[21]),k=u(k,I,E,B,T,14,h[22]),B=u(B,k,I,E,m,20,h[23]),E=u(E,B,k,I,v,5,h[24]),I=u(I,E,B,k,D,9,h[25]),k=u(k,I,E,B,g,14,h[26]),B=u(B,k,I,E,S,20,h[27]),E=u(E,B,k,I,w,5,h[28]),I=u(I,E,B,k,f,9,h[29]),k=u(k,I,E,B,x,14,h[30]),E=c(E,B=u(B,k,I,E,A,20,h[31]),k,I,p,4,h[32]),I=c(I,E,B,k,S,11,h[33]),k=c(k,I,E,B,M,16,h[34]),B=c(B,k,I,E,D,23,h[35]),E=c(E,B,k,I,a,4,h[36]),I=c(I,E,B,k,m,11,h[37]),k=c(k,I,E,B,x,16,h[38]),B=c(B,k,I,E,b,23,h[39]),E=c(E,B,k,I,w,4,h[40]),I=c(I,E,B,k,o,11,h[41]),k=c(k,I,E,B,g,16,h[42]),B=c(B,k,I,E,y,23,h[43]),E=c(E,B,k,I,v,4,h[44]),I=c(I,E,B,k,A,11,h[45]),k=c(k,I,E,B,T,16,h[46]),E=d(E,B=c(B,k,I,E,f,23,h[47]),k,I,o,6,h[48]),I=d(I,E,B,k,x,10,h[49]),k=d(k,I,E,B,D,15,h[50]),B=d(B,k,I,E,p,21,h[51]),E=d(E,B,k,I,A,6,h[52]),I=d(I,E,B,k,g,10,h[53]),k=d(k,I,E,B,b,15,h[54]),B=d(B,k,I,E,a,21,h[55]),E=d(E,B,k,I,S,6,h[56]),I=d(I,E,B,k,T,10,h[57]),k=d(k,I,E,B,y,15,h[58]),B=d(B,k,I,E,w,21,h[59]),E=d(E,B,k,I,m,6,h[60]),I=d(I,E,B,k,M,10,h[61]),k=d(k,I,E,B,f,15,h[62]),B=d(B,k,I,E,v,21,h[63]),n[0]=n[0]+E|0,n[1]=n[1]+B|0,n[2]=n[2]+k|0,n[3]=n[3]+I|0},CG:function(){var t=this.ww,i=t.words,s=8*this.vG,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._G();for(var h=this.FG,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.FG=this.FG.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.TG(a),i.HmacMD5=n.IG(a)})(Math),t.MD5}(um.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({kG:function(){this.FG=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},wG:function(t,e){for(var i=this.FG.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},CG:function(){var t=this.ww,e=t.words,i=8*this.vG,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._G(),this.FG},clone:function(){var t=r.clone.call(this);return t.FG=this.FG.clone(),t}}),e.SHA1=r.TG(h),e.HmacSHA1=r.IG(h),t.SHA1;var e,i,s,r,n,o,h}(um.exports),dm=(cm=um.exports).lib.Base,fm=cm.enc.Utf8,cm.algo.HMAC=dm.extend({init:function(t,e){t=this.BG=new t.init,"string"==typeof e&&(e=fm.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.LG=e.clone(),n=this.OG=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.VG==this.EG?t=s.createEncryptor:(t=s.createDecryptor,this.AG=1),this.UG&&this.UG.$G==t?this.UG.init(this,i&&i.words):(this.UG=t.call(s,this,i&&i.words),this.UG.$G=t)},wG:function(t,e){this.UG.processBlock(t,e)},CG:function(){var t,e=this.cfg.padding;return this.VG==this.EG?(e.pad(this.ww,this.blockSize),t=this._G(!0)):(t=this._G(!0),e.unpad(t)),t},blockSize:4});var m=s.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),p=(i.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return(i?n.create([1398893684,1701076831]).concat(i).concat(e):e).toString(a)},parse:function(t){var e,i=a.parse(t),s=i.words;return 1398893684==s[0]&&1701076831==s[1]&&(e=n.create(s.slice(2,4)),s.splice(0,4),i.sigBytes-=16),m.create({ciphertext:i,salt:e})}},y=s.SerializableCipher=r.extend({cfg:r.extend({format:p}),encrypt:function(t,e,i,s){s=this.cfg.extend(s);var r=t.createEncryptor(i,s),n=r.finalize(e),o=r.cfg;return m.create({ciphertext:n,key:i,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:s.format})},decrypt:function(t,e,i,s){return s=this.cfg.extend(s),e=this.YG(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},YG:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),x=(i.kdf={}).OpenSSL={execute:function(t,e,i,s){s||(s=n.random(8));var r=l.create({keySize:e+i}).compute(t,s),o=n.create(r.words.slice(e),4*i);return r.sigBytes=4*e,m.create({key:r,iv:o,salt:s})}},S=s.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:x}),encrypt:function(t,e,i,s){var r=(s=this.cfg.extend(s)).kdf.execute(i,t.keySize,t.ivSize);s.iv=r.iv;var n=y.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.YG(e,s.format);var r=s.kdf.execute(i,t.keySize,t.ivSize,e.salt);return s.iv=r.iv,y.decrypt.call(this,t,e,r.key,s)}})}()}(um.exports);var xm={exports:{}}.exports=function(t){return function(){var e=t,i=e.lib.BlockCipher,s=e.algo,r=[],n=[],o=[],h=[],a=[],l=[],u=[],c=[],d=[],f=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,s=0;for(e=0;e<256;e++){var g=s^s<<1^s<<2^s<<3^s<<4;g=g>>>8^255&g^99,r[i]=g,n[g]=i;var m=t[i],p=t[m],y=t[p],x=257*t[g]^16843008*g;o[i]=x<<24|x>>>8,h[i]=x<<16|x>>>16,a[i]=x<<8|x>>>24,l[i]=x,x=16843009*y^65537*p^257*m^16843008*i,u[g]=x<<24|x>>>8,c[g]=x<<16|x>>>16,d[g]=x<<8|x>>>24,f[g]=x,i?(i=m^t[t[t[y^m]]],s^=t[t[s]]):i=s=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],m=s.AES=i.extend({kG:function(){if(!this.XG||this.jG!==this.NG){for(var t=this.jG=this.NG,e=t.words,i=t.sigBytes/4,s=4*((this.XG=i+6)+1),n=this.ZG=[],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.KG=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.qG(t,e,this.ZG,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.qG(t,e,this.KG,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},qG:function(t,e,i,s,r,n,o,h){for(var a=this.XG,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++],p=s[u>>>24]^r[c>>>16&255]^n[d>>>8&255]^o[255&l]^i[f++],y=s[c>>>24]^r[d>>>16&255]^n[l>>>8&255]^o[255&u]^i[f++],x=s[d>>>24]^r[l>>>16&255]^n[u>>>8&255]^o[255&c]^i[f++];l=m,u=p,c=y,d=x}m=(h[l>>>24]<<24|h[u>>>16&255]<<16|h[c>>>8&255]<<8|h[255&d])^i[f++],p=(h[u>>>24]<<24|h[c>>>16&255]<<16|h[d>>>8&255]<<8|h[255&l])^i[f++],y=(h[c>>>24]<<24|h[d>>>16&255]<<16|h[l>>>8&255]<<8|h[255&u])^i[f++],x=(h[d>>>24]<<24|h[l>>>16&255]<<16|h[u>>>8&255]<<8|h[255&c])^i[f++],t[e]=m,t[e+1]=p,t[e+2]=y,t[e+3]=x},keySize:8});e.AES=i.TG(m)}(),t.AES}(um.exports),Sm={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.GG,s=i.blockSize,r=this.HG,n=this.JG;r&&(n=this.JG=r.slice(0),this.HG=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}(um.exports),bm={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(um.exports);const Mm={"-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=="]},Am=gt,wm=(...t)=>t.slice(1).reduce(((e,i)=>e+Am.atob(Mm[t[0]][i].toString())),"");let Dm,Tm,Em=!1,Bm=new Uint8Array([34]);class km{set e(t){Dm=t}get e(){Tm={_h:!1,Ah:!1,wh:!1,kh:!1,Ch:!1,Th:!1};const t=Bm.length>=1?Bm[0]:void 0;return void 0!==t&&(Tm._h=!!(1&t),Tm.Ah=!!(2&t),Tm.wh=!!(4&t),Tm.kh=!!(8&t),Tm.Ch=!!(16&t),Tm.Th=!!(32&t)),Tm.Th}}let Im=!1;const Cm=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},Pm=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")}`},Lm=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),Rm=t=>{const e={},i=t.split("-");if(3!==i.length)throw new Error(wm(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 Om(d,f)?e:null},Fm=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(Cm(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(Lm(h)s[e]===t)))return;break}case"0002":if(!Rm(t))throw new Error(wm(0,0,1,7,1,12,5));return;default:throw new Error(wm(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}throw new Error(wm(0,0,1,2,1,7,1,12,5))},_m=t=>{if(!t)throw new Error(wm(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5));const e=(t[wm(-1,9)]||t[wm(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(Am[wm(-1,6)][wm(-1,7)])>-1)return!0;const i=e.filter((t=>t.indexOf("*")>-1));if(Um(Am[wm(-1,6)][wm(-1,7)],i))return!0;const s=t[wm(-1,8)]||t[wm(-1,38)];if(""!==s&&null!=s){if(Um(Am[wm(-1,6)][wm(-1,7)],[s]))return!1;if(s===Am[wm(-1,6)][wm(-1,7)])return!1}throw new Error(wm(0,14,1,20,5))},Om=(t,e)=>{const i=new am("secp256k1").keyFromPublic(wm(-4,0),"hex"),s=mm(t).toString();return i.verify(s,e)},zm=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(!Om(r,n))throw new Error(wm(0,21,1,2,1,7,1,12,5));const o=pm.parse(r);i=xm.decrypt({ciphertext:pm.parse(s)},o,{mode:Sm,padding:bm,iv:pm.parse("00000000000000000000000000000001")}).toString(ym)}catch(t){throw new Error(wm(0,21,1,2,1,7,1,12,5))}try{e=JSON.parse(i)}catch(t){throw new Error(wm(0,21,1,2,1,7,1,12,5))}if(void 0===e[wm(-1,5)]||null===e[wm(-1,4)]||!e[wm(-1,9)])throw new Error(wm(0,21,1,2,1,7,1,12,5));const s=parseInt(wm(-3,0),10)||Number(parseInt(wm(-3,0),10));if(e[wm(-1,5)]{const e=Rm(t);if(!e)throw new Error(wm(0,0,1,7,1,12,5));let i,s="";try{const t=e.QG.slice(e.tH,e.tH+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(wm(0,39,1,40,1,41,5));const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!Om(`${s}-${r}`,n))throw new Error(wm(0,21,1,2,1,7,1,12,5));const o=Uint8Array.from(Cm(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(wm(-3,0),10)||Number(parseInt(wm(-3,0),10))))throw new Error(wm(0,21,1,2,1,3,1,4,5));const a=Int32Array.from(Cm(s,8)),l=gm(e[wm(-1,31)]).toString(pm),u=Int32Array.from(Cm(l,8)),c=gm(e[wm(-1,32)]).toString(pm),d=Int32Array.from(Cm(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t)))throw new Error(wm(0,21,1,2,1,7,1,12,5))})(t,e);break;case"0002":((t,e)=>{if(!e)throw new Error(wm(0,39,1,40,1,41,5));const i=Rm(t);if(!i)throw new Error(wm(0,0,1,7,1,12,5));const s=i.QG.slice(i.tH,i.QG.length),r=new DataView(s.buffer),n=new Int32Array(8);for(let t=0;tu[e]===t)))throw new Error(wm(0,21,1,2,1,7,1,12,5))})(t,e);break;default:throw new Error(wm(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}},Nm=(t,e,i=!0)=>{let s;Im=!1,e instanceof us?(s=e._e,e.G()):"container"in e&&(s="string"==typeof e.container?gt.document.getElementById(e.container):e.container);const r=!!s&&(s===gt.document.body||gt.document.body.contains(s)),n=s&&r?s:document.body,o=gt.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?wm(0,0,1,2,1,23,1,24,25,1):"")+h.charAt(0).toUpperCase()+h.substr(1);const a=gt.document.createElement("p1");o.append(a),a.innerHTML=h,a.style.color="red"},Gm=(t,e,i)=>{e?(t[wm(-1,17)](wm(-1,19),i),t[wm(-1,17)](wm(-1,20),i),t[wm(-1,17)](wm(-1,21),i),t[wm(-1,17)](wm(-1,22),i)):(t[wm(-1,18)](wm(-1,19),i),t[wm(-1,18)](wm(-1,20),i),t[wm(-1,18)](wm(-1,21),i),t[wm(-1,18)](wm(-1,22),i))},Um=(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)}))},Hm=t=>{const i=()=>{};let s,r,n;if(new gt.Image instanceof gt.HTMLImageElement){const t=new gt.Image;t.src=pd,r=new sd({source:t,fitMode:e.ImageFitMode.Stretch});const i=new gt.Image;i.src=md,n=new sd({source:i,fitMode:e.ImageFitMode.Stretch})}else if(gt.lcjs_setup){const t=new gt.Image;t.src=pd;const i=gt.lcjs_setup(t.naturalWidth,t.naturalHeight);i.getContext("2d").drawImage(t,0,0),r=new sd({source:i,fitMode:e.ImageFitMode.Stretch}),n=r}else r=new z({color:w("#f00")}),n=r;const o=e=>{const i=e.ct.yi();if(e.Kc&&(e.iH&&(n?e.Kc.ps(n):gt.requestAnimationFrame((()=>o(e)))),e.iH||(r?e.Kc.ps(r):gt.requestAnimationFrame((()=>o(e))))),e.Kc){const t=(e.iH,150),s=(e.iH,32),r=e.ct.x.getInnerEnd()-(3+t)*i.x,n=e.ct.y.getInnerStart()+3*i.y;e.Kc.Sn({x:r,y:n}).q({x:t*i.x,y:s*i.y})}!1===e.iH&&(6530!==pd.length&&Nm(wm(0,36,1,38,5),t,!1),"W"!==pd[3361]&&Nm(wm(0,36,1,38,5),t,!1)),!0===e.iH&&(8542!==md.length&&Nm(wm(0,36,1,38,5),t,!1),"2"!==md[571]&&Nm(wm(0,36,1,38,5),t,!1)),s&&s.Bi()};return s=t.vT("logo",Number.MAX_SAFE_INTEGER),n=>{const h={ct:n,iH:!1};let a,l;return h.sH=()=>{a=gt.setTimeout((()=>{l=t.Ae(e.MouseStyles.Point),void 0!==h.Kc&&(h.Kc.setMouseClickEventHandler(Wm),h.Kc.setTouchEndEventHandler(Wm)),h.iH=!0,o(h)}),3e3)},h.eH=()=>{gt.clearTimeout(a),t.we(l),void 0!==h.Kc&&(h.Kc.setMouseClickEventHandler(i),h.Kc.setTouchEndEventHandler(i)),h.iH=!1,o(h)},(t=>{t.Kc&&t.Kc.dispose(),s&&(t.Kc=s.gc(t.ct).ps(r).setMouseInteractions(!0).setMouseClickEventHandler(i).setTouchEndEventHandler(i).$h(J),t.sH&&t.Kc.setMouseEnterEventHandler(t.sH),t.eH&&t.Kc.setMouseLeaveEventHandler(t.eH),o(t))})(h),{Gs:()=>o(h),G:()=>(t=>{t.Kc&&(t.Kc.dispose(),t.Kc=void 0,t.sH=()=>{},t.eH=()=>{})})(h)}}},Wm=()=>gt.open("https://lightningchart.com/lightningchart-js/"),Ym=s.Record({color:A(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class qm extends Ym{constructor(t){super(t),this.type="glow"}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 Xm=s.Record({gridStrokeLength:1,gridStrokeStyle:new tt,tickLength:7,tickStyle:new tt,tickPadding:0,labelFont:new Yi,labelFillStyle:new z,labelPadding:0,labelAlignment:0,labelRotation:0});class $m extends Xm{}class jm extends $m{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 Zm=Object.assign(Object.create(new class extends $m{}),{}),Km=(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},Jm=(t,e,i,...s)=>Km(-1,t,e,i,s),Qm=(t,e,i,...s)=>Km(-1,t,e,i,s),tp=(t,e,i,...s)=>Km(0,t,e,i,s),ep=(t,e,...i)=>Km(1,t,e,void 0,i),ip=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},sp=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:Oi({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:Oi(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:Jm("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Oi({ignore:"first"},5,10,15,30)},minorTicks:{amount:4,fitFunction:Oi(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:Jm("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Oi({ignore:"first"},5,10,15,30)},minorTicks:{amount:12,fitFunction:Oi(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:Jm("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Oi({ignore:"first"},3,6,12)},minorTicks:{amount:8,fitFunction:Oi(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:Jm("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:Oi({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:Oi({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:ip(-1),getNextKeyValueIncludingRef:ip(0),getNextKeyValue:ip(1),greatTicks:!0,majorTicks:{fitFunction:Oi(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:Qm("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:tp("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:ep("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Oi(void 0,2,3)},minorTicks:{fitFunction:Oi(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:Qm("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:tp("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:ep("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Oi({ignore:"first"},2,5)},minorTicks:{fitFunction:Oi(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:Qm("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:tp("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:ep("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Oi(void 0,2,4)},minorTicks:{fitFunction:Oi(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:Qm("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:tp("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:ep("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:Qm("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:tp("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:ep("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],rp=(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=rp("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(sp.indexOf(o)<=sp.findIndex((t=>"Hour"===t.label)))return"left"===e?[h]:[];let u;if(!0===o.irregular)u=_i(i,s,o.getPrevKeyValue(t),o.getNextKeyValue(t));else{const e=o.greatTicks.getReferenceKeyValue(t)(i);u=Fi(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||Pe(c,a,l)?[h]:[c]:void 0!==c&&Pe(c,a,l)?[c]:[l]},op=(t,e)=>(i,s,r,n)=>{const o=rp(t,r,n);let h;if(void 0===o)return[];if("great"===t&&void 0!==o.greatTicks)if(!0===o.irregular)h=_i(i,s,o.getPrevKeyValue(e),o.getNextKeyValue(e));else{const t=o.greatTicks.getReferenceKeyValue(e)(i);h=Fi(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 sp[sp.indexOf(t)+1]})(o);if(void 0===t)return[];h=Ri(i,s,t.unit/o.minorTicks.amount,1)}}return h},hp=t=>(e,i,s,r,n,o)=>{const h=rp(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},ap=s.Record({locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new jm,majorTickStyle:new jm,minorTickStyle:new jm,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 lp extends ap{ws(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>sp.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]},`;gt.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=rp(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){let t;t=!1===Mt(n,"left"===i?a:l)?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=t+e}const d=s.get(t);if(void 0===d)return r(h);const f=d[sp.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{_i:"Great ticks (directive)",xg:0,bi:!0,pe:op("great",e),me:void 0},{_i:"Major ticks",xg:1,Ws:this.majorTickStyle,Ns:n("major"),pe:op("major",e),Ji:{Xs:hp("major")},me:void 0}];this.greatTickStyle!==Zm&&(o.push({_i:"Great ticks (left)",Ws:this.greatTickStyle.setLabelAlignment(-1),Ns:n("great","left"),pe:np(e,"left"),xi:!0,Ks:!1}),o.push({_i:"Great ticks (right)",Ws:this.greatTickStyle.setLabelAlignment(1),Ns:n("great","right"),pe:np(e,"right"),xi:!0,Ks:!1})),this.minorTickStyle!==Zm&&h.push({_i:"Minor ticks",xg:2,Ws:this.minorTickStyle,Ns:n("minor"),pe:op("minor",e),Ji:{Xs:hp("minor"),Qi:(t,e,i,s,r,n)=>{const o=rp("minor",r,n);return!o||"Week"!==o.label}},me:void 0});const a=this.cursorFormatter;return{Ai:o,wi:h,vi: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)} `},Ts:1e3,Is: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!==Zm?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!==Zm?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")}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 up=(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 Fi(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,Ri(i,s,o,h)},cp=(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,dp=Oi(void 0,2,5),fp=(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,gp=(t,e)=>{const i=mi(t),s=pi(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),pe:Li,xi:!0,Ks:!0}),o.push({_i:"Major ticks",xg:0,Ws:this.majorTickStyle,Ns:void 0===e?s:(t,i,r)=>s(e+t,i,r),pe:"logarithmic"===t.type?gp(t.base,!0):up(0,!0),Ji:"logarithmic"===t.type?void 0:{Xs:cp},me:void 0}),this.minorTickStyle!==Zm&&o.push({_i:"Minor ticks",xg:1,Ws:this.minorTickStyle,Ns:void 0===e?r:(t,i,s)=>r(e+t,i,s),pe:"logarithmic"===t.type?gp(t.base,!1):up(1,!1),Ji:"logarithmic"===t.type?{Xs:fp}:{Xs:dp},me:50});const h=this.cursorFormatter?this.cursorFormatter:bi.Numeric;return{Ai:n,wi:o,vi:void 0===e?h:(t,i,s)=>h(e+t,i,s),Ts:1e-9,Is: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!==Zm?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!==Zm?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 yp=s.Record({cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new jm,minorTickStyle:new jm}),xp=(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"},Sp={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}${le(s,2)}:${le(r,2)}:${le(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}${le(s,2)}:${le(r,2)}:${le(n,2)}.${le(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}${le(s,2)}:${le(r,2)}:${le(n,2)}.${le(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}${le(s,2)}:${le(r,2)}:${le(n,2)}.${le(o,3)}${h}`}},vp={MajorHours12:{major:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Fi(t,e,r,void 0,1e6)},fitKeyValues:Oi({ignore:"first"},2,4)},minor:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>Ri(t,e,36e5,1e6),fitKeyValues:Oi({},2,3,4,6)},defaultValueFormatter:Sp.hhmmss},MajorHours:{major:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Fi(t,e,r,void 0,1e6)},fitKeyValues:Oi({ignore:"first"},2,6,12)},minor:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>Ri(t,e,3e5,1e6),fitKeyValues:Oi({},2,4,6)},defaultValueFormatter:Sp.hhmmss},MajorMinutes15:{major:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Fi(t,e,9e5,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2)},minor:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>Ri(t,e,6e4,1e6),fitKeyValues:Oi({},3,5)},defaultValueFormatter:Sp.hhmmss},MajorMinutes:{major:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Fi(t,e,6e4,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>Ri(t,e,5e3,1e6),fitKeyValues:Oi({},2,3,4,6)},defaultValueFormatter:Sp.hhmmss},MajorSeconds15:{major:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Fi(t,e,15e3,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,4)},minor:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>Ri(t,e,1e3,1e6),fitKeyValues:Oi({},3,5)},defaultValueFormatter:Sp.hhmmss},MajorSeconds:{major:{format:Sp.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Fi(t,e,1e3,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmm,getKeyValues:(t,e,i,s)=>Ri(t,e,100,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.hhmmssmmm},MajorMilliseconds100:{major:{format:Sp.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Fi(t,e,100,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmm,getKeyValues:(t,e,i,s)=>Ri(t,e,10,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.hhmmssmmm},MajorMilliseconds10:{major:{format:Sp.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Fi(t,e,10,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmm,getKeyValues:(t,e,i,s)=>Ri(t,e,1,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.hhmmssmmm},MajorMilliseconds:{major:{format:Sp.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Fi(t,e,1,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Ri(t,e,.1,1e6),fitKeyValues:Oi({},2)},defaultValueFormatter:Sp.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Sp.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Fi(t,e,.1,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Ri(t,e,.01,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Sp.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Fi(t,e,.01,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Ri(t,e,.001,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Sp.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Fi(t,e,.001,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Ri(t,e,100*1e-6,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Sp.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Fi(t,e,r,void 0,1e6)},fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Ri(t,e,10*1e-6,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.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 bp extends yp{ws(t){const e=this.timeOrigin||0,i=[{_i:"Major ticks",xg:0,Ws:this.majorTickStyle,Ns:(t,i,s)=>{const r=xp(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,vp[r].major.format)(t+e,i,s)},pe:(t,e,i,s)=>{const r=xp(i,s);return(0,vp[r].major.getKeyValues)(t,e,i,s)},Ji:{Xs:(t,e,i,s,r,n)=>{const o=xp(r,n),h=vp[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},me:void 0}];return this.minorTickStyle instanceof jm&&i.push({_i:"Minor ticks",xg:1,Ws:this.minorTickStyle,Ns:(t,i,s)=>{const r=xp(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,vp[r].minor.format)(t+e,i,s)},pe:(t,e,i,s)=>{const r=xp(i,s);return(0,vp[r].minor.getKeyValues)(t,e,i,s)},Ji:{Xs:(t,e,i,s,r,n)=>{const o=xp(r,n),h=vp[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},me:void 0}),{Ai:[],wi:i,vi:this.cursorFormatter||((t,i,s)=>{const r=xp(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return vp[r].defaultValueFormatter(t+e,i,s)}),Ts:1e-4,Is: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!==Zm?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")}}const Mp={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"}},Ap={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"}},wp={"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"}},Dp={"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"}},Tp={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"}},Ep={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"}},Bp={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"}},kp={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"}},Ip={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"}},Cp={World:Ep,USA:Bp,NorthAmerica:kp,SouthAmerica:Ip,Canada:Dp,Europe:Tp,Asia:Ap,Africa:Mp,Australia:wp},Pp={Solid:ll},Lp={warm:t=>e=>D(60/(t-1)*e,.8,.8),cold:t=>e=>D(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>D(360/t*e,.8,.8),reverseSpectrum:t=>e=>D(360/t*(t-e),.8,.8),flatUI:t=>e=>D(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return D(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return D(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return D(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return D(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return D(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>D(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return D(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return D(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),D(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return D(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=>D(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>Rp([{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=>Rp([{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=>Rp([{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=>Rp([{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=>Rp([{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=>Rp([{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)},Rp=(t,e,i)=>{const s=_p(e,i),[r,n]=Op(s,t),o=Fp(t[r]),h=Fp(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:ha(o.h,h.h,a),s:ha(o.s,h.s,a),v:ha(o.v,h.v,a)};return D(l.h,l.s,l.v)},Fp=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},Op=(t,e)=>{if(e.length<2)throw new Error("Invalid palette size");for(let i=0;i{const i=(t=>{const e=new z({color:t.uiStrokeColorContrastHigh}),i=new z({color:t.uiStrokeColorContrastMedium}),s=new z({color:t.uiStrokeColorContrastLow}),r=new Yi({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 tt({thickness:2,fillStyle:s}),d=new z({color:t.dataHighlightOverlayColor}),f=new tt({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),g=t.dataColorPalette.map((t=>new z({color:t.stroke}))),m=t=>g[t%g.length],p=g.map((t=>new tt({thickness:2,fillStyle:t}))),y=t=>p[t%p.length],x=t.dataColorPalette.map((t=>new z({color:t.border}))).map((t=>new tt({thickness:2,fillStyle:t}))),S=t=>x[t%x.length],v=t.dataColorPalette.map((t=>{const e=t.area;return new Z({angle:180,stops:[{color:se(e,A(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:se(e,A(0,0,0,e.getA()),.3),offset:1}]})})),b=t=>v[t%v.length],M=t.dataColorPaletteInverted.map((t=>{const e=t.area;return new Z({angle:180,stops:[{color:se(e,A(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:se(e,A(0,0,0,e.getA()),.3),offset:1}]})})),w=t=>M[t%M.length],D=t.dataColorPaletteInverted.map((t=>new z({color:t.border}))).map((t=>new tt({thickness:2,fillStyle:t}))),T=t=>D[t%D.length],E=new z({color:t.dataColorPositive}),B=new z({color:t.dataColorNegative}),k=new tt({thickness:1,fillStyle:new z({color:t.dataStrokeColorContrastHigh.setA(50)})}),I=new tt({thickness:2,fillStyle:t.axisLineFillStyle}),C=J,P=new z({color:A(0,0,0,1)}),L=new tt({thickness:1,fillStyle:t.axisGridMajorFillStyle}),R=new tt({thickness:1,fillStyle:t.axisTickMajorFillStyle}),_=h,O=t.axisLabelMajorFillStyle,V=new tt({thickness:1,fillStyle:t.axisGridMajorFillStyle}),N=new tt({thickness:1,fillStyle:t.axisTickMajorFillStyle}),G=h,U=t.axisLabelMajorFillStyle,H=new tt({thickness:1,fillStyle:t.axisGridMinorFillStyle}),W=new tt({thickness:1,fillStyle:t.axisTickMinorFillStyle}),Y=a,q=t.axisLabelMinorFillStyle,X=Zm,$=new jm({gridStrokeStyle:L,tickStyle:R,tickLength:50,tickPadding:-14,labelFont:_,labelPadding:0,labelFillStyle:O}),j=new jm({gridStrokeStyle:V,tickStyle:N,tickLength:7,tickPadding:0,labelFont:G,labelPadding:0,labelFillStyle:U}),K=new jm({gridStrokeStyle:H,tickStyle:W,tickLength:4,tickPadding:5,labelFont:Y,labelPadding:0,labelFillStyle:q}),Q=new pp({extremeTickStyle:X,majorTickStyle:j,minorTickStyle:K}),et=new lp({greatTickStyle:$,majorTickStyle:j,minorTickStyle:K}),it=new bp({majorTickStyle:j,minorTickStyle:K}),st=new z({color:t.dataHighlightOverlayColor}),rt=new tt({thickness:1,fillStyle:i}),nt=new tt({thickness:2,fillStyle:i}),ot=t=>new Ji.Triangulated({shape:"sphere",size:10,fillStyle:g[t%g.length]}),ht=g[0],at=t.uiTextFillStyle,lt=t.legendBackgroundFillStyle,ut=new tt({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),ct=ne(t.legendButtonDefaultColor),dt=new tt({thickness:1,fillStyle:e}),ft=new tt({thickness:1,fillStyle:t.cursorGridFillStyle});let gt={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:J,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new tt({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:J,chartXYTitleFont:n,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:c,chartXYZoomingRectangleFillStyle:d,chartXYZoomingRectangleStrokeStyle:f,chartXYFittingRectangleFillStyle:d,chartXYFittingRectangleStrokeStyle:f,lineSeriesStrokeStyle:y,pointLineSeriesStrokeStyle:y,pointLineSeriesFillStyle:m,pointSeriesFillStyle:m,ellipseSeriesFillStyle:m,ellipseSeriesStrokeStyle:y,polygonSeriesFillStyle:m,polygonSeriesStrokeStyle:y,rectangleSeriesFillStyle:m,rectangleSeriesStrokeStyle:J,segmentSeriesStrokeStyle:y,boxSeriesBodyFillStyle:m(0),boxSeriesBodyStrokeStyle:J,boxSeriesStrokeStyle:new tt({thickness:1,fillStyle:g[0]}),boxSeriesMedianStrokeStyle:new tt({thickness:1,fillStyle:new z({color:A(0,0,0)})}),ohlcCandleBodyFillStylePositive:E,ohlcCandleBodyFillStyleNegative:B,ohlcCandleBodyStrokeStylePositive:J,ohlcCandleBodyStrokeStyleNegative:J,ohlcCandleStrokeStyle:new tt({thickness:1,fillStyle:new z({color:t.uiStrokeColorContrastHigh})}),ohlcBarStrokeStylePositive:new tt({thickness:2,fillStyle:E}),ohlcBarStrokeStyleNegative:new tt({thickness:2,fillStyle:B}),heatmapGridSeriesFillStyle:m,heatmapGridSeriesWireframeStyle:k,heatmapScrollingGridSeriesFillStyle:m,heatmapScrollingGridSeriesWireframeStyle:k,areaRangeSeriesFillStyle:b,areaRangeSeriesStrokeStyle:S,areaRangeSeriesFillStyleInverted:w,areaRangeSeriesStrokeStyleInverted:T,areaSeriesBipolarHighFillStyle:b,areaSeriesBipolarHighStrokeStyle:S,areaSeriesBipolarLowFillStyle:w,areaSeriesBipolarLowStrokeStyle:T,areaSeriesPositiveFillStyle:b,areaSeriesPositiveStrokeStyle:S,areaSeriesNegativeFillStyle:w,areaSeriesNegativeStrokeStyle:T,xAxisTitleFont:o,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:I,xAxisNibStyle:C,xAxisOverlayStyle:P,xAxisZoomingBandFillStyle:d,xAxisZoomingBandStrokeStyle:J,xAxisNumericTicks:Q,xAxisDateTimeTicks:et,xAxisTimeTicks:it,yAxisTitleFont:o,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:I,yAxisNibStyle:C,yAxisOverlayStyle:P,yAxisZoomingBandFillStyle:d,yAxisZoomingBandStrokeStyle:J,yAxisNumericTicks:Q,yAxisDateTimeTicks:et,yAxisTimeTicks:it,bandFillStyle:st,bandStrokeStyle:rt,constantLineStrokeStyle:nt,chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:J,chart3DTitleFont:n,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:c,chart3DBoundingBoxStrokeStyle:J,xAxis3DTitleFont:o,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:I,xAxis3DNumericTicks:Q,xAxis3DDateTimeTicks:et,xAxis3DTimeTicks:it,yAxis3DTitleFont:o,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:I,yAxis3DNumericTicks:Q,yAxis3DDateTimeTicks:et,yAxis3DTimeTicks:it,zAxis3DTitleFont:o,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:I,zAxis3DNumericTicks:Q,zAxis3DDateTimeTicks:et,zAxis3DTimeTicks:it,lineSeries3DStrokeStyle:y,pointLineSeries3DStrokeStyle:y,pointLineSeries3DPointStyle:ot,pointSeries3DPointStyle:ot,pointCloudSeries3DPointStyle:t=>new Ji.Pixelated({size:5,fillStyle:g[t%g.length]}),surfaceGridSeries3DFillStyle:m,surfaceGridSeries3DWireframeStyle:k,surfaceScrollingGridSeries3DFillStyle:m,surfaceScrollingGridSeries3DWireframeStyle:k,boxSeries3DFillStyle:m,polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:J,polarChartTitleFont:n,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:c,polarSectorFillStyle:st,polarSectorStrokeStyle:rt,polarAmplitudeAxisTitleFont:o,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:I,polarAmplitudeAxisNumericTicks:Q,polarAmplitudeAxisDateTimeTicks:et,polarAmplitudeAxisTimeTicks:it,polarRadialAxisTitleFont:o,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:I,polarRadialAxisTickStyle:j,polarLineSeriesStrokeStyle:y,polarPointLineSeriesFillStyle:m,polarPointLineSeriesStrokeStyle:y,polarPointSeriesFillStyle:m,polarPolygonSeriesFillStyle:b,polarPolygonSeriesStrokeStyle:S,polarAreaSeriesFillStyle:b,polarAreaSeriesStrokeStyle:S,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:J,mapChartTitleFont:n,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:ht,mapChartStrokeStyle:new tt({thickness:1,fillStyle:new z({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:F,mapChartOutlierRegionStrokeStyle:new tt({thickness:1,fillStyle:s}),mapChartSeparateRegionFillStyle:lt,mapChartSeparateRegionStrokeStyle:ut,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:J,dataGridTitleFont:n,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:h,dataGridTextFillStyle:ht,dataGridCellBackgroundFillStyle:new z({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new tt({thickness:.4,fillStyle:new z({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:J,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ut,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ut,dataGridScrollBarButtonArrowFillStyle:ct,dataGridScrollBarButtonArrowStrokeStyle:ut,sparkLineChartStrokeStyle:y(0),sparkPointChartFillStyle:m(0),sparkBarChartFillStyle:m(0),sparkBarChartStrokeStyle:S(0),sparkAreaChartFillStyle:b(0),sparkAreaChartStrokeStyle:S(0),sparkPieChartFillStyle:m,sparkPieChartStrokeStyle:ut,sparkChartBandFillStyle:st,sparkChartBandStrokeStyle:rt,sparkChartConstantLineStrokeStyle:nt,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:J,spiderChartTitleFont:n,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:c,spiderChartWebStyle:new tt({thickness:2,fillStyle:s}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:h,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:o,spiderChartAxisStrokeStyle:new tt({thickness:2,fillStyle:i}),spiderChartAxisNibStrokeStyle:new tt({thickness:2,fillStyle:e}),spiderSeriesFillStyle:b,spiderSeriesStrokeStyle:S,spiderSeriesPointFillStyle:m,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:J,pieChartTitleFont:n,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:m,pieChartSliceStrokeStyle:ut,pieChartSliceLabelFont:u,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:dt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:J,funnelChartTitleFont:n,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:m,funnelChartSliceStrokeStyle:ut,funnelChartSliceLabelFont:u,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:dt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:J,pyramidChartTitleFont:n,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:m,pyramidChartSliceStrokeStyle:ut,pyramidChartSliceLabelFont:u,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:dt,gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:J,gaugeChartTitleFont:n,gaugeChartTitleFillStyle:t.titleFillStyle,gaugeChartEmptyGaugeFillStyle:new z({color:t.uiBackgroundColor}),gaugeChartEmptyGaugeStrokeStyle:ut,gaugeChartGaugeFillStyle:ht,gaugeChartIntervalLabelsFillStyle:at,gaugeChartIntervalLabelsFont:u,gaugeChartValueLabelFillStyle:at,gaugeChartValueLabelFont:u,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:J,onScreenMenuBackgroundColor:A(254,204,0,.7),uiButtonFillStyle:ct,uiButtonStrokeStyle:ut,uiButtonSize:10,uiBackgroundFillStyle:lt,uiBackgroundStrokeStyle:ut,uiTextFillStyle:at,uiTextFont:u,legendTitleFillStyle:at,legendTitleFont:l,cursorTickMarkerXBackgroundFillStyle:lt,cursorTickMarkerXBackgroundStrokeStyle:ut,cursorTickMarkerXTextFillStyle:at,cursorTickMarkerXTextFont:u,cursorTickMarkerYBackgroundFillStyle:lt,cursorTickMarkerYBackgroundStrokeStyle:ut,cursorTickMarkerYTextFillStyle:at,cursorTickMarkerYTextFont:u,cursorPointMarkerFillStyle:F,cursorPointMarkerStrokeStyle:J,cursorResultTableFillStyle:lt,cursorResultTableStrokeStyle:ut,cursorResultTableTextFillStyle:at,cursorResultTableTextFont:u,cursorGridStrokeStyleX:ft,cursorGridStrokeStyleY:ft,chartMarkerPointMarkerFillStyle:t.legendBackgroundBorderFillStyle,chartMarkerPointMarkerStrokeStyle:J};return t.overrideThemeProperties&&(gt={...gt,...t.overrideThemeProperties}),gt})(t),s={...e,header1Font:i.xAxisTitleFont,header2Font:i.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:i.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...i,examples:s}},Vp=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/themes/${e}`;return i.addEventListener("error",(e=>{ve(t,s,"Theme with asset",{shouldCrash:!1})})),i.src=s,i},Np=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:se(e[s%e.length].stroke,A(255,255,255),.5);return new $({stops:[{color:se(r,A(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:se(r,A(30,30,30),.5*i).setA(100),offset:1}]})},Gp=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:se(e[s%e.length].stroke,A(255,255,255),.2);return new $({stops:[{color:se(r,A(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:se(r,A(0,0,0),.2*i),offset:1}]})},Up=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:se(e[s%e.length].stroke,A(255,255,255),.2);return new Z({angle:90,stops:[{color:se(r,A(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:se(r,A(30,30,30),.5*i),offset:1}]})},Hp=(t,e,i)=>i=>{const s=!0===t?e[i%e.length].stroke:se(e[i%e.length].stroke,A(255,255,255),.3);return new Z({angle:90,stops:[{color:se(s,A(255,255,255),.5),offset:0},{color:s,offset:.35},{color:se(s,A(30,30,30),.5),offset:1}]})},Wp=(t,i,s)=>{const r=i[0].stroke;return new $({shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner,position:{x:.5,y:.5},stops:[{color:!0===t?r:se(r,A(255,255,255),.5*s),offset:0},{color:r,offset:.5},{color:!0===t?r:se(r,A(0,0,0),.5*s),offset:1}]})},Yp=xe((()=>{const t=A(255,255,255),i=new z({color:t}),s=!0,r=new qm({spread:1,blur:9,offset:{x:0,y:0},color:A(0,0,0,150)}),n=new $({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:A(50,51,52)},{offset:.5,color:A(14,15,16)},{offset:1,color:A(0,0,0)}]}),o=new z({color:A(45,45,45)}),h=new $({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:A(120,120,120,100)},{offset:1,color:A(0,0,0,50)}]}),a=new $({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:A(30,30,30,200)},{offset:1,color:A(0,0,0,255)}]}),l=new z({color:A(255,255,220)}),u=new z({color:A(255,255,166)}),c=new z({color:A(255,255,220)}),d=new z({color:A(255,255,220,130)}),f=new z({color:A(255,255,200)}),g=f,m=g,p=new Z({angle:45,stops:[{offset:0,color:A(230,230,230)},{offset:1,color:A(150,150,150)}]}),y=new z({color:A(220,220,220)}),x=new z({color:A(200,200,200,50)}),S=new z({color:A(200,200,200,150)}),v=new z({color:A(200,200,200,20)}),b=new z({color:A(150,150,150)}),M=new Z({angle:0,stops:[{offset:0,color:A(10,10,10,220)},{offset:1,color:A(30,30,30,220)}]}),w=i,D=A(255,255,200),T=M,E=w,B=A(20,20,20),k=A(0,0,0),I=t,C=A(150,150,150),P=A(50,50,50),L=A(50,50,50),R=A(100,100,100),F=A(200,200,200),_=[A(255,255,91,255),A(255,205,91,255),A(255,155,91,255),A(255,196,188,255),A(255,148,184,255),A(219,148,198,255),A(235,196,224,255),A(169,148,198,255),A(148,226,198,255),A(148,255,176,255),A(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),O=t.setA(20),V=A(176,255,157,255),N=A(255,112,76,255),G={mapChartFillStyle:new Z({angle:135,stops:[{color:A(255,255,91,255),offset:0},{color:A(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:Np(s,_,.5),pieChartSliceFillStylePalette:Gp(s,_,1),funnelChartSliceFillStylePalette:Up(s,_,1),pyramidChartSliceFillStylePalette:Up(s,_,1),rectangleSeriesFillStyle:Hp(s,_),gaugeChartGaugeFillStyle:Wp(s,_,1)},U=new z({color:A(176,255,157,255)}),H=new z({color:A(255,146,146,255)}),W=new z({color:A(176,255,157,255)}),Y=new z({color:A(230,63,63,255)}),q=new z({color:A(176,255,157,120)}),X=new z({color:A(229,63,63,180)}),j=new z({color:A(27,37,36,255)}),K=new z({color:A(62,27,27,255)}),J=[A(255,0,0),A(255,255,0),A(0,255,0)],Q=[A(10,10,255),A(10,190,255),A(251,255,0),A(255,38,0)],tt=[A(255,255,0),A(255,204,0),A(255,128,0),A(255,0,0)],et=[A(0,0,0),A(167,4,69,255),A(255,0,0),A(252,252,168,255)],it=new $({stops:[{color:A(61,61,80,100),offset:0},{color:A(44,44,55,30),offset:1}]}),st=new z({color:A(148,148,198,255)}),rt=q.getColor().setA(255),nt=A(100,100,100);return zp({isDark:s,highlightColorOffset:A(60,60,60,60),highlightColorOffsetAxisOverlay:A(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:n,dashboardSplitterFillStyle:o,panelBackgroundFillStyle:h,seriesBackgroundFillStyle:a,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:l,axisTitleFillStyle:u,axisLabelMajorFillStyle:c,axisLabelMinorFillStyle:d,uiTitleFillStyle:f,uiTextFillStyle:g,cursorTextFillStyle:m,axisLineFillStyle:p,axisTickMajorFillStyle:y,axisGridMajorFillStyle:x,axisTickMinorFillStyle:S,axisGridMinorFillStyle:v,cursorGridFillStyle:b,legendBackgroundFillStyle:M,legendBackgroundBorderFillStyle:w,legendButtonDefaultColor:D,resultTableBackgroundFillStyle:T,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:B,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:C,uiStrokeColorContrastLow:P,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:R,dataStrokeColorContrastLow:F,dataColorPalette:_,dataColorPaletteInverted:[{area:A(190,50,50,100),border:A(210,80,80)}],dataHighlightOverlayColor:O,dataColorPositive:V,dataColorNegative:N,overrideThemeProperties:G},{positiveTextFillStyle:U,negativeTextFillStyle:H,positiveFillStyle:W,negativeFillStyle:Y,positiveAreaFillStyle:q,negativeAreaFillStyle:X,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:K,badGoodColorPalette:J,coldHotColorPalette:Q,intensityColorPalette:tt,spectrogramColorPalette:et,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),qp=xe((()=>{const t=A(255,255,255),i=new z({color:t}),s=!0,r=new qm({spread:0,blur:9,offset:{x:0,y:0},color:A(105,255,236,40)}),n=new z({color:A(2,21,30)}),o=new $({stops:[{color:A(19,40,66,150),offset:0},{color:A(0,0,0,150),offset:1}]}),h=new z({color:A(0,5,8,150)}),a=i,l=i,u=i,c=new z({color:A(255,255,220,130)}),d=i,f=i,g=f,m=new z({color:A(20,224,250,255)}),p=i,y=new z({color:A(61,94,110,100)}),x=new z({color:A(61,94,110,255)}),S=new z({color:A(61,94,110,40)}),v=i,b=new z({color:A(0,18,23,255)}),M=i,w=t,D=new z({color:A(0,17,22,240)}),T=i,E=A(0,38,48,220),B=A(0,0,0),k=t,I=A(150,150,150),C=A(19,78,93),P=A(50,50,50),L=A(0,36,48),R=A(200,200,200),F=[A(45,253,253,255),A(44,172,247,255),A(46,100,248,255),A(96,84,199,255),A(184,104,245,255),A(98,160,218,255),A(43,238,245,255),A(38,140,206,255),A(112,96,224,255),A(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),_=t.setA(50),O=A(3,217,194,255),V=A(230,63,63,255),N={mapChartFillStyle:new Z({angle:135,stops:[{color:A(118,248,231,255),offset:0},{color:A(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Np(s,F,1),pieChartSliceFillStylePalette:Gp(s,F,1),funnelChartSliceFillStylePalette:Up(s,F,1),pyramidChartSliceFillStylePalette:Up(s,F,1),rectangleSeriesFillStyle:Hp(s,F),gaugeChartGaugeFillStyle:Wp(s,F,1)},G=new z({color:A(45,253,253,255)}),U=new z({color:A(255,146,146,255)}),H=new z({color:A(45,253,253,255)}),W=new z({color:A(230,63,63,255)}),Y=new z({color:A(1,190,164,120)}),q=new z({color:A(229,63,63,180)}),X=new z({color:A(1,53,57,255)}),j=new z({color:A(62,27,27,255)}),K=[A(1,104,119,255),A(0,165,144,255),A(0,246,214,255)],J=[A(0,87,95,255),A(0,125,124,255),A(1,209,182,255),A(0,255,221,255),A(218,112,112,255),A(172,47,47,255)],Q=[A(126,255,253,255),A(50,233,230,255),A(0,196,193,255),A(62,138,178,255),A(139,88,191,255),A(162,55,143,255)],tt=[A(13,31,52,255),A(101,50,118,255),A(1,142,172,255),A(2,196,170,255),A(0,255,221,255)],et=new $({stops:[{color:A(122,103,254,70),offset:0},{color:A(178,168,255,10),offset:1}]}),it=new z({color:A(122,103,254,255)}),st=Y.getColor().setA(255),rt=A(15,83,83);return zp({isDark:s,highlightColorOffset:A(60,60,60,60),highlightColorOffsetAxisOverlay:A(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new sd({source:Vp(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:m,axisTickMajorFillStyle:p,axisGridMajorFillStyle:y,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:w,resultTableBackgroundFillStyle:D,resultTableBackgroundBorderFillStyle:T,uiBackgroundColor:E,uiBackgroundBorderColor:B,uiStrokeColorContrastHigh:k,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:C,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:R,dataColorPalette:F,dataColorPaletteInverted:[{area:A(170,60,210,100),border:A(210,100,250)}],dataHighlightOverlayColor:_,dataColorPositive:O,dataColorNegative:V,overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:U,positiveFillStyle:H,negativeFillStyle:W,positiveAreaFillStyle:Y,negativeAreaFillStyle:q,positiveBackgroundFillStyle:X,negativeBackgroundFillStyle:j,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:rt})})),Xp=xe((()=>{const t=!1,i=new qm({spread:0,blur:6,offset:{x:2,y:-2},color:A(0,0,0,30)}),s=new $({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:A(255,255,255)},{offset:1,color:A(255,255,255)}]}),r=new z({color:A(219,227,233,255)}),n=new $({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:A(255,255,255,200)},{offset:1,color:A(240,244,246,200)}]}),o=new $({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:A(255,255,255,255)},{offset:1,color:A(255,255,255,255)}]}),h=new z({color:A(33,43,49)}),a=new z({color:A(33,43,49)}),l=new z({color:A(33,43,49)}),u=new z({color:A(33,43,49,150)}),c=new z({color:A(33,43,49)}),d=c,f=d,g=new Z({angle:45,stops:[{offset:0,color:A(225,225,225)},{offset:1,color:A(225,225,225)}]}),m=new z({color:A(168,186,199,255)}),p=new z({color:A(168,186,199,120)}),y=new z({color:A(168,186,199,40)}),x=new z({color:A(168,186,199,40)}),S=new z({color:A(128,146,159,255)}),v=new Z({angle:0,stops:[{offset:0,color:A(255,255,255,240)},{offset:1,color:A(255,255,255,240)}]}),b=new z({color:A(168,186,199)}),M=A(255,255,200),w=new z({color:A(255,255,255,240)}),D=new z({color:A(128,146,159,255)}),T=A(255,255,255,255),E=A(168,168,199,255),B=A(168,186,199,255),k=A(168,186,199,255),I=A(168,186,199,255),C=A(168,186,199,255),P=A(100,100,100),L=A(200,200,200),R=[A(28,181,140,255),A(255,132,0,255),A(240,39,39,255),A(86,121,251,255),A(2,181,213,255),A(13,212,158,255),A(22,167,3,255),A(234,103,232,255),A(62,183,179,255),A(140,93,3,255),A(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),F=A(150,150,150,80),_=A(46,182,120,255),O=A(255,66,66,255),V=new tt({thickness:2,fillStyle:new z({color:A(168,186,199,255)})}),N={mapChartFillStyle:new Z({angle:-45,stops:[{color:A(2,181,213,255),offset:0},{color:A(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:Np(t,R,.8),pieChartSliceFillStylePalette:Gp(t,R,.8),funnelChartSliceFillStylePalette:Up(t,R,.5),pyramidChartSliceFillStylePalette:Up(t,R,.5),rectangleSeriesFillStyle:Hp(t,R),gaugeChartGaugeFillStyle:Wp(t,R,.8),chartXYSeriesBackgroundStrokeStyle:V,chart3DSeriesBackgroundStrokeStyle:V,polarChartSeriesBackgroundStrokeStyle:V,spiderChartSeriesBackgroundStrokeStyle:V,dataGridTextFillStyle:new z({color:A(0,88,64,255)})},G=new z({color:A(4,146,108,255)}),U=new z({color:A(240,39,39,255)}),H=new z({color:A(28,181,140,255)}),W=new z({color:A(230,88,88,255)}),Y=new z({color:A(28,181,140,180)}),q=new z({color:A(230,88,88,180)}),X=new z({color:A(229,243,228)}),j=new z({color:A(232,225,216)}),K=[A(193,48,48,255),A(240,234,60,255),A(45,191,55,255)],J=[A(10,19,255,255),A(15,191,250,255),A(249,255,2,255),A(253,133,0,255),A(255,24,0,255)],Q=[A(50,99,213),A(8,179,77),A(255,246,0),A(255,126,0),A(189,36,30)],et=[A(16,64,176),A(8,179,77),A(255,246,0),A(255,126,0),A(168,6,0)],it=new z({color:A(185,198,207,255)}),st=new $({stops:[{color:A(151,190,220,10),offset:0},{color:A(151,190,220,50),offset:1}]}),rt=Y.getColor().setA(255),nt=A(150,150,150);return zp({isDark:t,highlightColorOffset:A(-60,-60,-60,60),highlightColorOffsetAxisOverlay:A(0,0,0,40),effect:i,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:s,dashboardSplitterFillStyle:r,panelBackgroundFillStyle:n,seriesBackgroundFillStyle:o,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:h,axisTitleFillStyle:a,axisLabelMajorFillStyle:l,axisLabelMinorFillStyle:u,uiTitleFillStyle:c,uiTextFillStyle:d,cursorTextFillStyle:f,axisLineFillStyle:g,axisTickMajorFillStyle:m,axisGridMajorFillStyle:p,axisTickMinorFillStyle:y,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:D,uiBackgroundColor:T,uiBackgroundBorderColor:E,uiStrokeColorContrastHigh:B,uiStrokeColorContrastMedium:k,uiStrokeColorContrastLow:I,dataStrokeColorContrastHigh:C,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:L,dataColorPalette:R,dataColorPaletteInverted:[{area:A(190,50,50,100),border:A(210,80,80)}],dataHighlightOverlayColor:F,dataColorPositive:_,dataColorNegative:O,overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:U,positiveFillStyle:H,negativeFillStyle:W,positiveAreaFillStyle:Y,negativeAreaFillStyle:q,positiveBackgroundFillStyle:X,negativeBackgroundFillStyle:j,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:Q,spectrogramColorPalette:et,bollingerFillStyle:st,bollingerBorderFillStyle:it,highlightPointColor:A(0,0,0),highlightDataGridColor:rt,unfocusedDataColor:nt})})),$p=xe((()=>{const t=!1,i=new $({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:A(255,255,255)},{offset:1,color:A(255,255,255)}]}),s=new z({color:A(214,236,216,255)}),r=new $({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:A(233,244,231,70)},{offset:1,color:A(233,244,231,200)}]}),n=new $({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:A(255,255,255,255)},{offset:1,color:A(255,255,255,255)}]}),o=new z({color:A(1,61,53)}),h=new z({color:A(1,61,53)}),a=new z({color:A(1,61,53)}),l=new z({color:A(1,61,53,150)}),u=new z({color:A(1,61,53)}),c=u,d=c,f=new Z({angle:45,stops:[{offset:0,color:A(225,225,225)},{offset:1,color:A(225,225,225)}]}),g=new z({color:A(188,211,186,255)}),m=new z({color:A(188,211,186,150)}),p=new z({color:A(188,211,186,50)}),y=new z({color:A(188,211,186,50)}),x=new z({color:A(104,148,111,255)}),S=new Z({angle:0,stops:[{offset:0,color:A(255,255,255,240)},{offset:1,color:A(255,255,255,240)}]}),v=new z({color:A(104,148,111)}),b=A(255,255,200),M=new z({color:A(255,255,255,240)}),w=new z({color:A(104,148,111,255)}),D=A(255,255,255,255),T=A(179,201,183,255),E=A(188,211,186,255),B=A(188,211,186,255),k=A(188,211,186,255),I=A(188,211,186,255),C=A(100,100,100),P=A(200,200,200),L=[A(138,195,142,255),A(193,161,114,255),A(178,99,99,255),A(142,156,210,255),A(154,209,219,255),A(164,212,199,255),A(104,156,97,255),A(196,147,195,255),A(92,190,187,255),A(126,100,51,255),A(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),R=A(150,150,150,80),F=A(46,182,84,255),_=A(232,96,96,255),O=new tt({thickness:2,fillStyle:new z({color:A(188,211,186,255)})}),V={mapChartFillStyle:new Z({angle:-45,stops:[{color:A(118,160,121,255),offset:0},{color:A(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:Np(t,L,.8),pieChartSliceFillStylePalette:Gp(t,L,.8),pyramidChartSliceFillStylePalette:Up(t,L,.5),funnelChartSliceFillStylePalette:Up(t,L,.5),rectangleSeriesFillStyle:Hp(t,L),gaugeChartGaugeFillStyle:Wp(t,L,.8),chartXYSeriesBackgroundStrokeStyle:O,chart3DSeriesBackgroundStrokeStyle:O,polarChartSeriesBackgroundStrokeStyle:O,spiderChartSeriesBackgroundStrokeStyle:O,dataGridTextFillStyle:new z({color:A(77,66,21,255)})},N=new z({color:A(93,151,97,255)}),G=new z({color:A(178,99,99,255)}),U=new z({color:A(138,195,142,255)}),H=new z({color:A(178,99,99,255)}),W=new z({color:A(138,195,142,180)}),Y=new z({color:A(178,99,99,180)}),q=new z({color:A(224,240,237)}),X=new z({color:A(251,227,227)}),j=[A(178,99,99,255),A(215,224,111,255),A(80,186,88,255)],K=[A(62,64,142,255),A(66,131,77,255),A(250,250,135,255),A(202,161,78,255),A(179,53,53,255)],J=[A(64,86,138),A(123,192,205),A(255,252,149),A(220,155,92),A(184,78,74)],Q=[A(64,86,138),A(123,192,205),A(255,252,149),A(220,155,92),A(132,60,57)],et=new z({color:A(185,198,207,255)}),it=new $({stops:[{color:A(151,190,220,10),offset:0},{color:A(151,190,220,50),offset:1}]}),st=W.getColor().setA(255),rt=A(150,150,150);return zp({isDark:t,highlightColorOffset:A(-60,-60,-60,60),highlightColorOffsetAxisOverlay:A(0,0,0,40),effect:void 0,effectsText:!1,effectsDashboardSplitters:!1,lcjsBackgroundFillStyle:i,dashboardSplitterFillStyle:s,panelBackgroundFillStyle:r,seriesBackgroundFillStyle:n,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:o,axisTitleFillStyle:h,axisLabelMajorFillStyle:a,axisLabelMinorFillStyle:l,uiTitleFillStyle:u,uiTextFillStyle:c,cursorTextFillStyle:d,axisLineFillStyle:f,axisTickMajorFillStyle:g,axisGridMajorFillStyle:m,axisTickMinorFillStyle:p,axisGridMinorFillStyle:y,cursorGridFillStyle:x,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:w,uiBackgroundColor:D,uiBackgroundBorderColor:T,uiStrokeColorContrastHigh:E,uiStrokeColorContrastMedium:B,uiStrokeColorContrastLow:k,dataStrokeColorContrastHigh:I,dataStrokeColorContrastMedium:C,dataStrokeColorContrastLow:P,dataColorPalette:L,dataColorPaletteInverted:[{area:A(210,70,70,100),border:A(200,110,110)}],dataHighlightOverlayColor:R,dataColorPositive:F,dataColorNegative:_,overrideThemeProperties:V},{positiveTextFillStyle:N,negativeTextFillStyle:G,positiveFillStyle:U,negativeFillStyle:H,positiveAreaFillStyle:W,negativeAreaFillStyle:Y,positiveBackgroundFillStyle:q,negativeBackgroundFillStyle:X,badGoodColorPalette:j,coldHotColorPalette:K,intensityColorPalette:J,spectrogramColorPalette:Q,bollingerFillStyle:it,bollingerBorderFillStyle:et,highlightPointColor:A(0,0,0),highlightDataGridColor:st,unfocusedDataColor:rt})})),jp=xe((()=>{const t=A(255,255,255),i=new z({color:t}),s=!0,r=new qm({spread:1,blur:9,offset:{x:0,y:0},color:A(255,255,255,30)}),n=new z({color:A(6,15,36)}),o=new $({stops:[{color:A(46,13,87,50),offset:0},{color:A(0,0,0,150),offset:1}]}),h=new z({color:A(0,5,8,150)}),a=i,l=i,u=i,c=new z({color:A(255,255,220,130)}),d=i,f=i,g=f,m=new Z({angle:45,stops:[{offset:0,color:A(241,133,255,255)},{offset:1,color:A(115,207,238,255)}]}),p=i,y=new z({color:A(61,94,110,100)}),x=new z({color:A(61,94,110,255)}),S=new z({color:A(61,94,110,40)}),v=i,b=new z({color:A(0,18,23,255)}),M=i,w=A(115,207,238,255),D=new z({color:A(0,17,22,240)}),T=i,E=A(0,38,48,255),B=A(0,0,0),k=t,I=A(150,150,150),C=A(19,57,93),P=A(50,50,50),L=A(0,17,48),R=A(200,200,200),F=[A(20,211,237,255),A(98,147,252,255),A(164,73,250,255),A(129,117,253,255),A(95,134,252,255),A(22,133,212,255),A(35,200,242,255),A(104,121,233,255),A(137,69,232,255),A(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),_=t.setA(50),O=A(3,217,194,255),V=A(243,21,110,255),N={mapChartFillStyle:new Z({angle:135,stops:[{color:A(118,248,231,255),offset:0},{color:A(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Np(s,F,.5),pieChartSliceFillStylePalette:Gp(s,F,2),funnelChartSliceFillStylePalette:Up(s,F,1),pyramidChartSliceFillStylePalette:Up(s,F,1),rectangleSeriesFillStyle:Hp(s,F),gaugeChartGaugeFillStyle:Wp(s,F,1)},G=new z({color:A(20,211,237,255)}),U=new z({color:A(253,145,178,255)}),H=new z({color:A(20,211,237,255)}),W=new z({color:A(239,68,121,255)}),Y=new z({color:A(20,211,237,120)}),q=new z({color:A(239,68,121,180)}),X=new z({color:A(1,53,57,255)}),j=new z({color:A(94,19,42,255)}),K=[A(174,51,132,255),A(204,107,218,255),A(189,215,253,255)],J=[A(0,63,95,255),A(0,149,255,255),A(0,225,255,255),A(255,154,254,255),A(204,98,170,255),A(139,39,84,255)],Q=[A(197,241,255,255),A(70,210,255,255),A(0,164,217,255),A(90,99,222,255),A(138,75,192,255),A(151,27,162,255)],tt=[A(13,31,52,255),A(129,54,130,255),A(131,108,176,255),A(7,162,213,255),A(26,247,255,255)],et=new $({stops:[{color:A(219,42,235,60),offset:0},{color:A(237,73,252,10),offset:1}]}),it=new z({color:A(237,73,252,255)}),st=Y.getColor().setA(255),rt=A(8,70,100);return zp({isDark:s,highlightColorOffset:A(60,60,60,60),highlightColorOffsetAxisOverlay:A(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new sd({source:Vp(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:m,axisTickMajorFillStyle:p,axisGridMajorFillStyle:y,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:w,resultTableBackgroundFillStyle:D,resultTableBackgroundBorderFillStyle:T,uiBackgroundColor:E,uiBackgroundBorderColor:B,uiStrokeColorContrastHigh:k,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:C,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:R,dataColorPalette:F,dataColorPaletteInverted:[{area:A(41,130,255,100),border:A(45,110,240)}],dataHighlightOverlayColor:_,dataColorPositive:O,dataColorNegative:V,overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:U,positiveFillStyle:H,negativeFillStyle:W,positiveAreaFillStyle:Y,negativeAreaFillStyle:q,positiveBackgroundFillStyle:X,negativeBackgroundFillStyle:j,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:rt})})),Zp={};Object.defineProperty(Zp,"darkGold",{get:Yp,enumerable:!0}),Object.defineProperty(Zp,"turquoiseHexagon",{get:qp,enumerable:!0}),Object.defineProperty(Zp,"light",{get:Xp,enumerable:!0}),Object.defineProperty(Zp,"lightNature",{get:$p,enumerable:!0}),Object.defineProperty(Zp,"cyberSpace",{get:jp,enumerable:!0});const Kp=Zp,Jp=Kp.darkGold,Qp=(t,e,i)=>s=>{const r={theme:Jp,...i,...s},n=t(r),o=e?Hm(n):void 0,h=new fd(n.Mh,s,n,n.G.bind(n),o);return n.jh((()=>h.tD())).Xh((()=>h.X())).Bi(),h},ty=(t,e)=>{t.jh((()=>{e.ru()})).Xh((()=>e.X())).Bi()},ey=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new fo(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o);return ty(n,h),h},iy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new Mc(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,s);return ty(n,h),h},sy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new Rl(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,s);return ty(n,h),h},ry=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new Ua(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,s);return ty(n,h),h},ny=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new(s&&s.type?s.type:zo)(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,void 0,s&&s.disableAnimations);return ty(n,h),h},oy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new(s&&s.type?s.type:ll)(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,void 0,s&&s.disableAnimations);return ty(n,h),h},hy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new(s&&s.type?s.type:Ja)(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,void 0,s&&s.disableAnimations);return ty(n,h),h},ay=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new(s&&s.type?s.type:yl)(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,void 0,!(!s||!s.disableAnimations));return ty(n,h),h},ly=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new Xh(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,s,void 0);return ty(n,h),h},uy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new mh(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,void 0,s);return ty(n,h),h},cy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new rd(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,void 0);return ty(n,h),h};let dy;const fy={None:ln,Rectangle:pn,Circle:yn,Diamond:xn,Pointer:Sn},gy={Rectangle:pn,Circle:yn,Diamond:xn},my={XY:wa},py={XY:Aa,Spider:Rh,Map:_h,Polar:Rh},yy={None:un,UIRectangle:pn,UICircle:yn,UIDiamond:xn};e.Animation=H,e.AnimationEasings=U,e.Animator=W,e.AreaRangeSeries=tc,e.AreaSeries=Xu,e.AreaSeriesBipolar=Ku,e.AreaSeriesMonopolar=$u,e.AreaSeriesNegative=Zu,e.AreaSeriesPositive=ju,e.AreaSeriesTypes=Ju,e.AutoCursor2DBuilder=Ih,e.AutoCursorBuilders=py,e.AutoCursorXYBuilder=ba,e.AutoFitStrategies=Mh,e.AutoFitStrategy=Sh,e.Axis=no,e.Axis3D=Yo,e.AxisScrollStrategies=Bi,e.AxisTickStrategies=ki,e.Band=Jr,e.BasicSeries=_a,e.BorderedPicture=dn,e.BoxAndWhiskers=ql,e.BoxFigure=Yl,e.BoxSeries=Wu,e.BoxSeries3D=th,e.Button=_n,e.Chart=mo,e.Chart3D=mh,e.ChartComponent=Zr,e.ChartMarker=Ea,e.ChartMarker2D=class extends Ea{constructor(t,e,i,s,r,n){super(t,e,i,s.VS(t,e,i,n),r,n)}},e.ChartMarkerXY=ka,e.ChartWithCursor=qh,e.ChartWithSeries=ah,e.ChartXY=Mc,e.Color=M,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return A(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 A(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 A(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?w(t):w((t=>{const e=T[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=D,e.ColorPalettes=Lp,e.ColorRGBA=A,e.ColorShadingStyles=Jo,e.ConstantLine=Qr,e.CursorBuilder=kh,e.CursorBuilderXY=va,e.CustomTick=Xr,e.CustomizableFigure=Hl,e.Dashboard=fd,e.DataGrid=rd,e.DateTimeTickStrategy=lp,e.EllipseFigure=wu,e.EllipseSeries=Du,e.EmptyFill=R,e.EmptyPointMarker=un,e.EmptyUIElement=an,e.Figure=Gl,e.FigureSeries=Ul,e.FontSettings=Yi,e.FormattingFunctions=bi,e.FunnelChart=ja,e.FunnelChartTypes=tl,e.FunnelChartWithLabelsInsideSlices=Qa,e.FunnelChartWithLabelsOnSides=Ja,e.FunnelSlice=Wa,e.GaugeChart=sl,e.GaugeChartTypes=Pp,e.GaugeSlice=nl,e.GenericAxis=Ni,e.GlowEffect=qm,e.HeatmapGridSeries=rc,e.HeatmapGridSeriesIntensityValues=nc,e.HeatmapScrollingGridSeries=oc,e.HeatmapScrollingGridSeriesIntensityValues=hc,e.Highlighter=Kr,e.Icon=td,e.ImageFill=sd,e.IndividualPointFill=V,e.LUT=P,e.LegendBoxBuilders=eo,e.LineAndPointSeries3D=eh,e.LineSeries=yu,e.LineSeries3D=ih,e.LinearGradientFill=Z,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new Z({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=Xh,e.MapRegions=Cp,e.MapRegionsAfrica=Mp,e.MapRegionsAsia=Ap,e.MapRegionsAustralia=wp,e.MapRegionsCanada=Dp,e.MapRegionsEurope=Tp,e.MapRegionsNorthAmerica=kp,e.MapRegionsSouthAmerica=Ip,e.MapRegionsUSA=Bp,e.MapRegionsWorld=Ep,e.MapTypes=zh,e.MarkerBuilders=my,e.NumericTickStrategy=pp,e.OHLCBar=jl,e.OHLCCandleStick=$l,e.OHLCFigure=Xl,e.OHLCFigures=Zl,e.OHLCSeries=Vu,e.OHLCSeriesTraditional=Nu,e.OHLCSeriesTypes=Uu,e.OHLCSeriesWithAutomaticPacking=Gu,e.OnScreenMenu=ic,e.OnScreenMenuAnimationsButton=Sr,e.OnScreenMenuButton=cr,e.OnScreenMenuControlBase=Ks,e.OnScreenMenuCustomButton=br,e.OnScreenMenuOsmToggleButton=Mr,e.OnScreenMenuToggleButton=dr,e.OnScreenMenuZoomInButton=fr,e.OnScreenMenuZoomInXButton=gr,e.OnScreenMenuZoomInYButton=mr,e.OnScreenMenuZoomOutButton=pr,e.OnScreenMenuZoomOutXButton=yr,e.OnScreenMenuZoomOutYButton=xr,e.OnScreenMenuZoomToFitButton=vr,e.PalettedFill=G,e.Panel=uo,e.PhongShadingStyle=Zo,e.Picture=cn,e.PieChart=Eo,e.PieChartTypes=No,e.PieChartWithLabelsInsideSlices=Vo,e.PieChartWithLabelsOnSides=zo,e.PieSlice=Mo,e.PixelatedPoints3D=Ki,e.PointCloudSeries3D=oh,e.PointLineSeries=eu,e.PointLineSeries3D=sh,e.PointMarkers=yy,e.PointSeries=ec,e.PointSeries3D=nh,e.PointSeriesTypes3D=hh,e.PointStyle3D=Ji,e.PolarAreaSeries=Va,e.PolarAreaSeriesInterior=Na,e.PolarAxis=Zh,e.PolarAxisAmplitude=Jh,e.PolarAxisTick=Kh,e.PolarChart=Ua,e.PolarLineSeries=fa,e.PolarPointLineSeries=ga,e.PolarPointSeries=ma,e.PolarPolygon=pa,e.PolarPolygonSeries=za,e.PolarSector=sa,e.PolarSeries=na,e.PolygonFigure=vu,e.PolygonSeries=bu,e.PyramidChart=gl,e.PyramidChartTypes=Sl,e.PyramidChartWithLabelsInsideSlices=xl,e.PyramidChartWithLabelsOnSides=yl,e.PyramidSlice=ul,e.RadialGauge=rl,e.RadialGradientFill=$,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new $({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=Yu,e.RectangleFigure=xu,e.RectangleSeries=Su,e.SegmentFigure=Mu,e.SegmentSeries=Au,e.Series2D=ra,e.Series3D=Qo,e.SeriesMarkerXY=Ia,e.SeriesXY=Ca,e.SimpleFigureSeries=Wl,e.SimpleShadingStyle=$o,e.Slice=vo,e.SliceLabelFormatters=So,e.SliceSorters=xo,e.SolidFill=z,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new z({color:s(t)})},e.SolidGauge=ll,e.SolidGaugeSlice=ol,e.SolidLine=tt,e.SpiderAxis=wl,e.SpiderChart=Rl,e.SpiderSeries=Tl,e.SplineSeries=ru,e.StaticCursor2DBuilder=Ch,e.StaticCursorXYBuilder=Ma,e.StepSeries=pu,e.SurfaceGridSeries3D=fh,e.SurfaceScrollingGridSeries3D=gh,e.TableContentBuilder=Ah,e.Themes=Kp,e.Tick=io,e.TickStyle=$m,e.TimeFormattingFunctions=Sp,e.TimeTickStrategy=bp,e.TriangulatedPoints3D=ji,e.UIBackgrounds=fy,e.UIButtonPictures=gy,e.UICircle=yn,e.UIColumnGrid=class extends Mn{constructor(){super(...arguments),this.Oc=[]}addColumn(){return this.addElement(En,void 0)}getColumn(t,e=!1){return e&&this.Oc.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.Oc[t]}},e.UIDiamond=xn,e.UIElementBuilders=to,e.UIElementColumn=An,e.UIElementLine=bn,e.UIElementRow=Mn,e.UIElementWithBackground=Yr,e.UIEmptyBackground=ln,e.UILabel=gn,e.UILayoutBuilders=ph,e.UILayoutGap=vn,e.UILegendBoxPanel=yh,e.UIObject=Nr,e.UIOrigins=wr,e.UIPanel=fo,e.UIPointer=Sn,e.UIPolygon=fn,e.UIRectangle=pn,e.UIRowGrid=Dn,e.VisibleFill=O,e.VisibleTicks=jm,e.ZoomBandChart=Ec,e.defaultOsmBackgroundColor=Pr,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=F,e.emptyLine=J,e.emptyPoints3D=Xi,e.emptyTick=Zm,e.formatLongitudeLatitude=jh,e.isSolidLine=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType),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||"",dy||(dy=(t=>{let e,i,s=!1,r=!1,n=!1,o=!1,h="";try{if(Dm){const e=(t=>{if(!Dm)return;const e=Dm.split("-");if(e.length>0)switch(e[0]){case"0001":return"0001";case"0002":return"0002";default:return}})();if("0001"===e){Bm=new Uint8Array([2]);const e=(t=>{if(!Dm)return;const e=Dm.split("-");return 4===e.length?e[1].startsWith("m")?2:1:0})();1===e?(n=!zm(Dm),s=!0):2===e?(Vm(Dm,t),r=!0):(Im=!0,Fm(Dm),o=!0)}else{if("0002"!==e)throw new Error(wm(0,0,1,7,1,12,5));{const e=(t=>{if(!Dm)return;const e=Dm.split("-");return e.length>=2?Uint8Array.from(atob(e[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)Im=!0,Fm(Dm),o=!0;else if(189===e)n=!zm(Dm),s=!0;else{if(159!==e)throw new Error(wm(0,0,1,7,1,12,5));Vm(Dm,t),r=!0}}}}else Em=!0}catch(t){t instanceof Error&&(e=t)}try{o&&(i=Am[wm(-1,34)][wm(-1,35)](wm(-1,39))||void 0)}catch(t){Am.console.error(t)}let a=!1;if(i){const t=i.split("-");if(2===t.length&&Om(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||Em||s||r||a),u=(()=>{const t=new(Am[wm(-1,0)]);return t.open(wm(0,26),wm(-2,0)),t.setRequestHeader(wm(-1,24),wm(-1,25)),t.withCredentials=!0,t})();if(l){let t;try{t=parseInt(Dm?Dm.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="";Dm=Dm||"";const a=wm(-4,0);for(let t=0;t{if(e)throw Nm(e.message,t),e;const s={bh:t=>{const e=`${wm(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${(t=>{switch(t){case 1:return wm(0,48,49);case 0:return wm(0,48,50);case 2:return wm(0,51);case 3:return wm(0,52,48);case 4:return wm(0,53,48);case 5:return wm(0,54,48);case 6:return wm(0,55,48);case 7:return wm(0,56,48);case 8:return wm(0,57,48);case 9:return wm(0,58,48)}return pe(0,"")})(t)}`;throw Nm(e,r,!1),new Error(e)},...Tm},r=new Hg(t,s),o=t=>{if("error"===(null==t?void 0:t.type)&&i){const t=i.split("-");if(2===t.length&&Om(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return Im=!1,void Gm(u,!1,a)}}if(u.readyState===Am[wm(-1,0)].DONE){if(200!==u.status){let e="";try{e=t&&"loadend"!==t.type?wm(0,0,1,23,1,32,1,24,5):JSON.parse(u[wm(-1,23)]).message,Gm(u,!1,a)}catch(t){console.error(t)}throw Nm(e,r),new Error(wm(0,0,1,2,1,7,1,12,5)+e)}{const t=JSON.parse(u[wm(-1,23)]);if(!Om(h+wm(-3,0),t.h)){const t=wm(0,0,1,27,1,28,1,29,1,30,1,31,5);throw Nm(t,r),new Error(t)}Am[wm(-1,34)][wm(-1,36)](wm(-1,39),t.t),Am[wm(-1,34)][wm(-1,36)](wm(-1,33),t.s),Im=!1}}},a=t=>{o(t)};return Gm(u,!0,a),l?setTimeout((()=>{if(Im){let t=!0;if(i){const e=i.split("-");if(2===e.length&&Om(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&Nm(wm(0,25,1,23,1,32,1,24,5),r)}}),1e4):Gm(u,!1,a),n?(t=>{let e;Im=!1;const i=t.Et(),s=()=>{e&&(t.Qe(e.Je()),e=void 0),e=t.vT("deployment test"),e.ue(t.ct).fs(wm(0,34,1,33)).Sn({x:i.x/2,y:i.y/2}).un(50).xs(13).ps(new z({color:A(128,128,128,100)})).an("Arial").dn(500).setMouseInteractions(!1),t.Ze().Ke()};t.cr((()=>{s()})),setTimeout(s,0),setInterval((()=>{e&&e.Je()({Dashboard:Qp(t,e,i),ChartXY:iy(t,e,i),Spider:sy(t,e,i),Polar:ry(t,e,i),Pie:ny(t,e,i),UIPanel:ey(t,e,i),Gauge:oy(t,e,i),Funnel:hy(t,e,i),Pyramid:ay(t,e,i),Chart3D:uy(t,e,i),Map:ly(t,e,i),DataGrid:cy(t,e,i)}))(dy,n.e,r)},e.onScreenMenuControlBaseHeight=Er,e.onScreenMenuControlBaseWidth=Br,e.onScreenMenuControlOpacity=kr,e.onScreenMenuDefaultButtonShape=Cr,e.onScreenMenuSpriteURL=Ir,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=ho,e.synchronizeAxisIntervals=ot,e.translatePoint=nt,e.translatePoint3D=(t,e,i)=>{if("axes"===e.id&&"world"===i.id)return e.chart.Jp.OV(t);if("world"===e.id&&"axes"===i.id)return e.chart.Jp.RV(t);if(e.id===i.id)return t;throw new Error("LC JS translatePoint3D misusage | originCoordinateSystem and targetCoordinateSystem arguments must be either Chart3D.world or Chart3D.axes")},e.transparentFill=Dr,e.transparentLine=Tr,e.vec3Utils=be,e.xDimensionStrategy=Fl,e.yDimensionStrategy=_l}}]); \ No newline at end of file diff --git a/js/vendor.63fa56fa32f71392ee3e.bundle.js.LICENSE.txt b/js/vendor.ba735447f654cc2bc66a.bundle.js.LICENSE.txt similarity index 100% rename from js/vendor.63fa56fa32f71392ee3e.bundle.js.LICENSE.txt rename to js/vendor.ba735447f654cc2bc66a.bundle.js.LICENSE.txt diff --git a/resources/themes/LICENSE b/resources/themes/LICENSE new file mode 100644 index 0000000..665b9c2 --- /dev/null +++ b/resources/themes/LICENSE @@ -0,0 +1,19 @@ +LightningChart®JS THEME ASSETS END USER LICENSE AGREEMENT + +By downloading, installing, copying or otherwise using LightningChart®JS, you are agreeing to be bound to the terms of this agreement. + +This license refers to the end user rights regarding all non-software assets distributed along side the LightningChart®JS library. + +Licensee may not: + +In no way use the assets outside of LightningChart®JS. +Redistribute, share, or sell the assets to anyone, neither for commercial or noncommercial purposes. +Expose or move the assets to a location where the licensee does not manage or can not affirm that these terms of use are not followed. +Edit, alter or in any way modify the assets for any purpose. +Separate the assets from this LICENSE file. + +The licensee may: + +Include the assets in their licensed LightningChart®JS application deployments along with this LICENSE file at the same root directory. +Privately host the assets as part of their licensed LightningChart®JS application deployment, in a way that only allows the application itself to access the assets. +Include the assets in their licensed LightningChart®JS product that is sold to a 3rd party, as long as this LICENSE is included in the same root directory. diff --git a/resources/themes/cyberSpace.jpg b/resources/themes/cyberSpace.jpg new file mode 100644 index 0000000..2b81b78 Binary files /dev/null and b/resources/themes/cyberSpace.jpg differ diff --git a/resources/themes/turquoiseHexagon.jpg b/resources/themes/turquoiseHexagon.jpg new file mode 100644 index 0000000..88dab58 Binary files /dev/null and b/resources/themes/turquoiseHexagon.jpg differ