@nebula.js/sn-gauge 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ /*
2
+ * @nebula.js/sn-gauge v0.7.0
3
+ * Copyright (c) 2025 QlikTech International AB
4
+ * Released under the MIT license.
5
+ */
6
+
7
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["sn-gauge"]=e(t.stardust)}(this,(function(t){"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function n(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function r(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function l(t,n){if(t){if("string"==typeof t)return e(t,n);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?e(t,n):void 0}}var c=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],u=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var h=function(t){return{value:t,label:t.charAt(0).toUpperCase()+t.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:t}}};function d(t){var e=t.theme,n=t.translator,i=t.defaultValue,r=t.flags,o=[],s=e.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,a(new Set([i].concat(a(s.map((function(t){return t.split(",").map((function(t){return t.trim()})).map((function(t){return t.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(i),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(a(o.map((function(t){return h(t)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],a(function(t){return null!=t&&t.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?u:c}(r).map((function(t){return h(t)}))))}function f(t){var e=t.theme,n=t.translator,i=t.id,r=t.path,o=t.flags,a=function(){return e.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return d({theme:e,translator:n,defaultValue:a(),flags:o})}}}var p,g,m=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],y=function(t){return{value:t,label:t,groupHeader:!1,disabled:!1}};function x(t){var e=t.theme,n=t.translator,i=t.id,r=t.path,o=function(){return e.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(t){var e=t.translator,n=t.defaultValue,i=[],r=t.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,a(new Set([n].concat(a(r))))):i.push(n),[{value:"ThemeHeader",label:e.get("properties.themeFontSizes"),metaText:e.get("properties.theme"),groupHeader:!0}].concat(a(i.map((function(t){return y(t)}))),[{value:"DefaultHeader",label:e.get("properties.allFontSizes"),metaText:e.get("properties.default"),groupHeader:!0}],a(m.map((function(t){return y(t)}))))}({theme:e,translator:n,defaultValue:o()})}}}function v(t){var e=t.theme,n=t.translator,i=t.id,r=t.path;return{fontFamily:f({theme:e,translator:n,id:i,path:r,flags:t.flags}),fontSize:x({theme:e,translator:n,id:i,path:r})}}var b,w=function(){if(g)return p;g=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===e.call(t)},o=function(n){if(!n||"[object Object]"!==e.call(n))return!1;var i,r=t.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&t.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||t.call(n,i)},a=function(t,e){n&&"__proto__"===e.name?n(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};return p=function t(){var e,n,i,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(e=arguments[d]))for(n in e)i=s(h,n),h!==(l=s(e,n))&&(p&&l&&(o(l)||(c=r(l)))?(c?(c=!1,u=i&&r(i)?i:[]):u=i&&o(i)?i:{},a(h,{name:n,newValue:t(p,u,l)})):void 0!==l&&a(h,{name:n,newValue:l}));return h},p}(),M=(b=w)&&b.__esModule&&Object.prototype.hasOwnProperty.call(b,"default")?b.default:b;function k(t,e){return{range:function(t){var n=t.resources,i=t.data,r=n.theme.palette("categorical",0===e?i.items.length:e);return i.items.map((function(t){return r[t.value%r.length]}))},valueAccessor:t.value}}function _(t,e){return{range:function(t){var n=t.resources,i=t.data,r=n.theme.palette("categorical",0===e?i.items.length:e);return i.items.map((function(t){return r[t.row.value%r.length]}))},valueAccessor:t.value}}function S(t,e,n,i,r){var o,a,s=r.byRow,l=r.byElemNo;if(i&&(e.input.persistent||t.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&t.hc.qSize.qcy>((null===(a=(o=t.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(i,i.raw().qCardinal);if(i){var c=e.pic.extract({field:i.key(),trackBy:i.value}).length;return s(i,c)}return{}}function N(t,e){var n=t.hc.qDimensionInfo,i=e.input.byDimDef||{activeDimensionIndex:n.length-1};if(i.activeDimensionIndex>=0){var r=n[i.activeDimensionIndex];i=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:i.activeDimensionIndex}:{activeDimensionIndex:i.activeDimensionIndex}}return i}function R(t,e){var n;return e.activeDimensionIndex>=0?n=t.pic.fields().filter((function(t){return"dimension"===t.type()}))[e.activeDimensionIndex]:"libraryItem"===e.type?!1===(n=e.key?t.pic.field((function(t){return t.raw().colorMapRef===e.key})):void 0)&&(n=t.pic.field((function(t){return"colorByAlternative"===t.raw().id}))):"expression"===e.type&&(n=t.pic.field((function(t){return"colorByAlternative"===t.raw().id}))),n}function A(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function C(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function D(){}var O=1/.7,E="\\s*([+-]?\\d+)\\s*",z="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",I="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",T=/^#([0-9a-f]{3,8})$/,P=new RegExp(`^rgb\\(${E},${E},${E}\\)$`),q=new RegExp(`^rgb\\(${I},${I},${I}\\)$`),L=new RegExp(`^rgba\\(${E},${E},${E},${z}\\)$`),j=new RegExp(`^rgba\\(${I},${I},${I},${z}\\)$`),F=new RegExp(`^hsl\\(${z},${I},${I}\\)$`),B=new RegExp(`^hsla\\(${z},${I},${I},${z}\\)$`),V={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function $(){return this.rgb().formatHex()}function H(){return this.rgb().formatRgb()}function W(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=T.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?U(e):3===n?new K(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Y(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Y(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=P.exec(t))?new K(e[1],e[2],e[3],1):(e=q.exec(t))?new K(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=L.exec(t))?Y(e[1],e[2],e[3],e[4]):(e=j.exec(t))?Y(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=F.exec(t))?nt(e[1],e[2]/100,e[3]/100,1):(e=B.exec(t))?nt(e[1],e[2]/100,e[3]/100,e[4]):V.hasOwnProperty(t)?U(V[t]):"transparent"===t?new K(NaN,NaN,NaN,0):null}function U(t){return new K(t>>16&255,t>>8&255,255&t,1)}function Y(t,e,n,i){return i<=0&&(t=e=n=NaN),new K(t,e,n,i)}function X(t){return t instanceof D||(t=W(t)),t?new K((t=t.rgb()).r,t.g,t.b,t.opacity):new K}function G(t,e,n,i){return 1===arguments.length?X(t):new K(t,e,n,null==i?1:i)}function K(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Z(){return`#${et(this.r)}${et(this.g)}${et(this.b)}`}function J(){const t=Q(this.opacity);return`${1===t?"rgb(":"rgba("}${tt(this.r)}, ${tt(this.g)}, ${tt(this.b)}${1===t?")":`, ${t})`}`}function Q(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function tt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function et(t){return((t=tt(t))<16?"0":"")+t.toString(16)}function nt(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new rt(t,e,n,i)}function it(t){if(t instanceof rt)return new rt(t.h,t.s,t.l,t.opacity);if(t instanceof D||(t=W(t)),!t)return new rt;if(t instanceof rt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n<i):n===o?(i-e)/s+2:(e-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new rt(a,s,l,t.opacity)}function rt(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function ot(t){return(t=(t||0)%360)<0?t+360:t}function at(t){return Math.max(0,Math.min(1,t||0))}function st(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}A(D,W,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:$,formatHex:$,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return it(this).formatHsl()},formatRgb:H,toString:H}),A(K,G,C(D,{brighter(t){return t=null==t?O:Math.pow(O,t),new K(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new K(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new K(tt(this.r),tt(this.g),tt(this.b),Q(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Z,formatHex:Z,formatHex8:function(){return`#${et(this.r)}${et(this.g)}${et(this.b)}${et(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:J,toString:J})),A(rt,(function(t,e,n,i){return 1===arguments.length?it(t):new rt(t,e,n,null==i?1:i)}),C(D,{brighter(t){return t=null==t?O:Math.pow(O,t),new rt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new rt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new K(st(t>=240?t-240:t+120,r,i),st(t,r,i),st(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new rt(ot(this.h),at(this.s),at(this.l),Q(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Q(this.opacity);return`${1===t?"hsl(":"hsla("}${ot(this.h)}, ${100*at(this.s)}%, ${100*at(this.l)}%${1===t?")":`, ${t})`}`}}));const lt=Math.PI/180,ct=180/Math.PI,ut=4/29,ht=6/29,dt=3*ht*ht;function ft(t){if(t instanceof pt)return new pt(t.l,t.a,t.b,t.opacity);if(t instanceof vt)return bt(t);t instanceof K||(t=X(t));var e,n,i=xt(t.r),r=xt(t.g),o=xt(t.b),a=gt((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?e=n=a:(e=gt((.4360747*i+.3850649*r+.1430804*o)/.96422),n=gt((.0139322*i+.0971045*r+.7141733*o)/.82521)),new pt(116*a-16,500*(e-a),200*(a-n),t.opacity)}function pt(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function gt(t){return t>.008856451679035631?Math.pow(t,1/3):t/dt+ut}function mt(t){return t>ht?t*t*t:dt*(t-ut)}function yt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function xt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function vt(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function bt(t){if(isNaN(t.h))return new pt(t.l,0,0,t.opacity);var e=t.h*lt;return new pt(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}A(pt,(function(t,e,n,i){return 1===arguments.length?ft(t):new pt(t,e,n,null==i?1:i)}),C(D,{brighter(t){return new pt(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new pt(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new K(yt(3.1338561*(e=.96422*mt(e))-1.6168667*(t=1*mt(t))-.4906146*(n=.82521*mt(n))),yt(-.9787684*e+1.9161415*t+.033454*n),yt(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),A(vt,(function(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof vt)return new vt(t.h,t.c,t.l,t.opacity);if(t instanceof pt||(t=ft(t)),0===t.a&&0===t.b)return new vt(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*ct;return new vt(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new vt(t,e,n,null==i?1:i)}),C(D,{brighter(t){return new vt(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new vt(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return bt(this).rgb()}}));var wt=t=>()=>t;function Mt(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):wt(isNaN(t)?e:t)}var kt=function t(e){var n=function(t){return 1==(t=+t)?Mt:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):wt(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=G(t)).r,(e=G(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=Mt(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1),_t=/^class(-pyramid)?/,St=function(t,e,n,i){var r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max(),s=r,l=o,c=e.limits,u={},h="percent"===e.limitType?c.map((function(t){return r+(o-r)*t})):c,d=e.colors.map((function(e){return t.resolveUIColor(e)}));if(r=Math.min.apply(Math,[r].concat(a(h))),o=Math.max.apply(Math,[o].concat(a(h))),u.min=r,u.max=o,e.breakTypes&&-1===e.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(t){var e=t.min,n=t.max,i=t.limits,r=t.range,o=[],a=[];if(i.length)if(i[i.length-1]<e)a.push(e,n),o.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(i[0]>n)a.push(e,n),o.push(r[0],r[0],r[0]);else{if(i[0]>e)a.push(e),o.push(r[0]);else{a.push(e);for(var s=0;s<i.length;s++)if(e<i[s]){o.push(r[s]);break}}for(var l=0;l<i.length;l++)e<i[l]&&i[l]<n&&(a.push(i[l]),o.push(r[l]));if(i[i.length-1]<n)a.push(n),o.push(r[i.length]),o.push(r[i.length]);else{a.push(n);for(var c=0;c<i.length;c++)if(i[c]>n){o.push(r[c]),o.push(r[c]);break}}}else o.push(r[0]);return{min:e,max:n,range:o,domain:a}}({min:"percent"===e.limitType?r:s,max:"percent"===e.limitType?o:l,range:d,limits:"percent"===e.limitType?h:c}));else if(e.breakTypes){var f=e.breakTypes;u.type="continuous",u.domain=[r],u.range=[d[0]];for(var p=0;p<h.length;p+=1)if(f[p]){var g=d[p],m=d[p+1],y=kt(g,m)(.5);u.range.push(y),u.domain.push(h[p]),p<h.length-1&&f[p+1]&&(u.range.push(d[p+1]),u.domain.push((h[p]+h[p+1])/2))}else u.range.push(d[p]),u.range.push(d[p+1]),u.domain.push(h[p]),u.domain.push(h[p]+Math.min(1e-6,(o-r)/1e6));u.range.push(d[d.length-1]),u.domain.push(o)}else u.domain=h,u.range=d;return u};function Nt(t,e,n,i,r){var o,a,s,l=0,c=[],u=(t-e)/(i+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-e),s=n[o]>t?Math.floor(t/u):n[o]<e?0:Math.floor(a/u),Number.isNaN(s)||(c[s]?c[s]+=1:c[s]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=i||l>=r?Math.max(l,i):Nt(t,e,n,i+1,r)}var Rt=function(t,e,n,i){var r,o,s=e.theme,l=e.hc,c=i.f,u={mode:"field",fieldType:"measure",field:c?c.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(t){return t.resources.theme.palette("quant")}},h=[],d=!0;if(c){if(Number.isNaN(+c.min())||Number.isNaN(+c.max()))return{invalid:!0};(d=!("S"===(r=n.pic.raw()).qMode&&(r.qDataPages[0]&&r.qSize.qcy>r.qDataPages[0].qArea.qHeight||!r.qDataPages.length&&r.qSize.qcy>0)||"K"===r.qMode&&r.qStackedDataPages[0]&&r.qSize.qcy>r.qStackedDataPages[0].qArea.qHeight||"T"===r.qMode&&r.qSize.qcy>r.qTreeDataPages[0].qGroupSize))&&(h=n.pic.extract({field:0,props:{num:{field:c.key()},exclude:{fields:l.qDimensionInfo.map((function(t,e){return{field:"qDimensionInfo/".concat(e)}})),value:function(t){return Math.min.apply(Math,a(t))<0}}}}).filter((function(t){return t.value>=0&&!t.exclude.value})).map((function(t){return t.num.value})).filter((function(t){return"number"==typeof t})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(c&&!d)u.min=c.min(),u.max=c.max();else if(c){if(!h.length)return{invalid:!0};u.min=Math.min.apply(Math,a(h)),u.max=Math.max.apply(Math,a(h))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),s){var f=s.getDataColorScales().filter((function(t){return t.key===n.input.measureScheme}))[0];u.type=f&&_t.test(f.type)?"categorical":"continuous","categorical"===u.type&&(o=f.colors.some((function(t){return Array.isArray(t)}))?Math.max.apply(Math,a(f.colors.map((function(t){return t?t.length:0})))):f.colors.length)}if("categorical"===u.type){for(var p=d?Nt(u.max,u.min,h,1,o):o,g=(u.max-u.min)/p,m=[],y=0;y<p+1;y+=1)m.push(u.min+g*y);u.domain=m,u.range=function(t){for(var e=t.resources.theme.palette("quant",p),n=Math.max(1,Math.floor(e.length/p)),i=[],r=0;r<p;r+=1)i.push(e[r*n]);return[i[0]].concat(i,[i[i.length-1]])}}return u};function At(t,e){var n;return e.activeMeasureIndex>=0?n=t.pic.fields().filter((function(t){return"measure"===t.type()}))[e.activeMeasureIndex]:"libraryItem"===e.type?n=t.pic.field((function(t){return t.raw().colorMapRef===e.key&&void 0!==e.key})):"expression"===e.type&&(n=t.pic.field((function(t){return"colorByAlternative"===t.raw().id}))),n||(n=t.pic.field((function(t){return void 0!==t.raw().matchMeasure})))&&(n=t.pic.fields().filter((function(t){return"measure"===t.type()}))[n.raw().matchMeasure]),n}function Ct(t){t.measureOverrides.every((function(t){return!t}))&&(t.measureOverrides=null)}function Dt(t,e){for(var n=(null==e?void 0:e.domain)||[],i=(null==e?void 0:e.range)||[],r=[],o=0;o<t.length;++o){var a=t[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),i.push(a.primary)):i[s]=a.primary,t[o]=null}else if(a){r.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),i.splice(l,1))}}return{domain:n,range:i,exclude:r}}function Ot(t,e,n,i){var o,a=function(t,e,n,i){if(e.input&&!e.input.auto){if("byMeasure"===e.input.mode)return function(t,e,n){var i=e.theme,r=e.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?At:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),c=Rt(0,{theme:i,hc:r},n,{f:l});if(c.invalid)return c;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(c.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=s.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter((function(t){return"measure"===t.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(u){var h=u.raw().coloring;h&&h.gradient&&M(c,St(t,h.gradient,c,u))}else c.auxiliary=s;return c}(t,n,e);if("byDimension"===e.input.mode)return function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.getCDef,o=void 0===r?N:r,a=i.getCByField,s=void 0===a?R:a,l=i.getPersistence,c=void 0===l?S:l,u=o(e,n),h=s(n,u),d=h?h.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:d.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(p.label=u.label,"color.altLabel"===d.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(p.auxiliary=u),M(p,c(e,n,u,h,{byRow:_,byElemNo:k})),p}(t,n,e);if("byExpression"===e.input.mode)return function(t,e,n,i){var r=e.hc,o=e.theme,a=e.translator,s=n.pic.field((function(t){return"colorByExpression"===t.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:i.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=Rt(0,{hc:r,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,e,i);if("byMultiple"===e.input.mode||"primary"===e.input.mode)return function(t,e,n,i){var r=e.hc,o=e.theme,a=e.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&r.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],c=[];"measure"===n.input.useBaseColors&&r.qMeasureInfo.forEach((function(e,n){if(e.baseColor||e.coloring&&e.coloring.baseColor){l.push(n);var r=t.resolveUIColor(e.baseColor||e.coloring.baseColor);"none"===r?c.push(i.primary):c.push(r)}}));var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===s){var d=[],f=[];return r.qDimensionInfo.forEach((function(e,n){if(e.baseColor||e.coloring&&e.coloring.baseColor){d.push(n);var r=t.resolveUIColor(e.baseColor||e.coloring.baseColor);"none"===r?f.push(i.primary):f.push(r)}})),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=i.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=t.resolveUIColor(n.input.paletteColor));else{var g=n.input.singleColor;"number"!=typeof g||Number.isNaN(g)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][g])}return{mode:"constant",type:"constant",primary:p}}(t,n,e,i)}return{}}(t,e,n,i);return null!==(o=e.input)&&void 0!==o&&o.measureOverrides?(a.measureOverrides=e.input.measureOverrides.map((function(n,o){return function(t){var e,n=t.cm,i=t.defaults,o=t.index,a=t.input,s=t.pic;if(!a||!a.on)return null;var l=null!==(e=a.mode)&&void 0!==e?e:"primary";return"primary"===l?function(t,e,n){var i=n.primary;return void 0!==e.paletteColor&&e.paletteColor&&(i=t.resolveUIColor(e.paletteColor)),r(r({},n),{},{mode:"constant",type:"constant",primary:i})}(n,a,i):"byExpression"===l?function(t,e,n){var i="qMeasureInfo/".concat(t,"/"),o=e.field((function(t){return t.id().startsWith(i)&&"colorByMeasureExpression"===t.raw().id})),a=o;return r(r({},n),{},a?{mode:"field",fieldType:"expression",field:o?o.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(o,s,i):null}({cm:t,input:n,defaults:i,index:o,pic:e.pic})})),function(t,e){var n,i,r,o=e.translator;if(Ct(t),1===(null===(n=t.measureOverrides)||void 0===n?void 0:n.length))return t.measureOverrides[0];if("measure"===t.mode&&t.measureOverrides&&(t.explicit=Dt(t.measureOverrides,t.explicit),Ct(t)),null!==(i=t.measureOverrides)&&void 0!==i&&i.every((function(t){return"constant"===(null==t?void 0:t.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=Dt(t.measureOverrides),a}return null!==(r=t.measureOverrides)&&void 0!==r&&r.every((function(t){return t}))?{invalid:!0,measureOverrides:t.measureOverrides}:t}(a,n)):a}var Et=function(t,e){var n=t.fieldType,i={};if(e)if("measure"===n){var r=e.coloring;r&&(i.measureGradient=r.gradient)}else if("dimension"===n){var o=e[0],a=e[1];o&&(i.legendDataPage=o),a&&(i.dimValsData=a.colorMap)}return i},zt=function(t){throw t.isHandled=!0,t};function It(t){return function(e){return"object"===s(e.datum[t])?e.datum[t].value:void 0}}function Tt(t){return"object"===s(t.datum.isNull)?t.datum.isNull.value:-2===t.datum.value}function Pt(t){return-3===t.datum.value}var qt={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Lt={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function jt(t){var e=t.theme,n=t.key,i=t.styleOverrides,r={title:{color:qt.COLOR,fontSize:qt.FONT_SIZE,fontFamily:qt.FONT_FAMILY},label:{color:Lt.COLOR,fontSize:Lt.FONT_SIZE,fontFamily:Lt.FONT_FAMILY}};if(!e&&!i)return r;var o=i||{},a=o.title,s=o.label,l=function(t){var e=t.theme,n=t.key;return function(t,i,r,o){return void 0!==t?t:e?e.getStyle(n,i,r):o}}({theme:e,key:n});return r.title.color=l(null==a?void 0:a.color,"legend.title","color",qt.COLOR),r.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",qt.FONT_SIZE),r.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",qt.FONT_FAMILY),r.label.color=l(null==s?void 0:s.color,"legend.label","color",Lt.COLOR),r.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",Lt.FONT_SIZE),r.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",Lt.FONT_FAMILY),r}var Ft=function(t,e,n){var i=t&&t.dock||void 0;if("auto"!==i)return i||"right";if(e){var r=e.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return n?"left":"right"},Bt=function(t,e,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&e.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof t.show?t.show():!1!==t.show)};function Vt(t,e){var n=t.styleReference,i=t.styleOverrides,r=t.chart,o=t.rtl,a=e.legendProps,s=e.coloring,l=e.theme,c=e.hc,u=jt({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:Ft(a,r,o)},show:"function"==typeof a.show?function(){return Bt(a,c,s)}:Bt(a,c,s),renderer:"svg",mounted:function(t){t.childNodes[0].style.pointerEvents="none",t.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function $t(t,e,i){var o=[],a=[],s=function(t,e,n){return"categorical"===e.coloring.type?function(t,e,n){var i=Vt(t,e);if(!i.show)return!1;var o,a=t.key,s=t.styleReference,l=t.styleOverrides,c=t.viewState,u=t.rtl,h=t.settings,d=t.style,f=e.scaleKey,p=e.theme,g=e.scales,m=jt({theme:p,key:s,styleOverrides:l}),y=i.layout.dock,x="left"===y||"right"===y?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===e.coloring.fieldType&&(o=function(t){return t.datum.value>=0||-3===t.datum.value});var b="".concat(f,"Legend");return M(!0,i,{type:"legend-cat",key:"".concat(a,"-cat"),scale:b in g?b:f,settings:{layout:{scrollOffset:function(){return c?c.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:o,label:r({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},x)},navigation:{disabled:n,button:{content:function(t,e){var n=e.direction;return t("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[t("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",a],style:{inactive:{opacity:.3}}}]}},{settings:h,style:d})}(t,e,n):"continuous"===e.coloring.type&&function(t,e){var n,i=t.key,r=t.styleReference,o=t.styleOverrides,a=t.rtl,s=t.settings,l=t.style,c=e.scaleKey,u=e.theme,h="".concat(c,"Range"),d=Vt(t,e);if(!d.show)return!1;var f=jt({theme:u,key:r,styleOverrides:o}),p=d.layout.dock,g="right"===p||"left"===p,m=null===(n=e.scales)||void 0===n?void 0:n[h];return g&&m&&(m.invert=!0),M(!0,d,{type:"legend-seq",key:"".concat(i,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:s,style:l})}(t,e)}(t,e,i&&i.navigationDisabled);return o.push(s),s&&"legend-cat"===s.type&&(a.push(function(t){var e=t.key,n=t.requireFailure,i=t.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(e),type:"Tap",requireFailure:n,recognizeWith:i,options:{event:"legendtap",interval:10,pointers:1,enable:function(t,n){var i;if(!n)return!0;if(null!=r&&null!==(i=r.interact)&&void 0!==i&&i.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(t){return t.key==="".concat(e,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(t){t.preventDefault();var e=t.srcEvent.target;e&&e.hasAttribute("data-action")&&e.hasAttribute("data-component-key")&&this.chart.component(e.getAttribute("data-component-key")).emit(e.getAttribute("data-action"))}}}}(t,i)),a.push(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.eventName,i=t.key,r=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(i),type:"Pan",requireFailure:r,recognizeWith:o,options:{event:e,pointers:1,threshold:10,enable:function(t,n){var r;return this.started===e||!n||!(null!=a&&null!==(r=a.interact)&&void 0!==r&&r.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(t){return t.key==="".concat(i,"-cat")}))}},events:n(n(n({},"".concat(e,"start"),(function(t){t.preventDefault(),this.started!==e&&(this.started=e,this.chart.component("".concat(i,"-cat")).emit("panstart",t))})),"".concat(e,"move"),(function(t){t.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panmove",t)})),"".concat(e,"end"),(function(t){t.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panend",t),this.started=!1}))}}(t,i))),{interactions:a,components:o}}function Ht(t){var e=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.auto,n=function(t){var e=r({hc:null,colorProps:null,layout:null,theme:null},t),n={},i={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},o={auto:function(t){return t?(i.auto=t,o):i.auto},getDimensionColorMap:function(t){return t?(i.getDimensionColorMap=t,o):i.getDimensionColorMap},getAttributeDimension:function(t){return t?(i.getAttributeDimension=t,o):i.getAttributeDimension},getMeasure:function(t){return t?(i.getMeasure=t,o):i.getMeasure},set:function(t){var r;if(!t.colorProps)throw new Error('Missing "colorProps"');if(M(e,t),(n={pic:e.picasso.data("q")({data:e.hc,config:{localeInfo:e.localeInfo}}),input:e.colorProps}).input.auto){var o=i.auto(t.layout);n.input=M(!0,{},n.input,o,{auto:!1});var a=e.theme?e.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),e.hc&&e.hc.qDimensionInfo[s]&&e.hc.qDimensionInfo[s].coloring&&e.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=e.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(r=n.input.measureOverrides)&&void 0!==r&&r.every((function(t){return!t||!t.on}))&&(n.input=M(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var t=e.theme,i=[];(t&&t.getDataColorPickerPalettes()||[]).forEach((function(t){i.push({key:"ui",colors:t.colors})})),n.palettes=i}return n.palettes},getAuxiliaryData:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!t.auxiliary&&!/qAttrDimInfo/.test(t.field))return Promise.resolve();var r=(t.auxiliary||{}).key;if("measure"===t.fieldType)return i.getMeasure(r,e).catch((function(){}));if("dimension"===t.fieldType){var o="".concat(n,"/").concat(t.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(t.field)?i.getAttributeDimension(o,e).catch((function(){})):Promise.resolve(),r?i.getDimensionColorMap(r,e).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(t,i){var o=this;return t.auxiliary||/qAttrDimInfo/.test(t.field)?(this.palettes(),this.getAuxiliaryData(t,i).then((function(i){if(!i)return{};if("measure"===t.fieldType){if(i.coloring&&i.coloring.gradient){var a=n.pic.field(t.field);return St(o,i.coloring.gradient,t,a)}return{}}if("dimension"===t.fieldType){var s={nil:t.nil,others:t.others},l=i[0],c=i[1]?i[1].colorMap:null;if(l){var u=e.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(t.field).raw(),n.pic.field(t.field).raw()],qMeasureInfo:[],qDataPages:l,qInterColumnSortOrder:[0,1],qMode:"S"}});s.legendDataset=u}return c?function(t,e,n,i){var o=i.external,a=i.field,s=r({},t);M(s,k(a,a.raw().qCardinal));var l=o.theme?o.theme.getDataColorPalettes()[0]:null;return e.nul&&(s.nil=n.resolveUIColor(e.nul)),e.oth&&(s.others=n.resolveUIColor(e.oth)),e.usePal?(s.palettes={categorical:e.pal},l&&!e.pal&&(s.palettes.categorical=l.key,M(s,k(a)))):!1===e.autoFill&&e.single?s.range=[n.resolveUIColor(e.single)]:e.autoFill&&(l&&(s.palettes={categorical:l.key}),M(s,k(a))),e.colors&&e.colors.length&&(s.explicit=function(t,e,n){for(var i={},r=0;r<t.length;r+=1)i[t[r].value]=t[r].baseColor;var o=[];return{domain:function(t){var r=t.data,a=[];o=[];for(var s=0;s<r.items.length;s++){var l=r.items[s],c=(l.text||l).label;i[c]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(e.resolveUIColor(i[c])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(e.colors,n,s)),s}(s,c,o,{external:e,field:n.pic.field(t.field)}):s}return{}}))):Promise.resolve()},resolveUIColor:function(t){if(t.index<0||void 0===t.index)return t.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(t){return"ui"===t.key}))[0]||!1),!n.uiPalette)return t.color;var e="none"===n.uiPalette.colors[0]?t.index:t.index-1;return void 0===n.uiPalette.colors[e]?t.color:n.uiPalette.colors[e]},settings:function(){if(this.palettes(),!n.settings){var t={primary:"steelblue",others:"#aaa",nil:"#ddd"},i=e.theme;i&&(t=r(r({},t),i.getDataColorSpecials())),n.settings=M(t,Ot(this,n,e,t))}return n.settings}};return o}(t.resources).auto(e||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(t,e){return function(t,e){var n=e.layout,i=e.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():i&&i.getObject?i.getObject("ColorMapModel_".concat(t)).then((function(t){return t.getLayout()})):Promise.reject()}(t,{layout:e.layout,app:e.app})})).getMeasure((function(t,e){return function(t,e){var n=e.layout,i=e.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():i&&i.getMeasure?i.getMeasure(t).then((function(t){return t.getMeasure()})):Promise.reject()}(t,{layout:e.layout,app:e.app})})).getAttributeDimension((function(t,e){return function(t,e){var n=e.layout,i=e.model,r=e.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():i&&i.session&&r?i.getHyperCubeData(t,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(zt):Promise.reject()}(t,{layout:e.layout,model:e.model,app:e.app})}));return n.getSnapshotData=Et,n}({resources:t}),i={},o={},s=function(t){return o.settings||(t||console.warn("settings() called before auxiliarySettings()"),o.settings=e.settings()),o.settings},l={config:function(n){if(i=r({},n),o={},!i.key)throw new Error("Missing key");e.set(r(r({},t),i))},auto:function(t){return t?(e.auto(t),l):e.auto()},getAuxiliarySettings:function(t){return o.auxiliarySettings?Promise.resolve(o.auxiliarySettings):e.getAuxiliarySettings(s(!0),t).then((function(t){return o.auxiliarySettings=t||{},o.settings=r(r({},o.settings),o.auxiliarySettings),o.scales=void 0,o.color=void 0,o.auxiliarySettings}))},getAuxiliaryData:function(){return e.getAuxiliaryData(s())},getSnapshotData:function(t){var n=s();return e.getAuxiliaryData(n,t).then((function(t){return e.getSnapshotData(n,t)}))},resolveUIColor:function(t){return e.resolveUIColor(t)},settings:function(){var t=s();return{mode:t.mode,type:t.type,label:t.label,field:t.field,fieldType:t.fieldType,nil:t.nil,others:t.others,primary:t.primary}},settingsForMeasure:function(t){var e;return(null===(e=s().measureOverrides)||void 0===e?void 0:e[t])||this.settings()},isSelectionLocked:function(t){var e=t.isMeasureSelectionLocked;return function(t,e){var n=e.isMeasureSelectionLocked;return"field"!==t.mode||("dimension"===t.fieldType?t.isFieldLocked:"measure"!==t.fieldType||n)}(s(),{isMeasureSelectionLocked:e})},palettes:function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.colorProps,n=t.coloring,i=t.theme,r=[];if(n&&n.palettes&&i){var o=n.palettes.categorical||e.dimensionScheme,s=i.getDataColorPalettes().filter((function(t){return t.key===o}))[0]||i.getDataColorPalettes()[0];o&&s&&r.push({key:"categorical",colors:s.colors});var l=n.palettes.metric||e.measureScheme,c=i.getDataColorScales().filter((function(t){return t.key===l}))[0]||i.getDataColorScales()[0];if(c){var u=c.colors[0]?c.colors:[[]].concat(a(c.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(t){return t.slice().reverse()})):u.slice().reverse(),r.push({key:"quant",colors:u})}}return r}({coloring:s(),colorProps:i.colorProps,theme:i.theme})},scales:function(){return o.scales=o.scales||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.hc,n=t.coloring,i=t.rtl,o=t.key,s=t.source,l=t.picasso,c={},u=o;if(n){var h={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(a((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(a((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var d,f=function(t){var e=t.hc,n=t.source,i=t.coloring,r={data:{extract:[{source:"dummy",field:0,filter:function(){return r.expando=e.qDataPages[0]?e.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:i.field,trackBy:i.valueAccessor,reduce:"first",props:{row:{reduce:function(){return r.expando++}},text:{value:function(t){return t.qText},reduce:"first"}}}]},expando:0};return r}({hc:e,source:s,coloring:n}).data;if(n.legendDataset){var p=0,g={};l.data("q")({data:e}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(t){var e=t[0];return g[e]=p++,t[0]}}),d={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(t){return t.qElemNumber>=0},props:{row:{value:function(t){return g[t.qElemNumber]}}}}}}var m={data:f,range:n.range,domain:n.domain,explicit:h,type:"categorical-color",label:function(t){return t.datum.text&&t.datum.text.value?t.datum.text.value:t.datum.label}};c[u]=m,d&&(c["".concat(u,"Legend")]=r(r({},m),{},{data:d})),e&&e.qHasOtherValues&&d&&((d||m.data).amend=[{label:e.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var y={data:{field:n.field},min:n.min,max:n.max};c[u]=M({},y,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===c[u].type&&(c["".concat(u,"Range")]=M({},y,{invert:!!i}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var x={data:e.qDimensionInfo.map((function(t,e){return e})),label:function(t){return e.qDimensionInfo[t.datum.value].qFallbackTitle},explicit:h,type:"categorical-color"};c[u]=x}else if("measure"===n.mode){var v={data:e.qMeasureInfo.map((function(t,e){return e})).filter((function(t){var e;return!(null!==(e=n.explicit)&&void 0!==e&&null!==(e=e.exclude)&&void 0!==e&&e.includes(t))})),label:function(t){return e.qMeasureInfo[t.datum.value].qFallbackTitle},explicit:h,type:"categorical-color"};c[u]=v}}return c}({hc:i.hc,coloring:s(),key:i.key,source:i.source,picasso:t.picasso}),o.scales},color:function(){return o.color=o.color||function(t){var e=t.coloring,n=t.scales,i=t.key,r=It(i),o=It("".concat(i,"IsAnOther")),a=function(t,e){var i=t.fieldType,a=t.invalid,s=t.mode,l=t.nil,c=t.others,u=t.primary,h=t.type;return a?function(t){return Pt(t)||o(t)?c:l}:n[e]?function(t){return Pt(t)?c:Tt(t)||-2===r(t)&&"dimension"===i||"NaN"===r(t)?l:o(t)?c:t.resources.scale(e)(r(t))||c}:"constant"===s?function(t){return Pt(t)||o(t)?c:Tt(t)?l:u}:"color"===h?function(t){return Pt(t)||o(t)?c:Tt(t)?l:r(t)||c}:null},s=a(e,i);if(e.measureOverrides){var l=It("".concat(i,"MeasureIdx")),c=e.measureOverrides.map((function(t){return t&&a(t)}));return function(t){var e=l(t);return c[e]?c[e](t):s(t)}}return s}({coloring:s(),scales:this.scales(),key:i.key}),o.color},datumProps:function(t){return function(t){var e,i,r=t.hc,o=t.coloring,a=t.scales,s=t.key,l=t.addMeasureIx,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=s,h=o.nil;"field"===o.mode&&o.field?e=o.field:a[s]&&"field"===o.mode&&(e=a[s].data.field||o.field),e?(i={field:e,reduce:"first"},"color"===o.type&&(i.value=function(t){return"NaN"!==t.qNum?function(t){return"rgba(".concat([(16711680&t)>>16,(65280&t)>>8,255&t,((4278190080&t)>>>24)/255].join(","),")")}(t.qNum):t.qText&&W(t.qText)?t.qText:h})):"dimension"===o.mode?i=void 0!==o.field?o.field:r.qDimensionInfo.length-1:"measure"===o.mode&&(i=c);var d=n({},u,i);return r.qDimensionInfo.length>1&&(d["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(t,e){return{field:"qDimensionInfo/".concat(e)}})),value:function(t){return-1!==t.indexOf(-3)}}),l&&(d["".concat(u,"MeasureIdx")]=c),d}({coloring:this.settingsForMeasure(t),scales:this.scales(),key:i.key,hc:i.hc,addMeasureIx:s().measureOverrides},t)},data:function(){var t=s(),e={key:"dummy",data:[["field"],["a"]]};return t.legendDataset?[e,{type:"q",key:"attrDim",data:t.legendDataset.raw(),config:{localeInfo:i.localeInfo}}]:[e]},legend:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.eventName,n=t.key,r=t.viewState,o=t.chart,a=t.rtl,l=t.styleReference,c=void 0===l?"object.legend":l,u=t.styleOverrides,h=t.settings,d=void 0===h?{}:h,f=t.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return $t({eventName:e,key:n,rtl:a,viewState:r,chart:o,styleReference:c,styleOverrides:u,settings:d,style:void 0===f?{}:f},{legendProps:i.legendProps,scaleKey:i.key,coloring:s(),theme:i.theme,hc:i.hc,scales:this.scales()},p)}};return l}var Wt=function(t){return t.baseColor||t.coloring&&t.coloring.baseColor};function Ut(t){var e=t.qHyperCube,n=e.qDimensionInfo,i=e.qMeasureInfo,r=n.some(Wt),o=i.some(Wt),a=t.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!r?"off":a}var Yt=function(t){return t.baseColor||t.coloring&&t.coloring.baseColor};function Xt(t){var e,n=t.qHyperCube.qDimensionInfo.some(Yt),i=t.qHyperCube.qMeasureInfo.some(Yt),r=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(e=null!=r?r:i?"measure":void 0)&&void 0!==e?e:"off",paletteColor:null}}var Gt=function(){};function Kt(t){var e,n,i,o,a=t.picasso,s=t.model,l=t.app,c=t.translator,u=t.layoutService,h=void 0===u?void 0:u,d=t.createConfig,f=void 0===d?Gt:d,p=t.config,g=void 0===p?{}:p,m=t.custom,y=void 0===m?{}:m,x=g.localeInfo,v=g.key,b=g.theme,w=void 0===b?void 0:b,M=g.auto,k=void 0===M?void 0:M,_=g.definitionPath,S=null==h||null===(e=h.getLayout)||void 0===e?void 0:e.call(h),N={theme:w,key:v,localeInfo:x,layout:S,hc:null==h||null===(n=h.getHyperCube)||void 0===n?void 0:n.call(h),legendProps:null==h||null===(i=h.getLayoutValue)||void 0===i?void 0:i.call(h,"legend"),colorProps:r(r({},null==h||null===(o=h.getLayoutValue)||void 0===o?void 0:o.call(h,"color")),{},{useBaseColors:S?Ut(S):void 0})},R=Ht({picasso:a,model:s,app:l,translator:c,auto:k});!1!==k&&R.auto((function(t){return k?k({layout:t,defaultAuto:Xt}):Xt(t)}));var A=!1,C={getColor:function(){return R.color()},getPaletteColor:function(t){var e=t.index,n=t.color;return R.resolveUIColor({index:e,color:n})},getData:function(){return R.data()},getDatumProps:function(t){return R.datumProps(t)},getSnapshotData:function(){return R.getSnapshotData(_)},getSettingsForMeasure:function(t){return R.settingsForMeasure(t)},getSettings:function(){return R.settings()},getLegend:function(t,e){return R.legend(t,e)},getScales:function(){return R.scales()},getPalettes:function(){return R.palettes()},isSelectionLocked:function(t){var e=t.isMeasureSelectionLocked;return R.isSelectionLocked({isMeasureSelectionLocked:e})},isInitialized:function(){return A},custom:r({},y),initialize:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,e=(void 0===t?f:t)({getUseBaseColors:Ut}),n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(r(r({},t),e),{},{colorProps:r(r({},t.colorProps),e.colorProps||{})})}(N,e);return R.config(n),R.getAuxiliarySettings(_).then((function(){A=!0}))}};return C}var Zt="center",Jt="bottom";function Qt(t){var e=t.chart,n=t.logicalSize;if(n)return n;var i=e?e.element.getBoundingClientRect():{};return{width:i.width,height:i.height}}[{key:"NoDataExist",alignment:Zt,condition:function(t){var e=t.layoutService;if(!e)return!1;var n=e.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Zt,condition:function(t){var e=t.layoutService;return!!e&&e.getHyperCubeValue("qMeasureInfo").every((function(t){return"NaN"===t.qMin&&"NaN"===t.qMax}))}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:Zt,condition:function(t){var e=t.layoutService;if(!e)return!1;if(!e.meta.isContinuous)return!1;var n=e.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Zt},{key:"DataRangeIncludingZero",alignment:Jt},{key:"LimitedData",alignment:Jt},{key:"NegativeOrZeroValues",alignment:Jt}].reduce((function(t,e){return t[e.key]=e,t}),{});var te=[{key:"FULL",size:{width:550,height:450}},{key:"MEDIUM",size:{width:400,height:220}},{key:"SMALL",size:{width:300,height:150}},{key:"XSMALL",size:{width:150,height:75}}];function ee(t){var e=t.width,n=t.height,i=te.filter((function(t){return e>=t.size.width&&n>=t.size.height})).shift();return i?i.key:"SPARK"}var ne={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function ie(t){var e=t.orientation,n=t.dock,i=t.btt,r=t.rtl,o="horizontal"===e?function(t){return"bottom"===t||"near"===t?"bottom":"top"}(n):function(t,e){var n="left"===t||"near"===t?"left":"right";return e?ne[n]:n}(n,r),a=function(t,e,n){return"vertical"===t?e?"bottom":"top":n?"right":"left"}(e,i,r);return{current:o,opposite:ne[o],start:a,end:ne[a]}}function re(t){var e=t.chart,n=t.layoutService,i=t.config,o=void 0===i?{}:i,a=o.logicalSize,s=void 0!==a&&a,l=o.rtl,c=void 0!==l&&l,u={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},h={type:"x-y",config:r({},o),meta:u,update:function(t){u.chart.size={width:t.width,height:t.height},u.chart.mode=ee(t);var e=ie({orientation:"horizontal",dock:n.getLayoutValue("xAxis.dock"),btt:!1,rtl:c}),i=e.current,r=e.opposite;u.x.dock=i,u.x.opposite=r,u.x.size=t.width;var o=ie({orientation:"vertical",dock:n.getLayoutValue("yAxis.dock"),btt:!0,rtl:c}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=t.height}};return h.update(Qt({chart:e,logicalSize:s})),h}var oe="vertical",ae="horizontal";function se(t){var e=t.chart,n=t.layoutService,i=t.config,o=void 0===i?{}:i,a=t.typeConfig,s=void 0===a?{}:a,l=o.logicalSize,c=void 0!==l&&l,u=o.rtl,h=void 0!==u&&u,d=s.fallback===oe?oe:ae,f=!!s.invert,p=s.measureAxes||[{ref:"measureAxis",name:"minor"}],g={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},m={type:"major-minor",config:r({},o),meta:g,update:function(t){g.chart.orientation=n.getLayoutValue("orientation",d),g.chart.size={width:t.width,height:t.height},g.chart.mode=ee(t),g.major.orientation=function(t){var e=t.chartOrientation,n=t.invert;return t.layoutService.meta.isContinuous?ae:n?e===oe?ae:oe:e}({layoutService:n,chartOrientation:g.chart.orientation,invert:f});var e=ie({orientation:g.major.orientation,dock:n.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:h}),i=e.current,r=e.opposite;g.major.dock=i,g.major.opposite=r,g.major.size=g.major.orientation===oe?t.height:t.width,p.forEach((function(e){var i={};i.orientation=g.major.orientation===oe?ae:oe;var r=ie({orientation:i.orientation,dock:n.getLayoutValue("".concat(e.ref,".dock")),btt:!0,rtl:h}),o=r.current,a=r.opposite,s=r.start,l=r.end;i.dock=o,i.opposite=a,i.start=s,i.end=l,i.size=i.orientation===oe?t.height:t.width,g[e.name]=i}))}};return m.update(Qt({chart:e,logicalSize:c})),m}function le(t){var e=t.chart,n=t.layoutService,i=t.config,r=void 0===i?{}:i,o=t.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?re:se)({chart:e,layoutService:n,config:r,typeConfig:a})}function ce(t,e,n){if(void 0===t||void 0===e)return n;for(var i=e.split("."),r=t,o=0;o<i.length;++o){var a=i[o];if(void 0===r[a])return n;r=r[a]}return r}var ue=["__proto__","constructor"];function he(t,e,n){if(void 0!==t&&void 0!==e){var i=e.split("."),r=i[i.length-1];if(!ue.some((function(t){return i.includes(t)}))){for(var o=t,a=0;a<i.length-1;++a){var s=i[a];void 0===o[s]&&(o[s]=Number.isNaN(+i[a+1])?{}:[]),o=o[s]}void 0!==n?o[r]=n:delete o[r]}}}var de,fe={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},pe=function(t,e){return t[e].reduce((function(t,e,n){var i;return i=e,fe.ERROR_CODES.some((function(t){var e;return t===(null===(e=i.qError)||void 0===e?void 0:e.qErrorCode)}))?t.filtered.push(n):t.reduced.push(e),t}),{reduced:[],filtered:[]})};function ge(t){var e;return((null==t||null===(e=t.qHyperCube)||void 0===e?void 0:e.qDimensionInfo)||[]).map((function(t){var e,n=null===(e=t.qCardinalities)||void 0===e?void 0:e.qHypercubeCardinal;if(n)return n;var i=t.qStateCounts||{},r=i.qLocked,o=void 0===r?0:r,a=i.qOption,s=void 0===a?0:a,l=i.qSelected;return o+s+(void 0===l?0:l)}))}function me(t){switch(t.qHyperCube.qMode){case"S":return function(t){var e=t.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:e.qcx,y:e.qcy,dimensions:ge(t)}}}(t);case"K":return function(t){var e=ge(t);return{refs:{dataPages:"qHyperCube.qStackedDataPages"},size:{x:t.qHyperCube.qSize.qcx,y:e[0],dimensions:e}}}(t);case"T":return function(t){var e=ge(t);return{refs:{dataPages:"qHyperCube.qTreeDataPages"},size:{x:t.qHyperCube.qSize.qcx,y:e[0],dimensions:e}}}(t);default:throw new Error("Mode not supported")}}function ye(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function xe(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=be)):void 0===e&&(e=ve);for(var n,i,r,o,a,s=new ke(t),l=[s];n=l.pop();)if((r=e(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new ke(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(Me)}function ve(t){return t.children}function be(t){return Array.isArray(t)?t[1]:null}function we(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Me(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function ke(t){this.data=t,this.depth=this.height=0,this.parent=null}ke.prototype=xe.prototype={constructor:ke,count:function(){return this.eachAfter(ye)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)t.call(e,o,++l,this);return this},eachBefore:function(t,e){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(t.call(e,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return xe(this).eachBefore(we)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)o.push(e[n])}while(o.length)}},de=function(t){
8
+ /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
9
+ t.exports=function(t,e){if(!t||isNaN(+e))return e;var n,i,r,o,a,s,l,c,u,h,d=t.length,f=t.search(/[0-9\-\+#]/),p=f>0?t.substring(0,f):"",g=t.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,x=t.substring(y,y+1),v=y+("."===x||","===x?1:0),b=m>0?t.substring(v,d):"";if(n=(e="-"===(t=t.substring(f,v)).charAt(0)?-e:+e)<0?e=-e:0,r=(i=t.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",t=t.split(r),e=+(e=e.toFixed(t[1]&&t[1].length))+"",s=t[1]&&t[1].lastIndexOf("0"),(!(c=e.split("."))[1]||c[1]&&c[1].length<=s)&&(e=(+e).toFixed(s+1)),u=t[0].split(o),t[0]=u.join(""),(a=t[0]&&t[0].indexOf("0"))>-1)for(;c[0].length<t[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((e=e.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=e[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);e[0]=g}return e[1]=t[1]&&e[1]?r+e[1]:"","0"!==(i=e.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}},de({exports:{}});var _e="'Source Sans Pro', 'Arial', 'sans-serif'",Se="#333333",Ne="#595959",Re="#737373",Ae="#cccccc",Ce="#e6e6e6";function De(t){var e={};return[].concat(a(t),a([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Ne],["object","axis.label.name","fontFamily",_e],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Ae],["object","axis.line.minor","color",Ce],["object","axis.title","color"],["object","axis.title","fontFamily",_e],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Ce],["object","grid.line.major","color",Ae],["object","grid.line.minor","color",Ce],["object","label.value","color",Ne],["object","label.value","fontFamily",_e],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Ne],[!1,"label.value","lightColor",Ce],["object","outOfRange","color","#999"],["object","legend.title","color",Se],["object","legend.title","fontFamily",_e],["object","legend.title","fontSize","15px"],["object","legend.label","color",Ne],["object","legend.label","fontFamily",_e],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Se],["object","referenceLine.label.name","fontFamily",_e],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Ce],["object","referenceLine.outOfBounds","fontFamily",_e],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Re,function(t){return"transparent"===t?Re:t}]])).reduce((function(t,n){var i="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return e[i]||(e[i]=!0,t.push(n)),t}),[]).sort((function(t,e){return(t[0].split?t[0].split(".").length:0)-(e[0].split?e[0].split(".").length:0)}))}var Oe=function(t){return t};function Ee(t){var e=t.theme,n=t.id,i=t.transform,r=t.extend,a=t.matrix,s={},l=i.reduce((function(t,e){var n=o(e,2),i=n[0],r=n[1];return t[i]=r,t}),{});return a.forEach((function(t){var i=o(t,5),r=i[0],a=i[1],c=i[2],u=i[3],h=i[4],d=void 0===h?function(t){return t}:h,f=function(t){var e=t.theme,n=t.base,i=t.path,r=t.attribute,o=t.defaultValue,a=void 0===o?void 0:o;if(!e||!1===n)return a;var s=e.getStyle(n,i,r);return void 0===s?a:s}({theme:e,base:"object"===r&&n?"".concat("object",".").concat(n):r,path:a,attribute:c,defaultValue:u}),p=(l["".concat(a,".").concat(c)]||Oe)(d(f));he(s,[a,c].filter(Boolean).join("."),p)})),r.forEach((function(t){var e=o(t,2),n=e[0],i=e[1];he(s,n,i)})),s}const ze=(t,e,n)=>{const i=function(t){var e=t.theme,n=t.translator,i=t.config,r=void 0===i?{}:i,o=t.flags,a=function(t){var e=t.config,n=void 0===e?{}:e,i=n.id,r=n.paths;return{id:void 0===i?"object":"".concat("object",".").concat(i),paths:Array.isArray(r)?r:[]}}({config:r}),s=a.id,l=a.paths,c={};l.forEach((function(t){for(var i=t.split("."),r=c,a=0;a<i.length;a++){var l=i[a];a===i.length-1?r[l]=v({theme:e,translator:n,id:s,path:t,flags:o}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var u=function(t){for(var e=t.split("."),n=c,i=0;i<e.length;i++){var r=e[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(t,"' could not be resolved."));n=n[r]}return n};return c.getDefaultValue=function(t){return u(t).getDefaultValue()},c.getOptions=function(t){return u(t).getOptions()},c}({theme:n,translator:e,flags:t,config:{id:"gauge",paths:["axis.title","axis.label.name","label.value"]}});return{component:"styling-panel",chartTitle:"Object.Gauge",translation:"LayerStyleEditor.component.styling",useBackground:!0,subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,items:{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"axis",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"axis.title.fontFamily",component:"dropdown",options:()=>i.getOptions("axis.title.fontFamily"),defaultValue:()=>i.getDefaultValue("axis.title.fontFamily")},fontColor:{ref:"axis.title.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","axis.title","color")}),width:!1}}}}}}},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"axis",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"axis.label.name.fontFamily",component:"dropdown",options:()=>i.getOptions("axis.label.name.fontFamily"),defaultValue:()=>i.getDefaultValue("axis.label.name.fontFamily"),width:!0},fontColor:{ref:"axis.label.name.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","axis.label.name","color")}),width:!1}}}}}}},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"value",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"label.value.fontFamily",component:"dropdown",options:()=>i.getOptions("label.value.fontFamily"),defaultValue:()=>i.getDefaultValue("label.value.fontFamily"),width:!0},fontColor:{ref:"label.value.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","label.value","color")}),width:!1}}}}}}}}}};function Ie(t){return"measure"===ce(t,"color.useBaseColors")}function Te(t){const{flags:e,translator:n,sense:i}=t,r=i.theme,o={items:{labels:{items:{header:{show(t){var e;return null===(e=t.qHyperCubeDef.qMeasures)||void 0===e?void 0:e.length}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(t){var e;return null===(e=t.qHyperCubeDef.qMeasures)||void 0===e?void 0:e.length},convertFunctions:{get:(t,e,n,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(t,e,n,i,r){r.measureAxis.show=t?"labels":"all"}}}}}}};return{definition:{type:"items",component:"accordion",items:{data:{uses:"data"},addons:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},settings:{type:"items",uses:"settings",component:"expandable-items",translation:"Common.Appearance",items:{simpleLabels:o,presentation:{type:"items",grouped:!0,translation:"properties.presentation",items:{styleEditor:ze(e,n,r),rangeLimits:{type:"items",items:{text:{component:"text",translation:"properties.axis.rangeLimits",style:"sHeader"},min:{ref:"measureAxis.min",translation:"properties.axis.min",type:"number",expression:"optional",invalid:t=>t.measureAxis&&t.measureAxis.min>=t.measureAxis.max},max:{ref:"measureAxis.max",translation:"Common.Max",type:"number",expression:"optional",defaultValue:100,invalid:t=>t.measureAxis&&t.measureAxis.min>=t.measureAxis.max}}},type:{ref:"gaugetype",type:"string",component:"item-selection-list",defaultValue:"radial",horizontal:!0,items:[{icon:"gauge_gauge",component:"icon-item",labelPlacement:"bottom",translation:"properties.gauge.radial",value:"radial"},{icon:"gauge_vertical_bar",component:"icon-item",labelPlacement:"bottom",translation:"properties.gauge.bar",value:"bar"}]},autoOrientation:{ref:"autoOrientation",translation:"properties.orientation",type:"boolean",defaultValue:!0,component:"switch",undefinedValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:t=>"bar"===t.gaugetype},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:t=>"bar"===t.gaugetype&&!t.autoOrientation},angle:{ref:"angle",translation:"properties.gauge.angle",type:"number",component:"slider",min:.2,max:.98,step:.1,defaultValue:.7,show:()=>!1},segments:{type:"items",items:{useSegments:{ref:"useSegments",type:"boolean",component:"switch",defaultValue:!1,translation:"properties.gauge.useSegments",change(t){const e=(n=t.segmentInfo).paletteColors&&n.paletteColors.length?n.paletteColors:n.colors&&n.colors.length?n.colors:void 0;var n;e&&(t.useSegments&&1===e.length?t.segmentInfo.paletteColors=[t.paletteProgressColor||t.progressColor]:t.paletteProgressColor=e[0])},options:[{value:!1,translation:"properties.off"},{value:!0,translation:"properties.on"}]},useBaseColor:{ref:"color.useBaseColors",type:"string",defaultValue:"measure",translation:"properties.useLibraryMeasureColors",component:"switch",show:t=>(t.color||(t.color={}),t.color.useBaseColors||(t.color.useBaseColors="off"),!0),options:[{value:"off",translation:"properties.off"},{value:"measure",translation:"properties.on"}]},paletteProgressColor:{component:"color-picker",translation:"properties.color",ref:"paletteProgressColor",type:"object",dualOutput:!0,defaultValue:()=>{var t;if(!r)return-1;const{primary:e}=r.getDataColorSpecials(),n=null===(t=r.getDataColorPickerPalettes()[0])||void 0===t?void 0:t.colors,i=n.indexOf(e);return{index:-1===i?Math.min(6,n.length-1):i}},show:t=>!Ie(t)&&!t.useSegments},maxSegments:{ref:"maxSegments",type:"number",defaultValue:6,show:!1},segmentInfo:{ref:"segments",type:"items",component:"color-scale-creator",show:t=>!Ie(t)&&t.useSegments,items:{limits:{ref:"segmentInfo.limits",type:"array",items:{value:{ref:"value",type:"number",expression:"optional",invalid:(t,e)=>"number"==typeof t.value&&(t.value<e.measureAxis.min||t.value>e.measureAxis.max),defaultValue:1},gradient:{translation:"properties.gradient",ref:"gradient",type:"boolean",show:!1}}},paletteColors:{items:{color:{ref:"color",type:"string"},index:{ref:"index",type:"integer",defaultValue:6}},type:"array",ref:"segmentInfo.paletteColors"}}}}},disclaimerClosed:{ref:"disclaimerClosed",type:"boolean",defaultValue:!1,show:!1}}},measureAxis:{type:"items",translation:"properties.measureAxis",grouped:!0,items:{axis:{type:"items",snapshot:{title:"properties.measureAxis",tid:"property-yAxis"},items:{show:{ref:"measureAxis.show",translation:"properties.axis.labelsAndTitle",type:"string",component:"dropdown",options:[{value:"all",translation:"properties.axis.show.all"},{value:"labels",translation:"properties.axis.show.labels"},{value:"title",translation:"properties.axis.show.title"},{value:"none",translation:"Common.None"}],defaultValue:"all"},spacing:{ref:"measureAxis.spacing",translation:"properties.axis.scale",type:"number",component:"dropdown",defaultValue:1,show:t=>t.measureAxis&&"none"!==t.measureAxis.show&&"title"!==t.measureAxis.show,options:[{value:2,translation:"properties.gridLine.wide"},{value:1,translation:"properties.gridLine.medium"},{value:.5,translation:"properties.gridLine.narrow"}]}}}}}}}}},support:{cssScaling:!1,snapshot:!0,export:!0,sharing:!0,exportData:!0,viewData:!0}}}function Pe(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Le(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qe(Object(n),!0).forEach((function(e){Pe(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var je=Object.prototype.hasOwnProperty,Fe=Object.prototype.toString,Be=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,$e=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===Fe.call(t)},He=function(t){if(!t||"[object Object]"!==Fe.call(t))return!1;var e,n=je.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&je.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;for(e in t);return void 0===e||je.call(t,e)},We=function(t,e){Be&&"__proto__"===e.name?Be(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},Ue=function(t,e){if("__proto__"===e){if(!je.call(t,e))return;if(Ve)return Ve(t,e).value}return t[e]},Ye=function t(){var e,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(e=arguments[l]))for(n in e)i=Ue(s,n),s!==(r=Ue(e,n))&&(u&&r&&(He(r)||(o=$e(r)))?(o?(o=!1,a=i&&$e(i)?i:[]):a=i&&He(i)?i:{},We(s,{name:n,newValue:t(u,a,r)})):void 0!==r&&We(s,{name:n,newValue:r}));return s};function Xe(t,e,n,i){if(!t)return-1;const r=n.cache,o=t.origin?t.origin():null;o&&(t=o);let a=r.fields.indexOf(t),s=-1,l=-1;if(-1===a)for(let e=0;e<r.wrappedFields.length;e++)if(l=r.wrappedFields[e].attrDims.map((t=>t.instance)).indexOf(t),s=r.wrappedFields[e].attrExps.map((t=>t.instance)).indexOf(t),-1!==l||-1!==s){a=e;break}if(Array.isArray(i)&&i.some(((t,e)=>t!==e))){const t=i.indexOf(a);-1!==t&&(a=t)}return a-=e.qArea.qLeft,a<0||a>=e.qArea.qWidth?-1:l>=0?t=>t[a].qAttrDims.qValues[l]:s>=0?t=>t[a].qAttrExps.qValues[s]:t=>t[a]}function Ge(t,e,n){let{key:i}=n;const r={value:"function"==typeof t.value?t.value(e):void 0!==t.value?t.value:e};return r.label="function"==typeof t.label?t.label(e):void 0!==t.label?String(t.label):String(r.value),t.field&&(r.source={key:i,field:t.field.key()}),r}function Ke(t){let{cache:e,f:n,mainCell:i,p:r,prop:o,page:a,rowIdx:s,row:l,sourceKey:c,target:u,targetProp:h,columnOrder:d}=t,f=i;if(r.field&&r.field!==n){const t=Xe(r.field,a,{cache:e},d);if(-1===t)return;f=Ye({qRow:s},t(l))}u[h]=Ge(r,f,{key:c})}function Ze(t,e,n,i){const r=Array.isArray(t)?t:[t];let o=[];for(let t=0;t<r.length;t++)if(void 0!==r[t].field){const a=e.raw(),s=e.key(),l="object"==typeof r[t].field?r[t].field:e.field(r[t].field),{props:c,main:u}=i.normalizeConfig(r[t],e),h=Object.keys(c),d=!!r[t].trackBy,f=typeof r[t].trackBy,p={},g=[],m=[];for(let e=0;e<a.qDataPages.length;e++){const o=Xe(l,a.qDataPages[e],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[e].qMatrix.length;y++){const x=a.qDataPages[e].qArea.qTop+y,v=Ye({qRow:x},o(a.qDataPages[e].qMatrix[y])),b=Ge(u,v,{key:s});if(!(u.filter&&!u.filter(v))){for(let t=0;t<h.length;t++){const i=c[h[t]];let r=i.fields||[i];i.fields&&(b[h[t]]=[]);for(let o=0;o<r.length;o++)Ke({cache:n,f:l,mainCell:v,p:r[o],prop:h[t],props:c,page:a.qDataPages[e],rowIdx:x,row:a.qDataPages[e].qMatrix[y],sourceKey:s,target:i.fields?b[h[t]]:b,targetProp:i.fields?o:h[t],columnOrder:a.qColumnOrder});if(i.fields){const e=b[h[t]].map((t=>t.value)),n=b[h[t]].map((t=>t.label));b[h[t]]={value:"function"==typeof i.value?i.value(e):void 0!==i.value?i.value:e,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(b[h[t]].value)}}}d&&i.track({cfg:r[t],itemData:v,obj:b,target:g,tracker:p,trackType:f}),m.push(b)}}}const y=d?i.collect(g,{main:u,propsArr:h,props:c}):m;o=[...o,...y]}return o}function Je(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function Qe(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=en)):void 0===e&&(e=tn);for(var n,i,r,o,a,s=new on(t),l=[s];n=l.pop();)if((r=e(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new on(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(rn)}function tn(t){return t.children}function en(t){return Array.isArray(t)?t[1]:null}function nn(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function rn(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function on(t){this.data=t,this.depth=this.height=0,this.parent=null}function an(t){return null==t?null:function(t){if("function"!=typeof t)throw new Error;return t}(t)}on.prototype=Qe.prototype={constructor:on,count:function(){return this.eachAfter(Je)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)t.call(e,o,++l,this);return this},eachBefore:function(t,e){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(t.call(e,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop(),e=i.pop();for(;t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return Qe(this).eachBefore(nn)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)o.push(e[n])}while(o.length)}};var sn={depth:-1},ln={},cn={};function un(t){return t.id}function hn(t){return t.parentId}function dn(){var t,e=un,n=hn;function i(i){var r,o,a,s,l,c,u,h,d=Array.from(i),f=e,p=n,g=new Map;if(null!=t){const e=d.map(((e,n)=>function(t){t=`${t}`;let e=t.length;pn(t,e-1)&&!pn(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,i)))),n=e.map(fn),r=new Set(e).add("");for(const t of n)r.has(t)||(r.add(t),e.push(t),n.push(fn(t)),d.push(cn));f=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,r=d.length;a<r;++a)o=d[a],c=d[a]=new on(o),null!=(u=f(o,a,i))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?ln:c)),null!=(u=p(o,a,i))&&(u+="")&&(c.parent=u);for(a=0;a<r;++a)if(u=(c=d[a]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===ln)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=t){for(;s.data===cn&&1===s.children.length;)s=s.children[0],--r;for(let t=d.length-1;t>=0&&(c=d[t]).data===cn;--t)c.data=null}if(s.parent=sn,s.eachBefore((function(t){t.depth=t.parent.depth+1,--r})).eachBefore(rn),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(t){return arguments.length?(e=an(t),i):e},i.parentId=function(t){return arguments.length?(n=an(t),i):n},i.path=function(e){return arguments.length?(t=an(e),i):t},i}function fn(t){let e=t.length;if(e<2)return"";for(;--e>1&&!pn(t,e););return t.slice(0,e)}function pn(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function gn(t,e){"/"===t.charAt(0)&&(t=t.substring(1));const n=t.split("/");let i,r=e;for(let t=0;t<n.length;t++){if("*"===n[t]&&Array.isArray(r)){const e=[];i=n.slice(t+1).join("/");for(let t=0;t<r.length;t++){let n=gn(i,r[t]);Array.isArray(n)?e.push(...n):e.push(n)}return e}if(!n[t]&&Array.isArray(r)){const e=new Array(r.length);i=n.slice(t+1).join("/");for(let t=0;t<r.length;t++)e[t]=gn(i,r[t]);return e}n[t]in r&&(r=r[n[t]])}return r}function mn(t,e,n){let i=[];if(!t||!t.length)return i;if(e<=0){const e=n>=0?[t[n]]:t;i=[...i,...e]}else for(let r=0;r<t.length;r++)t[r].children&&t[r].children.length&&(i=[...i,...mn(t[r].children,e-1,n)]);return i}function yn(t,e,n){if(t===e)return t=>t;if(t>e){const n=Math.max(0,Math.min(100,t-e));return t=>{let e=t;for(let t=0;t<n;++t)e=e.parent;return e}}if(e>t){const i=Math.max(0,Math.min(100,e-t));return t=>mn(t.children,i-1,n)}return!1}const xn=/^qDimensionInfo(?:\/(\d+))?/,vn=/^\/?qMeasureInfo\/(\d+)/,bn=/\/qAttrExprInfo\/(\d+)/,wn=/\/qAttrDimInfo\/(\d+)/;function Mn(t){return(t.qColumnOrder&&t.qColumnOrder.length?t.qColumnOrder:t.qDimensionInfo.map(((t,e)=>e))).filter((e=>e<t.qDimensionInfo.length))}function kn(t,e){let{cube:n}=e;if(!t)return-1;let i=t.origin&&t.origin()?t.origin().key():t.key(),r=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=Mn(n);return xn.test(h)&&(r=!0,o=+xn.exec(h)[1],h=i.replace(xn,"")),vn.test(h)&&("K"===n.qMode?c=+vn.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+vn.exec(h)[1],u=0):u=+vn.exec(h)[1],h=h.replace(vn,"")),h&&(wn.exec(h)?s=+wn.exec(h)[1]:bn.exec(h)&&(a=+bn.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function _n(t,e){let n,i,r=yn(t.fieldDepth,e.fieldDepth,e.pseudoMeasureIndex);return n=e.measureIdx>=0?t=>t.data.qValues[e.measureIdx]:t=>t.data,e.attrDimIdx>=0?i=t=>{var n;return null==t||null===(n=t.qAttrDims)||void 0===n?void 0:n.qValues[e.attrDimIdx]}:e.attrIdx>=0&&(i=t=>{var n;return null==t||null===(n=t.qAttrExps)||void 0===n?void 0:n.qValues[e.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function Sn(t,e,n){let{key:i}=n;const r={value:"function"==typeof t.value?t.value(e):void 0!==t.value?t.value:e};return r.label="function"==typeof t.label?t.label(e):void 0!==t.label?String(t.label):String(r.value),t.field&&(r.source={key:i,field:t.field.key()}),r}function Nn(t){let{propsArr:e,props:n,item:i,itemData:r,ret:o,sourceKey:a}=t;for(let t=0;t<e.length;t++){const s=n[e[t]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=t=>h.value(t,i)),"function"==typeof h.label&&(f=t=>h.label(t,i)),h.accessor?(g=h.accessor(i),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=r,y=r)),s.fields){const t=d?d(p):p;c.push(t),u.push(f&&null!=y?f(y):null!=y?y:String(t))}else{const n=d?d(p):p;o[e[t]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[e[t]].source={field:h.field.key(),key:a})}}c&&(o[e[t]]={value:"function"==typeof s.value?s.value(c,i):c,label:"function"==typeof s.label?s.label(u,i):u})}}const Rn=(t,e,n)=>{const i="K"===t.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===t.qMode?"qSubNodes":"qNodes",o=gn(i,t);return o&&o[0]?(e.tree=Qe(o[0],n.children||(t=>t[r])),e.tree):null};const An=t=>{let{propsArr:e,props:n,cube:i,cache:r,itemDepthObject:o,f:a}=t;for(let t=0;t<e.length;t++){const s=n[e[t]],l=s.fields?s.fields:[s];for(let t=0;t<l.length;t++){const e=l[t];if(e.field!==a){const t=_n(o,kn(e.field,{cube:i,cache:r}));e.accessor=t.nodeFn,e.valueAccessor=t.valueFn,e.attrAccessor=t.attrFn}}}};function Cn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=e.raw(),o=e.key(),a="S"===r.qMode?function(t){const e=t.raw().qDataPages.length?t.raw().qDataPages[0].qMatrix:[],n=function(t){const e=t.raw().qColumnOrder,n=t.fields();return e&&e.length===n.length?e:n.map(((t,e)=>e))}(t),i=t.fields(),r=t.fields().filter((t=>"dimension"===t.type())).map((t=>n.indexOf(i.indexOf(t)))),o=t.fields().filter((t=>"measure"===t.type())).map((t=>n.indexOf(i.indexOf(t)))),a={__root:{__id:"__root",qValues:[]}};for(let t=0;t<e.length;t++){const n=e[t];let i="__root",l=!1;for(let t=0;t<r.length;t++){var s;const e=n[r[t]],o="".concat(i,"__").concat(null!==(s=e.qElemNumber)&&void 0!==s?s:e.qElemNo);a[o]||(a[o]=Le({__id:o,__parent:i,qValues:[]},e),l=!0),i=o}if(l)for(let t=0;t<o.length;t++){const e=n[o[t]];a[i].qValues.push(e)}}const l=Object.keys(a).map((t=>a[t])),c=dn().id((t=>t.__id)).parentId((t=>t.__parent))(l);return c}(e):Rn(r,n,t);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===r.qMode){let t=Mn(r)[o-1];a=n.fields[t]}else{let t=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(t=r.qDimensionInfo.length),a=n.fields[t]}const{props:s,main:c}=i.normalizeConfig(Le(Le({},t),{},{field:a?a.key():void 0}),e),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const h=a?kn(a,{cube:r,cache:n}):{fieldDepth:0};An({propsArr:u,props:s,cube:r,cache:n,itemDepthObject:h,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let t=0;t<u.length;t++){const e=l[u[t].depth].propsArr,n=l[u[t].depth].props,i=l[u[t].depth].main,r=c[t],a=r.data,s=Sn(i,a,{key:o});Nn({propsArr:e,props:n,item:r,itemData:a,ret:s,sourceKey:o,isTree:!0}),u[t].data=s}return a}function Dn(t,e,n,i){const r=Array.isArray(t)?t:[t];let o=[];for(let a=0;a<r.length;a++)if(void 0!==r[a].field){const s=e.raw(),l=e.key();if(!Rn(s,n,t))continue;const c="object"==typeof r[a].field?r[a].field:e.field(r[a].field),{props:u,main:h}=i.normalizeConfig(r[a],e),d=Object.keys(u),f=kn(c,{cube:s,cache:n}),{nodeFn:p,attrFn:g,valueFn:m}=_n({fieldDepth:0},f);An({propsArr:d,props:u,cube:s,cache:n,itemDepthObject:f,f:c});const y=!!r[a].trackBy,x=typeof r[a].trackBy,v={},b=[],w=p(n.tree),M=[];for(let t=0;t<w.length;t++){const e=w[t],n=g?g(m(e)):m(e);if(h.filter&&!h.filter(n))continue;const o=Sn(h,n,{key:l});Nn({propsArr:d,props:u,item:e,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[a],itemData:n,obj:o,target:b,tracker:v,trackType:x}),M.push(o)}const k=y?i.collect(b,{main:h,propsArr:d,props:u}):M;o=[...o,...k]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var On=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){
10
+ /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
11
+ t.exports=function(t,e){if(!t||isNaN(+e))return e;var n,i,r,o,a,s,l,c,u,h,d=t.length,f=t.search(/[0-9\-\+#]/),p=f>0?t.substring(0,f):"",g=t.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,x=t.substring(y,y+1),v=y+("."===x||","===x?1:0),b=m>0?t.substring(v,d):"";if(n=(e="-"===(t=t.substring(f,v)).charAt(0)?-e:+e)<0?e=-e:0,r=(i=t.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",t=t.split(r),e=+(e=e.toFixed(t[1]&&t[1].length))+"",s=t[1]&&t[1].lastIndexOf("0"),(!(c=e.split("."))[1]||c[1]&&c[1].length<=s)&&(e=(+e).toFixed(s+1)),u=t[0].split(o),t[0]=u.join(""),(a=t[0]&&t[0].indexOf("0"))>-1)for(;c[0].length<t[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((e=e.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=e[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);e[0]=g}return e[1]=t[1]&&e[1]?r+e[1]:"","0"!==(i=e.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}}));function En(t){return t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const zn={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},In=/%\)?$/,Tn=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Pn=/^\(oct\)/i,qn=/^\(dec\)/i,Ln=/^\(hex\)/i,jn=/^\(bin\)/i,Fn=/^\(rom\)/i,Bn=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Vn=/#|0/g;function $n(t,e,n,i){return t=t.toString(e),n[1]===n[1].toUpperCase()&&(t=t.toUpperCase()),t.length-t.indexOf(".")>10&&(t=t.slice(0,t.indexOf(".")+11)),t.replace(".",i||".")}function Hn(t,e,n){let i;return Tn.test(e)?t=$n(t,Number(/\d{2}/.exec(e)[0]),e,n):Pn.test(e)?t=$n(t,8,e,n):qn.test(e)?t=$n(t,10,e,n):Ln.test(e)?t=$n(t,16,e,n):jn.test(e)?t=$n(t,2,e,n):Fn.test(e)&&(i="",t<0&&(i="-",t=-t),0===(t=Math.floor(t))?t="0":t<=5e5?(t=function(t,e){let n,i="",r=Number(String(t).slice(-3)),o=(t-r)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<a.length;n++)if(a[n]<=r){i+=s[n],r-=a[n];break}for(n=0;n<o;n++)i="M".concat(i);return e[1]!==e[1].toUpperCase()&&(i=i.toLowerCase()),i}(t,e),t=i+t):t=e+i+t.toExponential(0)),t}function Wn(t,e,n){const i=En(t);return n?i:new RegExp(i||"",e)}function Un(t,e,n,i){let r,o,a,s,l,c,u,h,d,f=t.pattern;var p,g;i&&(t.abbreviate=!0),p=e,(g=n)&&(g=En(g)),p&&(p=En(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(g,"[#0]+)?")),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),e&&e===n&&(r=a.split(n),o=r.pop(),a=r.join("")+n+o,e=""),c=e,e=/,/.test(n)?"¤":",",c&&(a=a.replace(Wn(c,"g"),e)),u=n,n=".",u&&(a=a.replace(Wn(u,"g"),n)),h=a.match(/#/g),h=h?h.length:0;const m=f.split(u);let y;m[1]&&(y=m[1].match(Vn)),t.prefix=s||"",t.postfix=l||"",t.pattern=f,t.maxPrecision=y?y.length:2,t.percentage=In.test(f),t.numericPattern=a||"",t.numericRegex=new RegExp("".concat(Wn(e,null,!0),"|").concat(Wn(n,null,!0)),"g"),t.groupTemp=c,t.decTemp=u,t.t=e,t.d=n,t.temp=h}class Yn{constructor(t,e,n,i,r){this.localeInfo=t,this.pattern=e,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(t,e){if(!t||!t.qNumericalAbbreviation)return zn;const n={};return t.qNumericalAbbreviation.split(e).forEach((t=>{let e=t.split(":");2===e.length&&(n[e[0]]=e[1])})),n}(t,this.patternSeparator),this.prepare()}clone(){const t=new Yn(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}format(t,e,n,i){return this.prepare(e,n,i),this.formatValue(t)}prepare(t,e,n){let i;if(void 0===t&&(t=this.pattern),void 0===e&&(e=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!t)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:e,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:e,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:e,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,t=t.split(this.patternSeparator),i.positive.pattern=t[0],i.negative.pattern=t[1],i.zero.pattern=t[2],Bn.test(t[0])&&(i.positive.isFunctional=!0),t[1]?Bn.test(t[1])&&(i.negative.isFunctional=!0):i.negative=!1,t[2]?Bn.test(t[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Un(i.positive,e,n,r),i.negative&&!i.negative.isFunctional&&Un(i.negative,e,n,r),i.zero&&!i.zero.isFunctional&&Un(i.zero,e,n,r)}formatValue(t){let e,n,i,r,o,a,s,l,c,u=this._prepared,h="",d="",f=t;if(isNaN(t))return"".concat(f);if(t=+t,!1===u.pattern)return t.toString();if(0===t&&u.zero)return u=u.zero,u.pattern;if(t<0&&u.negative?(u=u.negative,t=-t):u=u.positive,o=u.d,a=u.t,u.isFunctional)t=Hn(t,u.pattern,o);else{if(u.percentage&&(t*=100),u.abbreviate){const e=Object.keys(this.abbreviations).map((t=>parseInt(t,10))).sort(((t,e)=>t-e));let i,r,o=e[0];for(s=0,n=Number(Number(t).toExponential().split("e")[1]);o<=n&&s<e.length;)s++,o=e[s];s>0&&(i=e[s-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],t/=10**r)}if(i=Math.abs(t),e=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(t=Math.round(t)),r=t,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)t=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const e=Number((t+1e-15*(t<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,t=On(n,e)||"0",c){const e=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(e).slice(2).replace(/0+$/,"");for(s=r.length;s<n;s++)r+="0";r&&(t+=o+r)}else 0===e&&(r=0)}else if(i>=10**e||i<1||i<1e-4)0===t?t="0":i<1e-4||i>=1e20?(t=(t=r.toExponential(Math.max(1,Math.min(14,e))-1)).replace(/\.?0+(?=e)/,""),d=""):(t=t.toPrecision(Math.max(1,Math.min(14,e)))).indexOf(".")>=0&&(t=(t=t.replace(t.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,e=Math.max(0,Math.min(20,e-Math.ceil(Math.log(i)/Math.log(10)))),s=0;s<e;s++)l+="#";t=On(l,t)}t=t.replace(u.numericRegex,(t=>t===a?u.groupTemp:t===o?u.decTemp:"")),r<0&&!/^-/.test(t)&&(t="-".concat(t))}return u.prefix+t+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:t=>"".concat(t)}}}function Xn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=t=>t}=e;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return a=r(...arguments),o.has(a)?o.get(a):o.set(a,t(...arguments))}:e=>(a=r(e),o.has(a)?o.get(a):o.set(a,t(e))),o.set=(t,e)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[t]=e,l[c]=t,c++,e),o.get=t=>s[t],o.has=t=>t in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function Gn(t,e,n,i,r){const o=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Yn(...e)}(r,t,e,n,i),a=Xn(o.formatValue.bind(o),{toKey:t=>isNaN(t)?t:+t});function s(t){return a(t)}return s.format=function(t,e,n,i){return a.clear(),o.format(e,t,n,i)},s.pattern=function(t){return t&&(a.clear(),o.pattern=t,o.prepare()),o.pattern},s}const Kn="D",Zn="T",Jn="TS",Qn="IV",ti=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ei=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ni=["January","February","March","April","May","June","July","August","September","October","November","December"],ii=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ri(t,e){for(let n=t.length;n<e;n++)t="0".concat(t);return t}function oi(t){let e=t.toString().split(".");return e[1]?(e=Number("0.".concat(e[1])),e):0}function ai(t,e){let n,i=function(t){const e=t,n=24*oi(e),i=60*oi(n),r=60*oi(i),o=1e3*oi(r);return{d:Math.floor(e),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(t),r=i.d,o=i.h,a=i.m,s=i.s,l=i.f,c=0;/w+|t+/gi.test(e)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(t),0,0,Math.round(86400*(t-Math.floor(t))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(e)||(o+=24*r),/h+/gi.test(e)||(a+=60*o),/m+/gi.test(e)||(s+=60*a),/w+/gi.test(e)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:a,s:s,f:l,t:u}}class si{constructor(t,e,n){const i=t||{};if(i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:ti,qDayNames:ei,qLongMonthNames:ni,qMonthNames:ii}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),!e){e={[Zn]:i.qTimeFmt||"hh:mm:ss",[Kn]:i.qDateFmt||"YYYY-MM-DD",[Jn]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=e}clone(){const t=new si(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}format(t,e){e||(e=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),e=e.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(e);let i;t instanceof Date?i=function(t,e){let n=t.getUTCHours(),i=t.getUTCDay()-1;return e&&(n%=12,n||(n=12)),i<0&&(i=6),{year:t.getUTCFullYear(),month:t.getUTCMonth(),day:i,date:t.getUTCDate(),h:n,m:t.getUTCMinutes(),s:t.getUTCSeconds(),f:t.getUTCMilliseconds(),t:t.getUTCHours()>=12?"pm":"am"}}(t,n):(t<0&&(t=-t,e="-".concat(e)),i=ai(t,e));const r=function(t,e){return{"Y+|y+":{Y:"".concat(Number("".concat(e.year).slice(-2))),YY:ri("".concat(e.year).slice(-2),2),YYY:ri("".concat(e.year).slice(-3),3),def:t=>ri("".concat(e.year),t.length)},"M+":{M:e.month+1,MM:ri("".concat(e.month+1),2),MMM:t.locale_months_abbr[e.month],def:t.locale_months[e.month]},"W+|w+":{W:e.day,WW:ri("".concat(e.day),2),WWW:t.locale_days_abbr[e.day],def:t.locale_days[e.day]},"D+|d+":{D:e.date,def:t=>ri("".concat(e.date),t.length)},"h+|H+":{h:e.h,def:t=>ri("".concat(e.h),t.length)},"m+":{m:e.m,def:t=>ri("".concat(e.m),t.length)},"s+|S+":{s:e.s,def:t=>ri("".concat(e.s),t.length)},"f+|F+":{def(t){let n="".concat(e.f),i=t.length-n.length;if(i>0)for(let t=0;t<i;t++)n+="0";else i<0&&(n=n.slice(0,t.length));return n}},"t{1,2}|T{1,2}":{def(t){let n=e.t;return t[0].toUpperCase()===t[0]&&(n=n.toUpperCase()),n=n.slice(0,t.length),n}}}}(this,i),o=[];for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&o.push(t);const a=new RegExp(o.join("|"),"g"),s=e.replace(a,(t=>{let e,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(e=new RegExp(n),e.test(t)))break;if(!e)return"";for(const e in r[n])if(e===t||e.toLowerCase()===t){i=r[n][e],void 0===i&&(i=r[n][e.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(t)),i}));return s}}function li(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new si(...e)}function ci(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=li(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,t,e),i=Xn(n.format.bind(n),{toKey:t=>"object"==typeof t&&"function"==typeof t.getTime?t.getTime():t});function r(t){return e!==Qn?function(t){return new Date(Date.UTC(1899,11,30+Math.floor(t),0,0,0,Math.round(864e5*(t-Math.floor(t)))))}(t):t}function o(t){return t=r(t),i(t)}return o.format=function(t,e){return i.clear(),e=r(e),n.format(e,t)},o.locale=function(r){return n=li(r,t,e),i=Xn(n.format.bind(n),{toKey:t=>"object"==typeof t?t.getTime():t}),this},o.qtype=function(t){return void 0!==t&&(e=t,i.clear()),e},o}function ui(){let t,{meta:e,id:n,key:i,localeInfo:r,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?t=>null==t?void 0:t.qElemNo:t=>null==t?void 0:t.qValue),u="dimension"===s?"first":"avg",h=function(t,e){if(t&&t.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(t.qNumFormat.qType))return ci(t.qNumFormat.qFmt,t.qNumFormat.qType,e);let n="#",i=e&&void 0!==e.qThousandSep?e.qThousandSep:",",r=e&&void 0!==e.qDecimalSep?e.qDecimalSep:".",o="U",a=t&&!!t.qIsAutoFormat;return t&&t.qNumFormat?(n=t.qNumFormat.qFmt||n,i=t.qNumFormat.qThou||i,r=t.qNumFormat.qDec||r,o=t.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(t.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(r,"##"),o="U"),Gn(n,i,r,o,e)}(e,r),d="dimension"===s?"first":(t,e)=>h(e),f={id:()=>n,key:()=>i,raw:()=>e,title:()=>e.qFallbackTitle||e.label,type:()=>s,origin:()=>l,items:()=>(t||(t=o(f)),t),min:()=>e.qMin,max:()=>e.qMax,value:c,label:t=>(null==t?void 0:t.qText)||"",reduce:u,reduceLabel:d,formatter:()=>h,tags:()=>e.qTags};return f}function hi(t,e,n,i,r){return(e[t]||[]).map(((e,o)=>{const a="".concat(i?"".concat(i,"/"):"").concat(t,"/").concat(o),s={instance:ui(Ye({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:e},r))};return s.attrDims=hi("qAttrDimInfo",e,n,a,Ye({},r,{value:t=>null==t?void 0:t.qElemNo,type:"dimension"})),s.attrExps=hi("qAttrExprInfo",e,n,a,Ye({},r,{value:t=>null==t?void 0:t.qNum,type:"measure"})),s.measures=hi("qMeasureInfo",e,n,a,Ye({},r,{value:t=>null==t?void 0:t.qValue,type:"measure"})),s}))}function di(){let{key:t,data:e,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},r=e;if(!r)throw new Error('Missing "data" input');if(!r.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=di.util,a={cache:i,cube:r,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>t,raw:()=>r,field:t=>function(t,e){let{cache:n}=e;if("number"==typeof t)return n.fields[t];const i=n.allFields;if("function"==typeof t){for(let e=0;e<i.length;e++)if(t(i[e]))return i[e];return!1}if("string"==typeof t){for(let e=0;e<i.length;e++)if(i[e].key()===t||i[e].title()===t)return i[e]}else if(t&&-1!==i.indexOf(t))return t;throw Error("Field not found: ".concat(t))}(t,a),fields:()=>i.fields.slice(),extract:t=>a.extractor(t,s,i,o),hierarchy:t=>a.hierarchy(t,s,i,o),_cache:()=>i};"K"===r.qMode||"T"===r.qMode||!r.qMode&&r.qNodesOnDim?(a.extractor=Dn,a.hierarchy=Cn,a.pages="K"===r.qMode?r.qStackedDataPages:r.qTreeDataPages):"S"===r.qMode?(a.extractor=Ze,a.pages=r.qDataPages,a.hierarchy=Cn):a.extractor=()=>[],a.fieldExtractor=t=>a.extractor({field:t},s,i,o);const l="S"===r.qMode?t=>t.qElemNumber:void 0,c="S"===r.qMode?t=>t.qNum:void 0;i.wrappedFields.push(...hi("qDimensionInfo",r,t,"",Ye({},a,{value:l,type:"dimension"}))),i.wrappedFields.push(...hi("qMeasureInfo",r,t,"",Ye({},a,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((t=>t.instance));const u=t=>{t.forEach((t=>{i.allFields.push(t.instance),u(t.measures),u(t.attrDims),u(t.attrExps)}))};return u(i.wrappedFields),(n.virtualFields||[]).forEach((e=>{const n=s.field(e.from),r=ui(Le({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:t=>a.extractor({field:t},s,i,o),key:e.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},e.override||{}));i.virtualFields.push(r)})),i.allFields.push(...i.virtualFields),s}const fi=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],pi=/\/qDimensionInfo(?:\/(\d+))?/,gi=/\/qMeasureInfo\/(\d+)/,mi=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,yi=/\/qAttrExprInfo\/(\d+)/,xi=/\/?qHyperCube/,vi=/\/?qTreeData/,bi=t=>"".concat(t.substr(0,t.indexOf("/qHyperCubeDef")+14)),wi=t=>"".concat(t.substr(0,t.indexOf("/qTreeDataDef")+13));function Mi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=e.byCells,r=e.primarySource,o=[],a={},s=t.isActive();let l=!1;if(t.brushes().forEach((t=>{const e=function(t,e){let n=t,i=-1,r=-1,o="",a=t=>t;xi.test(t)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=bi):vi.test(t)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=wi);let s=!0;if(pi.test(t)&&(i=+pi.exec(t)[1]),gi.test(t)&&(r=+gi.exec(t)[1]),mi.test(t)){r=-1,i=0;const t=+mi.exec(n)[2];isNaN(t)||(i=t,n=n.replace(/\/\d+$/,"")),s=!1}if(yi.test(t)){const t=r;if(e){r=0;const a=gn(o,e);r+=(a.qMeasureInfo||[]).length,i>-1?(r=a.qDimensionInfo.slice(0,i).reduce(((t,e)=>t+e.qAttrExprInfo.length),r),i=-1):(r=a.qDimensionInfo.reduce(((t,e)=>t+e.qAttrExprInfo.length),r),r=a.qMeasureInfo.slice(0,t).reduce(((t,e)=>t+e.qAttrExprInfo.length),r)),r+=+yi.exec(n)[1]}else i>-1?(i=-1,r=+yi.exec(n)[1]):r+=+yi.exec(n)[1]+1}return fi.forEach((t=>{let[e,i]=t;n=n.replace(e,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(t.id,n);if("range"===t.type&&e.measureIdx>-1&&e.dimensionIdx>-1){const n=t.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:e.path,ranges:[]}),n.forEach((t=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:e.measureIdx,qDimensionIx:e.dimensionIdx,qRange:{qMin:t.min,qMax:t.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===t.type&&e.measureIdx>-1){const n=t.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:e.path,ranges:[]}),n.forEach((t=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:e.measureIdx,qRange:{qMin:t.min,qMax:t.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===t.type&&e.dimensionIdx>-1){const n=t.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:e.path,ranges:[]}),n.forEach((t=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:e.dimensionIdx,qRange:{qMin:t.min,qMax:t.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===t.type&&e.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,s=i.qEffectiveInterColumnSortOrder.indexOf(e.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:e.path,cells:[]}),t.id===r||!r){const n=t.brush.values().map((t=>+t)).filter((t=>!isNaN(t)));(0===o||s>=o)&&o>-1?n.forEach((t=>{a.selectPivotCells.cells.push({qType:"T",qCol:t,qRow:s-o})})):n.forEach((t=>{a.selectPivotCells.cells.push({qType:"L",qCol:e.dimensionIdx,qRow:t})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:e.path,cols:[]}),a.selectHyperCubeCells.cols.push(e.dimensionIdx),t.id!==r&&(r||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=t.brush.values().map((t=>+t)).filter((t=>!isNaN(t))),l=!!a.selectHyperCubeCells.values.length);else{const n=t.brush.values().map((t=>+t)).filter((t=>!isNaN(t)));l=!!n.length,o.push({params:[e.path,e.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=e.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function ki(t){di.util=t.data("matrix").util,t.data("q",di),t.formatter("q-number",Gn),t.formatter("q-time",ci)}ki.qBrushHelper=Mi,ki.selections=Mi;var _i=Object.prototype.hasOwnProperty,Si=Object.prototype.toString,Ni=Object.defineProperty,Ri=Object.getOwnPropertyDescriptor,Ai=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===Si.call(t)},Ci=function(t){if(!t||"[object Object]"!==Si.call(t))return!1;var e,n=_i.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&_i.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;for(e in t);return void 0===e||_i.call(t,e)},Di=function(t,e){Ni&&"__proto__"===e.name?Ni(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},Oi=function(t,e){if("__proto__"===e){if(!_i.call(t,e))return;if(Ri)return Ri(t,e).value}return t[e]},Ei=function t(){var e,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(e=arguments[l]))for(n in e)i=Oi(s,n),s!==(r=Oi(e,n))&&(u&&r&&(Ci(r)||(o=Ai(r)))?(o?(o=!1,a=i&&Ai(i)?i:[]):a=i&&Ci(i)?i:{},Di(s,{name:n,newValue:t(u,a,r)})):void 0!==r&&Di(s,{name:n,newValue:r}));return s},zi="2.6.0";function Ii(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ti(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Pi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ti(Object(n),!0).forEach((function(e){Ii(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ti(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function qi(t){return!!t.changedTouches}function Li(t){return"number"==typeof t&&!isNaN(t)}function ji(t){return"number"!=typeof t||isNaN(t)}function Fi(t){const e=t.length;let n=NaN,i=NaN,r=NaN,o=NaN;for(let a=0;a<e;a++)n=isNaN(n)?t[a].x:Math.min(n,t[a].x),i=isNaN(i)?t[a].x:Math.max(i,t[a].x),r=isNaN(r)?t[a].y:Math.min(r,t[a].y),o=isNaN(o)?t[a].y:Math.max(o,t[a].y);return[n,r,i,o]}function Bi(t){return[{x:t.x1||0,y:t.y1||0},{x:t.x2||0,y:t.y2||0}]}function Vi(t){return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}]}function $i(t){const[e,n,i,r]=Fi(t);return{x:e,y:n,width:i-e,height:r-n}}function Hi(t){return{x1:t[0].x,y1:t[0].y,x2:t[1].x,y2:t[1].y}}function Wi(t){const{x:e,y:n,width:i,height:r,x1:o,x2:a,y1:s,y2:l,cx:c,cy:u,r:h,vertices:d}=t||{};return Li(c)&&Li(u)&&Li(h)?"circle":Li(o)&&Li(a)&&Li(s)&&Li(l)?"line":Li(e)&&Li(n)&&Li(i)&&Li(r)?"rect":Li(e)&&Li(n)?"point":Array.isArray(d)?d.every((t=>Array.isArray(t)))?"geopolygon":"polygon":null}function Ui(t,e){return{x:e.x-t,y:e.y-t,width:e.width+t,height:e.height+t}}var Yi=Math.PI,Xi=2*Yi,Gi=1e-6,Ki=Xi-Gi;function Zi(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ji(){return new Zi}function Qi(t){return function(){return t}}Zi.prototype=Ji.prototype={constructor:Zi,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var o=this._x1,a=this._y1,s=n-t,l=i-e,c=o-t,u=a-e,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>Gi)if(Math.abs(u*s-l*c)>Gi&&r){var d=n-o,f=i-a,p=s*s+l*l,g=d*d+f*f,m=Math.sqrt(p),y=Math.sqrt(h),x=r*Math.tan((Yi-Math.acos((p+h-g)/(2*m*y)))/2),v=x/y,b=x/m;Math.abs(v-1)>Gi&&(this._+="L"+(t+v*c)+","+(e+v*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>c*f)+","+(this._x1=t+b*s)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(i),s=n*Math.sin(i),l=t+a,c=e+s,u=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>Gi||Math.abs(this._y1-c)>Gi)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%Xi+Xi),h>Ki?this._+="A"+n+","+n+",0,1,"+u+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>Gi&&(this._+="A"+n+","+n+",0,"+ +(h>=Yi)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var tr=Math.abs,er=Math.atan2,nr=Math.cos,ir=Math.max,rr=Math.min,or=Math.sin,ar=Math.sqrt,sr=1e-12,lr=Math.PI,cr=lr/2,ur=2*lr;function hr(t){return t>=1?cr:t<=-1?-cr:Math.asin(t)}function dr(t){return t.innerRadius}function fr(t){return t.outerRadius}function pr(t){return t.startAngle}function gr(t){return t.endAngle}function mr(t){return t&&t.padAngle}function yr(t,e,n,i,r,o,a){var s=t-n,l=e-i,c=(a?o:-o)/ar(s*s+l*l),u=c*l,h=-c*s,d=t+u,f=e+h,p=n+u,g=i+h,m=(d+p)/2,y=(f+g)/2,x=p-d,v=g-f,b=x*x+v*v,w=r-o,M=d*g-p*f,k=(v<0?-1:1)*ar(ir(0,w*w*b-M*M)),_=(M*v-x*k)/b,S=(-M*x-v*k)/b,N=(M*v+x*k)/b,R=(-M*x+v*k)/b,A=_-m,C=S-y,D=N-m,O=R-y;return A*A+C*C>D*D+O*O&&(_=N,S=R),{cx:_,cy:S,x01:-u,y01:-h,x11:_*(r/w-1),y11:S*(r/w-1)}}function xr(){var t=dr,e=fr,n=Qi(0),i=null,r=pr,o=gr,a=mr,s=null;function l(){var l,c,u=+t.apply(this,arguments),h=+e.apply(this,arguments),d=r.apply(this,arguments)-cr,f=o.apply(this,arguments)-cr,p=tr(f-d),g=f>d;if(s||(s=l=Ji()),h<u&&(c=h,h=u,u=c),h>sr)if(p>ur-sr)s.moveTo(h*nr(d),h*or(d)),s.arc(0,0,h,d,f,!g),u>sr&&(s.moveTo(u*nr(f),u*or(f)),s.arc(0,0,u,f,d,g));else{var m,y,x=d,v=f,b=d,w=f,M=p,k=p,_=a.apply(this,arguments)/2,S=_>sr&&(i?+i.apply(this,arguments):ar(u*u+h*h)),N=rr(tr(h-u)/2,+n.apply(this,arguments)),R=N,A=N;if(S>sr){var C=hr(S/u*or(_)),D=hr(S/h*or(_));(M-=2*C)>sr?(b+=C*=g?1:-1,w-=C):(M=0,b=w=(d+f)/2),(k-=2*D)>sr?(x+=D*=g?1:-1,v-=D):(k=0,x=v=(d+f)/2)}var O=h*nr(x),E=h*or(x),z=u*nr(w),I=u*or(w);if(N>sr){var T,P=h*nr(v),q=h*or(v),L=u*nr(b),j=u*or(b);if(p<lr&&(T=function(t,e,n,i,r,o,a,s){var l=n-t,c=i-e,u=a-r,h=s-o,d=h*l-u*c;if(!(d*d<sr))return[t+(d=(u*(e-o)-h*(t-r))/d)*l,e+d*c]}(O,E,L,j,P,q,z,I))){var F=O-T[0],B=E-T[1],V=P-T[0],$=q-T[1],H=1/or(function(t){return t>1?0:t<-1?lr:Math.acos(t)}((F*V+B*$)/(ar(F*F+B*B)*ar(V*V+$*$)))/2),W=ar(T[0]*T[0]+T[1]*T[1]);R=rr(N,(u-W)/(H-1)),A=rr(N,(h-W)/(H+1))}}k>sr?A>sr?(m=yr(L,j,O,E,h,A,g),y=yr(P,q,z,I,h,A,g),s.moveTo(m.cx+m.x01,m.cy+m.y01),A<N?s.arc(m.cx,m.cy,A,er(m.y01,m.x01),er(y.y01,y.x01),!g):(s.arc(m.cx,m.cy,A,er(m.y01,m.x01),er(m.y11,m.x11),!g),s.arc(0,0,h,er(m.cy+m.y11,m.cx+m.x11),er(y.cy+y.y11,y.cx+y.x11),!g),s.arc(y.cx,y.cy,A,er(y.y11,y.x11),er(y.y01,y.x01),!g))):(s.moveTo(O,E),s.arc(0,0,h,x,v,!g)):s.moveTo(O,E),u>sr&&M>sr?R>sr?(m=yr(z,I,P,q,u,-R,g),y=yr(O,E,L,j,u,-R,g),s.lineTo(m.cx+m.x01,m.cy+m.y01),R<N?s.arc(m.cx,m.cy,R,er(m.y01,m.x01),er(y.y01,y.x01),!g):(s.arc(m.cx,m.cy,R,er(m.y01,m.x01),er(m.y11,m.x11),!g),s.arc(0,0,u,er(m.cy+m.y11,m.cx+m.x11),er(y.cy+y.y11,y.cx+y.x11),g),s.arc(y.cx,y.cy,R,er(y.y11,y.x11),er(y.y01,y.x01),!g))):s.arc(0,0,u,w,b,g):s.lineTo(z,I)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-lr/2;return[nr(i)*n,or(i)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Qi(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Qi(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Qi(+t),l):n},l.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Qi(+t),l):i},l.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Qi(+t),l):r},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Qi(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Qi(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function vr(t){this._context=t}function br(t){return new vr(t)}function wr(t){return t[0]}function Mr(t){return t[1]}function kr(){var t=wr,e=null,n=Qi(0),i=Mr,r=Qi(!0),o=null,a=br,s=null;function l(l){var c,u,h,d,f,p=l.length,g=!1,m=new Array(p),y=new Array(p);for(null==o&&(s=a(f=Ji())),c=0;c<=p;++c){if(!(c<p&&r(d=l[c],c,l))===g)if(g=!g)u=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=c-1;h>=u;--h)s.point(m[h],y[h]);s.lineEnd(),s.areaEnd()}g&&(m[c]=+t(d,c,l),y[c]=+n(d,c,l),s.point(e?+e(d,c,l):m[c],i?+i(d,c,l):y[c]))}if(f)return s=null,f+""||null}function c(){return function(){var t=wr,e=Mr,n=Qi(!0),i=null,r=br,o=null;function a(a){var s,l,c,u=a.length,h=!1;for(null==i&&(o=r(c=Ji())),s=0;s<=u;++s)!(s<u&&n(l=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(l,s,a),+e(l,s,a));if(c)return o=null,c+""||null}return a.x=function(e){return arguments.length?(t="function"==typeof e?e:Qi(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:Qi(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:Qi(!!t),a):n},a.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),a):r},a.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),a):i},a}().defined(r).curve(a).context(o)}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:Qi(+n),e=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Qi(+e),l):t},l.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:Qi(+t),l):e},l.y=function(t){return arguments.length?(n="function"==typeof t?t:Qi(+t),i=null,l):n},l.y0=function(t){return arguments.length?(n="function"==typeof t?t:Qi(+t),l):n},l.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Qi(+t),l):i},l.lineX0=l.lineY0=function(){return c().x(t).y(n)},l.lineY1=function(){return c().x(t).y(i)},l.lineX1=function(){return c().x(e).y(n)},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:Qi(!!t),l):r},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}function _r(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function Sr(t){return t}vr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Nr=Array.prototype.slice;function Rr(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Ar(t){this._context=t}function Cr(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Dr(t,e){this._context=t,this._k=(1-e)/6}Ar.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Rr(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Rr(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Dr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Cr(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Cr(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Or=function t(e){function n(t){return new Dr(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Er(t,e){this._context=t,this._alpha=e}Er.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(t,e,n){var i=t._x1,r=t._y1,o=t._x2,a=t._y2;if(t._l01_a>sr){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>sr){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,o,a,t._x2,t._y2)}(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var zr=function t(e){function n(t){return e?new Er(t,e):new Dr(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Ir(t){return t<0?-1:1}function Tr(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),a=(n-t._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(Ir(o)+Ir(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Pr(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function qr(t,e,n){var i=t._x0,r=t._y0,o=t._x1,a=t._y1,s=(o-i)/3;t._context.bezierCurveTo(i+s,r+s*e,o-s,a-s*n,o,a)}function Lr(t){this._context=t}function jr(t){this._context=new Fr(t)}function Fr(t){this._context=t}function Br(t){this._context=t}function Vr(t){var e,n,i=t.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,o[i-1]=7,a[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(r[i-1]=a[i-1]/o[i-1],e=i-2;e>=0;--e)r[e]=(a[e]-r[e+1])/o[e];for(o[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)o[e]=2*t[e+1]-r[e+1];return[r,o]}function $r(t,e){this._context=t,this._t=e}function Hr(t,e){if((r=t.length)>1)for(var n,i,r,o=1,a=t[e[0]],s=a.length;o<r;++o)for(i=a,a=t[e[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Wr(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function Ur(t,e){return t[e]}function Yr(t){for(var e,n=-1,i=0,r=t.length,o=-1/0;++n<r;)(e=+t[n][1])>o&&(o=e,i=n);return i}function Xr(t){for(var e,n=0,i=-1,r=t.length;++i<r;)(e=+t[i][1])&&(n+=e);return n}function Gr(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",i=arguments.length>2?arguments[2]:void 0;const r={},o=t||{get:()=>{},has:()=>!1,default:()=>{}};function a(t,e){if(!t||"string"!=typeof t)throw new TypeError("Invalid argument: key must be a non-empty string");return!(t in r)&&(r[t]=e,!0)}function s(t){return r[t]||o.get(t)}function l(t,r){if(void 0!==r)return a(t,r);const o=s(t);return i&&void 0===o&&i.warn("".concat(t," does not exist in ").concat(n," registry")),o||s(e)}return e=o.default(),l.add=a,l.get=s,l.has=function(t){return!!r[t]||o.has(t)},l.remove=function(t){const e=r[t];return delete r[t],e},l.getKeys=function(){return Object.keys(r)},l.getValues=function(){return Object.keys(r).map((t=>r[t]))},l.default=function(t){return void 0!==t&&(e=t),e},l.register=a,l}function Kr(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Zr(t){return(t=Kr(Math.abs(t)))?t[1]:NaN}Lr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:qr(this,this._t0,Pr(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,qr(this,Pr(this,n=Tr(this,t,e)),n);break;default:qr(this,this._t0,n=Tr(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(jr.prototype=Object.create(Lr.prototype)).point=function(t,e){Lr.prototype.point.call(this,e,t)},Fr.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,o){this._context.bezierCurveTo(e,t,i,n,o,r)}},Br.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=Vr(t),r=Vr(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},$r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Jr,Qr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function to(t){if(!(e=Qr.exec(t)))throw new Error("invalid format: "+t);var e;return new eo({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function eo(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function no(t,e){var n=Kr(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}to.prototype=eo.prototype,eo.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var io={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>no(100*t,e),r:no,s:function(t,e){var n=Kr(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(Jr=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return o===a?i:o>a?i+new Array(o-a+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Kr(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ro(t){return t}var oo,ao,so,lo=Array.prototype.map,co=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function uo(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?ro:(e=lo.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,o=[],a=0,s=e[0],l=0;r>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),o.push(t.substring(r-=s,r+s)),!((l+=s+1)>i));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?ro:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(lo.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=to(t)).fill,n=t.align,h=t.sign,d=t.symbol,f=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,x=t.type;"n"===x?(g=!0,x="g"):io[x]||(void 0===m&&(m=12),y=!0,x="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var v="$"===d?r:"#"===d&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",b="$"===d?o:/[%p]/.test(x)?l:"",w=io[x],M=/[defgprs%]/.test(x);function k(t){var r,o,l,d=v,k=b;if("c"===x)k=w(t)+k,t="";else{var _=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),_&&0==+t&&"+"!==h&&(_=!1),d=(_?"("===h?h:c:"-"===h||"("===h?"":h)+d,k=("s"===x?co[8+Jr/3]:"")+k+(_&&"("===h?")":""),M)for(r=-1,o=t.length;++r<o;)if(48>(l=t.charCodeAt(r))||l>57){k=(46===l?a+t.slice(r+1):t.slice(r))+k,t=t.slice(0,r);break}}g&&!f&&(t=i(t,1/0));var S=d.length+t.length+k.length,N=S<p?new Array(p-S+1).join(e):"";switch(g&&f&&(t=i(N+t,N.length?p-k.length:1/0),N=""),n){case"<":t=d+t+k+N;break;case"=":t=d+N+t+k;break;case"^":t=N.slice(0,S=N.length>>1)+d+t+k+N.slice(S);break;default:t=N+d+t+k}return s(t)}return m=void 0===m?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return t+""},k}return{format:h,formatPrefix:function(t,e){var n=h(((t=to(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Zr(e)/3))),r=Math.pow(10,-i),o=co[8+i/3];return function(t){return n(r*t)+o}}}}!function(t){oo=uo(t),ao=oo.format,so=oo.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const ho=new Date,fo=new Date;function po(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=e=>(t(e=new Date(+e)),e),r.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),r.round=t=>{const e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),r.range=(n,i,o)=>{const a=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return a;let s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(s<n&&n<i);return a},r.filter=n=>po((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})),n&&(r.count=(e,i)=>(ho.setTime(+e),fo.setTime(+i),t(ho),t(fo),Math.floor(n(ho,fo))),r.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?e=>i(e)%t==0:e=>r.count(0,e)%t==0):r:null)),r}const go=6e4,mo=864e5,yo=6048e5,xo=po((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*go)/mo),(t=>t.getDate()-1));xo.range;const vo=po((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/mo),(t=>t.getUTCDate()-1));vo.range;const bo=po((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/mo),(t=>Math.floor(t/mo)));function wo(t){return po((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*go)/yo))}bo.range;const Mo=wo(0),ko=wo(1),_o=wo(2),So=wo(3),No=wo(4),Ro=wo(5),Ao=wo(6);function Co(t){return po((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/yo))}Mo.range,ko.range,_o.range,So.range,No.range,Ro.range,Ao.range;const Do=Co(0),Oo=Co(1),Eo=Co(2),zo=Co(3),Io=Co(4),To=Co(5),Po=Co(6);Do.range,Oo.range,Eo.range,zo.range,Io.range,To.range,Po.range;const qo=po((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));qo.every=t=>isFinite(t=Math.floor(t))&&t>0?po((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null,qo.range;const Lo=po((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));function jo(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Fo(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Bo(t){let e,n,i;function r(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<0?r=e+1:o=e}while(r<o)}return r}return 2!==t.length?(e=jo,n=(e,n)=>jo(t(e),n),i=(e,n)=>t(e)-n):(e=t===jo||t===Fo?t:Vo,n=t,i=t),{left:r,center:function(t,e,n=0,o=t.length){const a=r(t,e,n,o-1);return a>n&&i(t[a-1],e)>-i(t[a],e)?a-1:a},right:function(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<=0?r=e+1:o=e}while(r<o)}return r}}}function Vo(){return 0}Lo.every=t=>isFinite(t=Math.floor(t))&&t>0?po((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null,Lo.range;const $o=Bo(jo).right;Bo((function(t){return null===t?NaN:+t})).center;var Ho=$o;class Wo extends Map{constructor(t,e=Yo){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Uo(this,t))}has(t){return super.has(Uo(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const i=e(n);t.has(i)&&(n=t.get(i),t.delete(i));return n}(this,t))}}function Uo({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function Yo(t){return null!==t&&"object"==typeof t?t.valueOf():t}const Xo=Math.sqrt(50),Go=Math.sqrt(10),Ko=Math.sqrt(2);function Zo(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),a=o>=Xo?10:o>=Go?5:o>=Ko?2:1;let s,l,c;return r<0?(c=Math.pow(10,-r)/a,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*a,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=n&&n<2?Zo(t,e,2*n):[s,l,c]}function Jo(t,e,n){return Zo(t=+t,e=+e,n=+n)[2]}function Qo(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ta(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ea(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function na(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,a=t.shortDays,s=t.months,l=t.shortMonths,c=ca(r),u=ua(r),h=ca(o),d=ua(o),f=ca(a),p=ua(a),g=ca(s),m=ua(s),y=ca(l),x=ua(l),v={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Oa,e:Oa,f:Pa,g:Ya,G:Ga,H:Ea,I:za,j:Ia,L:Ta,m:qa,M:La,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:xs,s:vs,S:ja,u:Fa,U:Ba,V:$a,w:Ha,W:Wa,x:null,X:null,y:Ua,Y:Xa,Z:Ka,"%":ys},b={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Za,e:Za,f:ns,g:fs,G:gs,H:Ja,I:Qa,j:ts,L:es,m:is,M:rs,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:xs,s:vs,S:os,u:as,U:ss,V:cs,w:us,W:hs,x:null,X:null,y:ds,Y:ps,Z:ms,"%":ys},w={a:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=y.exec(e.slice(n));return i?(t.m=x.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return _(t,e,n,i)},d:wa,e:wa,f:Ra,g:ya,G:ma,H:ka,I:ka,j:Ma,L:Na,m:ba,M:_a,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:va,Q:Ca,s:Da,S:Sa,u:da,U:fa,V:pa,w:ha,W:ga,x:function(t,e,i){return _(t,n,e,i)},X:function(t,e,n){return _(t,i,e,n)},y:ya,Y:ma,Z:xa,"%":Aa};function M(t,e){return function(n){var i,r,o,a=[],s=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===t.charCodeAt(s)&&(a.push(t.slice(l,s)),null!=(r=ia[i=t.charAt(++s)])?i=t.charAt(++s):r="e"===i?" ":"0",(o=e[i])&&(i=o(n,r)),a.push(i),l=s+1);return a.push(t.slice(l,s)),a.join("")}}function k(t,e){return function(n){var i,r,o=ea(1900,void 0,1);if(_(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=ta(ea(o.y,0,1))).getUTCDay(),i=r>4||0===r?Oo.ceil(i):Oo(i),i=vo.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=Qo(ea(o.y,0,1))).getDay(),i=r>4||0===r?ko.ceil(i):ko(i),i=xo.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?ta(ea(o.y,0,1)).getUTCDay():Qo(ea(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,ta(o)):Qo(o)}}function _(t,e,n,i){for(var r,o,a=0,s=e.length,l=n.length;a<s;){if(i>=l)return-1;if(37===(r=e.charCodeAt(a++))){if(r=e.charAt(a++),!(o=w[r in ia?e.charAt(a++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return v.x=M(n,v),v.X=M(i,v),v.c=M(e,v),b.x=M(n,b),b.X=M(i,b),b.c=M(e,b),{format:function(t){var e=M(t+="",v);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=M(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var ia={"-":"",_:" ",0:"0"},ra=/^\s*\d+/,oa=/^%/,aa=/[\\^$*+?|[\]().{}]/g;function sa(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function la(t){return t.replace(aa,"\\$&")}function ca(t){return new RegExp("^(?:"+t.map(la).join("|")+")","i")}function ua(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function ha(t,e,n){var i=ra.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function da(t,e,n){var i=ra.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function fa(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function pa(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function ga(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function ma(t,e,n){var i=ra.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function ya(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function xa(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function va(t,e,n){var i=ra.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function ba(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function wa(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Ma(t,e,n){var i=ra.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function ka(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function _a(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function Sa(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Na(t,e,n){var i=ra.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Ra(t,e,n){var i=ra.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Aa(t,e,n){var i=oa.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function Ca(t,e,n){var i=ra.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Da(t,e,n){var i=ra.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Oa(t,e){return sa(t.getDate(),e,2)}function Ea(t,e){return sa(t.getHours(),e,2)}function za(t,e){return sa(t.getHours()%12||12,e,2)}function Ia(t,e){return sa(1+xo.count(qo(t),t),e,3)}function Ta(t,e){return sa(t.getMilliseconds(),e,3)}function Pa(t,e){return Ta(t,e)+"000"}function qa(t,e){return sa(t.getMonth()+1,e,2)}function La(t,e){return sa(t.getMinutes(),e,2)}function ja(t,e){return sa(t.getSeconds(),e,2)}function Fa(t){var e=t.getDay();return 0===e?7:e}function Ba(t,e){return sa(Mo.count(qo(t)-1,t),e,2)}function Va(t){var e=t.getDay();return e>=4||0===e?No(t):No.ceil(t)}function $a(t,e){return t=Va(t),sa(No.count(qo(t),t)+(4===qo(t).getDay()),e,2)}function Ha(t){return t.getDay()}function Wa(t,e){return sa(ko.count(qo(t)-1,t),e,2)}function Ua(t,e){return sa(t.getFullYear()%100,e,2)}function Ya(t,e){return sa((t=Va(t)).getFullYear()%100,e,2)}function Xa(t,e){return sa(t.getFullYear()%1e4,e,4)}function Ga(t,e){var n=t.getDay();return sa((t=n>=4||0===n?No(t):No.ceil(t)).getFullYear()%1e4,e,4)}function Ka(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+sa(e/60|0,"0",2)+sa(e%60,"0",2)}function Za(t,e){return sa(t.getUTCDate(),e,2)}function Ja(t,e){return sa(t.getUTCHours(),e,2)}function Qa(t,e){return sa(t.getUTCHours()%12||12,e,2)}function ts(t,e){return sa(1+vo.count(Lo(t),t),e,3)}function es(t,e){return sa(t.getUTCMilliseconds(),e,3)}function ns(t,e){return es(t,e)+"000"}function is(t,e){return sa(t.getUTCMonth()+1,e,2)}function rs(t,e){return sa(t.getUTCMinutes(),e,2)}function os(t,e){return sa(t.getUTCSeconds(),e,2)}function as(t){var e=t.getUTCDay();return 0===e?7:e}function ss(t,e){return sa(Do.count(Lo(t)-1,t),e,2)}function ls(t){var e=t.getUTCDay();return e>=4||0===e?Io(t):Io.ceil(t)}function cs(t,e){return t=ls(t),sa(Io.count(Lo(t),t)+(4===Lo(t).getUTCDay()),e,2)}function us(t){return t.getUTCDay()}function hs(t,e){return sa(Oo.count(Lo(t)-1,t),e,2)}function ds(t,e){return sa(t.getUTCFullYear()%100,e,2)}function fs(t,e){return sa((t=ls(t)).getUTCFullYear()%100,e,2)}function ps(t,e){return sa(t.getUTCFullYear()%1e4,e,4)}function gs(t,e){var n=t.getUTCDay();return sa((t=n>=4||0===n?Io(t):Io.ceil(t)).getUTCFullYear()%1e4,e,4)}function ms(){return"+0000"}function ys(){return"%"}function xs(t){return+t}function vs(t){return Math.floor(+t/1e3)}const bs=Gr();bs("d3-number",(function(t,e,n){let i,r;function o(t){return r(t)}function a(){o.locale({decimal:n||".",thousands:e||",",grouping:[3],currency:["$",""]})}return o.locale=function(e){return i=uo(e),r=i.format(t),this},a(),o.format=function(t,r,o,s){return(o||s)&&(e=o,n=s,a()),i.format(t)(r)},o.pattern=function(e){return e&&(t=e,r=i.format(e)),t},o})),bs("d3-time",(function(t){let e=na({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=e.format(t);function i(t){return n(t)}return i.format=function(t,n){return e.format(t)(n)},i.locale=function(){return e=na(...arguments),n=e.format(t),this},i.parse=function(t,n){return e.parse(t)(n)},i.parsePattern=function(t){return e.parse(t)},i}));const ws={id:t=>"".concat(t.source,"/").concat(t.key||t.title),key:t=>String(t.key||t.title),tags:t=>t.tags,min:t=>t.min,max:t=>t.max,type:t=>t.type,title:t=>String(t.title),values:t=>t.values,value:t=>t,label:t=>t,formatter:t=>(t=>{if("function"==typeof t.formatter)return t.formatter();const e=t.formatter||{};return bs(e.type||"d3-number")(e.format||"")})(t)};function Ms(t){let{id:e=ws.id,key:n=ws.key,min:i=ws.min,max:r=ws.max,type:o=ws.type,tags:a=ws.tags,title:s=ws.title,values:l=ws.values,value:c=ws.value,label:u=ws.label,formatter:h=ws.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>e(t),key:()=>n(t),raw:()=>t,tags:()=>a(t),type:()=>o(t),min:()=>i(t),max:()=>r(t),title:()=>s(t),items:()=>l(t),formatter:()=>h(t),value:c,label:u}}const ks=t=>t.filter((t=>"number"==typeof t&&!isNaN(t))),_s=t=>t.reduce(((t,e)=>t+e),0),Ss={first:t=>t[0],last:t=>t[t.length-1],min:t=>{const e=ks(t);return e.length?Math.min.apply(null,e):NaN},max:t=>{const e=ks(t);return e.length?Math.max.apply(null,e):NaN},sum:t=>{const e=ks(t);return e.length?e.reduce(((t,e)=>t+e),0):NaN},avg:t=>{const e=ks(t),n=e.length;return n?_s(e)/n:NaN}};function Ns(t,e,n,i){const r={},o=i.field||(void 0!==t.field?e.field(t.field):null);return Object.keys(n).forEach((a=>{const s=n[a],l=r[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map((n=>Ns(t,e,{main:n},i).main)):void 0!==s.field?(l.type="field",l.field=e.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=Ss[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?Ss[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=Ss[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?Ss[l.field.reduceLabel]:l.field.reduceLabel))})),r}function Rs(t,e){const{main:n}=Ns(t,e,{main:{value:t.value,label:t.label,reduce:t.reduce,filter:t.filter}},{});return{props:Ns(t,e,t.props||{},n),main:n}}function As(t,e,n,i){const r=Array(t.length),o=Array(t.length);let a;for(let e=0;e<t.length;e++)a=i?t[e][i]:t[e],r[e]=a.value,o[e]=a.label;const s=e.reduce,l=e.reduceLabel,c=s?s(r):r,u={value:c,label:l?l(o,c):n?n(c):String(c)};return i&&t[0][i].source?(u.source=t[0][i].source,u):!i&&t[0].source?(u.source=t[0].source,u):u}function Cs(t,e){let{main:n,propsArr:i,props:r}=e,o=[];const a=n.field.formatter(),s={};return i.forEach((t=>{s[t]=r[t].field?r[t].field.formatter():t=>t})),o.push(...t.map((t=>{const e=As(t.items,n,a);return i.forEach((n=>{e[n]=As(t.items,r[n],s[n],n)})),e}))),o}function Ds(t){let{cfg:e,itemData:n,obj:i,target:r,tracker:o,trackType:a}=t;const s="function"===a?e.trackBy(n):n[e.trackBy];let l=o[s];l||(l=o[s]={items:[],id:s},r.push(l)),l.items.push(i)}function Os(t){if(t.length<1e4)return Math.max(...t);let e=-1/0;const n=t.length;for(let i=0;i<n;i++)e<t[i]&&(e=t[i]);return e}function Es(t){if(t.length<1e4)return Math.min(...t);let e=1/0;const n=t.length;for(let i=0;i<n;i++)e>t[i]&&(e=t[i]);return e}const zs={diverging:function(t,e){if((s=t.length)>0)for(var n,i,r,o,a,s,l=0,c=t[e[0]].length;l<c;++l)for(o=a=0,n=0;n<s;++n)(r=(i=t[e[n]][l])[1]-i[0])>=0?(i[0]=o,i[1]=o+=r):r<0?(i[1]=a,i[0]=a+=r):i[0]=o},none:Hr,silhouette:function(t,e){if((n=t.length)>0){for(var n,i=0,r=t[e[0]],o=r.length;i<o;++i){for(var a=0,s=0;a<n;++a)s+=t[a][i][1]||0;r[i][1]+=r[i][0]=-s/2}Hr(t,e)}},expand:function(t,e){if((i=t.length)>0){for(var n,i,r,o=0,a=t[0].length;o<a;++o){for(r=n=0;n<i;++n)r+=t[n][o][1]||0;if(r)for(n=0;n<i;++n)t[n][o][1]/=r}Hr(t,e)}},wiggle:function(t,e){if((r=t.length)>0&&(i=(n=t[e[0]]).length)>0){for(var n,i,r,o=0,a=1;a<i;++a){for(var s=0,l=0,c=0;s<r;++s){for(var u=t[e[s]],h=u[a][1]||0,d=(h-(u[a-1][1]||0))/2,f=0;f<s;++f){var p=t[e[f]];d+=(p[a][1]||0)-(p[a-1][1]||0)}l+=h,c+=d*h}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,Hr(t,e)}}},Is={ascending:function(t){var e=t.map(Xr);return Wr(t).sort((function(t,n){return e[t]-e[n]}))},insideout:function(t){var e,n,i=t.length,r=t.map(Xr),o=function(t){var e=t.map(Yr);return Wr(t).sort((function(t,n){return e[t]-e[n]}))}(t),a=0,s=0,l=[],c=[];for(e=0;e<i;++e)n=o[e],a<s?(a+=r[n],l.push(n)):(s+=r[n],c.push(n));return c.reverse().concat(l)},none:Wr,reverse:function(t){return Wr(t).reverse()}};function Ts(t,e,n){const i={},r=e.stackKey,o=e.value,a=e.startProp||"start",s=e.endProp||"end",l=e.offset||"none",c=e.order||"none",u=e.valueRef||"";let h=0,d={};for(let e=0;e<t.items.length;e++){let n=t.items[e],o=u?n[u]:null;if(o&&o.source){let t="".concat(o.source.key||"","/").concat(o.source.field);d[t]||(d[t]=o.source)}let a=r(n);i[a]=i[a]||{items:[]},i[a].items.push(n),h=Math.max(h,i[a].items.length)}const f=Array.apply(null,{length:h}).map(Number.call,Number),p=Object.keys(i).map((t=>i[t].items)),g=function(){var t=Qi([]),e=Wr,n=Hr,i=Ur;function r(r){var o,a,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(o=0;o<c;++o){for(var h,d=s[o],f=u[o]=new Array(l),p=0;p<l;++p)f[p]=h=[0,+i(r[p],d,p,r)],h.data=r[p];f.key=d}for(o=0,a=e(u);o<c;++o)u[a[o]].index=o;return n(u,a),u}return r.keys=function(e){return arguments.length?(t="function"==typeof e?e:Qi(Nr.call(e)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:Qi(+t),r):i},r.order=function(t){return arguments.length?(e=null==t?Wr:"function"==typeof t?t:Qi(Nr.call(t)),r):e},r.offset=function(t){return arguments.length?(n=null==t?Hr:t,r):n},r}().keys(f).value(((t,e)=>t[e]?o(t[e]):0)).order(Is[c]).offset(zs[l]);let m=g(p),y=[];for(let t=0;t<m.length;t++){let e=m[t];for(let t=0;t<e.length;t++){let n=e[t],i=e[t].data[e.key];i&&(i[a]={value:n[0]},i[s]={value:n[1]},y.push(n[0],n[1]))}}let x=Object.keys(d).map((t=>{let e=n(d[t].key);return e?e.field(d[t].field):null})).filter((t=>!!t));const v=Ms({title:x.map((t=>t.title())).join(", "),min:Es(y),max:Os(y),type:"measure",formatter:x[0]?x[0].formatter:void 0});t.fields.push(v)}function Ps(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(t))n.items=t.map((t=>({value:t,label:String(t)})));else if(t){if("collection"in t)n=Pi({},e.collection(t.collection));else{const r=e.dataset?e.dataset(t.source):null;let o=t.value||(t=>t),a=t.label||(t=>t);if(t.groupBy||t.mapTo)i.warn('Deprecated "data" configuration',t),n.items=[];else if(t.hierarchy)n.root=r.hierarchy?r.hierarchy(t.hierarchy):null,n.fields=r.fields();else if(t.items)n.items=t.items.map((t=>({value:o(t),label:String(a(t))})));else if(t.extract){const i=Array.isArray(t.extract)?t.extract:[t.extract];n.items=[];const o=[];i.forEach((t=>{const i=t.source?e.dataset(t.source):r;i&&(n.items=[...n.items,...i.extract(t)],void 0!==t.field&&o.push(i.field(t.field)))})),o.length&&(n.fields=o),t.amend&&Array.isArray(t.amend)&&(n.items=[...n.items,...t.amend])}else if(void 0!==t.field&&r){const e=r.field(t.field);e&&(n.fields||(n.fields=[]),n.fields.push(e),"value"in t||(o=e.value||(t=>t),a=e.label||(t=>t),n.value=o),n.items=e.items().map((e=>({value:o(e),label:String(a(e)),source:{field:t.field}}))))}else t.fields&&t.fields.forEach((t=>{const i="object"==typeof t&&t.source?e.dataset(t.source):r;if(!i)return;let o;o="object"==typeof t&&void 0!==t.field?i.field(t.field):i.field(t),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&t.map&&(n.items=n.items.map(t.map))}t&&t.stack&&Ts(n,t.stack,e.dataset)}return t&&!Array.isArray(t)&&"function"==typeof t.filter&&n.items&&(n.items=n.items.filter(t.filter)),t&&!Array.isArray(t)&&"function"==typeof t.sort&&n.items&&(n.items=n.items.sort(t.sort)),n}function qs(t,e,n){let i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ps;if(t.data){const i=r(t.data,e,n);if(i&&i.fields&&i.fields[0])return i.fields[0].formatter()}if(i=t.formatter?"".concat(t.formatter,"-").concat(t.type||"number"):t.type||"d3-number",n.formatter.has(i)){return n.formatter.get(i)(t.format||"")}throw new Error("Formatter of type '".concat(i,"' was not found"))}function Ls(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}const js=Symbol("implicit");function Fs(){var t=new Wo,e=[],n=[],i=js;function r(r){let o=t.get(r);if(void 0===o){if(i!==js)return i;t.set(r,o=e.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Wo;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return Fs(e,n).unknown(i)},Ls.apply(r,arguments),r}function Bs(){var t,e,n=Fs().unknown(void 0),i=n.domain,r=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=a<o,d=h?a:o,f=h?o:a;t=(f-d)/Math.max(1,n-l+2*c),s&&(t=Math.floor(t)),d+=(f-d-t*(n-l))*u,e=t*(1-l),s&&(d=Math.round(d),e=Math.round(e));var p=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o}(n).map((function(e){return d+t*e}));return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([o,a]=t,o=+o,a=+a,h()):[o,a]},n.rangeRound=function(t){return[o,a]=t,o=+o,a=+a,s=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(s=!!t,h()):s},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return Bs(i(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},Ls.apply(h(),arguments)}function Vs(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function $s(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Hs(){}var Ws=.7,Us=1/Ws,Ys="\\s*([+-]?\\d+)\\s*",Xs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ks=/^#([0-9a-f]{3,8})$/,Zs=new RegExp(`^rgb\\(${Ys},${Ys},${Ys}\\)$`),Js=new RegExp(`^rgb\\(${Gs},${Gs},${Gs}\\)$`),Qs=new RegExp(`^rgba\\(${Ys},${Ys},${Ys},${Xs}\\)$`),tl=new RegExp(`^rgba\\(${Gs},${Gs},${Gs},${Xs}\\)$`),el=new RegExp(`^hsl\\(${Xs},${Gs},${Gs}\\)$`),nl=new RegExp(`^hsla\\(${Xs},${Gs},${Gs},${Xs}\\)$`),il={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function rl(){return this.rgb().formatHex()}function ol(){return this.rgb().formatRgb()}function al(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ks.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?sl(e):3===n?new ul(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ll(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ll(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Zs.exec(t))?new ul(e[1],e[2],e[3],1):(e=Js.exec(t))?new ul(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Qs.exec(t))?ll(e[1],e[2],e[3],e[4]):(e=tl.exec(t))?ll(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=el.exec(t))?ml(e[1],e[2]/100,e[3]/100,1):(e=nl.exec(t))?ml(e[1],e[2]/100,e[3]/100,e[4]):il.hasOwnProperty(t)?sl(il[t]):"transparent"===t?new ul(NaN,NaN,NaN,0):null}function sl(t){return new ul(t>>16&255,t>>8&255,255&t,1)}function ll(t,e,n,i){return i<=0&&(t=e=n=NaN),new ul(t,e,n,i)}function cl(t,e,n,i){return 1===arguments.length?function(t){return t instanceof Hs||(t=al(t)),t?new ul((t=t.rgb()).r,t.g,t.b,t.opacity):new ul}(t):new ul(t,e,n,null==i?1:i)}function ul(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function hl(){return`#${gl(this.r)}${gl(this.g)}${gl(this.b)}`}function dl(){const t=fl(this.opacity);return`${1===t?"rgb(":"rgba("}${pl(this.r)}, ${pl(this.g)}, ${pl(this.b)}${1===t?")":`, ${t})`}`}function fl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function pl(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function gl(t){return((t=pl(t))<16?"0":"")+t.toString(16)}function ml(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new xl(t,e,n,i)}function yl(t){if(t instanceof xl)return new xl(t.h,t.s,t.l,t.opacity);if(t instanceof Hs||(t=al(t)),!t)return new xl;if(t instanceof xl)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n<i):n===o?(i-e)/s+2:(e-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new xl(a,s,l,t.opacity)}function xl(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function vl(t){return(t=(t||0)%360)<0?t+360:t}function bl(t){return Math.max(0,Math.min(1,t||0))}function wl(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Vs(Hs,al,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:rl,formatHex:rl,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return yl(this).formatHsl()},formatRgb:ol,toString:ol}),Vs(ul,cl,$s(Hs,{brighter(t){return t=null==t?Us:Math.pow(Us,t),new ul(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ws:Math.pow(Ws,t),new ul(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ul(pl(this.r),pl(this.g),pl(this.b),fl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:hl,formatHex:hl,formatHex8:function(){return`#${gl(this.r)}${gl(this.g)}${gl(this.b)}${gl(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:dl,toString:dl})),Vs(xl,(function(t,e,n,i){return 1===arguments.length?yl(t):new xl(t,e,n,null==i?1:i)}),$s(Hs,{brighter(t){return t=null==t?Us:Math.pow(Us,t),new xl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ws:Math.pow(Ws,t),new xl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new ul(wl(t>=240?t-240:t+120,r,i),wl(t,r,i),wl(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new xl(vl(this.h),bl(this.s),bl(this.l),fl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=fl(this.opacity);return`${1===t?"hsl(":"hsla("}${vl(this.h)}, ${100*bl(this.s)}%, ${100*bl(this.l)}%${1===t?")":`, ${t})`}`}}));var Ml=t=>()=>t;function kl(t){return 1==(t=+t)?_l:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Ml(isNaN(e)?n:e)}}function _l(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Ml(isNaN(t)?e:t)}var Sl=function t(e){var n=kl(e);function i(t,e){var i=n((t=cl(t)).r,(e=cl(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=_l(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function Nl(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(o){for(n=0;n<i;++n)r[n]=t[n]*(1-o)+e[n]*o;return r}}function Rl(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),a=new Array(i);for(n=0;n<r;++n)o[n]=Il(t[n],e[n]);for(;n<i;++n)a[n]=e[n];return function(t){for(n=0;n<r;++n)a[n]=o[n](t);return a}}function Al(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Cl(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Dl(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=Il(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var Ol=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,El=new RegExp(Ol.source,"g");function zl(t,e){var n,i,r,o=Ol.lastIndex=El.lastIndex=0,a=-1,s=[],l=[];for(t+="",e+="";(n=Ol.exec(t))&&(i=El.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Cl(n,i)})),o=El.lastIndex;return o<e.length&&(r=e.slice(o),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)s[(n=l[i]).i]=n.x(t);return s.join("")})}function Il(t,e){var n,i=typeof e;return null==e||"boolean"===i?Ml(e):("number"===i?Cl:"string"===i?(n=al(e))?(e=n,Sl):zl:e instanceof al?Sl:e instanceof Date?Al:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?Nl:Array.isArray(e)?Rl:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Dl:Cl)(t,e)}function Tl(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Pl(t){return+t}var ql=[0,1];function Ll(t){return t}function jl(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function Fl(t,e,n){var i=t[0],r=t[1],o=e[0],a=e[1];return r<i?(i=jl(r,i),o=n(a,o)):(i=jl(i,r),o=n(o,a)),function(t){return o(i(t))}}function Bl(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<i;)r[a]=jl(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=Ho(t,e,1,i)-1;return o[n](r[n](e))}}function Vl(){var t,e,n,i,r,o,a=ql,s=ql,l=Il,c=Ll;function u(){var t=Math.min(a.length,s.length);return c!==Ll&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),i=t>2?Bl:Fl,r=o=null,h}function h(e){return null==e||isNaN(e=+e)?n:(r||(r=i(a.map(t),s,l)))(t(c(e)))}return h.invert=function(n){return c(e((o||(o=i(s,a.map(t),Cl)))(n)))},h.domain=function(t){return arguments.length?(a=Array.from(t,Pl),u()):a.slice()},h.range=function(t){return arguments.length?(s=Array.from(t),u()):s.slice()},h.rangeRound=function(t){return s=Array.from(t),l=Tl,u()},h.clamp=function(t){return arguments.length?(c=!!t||Ll,u()):c!==Ll},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,u()}}function $l(t,e,n,i){var r,o=function(t,e,n){n=+n;const i=(e=+e)<(t=+t),r=i?Jo(e,t,n):Jo(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}(t,e,n);switch((i=to(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Zr(e)/3)))-Zr(Math.abs(t)))}(o,a))||(i.precision=r),so(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Zr(e)-Zr(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-Zr(Math.abs(t)))}(o))||(i.precision=r-2*("%"===i.type))}return ao(i)}function Hl(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const i=e<t,[r,o,a]=i?Zo(e,t,n):Zo(t,e,n);if(!(o>=r))return[];const s=o-r+1,l=new Array(s);if(i)if(a<0)for(let t=0;t<s;++t)l[t]=(o-t)/-a;else for(let t=0;t<s;++t)l[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)l[t]=(r+t)/-a;else for(let t=0;t<s;++t)l[t]=(r+t)*a;return l}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return $l(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,o=e(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(r=l,l=c,c=r,r=a,a=s,s=r);u-- >0;){if((r=Jo(l,c,n))===i)return o[a]=l,o[s]=c,e(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function Wl(){var t=Vl()(Ll,Ll);return t.copy=function(){return e=t,Wl().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},Ls.apply(t,arguments),Hl(t)}function Ul(){var t,e=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[Ho(e,r,0,i)]:t}return r.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,n.length-1),r):e.slice()},r.range=function(t){return arguments.length?(n=Array.from(t),i=Math.min(e.length,n.length-1),r):n.slice()},r.invertExtent=function(t){var i=n.indexOf(t);return[e[i-1],e[i]]},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return Ul().domain(e).range(n).unknown(t)},Ls.apply(r,arguments)}function Yl(t){return void 0===t?t=>t:e=>t(e)}function Xl(t){return Math.max(0,Math.min(1,t))}function Gl(t){return"object"==typeof t}function Kl(t,e,n){const i=Math.abs(e-n)/(t+1),r=[];for(let o=1;o<=t;o++){const t=o*i;r.push(e<n?e+t:e-t)}return r}function Zl(t,e,n){if(1===t.length)return t;const i=t.concat([]);for(let r=0;r<t.length;r++){let o=t[r],a=t[r+1];0===r&&o!==n.start()?(i.push(...Kl(e,o,a)),o-=a-o,a=t[r],i.push(...Kl(e,o,a))):r===t.length-1&&a!==n.end()?(a=o+(o-t[r-1]),i.push(...Kl(e,o,a))):i.push(...Kl(e,o,a))}return i.filter((t=>t>=n.min()&&t<=n.max()))}function Jl(t){let{distance:e,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=t;const a=ji(r)||ji(e)?2:Math.max(e/r,2),s=Math.min(1e3,Math.round(a));let l=n.ticks(s);l.length<=1&&(l=n.ticks(s+1));const c=i>0?Zl(l,i,n):l;c.sort(((t,e)=>t-e));const u=c.map(Yl(o));return c.map(((t,e)=>{const i=n(t);return{position:i,start:i,end:i,label:u[e],value:t,isMinor:-1===l.indexOf(t)}}))}function Ql(t){let{distance:e,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=t;const a=ji(r)||ji(e)?2:Math.max(e/r,2),s=Math.min(1e3,Math.round(a)),l=s>10?10:s;n.nice(l);const c=n.ticks(s),u=i>0?Zl(c,i,n):c;u.sort(((t,e)=>t-e));const h=u.map(Yl(o));return u.map(((t,e)=>{const i=n(t);return{position:i,start:i,end:i,label:h[e],value:t,isMinor:-1===c.indexOf(t)}}))}function tc(t){let e,{settings:n,scale:i,distance:r,formatter:o=t=>t}=t;const a=n.minorTicks&&!ji(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const t=n.ticks.values.filter((t=>"object"==typeof t?!ji(t.value):!ji(t)));e=function(t){let{values:e,scale:n,formatter:i=t=>t}=t;return e.sort(((t,e)=>(Gl(t)?t.value:t)-(Gl(e)?e.value:e))).filter(((t,e,i)=>{const r=Gl(t)?t.value:t;return r<=n.max()&&r>=n.min()&&i.indexOf(t)===e})).map((t=>{const e=Gl(t),r=e?t.value:t,o=n(r);return{position:o,value:r,label:e&&void 0!==t.label?t.label:i(r),isMinor:!!e&&!!t.isMinor,start:e&&!isNaN(t.start)?Xl(n(t.start)):o,end:e&&!isNaN(t.end)?Xl(n(t.end)):o}}))}({values:t,scale:i.copy(),formatter:o})}else if(ji(n.ticks.count)){e=(n.ticks.tight?Ql:Jl)({distance:r,minorCount:a,unitDivider:n.ticks.distance,scale:i,formatter:o}),n.ticks.forceBounds&&function(t,e,n){const i=t.map((t=>t.position)),r=e.range();-1===i.indexOf(r[0])?t.splice(0,0,{position:r[0],start:r[0],end:r[0],label:n(e.start()),isMinor:!1,value:e.start()}):t[0]&&t[0].isMinor&&(t[0].isMinor=!1);const o=t[t.length-1];-1===i.indexOf(r[1])?t.push({position:r[1],start:r[1],end:r[1],label:n(e.end()),isMinor:!1,value:e.end()}):o&&o.isMinor&&(o.isMinor=!1)}(e,i,o)}else{e=function(t){let{count:e,minorCount:n,scale:i,formatter:r}=t;return i.ticks((e-1)*n+e).map(((t,e)=>{const o=i(t);return{position:o,start:o,end:o,label:r(t),isMinor:e%(n+1)!=0,value:t}}))}({count:Math.min(1e3,n.ticks.count),minorCount:a,scale:i.copy(),formatter:o})}return e}function ec(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={};return Object.keys(e).forEach((r=>{const o=typeof t[r];i[r]="function"===o?t[r](n):"undefined"===o?e[r]:t[r]})),i}const nc={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},ic={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},rc={count:NaN};function oc(t,e){t.instance||(t.instance=e.copy(),t.instance.domain([e.start(),e.end()]),t.instance.clamp(!0),t.instance.range(t.invert?[1,0]:[0,1]))}function ac(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Wl(),r={instance:null,invert:!1},o={data:e,resources:n},a=ec(t,nc,o);let s;function l(t){return ji(t)?NaN:i(t)}a.ticks=ec(t.ticks,ic,o),a.minorTicks=ec(t.minorTicks,rc,o),l.data=()=>e,l.invert=function(t){return i.invert(t)},l.rangeRound=function(t){return i.rangeRound(t),l},l.clamp=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(t),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(t){return null!==t&&"object"==typeof t?(t.settings=t.settings||{},t.settings=Ei(!0,{},a,t.settings),t.scale=l,s=tc(t),s):(s=i.ticks(t),s)},l.nice=function(t){return i.nice(t),l},l.tickFormat=function(t,e){return i.tickFormat(t,e)},l.interpolate=function(t){return i.interpolate(t),l},l.domain=function(t){return arguments.length?(i.domain(t),r.instance&&r.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(t){return arguments.length?(i.range(t),l):i.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(t){let e=(l.start()-l.end())/t,n=[l.end()],i=[],r=e/2;for(let o=0;o<t;o++){let t=n[n.length-1]||0,o=t+e,a=l(t+r);n.push(o,o),i.push(a,a)}return n.pop(),l.domain(n),l.range(i),l},l.copy=function(){const r=ac(t,e,n);return r.domain(l.domain()),r.range(l.range()),r.clamp(i.clamp()),r},l.norm=function(t){return oc(r,l),r.instance(t)},l.normInvert=function(t){return oc(r,l),r.instance.invert(t)};const{mini:c,maxi:u}=function(t,e){const n=+t.min,i=+t.max;let r=0,o=1;if(e&&e[0]){const n=e.map((t=>t.min())).filter((t=>!isNaN(t))),i=e.map((t=>t.max())).filter((t=>!isNaN(t)));if(r=n.length?Math.min(...n):Number.NaN,o=i.length?Math.max(...i):Number.NaN,isNaN(r)||isNaN(o))r=-1,o=1;else if(r===o&&0===r)r=-1,o=1;else if(r===o&&r)r-=Math.abs(.1*r),o+=Math.abs(.1*o);else if(!isNaN(t.expand)){const e=o-r;r-=e*t.expand,o+=e*t.expand}if(Array.isArray(t.include)){const e=t.include.filter((t=>!isNaN(t)));r=Math.min(...e,r),o=Math.max(...e,o)}}return{mini:isNaN(n)?r:n,maxi:isNaN(i)?o:i}}(a,e?e.fields:[]);return l.domain([c,u]),l.range(a.invert?[1,0]:[0,1]),r.invert=a.invert,l}const sc={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function lc(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:e,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},i=ec(t,sc,n),r=e.items||[],o={},a=[],s=[];function l(t,n){t.data=()=>e,t.datum=t=>r[o[t]],t.start=function(){return t.domain()[0]},t.end=function(){return t.domain()[t.domain().length-1]},t.labels=()=>s,t.ticks=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.scale=t,function(t){let{scale:e}=t;const n=e.domain(),i=e.data().items,r=e.labels?e.labels():n,o=e.bandwidth();return n.map(((t,n)=>{const a=e(t);return{position:a+o/2,label:"".concat(r[n]),data:i?i[n]:void 0,start:a,end:a+o}}))}(e,n.trackBy)}}const c=Bs();l(c,t),c.pxScale=function(e){const n=i.maxPxStep;if(isNaN(n))return c;const r=c.domain().length,o=Math.max(1,r-c.paddingInner()+2*c.paddingOuter());if(o*n>=e)return c;const a=c.copy();a.type=c.type,l(a,t);const s=o*n/e,u=(1-s)*c.align();return a.range(i.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof t.value?t.value:t=>t.datum.value,h="function"==typeof t.label?t.label:t=>t.datum.label;for(let t=0;t<r.length;t++){const e=Ei({datum:r[t]},n),i=u(e,t);-1===a.indexOf(i)&&(a.push(i),s.push(h(e,t)),o[i]=t)}return c.domain(a),c.range(i.invert?i.range.slice().reverse():i.range),c.padding(isNaN(i.padding)?0:i.padding),isNaN(i.paddingInner)||c.paddingInner(i.paddingInner),isNaN(i.paddingOuter)||c.paddingOuter(i.paddingOuter),c.align(isNaN(i.align)?.5:i.align),c}const cc={depth:0};function uc(t,e,n){return t.ancestors().map((t=>e(Ei({datum:t.data},n)))).reverse().slice(1).toString()}const hc=t=>t.min(),dc=t=>t.max();function fc(t,e){const n=t&&!isNaN(t.min),i=t&&!isNaN(t.max);let r=n?+t.min:0,o=i?+t.max:1;if(e&&e.length){if(!n){const t=e.map(hc).filter(Li);r=t.length?Math.min(...t):r}if(!i){const t=e.map(dc).filter(Li);o=t.length?Math.max(...t):o}}return[r,o]}const pc={domain:[],range:[],invert:!1,min:NaN,max:NaN};function gc(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=ac(t,e,n).clamp(!0).interpolate(Sl),r=ec(t,pc,{data:e,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length,s=i;Ei(!0,s,i);const[l,c]=fc(r,e?e.fields:[]),u=o?r.domain.length:-1,h=n.theme?n.theme.palette("sequential",u>0?u:2):[],d=a?r.range:h;return s.range(r.invert?d.slice().reverse():d.slice()),s.domain(o?r.domain:function(t,e,n){const i=t.length;if(2===i)return[e,n];const r=[],o=(n-e)/(i-1);r.push(e);for(let t=1;t<i-1;t++)r.push(e+o*t);return r.push(n),r}(s.range(),l,c)),s}const mc={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function yc(t){const e=[];for(let n=0;n<t.length-1;n++)e.push((t[n]+t[n+1])/2);return e}const xc={domain:[],range:[]};const vc={domain:[],range:[],unknown:void 0},bc={domain:[],range:[],override:!1};const wc=Gr();function Mc(t,e,n){let i=t.data;t.source&&(n.logger.warn("Deprecated: Scale data source configuration"),i={extract:[]},(Array.isArray(t.source)?t.source:[t.source]).forEach((t=>{i.extract.push({field:t})})));const r=Ps(i,e,n);let o,a=t.type||function(t){return t.root?"h-band":t.fields&&t.fields[0]?function(t){const e=t.map((t=>"dimension"===t.type()?"band":"linear"));return-1!==e.indexOf("linear")?"linear":"band"}(t.fields):"linear"}(r);return"color"===a&&(a=r.fields&&r.fields[0]&&"dimension"===r.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(t,r,{theme:n.theme,logger:n.logger}),o.type=a),o}wc("linear",ac),wc("band",lc),wc("h-band",(function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={data:n,resources:i},o=ec(e,sc,r);o.ticks=ec(e.ticks,cc,r),o.value="function"==typeof e.value?e.value:t=>t.datum.value,o.label="function"==typeof e.label?e.label:t=>t.datum.value;let a=lc(o);const{values:s,labels:l,items:c,ticks:u}=function(t,e,n){const i=e.ticks.depth,r=e.value,o=e.label,a=[],s=[],l={},c=[];let u=0;if(!t)return{values:a,labels:s,items:l,ticks:c};t.eachAfter((t=>{if(t.depth>0){const e=uc(t,r,n),h=t.leaves()||[t],d=r(Ei({datum:t.data},n)),f=o(Ei({datum:t.data},n)),p=Array.isArray(t.children),g={key:e,count:h.length,value:d,label:f,leftEdge:uc(h[0],r,n),rightEdge:uc(h[Math.max(h.length-1,0)],r,n),node:t};p?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(e),s.push(f)),(i<=0&&!p||t.depth===i)&&c.push(g),l[e]=g}}));const h=t.height-1;return h>0&&a.splice(-h),{values:a,labels:s,items:l,ticks:c}}(n.root,o,r),h=function(t){const e=String(t),n=c[e];return a(n?o.invert?n.rightEdge:n.leftEdge:e)};Ei(!0,h,a),h.bandwidth=function(t){const e=c[String(t)],n=a.bandwidth();if(e&&!e.isLeaf){const t=h(e.leftEdge),i=h(e.rightEdge);return Math.abs(t-i)+n}return n},h.step=function(t){const e=c[String(t)],n=e?e.count:1;let i=a.step();return i*=n,i},h.data=()=>n,h.datum=t=>{const e=c[String(t)];return e?e.node.data:null},h.copy=()=>t(e,n,i),h.labels=()=>l,h.ticks=()=>u.map((t=>{const e=h(t.key),n=h.bandwidth(t.key);return{position:e+n/2,label:t.label,data:t.node.data,start:e,end:e+n}}));const d=a.pxScale;return h.pxScale=function(t){return a=d(t),h},h.domain(s),h})),wc("sequential-color",gc),wc("threshold-color",(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Ul(),r=ec(t,mc,{data:e,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length;function s(t){return ji(t)?NaN:i(t)}Object.keys(i).forEach((t=>s[t]=i[t]));const l=e.fields,[c,u]=fc(r,l),h=o?r.domain.length:-1,d=n.theme?n.theme.palette("sequential",h>0?h:2):[];let f=a?r.range:d,p=[];return p=o?r.domain:r.nice?function(t,e,n){const i=2===t.length?10:Math.max(1,t.length),r=Wl().domain([e,n]).nice(i).ticks(i);if(!t||!t.length)return r;const o=Math.max(0,t.length-1);for(;r.length>o;)r[0]-e<=n-r[r.length-1]?r.shift():r.pop();return r}(f,c,u):[c+(u-c)/2],f.length>p.length+1?p=function(t,e,n){const i=t.length;if(2===i)return[e+(n-e)/2];const r=[],o=(n-e)/i;for(let t=1;t<i;t++)r.push(e+o*t);return r}(f,c,u):f.length<p.length+1&&(f=function(t,e,n,i){n=t[0],i=t&&t.length>=2?t[t.length-1]:i;const r=gc().domain([n,i]).range(e);return[n,...yc(t),i].map((t=>r(t)))}(p,f,c,u)),s.data=()=>e,s.range(r.invert?f.slice().reverse():f),s.domain(p),s})),wc("categorical-color",(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Fs(),r={data:e,resources:n},o=ec(t,xc,r),a="function"==typeof t.value?t.value:t=>t.datum.value,s="function"==typeof t.label?t.label:t=>t.datum.label,l=e.items||[],c={},u=[],h=[];for(let t=0;t<l.length;t++){const e=Ei({datum:l[t]},r),n=a(e,t);-1===u.indexOf(n)&&(u.push(n),h.push(s(e,t)),c[n]=t)}return i.data=()=>e,i.labels=()=>h,i.label=t=>h[u.indexOf(t)],i.datum=t=>l[c[t]],i.range(o.range),Array.isArray(o.domain)&&o.domain.length?i.domain(o.domain):i.domain(u),i}(t,e,n),r=n.theme,o=ec(t,vc,{data:e,resources:n});let a;if(o.explicit=ec(t.explicit,bc,{data:e,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():r?r.palette("categorical",i.domain().length).slice():[],o.unknown)i.unknown(o.unknown);else if(r&&r.palette("unknown")){let t=r.palette("unknown");i.unknown(t[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const t=i.domain().slice(),e=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],r=Math.floor(t.length/a.length);for(let t=1;t<r+1;t*=2)a=a.concat(a);if(o.explicit.override)for(let i=0;i<e.length;i++){const r=t.indexOf(e[i]);r>-1&&(a[r]=n[i])}else{const i=e.map(((e,i)=>[t.indexOf(e),e,n[i]])).sort(((t,e)=>t[0]-e[0]));i.forEach((e=>{const n=t.indexOf(e[1]);-1!==n&&a.splice(n,0,e[2])}))}a.length=t.length}return i.range(a),i}));var kc={};function _c(){_c.init.call(this)}kc.isObject=function(t){return"object"==typeof t&&null!==t},kc.isNumber=function(t){return"number"==typeof t},kc.isUndefined=function(t){return void 0===t},kc.isFunction=function(t){return"function"==typeof t};var Sc=_c;_c.EventEmitter=_c,_c.prototype._events=void 0,_c.prototype._maxListeners=void 0,_c.defaultMaxListeners=10,_c.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},_c.prototype.setMaxListeners=function(t){if(!kc.isNumber(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},_c.prototype.emit=function(t){var e,n,i,r,o,a;if(this._events||(this._events={}),"error"===t&&!this._events.error)throw(e=arguments[1])instanceof Error?e:Error('Uncaught, unspecified "error" event.');if(n=this._events[t],kc.isUndefined(n))return!1;if(kc.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];n.apply(this,r)}else if(kc.isObject(n)){for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];for(i=(a=n.slice()).length,o=0;o<i;o++)a[o].apply(this,r)}return!0},_c.prototype.addListener=function(t,e){var n;if(!kc.isFunction(e))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,kc.isFunction(e.listener)?e.listener:e),this._events[t]?kc.isObject(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,kc.isObject(this._events[t])&&!this._events[t].warned)&&((n=kc.isUndefined(this._maxListeners)?_c.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,kc.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),kc.isFunction(console.trace)&&console.trace()));return this},_c.prototype.on=_c.prototype.addListener,_c.prototype.once=function(t,e){if(!kc.isFunction(e))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(t,i),n||(n=!0,e.apply(this,arguments))}return i.listener=e,this.on(t,i),this},_c.prototype.removeListener=function(t,e){var n,i,r,o;if(!kc.isFunction(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=(n=this._events[t]).length,i=-1,n===e||kc.isFunction(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(kc.isObject(n)){for(o=r;o-- >0;)if(n[o]===e||n[o].listener&&n[o].listener===e){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},_c.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],kc.isFunction(n))this.removeListener(t,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},_c.prototype.listeners=function(t){return this._events&&this._events[t]?kc.isFunction(this._events[t])?[this._events[t]]:this._events[t].slice():[]},_c.listenerCount=function(t,e){return t._events&&t._events[e]?kc.isFunction(t._events[e])?1:t._events[e].length:0};var Nc={mixin:t=>(Object.keys(Sc.prototype).forEach((e=>{t[e]=Sc.prototype[e]})),Sc.init(t),t)};function Rc(){let t=0,e=0,n=0,i=0;n=n||t;const r={move(t){this.moveTo(n+t)},moveTo(o){const a=Math.max(t,Math.min(e-i,o));n!==a&&(n=a,r.emit("update"))},update(o){let a=!1;({min:t=t,max:e=e}=o),void 0!==o.viewSize&&o.viewSize!==i&&(i=o.viewSize,a=!0);const s=Math.max(t,Math.min(e-i,n));n!==s&&(n=s,a=!0),a&&r.emit("update")},getState:()=>({min:t,max:e,start:n,viewSize:i})};return Nc.mixin(r),r}function Ac(t,e){const n=t.min||0,i=t.max||0,r=t.viewSize||0,o=e||Rc();return o.update({min:n,max:i,viewSize:r}),o}function Cc(t,e){return t<=e}function Dc(t,e){return t<e}function Oc(t,e,n){let i=0;for(;i<t.length&&e>t[i];)++i;return t[i]===e&&n&&++i,i}function Ec(){let t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[];function r(){}return r.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:i=!0,includeMin:r=!0}=n;t=i?Cc:Dc,e=r?Cc:Dc},r.add=t=>{let{min:e,max:n}=t;const r=Oc(i,e),o=Oc(i,n,!0),a=[r,o-r];r%2==0&&a.push(e),o%2==0&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.remove=t=>{let{min:e,max:n}=t;const r=Oc(i,e),o=Oc(i,n,!0),a=[r,o-r];r%2==1&&a.push(e),o%2==1&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.set=t=>{const e=i.join(",");i=[],Array.isArray(t)?t.forEach(r.add):r.add(t);return e!==i.join(",")},r.clear=()=>{const t=i.length>0;return i=[],t},r.containsValue=n=>function(t,e,n,i){const r=t.length;for(let o=1;o<r;o+=2)if(n(t[o-1],e)&&i(e,t[o]))return!0;return!1}(i,n,e,t),r.containsRange=t=>{let{min:e,max:n}=t;const r=Oc(i,e,!0),o=Oc(i,n);return r===o&&o%2==1},r.toggle=t=>r.containsRange(t)?r.remove(t):r.add(t),r.ranges=()=>{const t=[];for(let e=1;e<i.length;e+=2)t.push({min:i[e-1],max:i[e]});return t},r.configure(n),r}function zc(){let t=[];function e(){}return e.add=e=>-1===t.indexOf(e)&&(t.push(e),!0),e.remove=e=>{const n=t.indexOf(e);return-1!==n&&(t.splice(n,1),!0)},e.contains=e=>-1!==t.indexOf(e),e.values=()=>t.slice(),e.clear=()=>t=[],e.toString=()=>t.join(";"),e}const Ic={key:void 0,includeMin:!0,includeMax:!0};function Tc(t){let{items:e,collection:n,vc:i}=t;const r={},o=[];let a,s;for(let t=0,o=e.length;t<o;t++){a=e[t].key,n[a]||(n[a]=i()),s=e[t].values||[e[t].value];for(let t=0;t<s.length;t++)n[a].add(s[t])&&(r[a]=r[a]||[],r[a].push(s[t]))}const l=Object.keys(r);for(let t=0,e=l.length;t<e;t++)a=l[t],o.push({id:a,values:r[a]});return o}function Pc(t){let{items:e,collection:n}=t;const i={},r=[];let o,a;for(let t=0,r=e.length;t<r;t++)if(o=e[t].key,n[o]){a=e[t].values||[e[t].value];for(let t=0;t<a.length;t++)n[o].remove(a[t])&&(i[o]=i[o]||[],i[o].push(a[t]))}const s=Object.keys(i);for(let t=0,e=s.length;t<e;t++)o=s[t],r.push({id:o,values:i[o]});return r}function qc(t){const e={};let n,i;for(let r=0,o=t.length;r<o;r++){n=t[r].key,i=t[r].values||[t[r].value],e[n]||(e[n]=[]);for(let t=0;t<i.length;t++){-1===e[n].indexOf(i[t])&&e[n].push(i[t])}}return e}function Lc(t){let{key:e,collection:n,obj:i,fn:r,value:o}=t;n[e]||(n[e]=r()),i[e]=i[e]||[],i[e].push(o),n[e].add(o)}function jc(t,e){const n=[],i=Object.keys(t);let r,o;const a=t=>-1===e[r].indexOf(t);for(let s=0,l=i.length;s<l;s++)r=i[s],e[r]?(o=t[r].filter(a),o.length&&n.push({id:r,values:o})):n.push({id:r,values:t[r]});return n}function Fc(t,e,n){const i=function(t,e){if(!Object.keys(e).length)return t;const n=t.length,i=Array(n);for(let r=0;r<n;r++)i[r]=t[r].key in e?Ei({},t[r],{key:e[t[r].key]}):t[r];return i}(e,n);return t&&t.length?t.reduce(((t,e)=>e(t)),i):i}function Bc(t){return t.replace(/(-[a-z])/g,(t=>t.toUpperCase().replace("-","")))}function Vc(t){return t.replace(/([A-Z])/g,(t=>"-".concat(t.toLowerCase())))}function $c(t,e,n){let{ranges:i,interceptors:r,rc:o,aliases:a,rangeConfig:s}=n;const l=Fc(r["".concat(e,"Ranges")],t,a);let c=!1;return l.forEach((t=>{const n=t.key;if(i[n]||(i[n]=o(s.sources[n]||s.default)),"set"===e)c=i[n][e](t.ranges||t.range)||c;else{const r=t.ranges||[t.range];for(let t=0;t<r.length;t++)c=i[n][e](r[t])||c}})),c}function Hc(){let{vc:t=zc,rc:e=Ec}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,i={},r={},o={},a={sources:{},default:Ei({},Ic)};const s={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const t={values:{},ranges:{}};return Object.keys(r).forEach((e=>{t.values[e]=r[e].values()})),Object.keys(i).forEach((e=>{t.ranges[e]=i[e].ranges()})),t},c={ls:[],clear(){this.ls.forEach((t=>t.clear()))},start(){this.ls.forEach((t=>t.start()))},end(){this.ls.forEach((t=>t.end()))},update(){const t=l();this.ls.forEach((e=>e._state(t)))},updateValues(){const t=l();this.ls.forEach((e=>e._state({values:t.values})))},updateRanges(){const t=l();this.ls.forEach((e=>e._state({ranges:t.ranges})))}},u={configure:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(t.ranges)&&t.ranges.length&&(a={sources:{},default:Ei({},Ic)},t.ranges.forEach((t=>{const e={};Object.keys(Ic).filter((t=>"key"!==t)).forEach((n=>{e[n]=void 0!==t[n]?t[n]:Ic[n]})),void 0!==t.key?a.sources[t.key]=e:a.default=e})),Object.keys(i).forEach((t=>i[t].configure(a.sources[t]||a.default))),u.emit("update",[],[]))},link:t=>{if(u===t)throw new Error("Can't link to self");c.ls.push(t),t._state(l())},_state:t=>{if(!t)return l();if(t.values){const e=[];Object.keys(t.values).forEach((n=>{r[n]&&t.values[n].join(";")===r[n].toString()||e.push({key:n,values:t.values[n]})})),Object.keys(r).forEach((n=>{t.values[n]||e.push({key:n,values:[]})})),e.length&&u.setValues(e)}if(t.ranges){const e=[];Object.keys(t.ranges).forEach((n=>{i[n]&&t.ranges[n].join(";")===i[n].toString()||e.push({key:n,ranges:t.ranges[n]})})),Object.keys(i).forEach((n=>{t.ranges[n]||e.push({key:n,ranges:[]})})),e.length&&u.setRanges(e)}},start:function(){if(!n){n=!0;for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];u.emit("start",...e),c.start()}},end:function(){if(n){n=!1,i={},r={};for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];u.emit("end",...e),c.end()}},isActive:()=>n,clear:()=>{const t=u.brushes().filter((t=>"value"===t.type&&t.brush.values().length)).map((t=>({id:t.id,values:t.brush.values()}))),e=Object.keys(i).length>0||t.length;i={},r={},e&&(u.emit("update",[],t),c.clear())},brushes:()=>{let t=[];return t=t.concat(Object.keys(i).map((t=>({type:"range",id:t,brush:i[t]})))),t=t.concat(Object.keys(r).map((t=>({type:"value",id:t,brush:r[t]})))),t},addValue:(t,e)=>{u.addValues([{key:t,value:e}])},addValues:e=>{const i=Fc(s.addValues,e,o),a=Tc({vc:t,collection:r,items:i});u.emit("add-values",i),a.length&&(n||(n=!0,u.emit("start")),u.emit("update",a,[]),c.updateValues())}};return u.setValues=e=>{const i=Fc(s.setValues,e,o),a=function(t){let{items:e,vCollection:n,vc:i}=t;const r={},o=qc(e);let a,s=[],l=[];const c={},u=Object.keys(n);for(let t=0,e=u.length;t<e;t++)a=u[t],c[a]=n[a].values().slice(),delete n[a];const h=t=>{n[a]&&n[a].contains(t)||Lc({key:a,value:t,collection:n,obj:r,fn:i})},d=Object.keys(o);for(let t=0,e=d.length;t<e;t++)a=d[t],o[a].forEach(h);return l=jc(c,r),s=jc(r,c),[s,l]}({items:i,vCollection:r,vc:t});u.emit("set-values",i),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.removeValue=(t,e)=>{u.removeValues([{key:t,value:e}])},u.removeValues=t=>{const e=Fc(s.removeValues,t,o),n=Pc({collection:r,items:e});u.emit("remove-values",e),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(e,i)=>{const a=Fc(s.addValues,e,o),l=Fc(s.removeValues,i,o),h=Tc({vc:t,collection:r,items:a}),d=Pc({collection:r,items:l});u.emit("add-values",a),u.emit("remove-values",l),(h.length||d.length)&&(n||(n=!0,u.emit("start")),u.emit("update",h,d),c.updateValues())},u.toggleValue=(t,e)=>{u.toggleValues([{key:t,value:e}])},u.toggleValues=e=>{const i=Fc(s.toggleValues,e,o),a=function(t){let{items:e,values:n,vc:i}=t;const r={},o={},a=[],s=[],l=qc(e);let c,u,h;const d=Object.keys(l);for(let t=0,e=d.length;t<e;t++){c=d[t],h=l[c];for(let t=0,e=h.length;t<e;t++)u=h[t],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):Lc({key:c,value:u,collection:n,obj:r,fn:i})}const f=Object.keys(r);for(let t=0,e=f.length;t<e;t++)c=f[t],a.push({id:c,values:r[c]});const p=Object.keys(o);for(let t=0,e=p.length;t<e;t++)c=p[t],s.push({id:c,values:o[c]});return[a,s]}({items:i,values:r,vc:t});u.emit("toggle-values",i),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.containsValue=(t,e)=>{let n=o[t]||t;return!!r[n]&&r[n].contains(e)},u.addRange=(t,e)=>{u.addRanges([{key:t,range:e}])},u.addRanges=t=>{$c(t,"add",{ranges:i,rc:e,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(t,e)=>{u.removeRanges([{key:t,range:e}])},u.removeRanges=t=>{$c(t,"remove",{ranges:i,rc:e,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(t,e)=>{u.setRanges([{key:t,range:e}])},u.setRanges=t=>{$c(t,"set",{ranges:i,rc:e,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(t,e)=>{u.toggleRanges([{key:t,range:e}])},u.toggleRanges=t=>{$c(t,"toggle",{ranges:i,rc:e,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(t,e)=>{let n=o[t]||t;return!!i[n]&&i[n].containsValue(e)},u.containsRange=(t,e)=>{let n=o[t]||t;return!!i[n]&&i[n].containsRange(e)},u.containsMappedData=(t,e,n)=>{let a=[];const s=Object.keys(t);let l,c,u,h;for(let e=0,n=s.length;e<n;e++){if(l=s[e],"value"===l)c=t,a[e]={key:"",i:e,bool:!1};else{if("source"===l)continue;c=t[l],a[e]={key:l,i:e,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),h=c.value,i[u]?a[e].bool=Array.isArray(h)?i[u].containsRange({min:h[0],max:h[1]}):i[u].containsValue(h):r[u]&&r[u].contains(h)&&(a[e].bool=!0))}return e?(a=a.filter((t=>-1!==e.indexOf(t.key))),"and"===n?!!a.length&&!a.some((t=>!1===t.bool)):"xor"===n?!!a.length&&a.some((t=>t.bool))&&a.some((t=>!1===t.bool)):a.some((t=>t.bool))):a.some((t=>t.bool))},u.intercept=(t,e)=>{const n=Bc(t);s[n]&&s[n].push(e)},u.removeInterceptor=(t,e)=>{const n=Bc(t);if(!s[n])return;const i=s[n].indexOf(e);-1!==i&&s[n].splice(i,1)},u.removeAllInterceptors=t=>{const e=[];if(t){const n=Bc(t);s[n]&&s[n].length&&e.push({name:t,handlers:s[n]})}else Object.keys(s).forEach((t=>{s[t].length&&e.push({name:Vc(t),handlers:s[t]})}));e.forEach((t=>{t.handlers.slice().forEach((e=>u.removeInterceptor(t.name,e)))}))},u.addKeyAlias=(t,e)=>{o[t]=e},u.removeKeyAlias=t=>{delete o[t]},Nc.mixin(u),u}function Wc(t){return t*t*t}function Uc(t){return--t*t*t+1}function Yc(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Gr();const Xc=["stroke","fill","color","backgroundColor","thumbColor"];function Gc(t,e){const n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),o=new Array(n);let a;for(a=0;a<i;++a)r[a]=Kc(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(t){for(a=0;a<i;++a)o[a]=r[a](t);return o}}function Kc(t,e,n){const i=typeof e;let r;return null==e||"boolean"===i?function(t){return()=>t}(e):("number"===i?Cl:"string"===i?(r=al(e))&&Xc.includes(n)?(e=r,Sl):zl:e instanceof al?Sl:e instanceof Date?Al:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?Nl:Array.isArray(e)?Gc:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Zc:Cl)(t,e)}function Zc(t,e){const n={},i={};let r;for(r in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)r in t?n[r]=Kc(t[r],e[r],r):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}}function Jc(t,e){return t.data?t.data.value:"text"===t.type?t.text:e}const Qc={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},tu=/^\$/;function eu(t){const e=typeof t;return"object"!==e&&"function"!==e&&"undefined"!==e}function nu(t,e,n){const i=t[e];i&&i.scale&&i.scale.pxScale?i.scale=i.scale.pxScale(n):i&&i.pxScale&&(t[e]=i.pxScale(n))}function iu(t,e){return t.pxScale?t.pxScale(e):t}const ru={normalizeSettings:function(t,e,n){const i=Ei({},t),r=Ei({},e);return Object.keys(i).forEach((t=>{r[t]={};const o=i[t],a=typeof o;if("function"==typeof o)r[t].fn=o;else if(eu(o)){let n=e[t];"string"==typeof n&&tu.test(n)&&(n=Qc[n]);const i=typeof n;r[t]="undefined"===i||i===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(r[t].fn=o.fn),void 0!==o.scale&&(r[t].scale=n.scale(o.scale)),"string"==typeof o.ref&&(r[t].ref=o.ref))})),Object.keys(e).forEach((t=>{if(t in i)return;const n=e[t];"string"===typeof n&&tu.test(n)?r[t]=Qc[n]:r[t]=n})),r},resolveForItem:function(t,e,n){const i={},r=Object.keys(e),o=r.length,a=t.datum,s=t.datum;for(let l=0;l<o;l++){const o=r[l],c=e[o],u="object"==typeof s&&void 0!==c,h=u&&"string"==typeof c.ref,d=u&&o in s,f=h?s[c.ref]:d?s[o]:a;eu(c)?i[o]=c:u&&c.fn?(c.scale&&(t.scale=c.scale),i[o]=c.fn.call(null,t,n)):u&&c.scale&&f?(i[o]=c.scale(f.value),c.scale.bandwidth&&(i[o]+=c.scale.bandwidth()/2)):h&&f?i[o]=f.value:c.fn?i[o]=c.fn.call(null,t,n):i[o]=c}return i},updateScaleSize:nu};function ou(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((t,e)=>Array.isArray(e.children)?(t.push(...ou(e.children)),t):(t.push(e),t)),[])}function au(t,e){let{context:n,data:i,style:r,filter:o,mode:a}=e;const s=t.chart.brush(n),l=i,c=r.active||{},u=r.inactive||{},h=[];Object.keys(c).forEach((t=>{h.push(t)})),Object.keys(u).forEach((t=>{-1===h.indexOf(t)&&h.push(t)}));const d=[];let f=!1;const p=()=>{let e=ou(t.nodes);return"function"==typeof o&&(e=e.filter(o)),e},g=()=>{const t=p(),e=t.length;let n,i=!1;const r="function"==typeof l?l({brush:s}):l;for(let i=0;i<e;i++){if(n=t[i].data,!n)continue;t[i].__style||(t[i].__style={},h.forEach((e=>{t[i].__style[e]=t[i][e]})));const e=s.containsMappedData(n,r,a),o=d.indexOf(t[i]);let l=!1;e&&-1===o?(d.push(t[i]),l=!0):e||-1===o||(d.splice(o,1),l=!0),t[i].needToUpdate=l||f,t[i].isActive=e}for(let r=0;r<e;r++)if(n=t[r].data,n){if(t[r].needToUpdate){const e=Ei({},t[r],t[r].__style),n=t[r].isActive;h.forEach((i=>{t[r][i]=n&&i in c?"function"==typeof c[i]?c[i].call(null,e,d):c[i]:!n&&i in u?"function"==typeof u[i]?u[i].call(null,e,d):u[i]:t[r].__style[i]})),i=!0}delete t[r].needToUpdate}return f=!1,i},m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=e,i=p(),r=i.length;for(let t=0;t<r;t++)i[t].data&&(i[t].__style=i[t].__style||{},h.forEach((e=>{i[t].__style[e]=i[t][e],e in u&&(i[t][e]="function"==typeof u[e]?u[e].call(null,i[t]):u[e])})));f=!0,d.length=0,n||t.renderer.render(t.nodes)},y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=e,i=p(),r=i.length;for(let t=0;t<r;t++)i[t].__style&&(Object.keys(i[t].__style).forEach((e=>{i[t][e]=i[t].__style[e]})),i[t].__style=void 0);d.length=0,n||t.renderer.render(t.nodes)},x=()=>{if(g()){const e="function"==typeof t.config.sortNodes?t.config.sortNodes(t):t.nodes;"function"==typeof t.config.customRender?t.config.customRender({render:t.renderer.render,nodes:e}):t.renderer.render(e)}};return s.on("start",m),s.on("end",y),s.on("update",x),{isActive:()=>s.isActive(),update:()=>{d.length=0,f=!0,g()},cleanUp:function(){s.removeListener("start",m),s.removeListener("end",y),s.removeListener("update",x)}}}function su(t){let{nodes:e,action:n,chart:i,trigger:r}=t;const o=[];for(let t=0;t<e.length;t++){let n=e[t].data;null!==n&&o.push(n)}!function(t){let{dataPoints:e,action:n,chart:i,trigger:r}=t;if(!r)return;const o=r.data||[""];let a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(let t=0;t<e.length;t++){const n=e[t];n&&o.forEach((t=>{let e=n&&!t?n:n[t];if(e){let t={key:e.source.field};void 0!==e.source.key&&(t.key="".concat(e.source.key,"/").concat(e.source.field)),Array.isArray(e.value)?(t.range={min:e.value[0],max:e.value[1]},a.items.push(t)):(t.value=e.value,s.items.push(t))}}))}r.contexts.forEach((t=>{a.items.length?i.brush(t)[a.actionFn](a.items):i.brush(t)[s.actionFn](s.items)}))}({dataPoints:o,action:n,chart:i,trigger:r})}function lu(t){let{collisions:e,t:n,config:i,action:r}=t,o=[],a=!1;e.length>0&&(o=e,a=!0,"stop"===n.propagation&&(o=[e[e.length-1]]));const s=o.map((t=>t.node));return su({nodes:s,action:r,chart:i.chart,data:i.data,trigger:n}),a}function cu(t,e,n){const i=n.element().getBoundingClientRect();let r=qi(t)?function(t,e){return 1!==t.changedTouches.length?null:{x:t.changedTouches[0].clientX-e.left,y:t.changedTouches[0].clientY-e.top}}(t,i):function(t,e){return{x:t.clientX-e.left,y:t.clientY-e.top}}(t,i);return null===r||r.x<0||r.y<0||r.x>i.width||r.y>i.height?[]:(e.touchRadius>0&&qi(t)?r={cx:r.x,cy:r.y,r:e.touchRadius}:e.mouseRadius>0&&!qi(t)&&(r={cx:r.x,cy:r.y,r:e.mouseRadius}),n.itemsAt(r))}function uu(t,e,n){return t?"function"==typeof t?t(e):t:n}const hu={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function du(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let e=0;e<t.length;e++){const i=t[e];n+=0===e?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return e&&(n+="Z"),n}function fu(t,e,n,i){const r=n/2,o=t-i/2,a=e-i/2,s=t-r,l=e-r;return[{x:o,y:a},{x:o,y:l},{x:o+i,y:l},{x:o+i,y:a},{x:s+n,y:a},{x:s+n,y:a+i},{x:o+i,y:a+i},{x:o+i,y:l+n},{x:o,y:l+n},{x:o,y:a+i},{x:s,y:a+i},{x:s,y:a}]}function pu(t){return-t/180*Math.PI}function gu(t){return function(t){let e=(.5*(Math.floor(t/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(e-t))*Math.sqrt(2),i=n*Math.cos(t),r=n*Math.sin(t);return{x1:i<0?1:0,y1:r<0?1:0,x2:i>=0?i:i+1,y2:r>=0?r:r+1}}(pu(t))}function mu(t,e){return{x:t.x+e.x,y:t.y+e.y}}function yu(t,e){return{x:t.x-e.x,y:t.y-e.y}}function xu(t,e){return{x:t.x*e,y:t.y*e}}function vu(t,e){return t.x-e.x}function bu(t,e){return t.y-e.y}function wu(t,e){return vu(t,e)**2+bu(t,e)**2}function Mu(t,e){return Math.sqrt(wu(t,e))}function ku(t,e){return t.x*e.x+t.y*e.y}function _u(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const i=Math.cos(e),r=Math.sin(e),o=yu(t,n);return mu({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}const Su={up:0,down:180,left:90,right:-90};function Nu(t){let{x:e,y:n,size:i}=t;const r=i/2;return{type:"rect",x:e-r,y:n-r,width:i,height:i}}const Ru=Gr();Ru.add("circle",(function(t){return{type:"circle",fill:"black",cx:t.x,cy:t.y,r:t.size/2}})),Ru.add("diamond",(function(t){const e=t.size,n=t.x-e/2,i=t.y-e/2;return{type:"path",fill:"black",d:du([{x:n,y:i+e/2},{x:n+e/2,y:i},{x:n+e,y:i+e/2},{x:n+e/2,y:i+e},{x:n,y:i+e/2}])}})),Ru.add("saltire",(function(t){const e=pu(45),n=t.size/2,i=isNaN(t.width)?n/2:t.width,r=Math.min(i,n);let o=t.size;const a=Math.sin(Math.asin(-e))*(r/2);o+=2*(n/Math.sin(-e)-n),o-=2*a;const s={x:t.x,y:t.y},l=fu(t.x,t.y,o,r).map((t=>_u(t,e,s)));return{type:"path",fill:"black",d:du(l)}})),Ru.add("square",(function(t){const e=t.size;return{type:"rect",fill:"black",x:t.x-e/2,y:t.y-e/2,width:e,height:e}})),Ru.add("triangle",(function(t){const e=t.size,n={x:t.x,y:t.y},i=Su[t.direction]||0,r=e/2,o=t.x-r,a=t.y-r;let s=[{x:o,y:a+e},{x:o+r,y:a},{x:o+e,y:a+e},{x:o,y:a+e}];const l=pu(i);return s=s.map((t=>_u(t,l,n))),{type:"path",fill:"black",d:du(s)}})),Ru.add("line",(function(t){const e="vertical"===t.direction,n=t.size/2,i=t.x,r=t.y;return{type:"line",stroke:"black",strokeWidth:1,x1:i-(e?0:n),y1:r-(e?n:0),x2:i+(e?0:n),y2:r+(e?n:0),collider:Nu(t)}})),Ru.add("star",(function(t){const e=t.size,n=[],i=e/2,r=t.points||5,o=Math.min(t.innerRadius||e/2,e)/2,a=isNaN(t.startAngle)?90:t.startAngle,s=360/r;for(let e=1;e<=r;e++){const r=s*e+a,l=pu(r),c=pu(r+s/2),u=Math.sin(l),h=Math.cos(l),d=Math.sin(c),f=Math.cos(c);n.push({x:t.x+h*i,y:t.y+u*i}),n.push({x:t.x+f*o,y:t.y+d*o})}return{type:"path",fill:"black",d:du(n)}})),Ru.add("n-polygon",(function(t){const e=[],n=t.size/2,i=Math.max(isNaN(t.sides)?6:t.sides,3),r=360/i,o=isNaN(t.startAngle)?0:t.startAngle;for(let a=1;a<=i;a++){const i=pu(r*a+o),s=Math.sin(i),l=Math.cos(i);e.push({x:t.x+l*n,y:t.y+s*n})}return{type:"path",fill:"black",d:du(e)}})),Ru.add("cross",(function(t){const e=t.x,n=t.y,i=t.size/2,r=isNaN(t.width)?i/2:t.width,o=Math.min(r,i);return{type:"path",fill:"black",d:du(fu(e,n,t.size,o))}})),Ru.add("bar",(function(t){const e={x:t.x,y:t.y},n="vertical"===t.direction,i=t.size/2,r=i/2/2;let o=[{x:e.x-i,y:e.y+r},{x:e.x-i,y:e.y-r},{x:e.x+i,y:e.y-r},{x:e.x+i,y:e.y+r}];if(n){const t=pu(90);o=o.map((n=>_u(n,t,e)))}const a=$i(o);return a.type="rect",a.fill="black",a})),Ru.add("rect",(function(t){const{x:e,y:n,size:i}=t,r=void 0===t.width?i:t.width,o=void 0===t.height?i:t.height;return{type:"rect",fill:"black",x:e-r/2,y:n-o/2,width:r,height:o}}));const Au=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ru;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=t.get(e.type);if(n){const t=n(e);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(e).forEach((n=>{void 0!==hu[n]&&"transform"!==n&&(t[n]=e[n])}))}(t,e),void 0!==e.data&&(t.data=e.data),t}return n}};function Cu(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:i=0,prioOrder:r=0,preferredSize:o=0,minimumLayoutMode:a,show:s=!0}=t;n=n||"center";return{computePreferredSize(t){let{inner:n,outer:i,children:r}=t;return"function"==typeof o?o({inner:n,outer:i,children:r,dock:this.dock()},e):o},dock(t){return void 0!==t?(n=t,this):"function"==typeof n?n(e):n},displayOrder(t){return void 0!==t?(i=t,this):"function"==typeof i?i(e):i},prioOrder(t){return void 0!==t?(r=t,this):"function"==typeof r?r(e):r},minimumLayoutMode(t){return void 0!==t?(a=t,this):"function"==typeof a?a(e):a},show(t){return void 0!==t?(s=t,this):"function"==typeof s?s(e):s}}}function Du(t,e,n){const{require:i=[]}=e,r=e.mediator||{},{settings:o,formatter:a,scale:s,data:l,renderer:c,chart:u,dockConfig:h,mediator:d,instance:f,rect:p,style:g,registries:m,resolver:y,update:x,_DO_NOT_USE_getInfo:v,symbol:b,isVisible:w}=n;t.emit=()=>{},w&&(t.isVisible=w),Object.defineProperty(t,"settings",{get:o}),Object.defineProperty(t,"data",{get:l}),Object.defineProperty(t,"formatter",{get:a}),Object.defineProperty(t,"scale",{get:s}),Object.defineProperty(t,"mediator",{get:d}),Object.defineProperty(t,"style",{get:g}),Object.defineProperty(t,"registries",{get:m}),p&&Object.defineProperty(t,"rect",{get:p}),v&&(t._DO_NOT_USE_getInfo=v),Object.keys(e).forEach((n=>{var i;i=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((t=>t===i))||("function"==typeof e[n]?t[n]=e[n].bind(t):t[n]=e[n])})),i.forEach((e=>{"renderer"===e?Object.defineProperty(t,"renderer",{get:c}):"chart"===e?Object.defineProperty(t,"chart",{get:u}):"dockConfig"===e?Object.defineProperty(t,"dockConfig",{get:h}):"instance"===e?Object.defineProperty(t,"instance",{get:f}):"update"===e&&x?Object.defineProperty(t,"update",{get:x}):"resolver"===e?Object.defineProperty(t,"resolver",{get:y}):"symbol"===e&&Object.defineProperty(t,"symbol",{get:b})})),Object.keys(r).forEach((e=>{t.mediator.on(e,r[e].bind(t))}))}function Ou(t,e,n){const i=e=>t[e]?(n.warn("Deprecation Warning the ".concat(e," property should be moved into layout: {} property")),t[e]):t.layout?t.layout[e]:void 0,r={};return r.displayOrder=i("displayOrder"),r.dock=i("dock"),r.prioOrder=i("prioOrder"),r.minimumLayoutMode=i("minimumLayoutMode"),t.layout=t.layout||{},t.layout.displayOrder=void 0!==r.displayOrder?r.displayOrder:t.layout.displayOrder,t.layout.prioOrder=void 0!==r.prioOrder?r.prioOrder:t.layout.prioOrder,t.layout.dock=r.dock||t.layout.dock,t.layout.minimumLayoutMode=r.minimumLayoutMode||t.layout.minimumLayoutMode,r.show=t.show,r.preferredSize=e,r}function Eu(t,e,n){Object.keys(n.on||{}).forEach((i=>{t.eventListeners=t.eventListeners||[];const r=n.on[i].bind(t);t.eventListeners.push({event:i,listener:r}),e.on(i,r)})),t.emit=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return e.emit(t,...i)}}function zu(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:i=()=>({})}=t,{chart:r,container:o,mediator:a,registries:s,theme:l,renderer:c}=e,u=Nc.mixin({});let h,d,f,p,g,m=e.settings||{},y=Ei(!0,{},n,m),x=[],v=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ru,n={};return{resolve:function(i){let{data:r,settings:o,defaults:a={},scaled:s}=i;const l=n.norm=e.normalizeSettings(o,a,t.chart),c={scale:t.chart.scale,formatter:t.chart.formatter};s&&Object.keys(s).forEach((t=>{l[t]&&e.updateScaleSize(l,t,s[t])}));const u=[];if(!r||!Array.isArray(r.items)){const t={data:r,resources:c};let i=e.resolveForItem(t,n.norm,-1);return{settings:n.norm,item:i}}{let t;for(let i=0,o=r.items.length;i<o;i++){t={datum:r.items[i],data:r,resources:c};let o=e.resolveForItem(t,n.norm,i);o.data=r.items[i],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:r}),b=!1;const w={nodes:[],chart:r,config:y.brush||{},renderer:null},M={tap:[],over:[]},k=[],_={},S=Ei({},m);function N(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const r=void 0!==t[e],o=void 0!==m[e];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return r&&("function"==typeof t[e]?a=t[e].call(_,...l):i&&(a=t[e])),o&&("function"==typeof m[e]?a=m[e].call(S,...l):i&&(a=m[e])),r||o||(a=n.call(_,...l)),a}}const R=N("preferredSize",(()=>0),!0),A=N("resize",(t=>{let{inner:e}=t;return e})),C=N("created"),D=N("beforeMount"),O=N("mounted"),E=N("beforeUnmount"),z=N("beforeUpdate"),I=N("updated"),T=N("beforeRender"),P=N("beforeDestroy"),q=N("destroyed"),L=t.render,j=()=>{y.brush&&(y.brush.consume||[]).forEach((t=>{t.context&&t.style&&k.push(au(w,t))}))},F=()=>{y.brush&&(y.brush.trigger||[]).forEach((t=>{"over"===t.on?M.over.push(t):M.tap.push(t)}))};Object.defineProperty(w,"data",{get:()=>x});const B=y.renderer||t.renderer,V=B?c||s.renderer(B)():c||s.renderer()();"function"==typeof V.settings&&V.settings(y.rendererSettings),w.renderer=V;const $={resources:r.logger?{logger:r.logger()}:{}};let H=Cu(Ou(y,R,r.logger()),$);const W=t=>{t.key=y.key,t.element=V.element()},U=()=>{};U.dockConfig=()=>H,U.set=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.settings&&(m=t.settings,y=Ei(!0,{},n,t.settings),H=Cu(Ou(y,R,r.logger()),$),w.config=y.brush||{}),y.scale&&(h=r.scale(y.scale)),y.data){const{rendererSettings:t}=y,e="function"==typeof(null==t?void 0:t.progressive)&&t.progressive(),n=Ps(y.data,{dataset:r.dataset,collection:r.dataCollection},{logger:r.logger()},r.dataCollection);e?e.isFirst?(x=n,x.items&&(x.items=[...n.items])):x.items&&(x.items=[...x.items,...n.items||[]]):x=n}else x=h?h.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?d=r.formatter(y.formatter):h&&h.data().fields&&(d=h.data().fields[0].formatter()),g=l.style(y.style||{})},U.resize=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=A({inner:t,outer:e});p=n?V.size(n):V.size(t),S.rect=Ei(!0,{computedPhysical:p.computedPhysical,computedOuter:e.computed||e,computedInner:t.computed||t},t),p=Ei(!0,{computedOuter:e.computed||e,computedInner:t.computed||t},p)},U.getRect=()=>S.rect;const Y=()=>{const t=V.renderArgs?V.renderArgs.slice(0):[],{rendererSettings:e}=y;let n=x;const i="function"==typeof(null==e?void 0:e.progressive)&&e.progressive();return x.items&&i&&(n=Pi(Pi({},x),{},{items:x.items.slice(i.start,i.end)})),t.push({data:n}),t};let X,G,K;function Z(t){const{rendererSettings:e}=y,n="function"==typeof(null==e?void 0:e.progressive)&&e.progressive();n?n.isFirst?w.nodes=[...t||[]]:w.nodes&&(w.nodes=[...w.nodes,...t||[]]):w.nodes=t}U.beforeMount=D,U.beforeRender=()=>{T({size:p})},U.render=()=>{const t=L.call(_,...Y());Z(t),V.render(t),X=t,G=S.rect.computed},U.hide=()=>{U.unmount(),V.size({x:0,y:0,width:0,height:0}),V.clear()},U.beforeUpdate=()=>{z({settings:y,data:x})},U.update=()=>{K&&K.stop();const{rendererSettings:t,brush:e,animations:n}=y;if("function"==typeof(null==t?void 0:t.transform)&&t.transform())return V.render(),void(X=null);const i=L.call(_,...Y());Z(i),k.forEach((t=>t.cleanUp())),k.length=0,M.tap=[],M.over=[],e&&(j(),F()),k.forEach((t=>{t.isActive()&&t.update()})),X&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:X,currentRect:S.rect.computed,previousRect:G}),K=function(t,e,n,i){let r,{old:o,current:a}=t,{renderer:s}=e,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},h={nodes:[],ips:[]},d=[],f=null;const p=n.trackBy||Jc,g={start(){let t={};if(o.forEach(((e,n)=>{let i=p(e,n);t[i]=e})),a.forEach(((e,n)=>{let i=p(e,n);if(t[i]){if("path"===e.type&&e.points&&e.points.length>0&&"trend"!==e.data.source.key){const n=function(t,e){const n=t.points.filter((t=>!t.dummy)),i=e.points.filter((t=>!t.dummy)),r=i.map((t=>t.data.major.value)),o=n.filter((t=>r.includes(t.data.major.value))).map((t=>t.data.major.value)),a=n.filter((t=>o.includes(t.data.major.value))),s=i.filter((t=>o.includes(t.data.major.value)));return{old:a,current:s}}(t[i],e);h.ips.push(Zc(Ei({},t[i],{points:n.old}),Ei({},e,{points:n.current}))),l.push(Ei({},t[i],{commonPoints:n.old}))}else h.ips.push(Zc(t[i],e)),l.push(t[i]);h.nodes.push(e),t[i]=!1}else c.nodes.push(e),c.ips.push(Zc(Ei({},e,{r:.001,opacity:0}),e))})),Object.keys(t).forEach((e=>{t[e]&&(u.nodes.push(t[e]),u.ips.push(Zc(t[e],Ei({},t[e],{r:1e-4,opacity:0}))))})),d.push({name:"exiting",easing:Wc,duration:200,tweens:u.ips,nodes:[...l]}),d.push({name:"updating",easing:Yc,duration:400,tweens:h.ips,nodes:[]}),d.push({name:"entering",easing:Uc,duration:200,tweens:c.ips,nodes:[...h.nodes]}),n.isMainComponent){var e;const t=null===(e=n.isMainComponent)||void 0===e?void 0:e.filterFn,r=t?l.filter(t).length:l.length,{isInit:o,shouldBeRemoved:a}=i.getValue("animations.updatingStageMeta");!1===o?(i.setValue("animations.updatingStageMeta.shouldBeRemoved",0===r),i.setValue("animations.updatingStageMeta.isInit",!0)):i.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===r)}d.length&&(f=s.getScene(a),d[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(g.tick)))},tick(){let t=d[0];t||g.stop(),t.started||(t.started=Date.now());let e=(Date.now()-t.started)/t.duration,n=[],o=t.tweens.map((n=>n(t.easing(Math.min(1,e)))));if(n.push(...o),n.push(...t.nodes),s.render(n),e>=1){d.shift();const{isInit:t,shouldBeRemoved:e}=i.getValue("animations.updatingStageMeta");d.length?"updating"===d[0].name&&e&&d.shift():(!0===t&&i.setValue("animations.updatingStageMeta.isInit",!1),g.stop())}r&&(r=window.requestAnimationFrame(g.tick))},stop(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:()=>!!r,get targetScene(){return f}};return g}({old:X,current:i},{renderer:V},n,r.storage),K.start()):V.render(i),X=i,G=S.rect.computed,V.setKey&&"string"==typeof m.key&&V.setKey(m.key)},U.updated=I,U.destroy=()=>{U.unmount(),P(f),V.destroy(),q(),f=null};const J=t=>{w.nodes=t,k.forEach((t=>{t.isActive()&&t.update()})),V.render(t)};return Du(_,t,{settings:()=>y,data:()=>x,scale:()=>h,formatter:()=>d,renderer:()=>V,chart:()=>r,dockConfig:()=>H,mediator:()=>a,instance:()=>S,rect:()=>S.rect,style:()=>g,update:()=>J,registries:()=>s,resolver:()=>v,symbol:()=>Au(s.symbol)}),Du(S,m,{settings:()=>y,data:()=>x,scale:()=>h,formatter:()=>d,renderer:()=>V,chart:()=>r,dockConfig:()=>H,mediator:()=>a,style:()=>g,_DO_NOT_USE_getInfo:i.bind(_),isVisible:()=>b}),U.getBrushedShapes=function(t,e,n){const i=[];if(y.brush&&y.brush.consume){const o=r.brush(t),a=V.findShapes("*");y.brush.consume.filter((e=>e.context===t)).forEach((t=>{for(let r=0;r<a.length;r++){const s=a[r];s.data&&o.containsMappedData(s.data,n||t.data,e)&&(W(s),i.push(s),a.splice(r,1),r--)}}))}return i},U.findShapes=t=>{var e;const n=(null!==(e=K)&&void 0!==e&&e.inProgress()?K.targetScene:V).findShapes(t);for(let t=0,e=n.length;t<e;t++)W(n[t]);return n},U.shapesAt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=V.itemsAt(t);let i;i=e&&"stop"===e.propagation&&n.length>0?[n.pop().node]:n.map((t=>t.node));for(let t=0,e=i.length;t<e;t++)W(i[t]);return i},U.brushFromShapes=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.contexts=Array.isArray(e.contexts)?e.contexts:[];su({nodes:t,action:e.action||"toggle",trigger:e,chart:r,data:w.data})},U.mount=()=>{f=V.element&&V.element()?f:V.appendTo(o),V.setKey&&"string"==typeof m.key&&V.setKey(m.key),y.brush&&(j(),F()),Eu(S,u,m),Eu(_,u,t),b=!0},U.mounted=()=>O(f),U.unmount=()=>{[S,_].forEach((t=>{!function(t,e){t.eventListeners&&(t.eventListeners.forEach((t=>{let{event:n,listener:i}=t;e.removeListener(n,i)})),t.eventListeners.length=0),t.emit=()=>{}}(t,u)})),M.tap=[],M.over=[],k.forEach((t=>{t.cleanUp()})),k.length=0,E(),b=!1},U.onBrushTap=t=>{M.tap.forEach((e=>{(function(t){let{e:e,t:n,config:i}=t;return lu({collisions:cu(e,n,i.renderer),t:n,config:i,action:uu(n.action,e,"toggle")})})({e:t,t:e,config:w})&&"stop"===e.globalPropagation&&r.toggleBrushing(!0)}))},U.onBrushOver=t=>{M.over.forEach((e=>{(function(t){let{e:e,t:n,config:i}=t;return lu({collisions:cu(e,n,i.renderer),t:n,config:i,action:uu(n.action,e,"set")})})({e:t,t:e,config:w})&&"stop"===e.globalPropagation&&r.toggleBrushing(!0)}))},U.def=_,U.ctx=S,U.renderer=()=>V,U.set({settings:m}),C(),U}function Iu(t){const e=Ei(!0,{},t),n={getAll:()=>e,getValue:(t,n)=>function(t,e,n){if(void 0===t||void 0===e)return n;const i=e.split(".");let r=t;for(let t=0;t<i.length;++t){const e=i[t];if(void 0===r[e])return n;r=r[e]}return r}(e,t,n),setValue:(t,n)=>function(t,e,n){if(void 0===t||void 0===e)return;const i=e.split("."),r=i[i.length-1];let o=t;for(let t=0;t<i.length-1;++t){const e=i[t];void 0===o[e]&&(o[e]=Number.isNaN(+i[t+1])?{}:[]),o=o[e]}void 0!==n?o[r]=n:delete o[r]}(e,t,n)};return n}function Tu(t,e,n){const i=mu(function(t,e){const n=ku(t,e)/ku(e,e)||1;return{x:e.x*n,y:e.y*n}}(yu(n,t),yu(e,t)),t);return i}function Pu(t,e,n){return Mu(t,n)+Mu(e,n)-Mu(t,e)<1e-12}function qu(t,e){return t.x>=e.x&&t.x+t.width<=e.x+e.width&&t.y>=e.y&&t.y+t.height<=e.y+e.height}function Lu(t){return t.x1===t.x2&&t.y1===t.y2}function ju(t){return t.width<=0||t.height<=0}function Fu(t){return t.r<=0}function Bu(t){return t.edges.length<=2}function Vu(t,e){let n=!1;for(let i=0,r=e.edges.length;i<r;i++)if(n=Gu(t,Hi(e.edges[i])),!0===n)return!0;return!1}function $u(t,e){let n=!1;const{numPolygons:i,polygons:r}=e;for(let e=0;e<i;e++){if(n=rh(t,r[e]),!0===n)return!0}return!1}function Hu(t,e){if(Fu(t))return!1;return wu({x:t.cx,y:t.cy},e)<=t.r**2}function Wu(t,e){if(ju(e)||Fu(t))return!1;const n=e.width/2,i=e.height/2,r=e.x+n,o=e.y+i,a=t.r,s=t.cx,l=t.cy,c=Math.abs(s-r),u=Math.abs(l-o);if(c>n+a||u>i+a)return!1;if(c<=n||u<=i)return!0;return(c-n)**2+(u-i)**2<=a**2}function Uu(t,e){if(Fu(t)||Lu(e))return!1;const[n,i]=Bi(e);if(Hu(t,n)||Hu(t,i))return!0;const r={x:t.cx,y:t.cy},o=Tu(n,i,r);return wu(o,r)<=t.r**2&&Pu(n,i,o)}function Yu(t,e){if(Bu(e)||Fu(t))return!1;if(Xu(e,{x:t.cx,y:t.cy}))return!0;const n=e.edges.length;for(let i=0;i<n;i++){if(Uu(t,Hi(e.edges[i])))return!0}return!1}function Xu(t,e){if(Bu(t)||!Qu(t.boundingRect(),e))return!1;const{x:n,y:i}=e,r=t.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=r.length,s=a-1;++l<a;s=l){if(r[l].x===n&&r[l].y===i)return!0;if(r[l].y===r[s].y&&r[l].y===i&&(n-r[l].x)*(n-r[s].x)<=0)return!0;if(r[l].y<i&&i<=r[s].y||r[s].y<i&&i<=r[l].y){if(c=(r[s].x-r[l].x)*(i-r[l].y)/(r[s].y-r[l].y)+r[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function Gu(t,e){if(Bu(t))return!1;for(let n=0,i=t.edges.length;n<i;n++){if(eh(e,Hi(t.edges[n])))return!0}const[n,i]=Bi(e);return Xu(t,n)||Xu(t,i)}function Ku(t,e){if(Bu(t))return!1;for(let n=0,i=t.edges.length;n<i;n++){if(th(e,Hi(t.edges[n])))return!0}const[n,i,r,o]=Vi(e);return Xu(t,n)||Xu(t,i)||Xu(t,r)||Xu(t,o)}function Zu(t,e){return!ju(t)&&!ju(e)&&(t.x<=e.x+e.width&&e.x<=t.x+t.width&&t.y<=e.y+e.height&&e.y<=t.y+t.height)}function Ju(t,e){if(ju(t)||ju(e))return!1;return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}].every((e=>Qu(t,e)))}function Qu(t,e){return!ju(t)&&(e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height)}function th(t,e){if(Lu(e)||ju(t))return!1;const[n,i]=Bi(e);if(Qu(t,n)||Qu(t,i))return!0;const r=Vi(t);let o=r.length;for(let t=0;t<o;t++){if(eh(Hi([r[t],r[3!==t?t+1:0]]),e))return!0}return!1}function eh(t,e){const[n,i]=Bi(t),[r,o]=Bi(e),a=vu(i,n),s=bu(i,n),l=vu(o,r),c=bu(o,r),u=vu(n,r),h=bu(n,r);let d=c*a-l*s;const f=l*h-c*u,p=a*h-s*u;let g,m;if(0===a&&0===s)return!1;if(0===l&&0===c)return!1;if(0===d){if(0===f&&0===p){if(0===a){if(0===s)return n.x===i.x&&n.y===i.y;g=bu(r,n)/s,m=bu(o,n)/s}else g=(r.x-n.x)/a,m=(o.x-n.x)/a;return!(g<0&&m<0||g>1&&m>1)}return!1}const y=f/d;return d=p/d,y>=0&&y<=1&&d>=0&&d<=1}function nh(t,e){if(Lu(t))return!1;const[n,i]=Bi(t);return Pu(n,i,e)}function ih(t,e){const n=t.boundingRect(),i=e.boundingRect();return!!Zu(n,i)&&(Ju(n,i)?Vu(t,e):Vu(e,t))}function rh(t,e){const n=t.boundingRect(),i=e.boundingRect();return!!Zu(n,i)&&(Ju(i,n)?function(t,e){let n=!1;const{numPolygons:i,polygons:r}=t;for(let t=0;t<i;t++)if(n=ih(e,r[t]),!0===n)return!0;return!1}(t,e):function(t,e){let n=!1;for(let i=0,r=e.edges.length;i<r;i++)if(n=sh(t,Hi(e.edges[i])),!0===n)return!0;return!1}(t,e))}function oh(t,e){if(Fu(t))return!1;if(ah(e,{x:t.cx,y:t.cy}))return!0;const{numPolygons:n,polygons:i}=e;for(let e=0;e<n;e++){const n=i[e],r=n.edges.length;for(let e=0;e<r;e++){if(Uu(t,Hi(n.edges[e])))return!0}}return!1}function ah(t,e){if(!Qu(t.boundingRect(),e))return!1;const{x:n,y:i}=e,r=t.numPolygons;let o,a,s,l,c,u,h=!1;for(a=0;a<r;a++)for(o=t.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===i)return!0;if(o[c].y===o[l].y&&o[c].y===i&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<i&&i<=o[l].y||o[l].y<i&&i<=o[c].y){if(u=(o[l].x-o[c].x)*(i-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(h=!h)}}return h}function sh(t,e){const[n,i]=Bi(e);if(ah(t,n)||ah(t,i))return!0;const{numPolygons:r,polygons:o}=t;for(let t=0;t<r;t++){const n=o[t];for(let t=0,i=n.edges.length;t<i;t++){if(eh(e,Hi(n.edges[t])))return!0}}return!1}function lh(t,e){const[n,i,r,o]=Vi(e);if(ah(t,n)||ah(t,i)||ah(t,r)||ah(t,o))return!0;const{numPolygons:a,polygons:s}=t;for(let t=0;t<a;t++){const n=s[t];for(let t=0,i=n.edges.length;t<i;t++){if(th(e,Hi(n.edges[t])))return!0}}return!1}const ch=/^\$/,uh="@extend";function hh(t){throw new Error('Cyclical reference for "'.concat(t,'"'))}function dh(t,e,n){if("string"==typeof t){let i=e[t];return-1!==n.indexOf(t)&&hh(t),ch.test(i)?(n.push(t),dh(i,e,n)):i}let i=t;const r=Ei(!0,{},e,t),o={};if(t[uh]){const o=t[uh];-1!==n.indexOf(o)&&hh(o);let a=n.slice();a.push(o),i=Ei(!0,{},dh(r[o],e,a),t)}return Object.keys(i).forEach((t=>{let e=n.slice();if(t===uh||ch.test(t))return;o[t]=i[t];let a=o[t];ch.test(a)&&a in r?(-1!==n.indexOf(a)&&hh(a),e.push(a),a=r[a],"object"==typeof a||ch.test(a)&&a in r?o[t]=dh(a,r,e):o[t]=a):"object"==typeof a&&(o[t]=dh(a,r,e))})),o}function fh(t,e){return dh(t,e,[])}function ph(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={},n=t;const i=t=>{t.forEach((t=>{const n=Array.isArray(t.colors[0])?t.colors:[t.colors];e[t.key]={colors:n,sizes:n.map((t=>t?t.length:0))}}))},r={palette:(t,n)=>((t,n)=>{const i=e[t];if(!i)return[];const r=i.sizes;for(let t=0;t<r.length;t++)if(n<=r[t])return i.colors[t];return i.colors[r.length-1]})(t,n),setPalettes:i,style:t=>fh(t,n),setStyle:e=>{n=Ei({},t,e)}};return i(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),r}function gh(t){t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height)}function mh(t){const e={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return Ei(!0,e,t),e.center.minWidthRatio=Math.min(Math.max(e.center.minWidthRatio,0),1),e.center.minHeightRatio=Math.min(Math.max(e.center.minHeightRatio,0),1),e.center.minWidth=Math.max(e.center.minWidth,0),e.center.minHeight=Math.max(e.center.minHeight,0),e}function yh(t,e,n,i,r){return{x:isNaN(t)?0:t,y:isNaN(t)?0:e,width:isNaN(t)?0:n,height:isNaN(t)?0:i,margin:isNaN(r)?0:r}}function xh(t,e,n){if(void 0===t.cachedSize){const i=t.config.dock();let r,o=t.comp.preferredSize({inner:e,outer:n,dock:i});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},r="top"===i||"bottom"===i?o.height:"right"===i||"left"===i?o.width:Math.max(o.width,o.height),t.cachedSize=Math.ceil(r),t.edgeBleed=o.edgeBleed||0}return t.cachedSize}function vh(t,e){switch(e.config.dock()){case"top":t.y+=e.cachedSize,t.height-=e.cachedSize;break;case"bottom":t.height-=e.cachedSize;break;case"left":t.x+=e.cachedSize,t.width-=e.cachedSize;break;case"right":t.width-=e.cachedSize}}function bh(t,e){const n=e.edgeBleed;n&&(t.left=Math.max(t.left,n.left||0),t.right=Math.max(t.right,n.right||0),t.top=Math.max(t.top,n.top||0),t.bottom=Math.max(t.bottom,n.bottom||0))}function wh(t,e,n){e.x<n.left&&(e.width-=n.left-e.x,e.x=n.left);const i=t.width-(e.x+e.width);i<n.right&&(e.width-=n.right-i),e.y<n.top&&(e.height-=n.top-e.y,e.y=n.top);const r=t.height-(e.y+e.height);r<n.bottom&&(e.height-=n.bottom-r)}function Mh(t,e,n,i,r){const o=Ei({},e),a=Ei({},n);vh(o,i),bh(a,i),wh(t,o,a);const s=function(t,e,n){const i=Math.min(n.center.minWidth,t.width)||Math.max(t.width*n.center.minWidthRatio,1),r=Math.min(n.center.minHeight,t.height)||Math.max(t.height*n.center.minHeightRatio,1);return e.width>=i&&e.height>=r}(t,o,r);return!!s&&(vh(e,i),bh(n,i),!0)}function kh(t){return{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y}}function _h(t){return $i([].concat(...t.map(Vi)))}function Sh(t){let{visible:e,layoutRect:n,reducedRect:i,containerRect:r,translation:o}=t;const a=yh(i.x,i.y,i.width,i.height),s=yh(i.x,i.y,i.width,i.height),l={},c=e.slice(),u=c.slice().sort(((t,e)=>t.config.displayOrder()-e.config.displayOrder()));return e.sort(((t,e)=>{if(t.referencedDocks.length>0&&e.referencedDocks.length>0)return 0;if(e.referencedDocks.length>0)return-1;if(t.referencedDocks.length>0)return 1;const n=t.config.displayOrder()-e.config.displayOrder();return 0===n?c.indexOf(t)-c.indexOf(e):n})).forEach((t=>{let e={},c={};switch(t.config.dock()){case"top":e.height=c.height=t.cachedSize,e.width=n.width,c.width=a.width,e.x=n.x,c.x=a.x,e.y=c.y=a.y-t.cachedSize,a.y-=t.cachedSize,a.height+=t.cachedSize;break;case"bottom":e.x=n.x,c.x=a.x,e.y=c.y=a.y+a.height,e.width=n.width,c.width=a.width,e.height=c.height=t.cachedSize,a.height+=t.cachedSize;break;case"left":e.x=c.x=s.x-t.cachedSize,e.y=n.y,c.y=s.y,e.width=c.width=t.cachedSize,e.height=n.height,c.height=s.height,s.x-=t.cachedSize,s.width+=t.cachedSize;break;case"right":e.x=c.x=s.x+s.width,e.y=n.y,c.y=s.y,e.width=c.width=t.cachedSize,e.height=n.height,c.height=s.height,s.width+=t.cachedSize;break;case"center":e.x=c.x=i.x,e.y=c.y=i.y,e.width=c.width=i.width,e.height=c.height=i.height;break;default:if(t.referencedDocks.length>0){const n=t.referencedDocks.map((t=>l[t])).filter((t=>!!t));n.length>0&&(e=_h(n.map((t=>t.outerRect))),c=_h(n.map((t=>t.r))))}}t.key&&(l[t.key]={r:c,outerRect:e}),function(t,e,n,i){const r={x:i.width/n.width,y:i.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const t=r.x<r.y,e=Math.min(r.x,r.y);r.x=e,r.y=e;const a=t?"height":"width",s=(i[a]-n[a]*r.x)*n.align;o.left=t?0:s,o.top=t?s:0}t.scaleRatio=r,t.margin=o,e.scaleRatio=r,e.margin=o,n.scaleRatio=r,n.margin=o}(c,e,n,r),c.edgeBleed=t.edgeBleed,c.computed=kh(c),e.edgeBleed=t.edgeBleed,e.computed=kh(e),c.x+=o.x,c.y+=o.y,e.x+=o.x,e.y+=o.y,t.comp.resize(c,e),t.cachedSize=void 0,t.edgeBleed=void 0})),u}function Nh(t,e,n){const i=t.layoutModes||{},r=e.minimumLayoutMode();let o=e.show();return o&&"object"==typeof r?o=i[r.width]&&i[r.height]&&n.width>=i[r.width].width&&n.height>=i[r.height].height:o&&void 0!==r&&(o=i[r]&&n.width>=i[r].width&&n.height>=i[r].height),o}function Rh(t){if(!t.resize||"function"!=typeof t.resize)throw new Error("Component is missing resize function");if(!t.dockConfig&&!t.preferredSize)throw new Error("Component is missing preferredSize function")}function Ah(t){let e=mh(t);const n={};return n.layout=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t||isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:i,containerRect:r}=function(t,e){const n={x:0,y:0,width:0,height:0},i={x:0,y:0,width:0,height:0};return n.width=t.width||0,n.height=t.height||0,void 0!==e.size&&(n.width=isNaN(e.size.width)?n.width:e.size.width,n.height=isNaN(e.size.height)?n.height:e.size.height),void 0!==e.logicalSize?(i.width=isNaN(e.logicalSize.width)?n.width:e.logicalSize.width,i.height=isNaN(e.logicalSize.height)?n.height:e.logicalSize.height,i.align=isNaN(e.logicalSize.align)?.5:Math.min(Math.max(e.logicalSize.align,0),1),i.preserveAspectRatio=e.logicalSize.preserveAspectRatio):(i.width=n.width,i.height=n.height,i.preserveAspectRatio=!1),gh(i),gh(n),{logicalContainerRect:i,containerRect:n}}(t,e),[o,a]=function(t,e,n){const i=[],r=[];for(let o=0;o<t.length;++o){const a=t[o];Rh(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map((t=>t.replace(/^\s*@/,""))):[];Nh(e,s,n)?i.push({comp:a,key:l,config:s,referencedDocks:u}):r.push({comp:a,key:l,config:s,referencedDocks:u})}return[i,r]}(n,e,i),s=function(t){let{layoutRect:e,visible:n,hidden:i,settings:r}=t;const o=yh(e.x,e.y,e.width,e.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort(((t,e)=>t.config.prioOrder()-e.config.prioOrder()));for(let t=0;t<s.length;++t){const n=s[t];xh(n,o,e),Mh(e,o,a,n,r)||(i.push(s.splice(t,1)[0]),--t)}!function(t,e){if(0!==e.length)for(let n=0;n<t.length;++n){let i=t[n];if(i.referencedDocks.length){const r=i.referencedDocks.every((t=>e.some((e=>e.key===t))));r&&e.push(t.splice(n,1)[0])}}}(n,i);const l=n.filter((t=>-1!==s.indexOf(t)));return n.length=0,n.push(...l),wh(e,o,a),o}({layoutRect:i,visible:o,hidden:a,settings:e}),l=Sh({visible:o,layoutRect:i,reducedRect:s,containerRect:r,translation:{x:t.x,y:t.y}});return a.forEach((t=>{t.comp.visible=!1;const e=yh();t.comp.resize(e,e)})),{visible:o.map((t=>t.comp)),hidden:a.map((t=>t.comp)),ordered:l.map((t=>t.comp))}},n.settings=function(t){e=mh(t)},n}const Ch=(t,e)=>{for(let n=0;n<t.length;n++){const i=t[n];if(i.hasKey&&i.key===e)return t[n]}return null},Dh=t=>null==t?void 0:t.map((t=>{const e=t.instance.dockConfig();return{preferredSize:n=>e.computePreferredSize(Pi(Pi({},n),{},{children:Dh(t.children)}))}})),Oh=(t,e)=>({visible:[],hidden:e,ordered:[]}),Eh=t=>(e,n)=>{var i;const r=n.map(((t,e)=>{const n=t.instance.dockConfig();return{index:e,key:t.key,dockConfig:n,resize:t.instance.resize,preferredSize:e=>n.computePreferredSize(Pi(Pi({},e),{},{children:Dh(t.children)}))}})),o=t=>n[t.index],{visible:a=r,hidden:s=[],ordered:l=a}=null!==(i=t(e,r))&&void 0!==i?i:{};return{visible:a.map(o),hidden:s.map(o),ordered:l.map(o)}},zh=t=>"function"==typeof t?Eh(t):(t=>{const e=Ah(t);return Eh(((t,n)=>e.layout(t,n)))})(t);function Ih(t,e,n){const i=e.left-n.left,r=e.top-n.top,o=Wi(t),a=Ei(!0,{},t);switch(o){case"circle":a.cx+=i,a.cy+=r;break;case"polygon":for(let t=0,e=a.vertices.length;t<e;t++){const e=a.vertices[t];e.x+=i,e.y+=r}break;case"geopolygon":for(let t=0;t<a.vertices.length;t++){const e=a.vertices[t];for(let t=0,n=e.length;t<n;t++){const n=e[t];n.x+=i,n.y+=r}}break;case"line":a.x1+=i,a.y1+=r,a.x2+=i,a.y2+=r;break;case"point":case"rect":a.x+=i,a.y+=r}return a}function Th(t,e){const n=[];let i=0;e.forEach((t=>{n.push(i),i++;const e=t.instance.def.additionalElements&&t.instance.def.additionalElements();e&&(i+=e.length)})),e.forEach(((e,i)=>((t,e,n)=>{const i=e.instance.renderer().element();if(isNaN(n)||!i||!t||!t.children)return;const r=t.children[Math.max(0,n)];if(i===r)return;const o=e.instance.def.additionalElements&&e.instance.def.additionalElements().filter(Boolean);t.insertBefore&&void 0!==r?(t.insertBefore(i,r),o&&o.forEach((e=>{t.insertBefore(e,i)}))):(o&&o.forEach((e=>{t.appendChild(e,i)})),t.appendChild(i))})(t,e,n[i])))}function Ph(t,e){let{element:n,data:i=[],settings:r={},on:o={}}=t;const a=e.registries,s=e.logger,l=ph(e.style,e.palettes),c=[],u=Ei({},t),h=function(){const t={};return Nc.mixin(t),t}();let d=[],f=null,p=null,g=null,m=[],y=()=>{},x=()=>{};const v={};let b=!1;const w=function(t){let{createComponent:e}=t;const n={};let i=[],r=[];const o=t=>{const n=e(t);return n&&(i.push(n),t.components&&(n.children=t.components.map((t=>o(t))).filter((t=>!!t)))),n},a=t=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)},s=(t,e)=>{for(let n=t.length-1;n>=0;n--){const i=t[n],r=e.find((t=>i.hasKey&&i.key===t.key));r?i.children&&r.components&&s(i.children,r.components):(t.splice(n,1),a(i),i.children&&s(i.children,[]),i.instance.destroy())}},l=t=>{let{compList:e,data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:s}=t;return s.map((t=>{const s=Ch(e,t.key);return i.indexOf(t.key)>-1?(delete s.updateWith,s):s?(t.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(t.rendererSettings),t.rendererSettings&&"function"==typeof t.rendererSettings.transform&&t.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:r,scales:a,data:n,settings:t},t.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:t.components})),s)):o(t)})).filter((t=>!!t))},c=t=>{let{components:e,hidden:n,layoutFn:i,ordered:r,rect:o,visible:a}=t;const{visible:s,hidden:l,ordered:u}=i(o,e);a.push(...s),n.push(...l),r.push(...u),s.forEach((t=>{if(t.children){var e,i;const o=zh(null!==(e=null===(i=t.settings)||void 0===i?void 0:i.strategy)&&void 0!==e?e:{});c({components:t.children,hidden:n,layoutFn:o,ordered:r,rect:t.instance.getRect(),visible:a})}})),l.forEach((t=>{t.children&&c({components:t.children,hidden:n,layoutFn:Oh,ordered:r,rect:null,visible:a})}))};return n.destroy=()=>{i.forEach((t=>t.instance.destroy())),i=[],r=[]},n.findComponentByKey=t=>Ch(i,t),n.forEach=t=>{i.forEach(t)},n.layout=t=>{let{layoutSettings:e,rect:n}=t;const i=[],o=[],a=[],s=zh(e);return c({components:r,hidden:o,layoutFn:s,ordered:a,rect:n,visible:i}),{visible:i,hidden:o,ordered:a}},n.set=t=>{let{components:e}=t;r=e.map((t=>o(t))).filter((t=>!!t))},n.update=t=>{let{components:e,data:n,excludeFromUpdate:i,formatters:o,scales:a}=t;s(r,e),r=l({compList:r,data:n,excludeFromUpdate:i,formatters:o,scales:a,settingsList:e})},n}({createComponent:t=>{if(!a.component.has(t.type))return s.warn("Unknown component: ".concat(t.type)),!1;return{instance:zu(a.component(t.type),{settings:t,chart:u,mediator:h,registries:a,theme:l,container:n}),settings:Ei(!0,{},t),key:t.key,hasKey:void 0!==t.key}}});function M(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const i="function"==typeof t[e];let r;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return r=i?t[e].call(u,...a):n.call(u,...a),r}}const k=()=>{let t;r.dockLayout?(s.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),t=r.dockLayout):t=r.strategy;const e=function(t){if("function"==typeof t.getBoundingClientRect){const{width:e,height:n}=t.getBoundingClientRect();return{x:0,y:0,width:e,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:t,rect:e})},_=M("created"),S=M("beforeMount"),N=M("mounted"),R=M("beforeUpdate"),A=M("updated"),C=M("beforeRender"),D=M("beforeDestroy"),O=M("destroyed"),E=function(t,e){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:i={},scales:r={},scroll:o={}}=e;y=function(t,e){let{types:n,logger:i}=e;const r={},o=[];return Array.isArray(t)?o.push(...t):(i.warn('Deprecated: "data-source" configuration"'),o.push(t)),o.forEach(((t,e)=>{let o=n(t.type);if(o){let n=t.key;void 0===t.key&&(i.warn("Missing key for dataset. Using index '".concat(e,"' as key.")),n=e);let a=o({key:n,data:t.data,config:t.config});r[n]=a}})),t=>t?r[t]:r[Object.keys(r)[0]]}(t,{logger:s,types:a.data}),n||Object.keys(v).forEach((t=>v[t].clear())),e.palettes&&l.setPalettes(e.palettes),e.style&&l.setStyle(e.style),x=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ps;const r={};return(t||[]).forEach((t=>{if(!t.key)throw new Error('Data collection is missing "key" property');if("object"==typeof t.data&&"collection"in t.data)throw new Error("Data config for collections may not reference other collections");r[t.key]=()=>i(t.data,e,n)})),t=>{let e,n;if("string"==typeof t?e=t:"object"==typeof t&&(e=t.key,n=t),!(e in r))throw new Error("Unknown data collection: ".concat(e));"function"==typeof r[e]&&(r[e]=r[e]());let i=r[e];if(n&&n.fields&&n.fields.filter){let t=i.fields.filter(n.fields.filter);i.fields.length!==t.length&&(i=Ei(i,{fields:t}))}return i}}(e.collections,{dataset:y},{logger:s});const c={theme:l,logger:s};f=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mc;const r={};return{get(o){let a;return"string"==typeof o&&t[o]?a=o:"object"==typeof o&&"scale"in o&&t[o.scale]&&(a=o.scale),a?(r[a]=r[a]||i(t[a],e,n),r[a]):i(o,e,n)},all(){return Object.keys(t).forEach(this.get),r}}}(r,{dataset:y,collection:x},Pi(Pi({},c),{},{scale:a.scale})),p=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:qs;const r={};return{get(o){let a;return"string"==typeof o&&t[o]?a=o:"object"==typeof o&&"formatter"in o&&t[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&t[o.type]&&(a=o.type),a?(r[a]=r[a]||i(t[a],e,n),r[a]):i(o||{},e,n)},all(){return Object.keys(t).forEach(this.get),r}}}(i,{dataset:y,collection:x},Pi(Pi({},c),{},{formatter:a.formatter})),g=function(t,e){const n={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=Ac(t[i],e?e[i]:null));return n}(o,g)};function z(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e={},i=t.filter((t=>!!t.key)).map((t=>t.key));m.forEach((t=>{t.key&&-1!==i.indexOf(t.key)?e[t.key]=t:t.destroy()})),m=t.map((t=>{const i=t.key&&e[t.key]?e[t.key]:a.interaction(t.type)(u,h,n);return i.set(t),i}))}const I=t=>{const e=n.getBoundingClientRect(),i="clientX"in t?t.clientX:t.x,r="clientY"in t?t.clientY:t.y,o={x:i-e.left,y:r-e.top},a=[];return d.forEach((t=>{const e=t.instance.getRect();Qu(e.computedPhysical?e.computedPhysical:{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y},o)&&a.push(t)})),a},T=()=>{if(c.length||!n)return;Object.keys(o).forEach((t=>{const e=o[t].bind(u);n.addEventListener(t,e),c.push({key:t,listener:e})}));const t={},e=e=>{e.touches?(t.x=e.touches[0].clientX,t.y=e.touches[0].clientY,t.multiTouch=e.touches.length>1):(t.x=e.clientX,t.y=e.clientY,t.multiTouch=!1),t.time=Date.now(),t.comps=I(t)},i=e=>{const n=t.comps||I(e);if(!n.every((t=>t.instance.def.disableTriggers))&&("touchend"===e.type&&e.preventDefault(),function(t,e){const n=qi(t),i=n?t.changedTouches[0]:t,r=Date.now()-e.time,o=isNaN(e.x)?0:Math.abs(i.clientX-e.x),a=isNaN(e.y)?0:Math.abs(i.clientY-e.y);return(0===t.button||n)&&!e.multiTouch&&o<=12&&a<=12&&r<=300}(e,t)))for(let t=n.length-1;t>=0;t--){if(n[t].instance.onBrushTap(e),b){b=!1;break}}},r=[];r.push({key:"mousedown",listener:e}),r.push({key:"mouseup",listener:i}),function(t){return"ontouchstart"in t&&"ontouchend"in t||navigator.maxTouchPoints>1}(n)&&(r.push({key:"touchstart",listener:e}),r.push({key:"touchend",listener:i})),r.push({key:"mousemove",listener:t=>{const e=I(t);for(let n=e.length-1;n>=0;n--){if(e[n].instance.onBrushOver(t),b){b=!1;break}}}}),r.forEach((t=>{n.addEventListener(t.key,t.listener),c.push(t)}))},P=()=>{c.forEach((t=>{let{key:e,listener:i}=t;return n.removeEventListener(e,i)})),c.length=0},q=()=>{n.innerHTML="",(()=>{const{components:t=[]}=r;C(),E(i,r),w.set({components:t});const{visible:e,hidden:o,ordered:a}=k();d=e,o.forEach((t=>{t.instance.hide(),t.visible=!1})),e.forEach((t=>t.instance.beforeMount())),e.forEach((t=>t.instance.mount())),e.forEach((t=>t.instance.beforeRender())),e.forEach((t=>t.instance.render())),e.forEach((t=>t.instance.mounted())),e.forEach((t=>{t.visible=!0})),Th(n,a)})(),T(),z(r.interactions)};return u.layoutComponents=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:e=[]}=t;t.data&&(i=t.data),t.settings&&(r=t.settings,z(t.settings.interactions)),R(),E(i,r);const{formatters:n,scales:o,components:a=[]}=r;w.update({components:a,data:i,excludeFromUpdate:e,formatters:n,scales:o}),w.forEach((t=>{t.updateWith&&t.instance.set(t.updateWith)})),w.forEach((t=>{t.updateWith&&t.instance.beforeUpdate()})),k()},u.update=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:e,excludeFromUpdate:o=[]}=t;let a;t.data&&(i=t.data),t.settings&&(r=t.settings,z(t.settings.interactions)),R(),E(i,r,{partialData:e});const{formatters:s,scales:l,components:c=[]}=r;w.update({components:c,data:i,excludeFromUpdate:o,formatters:s,scales:l}),w.forEach((t=>{t.updateWith&&t.instance.set(t.updateWith)})),w.forEach((t=>{t.updateWith&&t.instance.beforeUpdate()}));const u=[],h=[];let f;if(e)w.forEach((t=>{(t.updateWith||t.applyTransform)&&t.visible&&u.push(t)})),f=u;else{const{visible:t,hidden:e,ordered:n}=k();d=t,f=t,a=n,t.forEach((t=>{t.updateWith&&t.visible?u.push(t):h.push(t)})),e.forEach((t=>{t.instance.hide(),t.visible=!1,delete t.updateWith,t.applyTransform=!1}))}h.forEach((t=>t.instance.beforeMount())),h.forEach((t=>t.instance.mount())),f.forEach((t=>t.instance.beforeRender())),f.forEach((t=>{(t.updateWith||t.applyTransform)&&t.visible?t.instance.update():t.instance.render()})),e||Th(n,a),h.forEach((t=>t.instance.mounted())),u.forEach((t=>t.instance.updated())),d.forEach((t=>{delete t.updateWith,t.visible=!0,t.applyTransform=!1})),A()},u.destroy=()=>{D(),w.destroy(),P(),z(),delete u.update,delete u.destroy,O()},u.getAffectedShapes=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=[];return d.filter((t=>null==i||t.key===i)).forEach((i=>{const o=i.instance.getBrushedShapes(t,e,n);r=[...r,...o]})),r},u.findShapes=t=>{let e=[];return d.forEach((n=>{const i=n.instance.findShapes(t);e=[...e,...i]})),e},u.componentsFromPoint=t=>I(t).map((t=>t.instance.ctx)),u.shapesAt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];const r=n.getBoundingClientRect();let o=d;if(Array.isArray(e.components)&&e.components.length>0){const t=e.components.map((t=>t.key));o=d.filter((e=>-1!==t.indexOf(e.key))).map((n=>({instance:n.instance,opts:e.components[t.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=Ih(t,r,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===e.propagation;if(i=[...i,...l],i.length>0&&c)return i}return i},u.brushFromShapes=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<e.components.length;n++){const i=e.components[n].key;d.filter((t=>i===t.key)).forEach((i=>{let r=t.filter((t=>t.key===i.key));i.instance.brushFromShapes(r,e.components[n])}))}},u.scroll=function(){return function(t,e){return e[t]||(e[t]=Rc()),e[t]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",g)},u.dataset=t=>y(t),u.dataCollection=t=>x(t),u.scales=function(){return f.all()},u.formatters=function(){return p.all()},u.brush=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return v[t]||(v[t]=Hc()),v[t]},u.scale=function(t){return f.get(t)},u.formatter=function(t){return p.get(t)},u.toggleBrushing=function(t){b=void 0!==t?t:!b},u.component=t=>{const e=w.findComponentByKey(t);return null==e?void 0:e.instance.ctx},u.logger=()=>s,u.theme=()=>l,u.storage=Iu({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:m,on(){T(),m.forEach((t=>t.on()))},off(){P(),m.forEach((t=>t.off()))}})}),_(),n&&(S(),q(),N(n),u.element=n),u}const qh=t=>{let e=Gr(t);return e.prio=t=>t?e.default(t[0]):[e.default()],e.types=()=>e.getKeys(),e};var Lh=Gr();function jh(t,e,n){let{key:i}=n;const r={value:"function"==typeof t.value?t.value(e):void 0!==t.value?t.value:e};return r.label="function"==typeof t.label?t.label(e):void 0!==t.label?String(t.label):String(r.value),t.field&&(r.source={key:i,field:t.field.key()}),r}const Fh=t=>t.filter((t=>"number"==typeof t&&!isNaN(t)));const Bh=t=>{let{key:e,data:n,cache:i,config:r}=t;if(!n)return;let o=n;"string"==typeof o&&(o=(t=>{let{data:e,config:n}=t;const i=e.split("\n"),r=i[0],o=i[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(r){const t=[/,/,/\t/,/;/];for(let e=0;e<t.length;e++){const n=t[e];if(r&&o){if(n.test(r)&&n.test(o)&&r.split(n).length===o.split(n).length){a=n;break}}else n.test(r)&&(a=n)}}return i.map((t=>t.split(a)))})({data:n,config:r})),Array.isArray(o)&&function(t){let e,{source:n,data:i,cache:r,config:o}=t,a=i;const s=o&&o.parse;Array.isArray(i[0])?s&&!1===s.headers?e=i[0].map(((t,e)=>e)):(e=i[0],a=i.slice(1)):e=Object.keys(i[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=e;u=s&&"function"==typeof s.fields?s.fields(u.slice()):e.map((t=>({key:t,title:t}))),Array.isArray(i[0])?c=u.map((()=>[])):(c={},u.forEach((t=>{c[t.key]=[]})));for(let t=0;t<a.length;t++){const e=l?l(a[t],t,u):a[t];if(e)if(Array.isArray(e))for(let t=0;t<u.length;t++)c[t].push(e[t]);else for(let t=0;t<u.length;t++)c[u[t].key].push(e[u[t].key])}const h=Array.isArray(c)?t=>c[t]:t=>c[u[t].key];for(let t=0;t<u.length;t++){const e=h(t),i=Fh(e),o=i.length>0,a=o?"measure":"dimension",s=o?Math.min(...i):NaN,l=o?Math.max(...i):NaN;r.fields.push(Ms(Ei({source:n,key:t,title:u[t].title,values:e,min:s,max:l,type:a},u[t]),{value:u[t].value,label:u[t].label}))}}({data:o,cache:i,source:e,config:r})};function Vh(){let{key:t,data:e,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[]},r={key:()=>t,raw:()=>e,field:t=>function(t,e){let{cache:n}=e;if("number"==typeof t)return n.fields[t];for(let e=0;e<n.fields.length;e++)if(n.fields[e].key()===t)return n.fields[e];for(let e=0;e<n.fields.length;e++)if(n.fields[e].title()===t)return n.fields[e];return null}(t,{cache:i,matrix:e}),fields:()=>i.fields.slice(),extract:t=>function(t,e){const n=Array.isArray(t)?t:[t];let i=[];return n.forEach((t=>{if(void 0!==t.field){const n=e.field(t.field),r=e.key();if(!n)throw Error("Field '".concat(t.field,"' not found"));const{props:o,main:a}=Rs(t,e),s=Object.keys(o),l=!!t.trackBy,c=typeof t.trackBy,u={},h=[],d=n.items(),f=[];for(let e=0;e<d.length;e++){const n=d[e];if(a.filter&&!a.filter(n))continue;const i=jh(a,n,{key:r});s.forEach((t=>{const a=o[t];let s=a.field?a.field.items()[e]:n;i[t]=jh(a,s,{key:r})})),l&&Ds({cfg:t,itemData:n,obj:i,target:h,tracker:u,trackType:c}),f.push(i)}i=l?[...i,...Cs(h,{main:a,propsArr:s,props:o})]:[...i,...f]}})),i}(t,r),hierarchy:()=>null};return Bh({key:t,data:e,config:n,cache:i}),r}Vh.util={normalizeConfig:Rs,collect:Cs,track:Ds};const $h=Gr();$h.default("matrix"),$h("matrix",Vh),$h("default",Vh);const Hh=Gr();function Wh(t,e,n){return Math.max(t,Math.min(e,n))}function Uh(t){let{item:e,value:n,boxCenter:i,rendWidth:r,rendHeight:o,flipXY:a,symbol:s}=t,l="x",c="y",u=r,h=o,d=n<.5?90:-90;return a&&(l="y",c="x",u=o,h=r,d=n<.5?180:0),s(Ei({},e.oob,{[l]:i*u,[c]:Math.max(e.oob.size/2,Math.min(n*h,h-e.oob.size/2)),startAngle:d}))}function Yh(t){let{item:e,boxWidth:n,boxPadding:i,rendWidth:r,rendHeight:o,flipXY:a}=t,s="x",l="y",c="width",u="height",h=r,d=o;a&&(s="y",l="x",c="height",u="width",h=o,d=r);const{actualDiff:f,actualLow:p}=function(t){let{start:e,end:n,minPx:i=.1,maxPx:r=1}=t;const o=Math.max(e,n),a=Math.min(e,n),s=Wh(-.1,1.2,o),l=Wh(-.1,1.2,a),c=s*r-l*r,u=Math.max(i,c),h=(u-c)/2;return{actualDiff:u,startModifier:h,actualLow:l*r-h}}({start:e.start,end:e.end,minPx:e.box.minHeightPx,maxPx:d});return Ei({},e.box,{type:"rect",[s]:(i+e.major)*h,[l]:p,[u]:f,[c]:n*h,data:e.data||{},collider:{type:null}})}function Xh(t){let{item:e,from:n,to:i,boxCenter:r,rendWidth:o,rendHeight:a,flipXY:s}=t,l="x1",c="y1",u="x2",h="y2",d=o,f=a;return s&&(l="y1",c="x1",u="y2",h="x2",d=a,f=o),Ei({},e.line,{type:"line",[h]:Math.floor(n*f),[l]:r*d,[c]:Math.floor(i*f),[u]:r*d,data:e.data||{},collider:{type:null}})}function Gh(t){let{item:e,key:n,position:i,width:r,boxCenter:o,rendWidth:a,rendHeight:s,flipXY:l}=t,c="x1",u="y1",h="x2",d="y2",f=a,p=s;l&&(c="y1",u="x1",h="y2",d="x2",f=s,p=a);const g=r/2;return Ei({type:"line"},e[n],{[u]:Math.floor(i*p),[c]:(o-g)*f,[d]:Math.floor(i*p),[h]:(o+g)*f,r:g*f,cx:o*f,cy:i*p,width:r*f,data:e.data||{},collider:{type:null}})}function Kh(t,e,n){const{width:i,maxWidthPx:r,minWidthPx:o}=e.box,a=t>=0?1:-1;let s=Math.min(a*t*i,isNaN(r)?n:r/n);return s=isNaN(o)?s:Math.max(o/n,s),s*a}Hh("native",(function(t,e,n){let i,r,o={chart:t,mediator:e,element:n},a=[],s=!0;function l(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&Object.keys(i.events).forEach((t=>{const e=i.events[t].bind(o);n.addEventListener(t,e),a.push({key:t,listener:e})}))}function c(){a.forEach((t=>{let{key:e,listener:i}=t;n.removeEventListener(e,i)})),a=[]}return{get key(){return r},set(t){!function(t){r=t.key,i=t,i.events=i.events||[],void 0===i.enable&&(i.enable=!0)}(t),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,i=null}}}));const Zh={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},Jh=Object.keys(Zh),Qh={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(t){let{data:e}=t;const{width:n,height:i}=this.rect,r="horizontal"===this.settings.settings.orientation,{style:o,resolver:a,symbol:s}=this,l=Jh.filter((t=>!this.settings.settings[t]||!1!==this.settings.settings[t].show)),c={};l.forEach((t=>c[t]=Zh[t]));const u=function(t){let{keys:e,data:n,defaultSettings:i,style:r,settings:o,width:a,height:s,resolver:l}=t;const c=Ei(!0,{},i||{},r||{}),u={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},h=o.major;let d;d="object"==typeof h&&"object"==typeof h.ref&&void 0!==h.ref.start&&void 0!==h.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:Ei(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof h&&void 0!==h.binStart&&void 0!==h.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:Ei(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const f=o.minor||{},p={};["start","end","min","max","med"].forEach((t=>{(f[t]||n.items&&n.items.length&&n.items[0][t])&&(p[t]={scale:f.scale,ref:t})}));let g,m={major:d,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:Ei(!0,{},p,f)})};for(let t=0,i=e.length;t<i;t++)o[g]&&!1===o[g].show||(g=e[t],m[g]=l.resolve({data:n,defaults:c[g],settings:o[g],scaled:u}));return m}({keys:l,data:e,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:i,resolver:a}),{settings:h,items:d}=u,f=function(t){let{width:e,height:n,flipXY:i,resolved:r,keys:o,symbol:a}=t;const s=[],l=r.major.items;if(!l.length)return s;const c=e,u=n,h=i?n:e,d=r.major.settings,f=["start","end","min","max","med"].filter((t=>void 0!==r.minor.settings[t])),p=f.length,g=o.filter((t=>"oob"!==t));let m,y,x,v,b,w,M,k,_;const S=o?o.length:0,N=g?g.length:0,R={box:function(){x.box&&Li(x.start)&&Li(x.end)&&m.push(Yh({item:x,boxWidth:v,boxPadding:b,rendWidth:c,rendHeight:u,flipXY:i}))},line:function(){Li(x.min)&&Li(x.start)&&m.push(Xh({item:x,from:x.min,to:x.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),Li(x.max)&&Li(x.end)&&m.push(Xh({item:x,from:x.max,to:x.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},median:function(){x.median&&Li(x.med)&&m.push(Gh({item:x,key:"median",position:x.med,width:v,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},whisker:function(){if(x.whisker){const t=v*x.whisker.width;Li(x.min)&&m.push(Gh({item:x,key:"whisker",position:x.min,width:t,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),Li(x.max)&&m.push(Gh({item:x,key:"whisker",position:x.max,width:t,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))}}};function A(){let t,e=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let i=0;i<p;i++)t=x[f[i]],Li(t)&&(e<t&&(e=t),n>t&&(n=t));M=e<0&&e!==-Number.MAX_VALUE,k=n>1&&n!==Number.MAX_VALUE,_=M||k}for(let t=0,e=l.length;t<e;t++){m=[],y=null;const e=l[t],n=e.data;let f=null,p=null;void 0!==d.binStart?(f=e.binStart,p=e.binEnd,y=d.binStart.scale):(y=d.major.scale,f=y?e.major:0);let C=0;y?y.bandwidth?(C=y.bandwidth(),f-=C/2):C=p-f:C=1,x=Ei({},{major:f,majorEnd:p},r.minor.items[t]);for(let e=0;e<S;e++)x[o[e]]=r[o[e]].items[t];if(v=Kh(C,x,h),b=(C-v)/2,w=b+x.major+v/2,A(),_)x.oob&&(M?m.push(Uh({item:x,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:a})):k&&m.push(Uh({item:x,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:a})));else for(let t=0;t<N;t++)x[g[t]]&&!1===x[g[t]].show||R[g[t]]();const D={type:"container",data:n,collider:{type:"bounds"},children:m};s.push(D)}return s}({items:d,settings:h,width:n,height:i,flipXY:r,resolved:u,keys:l,symbol:s});return f}};const td={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},ed=/px$/,nd={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},id={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function rd(t,e){return t&&"function"==typeof t.bandwidth?{isBandwidth:!0,value:Math.max(1,t.bandwidth()*e)}:{isBandwidth:!1,value:Math.max(1,e)}}function od(t,e,n,i){let{width:r,height:o}=e;return t.filter((t=>!1!==t.show&&!isNaN(t.x+t.y))).map((t=>{let e=t,a=ed.test(t.size)?parseInt(t.size,10):n.min+e.size*(n.max-n.min);ji(a)&&(e=td,a=n.min+e.size*(n.max-n.min));const[s,l]=function(t){let e=nd.shape,n={};return"object"==typeof t.shape&&"string"==typeof t.shape.type?(e=t.shape.type,n=t.shape):"string"==typeof t.shape&&(e=t.shape),[e,n]}(e),c=Pi(Pi({},l),{},{type:s,label:t.label,x:t.x*r,y:t.y*o,fill:e.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity});e===t.errorShape&&(c.width=e.width);const u=i(c);return u.data=t.data,u}))}const ad={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:t=>t.data.value},style:{item:"$shape"}},render(t){let{data:e}=t;const n=this.resolver.resolve({data:e,defaults:Ei({},nd,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:i,height:r}=this.rect,o=Ei({},id,this.settings.settings.sizeLimits),a=n.items,s=function(t,e,n,i,r){const o=rd(t?t.scale:void 0,n),a=rd(e?e.scale:void 0,i);let s=Math.min(o.value*r[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*r[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*r[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*r[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:r.maxPx,minGlobal:r.minPx}}(n.settings.x,n.settings.y,i,r,o);return od(a,this.rect,s,this.settings.shapeFn||this.symbol)}};Math.PI;const sd={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function ld(t,e,n,i){let{x:r,y:o,width:a,height:s}=e;const l=xr(),c={x:r+a/2,y:o+s/2},u=Math.min(a,s)/2,h=Math.min(a,s)/2,d=h/100;return t.map(((t,e)=>{const r=n[e];r.type="path";const o=h*r.outerRadius,a=u*r.innerRadius,s=d*r.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),r.arcDatum=t;const f=l.centroid(t),p=r.offset?function(t,e,n,i){let[r,o]=t;const a=Math.sqrt(r*r+o*o);r/=a,o/=a;const s=n-i;return{x:r*e*s,y:o*e*s}}(f,r.offset,o,a):{x:0,y:0};return r.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),r.desc={share:t.value/i,slice:{start:t.startAngle,end:t.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+p.x,y:c.y+p.y}}},r}))}function cd(t,e){return t.slice&&"arc"in t.slice?e.arc:e.data.value}const ud={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(t){let{data:e}=t;const n=[],i=[],r=this.settings.settings,{items:o}=this.resolver.resolve({data:e,defaults:Ei({},sd,this.style.slice),settings:r.slice});let a=0;for(let t=0,e=o.length;t<e;t++){const e=cd(r,o[t]);e>0&&o[t].outerRadius>=o[t].innerRadius&&(n.push(e),i.push(o[t]),a+=e)}const s=function(){var t=Sr,e=_r,n=null,i=Qi(0),r=Qi(ur),o=Qi(0);function a(a){var s,l,c,u,h,d=a.length,f=0,p=new Array(d),g=new Array(d),m=+i.apply(this,arguments),y=Math.min(ur,Math.max(-ur,r.apply(this,arguments)-m)),x=Math.min(Math.abs(y)/d,o.apply(this,arguments)),v=x*(y<0?-1:1);for(s=0;s<d;++s)(h=g[p[s]=s]=+t(a[s],s,a))>0&&(f+=h);for(null!=e?p.sort((function(t,n){return e(g[t],g[n])})):null!=n&&p.sort((function(t,e){return n(a[t],a[e])})),s=0,c=f?(y-d*v)/f:0;s<d;++s,m=u)l=p[s],u=m+((h=g[l])>0?h*c:0)+v,g[l]={data:a[l],index:s,value:h,startAngle:m,endAngle:u,padAngle:x};return g}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:Qi(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,n=null,a):e},a.sort=function(t){return arguments.length?(n=t,e=null,a):n},a.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Qi(+t),a):i},a.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:Qi(+t),a):r},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Qi(+t),a):o},a}().sortValues(null);s.startAngle(r.startAngle),s.endAngle(r.endAngle),s.padAngle(r.padAngle);return ld(s(n),Ei({},this.rect,{x:0,y:0}),i,a)}};const hd=function(t){function e(e){if(t[e.type]&&t[e.type].condition(e)){const n=t[e.type],i=void 0===n.conditionAppend||n.conditionAppend(e);n.items.forEach((t=>{const n=Math.round(e[t.key]),r=e[t.key]-n;e[t.key]=n,i&&"append"===t.type&&(r>0?e[t.key]+=.5:e[t.key]-=.5)}))}}return void 0===t&&((t={}).line={append:["x1","x2","y1","y2"],round:[],condition:t=>t.x1===t.x2||t.y1===t.y2,conditionAppend:t=>t.strokeWidth%2!=0},t.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:t=>t.strokeWidth%2!=0}),Object.keys(t).forEach((e=>{const n=t[e];n.items=[],n.append.forEach((t=>{n.items.push({key:t,type:"append"})})),n.round.forEach((t=>{n.items.push({key:t,type:"round"})}))})),e.multiple=t=>t.forEach((t=>e(t))),e}();class dd{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(t,e){if(e){const e=t.substring(0,1),n=t.substring(1);if("x"===e)return"y".concat(n);if("y"===e)return"x".concat(n);if("cx"===t)return"cy";if("cy"===t)return"cx";if("width"===t)return"height";if("height"===t)return"width"}return t}transposeCoordinate(t,e,n){if("number"==typeof e&&isFinite(e)){const i=t.substring(0,1);if("x"===i||"cx"===t)return e*this.width;if("width"===t)return e*this.width;if("r"===t)return e*(n?this.height:this.width);if("y"===i||"cy"===t)return e*this.height;if("height"===t)return e*this.height}return e}push(){return this.storage.push(...arguments),this}processItem(t){let e={};const n=void 0!==t.flipXY?t.flipXY:this.flipXY,i=void 0!==t.crisp?t.crisp:this.crisp;if(t.fn&&"function"==typeof t.fn){let i=n?this.height:this.width,r=n?this.width:this.height;t=t.fn({width:i,height:r,flipXY:n});const o=Object.keys(t);for(let i=0,r=o.length;i<r;i++){let r=o[i];e[dd.evaluateKey(r,n)]=t[r]}}else{const i=Object.keys(t);for(let r=0,o=i.length;r<o;r++){let o=i[r];const a=dd.evaluateKey(o,n),s=this.transposeCoordinate(a,t[o],n);e[a]=s}}return i&&hd(e),e}output(){let t=[];for(let e=0,n=this.storage.length;e<n;e++){let n=this.processItem(this.storage[e]);t.push(n)}return t}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function fd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new dd(...e)}function pd(t,e){return t&&e?t.cachedTicks&&t.cachedTicks()||t.ticks({distance:e}):[]}const gd={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=fd(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,nu(this,"x",this.rect.width),nu(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=Ei({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=Ei({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=pd(this.x,this.rect.width),this.lines.y=pd(this.y,this.rect.height),this.lines.y=this.lines.y.map((t=>Ei(t,{flipXY:!0})));let t=t=>{let{dir:e,isMinor:n}=t,i=this.lines[e].filter((t=>!!t.isMinor===n)),r=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:r,data:{items:i,dir:e}}).items.forEach((t=>{let n=t.data;var i,r;t.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:t.stroke||"black",strokeWidth:void 0!==t.strokeWidth?t.strokeWidth:1,strokeDasharray:void 0!==t.strokeDasharray?t.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(i=n.value)&&void 0!==i?i:null===(r=n.data)||void 0===r?void 0:r.value,dir:e})}))};return t({dir:"x",isMinor:!1}),t({dir:"x",isMinor:!0}),t({dir:"y",isMinor:!1}),t({dir:"y",isMinor:!0}),this.blueprint.output()}};function md(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(t," ").concat(e-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?0:1,", ").concat(t," ").concat(e+n,"\n L ").concat(r?t+n:t-n," ").concat(e," Z\n ")}let r="bottom"===i;return"\n M ".concat(t-n," ").concat(e,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?1:0,", ").concat(t+n," ").concat(e,"\n L ").concat(t," ").concat(r?e+n:e-n," Z\n ")}function yd(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(t+=r?1.5*n:-1.5*n," ").concat(e-n,"\n L ").concat(t," ").concat(e+n,"\n L ").concat(r?t+n:t-n," ").concat(e," Z\n ")}let r="bottom"===i;return e+=r?1.5*n:-1.5*n,"\n M ".concat(t-n," ").concat(e,"\n L ").concat(t+n," ").concat(e,"\n L ").concat(t," ").concat(r?e+n:e-n," Z\n ")}function xd(t,e,n){return t<e||t>n}function vd(t,e){if("string"==typeof t.formatter)return e.formatter(t.formatter);if("object"==typeof t.formatter)return e.formatter(t.formatter);if(void 0!==t.scale&&t.scale.data){const e=t.scale.data()&&t.scale.data().fields;return e&&e[0]?e[0].formatter():null}return null}function bd(t){if(void 0===t)return 0;if("number"==typeof t&&isFinite(t))return t;if("string"==typeof t)switch(t){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function wd(t){let{chart:e,blueprint:n,renderer:i,p:r,settings:o,items:a,slopeLine:s}=t,l=!0,c=!1,u=!1,h=!1,d=!1,f=Ei(!0,{},o.style.line,r.line||{}),p=Ei(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:f.stroke});if(c=s?n.processItem({type:"line",x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,stroke:f.stroke||"black",strokeWidth:f.strokeWidth||1,strokeDasharray:f.strokeDasharray,flipXY:!1,value:r.valueInfo?r.valueInfo.id:r.value}):n.processItem({type:"line",x1:r.position,y1:0,x2:r.position,y2:1,stroke:f.stroke||"black",strokeWidth:f.strokeWidth||1,strokeDasharray:f.strokeDasharray,flipXY:r.flipXY||!1,value:r.valueInfo?r.valueInfo.id:r.value}),r.label){const t=Ei(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:f.stroke},r.label);let s,c={width:0,height:0},p="";s=vd(r,e),!1!==r.label.showValue&&(s?p=" (".concat(s(r.value),")"):r.scale&&(p=" (".concat(r.value,")"))),p&&(c=i.measureText({text:p,fontFamily:t.fontFamily,fontSize:t.fontSize}));let g=i.measureText({text:t.text||"",fontFamily:t.fontFamily,fontSize:t.fontSize}),m={width:g.width+c.width,height:Math.max(g.height,c.height)},y=t.padding,x=bd(r.flipXY?t.vAlign:t.align),v=bd(r.flipXY?t.align:t.vAlign),b=Math.min(1+m.width+2*y,t.maxWidth*n.width,t.maxWidthPx),w=m.height+2*y,M=r.flipXY?w:b,k=r.flipXY?b:w;if(u=n.processItem({fn:e=>{let{width:i,height:o}=e,a=r.position*i-(r.flipXY?w:b)*(1-x);a=r.flipXY?a:Math.max(a,0);return{type:"rect",x:a,y:Math.max(Math.abs(v*o-k*v),0),width:r.flipXY?M:Math.min(M,n.width-a),height:k,stroke:t.background.stroke,strokeWidth:t.background.strokeWidth,fill:t.background.fill,opacity:t.background.opacity}},flipXY:r.flipXY||!1}),u.x<-1||u.x+u.width>n.width+1||u.y<-1||u.y+u.height>n.height+1)u=void 0;else{h={type:"text",text:t.text||"",fill:t.fill,opacity:t.opacity,fontFamily:t.fontFamily,fontSize:t.fontSize,x:u.x+y,y:u.y+u.height/2+m.height/3,maxWidth:u.width-2*y-c.width,anchor:"start"},p&&(d={type:"text",text:p||"",fill:t.fill,opacity:t.opacity,fontFamily:t.fontFamily,fontSize:t.fontSize,x:h.x+3+(u.width-(c.width+2*y)),y:h.y});for(let t=0,e=a.length;t<e;t++){let e=a[t];"rect"===e.type?Zu(u,e)&&(l=!1):"line"===e.type&&r.flipXY===e.flipXY&&th(u,e)&&(l=!1)}}}if(c&&a.push(c),0!==(null==s?void 0:s.slope)&&(null!=s&&s.showLabel||null!=s&&s.showValue)){let t,o;const l=120;let u=s.showLabel?s.refLineLabel:"";if(s.showValue){const n=vd(r,e),i=n?n(s.value):s.value;t="(".concat(s.slope,"x + ").concat(i,")"),u+=s.refLineLabel?" ".concat(t):t}if(u.length>1){var g;const t=i.measureText({text:u,fontFamily:p.fontFamily,fontSize:p.fontSize});t.width=t.width>l?l:t.width;const r=function(t,e,n){const i=t.scale({scale:"x"}),r=t.scale({scale:"y"});if(e>0){if(i.max()*e+n>=r.max())return!0}else if(e<0&&i.min()*e+n>=r.max())return!0;return!1}(e,s.slope,s.value)?function(t,e,n){const i=t.scale({scale:"x"}),r=t.scale({scale:"y"});return i((r.max()-n)/e)}(e,s.slope,s.value):void 0,h=void 0===r||s.isRtl?p.padding:3*p.padding,d=void 0!==r||s.slope>0?3*p.padding:p.padding,m=function(t,e,n,i,r,o){let a=0;if(void 0!==n){if(n<.8)return a=t.slope<0||t.isRtl?3*o.padding:2*o.padding,t.isRtl,n*r.width+a;if(1===n)return t.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding);if(n>.8)return t.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding)}else if(t.slope>0)return e.x2-(i.width+2*o.padding);return t.isRtl?e.x1-(i.width+2*o.padding):e.x1}(s,c,r,t,n,p),y=Math.min(c.y1,c.y2);s.labelStroke&&(o={type:"rect",x:s.isRtl?Math.max(m,h)-2:Math.max(m,h)+2,y:Math.abs(Math.max(y,d)-t.height),rx:3,ry:3,width:t.width+p.padding,height:t.height-2,stroke:f.stroke,fill:f.stroke});const x={type:"text",text:u,fill:null!==(g=s.labelStroke)&&void 0!==g?g:f.stroke,opacity:p.opacity,fontFamily:p.fontFamily,fontSize:p.fontSize,x:o?o.x+2:Math.max(m,h)+2,y:o?o.y+t.height-p.padding:Math.abs(Math.max(y,d)-p.padding/2),anchor:"start",title:u,maxWidth:l,width:t.width};(function(t,e,n,i,r){for(let o=0,a=t.length;o<a;o++){const a=t[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-e.x)<Math.max(a.width+i,e.width+i)&&Math.abs(a.y-e.y)<n.height+r)return!0}return!1})(a,x,t,h,d)||(o&&a.push(o),a.push(x))}}l&&u&&h&&(a.push(u,h),d&&a.push(d))}function Md(t){const e={value:t.value};return t.label&&(e.label=t.label.text),e}function kd(t){return void 0!==("function"==typeof t.value?t.value():t.value)}function _d(t,e){const n=t.min();if(n===t.max()){const i=function(t){const e=t.range();return 2===(null==e?void 0:e.length)&&e[0]>e[1]}(t);if(e<n)return i?2:-1;if(e>n)return i?-1:2}return t(e)}function Sd(t,e){return t&&e&&Math.abs(t.x-e.x)<1e-15&&Math.abs(t.y-e.y)<1e-15}const Nd={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=fd(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let t=this.settings;if(this.lines={x:[],y:[]},this.lines.x=t.lines&&t.lines.x||[],this.lines.y=t.lines&&t.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const e={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(kd).map((t=>{if("function"==typeof t.value&&(t.value=t.value()),t.scale){let e=this.chart.scale(t.scale);const n=_d(e,t.value);return Ei(t,{scale:e,position:n})}return Ei(t,{position:t.value})})),this.lines.y=this.lines.y.filter(kd).map((t=>{if("function"==typeof t.value&&(t.value=t.value()),t.scale){let e=this.chart.scale(t.scale);const n=_d(e,t.value);return Ei(t,{scale:e,position:n,flipXY:!0})}return Ei(t,{position:t.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((t=>!(t.position<0||t.position>1)||(e["x".concat(t.position>1?1:0)].push(Md(t)),!1))),this.lines.y=this.lines.y.filter((t=>!(!t.slope||0===t.slope)||(!(t.position<0||t.position>1)||(e["y".concat(t.position>1?1:0)].push(Md(t)),!1))));let n=[];return[...this.lines.x,...this.lines.y].forEach((i=>{if(!0===i.show||void 0===i.show){let r;if(i.slope&&0!==i.slope){const t=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=t.min(),a=t.max(),s=n.min(),l=n.max();r=Pi(Pi({},i),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*i.slope+i.value,u=a*i.slope+i.value,h=(s-i.value)/i.slope,d=(l-i.value)/i.slope;let f=[];xd(c,s,l)||(f[0]={x:_d(t,o),y:_d(n,c)}),xd(h,o,a)||(f[1]={x:_d(t,h),y:1}),xd(u,s,l)||(f[2]={x:_d(t,a),y:_d(n,u)}),xd(d,o,a)||(f[3]={x:_d(t,d),y:0});if(f.filter((t=>!!t)).length>2&&function(t){Sd(t[0],t[1])&&(t[1]=void 0),Sd(t[1],t[2])&&(t[2]=void 0),Sd(t[2],t[3])&&(t[3]=void 0),Sd(t[3],t[0])&&(t[3]=void 0)}(f),f=f.filter((t=>!!t)),f.length<2)return void e["y".concat(c>l?0:1)].push(Md(i));r.x1=f[0].x,r.y1=f[0].y,r.x2=f[1].x,r.y2=f[1].y}else r=void 0;wd({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:i,settings:t,items:n,slopeLine:r})}})),t.style.oob.show&&function(t){let{blueprint:e,oob:n,settings:i,items:r}=t;const o=Object.keys(n);let a=i.style.oob||{};for(let t=0,i=o.length;t<i;t++){const i=o[t],s=n[i];if(s.length>0){let t=i.charAt(1),n="y"===i.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===t?"bottom":"top":"1"===t?"right":"left";let u=e.processItem({fn:e=>{let{width:i,height:r}=e,u=t*i+("1"===t?-o:o),h=n?l:r-l;return"arc"===a.type?{type:"path",d:md(n?h:u,n?u:h,a.width,c),x:u,y:h,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:h,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),h=u.cx||u.x,d=u.cy||u.y,f={type:"text",text:s.length||"",x:h-.4*a.width,y:d+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},p={type:"path",d:yd(h,d,a.width,c),x:h,y:d,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};r.push(u,f,p)}}}({blueprint:this.blueprint,oob:e,settings:t,items:n}),n}};function Rd(t){const e={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===t.align||"bottom"===t.align?(e.x1=t.innerRect.x-t.outerRect.x,e.x2=e.x1+t.innerRect.width,e.y1=e.y2="top"===t.align?t.innerRect.height-t.padding:t.padding):(e.x1=e.x2="left"===t.align?t.innerRect.width-t.padding:t.padding,e.y1=t.innerRect.y-t.outerRect.y,e.y2=e.y1+t.innerRect.height),function(t,e){Ei(t,e.style)}(e,t),e}function Ad(t){return"string"==typeof t||"number"==typeof t?t:"-"}function Cd(t,e,n){n.layered||!n.stepSize?function(t,e){e.collider={type:"polygon",vertices:[{x:e.boundingRect.x,y:e.boundingRect.y},{x:e.boundingRect.x+e.boundingRect.width,y:e.boundingRect.y},{x:e.boundingRect.x+e.boundingRect.width,y:e.boundingRect.y+e.boundingRect.height},{x:e.boundingRect.x,y:e.boundingRect.y+e.boundingRect.height}]}}(0,e):n.tilted?function(t,e,n){const i=n.angle*(Math.PI/180),r=Math.max(n.stepSize/2,e.boundingRect.height/2),o="start"===e.anchor,a="end"===e.anchor&&i<0,s="start"===e.anchor&&i>=0,l=e.boundingRect.y+(s||a?e.boundingRect.height:0),c=[{x:e.x-r,y:l},{x:e.x+r,y:l}].map((t=>_u(t,i,{x:e.x,y:e.y}))),u={x:o?e.boundingRect.x+e.boundingRect.width+10:e.boundingRect.x-10,y:e.boundingRect.y+e.boundingRect.height},h={x:o?e.boundingRect.x+e.boundingRect.width+10:e.boundingRect.x-10,y:e.boundingRect.y},d=i>=0?[u,h]:[h,u];c.push(...d),e.collider={type:"polygon",vertices:c}}(0,e,n):function(t,e,n){if("bottom"===n.align||"top"===n.align){const i=t.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);e.collider={type:"rect",x:i,y:0,width:i<0?n.stepSize+i:n.stepSize,height:n.innerRect.height}}else{const i=t.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);e.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}const i=e.collider;i.x=Math.max(i.x,0),i.y=Math.max(i.y,0);const r=i.x+i.width-(n.outerRect.x+n.outerRect.width);i.width=r>0?i.width-r:i.width;const o=i.y+i.height-(n.outerRect.y+n.outerRect.height);i.height=o>0?i.height-o:i.height}(t,e,n)}function Dd(t,e){const n=isNaN(t.style.align)?.5:Math.min(Math.max(t.style.align,0),1);let i=0;if(t.tilted)i=t.stepSize*n;else{const r=e?t.textRect.height:t.textRect.width;i=Math.max(0,t.stepSize-r)*n}return i}function Od(t,e){var n,i;const r={type:"text",text:Ad(t.label),x:0,y:0,maxWidth:e.maxWidth,maxHeight:e.maxHeight,tickValue:null!==(n=t.value)&&void 0!==n?n:null===(i=t.data)||void 0===i?void 0:i.value};return"top"===e.align||"bottom"===e.align?(r.x=t.start*e.innerRect.width+(e.innerRect.x-e.outerRect.x)+Dd(e,!1),r.y="top"===e.align?e.innerRect.height:0,r.anchor=e.stepSize?"start":"middle",r.x+=isNaN(e.style.offset)?0:+e.style.offset):(r.y=t.start*e.innerRect.height+(e.innerRect.y-e.outerRect.y)+Dd(e,!0),r.x="left"===e.align?e.innerRect.width:0,r.anchor="left"===e.align?"end":"start",r.baseline=e.stepSize?"text-before-edge":"central",r.y+=isNaN(e.style.offset)?0:+e.style.offset),function(t,e){["fill","fontSize","fontFamily"].forEach((n=>{t[n]=e.style[n]}))}(r,e),function(t,e){if(!e.tilted&&!e.stepSize)if("top"===e.align||"bottom"===e.align){const n=0,i=e.outerRect.width,r=Math.min(e.maxWidth/2,e.textRect.width/2),o=t.x-r,a=t.x+r;o<n?(t.anchor="start",t.x=e.innerRect.x-e.outerRect.x):a>i&&(t.anchor="end",t.x=e.innerRect.width+e.innerRect.x)}else{const n=0,i=e.outerRect.height,r=e.maxHeight/2,o=t.y-r,a=t.y+r;o<n?(t.y=e.innerRect.y-e.outerRect.y,t.baseline="text-before-edge"):a>i&&(t.y=e.innerRect.height+(e.innerRect.y-e.outerRect.y),t.baseline="text-after-edge")}}(r,e),function(t,e){"top"===e.align?t.y-=e.padding:"bottom"===e.align?t.y+=e.padding+e.maxHeight:"left"===e.align?t.x-=e.padding:"right"===e.align&&(t.x+=e.padding)}(r,e),function(t,e){if(e.tilted){const n=-e.angle,i=n*(Math.PI/180);"bottom"===e.align?(t.x-=e.maxHeight*Math.sin(i)/2,t.y-=e.maxHeight,t.y+=e.maxHeight*Math.cos(i)/2):t.x-=e.maxHeight*Math.sin(i)/3,t.transform="rotate(".concat(n,", ").concat(t.x,", ").concat(t.y,")"),t.anchor="bottom"===e.align==e.angle<0?"start":"end";const r=Math.cos(i)*e.maxWidth;if("bottom"===e.align==e.angle<0){const n=e.outerRect.width-e.paddingEnd;t.x+r>n&&(t.maxWidth=(n-t.x-10)/Math.cos(i))}else{const n=e.paddingEnd;t.x-r<n&&(t.maxWidth=(t.x-n-10)/Math.cos(i))}}}(r,e),function(t,e){t.boundingRect=e.textBounds(t)}(r,e),Cd(t,r,e),r}function Ed(t,e){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:t.value};return"top"===e.align||"bottom"===e.align?(n.x1=n.x2=t.position*e.innerRect.width+(e.innerRect.x-e.outerRect.x),n.y1="top"===e.align?e.innerRect.height:0,n.y2="top"===e.align?n.y1-e.tickSize:n.y1+e.tickSize):(n.y1=n.y2=t.position*e.innerRect.height+(e.innerRect.y-e.outerRect.y),n.x1="left"===e.align?e.innerRect.width:0,n.x2="left"===e.align?n.x1-e.tickSize:n.x1+e.tickSize),function(t,e){Ei(t,e.style)}(n,e),function(t,e){"top"===e.align?(t.y1-=e.padding,t.y2-=e.padding):"bottom"===e.align?(t.y1+=e.padding,t.y2+=e.padding):"left"===e.align?(t.x1-=e.padding,t.x2-=e.padding):"right"===e.align&&(t.x1+=e.padding,t.x2+=e.padding)}(n,e),function(t,e){const n=t.strokeWidth/2;t.x1===e.innerRect.width?(t.x1-=n,t.x2-=n):0===t.x1?(t.x1+=n,t.x2+=n):t.y1===e.innerRect.height?(t.y1-=n,t.y2-=n):0===t.y1&&(t.y1+=n,t.y2+=n)}(n,e),n}function zd(t){return!t.isMinor&&t.position>=0&&t.position<=1}function Id(t){let{rect:e,state:n,majorTicks:i,measure:r,horizontal:o}=t;return o?function(t){let{majorTicks:e,measureText:n,rect:i,state:r}=t;const o="layered"===r.labels.activeMode?2:1,a=i.width,s=e.map((t=>t.label)).map((t=>"".concat(t.slice(0,1)).concat(t.length>1?"…":""))).map(n).map((t=>t.width));for(let t=0;t<e.length;++t){const n=e[t];if(o*a*Math.abs(n.start-n.end)<s[t])return!0}return!1}({majorTicks:i,measureText:r,rect:e,state:n}):function(t){let{majorTicks:e,measureText:n,rect:i}=t;const r=i.height,o=n("M").height;return!(e.length<2)&&r*Math.abs(e[0].position-e[1].position)<o}({majorTicks:i,measureText:r,rect:e,state:n})}function Td(t){let{value:e,maxValue:n,minValue:i,range:r,modifier:o}=t;return isNaN(r)||isNaN(o)||(e=r*o),e>n&&(e=n),e<i&&(e=i),e}function Pd(t){let{isDiscrete:e,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s}=t,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:h}=a.labels;if(a.labels.show){const t=a.align,d="top"===t||"bottom"===t,f=d?n.inner.width:n.inner.height,p=o.ticks({settings:a,distance:f,formatter:i}).filter(zd),g=t=>{const e=r({text:t,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return e.width=Td({value:e.width,maxValue:u,minValue:h}),e};if(e&&d&&"auto"===a.labels.mode&&(!function(t){let{majorTicks:e,measure:n,rect:i,state:r,settings:o}=t;const a=o.labels.maxGlyphCount,s="layered"===r.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=i.width;let h=0,d=0;if(isNaN(a))for(let t=0;t<e.length;t++){const i=e[t],r=i.label,o=n(r).width*(r.length>1?l:1);if(d=s*u*Math.abs(i.start-i.end),o+c>d)return!0}else if(d=s*u*e.reduce(((t,e)=>Math.min(Math.abs(e.start-e.end),t)),1/0),h=n("M").width*l*a,h+c>d)return!0;return!1}({majorTicks:p,measure:g,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&Id({rect:n.inner,state:s,majorTicks:p,measure:g,horizontal:d})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let m,y;if("tilted"===s.labels.activeMode){const t=Math.abs(a.labels.tiltAngle)*(Math.PI/180);m=e=>Td({value:e.width,maxValue:u,minValue:h})*Math.sin(t)+e.height*Math.cos(t)}else m=d?t=>t.height:t=>Td({value:t.width,maxValue:u,minValue:h});if(d&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=p.map((t=>t.label));else{let t="";for(let e=0;e<a.labels.maxGlyphCount;e++)t+="M";y=[t]}const x=y.map(g),v=x.map(m),b=Math.max(...v,0);if(l+=b,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const t="bottom"===a.align==a.labels.tiltAngle>=0,e=Math.abs(a.labels.tiltAngle)*(Math.PI/180),i=(b-g("M").height*Math.cos(e))/Math.sin(e),r=t=>Math.min(i,t.width)*Math.cos(e)+t.height,o=(e,i)=>{const r=p[i]?p[i].position:0;return t?e-r*n.inner.width:e-(1-r)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...x.map(r).map(o),0))+a.paddingEnd;if(c[t?"left":"right"]=s,!a.labels.filterOverlapping&&function(t){let{majorTicks:e,measureText:n,rect:i,bleedSize:r,angle:o}=t;if(e.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(i.outer.width-r,i.inner.width)*Math.abs(e[0].position-e[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:p,measureText:g,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const qd=(t,e,n)=>t.width*Math.abs(e.position-n.position);function Ld(t){let{layered:e,major:n,innerRect:i,outerRect:r,tick:o,index:a}=t;const s=e?2:1,l=n[a-s],c=n[a+s],u=l?qd(i,o,l)/2-2:1/0,h=c?qd(i,o,c)/2-2:1/0;return n.length<2?i.width:l?c?2*Math.min(u,h):(t=>{let{innerRect:e,outerRect:n,tick:i,prevWidth:r}=t;const o=e.x-n.x,a=n.width-e.width-o,s=e.width-e.width*i.position+a,l=2*Math.min(r,s),c=1===i.position?e.width/2-2:0;return Math.max(r,l,c)})({innerRect:i,outerRect:r,tick:o,prevWidth:u}):(t=>{let{innerRect:e,outerRect:n,tick:i,nextWidth:r}=t;const o=e.x-n.x,a=e.width*i.position+o,s=2*Math.min(r,a),l=0===i.position?e.width/2-2:0;return Math.max(r,s,l)})({innerRect:i,outerRect:r,tick:o,nextWidth:h})}function jd(t){const e=t.innerRect,n={cx:e.width/2,cy:e.height/2},i=Math.min(e.height,e.width)/2*t.radius,r=i+t.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:t.startAngle,endAngle:t.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:i,outerRadius:r}},ticks:[]};return function(t,e){Ei(t,e.style)}(o,t),o}function Fd(t,e,n,i){return{x:t+n*Math.cos(i),y:e+n*Math.sin(i)}}function Bd(t,e){const n=e.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*e.radius+e.padding,o=e.startAngle,a=e.endAngle,s=e.tickSize,l=a-o;let c=a-t.position*l;c-=Math.PI/2;const u=Fd(i.cx,i.cy,r+s,c),h=Fd(i.cx,i.cy,r,c),d={type:"line",x1:u.x,y1:u.y,x2:h.x,y2:h.y,value:t.value};return function(t,e){const n=Pi({},e.style);Ei(t,n)}(d,e),d}function Vd(t){return"string"==typeof t||"number"==typeof t?t:"-"}function $d(t,e,n){let i;return i="left"===e?n.x:"right"===e?t.outerRect.width-n.x:Math.max(n.x,t.outerRect.width-n.x),i}function Hd(t,e){const n=e.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*e.radius+e.padding,o=e.startAngle,a=e.endAngle,s=e.tickSize,l=a-o,c=.2;let u,h;u="top"===e.align||"bottom"===e.align?a-t.position*l:o+t.position*l,h=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const d=function(t,e,n,i){return{x:t+n*Math.cos(i),y:e+n*Math.sin(i)}}(i.cx,i.cy,r+s+6,u);let f;f="left"===h?"end":"right"===h?"start":"middle";const p={type:"text",text:Vd(t.label),align:h,x:d.x,y:d.y,maxHeight:e.maxHeight,maxWidth:$d(e,h,d),anchor:f,baseline:"middle"};return function(t,e){["fill","fontSize","fontFamily"].forEach((n=>{t[n]=e.style[n]}))}(p,e),function(t,e){t.boundingRect=e.textBounds(t)}(p,e),function(t,e,n){let i,r;const o=parseFloat(n.fontSize)||0;i=e.y-o/2,r=t.innerRect.height-(e.y+o/2),(i<0||r<0)&&(n.text="")}(e,d,p),p}function Wd(t){let e=0;return e+=t.paddingStart,e+=t.line.show?t.line.strokeWidth/2:0,e+=t.ticks.show?t.ticks.margin:0,e}function Ud(t){let e=0;return e+=t.line.show?t.line.strokeWidth/2:0,e+=t.ticks.show?t.ticks.margin:0,e}function Yd(t){let e=0;return e+=t.ticks.show?t.ticks.tickSize:0,e+=Wd(t)+t.labels.margin,e}function Xd(t,e){return t.map((t=>Ed(t,e)))}function Gd(t,e){return e?Math.abs(e.end-e.start):t.bandwidth()}function Kd(t){let{textMetrics:e,settings:n,innerRect:i,scale:r,tilted:o,layered:a,tick:s}=t;const l=e.height,c=Gd(r,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=i.width-Yd(n)-n.paddingEnd;else if(a)u.width=c*i.width*2;else if(o){const t=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(i.height-Yd(n)-n.paddingEnd-l*Math.cos(t))/Math.sin(t)}else u.width=c*i.width;return u.width=Td({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function Zd(t){let{textMetrics:e,settings:n,innerRect:i,outerRect:r,tilted:o,layered:a,tick:s,index:l,major:c}=t;const u=e.height,h={width:0,height:u};if("left"===n.align||"right"===n.align)h.width=i.width-Yd(n)-n.paddingEnd;else if(o){const t=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(i.height-Yd(n)-n.paddingEnd-u*Math.cos(t))/Math.sin(t)}else h.width=Ld({layered:a,major:c,innerRect:i,outerRect:r,tick:s,index:l});return h.width=Td({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function Jd(t){let e;function n(){return e=Zd,n}function i(){return e=Kd,i}function r(t){let{settings:n,scale:i,innerRect:r,outerRect:o,measureText:a,ticks:s,state:l,textBounds:c}=t;const u=[],h=function(t){return t.filter((t=>!t.isMinor))}(s),d=function(t){return t.filter((t=>t.isMinor))}(s),f={innerRect:r,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,g="layered"===l.labels.activeMode;let m;if(n.arc&&(f.startAngle=n.arc.startAngle,f.endAngle=n.arc.endAngle,f.radius=n.arc.radius),n.line.show&&(f.style=n.line,f.padding=n.paddingStart,n.arc?u.push(jd(f)):u.push(Rd(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=Wd(n),n.arc?(f.padding=Ud(n),m=function(t,e){return t.map((t=>Bd(t,e)))}(h,f)):m=Xd(h,f)),n.labels.show){const t=Yd(n);f.style=n.labels,f.padding=t,f.tilted=p,f.layered=g,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const l=(t,l)=>{f.textRect=function(t){let{style:e,measureText:n,tick:i}=t;return n({text:i.label,fontSize:e.fontSize,fontFamily:e.fontFamily})}({tick:t,measureText:a,style:f.style});const c=e({textMetrics:f.textRect,settings:n,innerRect:r,outerRect:o,scale:i,tilted:p,layered:g,tick:t,major:h,index:l});f.maxWidth=c.width,f.maxHeight=c.height,f.stepSize=function(t){let{innerRect:e,scale:n,settings:i,tick:r}=t;return("top"===i.align||"bottom"===i.align?e.width:e.height)*Gd(n,r)}({innerRect:r,scale:i,ticks:s,settings:n,tick:t})};let d=[];n.arc?(f.padding=function(t){let e=0;return e+=t.ticks.show?t.ticks.tickSize:0,e+=Ud(t)+t.labels.margin,e}(n),d=function(t,e,n){return t.map(((t,i)=>{n(t,i);const r=Hd(t,e);return r.data=t.data,r}))}(h,f,l)):d=!g||"top"!==n.align&&"bottom"!==n.align?function(t,e,n){return t.map(((t,i)=>{n(t,i);const r=Od(t,e);return r.data=t.data,r}))}(h,f,l):function(t,e,n,i){const r=e.padding,o=Yd(n);return t.map(((t,a)=>{i(t,a);const s=o+e.maxHeight+n.labels.margin;e.layer=a%2,e.padding=a%2==0?r:s;const l=Od(t,e);return l.data=t.data,l}))}(h,f,n,l),n.labels.filterOverlapping&&function(t,e,n){let i=(e,n)=>Zu(Ui(1,t[e].boundingRect),Ui(1,t[n].boundingRect));if(n&&n.tilted){const e=Math.abs(n.angle);i=(n,i)=>{const r=1/Math.abs(t[n].x-t[i].x),o=Math.sin(e*(Math.PI/180))/r;return t[n].boundingRect.height>o}}for(let n=0;n<=t.length-1;n++)for(let r=n+1;r<=Math.min(n+5,n+(t.length-1));r++)t[n]&&t[r]&&i(n,r)&&(r===t.length-1?(t.splice(n,1),e&&e.splice(n,1)):(t.splice(r,1),e&&e.splice(r,1)),r--,n--)}(d,m,f),u.push(...d)}return n.minorTicks&&n.minorTicks.show&&d.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(t){return t.line.strokeWidth+t.minorTicks.margin}(n),u.push(...Xd(d,f))),m&&u.push(...m),u}return n.build=r,i.build=r,t?i():n()}const Qd={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},tf={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const ef={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(t){let{state:e,style:n,settings:i}=t;const r=Ei(!0,{},e.isDiscrete?Qd:tf,n),o=Ei(!0,{},r,i.settings),a=i.layout.dock||e.defaultDock;o.dock=a,o.align=function(t,e){const n=["top","bottom"],i=["left","right"];return-1!==n.indexOf(t)&&-1===i.indexOf(e)||-1!==i.indexOf(t)&&-1===n.indexOf(e)?t:e}(i.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:s,paddingEnd:l}=o;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=Jd(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(t,e,n){const i=e.labels.mode;return n&&t.isHorizontal?"auto"===i?t.labels.activeMode:-1!==["layered","tilted"].indexOf(e.labels.mode)&&-1!==["top","bottom"].indexOf(e.dock)?i:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(t){const{formatter:e,state:n,scale:i}=this,r=this.state.isHorizontal?t.inner.width:t.inner.height;this.state.pxScale=iu(i,r);const o=function(t){let{isDiscrete:e,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s}=t,l=0;const{size:c,edgeBleed:u,isToLarge:h}=Pd({isDiscrete:e,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s});if(l+=c,h)return{size:l};if(a.ticks.show&&(l+=a.ticks.margin,l+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const t=a.minorTicks.margin+a.minorTicks.tickSize;t>l&&(l=t)}if(a.line.show){const t=a.line.strokeWidth/2;l+=t,u[function(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return t}}(a.align)]=Math.ceil(t)}return l+=a.paddingStart,l+=a.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:t.inner,outer:t.outer},formatter:e,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:e}=t;this.setState(e)},resize(t){const{inner:e,outer:n}=t,i=Ei({},e,function(t){let{align:e,inner:n}=t;return"left"===e?{x:n.width+n.x}:"right"===e||"bottom"===e?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:e})),r=n||i;return Ei(this.state.innerRect,i),Ei(this.state.outerRect,r),n},beforeRender(){const{scale:t,formatter:e}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=iu(t,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:e}).filter((t=>t.position>=0&&t.position<=1))},render(){const{state:t}=this,e=[];return e.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:t})),hd.multiple(e),e}};const nf={render:()=>[]};function rf(t,e,n){let i="";if("function"==typeof t)i=t();else if("string"==typeof t)i=t;else if(n){const t=(n.data().fields||[]).map((t=>t.title()));i=t.join(e)}return i}function of(t,e){let n="middle";return"left"===t?"top"===e?n="end":"bottom"===e&&(n="start"):"right"===t?"top"===e?n="start":"bottom"===e&&(n="end"):"left"===e?n="start":"right"===e&&(n="end"),n}const af={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const t=this.settings.text,e=this.definitionSettings.join;this.title=rf(t,e,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const{title:t,definitionSettings:e,rect:n}=this,i=[];return i.push(function(t){let{title:e,definitionSettings:n,dock:i,rect:r,measureText:o,style:a}=t;const s={type:"text",text:e,x:0,y:0,dx:0,dy:0,anchor:of(i,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};Ei(s,a.text);const l=o(s);if("top"===i||"bottom"===i){let t=r.width/2;"left"===n.anchor?t=n.paddingLeft||0:"right"===n.anchor&&(t=r.width-(n.paddingRight||0)),s.x=t,s.y="top"===i?r.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===i?-l.height/6:-l.height/3,s.maxWidth=.8*r.width}else{let t=r.height/2;"top"===n.anchor?t=n.paddingStart:"bottom"===n.anchor&&(t=r.height-n.paddingStart),s.y=t,s.x="left"===i?r.width-n.paddingStart:n.paddingStart,s.dx="left"===i?-l.height/3:l.height/3;const e="left"===i?270:90;s.transform="rotate(".concat(e,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*r.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:t,dock:this.settings.layout.dock,definitionSettings:e,rect:n,measureText:this.renderer.measureText,style:this.style})),i},beforeUpdate(t){t.settings&&(Ei(this.settings,t.settings),this.definitionSettings=t.settings.settings);const e=this.settings.text,n=this.definitionSettings.join;this.title=rf(e,n,this.scale)}};function sf(t,e){const n=t.settings.layout.dock,i=t.settings.settings.invert,r="top"===n||"bottom"===n,o=r?"width":"height",a=t.rect[o],s=t.chart.scroll(t.settings.scroll);let l;{let t=e[r?"x":"y"];i&&(t=a-t);const n=s.getState();l={startOffset:t,startScroll:n.start,swipe:!1};const o=t/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:t=>{let e=t[r?"x":"y"];if(i&&(e=a-e),!l.swipe){if(Math.abs(l.startOffset-e)<=1)return;l.swipe=!0}const n=s.getState(),o=(e-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:t=>{let e=t[r?"x":"y"];i&&(e=a-e);const n=s.getState();if(l.swipe){const t=(e-l.startOffset)/a*(n.max-n.min),i=l.startScroll+t;s.moveTo(i)}else{const t=e/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(t)}}}}function lf(t,e){const n=e.element().getBoundingClientRect();return{x:t.center.x-n.left,y:t.center.y-n.top}}const cf={require:["chart","renderer"],on:{panStart(t){const e=lf(t,this.renderer),n={x:e.x-t.deltaX,y:e.y-t.deltaY};this.currentMove=sf(this,n),this.currentMove.update(e)},panMove(t){if(!this.currentMove)return;const e=lf(t,this.renderer);this.currentMove.update(e)},panEnd(t){if(!this.currentMove)return;const e=lf(t,this.renderer);this.currentMove.end(e),this.currentMove=null},panCancel(){this.currentMove=null},tap(t){const e=lf(t,this.renderer);sf(this,e).end(e)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(t){const e=this.chart.scroll(this.settings.scroll).getState();if(e.viewSize>=e.max-e.min){return Math.max(t.width,t.height)}return this.settings.settings.width},render:function(t){const e=this.settings.layout.dock,n=this.settings.settings.invert,i="top"===e||"bottom"===e,r=i?"width":"height",o=this.rect[r],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),t("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(t("div",{class:"scroller",style:{position:"absolute",[i?"left":"top"]:"".concat(s,"px"),[i?"top":"left"]:"25%",[i?"height":"width"]:"50%",[r]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function uf(t){let{h:e,isVertical:n,value:i,pos:r,align:o,borderHit:a,state:s,idx:l}=t;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let h=0,d="100%",f="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(d="".concat(s.targetRect.x+s.targetRect.width,"px"),f="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(h=n?s.targetRect.x:s.targetRect.y,d="".concat(s.rect.width-h,"px"),f="".concat(s.rect.height-h,"px")),c||(r-=a),e("div",{onmouseover(t){t.srcElement.children[0].style.backgroundColor="#000",t.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(t){t.srcElement.children[0].style.backgroundColor=s.style.line.stroke,t.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":i,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?h:r,"px"),top:"".concat(n?r:h,"px"),height:n?"".concat(a,"px"):f,width:n?d:"".concat(a,"px"),pointerEvents:"auto"}},[e("div",{style:Ei({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function hf(t){let{h:e,isVertical:n,label:i,otherValue:r,rangeIdx:o,idx:a,pos:s,align:l,state:c,value:u}=t;const h="end"!==l,d="outside"===c.settings.bubbles.placement;let f,p="none";n?(f=h?"left":"right",d&&(p=h?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=h?"top":"bottom",d&&(p=h?"translate(0px, -100%)":"translate(0px, 100%)"));let g=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const m={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const x=g?e("input",{type:"text",value:u,style:Pi(Pi({},m),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(t){if("Enter"===t.key){t.preventDefault(),t.stopPropagation();const e=parseFloat(t.target.value);isNaN(e)?(y="rgba(230, 78, 78, 0.6)",t.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,e,r)}else"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),c.onEditCanceled())}}):e("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":r,"data-idx":o,"data-bidx":a,style:m},[i]);return e("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:p}},[x])}function df(t){let{h:e,isVertical:n,top:i,height:r,color:o,on:a,opacity:s}=t;return e("div",Ei({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(i,"px"),top:n?"".concat(i,"px"):0,height:n?"".concat(r,"px"):"100%",width:n?"100%":"".concat(r,"px"),pointerEvents:"auto"}},a),[])}function ff(t){let{borderHit:e,els:n,isVertical:i,state:r,vStart:o,vEnd:a,idx:s}=t,l=0;r.targetRect&&(l=i?r.targetRect.y:r.targetRect.x);const c=!!r.scale,u=c?r.scale.norm(o)*r.size:o,h=c?r.scale.norm(a)*r.size:a,d=Math.abs(u-h),f=Math.min(u,h)+l,p=f+d;if(r.targetRect){const t=r.targetFillRect||r.targetRect,e=i?t.height:t.width,s=c?r.scale.norm(o)*e:o,l=c?r.scale.norm(a)*e:a,u=Math.abs(s-l),h=Math.min(s,l),d={h:r.h,isVertical:i,top:h,height:u,color:r.style.target.fill,opacity:r.style.target.opacity};r.style.target.opacity<.8&&(d.on={onmouseover(t){t.srcElement.style.opacity=r.style.target.opacity+.1},onmouseout(t){t.srcElement.style.opacity=r.style.target.opacity}}),n.push(r.h("div",{style:{position:"absolute",left:"".concat(t.x,"px"),top:"".concat(t.y,"px"),height:"".concat(t.height,"px"),width:"".concat(t.width,"px")}},[df(d)]))}const g=u<h?o:a,m=u<h?a:o,[y,x]=c?r.scale.domain():[Math.min(o,a),Math.max(o,a)],v=g+1e-5>=y&&g-1e-5<=x,b=m-1e-5<=x&&m+1e-5>=y;v&&n.push(uf({h:r.h,isVertical:i,borderHit:e,value:g,pos:f,align:"start",state:r,idx:s})),b&&n.push(uf({h:r.h,isVertical:i,borderHit:e,value:m,pos:p,align:"end",state:r,idx:s}));const w=r.settings.bubbles;if(w&&w.show){const t={fontSize:w.fontSize,fontFamily:w.fontFamily,color:w.fill},e=[o,a];v&&n.push(hf({h:r.h,isVertical:i,align:w.align,style:t,rangeIdx:s,idx:0,otherValue:m,value:g,label:"".concat(r.format(g,e)),pos:f,state:r})),b&&n.push(hf({h:r.h,isVertical:i,align:w.align,style:t,rangeIdx:s,idx:1,otherValue:g,value:m,label:"".concat(r.format(m,e)),pos:p,state:r}))}}function pf(t){const e=t.active.limitHigh-t.active.end,n=t.active.limitLow-t.active.start;let i=t.current-t.start;return i=i<0?Math.max(i,n):Math.min(i,e),i}function gf(t){let e=[];const n=0===t.direction;if(Array.isArray(t.ranges)&&t.ranges.forEach(((i,r)=>{t.active&&r===t.active.idx||ff({borderHit:5,els:e,isVertical:n,state:t,vStart:Math.min(i.min,i.max),vEnd:Math.max(i.min,i.max),idx:r})})),t.active){let i=t.start,r=t.current;if(-1!==t.active.idx)if("foo"===t.active.mode)i=Math.min(t.active.start,t.active.end),r=Math.max(t.active.start,t.active.end);else if("modify"===t.active.mode)i=Math.min(t.start,t.current),r=Math.max(t.start,t.current);else{const e=pf(t);i=t.active.start+e,r=t.active.end+e}ff({borderHit:5,els:e,isVertical:n,state:t,vStart:i,vEnd:r,idx:t.active.idx})}return e}function mf(t){return{min:t.scale.min(),max:t.scale.max()}}function yf(t){return{min:0,max:t.direction?t.rect.width:t.rect.height}}function xf(t,e,n){let i,r,o=t.ranges,a=-1;for(i=0;i<o.length;i++){if(o[i].min<=e&&e<=o[i].max){a=i,n.min=i?o[i-1].max:n.min,n.max=i+1<o.length?o[i+1].min:n.max;break}if(e<o[i].min){n.max=o[i].min,n.min=i?o[i-1].max:n.min;break}}-1===a&&o.length&&i>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(r={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),t.active=r}function vf(t){t.renderer.render(gf(t))}function bf(t,e){if(!e||!e.isActive())return[];const n=t.scale.data(),i=(n&&n.fields||[]).map((t=>t.id())),r=e.brushes().filter((t=>"range"===t.type&&-1!==i.indexOf(t.id)))[0];return r?r.brush.ranges():[]}function wf(t,e){let n,i=1/0;const r=e.domain(),o=e.bandwidth()/2;for(let a=0;a<r.length;++a){const s=Math.abs(t-o-e(r[a]));s<i&&(i=s,n=r[a])}return n}function Mf(t,e){return Math.min(...t)<=Math.max(...e)&&Math.max(...t)>=Math.min(...e)}function kf(t){return $i(t.reduce(((t,e)=>(t.push(...Vi(e.bounds)),t)),[]))}const _f={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(t){this.start(t)},rangeMove(t){this.move(t)},rangeEnd(t){this.end(t)},rangeClear(t){this.clear(t)},bubbleStart(t){this.bubbleStart(t)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(t){this.state.rect=t.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=bf(this.state,this.state.brushInstance),this.state.active=null,vf(this.state))},render(t){const e=this.settings.settings;this.state.direction="vertical"===e.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"];let r=iu(this.chart.scale(e.scale),i);const o=function(t){const e={targetRect:null,targetFillRect:null,scale:null,size:null},n=t.settings.settings,i=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((e=>t.chart.component(e))).filter((t=>!!t&&!!t.rect)),r=n.target&&n.target.selector?t.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?t.chart.findShapes(n.target.fillSelector):[];if(r.length>0){const i=kf(r);if(e.size=i[0===t.state.direction?"height":"width"],e.scale=iu(t.chart.scale(n.scale),e.size),e.targetRect=i,o.length>0){const t=kf(o);e.targetFillRect=t}}else if(i&&i.length>0){const n=i.slice(1).reduce(((t,e)=>({x0:Math.min(t.x0,e.rect.computedInner.x),y0:Math.min(t.y0,e.rect.computedInner.y),x1:Math.max(t.x1,e.rect.computedInner.x+e.rect.computedInner.width),y1:Math.max(t.y1,e.rect.computedInner.y+e.rect.computedInner.height)})),{x0:i[0].rect.computedInner.x,y0:i[0].rect.computedInner.y,x1:i[0].rect.computedInner.x+i[0].rect.computedInner.width,y1:i[0].rect.computedInner.y+i[0].rect.computedInner.height});e.targetRect={x:n.x0-t.state.rect.x,y:n.y0-t.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return e}(this);if(r=o.scale?o.scale:r,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?i:o.size,this.state.settings=e,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof e.brush?e.brush.context:e.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!e.multiple,this.state.h=t,this.state.onEditConfirmed=(t,e,n)=>{this.state.edit=null,function(t,e,n,i){let r=t.ranges.map((t=>({min:t.min,max:t.max})));const o=t.scale.min(),a=t.scale.max();r[e]={min:Math.max(o,Math.min(n,i)),max:Math.min(a,Math.max(n,i))},t.ranges[e]=Pi({},r[e]);const s=t.scale.data();s&&s.fields&&s.fields.forEach((e=>{t.fauxBrushInstance||t.brushInstance.setRange(e.id(),r)}))}(this.state,t,e,n),this.emit("bubbleEnd"),vf(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,vf(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof e.bubbles.label&&((t,n)=>e.bubbles.label.call(void 0,{datum:t,data:n,scale:r,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(r,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof e.brush&&e.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=r;const t=this.state.scale.data();!this.state.format&&t&&t.fields&&t.fields[0]&&(this.state.format=t.fields[0].formatter())}else this.state.editable=!1,this.state.scale=ac(),this.state.scale.data=r.data,this.state.format||(this.state.format=(t,e)=>Mf(r.range(),e)?function(t,e){const n=e.ticks(),i=e.domain().indexOf(wf(t,e));return-1!==i?n[i].label:"-"}(t,r):"-"),this.state.fauxBrushInstance=Hc(),this.state.findValues=t=>function(t,e){const n=e.domain(),i=e.range(),r=[];return t.forEach((t=>{if(!Mf(i,[t.min,t.max]))return;const o=n.indexOf(wf(t.min,e)),a=n.indexOf(wf(t.max,e));r.push.apply(r,n.slice(Math.min(o,a),Math.max(o,a)+1))})),r}(t,r);return this.state.ranges=bf(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[gf(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(t){!function(t){let{state:e,e:n,renderer:i,ranges:r,targetSize:o}=t;if(e.started)return;e.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);i.element().contains(l)||(l=null);const c={started:!0};e.offset=Ei({},i.element().getBoundingClientRect());const u=a-e.offset.left,h=s-e.offset.top;e.offset.left+=e.targetRect?e.targetRect.x:0,e.offset.top+=e.targetRect?e.targetRect.y:0,e.ranges=r(e,e.fauxBrushInstance||e.brushInstance);const d=n.center[e.cssCoord.coord]-n[e.cssCoord.pos]-e.offset[e.cssCoord.offset],f=n.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];c.current=e.scale.normInvert(f/e.size),c.start=e.scale.normInvert(d/e.size);let p=e.ranges;const g=mf(e);let m,y,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),g.min=x>0?p[x-1].max:g.min,g.max=x+1<p.length?p[x+1].min:g.max;else{for(m=0;m<p.length;m++){if(p[m].min<=c.start&&c.start<=p[m].max){x=m,g.min=m?p[m-1].max:g.min,g.max=m+1<p.length?p[m+1].min:g.max;break}if(c.start<p[m].min){g.max=p[m].min,g.min=m?p[m-1].max:g.min;break}}-1===x&&p.length&&m>=p.length&&(g.min=p[p.length-1].max)}if(-1!==x||e.multi||(c.ranges=[],g.min=e.scale.min(),g.max=e.scale.max()),-1!==x)if(y={idx:x,start:p[x].min,end:p[x].max,limitLow:g.min,limitHigh:g.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let t=e.scale.norm(y.start)*e.size,n=e.scale.norm(y.end)*e.size;Math.abs(d-t)<=o?(c.start=y.end,y.mode="modify"):Math.abs(d-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:g.min,limitHigh:g.max,mode:"current"};c.active=y,"modify"!==y.mode&&e.targetRect&&!Qu(e.targetRect,{x:u,y:h})||Object.keys(c).forEach((t=>e[t]=c[t]))}({e:t,state:this.state,renderer:this.renderer,ranges:bf,targetSize:5})},end(){this.state.started&&(!function(t,e){t.started=!1,t.ranges=e(t,t.fauxBrushInstance||t.brushInstance);const n=mf(t);xf(t,t.current,n)}(this.state,bf),vf(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(t){this.state.started&&(!function(t,e){const n=(e.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset])/t.size,i=t.scale.normInvert(n);t.current=Math.max(Math.min(i,t.active.limitHigh),t.active.limitLow)}(this.state,t),function(t){let e=t.ranges.map((t=>({min:t.min,max:t.max})));if(-1!==t.active.idx)if("modify"===t.active.mode)e[t.active.idx].min=Math.min(t.start,t.current),e[t.active.idx].max=Math.max(t.start,t.current);else{const n=pf(t);e[t.active.idx].min+=n,e[t.active.idx].max+=n}else e.push({min:Math.min(t.start,t.current),max:Math.max(t.start,t.current)});const n=t.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(t.fauxBrushInstance){let i=bf(t,t.fauxBrushInstance),r=t.findValues(i),o=t.findValues(e),a=o.filter((t=>-1===r.indexOf(t))),s=r.filter((t=>-1===o.indexOf(t))),l=a.map((t=>({key:n.id(),value:t}))),c=s.map((t=>({key:n.id(),value:t})));t.brushInstance.addAndRemoveValues(l,c),t.fauxBrushInstance.setRange(n.id(),e)}else t.brushInstance.setRange(n.id(),e)}))}(this.state),vf(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(t){if(!this.state.editable)return;const e=t.srcEvent||t,n=e.target,i={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(i.rangeIdx)||JSON.stringify(i)===JSON.stringify(this.state.edit))return;this.state.edit=i,e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault();const r=n.parentNode;vf(this.state);const o=r.querySelector("input");o.focus(),o.select()}};function Sf(t){t.renderer.render(gf(t))}function Nf(t){return t.rc.ranges()}function Rf(t,e){const n={x:t.direction?e.min+t.rect.x:t.rect.x,y:t.direction?t.rect.y:e.min+t.rect.y,width:t.direction?e.max-e.min:t.rect.width+t.rect.x,height:t.direction?t.rect.height+t.rect.y:e.max-e.min};return t.chart.shapesAt(n,t.settings.brush)}const Af={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(t){this.start(t)},areaMove(t){this.move(t)},areaEnd(t){this.end(t)},areaClear(t){this.clear(t)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(t){this.state.rect=this.rect;const e=this.settings.settings,n="vertical"===e.direction?0:1,i=this.state.rect[0===n?"height":"width"],r=this.renderer.element().getBoundingClientRect(),o=(e.target?e.target.components||[e.target.component]:[]).map((t=>this.chart.component(t))).filter((t=>!!t&&!!t.rect)),a=o[0]?o.slice(1).reduce(((t,e)=>({x0:Math.min(t.x0,e.rect.x),y0:Math.min(t.y0,e.rect.y),x1:Math.max(t.x1,e.rect.x+e.rect.width),y1:Math.max(t.y1,e.rect.y+e.rect.height)})),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=e,this.state.offset=r,this.state.rc=Ec(),this.state.renderer=this.renderer,this.state.multi=!!e.multiple,this.state.h=t,this.state.size=i,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(t,e){return function(t,e,n){const i=Math.min(...n),r=Math.max(...n),o={x:t.direction?i+t.rect.x:t.rect.x,y:t.direction?t.rect.y:i+t.rect.y,width:t.direction?r-i:t.rect.width+t.rect.x,height:t.direction?t.rect.height+t.rect.y:r-i},a=t.chart.shapesAt(o,t.settings.brush);if(0===a.length)return"-";const s=a.reduce(((n,r)=>{const o=n.bounds,a=r.bounds;return e===i?o[t.cssCoord.coord]<=a[t.cssCoord.coord]?n:r:o[t.cssCoord.coord]+o[t.cssCoord.area]>=a[t.cssCoord.coord]+a[t.cssCoord.area]?n:r})),l=t.settings.brush.components.reduce(((t,e)=>t.key===s.key?t:e));return"function"==typeof t.settings.bubbles.label?t.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,t,e)},[]},start(t){!function(t){let{state:e,e:n,renderer:i,ranges:r,targetSize:o}=t;if(e.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);i.element().contains(l)||(l=null);const c={started:!0};e.offset=i.element().getBoundingClientRect(),e.ranges=r(e);const u=a-e.offset.left,h=s-e.offset.top,d=n.center[e.cssCoord.coord]-n[e.cssCoord.pos]-e.offset[e.cssCoord.offset],f=n.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];let p=f,g=d;c.start=d,c.current=f;let m=e.ranges;const y=yf(e);let x,v,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),y.min=b>0?m[b-1].max:y.min,y.max=b+1<m.length?m[b+1].min:y.max;else{for(x=0;x<m.length;x++){if(m[x].min<=g&&g<=m[x].max){b=x,y.min=x?m[x-1].max:y.min,y.max=x+1<m.length?m[x+1].min:y.max;break}if(g<m[x].min){y.max=m[x].min,y.min=x?m[x-1].max:y.min;break}}-1===b&&m.length&&x>=m.length&&(y.min=m[m.length-1].max)}if(-1!==b||e.multi||(c.ranges=[],y.min=0,y.max=e.direction?e.rect.width:e.rect.height),-1!==b)if(v={idx:b,start:m[b].min,end:m[b].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let t=v.start,e=v.end;Math.abs(d-t)<=o?(c.start=v.end,v.mode="modify"):Math.abs(d-e)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:g,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=v,"modify"!==v.mode&&e.targetRect&&!Qu(e.targetRect,{x:u,y:h})||Object.keys(c).forEach((t=>e[t]=c[t]))}({e:t,state:this.state,renderer:this.renderer,ranges:Nf,targetSize:5})},end(){this.state.started&&(!function(t,e){t.started=!1,t.ranges=e(t);const n=yf(t);xf(t,t.current,n)}(this.state,Nf),Sf(this.state))},move(t){this.state.started&&(!function(t,e){const n=e.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];t.current=Math.max(Math.min(n,t.active.limitHigh),t.active.limitLow)}(this.state,t),function(t){const e=t.ranges.map((t=>({min:t.min,max:t.max})));if(-1!==t.active.idx)if("modify"===t.active.mode)e[t.active.idx].min=Math.min(t.start,t.current),e[t.active.idx].max=Math.max(t.start,t.current);else{const n=pf(t);e[t.active.idx].min=t.active.start+n,e[t.active.idx].max=t.active.end+n}else e.push({min:Math.min(t.start,t.current),max:Math.max(t.start,t.current)});t.rc.set(e);let n=[];e.forEach((e=>{n=[...n,...Rf(t,e)]})),function(t,e){t.chart.brushFromShapes(e,t.settings.brush)}(t,n)}(this.state),Sf(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function Cf(t){const e="vertical"===t.direction,n=t.rect[e?"height":"width"],i=t.rect[e?"width":"height"];return function(t){const e=t.brush;if(!e||!e.isActive())return[];const n=t.scale.data(),i=(n&&n.fields||[]).map((t=>t.id())),r=e.brushes().filter((t=>"range"===t.type&&-1!==i.indexOf(t.id)))[0];return r?r.brush.ranges():[]}(t).map((r=>{const o=t.scale(r.min)*n,a=t.scale(r.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:t.fill,opacity:t.opacity,x:e?0:s,width:e?i:l,y:e?s:0,height:e?l:i}}))}function Df(t,e,n,i){function r(){!function(t){t.renderer.render(Cf(t))}(t)}function o(){!function(t){t.renderer.render(Cf(t))}(t)}function a(){!function(t){t.renderer.render(Cf(t))}(t)}t.brush=e,e&&(e.on("start",r),e.on("update",o),e.on("end",a),t.start=r,t.update=o,t.end=a,t.brush=e,t.scale=n,t.renderer=i)}function Of(t){t.brush&&(t.brush.removeListener("start",t.start),t.brush.removeListener("update",t.update),t.brush.removeListener("end",t.end)),t.start=void 0,t.update=void 0,t.end=void 0,t.brush=void 0,t.scale=void 0,t.renderer=void 0}const Ef={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const t=this.settings.settings,e=this.chart.brush(t.brush),n=t.direction||"horizontal",i="horizontal"===n?this.rect.width:this.rect.height,r=iu(this.chart.scale(t.scale),i);return Of(this.state),Df(this.state,e,r,this.renderer),this.state.rect=this.rect,this.state.fill=t.fill||"#ccc",this.state.opacity=void 0!==t.opacity?t.opacity:1,this.state.direction=n,Cf(this.state)},beforeDestroy(){Of(this.state)}};function zf(t,e){const n=e.center.x,i=e.center.y;return{x:n-t.left,y:i-t.top}}function If(t,e,n){return wu(t,e.points[0])<n.settings.snapIndicator.threshold**2}function Tf(t,e){null==t.path.d?t.path.d="M".concat(e.x," ").concat(e.y," "):t.path.d+="L".concat(e.x," ").concat(e.y," "),t.points.push(e)}function Pf(t){let{state:e,start:n=null,end:i=null}=t;null!==n&&(e.snapIndicator.x1=n.x,e.snapIndicator.y1=n.y),null!==i&&(e.snapIndicator.x2=i.x,e.snapIndicator.y2=i.y)}function qf(t,e){t.snapIndicator.visible=e}const Lf={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(t){this.start(t)},lassoEnd(t){this.end(t)},lassoMove(t){this.move(t)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(t){var e;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(e=this.settings.settings.lasso).fill,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,strokeDasharray:e.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(t){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:t.strokeDasharray,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(t){return{visible:!0,type:"circle",cx:0,cy:0,r:t.r,fill:t.fill,opacity:t.opacity,stroke:t.stroke,strokeWidth:t.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(t,e){const n=t.element.getBoundingClientRect();return{x:e.left-n.left,y:e.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map((t=>({key:t.key,contexts:t.contexts||["lassoBrush"],data:t.data||[""],action:t.action||"add"})));const n=zf(this.state.rendererBounds,t);Tf(this.state,n),Pf({state:this.state,start:n}),function(t,e){t.startPoint.cx=e.x,t.startPoint.cy=e.y}(this.state,n)},move(t){if(!this.state.active)return;const e=zf(this.state.rendererBounds,t);If(e,this.state,this.settings)?qf(this.state,!0):qf(this.state,!1),Tf(this.state,e),Pf({state:this.state,end:e}),function(t,e){const n=[t.startPoint,t.path,t.snapIndicator].filter((t=>t.visible));e.render(n)}(this.state,this.renderer),function(t,e){if(t.active){const n=t.points[t.points.length-2],i=t.points[t.points.length-1];t.lineBrushShape.x1=n.x+t.componentDelta.x,t.lineBrushShape.y1=n.y+t.componentDelta.y,t.lineBrushShape.x2=i.x+t.componentDelta.x,t.lineBrushShape.y2=i.y+t.componentDelta.y;const r=e.shapesAt(t.lineBrushShape,{components:t.brushConfig});e.brushFromShapes(r,{components:t.brushConfig})}}(this.state,this.chart)},end(t){if(!this.state.active)return;qf(this.state,!1);If(zf(this.state.rendererBounds,t),this.state,this.settings)&&function(t,e){if(t.active){const n=t.componentDelta.x,i=t.componentDelta.y,r=t.points.map((t=>({x:t.x+n,y:t.y+i}))),o=e.shapesAt({vertices:r},{components:t.brushConfig});e.brushFromShapes(o,{components:t.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var t,e;this.state.active&&(t=this.state,e=this.chart,t.brushConfig.forEach((t=>{t.contexts.forEach((t=>{e.brush(t).end()}))})),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function jf(t,e,n,i,r){let o,a=0,s=e.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=r(e[l]),o[n]+o[i]<t[n]?a=l+1:s=l}return a}function Ff(t){let{orientation:e,targetNodes:n,labels:i,container:r}=t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jf;const a=[],s="v"===e?"x":"y",l="v"===e?"width":"height",c=t=>t.textBounds,u=t=>t.node.localBounds;return(t,e)=>{const{textBounds:h,node:d}=i[e];if(h[s]<r[s]||h[s]+h[l]>r[s]+r[l])return!1;for(let t=o(h,a,s,l,c);t<a.length;t++)if(Zu(h,a[t].textBounds))return!1;const f=o(h,n,s,l,u),p=h[s]+h[l];for(let t=f;t<n.length;t++){const e=n[t].node;if(p<e.localBounds[s])break;if(Zu(h,e.localBounds)&&d!==e)return!1}return a.push(i[e]),!0}}const Bf=4;function Vf(t,e){return{node:t,data:t.data,scale:e.scale,formatter:e.formatter,dataset:e.dataset}}function $f(t){const e=typeof t;return("string"===e||"number"===e)&&""!==t}function Hf(t){return Pi(Pi({type:"rect",rx:2,ry:2,fill:t.backgroundColor},t.backgroundBounds),{},{data:"".concat(t.data," ").concat(t.text),rotation:t.transform&&t.transform.match(/rotate/gi)?"rotated":"horizontal"})}function Wf(t,e,n){return n?t.width>=e.height:t.width>=e.width}function Uf(t,e,n){return n?t.height>=e.width:t.height>=e.height}function Yf(t,e,n,i,r){let o,a;return"v"===t?(o=i||r||Wf(e,n,!0),a=Uf(e,n,!i)):(o=Wf(e,n),a=r||Uf(e,n,!1)),o&&a}function Xf(t,e,n,i){return t+.5*e+(i-.5)*(e-n)-.5*n}function Gf(t,e,n){const i={type:"text",text:e,maxWidth:n.rotate?t.height:t.width,x:0,y:t.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(!n.overflow&&!function(t,e,n){return Wf(t,e,n.rotate)&&Uf(t,e,n.rotate)}(t,r,n))return!1;const o=.5*r.height;return n.rotate?(i.x=Xf(t.x,t.width,r.height,n.align)+o,i.y=Xf(t.y,t.height,r.width,n.justify),i.transform="rotate(-90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,")")):(i.x=Xf(t.x,t.width,r.width,n.align),i.y=Xf(t.y,t.height,r.height,n.justify)+o),i}function Kf(t){let{bar:e,view:n,direction:i,position:r,padding:o=Bf,measured:a}=t;const s={};if(Ei(s,e),r&&"inside"!==r)if("up"===i||"down"===i){const t=Math.max(0,Math.min(e.y,n.height)),o=Math.max(0,Math.min(e.y+e.height,n.height));"outside"===r&&"up"===i||"opposite"===r&&"down"===i?(s.y=0,s.height=t):("outside"===r&&"down"===i||"opposite"===r&&"up"===i)&&(s.y=o,s.height=n.height-o)}else{const t=Math.max(0,Math.min(e.x,n.width)),o=Math.max(0,Math.min(e.x+e.width,n.width));"outside"===r&&"left"===i||"opposite"===r&&"right"===i?(s.x=0,s.width=t):("outside"===r&&"right"===i||"opposite"===r&&"left"===i)&&(s.x=o,s.width=n.width-o)}else;return function(t,e){const n=Math.max(0,Math.min(t.y,e.height)),i=Math.max(0,Math.min(t.y+t.height,e.height)),r=Math.max(0,Math.min(t.x,e.width)),o=Math.max(0,Math.min(t.x+t.width,e.width));t.x=r,t.width=o-r,t.y=n,t.height=i-n}(s,n),function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{top:i=Bf,bottom:r=Bf,left:o=Bf,right:a=Bf}=n,s="function"==typeof o?o(e):o,l="function"==typeof a?a(e):a,c="function"==typeof i?i(e):i,u="function"==typeof r?r(e):r;t.x+=s,t.width-=s+l,t.y+=c,t.height-=c+u}(s,a,o),s}function Zf(t){let e,n,i,r,o,{direction:a,fitsHorizontally:s,measured:l,node:c,orientation:u,placementSettings:h,rect:d}=t,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kf;const p=[],g="h"===u?"width":"height";for(o=0;o<h.length;o++)if(i=h[o],r=f({bar:c.localBounds,view:d,direction:a,position:i.position,padding:i.padding,measured:l}),p.push(r),e=!o||r[g]>e[g]?r:e,Yf(u,r,l,s,i.overflow)){n=r;break}return n||(n=e,o=p.indexOf(n)),i=h[o],{bounds:n,placement:i}}function Jf(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=Bf,bottom:a=Bf,left:s=Bf,right:l=Bf}=r,c="function"==typeof s?s(e):s,u="function"==typeof l?l(e):l,h="function"==typeof o?o(e):o,d="function"==typeof a?a(e):a,f=t.x+t.dx,p=t.y+t.dy,g=n?Math.min(e.width,i.height):Math.min(e.height,i.width),m=n?Math.min(e.height,i.height):Math.min(e.width,i.width),y=.5*e.height,x=1e-9;return{x:(n?f-y:f)-c-x,y:(n?p:p-y)-h-x,width:m+(c+u)-x,height:g+(h+d)-x}}function Qf(t){let{chart:e,targetNodes:n,rect:i,fitsHorizontally:r,collectiveOrientation:o}=t,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zf,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Gf,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ff;const c=[],u={container:i,targetNodes:n,labels:[],orientation:o};let h,d,f,p,g,m,y,x,v,b,w,M,k,_;for(let t=0,l=n.length;t<l;t++){m=null,d=n[t],f=d.node,k=Vf(f,e),v=d.direction,_="left"===v||"right"===v?"h":"v";for(let e=0;e<d.texts.length;e++){if(p=d.texts[e],!$f(p))continue;b=d.labelSettings[e],x=d.measurements[e],M=b.placements;const n=a({direction:v,fitsHorizontally:r,lblStngs:b,measured:x,node:f,orientation:_,placements:M,placementSettings:d.placementSettings[e],rect:i});if(m=n.bounds,w=n.placement,m&&w){g=w.justify;const e="function"==typeof b.linkData?b.linkData(k,t):void 0,n="function"==typeof w.overflow?w.overflow(k,t):w.overflow;"up"===v&&(g=1-g),"opposite"===w.position&&(g=1-g),"left"===v&&(g=1-g);const i=!("h"===o||r);if(h=s(m,p,{justify:"h"===_?w.align:g,align:"h"===_?g:w.align,fontSize:b.fontSize,fontFamily:b.fontFamily,textMetrics:x,rotate:i,overflow:!!n}),h){const n=Jf(h,x,i,m,w.padding);y="function"==typeof w.fill?w.fill(Pi(Pi({},k),{},{textBounds:n}),t):w.fill,h.fill=y,void 0!==e&&(h.data=e),"object"==typeof w.background&&(h.backgroundColor="function"==typeof w.background.fill?w.background.fill(Pi(Pi({},k),{},{textBounds:n}),t):w.background.fill,void 0!==h.backgroundColor&&(h.backgroundBounds=Jf(h,x,i,m,w.background.padding))),c.push(h),u.labels.push({node:f,textBounds:n})}}}}const S=c.filter(l(u));return[...S.filter((t=>void 0!==t.backgroundBounds)).map(Hf),...S]}function tp(t){const e=2*Math.PI;return(t%e+e)%e}function ep(t,e){t.x+=e,t.width-=2*e,t.y+=e,t.height-=2*e}function np(t){return{x:t.x,y:t.y-t.height/2,width:t.width,height:t.height}}function ip(t,e,n){let{x:i,y:r}=e;if(i*i+r*r>t*t)return null;let o=Math.sin(n),a=Math.cos(n),s=i*a-r*o,l=t*t-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function rp(t){let e,n,{radius:i,size:r,angle:o}=t,{width:a,height:s}=r,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(e=ip(i,l,o),!e)return null;e.y*=-1,n={x:-a,y:0};break;case 1:if(e=ip(i,l,Math.PI-o),!e)return null;n={x:-a,y:-s};break;case 2:if(e=ip(i,l,o-Math.PI),!e)return null;e.x*=-1,n={x:0,y:-s};break;case 3:if(e=ip(i,l,2*Math.PI-o),!e)return null;e.x*=-1,e.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:e.x+n.x,y:e.y+n.y,width:a,height:s}}function op(t){let{slice:e,measured:n,padding:i}=t,{start:r,end:o,innerRadius:a,outerRadius:s}=e,l=s-a-2*i,c=o-r;if(c<Math.PI){let t=(n.height/2+i)/Math.tan(c/2);t>a&&(l=s-t-2*i)}if(l<0||l<n.minReqWidth)return null;const u=tp((r+o)/2);let h=s-i,d={x:Math.sin(u)*h,y:-Math.cos(u)*h,width:l,height:n.height};return u<Math.PI?(d.angle=u-Math.PI/2,d.anchor="end"):(d.angle=u+Math.PI/2,d.anchor="start"),d}function ap(t){let{context:e,node:n,bounds:i}=t;let{start:r,end:o}=n.desc.slice;const a=tp((r+o)/2);switch(Math.floor(a/(Math.PI/2))){case 0:e.q1maxY=i.y-2,void 0===e.q2minY&&(e.q2minY=i.y+i.height+2);break;case 1:e.q2minY=i.y+i.height+2;break;case 2:e.q3minY=i.y+i.height+2;break;case 3:e.q4maxY=i.y-2,void 0===e.q3minY&&(e.q3minY=i.y+i.height+2)}}function sp(t,e){return{node:t,data:t.data,scale:e.scale,formatter:e.formatter,dataset:e.dataset}}function lp(t,e,n){const i={type:"text",text:e,maxWidth:t.width,x:t.x,y:t.y+("top"===t.baseline?t.height/2:0),fill:n.fill,anchor:t.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(t.angle)){let e=t.angle*(360/(2*Math.PI));i.transform="rotate(".concat(e,", ").concat(i.x,", ").concat(i.y,")")}return i}function cp(t){let e,n,{slice:i,direction:r,position:o,padding:a,measured:s,view:l,context:c,store:u}=t,{start:h,end:d,innerRadius:f,offset:p}=i;switch(o){case"into":e="rotate"===r?op({slice:i,measured:s,padding:a}):function(t){let{slice:e,padding:n,measured:i}=t,{start:r,end:o,innerRadius:a,outerRadius:s}=e;const l=tp((r+o)/2);let c=rp({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",th(c,{x1:0,y1:0,x2:Math.sin(r)*s,y2:-Math.cos(r)*s})||th(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||Wu({cx:0,cy:0,r:a},c)?null:(ep(c,n),c)):null}({slice:i,measured:s,padding:a});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},e="rotate"===r?op({slice:n,measured:s,padding:a}):function(t){let{slice:e,padding:n,measured:i,store:r}=t;const{start:o,end:a,outerRadius:s}=e,l=tp((o+a)/2);let c=rp({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",ep(c,n),r.insideLabelBounds.some((t=>Zu(t,c)))?null:(r.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":e="rotate"===r?function(t){let{slice:e,measured:n,padding:i,view:r}=t,{start:o,end:a,outerRadius:s,offset:l}=e,c=s+i,u=a-o;if(u<Math.PI&&(n.height/2+i)/Math.tan(u/2)>c)return null;const h=tp((o+a)/2);let d=Math.sin(h)*c,f=-Math.cos(h)*c,p=n.width+1,g=h%Math.PI;if(g>Math.PI/2&&(g=Math.PI-g),Math.cos(g)>.001){let t=f<0?r.y:r.y+r.height,e=Math.abs(t-l.y)/Math.cos(g)-Math.tan(g)*(n.height/2)-2*i-s;e<p&&(p=e)}if(Math.sin(g)>.001){let t=d<0?r.x:r.x+r.width,e=Math.abs(t-l.x)/Math.sin(g)-n.height/2/Math.tan(g)-2*i-s;e<p&&(p=e)}if(p<=0||p<n.minReqWidth)return null;let m={x:d,y:f,width:p,height:n.height};return h<Math.PI?(m.angle=h-Math.PI/2,m.anchor="start"):(m.angle=h+Math.PI/2,m.anchor="end"),m}({slice:i,measured:s,padding:a,view:l}):function(t){let{slice:e,measured:n,padding:i,view:r,context:o}=t,{start:a,end:s,outerRadius:l,offset:c}=e;const u=tp((a+s)/2);if(function(t,e,n){switch(e){case 0:return t.q1maxY<0;case 1:return t.q2minY>n.height;case 2:return t.q3minY>n.height;case 3:return t.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),r))return null;let h=l+i+n.height/2,d=Math.sin(u)*h,f=-Math.cos(u)*h,p=n.width+1;if(u<Math.PI){let t=Math.abs(r.x+r.width-(d+c.x));t<p&&(p=t)}else{let t=Math.abs(r.x-(d+c.x));t<p&&(p=t)}if(p<n.minReqWidth)return null;let g={x:d,y:f,width:p,height:n.height};return u<Math.PI?g.anchor="start":g.anchor="end",g}({slice:i,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return e&&(e.x+=p.x,e.y+=p.y,"outside"===o&&"rotate"!==r&&function(t,e,n){const{start:i,end:r,offset:o,outerRadius:a}=n,s=tp((i+r)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==e.q1maxY){let n=Math.min(t.y,e.q1maxY-t.height),i=t.y-n;if(t.y=n,i>1){let e=a+2;t.line={type:"line",x1:t.x-2,y1:t.y+2,x2:o.x+Math.sin(s)*e,y2:o.y-Math.cos(s)*e,strokeWidth:1}}}break;case 1:if(void 0!==e.q2minY){let n=Math.max(t.y,e.q2minY),i=n-t.y;if(t.y=n,i>1){let e=a+2;t.line={type:"line",x1:t.x-2,y1:t.y-2,x2:o.x+Math.sin(s)*e,y2:o.y-Math.cos(s)*e,strokeWidth:1}}}break;case 2:if(void 0!==e.q3minY){let n=Math.max(t.y,e.q3minY),i=n-t.y;if(t.y=n,i>1){let e=a+2;t.line={type:"line",x1:t.x+2,y1:t.y-2,x2:o.x+Math.sin(s)*e,y2:o.y-Math.cos(s)*e,strokeWidth:1}}}break;case 3:if(void 0!==e.q4maxY){let n=Math.min(t.y,e.q4maxY-t.height),i=t.y-n;if(t.y=n,i>1){let e=a+2;t.line={type:"line",x1:t.x+2,y1:t.y+2,x2:o.x+Math.sin(s)*e,y2:o.y-Math.cos(s)*e,strokeWidth:1}}}}}(e,c,i)),e}function up(t){let{context:e,direction:n,measured:i,node:r,placementSettings:o,rect:a,store:s}=t,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cp;for(let t=0;t<o.length;t++){let c=o[t],u=l({context:e,slice:r.desc.slice,view:a,direction:n,position:c.position,measured:i,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function hp(t,e,n){const i=e.fontFamily,r="".concat(e.fontSize,"px"),o=n.measureText({text:t,fontFamily:i,fontSize:r});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(t[0],"…"),fontFamily:i,fontSize:r}).width),o}const dp=/\n+|\r+|\r\n/,fp=/\s/,pp=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function gp(t){return"string"==typeof t?-1!==t.search(dp):-1!==String(t).search(dp)}function mp(t){return-1!==t.search(fp)}function yp(t){return-1!==t.search(pp)}function xp(t,e,n){return Math.max(e,Math.min(n,t))}function vp(){let{string:t,separator:e="",reverse:n=!1,measureText:i=t=>({width:t.length,height:1}),mandatoryBreakIdentifiers:r=[gp],noBreakAllowedIdentifiers:o=[],suppressIdentifier:a=[mp,gp,t=>""===t],hyphenationIdentifiers:s=[yp]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(t).split(e);!function(t){""===t[0]&&t.shift(),""===t[t.length-1]&&t.pop()}(l);const c=l.length,u=n?t=>t>=0:t=>t<c;let h=n?c:-1;function d(t){const e=xp(t,0,c-1),n=l[e],u=i(n),h=function(t,e,n,i,r){return i.some((i=>i(t,e,n)))?1:r.some((i=>i(t,e,n)))?0:2}(n,e,l,r,o);return{index:e,value:n,breakOpportunity:h,suppress:a.some((t=>t(n,e,l))),hyphenation:s.some((t=>t(n,e,l))),width:u.width,height:u.height,done:!1}}return{next:function(t){return isNaN(t)?n?h--:h++:h=xp(t,0,c-1),u(h)?d(h):{done:!0}},peek:d,length:c}}const bp="…",wp=/^\s*\d+(\.\d+)?px\s*$/i;function Mp(t){return"string"===typeof t&&wp.test(t)}function kp(t){const e=t["font-size"]||t.fontSize;return Mp(e)?parseFloat(e)*Math.max(isNaN(t.lineHeight)?1.2:t.lineHeight,0):19.2}function _p(t){const e=t.maxHeight,n=Math.max(t.maxLines,1)||1/0;if(isNaN(e))return n;const i=kp(t);return Math.max(1,Math.min(Math.floor(e/i),n))}function Sp(t,e){return{lines:[],line:"",width:0,maxLines:_p(t),maxWidth:t.maxWidth,hyphens:{enabled:"auto"===t.hyphens,char:"‐",metrics:e("‐")}}}function Np(t){t.lines.push(t.line),t.line="",t.width=0}function Rp(t,e){t.line+=e.value,t.width+=e.width}function Ap(t,e,n){if(e.width>t.maxWidth)return e;const i=e.index;for(let r=1;r<5;r++){const o=n.peek(e.index-1);if(!e.hyphenation||!o.hyphenation||0===e.index)return e;if(t.width+t.hyphens.metrics.width<=t.maxWidth)return t.line+=t.hyphens.char,e;if(1===t.line.length)return e;e=n.next(i-r),t.line=t.line.slice(0,-1),t.width-=e.width}return e}function Cp(t,e,n){const i=vp({string:e.value,measureText:n});for(;t.lines.length<t.maxLines;){let e=i.next();if(e.done)break;t.width+e.width>t.maxWidth&&2===e.breakOpportunity&&t.line.length>0?(e=t.hyphens.enabled?Ap(t,e,i):e,Np(t),Rp(t,e)):Rp(t,e)}}function Dp(t,e){const n=vp({string:t.text,separator:"",measureText:e,noBreakAllowedIdentifiers:[(t,e)=>0===e]}),i=Sp(t,e);let r=!0;for(;i.lines.length<i.maxLines;){let t=n.next();if(t.done){Np(i),r=!1;break}1===t.breakOpportunity?Np(i):i.width+t.width>i.maxWidth&&2===t.breakOpportunity?t.suppress?i.width+=t.width:(t=i.hyphens.enabled?Ap(i,t,n):t,Np(i),Rp(i,t)):Rp(i,t)}return{lines:i.lines,reduced:r}}function Op(t,e){const n=vp({string:t.text,separator:/(\s|-|\u2010)/,measureText:e}),i=Sp(t,e);let r=!0;for(;i.lines.length<i.maxLines;){let t=n.next();if(t.done){Np(i),r=!1;break}1===t.breakOpportunity?Np(i):i.width+t.width>i.maxWidth&&2===t.breakOpportunity?t.suppress?Np(i):t.width>i.maxWidth?Cp(i,t,e):(Np(i),Rp(i,t)):Rp(i,t)}return{lines:i.lines,reduced:r}}function Ep(t){return{"break-all":Dp,"break-word":Op}[t.wordBreak]}function zp(t){return e=>{const n=e.node;if(function(t){return"text"===t.type&&!t._lineBreak}(n)){const i=Ep(n);if(!i)return;const r=t(n);if(r.width>n.maxWidth||gp(n.text)){const o=(kp(n)-r.height)/2,a=i(n,function(t,e){return n=>e({text:n,fontSize:t.fontSize,fontFamily:t.fontFamily})}(n,t));e.node=function(t,e,n,i){const r={type:"container",children:[]};void 0!==e.id&&(r.id=e.id);let o=0;return t.lines.forEach(((a,s)=>{const l=Ei({},e);l.text=a,l._lineBreak=!0,o+=n,t.reduced&&s===t.lines.length-1?l.text+=bp:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=i,o+=n,r.children.push(l)})),r}(a,n,o,r.height)}}}}function Ip(t,e){let{text:n,"font-size":i,"font-family":r,maxWidth:o}=t;if(n="string"==typeof n?n:"".concat(n),void 0===o)return n;let a=e({text:n,fontSize:i,fontFamily:r}).width;if(a<=o)return n;let s=0,l=n.length-1;for(;s<=l;){let t=Math.floor((s+l)/2);a=e({text:n.substr(0,t)+bp,fontSize:i,fontFamily:r}).width,a<=o?s=t+1:l=t-1}return n.substr(0,l)+bp}function Tp(t){const e=t.baseline||t["dominant-baseline"];let n=0;const i=parseInt(t.fontSize||t["font-size"],10)||0;switch(e){case"hanging":n=.75*i;break;case"text-before-edge":n=.85*i;break;case"middle":n=.25*i;break;case"central":n=.35*i;break;case"mathemetical":n=i/2;break;case"text-after-edge":case"ideographic":n=.2*-i;break;default:n=0}return n}const Pp={},qp={},Lp={fontSize:void 0,fontFamily:void 0};let jp;function Fp(t,e){return!t&&!e||t===e}function Bp(t){let{text:e,fontWeight:n,fontSize:i,fontFamily:r}=t;const o="".concat(e," ").concat(n," ").concat(i," ").concat(r);return"number"!=typeof qp[o]&&(jp=jp||document.createElement("canvas").getContext("2d"),function(t){let{fontWeight:e,fontSize:n,fontFamily:i}=t;Fp(Lp.fontWeight,e)&&Fp(Lp.fontSize,n)&&Fp(Lp.fontFamily,i)||(jp.font=[e,n,i].filter((t=>!!t)).join(" "),Lp.fontWeight=e,Lp.fontSize=n,Lp.fontFamily=i)}({fontWeight:n,fontSize:i,fontFamily:r}),qp[o]=jp.measureText(e).width),qp[o]}function Vp(t){return"number"!=typeof Pp[t]&&(Pp[t]=function(t){if(Mp(t)){const e=parseFloat(t);return e+4*Math.ceil((e+1e-12)/24)}return 16}(t)),Pp[t]}function $p(t){let{text:e,fontWeight:n,fontSize:i,fontFamily:r}=t;return{width:Bp({text:e,fontWeight:n,fontSize:i,fontFamily:r}),height:Vp(i)}}function Hp(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p;const n=t["font-size"]||t.fontSize,i=t["font-family"]||t.fontFamily,r=e({text:t.text,fontFamily:i,fontSize:n}),o=Math.min(t.maxWidth||r.width,r.width),a=t.x||0,s=t.y||0,l=t.dx||0,c={x:0,y:s+((t.dy||0)+Tp(t))-.75*r.height,width:o,height:r.height},u=t["text-anchor"]||t.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function Wp(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p;const n=Ep(t),i=t["font-size"]||t.fontSize,r=t["font-family"]||t.fontFamily,o=e({text:t.text,fontFamily:r,fontSize:i});if(n&&(o.width>t.maxWidth||gp(t.text))){const o=n(t,(t=>e({text:t,fontFamily:r,fontSize:i}))),a=Ei({},t);let s=0,l="";for(let t=0,n=o.lines.length;t<n;t++){let a=o.lines[t];a+=t===n-1&&o.reduced?bp:"";const c=e({text:a,fontSize:i,fontFamily:r}).width;c>=s&&(s=c,l=a)}a.text=l;const c=Hp(a,e);return c.height=kp(t)*o.lines.length,c}return Hp(t,e)}function Up(t,e){return{node:t,data:t.data,scale:e.scale,formatter:e.formatter,dataset:e.dataset}}function Yp(t,e,n){const i={type:"text",text:e,maxWidth:t.width,x:0,y:t.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(t.width<n.fontSize)return!1;const o=Math.max(0,t.width-r.width);return i.x=t.x+n.align*o,i.y=t.y+r.height/1.2,i}function Xp(t){let{cx:e,cy:n,r:i}=t;return{type:"circle",bounds:{cx:e,cy:n,r:i}}}function Gp(t){return t.desc&&t.desc.slice?function(t){let{start:e,end:n,innerRadius:i,outerRadius:r,offset:o}=t;if(Math.abs(e+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==i?i:r;return Xp({cx:o.x,cy:o.y,r:a})}(t.desc.slice):"circle"===t.type?Xp(t.attrs):"rect"===t.type?{type:"rect",bounds:t.bounds}:{type:null,bounds:null}}var Kp={bar:function(t){let{settings:e,chart:n,nodes:i,rect:r,renderer:o,style:a}=t,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qf;const l=Ei({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=e.labels.map((t=>Ei({},l,e,t))),u=e.labels.map((t=>t.placements.map((n=>Ei({},l,e,t,n))))),{fitsHorizontally:h,hasHorizontalDirection:d,targetNodes:f}=function(t){let{nodes:e,rect:n,chart:i,labelSettings:r,placementSettings:o,settings:a,renderer:s}=t;const l={},c=[];let u,h,d,f,p,g,m,y=!0,x=!1;for(let t=0;t<e.length;t++){if(h=e[t],f=h.localBounds,!Zu(f,n))continue;let v=Vf(h,i);u={node:h,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let e=0;e<r.length;e++)g=r[e],d="function"==typeof g.label?g.label(v,t):void 0,$f(d)&&(m="function"==typeof a.direction?a.direction(v,t):a.direction||"up",x=x||"left"===m||"right"===m,l.fontFamily=g.fontFamily,l.fontSize="".concat(g.fontSize,"px"),l.text=d,p=s.measureText(l),u.measurements.push(p),u.texts.push(d),u.labelSettings.push(g),u.placementSettings.push(o[e]),u.direction=m,y=y&&p.width<=f.width-2*Bf);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:x}}({nodes:i,chart:n,renderer:o,settings:e,rect:r,labelSettings:c,placementSettings:u}),p=function(t){let{orientation:e="auto",defaultOrientation:n="h"}=t;switch(e.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:e.orientation,defaultOrientation:d?"h":"v"}),g="h"===p?"y":"x",m="h"===p?"height":"width";return f.sort(((t,e)=>t.node.localBounds[g]+t.node.localBounds[m]-(e.node.localBounds[g]+e.node.localBounds[m]))),s({chart:n,targetNodes:f,stngs:e,rect:r,fitsHorizontally:h,collectiveOrientation:p})},slice:function(t){let{settings:e,chart:n,nodes:i,rect:r,renderer:o,style:a}=t,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:up,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:lp;const c=Ei({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=e.labels.map((t=>Ei({},c,e,t))),h=e.labels.map((t=>t.placements.map((n=>Ei({},c,e,t,n))))),d=[],f={insideLabelBounds:[]};i=function(t){const e=[],n=[],i=[],r=[];for(let o=0;o<t.length;++o){const{start:a,end:s}=t[o].desc.slice,l=tp((a+s)/2);switch(Math.floor(l/(Math.PI/2))){case 0:e.push(t[o]);break;case 1:n.push(t[o]);break;case 2:i.push(t[o]);break;case 3:r.push(t[o])}}const o=(t,e)=>tp((t.desc.slice.start+t.desc.slice.end)/2)-tp((e.desc.slice.start+e.desc.slice.end)/2),a=(t,e)=>o(e,t);return e.sort(a),n.sort(o),i.sort(a),r.sort(o),e.concat(n,r,i)}(i);const p={};for(let t=0,e=i.length;t<e;t++){const e=i[t],a=sp(e,n);for(let n=0;n<u.length;n++){const i=u[n],c="function"==typeof i.label?i.label(a,t):"";if(!c)continue;const g="function"==typeof i.direction?i.direction(a,t):i.direction||"horizontal",m="function"==typeof i.linkData?i.linkData(a,t):void 0,y=hp(c,i,o),x=s({context:p,direction:g,lblStngs:i,measured:y,node:e,placementSettings:h[n],rect:r,store:f}),v=x.bounds,b=x.placement;if(v&&b){if("outside"===b.position&&"rotate"!==g){ap({context:p,node:e,bounds:v});if(!qu(np(v),r))continue}const n="function"==typeof b.fill?b.fill(a,t):b.fill,o=l(v,c,{fill:n,fontSize:i.fontSize,fontFamily:i.fontFamily,textMetrics:y});o&&(void 0!==m&&(o.data=m),d.push(o),v.line&&(v.line.stroke=n,d.push(v.line)))}}}return d},rows:function(t){let{settings:e,chart:n,nodes:i,renderer:r,style:o}=t,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yp;const s=Ei({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=Ei({},s,e),c=e.labels.map((t=>Ei({},l,t))),u={},h=[];for(let t=0,e=i.length;t<e;t++){let e=i[t],o=Up(e,n),{type:s,bounds:d}=Gp(e);if(!d)continue;let f,p=0,g=[],m=[],y="circle"===s?2*d.r*.9:d.height;for(p+=l.padding,f=0;f<c.length;f++){let e=c[f],n="function"==typeof e.label?e.label(o,t):"";u.fontFamily=e.fontFamily,u.fontSize="".concat(e.fontSize,"px"),u.text=n;let i=r.measureText(u);if(p+=i.height+e.padding,p>y)break;m.push(n),g.push(i)}const x=f,v=Math.max(0,y-p);let b;for(b="circle"===s?d.cy-.9*d.r:d.y,b+=l.justify*v+l.padding,f=0;f<x;f++){let e,n=c[f];if("circle"===s){let t=Math.max(Math.abs(b-d.cy),Math.abs(b+g[f].height-d.cy)),n=Math.sqrt(d.r*d.r-t*t);e={x:d.cx-n+l.padding,y:b,width:2*n-2*l.padding,height:g[f].height}}else e={x:d.x+l.padding,y:b,width:d.width-2*l.padding,height:g[f].height};b+=g[f].height+l.padding;let i="function"==typeof n.fill?n.fill(o,t):n.fill;const u="function"==typeof n.linkData?n.linkData(o,t):void 0;let p=a(e,m[f],{fill:i,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:g[f]});if(p){if(p.text&&p.text!==bp){const t=Ip(p,r.measureText);if(bp===t)continue;p.ellipsed=t}void 0!==u&&(p.data=u),h.push(p)}}}return h}};const Zp={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const t=this.settings.settings,e=[];return(t.sources||[]).forEach((t=>{t.strategy&&Kp[t.strategy.type]&&t.component&&e.push(...function(t,e){let{chart:n,source:i,rect:r,renderer:o,style:a}=t;if(!n.component(i.component))return[];const s=n.findShapes(i.selector).filter((t=>t.key===i.component));return e({chart:n,settings:i.strategy.settings,nodes:s,rect:{x:0,y:0,width:r.width,height:r.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:t,style:this.style},Kp[t.strategy.type]))})),e}};const Jp={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,justify:.5,align:.5,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25},navigation:{button:{class:void 0,content:void 0,tabIndex:void 0},disabled:!1}};function Qp(t){let{x:e=0,y:n,item:i,globalMetrics:r,createSymbol:o,direction:a="ltr"}=t,s=i.label.displayObject,l=i.label.bounds,c=i.symbol.meta;const u="rtl"===a;let h={x:u?e+r.maxLabelBounds.width:e+r.maxSymbolSize+r.spacing,y:n,width:r.maxLabelBounds.width,height:Math.max(r.maxSymbolSize,r.maxLabelBounds.height)},d=function(t,e,n){const i=Math.max(0,t.width-e),r=Math.max(0,t.height-e);return{x:t.x+e/2+n.align*i,y:t.y+e/2+n.justify*r}}({x:u?e+r.maxLabelBounds.width+r.spacing:e,y:n,width:r.maxSymbolSize,height:h.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const f=o(Ei({},c,d));return delete f.collider,s.anchor=u?"end":"start",function(t,e,n){const i=n.textMetrics;if(t.height<i.height)return!1;const r=Math.max(0,t.width-i.width);e.baseline="text-before-edge";const o=Math.max(0,t.height-i.height);e.x=t.x+n.align*r,e.y=t.y+n.justify*o+.175*parseInt(e.fontSize,10)}(h,s,{textMetrics:l,fontSize:parseInt(s.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[f,s],collider:{type:"rect",x:e,y:n,width:r.maxItemBounds.width,height:r.maxItemBounds.height}},metrics:h}}function tg(t,e){const n=t.items.length,i=Math.ceil(n/e),r="horizontal"===t.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical";return t.globalMetrics.maxItemBounds[r]*i+(i-1)*t.layout.margin[o]}function eg(t,e){let n,i,r,o,{onScroll:a=()=>{}}=e,s=null,l=0;const c={itemize:e=>{n=function(t,e){let n,i,{resolved:r,dock:o}=t,a=[],s=r.items.items,l=r.symbols.items,c=r.labels.items,u=0,h=0,d=0;for(let t=0;t<s.length;t++){if(!1===s[t].show)continue;const r=void 0!==c[t].text?c[t].text:c[t].data.label||"";n=Ei({},c[t],{type:"text",fontSize:"".concat(parseInt(c[t].fontSize,10),"px"),text:r,title:r}),i={symbol:{meta:l[t]},label:{displayObject:n,bounds:e.textBounds(n)}},a.push(i),u=Math.max(l[t].size,u),h=Math.max(i.label.bounds.width,h),d=Math.max(i.label.bounds.height,d)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,d),width:u+8+h},maxLabelBounds:{width:h,height:d}},layout:{margin:{vertical:void 0!==r.layout.item.vertical?r.layout.item.vertical:4,horizontal:void 0!==r.layout.item.horizontal?r.layout.item.horizontal:4},mode:r.layout.item.mode,size:r.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:r.layout.item.direction,scrollOffset:r.layout.item.scrollOffset}}}(e,t.renderer),s=isNaN(n.layout.scrollOffset)?s:n.layout.scrollOffset},getItemsToRender:e=>{r=e.viewRect,l=c.getContentOverflow(r);const a=c.extent();s=Math.max(0,Math.min(s,l)),o=Ei({},r);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=s,o["x"===u?"width":"height"]=a,function(t,e,n){let{viewRect:i}=t,{itemized:r,create:o=Qp,parallels:a,createSymbol:s}=n;const l=r.layout.direction,c=r.globalMetrics,u=r.items,h="horizontal"===r.layout.orientation;let d=0;const f=[],p=c.maxItemBounds.height,g=c.maxItemBounds.width,m=r.layout.margin.vertical+p,y=r.layout.margin.horizontal+g;let x=e.x,v=e.y,b=i.x-e.x;for(let t=0;t<u.length;t++){let n=o({y:v,x:"rtl"===l?i.x+b+i.width-g-(x-e.x):x,item:u[t],globalMetrics:c,direction:l,createSymbol:s});if((h&&x>=i.x-g||!h&&v>=i.y-p)&&f.push(n.item),d++,d>=a?(d=0,h?(x+=y,v=e.y):(v+=m,x=e.x)):h?v+=m:x+=y,!h&&v>i.y+i.height)break;if(h&&x>i.x+i.width)break}return f}(e,o,{itemized:n,parallels:i,createSymbol:t.symbol})},parallelize:(t,e)=>(i=function(t,e,n){const i=n.items.length,r="horizontal"===n.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[r]*i+(i-1)*n.layout.margin[o];let s=Math.ceil(a/t);if(null!=e){const t="horizontal"===n.layout.orientation?"height":"width",i="width"===t?"horizontal":"vertical",r=n.layout.margin[i]||4,o=Math.floor((e+r)/(r+n.globalMetrics.maxItemBounds[t]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(t,e,n),i),hasContentOverflow:()=>{const t="horizontal"===n.layout.orientation?"width":"height";return tg(n,i)>r[t]},getContentOverflow:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;const e="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,tg(n,i)-t[e])},getNextSize:()=>{const t="horizontal"===n.layout.orientation?"width":"height",e="width"===t?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[t]+n.layout.margin[e]},getPrevSize:()=>{const t="horizontal"===n.layout.orientation?"width":"height",e="width"===t?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[t]+n.layout.margin[e]},hasNext:()=>"horizontal"===c.orientation()?r.x+r.width<o.x+o.width:r.y+r.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<r.x:o.y<r.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:t=>{const e=Math.max(0,Math.min(l,s-t));e!==s&&(s=e,a())},offset:()=>s,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>tg(n,i),spread:()=>function(t,e){const n=e,i="horizontal"===t.layout.orientation?"height":"width",r="width"===i?"horizontal":"vertical";return t.globalMetrics.maxItemBounds[i]*n+(n-1)*t.layout.margin[r]}(n,i)};return c}function ng(t){return Object.keys(t).filter((e=>t[e])).join(" ")}const ig={up:"▲",right:"▶",down:"▼",left:"◀"};function rg(t,e){let{size:n,isActive:i,direction:r,nav:o,attrs:a}=e,s={},l="";const c=a;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:r}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(t,{direction:r})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(s).length||(u.border="0",u.background="none"),(!i||o&&o.disabled)&&(c.disabled="disabled"),t("button",Ei({class:ng(s),style:u},c),[l||t("span",{style:{pointerEvents:"none"}},[ig[r]])])}function og(t){let e;const n={itemize:t=>{e=function(t){let{dock:e,navigation:n}=t;return{layout:{orientation:"top"===e||"bottom"===e?"vertical":"horizontal"},navigation:n}}(t)},render:i=>function(t,e,n,i){let{rect:r,itemRenderer:o}=e;if(!t||!t.renderArgs)return;t.size(r);const a=t.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void t.render([]);const h=s?["right","left"]:["down","up"];l&&s&&h.reverse();const d=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[rg(a,{size:32,isActive:c,direction:h[0],attrs:{"data-action":"next","data-component-key":i.settings.key},nav:n.navigation}),rg(a,{size:32,isActive:u,direction:h[1],attrs:{"data-action":"prev","data-component-key":i.settings.key},nav:n.navigation})])];t.render(d)}(n.renderer,i,e,t),extent:()=>32,spread:()=>64};return n}function ag(t){let e;const n={itemize:n=>{e=function(t,e){let{resolved:n}=t;if(!1===n.title.item.show)return null;const i=Ei({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(i.anchor&&"start"!==i.anchor?"end"===i.anchor&&(i.anchor="start"):i.anchor="end"),void 0===n.title.settings.text){const t=e.scale.data().fields;i.text=t&&t[0]?t[0].title():""}return{displayObject:i,bounds:e.renderer.textBounds(i)}}(n,t)},render:t=>{!function(t,e,n){let{rect:i}=t;if(!e)return;const r=[];if(e.size(i),n){const t={start:0,end:i.width,middle:i.width/2};r.push(Ei({},n.displayObject,{x:t[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}e.render(r)}(t,n.renderer,e)},spread:()=>e?e.bounds.height:0,extent:()=>e?e.bounds.width:0};return n}function sg(t,e,n,i){let r,o,a,{itemRenderer:s,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=i,h=0;const d={x:e.spacing,y:e.spacing,width:t.width-2*e.spacing,height:t.height-2*e.spacing};if(r={x:d.x,y:d.y,width:d.width,height:c.spread()},"horizontal"===n){r={x:d.x,y:d.y,width:c.extent(),height:c.spread()};const t=d.width-r.width-(r.width?e.spacing:0),n=d.height;s.parallelize(t,u?void 0:n);const i=s.extent()>t?l.extent():0,f=s.spread(),p=i?l.spread():0;o={x:r.x+r.width+(r.width?e.spacing:0),y:d.y+Math.max(0,(p-f)/2),width:d.width-i-r.width-(i?e.spacing:0)-(r.width?e.spacing:0),height:n},a={x:o.x+o.width+(i?e.spacing:0),y:d.y,width:i,height:d.height},r.y=o.y;"rtl"===s.direction()&&(a.x=d.x,o.x=a.x+a.width+(a.width?e.spacing:0),r.x=o.x+o.width+(r.width?e.spacing:0)),h=Math.max(r.height,p,s.spread())}else{const t=d.height-r.height-(r.height?e.spacing:0),n=d.width;s.parallelize(t,u?void 0:n);const i=s.extent()>t?l.extent():0;a={x:d.x,y:d.y+d.height-i,width:d.width,height:i},o={x:d.x,y:r.y+r.height+(r.height?e.spacing:0),width:d.width,height:d.height-r.height-(r.height?e.spacing:0)-a.height-(a.height?e.spacing:0)},h=Math.max(c.extent(),i?l.spread():0,s.spread())}return o=Ei({},t,{x:t.x+o.x,y:t.y+o.y,width:o.width,height:o.height}),a.x+=t.x,a.y+=t.y,r.x+=t.x,r.y+=t.y,{title:Ei({},t,r),content:Ei({},t,o),navigation:Ei({},t,a),orientation:n,preferredSize:h}}function lg(t){t.state.resolved=function(t){const e=t.scale.domain();let n={items:[]};const i=t.settings.layout.dock;if("threshold-color"===t.scale.type){const r=t.scale.data().fields[0];let o=t=>String(t);t.settings.formatter?o=t.chart.formatter(t.settings.formatter):r&&(o=r.formatter());for(let t=0;t<e.length-1;t++){const i={value:e[t],label:"".concat(o(e[t])," - < ").concat(o(e[t+1]))};r&&(i.source={field:r.id()}),n.items.push(i)}"vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")&&n.items.reverse()}else{const i=t.scale.labels?t.scale.labels():null;n.items=e.map(((e,n)=>{const r=t.scale.datum?Ei({},t.scale.datum(e)):{value:e};return r.value=e,t.scale.label?r.label=t.scale.label(e):i&&(r.label=i[n]),r}))}const r=t.resolver.resolve({data:{fields:t.scale.data().fields},defaults:Ei(!0,{},Jp.title,t.style.title),settings:t.settings.settings.title}),o=t.resolver.resolve({data:{fields:t.scale.data().fields},defaults:Jp.layout,settings:t.settings.settings.layout}),a=t.resolver.resolve({data:n,defaults:Ei(!0,{},Jp.item.label,t.style.item.label),settings:(t.settings.settings.item||{}).label}),s=Ei(!0,{},(t.settings.settings.item||{}).shape);void 0===s.fill&&t.settings.scale&&(s.fill={scale:t.settings.scale});const l=t.resolver.resolve({data:n,defaults:Ei(!0,{},Jp.item.shape,t.style.item.shape),settings:s}),c=t.resolver.resolve({data:n,defaults:Ei(!0,{},{show:Jp.item.show}),settings:{show:(t.settings.settings.item||{}).show}});function u(t,n){let i=t.data.value,r=e[n+1];t.data.value=[i,r]}"threshold-color"===t.scale.type&&("vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:r,labels:a,symbols:l,items:c,layout:o}}(t),t.titleRenderer.itemize({resolved:t.state.resolved,dock:t.settings.layout.dock||"center"}),t.itemRenderer.itemize({resolved:t.state.resolved,dock:t.settings.layout.dock||"center"}),t.navigationRenderer.itemize({resolved:t.state.resolved,dock:t.settings.layout.dock||"center",navigation:t.settings.settings.navigation}),t.state.display={spacing:8}}function cg(t){const{rect:e,settings:n,state:i,itemRenderer:r,navigationRenderer:o,titleRenderer:a}=t,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=sg(e,i.display,l,{itemRenderer:r,navigationRenderer:o,titleRenderer:a});t.renderer.size(c.content);let u=r.getItemsToRender({viewRect:Ei({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:r}),a.render({rect:c.title}),t.state.views={layout:c},u}const ug={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(t){t&&t.parentNode&&(this.navigationRenderer.renderer.appendTo(t.parentNode),this.titleRenderer.renderer.appendTo(t.parentNode),t.parentNode.insertBefore(this.navigationRenderer.renderer.element(),t),t.parentNode.insertBefore(this.titleRenderer.renderer.element(),t)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(t){if(!this.state.interaction.started)return;const e="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*t.deltaX:t.deltaY;this.itemRenderer.scroll(e-this.state.interaction.delta),this.state.interaction.delta=e},panend(){this.state.interaction.started=!1},scroll(t){this.itemRenderer.scroll(-t)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const t=cg(this);this.update(t)},this.itemRenderer=eg(this,{onScroll:this.onScroll}),this.navigationRenderer=og(this),this.titleRenderer=ag(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),lg(this)},preferredSize(t){return function(t,e){let n=0;const i=t.settings.layout.dock||"center",r="top"===i||"bottom"===i?"horizontal":"vertical",o=t.state.display,a=sg(e.inner,o,r,{itemRenderer:t.itemRenderer,navigationRenderer:t.navigationRenderer,titleRenderer:t.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,t)},beforeUpdate(){lg(this)},render(){return cg(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function hg(t,e){let n=0;const i=t.state.isVertical?"justify":"align",r=t.state.isVertical?"y":"x",o=t.state.isVertical?"height":"width",a=t.state.isVertical?"requiredHeight":"requiredWidth";n=t.state.rect[o]-t.state.legend.length()-t.state.title[a](),n*=Math.min(1,Math.max(t.stgns[i],0)),e[r]+=n}function dg(t,e,n){const i=n[t];return"object"==typeof i?-1!==i.valid.indexOf(e)?e:i.default:n.default}function fg(t){return dg(t.layout.dock,t.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function pg(t,e){const n={x:0,y:0,width:0,height:0},i=t.stgns.padding;return n.x=i.left,n.y=i.top,n.width=e.width-i.left-i.right,n.height=e.height-i.top-i.bottom,n}function gg(t){const e="top"!==t.settings.layout.dock&&"bottom"!==t.settings.layout.dock,n=t.stgns.title,i=t.chart.scale(t.stgns.fill),r=t.chart.scale(t.stgns.major),o=function(t,e){const n=e.domain();let i=n,r=t.stgns.tick.label;!r&&t.formatter?r=t.formatter:!r&&e.data().fields&&(r=e.data().fields[0].formatter()),"function"==typeof r&&(i=n.map(r).map(String));const o=n.map(((n,r)=>{const o=i[r];return{value:n,label:o,pos:e.norm(parseFloat(n,10)),textMetrics:t.renderer.measureText({text:o,fontSize:t.stgns.tick.fontSize,fontFamily:t.stgns.tick.fontFamily})}}));return o}(t,r),a=dg((s=t.settings).layout.dock,s.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});var s;if(void 0===n.text){const t=r.data().fields;n.text=t&&t[0]?t[0].title():""}const l=t.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=t.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),u={isVertical:e,nodes:[],title:{anchor:fg(t.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let t=c.width,i=n.maxLengthPx;return e||(t+=n.padding,i+=n.padding),Math.min(t,i,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let t=c.height;return e&&(t+=n.padding),Math.min(t,u.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map((t=>t.textMetrics.width))),t.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...u.ticks.values.map((t=>t.textMetrics.height)))+t.stgns.tick.padding:0,height:Math.max(...o.map((t=>t.textMetrics.height)))},legend:{fillScale:i,majorScale:r,length:()=>{const n=e?"height":"width",i=e?"requiredHeight":"requiredWidth",r=Math.min(u.rect[n],u.rect[n]*t.stgns.length)-u.title[i]();return Math.max(0,Math.min(r,t.stgns.maxLengthPx))}}};return u}const mg={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(t){const e=this.state;e.rect=pg(this,t.inner);let n=this.stgns.size;const i=e.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=i;const r=Math.max(t.inner.width,t.inner.height);if("left"===e.ticks.anchor||"right"===e.ticks.anchor){const t=e.ticks.values.reduce(((t,e)=>t+e.textMetrics.height),0);if(t>this.state.legend.length())return r;n+=e.ticks.length}else{if(e.ticks.length>this.state.legend.length())return r;n+=Math.max(...e.ticks.values.map((t=>t.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===e.title.anchor||"right"===e.title.anchor?Math.max(e.title.textBounds.height+i,n):Math.max(n,e.title.requiredWidth()+i)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=gg(this)},beforeUpdate(t){this.stgns=t.settings.settings,this.state=gg(this)},beforeRender(t){if(this.state.nodes=[],this.state.rect=pg(this,t.size),this.stgns.title.show){const t=function(t){const e=t.state,n=t.stgns,i="left"===e.ticks.anchor,r="top"===e.ticks.anchor;let o=e.rect.x,a=e.rect.y,s="start";"left"===e.title.anchor?(o+=e.title.requiredWidth()-n.title.padding,a+=e.title.textMetrics.height,a+=r?e.rect.height-e.title.textBounds.height:0,s="end"):"right"===e.title.anchor?(o+=e.legend.length(),o+=n.title.padding,a+=e.title.textMetrics.height,a+=r?e.rect.height-e.title.textBounds.height:0):"top"===e.title.anchor&&(o+=i?e.rect.width:0,a+=e.title.textMetrics.height,s=i?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,e.rect.y+e.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return hg(t,l),l}(this);this.state.nodes.push(t)}const e=function(t){const e=t.state.legend.fillScale,n=t.state.legend.majorScale,i=e.domain().map((t=>({type:"stop",color:e(t),offset:Math.min(1,Math.max(0,n.norm(t)))})));return i.sort(((t,e)=>t.offset-e.offset))}(this),n=function(t,e){const n=t.state,i=t.stgns,r=n.rect;let o=r.x,a=r.y,s=n.isVertical?i.size:n.legend.length(),l=n.isVertical?n.legend.length():i.size;"left"===n.ticks.anchor?o+=n.rect.width-i.size:"top"===n.ticks.anchor&&(a+=n.rect.height-i.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:e,degree:n.isVertical?90:180}};return hg(t,c),c}(this,e),i=function(t,e){const n=t.state,i=t.stgns;let r="start";const o={type:"rect",x:e.x,y:e.y,width:n.isVertical?0:e.width,height:n.isVertical?e.height:0,fill:"transparent"},a=n.ticks.values.map((a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=e.y+e.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=e.x+e.width*a.pos,"right"===n.ticks.anchor?(s=e.x+i.size+i.tick.padding,o.x=e.x+e.width):"left"===n.ticks.anchor?(s=e.x-i.tick.padding,r="end"):"top"===n.ticks.anchor?(l=e.y-i.tick.padding,c-=.25*a.textMetrics.height,r=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=e.y+e.height+i.tick.padding,c=.8*a.textMetrics.height,r=0===a.pos?"start":"end",o.y=e.y+e.height),{type:"text",x:s,y:l,dx:0,dy:c,text:a.label,fontSize:i.tick.fontSize,fontFamily:i.tick.fontFamily,fill:i.tick.fill,maxWidth:n.isVertical?i.tick.maxLengthPx:Math.min(i.tick.maxLengthPx,n.legend.length()/2),anchor:r,textBoundsFn:t.renderer.textBounds,title:a.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),r={id:"legend-seq-target",type:"container",children:[n,i]};this.state.nodes.push(r)},render(){return this.state.nodes}};const yg={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},connect:!1,orientation:"horizontal",layers:{curve:"linear",show:!0,sort:void 0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function xg(t,e){let{generatorType:n,item:i,data:r,major:o,minor:a,layerObj:s,stngs:l}=e,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:t,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:i.opacity,stroke:i.stroke,strokeWidth:i.strokeWidth,strokeLinejoin:i.strokeLinejoin,fill:c||i.fill,data:r};return i.strokeDasharray&&(u.strokeDasharray=i.strokeDasharray),u}function vg(t){const{metaLayers:e,coordinates:n,layers:i,lines:r,areas:o}=function(t){let{data:e,stngs:n,rect:i,resolver:r,style:o,domain:a}=t;const{width:s,height:l}=i,c=r.resolve({data:e,defaults:yg.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),h={};let d=0;for(let t=0;t<c.items.length;t++){let e=c.items[t],n=e.layerId;if(u){const t=h[n]?h[n].items[h[n].items.length-1]:null,i=t?a.indexOf(t.data.major?t.data.major.value:t.data.value):null;t&&a.indexOf(e.data.major?e.data.major.value:e.data.value)-1!==i&&h[n].items.push({dummy:!0})}h[n]=h[n]||{order:d++,id:n,items:[],dataItems:[],consumableData:{}},h[n].dataItems.push(e.data),h[n].items.push(e)}const f=Object.keys(h).map((t=>(h[t].consumableData=Pi({points:h[t].dataItems},h[t].dataItems[0]),h[t]))),p={items:f.map((t=>t.consumableData))},g=n.layers||{};return{coordinates:c,metaLayers:f,layers:r.resolve({data:p,defaults:{curve:yg.layers.curve,show:yg.layers.show},settings:{curve:g.curve,show:g.show}}),lines:r.resolve({data:p,defaults:Ei({},yg.layers.line,o.line),settings:g.line}),areas:r.resolve({data:p,defaults:Ei({},yg.layers.area,o.area),settings:g.area})}}(t),a=[];return e.forEach(((e,s)=>{const l=i.items[s];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=e.id;const c=[],u=[];let h,d;for(let i=0;i<e.items.length;i++){if(h=e.items[i],d=h.data,!h.dummy){if(isNaN(h.major))continue;t.missingMinor0&&(h.minor0=n.settings.minor.scale?n.settings.minor.scale(d.minor0?d.minor0.value:0):0),isNaN(h.minor)||c.push(h.minor),l.data.push(h.data)}u.push(h)}const f=c.sort(((t,e)=>t-e))[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:r.items[s],areaObj:o.items[s],median:f,points:u,consumableData:e.consumableData})})),a}const bg={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(t){let{data:e}=t;const{width:n,height:i}=this.rect;this.stngs=this.settings.settings||{};const r=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=vg({data:e,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:r,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const t=o.map((t=>({id:t.layerObj.id,data:t.layerObj.data}))).sort(this.stngs.layers.sort).map((t=>t.id));o.sort(((e,n)=>t.indexOf(e.layerObj.id)-t.indexOf(n.layerObj.id)))}else o.sort(((t,e)=>t.median-e.median));return function(t,e){let{width:n,height:i,missingMinor0:r,stngs:o}=e;const a=[],s=o.layers||{};return t.forEach((t=>{const{lineObj:e,layerObj:l,areaObj:c,points:u}=t;let h={size:i,p:"y"},d={size:n,p:"x"};if("vertical"===o.orientation){const t=Ei(!0,{},d);d=Ei(!0,{},h),h=Ei(!0,{},t)}s.area&&!1!==c.show&&a.push(xg(u,{data:t.consumableData,item:c,generatorType:"area",major:d,minor:h,layerObj:l,stngs:o})),e&&!1!==e.show&&(a.push(xg(u,{data:t.consumableData,item:e,generatorType:"line".concat(h.p.toUpperCase(),"1"),major:d,minor:h,layerObj:l,stngs:o},"none")),!r&&s.area&&!1!==c.show&&!1!==e.showMinor0&&a.push(xg(u,{data:t.consumableData,item:e,generatorType:"line".concat(h.p.toUpperCase(),"0"),major:d,minor:h,layerObj:l,stngs:o},"none")))})),a}(o,{width:n,height:i,missingMinor0:r,stngs:this.stngs})}};function wg(t,e){let n,i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof e.center?(n=e.center.x,i=e.center.y):(n=e.clientX,i=e.clientY);const o=n-t.state.boundingRect.left,a=i-t.state.boundingRect.top;return{x:r?Math.max(0,Math.min(o,t.rect.width)):o,y:r?Math.max(0,Math.min(a,t.rect.height)):a}}function Mg(t,e){return{x:e.x+t.rect.x,y:e.y+t.rect.y}}function kg(t,e){const n=Math.min(t.x,e.x),i=Math.min(t.y,e.y);return{x:n,y:i,width:Math.max(t.x,e.x)-n,height:Math.max(t.y,e.y)-i}}const _g={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(t){this.start(t)},areaMove(t){this.move(t)},areaEnd(t){this.end(t)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(t){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const e=wg(this,t,!1);Qu({x:0,y:0,width:this.rect.width,height:this.rect.height},e)&&(this.state.brushConfig=this.settings.settings.brush.components.map((t=>({key:t.key,contexts:t.contexts,data:t.data,action:t.action||"set"}))),this.state.start=wg(this,t),this.state.active=!0)},move(t){var e;this.state.active&&(this.state.end=wg(this,t),function(t){if(t.state.active){const e=Mg(t,t.state.start),n=Mg(t,t.state.end),i=t.chart.shapesAt(kg(e,n),{components:t.state.brushConfig});t.chart.brushFromShapes(i,{components:t.state.brushConfig})}}(this),(e=this).renderer.render([Ei({type:"rect"},kg(e.state.start,e.state.end),e.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var t,e;this.state.active&&(t=this.state,e=this.chart,t.brushConfig.forEach((t=>{Array.isArray(t.contexts)&&t.contexts.forEach((t=>{e.brush(t).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function Sg(t,e,n){let{renderer:i,style:r,props:o,h:a}=n;const s=function(t,e){return{tooltip:"function"==typeof t.tooltipClass?t.tooltipClass({dock:e.dock}):t.tooltipClass,content:"function"==typeof t.contentClass?t.contentClass({dock:e.dock}):t.contentClass,arrow:"function"==typeof t.arrowClass?t.arrowClass({dock:e.dock}):t.arrowClass}}(o,e),l=function(t,e,n,i){return i.content({h:t,style:n,data:e})}(a,t,r,o),c=a("div",{dir:o.direction,class:ng(Ei({"pic-tooltip":!0},s.tooltip)),style:Ei({position:"relative",display:"inline-block"},e.computedTooltipStyle)},a("div",{style:r.content,class:ng(Ei({"pic-tooltip-content":!0},s.content))},l),a("div",{class:ng(Ei({"pic-tooltip-arrow":!0},s.arrow)),style:Ei({},r.arrow,r["arrow-".concat(e.dock)],e.computedArrowStyle)}));return i.render(c),i.element().children[0]}function Ng(t){let{defaultDuration:e,defaultDelay:n}=t,i=null,r=null,o=!1;const a=function(){const t=function(){},e={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return t.set=t=>{n=t,e[n].forEach((e=>e(t)))},t.on=(t,n)=>{Array.isArray(t)?t.forEach((t=>e[t].push(n))):e[t].push(n)},t.destroy=()=>{Object.keys(e).forEach((t=>{e[t].length=0}))},t}(),s=function(){},l=()=>{i=null,r=null,o=!1,a.set("fulfilled")};return s.invoke=function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;i&&(clearTimeout(i),a.set("debounced")),a.set("pending"),i=setTimeout((()=>{t(),o=!0,i=null,a.set("active")}),c),s>0&&(r&&clearTimeout(r),r=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):i&&(clearTimeout(i),a.set("rejected")),r&&clearTimeout(r),i=null,r=null,o=!1},s.on=(t,e)=>{a.on(t,e)},s.destroy=()=>{s.clear(),a.destroy()},s}function Rg(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-t,"px)"),right:"translate(".concat(t,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-t,"px)"),bottom:"translate(-50%, ".concat(t,"px)"),inside:"translate(-50%, -50%)"}}function Ag(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-t-n,y:-e/2},right:{x:n,y:-e/2},top:{x:-t/2,y:-e-n},bottom:{x:-t/2,y:n},inside:{x:-t/2,y:-e/2}}}function Cg(t,e){const n=t>0?"-":"+";return t=Math.abs(t),void 0===e&&(e=t),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(t,"px)"),borderWidth:"".concat(e,"px")},right:{left:"".concat(2*-t,"px"),top:"calc(50% ".concat(n," ").concat(t,"px)"),borderWidth:"".concat(e,"px")},top:{left:"calc(50% ".concat(n," ").concat(t,"px)"),top:"100%",borderWidth:"".concat(e,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(t,"px)"),top:"".concat(2*-t,"px"),borderWidth:"".concat(e,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function Dg(t,e,n,i,r,o){const a=e+o.x,s=n+o.y,l=r;return!(a<0||s<0)&&!(a+i>t.width||s+l>t.height)}function Og(t){let{area:e,vx:n,vy:i,width:r,height:o,offset:a}=t;const s=n+a.x,l=i+a.y,c=r,u=o;let h=s<0?-s:0,d=l<0?-l:0;return h+=s+c>e.width?-(s+c-e.width):0,d+=l+u>e.height?-(l+u-e.height):0,{x:h,y:d}}function Eg(t){let{options:e,pointer:n,width:i,height:r,dockOrder:o,x:a,y:s}=t;const{targetBounds:l}=n,c=Rg(e.offset),u=c[e.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:Cg(e.offset)[e.dock],dock:e.dock};const h={width:"target"===e.area?l.width:window.innerWidth,height:"target"===e.area?l.height:window.innerHeight},d=Ag(i,r,e.offset),f=[],p="target"===e.area?a:l.left+a,g="target"===e.area?s:l.top+s;for(let t=0;t<o.length;t+=1){const n=o[t],l=Og({area:h,vx:p,vy:g,width:i,height:r,offset:d[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},m=Cg(e.offset)[n];0!==l.x&&(u.width="".concat(i-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),m.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:m,dock:n,rect:{width:i,height:r}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort(((t,e)=>Math.abs(t.offset.x)-Math.abs(e.offset.x))),f[0]}function zg(t,e,n){const i=t.key?n.component(t.key):n.componentsFromPoint({x:e.clientX,y:e.clientY})[0];if(!i)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const r=i.rect;return Ei({scaleRatio:r.scaleRatio},r.computedInner)}const Ig={bounds:function(t){let{resources:e,nodes:n,pointer:i,width:r,height:o,options:a}=t;const{targetBounds:s}=i,{x:l,y:c,width:u,height:h}=e.getNodeBoundsRelativeToTarget(n[0]),d={left:{x:l,y:c+h/2},right:{x:l+u,y:c+h/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+h},inside:{x:l+u/2,y:c+h/2}},f=Rg(a.offset),p=f[a.dock];if(p)return{computedTooltipStyle:{left:"".concat(d[a.dock].x,"px"),top:"".concat(d[a.dock].y,"px"),transform:p},computedArrowStyle:Cg(a.offset)[a.dock],dock:a.dock};const g={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},m=Ag(r,o,a.offset),y=["top","left","right","bottom","inside"];for(let t=0;t<y.length;t+=1){const e=y[t];if(Dg(g,"target"===a.area?d[e].x:s.left+d[e].x,"target"===a.area?d[e].y:s.top+d[e].y,r,o,m[e]))return{computedTooltipStyle:{left:"".concat(d[e].x,"px"),top:"".concat(d[e].y,"px"),transform:f[e]},computedArrowStyle:Cg(a.offset)[e],dock:e}}const x=function(t){let{options:e,docks:n,dockOffsets:i,targetBounds:r,area:o,width:a,height:s}=t;const l="top",c="target"===e.area?n[l].x:r.left+n[l].x,u=("target"===e.area?n[l].y:(r.top,n[l].y),i[l]),h=c+u.x,d=(u.y,a);let f=n.top.x;return h<0&&h+d>o.width||(h<0?f-=h:h+d>o.width&&(f-=h+d-o.width)),f}({options:a,docks:d,dockOffsets:m,targetBounds:s,area:g,width:r,height:o});return{computedTooltipStyle:{left:"".concat(x,"px"),top:"".concat(d.top.y,"px"),transform:f.top},computedArrowStyle:Cg(a.offset+x-d.top.x,a.offset).top,dock:"top"}},pointer:function(t){let{options:e,pointer:n,width:i,height:r}=t;const{x:o,y:a}=n;return Eg({x:o,y:a,pointer:n,width:i,height:r,options:e,dockOrder:["top","left","right","bottom"]})},slice:function(t){let{options:e,pointer:n,width:i,height:r,nodes:o,resources:a}=t;const s=o[0],{dx:l,dy:c}=n,u=a.getComponentBoundsFromNode(s),h=l+u.x+u.width/2,d=c+u.y+u.height/2,{start:f,end:p,outerRadius:g}=s.desc.slice,m=(f+p)/2-Math.PI/2,y=2*Math.PI,x=(m%y+y)%y;let v=["top","left","right","bottom"];return"auto"===e.dock&&(v=x<=Math.PI/4||x>=7*Math.PI/4?["right","top","bottom","left"]:x<=3*Math.PI/4?["bottom","left","right","top"]:x<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),Eg({x:h+g*u.scaleRatio.x*Math.cos(x),y:d+g*u.scaleRatio.y*Math.sin(x),pointer:n,width:i,height:r,options:e,dockOrder:v})}};function Tg(t,e){let{width:n,height:i}=t,{chart:r,state:o,props:a}=e;const s={resources:{formatter:r.formatter,scale:r.scale,component:r.component,getComponentBoundsFromNode:t=>zg(t,o.pointer,r),getNodeBoundsRelativeToTarget:t=>function(t,e,n){const i=zg(t,e,n),r=t.bounds;return{x:i.x+e.dx+r.x,y:i.y+e.dy+r.y,width:r.width,height:r.height}}(t,o.pointer,r)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:i},l=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=Ei(c,a.placement(s))),"object"===l&&Ig[a.placement.type]?c=Ei(c,a.placement):"string"===l&&Ig[a.placement]&&(c=Ei(c,{type:a.placement})),s.options=c;const u=Ig[c.type](s);let{x:h,y:d,width:f,height:p}=s.resources.getComponentBoundsFromNode(s.nodes[0]);return h+=s.pointer.dx,f+=h,d+=s.pointer.dy,p+=d,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.left)),f),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.top)),p),"px"),u}let Pg;function qg(){Pg=null}const Lg={duration:8e3,delay:500,filter:t=>t.filter((t=>t.data&&void 0!==t.data.value)),extract:t=>t.node.data.value,content:t=>{let{h:e,data:n}=t;return n.map((t=>e("div",{},t)))},isEqual:(t,e)=>t.length&&t.length===e.length&&t.every(((t,n)=>e[n]&&JSON.stringify(t.data)===JSON.stringify(e[n].data))),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const jg={require:["chart","renderer"],defaultSettings:{settings:Lg,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(t,e)},prevent(t){this.prevent(t)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(t){let e,{nodes:n,duration:i,delay:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(t,e){let{chart:n,state:i}=e,r=0,o=0;t.center?(r+=t.center.x,o+=t.center.y):(r+=t.clientX,o+=t.clientY);const a=n.element.getBoundingClientRect(),s=i.targetElement.getBoundingClientRect(),l=r,c=o,u=a.left-s.left,h=a.top-s.top,d=r-a.left,f=o-a.top;return r-=s.left,o-=s.top,{x:r,y:o,dx:u,dy:h,cx:d,cy:f,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(t,this),e=Array.isArray(n)?this.props.filter(n):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,e)||(this.dispatcher.clear(),this.state.activeNodes=e,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),i,r)))},prevent(t){this.state.prevent=!!t},init(t){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=t.settings,this.dispatcher=Ng({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const e=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(t){Pg&&Pg!==t&&Pg()}(e),Pg=e,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const t={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,Ei({element:this.state.tooltipElm},t)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,Ei({element:this.state.tooltipElm},t)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,t),Pg===e&&(Pg=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(t){let{settings:e}=t;this.dispatcher&&(this.dispatcher.destroy(),qg()),this.init(e)},render(t){return this.h=t,[]},beforeDestroy(){this.dispatcher.destroy(),qg()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const{width:t,height:e}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:t,height:e}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(t){const e=function(t,e){let{chart:n,scale:i,props:r,h:o}=e;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:i,h:o},s=[];return t.forEach((t=>{if("function"==typeof r.extract){const e=Ei({node:t},a);s.push(r.extract(e))}})),s}(t,this),n=Tg(Sg(e,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=Sg(e,n,this)}};const Fg={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const t=this.chart.findShapes(this.props.selector).filter((t=>t.key===this.props.target)),e=t.filter((t=>t.collider)).map((t=>t.collider));e.forEach((t=>{t.fill=this.props.fill,t.stroke=this.props.stroke,t.opacity=this.props.opacity,t.collider={type:null}})),this.renderer.render(e)},created(){this.props=this.settings.settings},resize(t){let{outer:e,inner:n}=t;return this.props.useOuterRect?e:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Bg={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Vg=/([astvzqmhlc])([^astvzqmhlc]*)/gi,$g=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function Hg(t){const e=[],n=String(t).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(Vg,((t,n,i)=>{const r=function(t){const e=t.match($g);return e?e.map(Number):[]}(i);let o=n.toLowerCase(),a=n;if("m"===o&&r.length>2&&(e.push([a,...r.splice(0,2)]),o="l",a="m"===a?"l":"L"),r.length<Bg[o])return"";for(e.push([a,...r.splice(0,Bg[o])]);r.length>=Bg[o]&&r.length&&Bg[o];)e.push([a,...r.splice(0,Bg[o])]);return""})),e}const Wg=2*Math.PI;function Ug(t,e){return{x:.5*(t.x+e.x),y:.5*(t.y+e.y)}}function Yg(t,e,n,i,r){const o=1-t;return o**3*e+3*o**2*t*n+3*o*t**2*i+t**3*r}function Xg(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(t,e,n,i){return Math.abs(t.x+n.x-(e.x+e.x))+Math.abs(t.y+n.y-(e.y+e.y))+Math.abs(e.x+i.x-(n.x+n.x))+Math.abs(e.y+i.y-(n.y+n.y))}(t,e,n,i)<=10)return r[r.length-1]!==t&&r.push(t),r.push(i),r;const a=Ug(t,e),s=Ug(e,n),l=Ug(n,i),c={x:Yg(.5,t.x,e.x,n.x,i.x),y:Yg(.5,t.y,e.y,n.y,i.y)},u=Ug(a,s),h=Ug(s,l);return Xg(t,a,u,c,r,o-1),Xg(c,h,l,i,r,o-1),r}function Gg(t,e,n){const{cp1:i,cp2:r}=function(t,e,n){return{cp1:{x:t.x+2/3*(e.x-t.x),y:t.y+2/3*(e.y-t.y)},cp2:{x:n.x+2/3*(e.x-n.x),y:n.y+2/3*(e.y-n.y)}}}(t,e,n);return Xg(t,i,r,n)}function Kg(t,e,n){const i=[],r=!!t[4],o=!!t[5],a=t[3];let s,l,c,u,h=t[6],d=t[7],f=t[1],p=t[2];if("a"===t[0]&&(h+=e,d+=n),e===d&&n===d)return i;if(!f||!p)return i.push({x:h,y:d}),i;({cx:s,cy:l,rx:f,ry:p,sweepAngle:c,startAngle:u}=function(t,e,n,i,r,o,a,s,l){let c,u,h,d,f,p;const g=pu(n%360),m=Math.cos(g),y=Math.sin(g),x=(s-o)/2,v=(l-a)/2,b=m*x+y*v,w=m*v-y*x;p=b**2/(t=Math.abs(t))**2+w**2/(e=Math.abs(e))**2,p>1&&(p=Math.sqrt(p),t*=p,e*=p);const M=t*w,k=e*b,_=M**2+k**2,S=(t*e)**2-_;let N=Math.sqrt(Math.max(S/_,0));i===r&&(N=-N);const R=N*(M/e),A=N*(-k/t);d=m*R-y*A+(s+o)/2,f=y*R+m*A+(l+a)/2;const C=(b-R)/t,D=(w-A)/e,O=(-b-R)/t,E=(-w-A)/e;return c=Math.atan2(D,C),c+=c<0?Wg:0,u=Math.atan2(E,O),u+=u<0?Wg:0,h=u-c,!r&&c<u?h-=Wg:r&&u<c&&(h+=Wg),h%=Wg,{startAngle:c,sweepAngle:h,cx:d,cy:f,rx:t,ry:e}}(f,p,a,r,o,h,d,e,n));const g=Math.abs(c*Math.sqrt((f**2+p**2)/2)),m=Math.ceil(g/10),y=c/m;for(let t=1;t<=m;t++){const e=(u+y*t)%Wg,n=Math.cos(e),r=Math.sin(e);i.push({x:s+n*f+-r*n,y:l+r*p+n*r})}return i}function Zg(t){const e=Hg(t),n=[],i=[];let r=0,o=0,a=null,s=null,l=null,c=null;for(let t=0;t<e.length;++t){const u=e[t],h=u[0];switch("S"!==h&&"s"!==h&&"C"!==h&&"c"!==h&&(a=null,s=null),"T"!==h&&"t"!==h&&"Q"!==h&&"q"!==h&&(l=null,c=null),h){case"m":i.length&&n.push(i.splice(0));case"l":r+=u[1],o+=u[2],i.push({x:r,y:o});break;case"M":i.length&&n.push(i.splice(0));case"L":r=u[1],o=u[2],i.push({x:r,y:o});break;case"H":r=u[1],i.push({x:r,y:o});break;case"h":r+=u[1],i.push({x:r,y:o});break;case"V":o=u[1],i.push({x:r,y:o});break;case"v":o+=u[1],i.push({x:r,y:o});break;case"a":i.push(...Kg(u,r,o)),r+=u[6],o+=u[7];break;case"A":i.push(...Kg(u,r,o)),r=u[6],o=u[7];break;case"c":i.push(...Xg({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o},{x:u[5]+r,y:u[6]+o})),a=u[3]+r,s=u[4]+o,r+=u[5],o+=u[6];break;case"C":i.push(...Xg({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],r=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=r,s=o),i.push(...Xg({x:r,y:o},{x:2*r-a,y:2*o-s},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),a=u[1]+r,s=u[2]+o,r+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=r,s=o),i.push(...Xg({x:r,y:o},{x:2*r-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],r=u[3],o=u[4];break;case"Q":i.push(...Gg({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],r=u[3],o=u[4];break;case"q":i.push(...Gg({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),l=u[1]+r,c=u[2]+o,r+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...Gg({x:r,y:o},{x:l,y:c},{x:u[1],y:u[2]})),r=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...Gg({x:r,y:o},{x:l,y:c},{x:u[1]+r,y:u[2]+o})),r+=u[1],o+=u[2];break;case"z":case"Z":i.length&&i.push({x:i[0].x,y:i[0].y})}}return function(t){for(let e=0;e<t.length-1;e++){const n=t[e],i=t[e+1];Math.abs(n.x-i.x)<1e-12&&Math.abs(n.y-i.y)<1e-12&&(t.splice(e,1),e--)}}(i),n.push(i.splice(0)),n}const Jg={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const t=this.chart.findShapes("path").filter((t=>t.key===this.props.target)),e=[];t.forEach((t=>{Zg(t.attrs.d).forEach((t=>{t.forEach((t=>{e.push({type:"circle",cx:t.x,cy:t.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(e)},created(){this.props=this.settings.settings},resize(t){let{outer:e,inner:n}=t;return this.props.useOuterRect?e:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Qg=[function(t){t.component("box",Qh),t.component("box-marker",Qh)},function(t){t.component("point",ad),t.component("point-marker",ad)},function(t){t.component("pie",ud)},function(t){t.component("grid-line",gd)},function(t){t.component("ref-line",Nd)},function(t){t.component("axis",ef)},function(t){t.component("container",nf)},function(t){t.component("text",af)},function(t){t.component("scrollbar",cf)},function(t){t.component("brush-range",_f),t.component("brush-area-dir",Af)},function(t){t.component("range",Ef)},function(t){t.component("brush-lasso",Lf)},function(t){t.component("labels",Zp)},function(t){t.component("legend-cat",ug)},function(t){t.component("legend-seq",mg)},function(t){t.component("line",bg)},function(t){t.component("brush-area",_g)},function(t){t.component("tooltip",jg)},function(t){t.component("debug-collider",Fg)},function(t){t.component("debug-path-to-points",Jg)}];class tm{constructor(t){this._parent=null,this._children=[],this._ancestors=null,this.type=t,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let t=[];const e=this.children.length;let n,i;for(n=0;n<e;n++)i=this.children[n],t.push(i),i.children.length&&(t=[...t,...i.descendants]);return t}equals(t){const e=this.children,n=t.children;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!e[t].equals(n[t]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((t=>t.toJSON()))}}}class em{constructor(){let{x:t=0,y:e=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:t,y:e,width:n,height:i,minWidth:r,minHeight:o})}set(){let{x:t=0,y:e=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=t,this.width=Math.max(n,r)):(this.x=t+Math.min(n,-r),this.width=-Math.min(n,-r)),i>=0?(this.y=e,this.height=Math.max(i,o)):(this.y=e+Math.min(i,-o),this.height=-Math.min(i,-o))}containsPoint(t){return Qu(this,t)}intersectsLine(t){return th(this,Hi(t))}intersectsRect(t){return Zu(this,$i(t))}intersectsCircle(t){return Wu(t,this)}intersectsPolygon(t){return Ku(t,this)}intersectsGeoPolygon(t){return lh(t,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class nm{constructor(){let{cx:t=0,cy:e=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:t,cy:e,r:n,minRadius:i})}set(){let{cx:t=0,cy:e=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=t,this.cy=e,this.r=Math.max(n,i),this.vector={x:this.cx,y:this.cy}}containsPoint(t){return Hu(this,t)}intersectsLine(t){return Uu(this,Hi(t))}intersectsRect(t){return Wu(this,$i(t))}intersectsCircle(t){return n=t,!Fu(e=this)&&!Fu(n)&&(e.cx-n.cx)**2+(e.cy-n.cy)**2<=(e.r+n.r)**2;var e,n}intersectsPolygon(t){return Yu(this,t)}intersectsGeoPolygon(t){return oh(this,t)}points(){return[{x:this.cx,y:this.cy}]}}class im{constructor(){let{x1:t=0,y1:e=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:t,y1:e,x2:n,y2:i,tolerance:r})}set(){let{x1:t=0,y1:e=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=t,this.y1=e,this.x2=n,this.y2=i,this.tolerance=Math.max(0,Math.round(r)),this.vectors=this.points(),this.zeroSize=t===n&&e===i}containsPoint(t){if(this.tolerance>0){return Uu({cx:t.x,cy:t.y,r:this.tolerance},this)}return nh(this,t)}intersectsLine(t){return eh(this,Hi(t))}intersectsRect(t){return th($i(t),this)}intersectsCircle(t){return Uu(t,this)}intersectsPolygon(t){return Gu(t,this)}intersectsGeoPolygon(t){return sh(t,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class rm{constructor(){let{vertices:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:t})}set(){let{vertices:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=t.slice(),this.edges=[],function(t){for(let e=0;e<t.length-1;e++){const n=t[e],i=t[e+1];n.x===i.x&&n.y===i.y&&(t.splice(e,1),e--)}}(this.vertices),!(this.vertices.length<=2)){!function(t){const e=t[0],n=t[t.length-1];e.x===n.x&&e.y===n.y||t.push(e)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let t=0;t<this.vertices.length;t++)t<this.vertices.length-1&&this.edges.push([this.vertices[t],this.vertices[t+1]]),this.xMin=isNaN(this.xMin)?this.vertices[t].x:Math.min(this.xMin,this.vertices[t].x),this.xMax=isNaN(this.xMax)?this.vertices[t].x:Math.max(this.xMax,this.vertices[t].x),this.yMin=isNaN(this.yMin)?this.vertices[t].y:Math.min(this.yMin,this.vertices[t].y),this.yMax=isNaN(this.yMax)?this.vertices[t].y:Math.max(this.yMax,this.vertices[t].y);this._bounds=null,this._boundingRect=null}}containsPoint(t){return Xu(this,t)}intersectsCircle(t){return Yu(t,this)}intersectsLine(t){return Gu(this,Hi(t))}intersectsRect(t){return Ku(this,$i(t))}intersectsPolygon(t){return ih(this,t)}intersectsGeoPolygon(t){return rh(t,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function om(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new rm(...e)}function am(t){const e=t[0],n=t[t.length-1];e.x===n.x&&e.y===n.y||t.push(e)}function sm(t){for(let e=0;e<t.length-1;e++){const n=t[e],i=t[e+1];n.x===i.x&&n.y===i.y&&(t.splice(e,1),e--)}}class lm{constructor(){let{vertices:t=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:t})}set(){let{vertices:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=t.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let t=0;t<this.numPolygons;t++)sm(this.vertices[t]),this.vertices[t].length>2&&am(this.vertices[t]),this.polygons[t]=om({vertices:this.vertices[t]}),this.xMin=isNaN(this.xMin)?this.polygons[t].xMin:Math.min(this.xMin,this.polygons[t].xMin),this.xMax=isNaN(this.xMax)?this.polygons[t].xMax:Math.max(this.xMax,this.polygons[t].xMax),this.yMin=isNaN(this.yMin)?this.polygons[t].yMin:Math.min(this.yMin,this.polygons[t].yMin),this.yMax=isNaN(this.yMax)?this.polygons[t].yMax:Math.max(this.yMax,this.polygons[t].yMax);this._bounds=null,this._boundingRect=null}containsPoint(t){return ah(this,t)}intersectsCircle(t){return oh(t,this)}intersectsLine(t){return sh(this,Hi(t))}intersectsRect(t){return lh(this,$i(t))}intersectsPolygon(t){return rh(this,t)}intersectsGeoPolygon(t){return function(t,e){const n=t.boundingRect(),i=e.boundingRect();return!!Zu(n,i)&&(Ju(i,n)?$u(e,t):$u(t,e))}(this,t)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function cm(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new lm(...e)}class um{constructor(){let{points:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:t})}set(){let{points:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=t.slice(),this._points.length>1)for(let t=0,i=this._points.length-1;t<i;t++)e=this._points[t],n=this._points[t+1],(e.x!==n.x||e.y!==n.y)&&this.segments.push({x1:this._points[t].x,y1:this._points[t].y,x2:this._points[t+1].x,y2:this._points[t+1].y});var e,n}containsPoint(t){return this.segments.some((e=>nh(e,t)))}intersectsCircle(t){return this.segments.some((e=>Uu(t,e)))}intersectsLine(t){const e=Hi(t);return this.segments.some((t=>eh(t,e)))}intersectsRect(t){const e=$i(t);return this.segments.some((t=>th(e,t)))}intersectsPolygon(t){return this.segments.some((e=>Gu(t,e)))}intersectsGeoPolygon(t){return this.segments.some((e=>sh(t,e)))}points(){return this._points}}const hm=Gr();function dm(t,e){return hm.get(t)(e)}hm.add("rect",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new em(...e)})),hm.add("circle",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new nm(...e)})),hm.add("line",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new im(...e)})),hm.add("polygon",om),hm.add("geopolygon",cm),hm.add("polyline",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new um(...e)}));class fm{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(t)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],t.forEach((t=>{const e=dm(t.type,t);e&&this.geometries.push(e)}))}containsPoint(t){return this.geometries.some((e=>e.containsPoint(t)))}intersectsLine(t){return this.geometries.some((e=>e.intersectsLine(t)))}intersectsRect(t){return this.geometries.some((e=>e.intersectsRect(t)))}intersectsCircle(t){return this.geometries.some((e=>e.intersectsCircle(t)))}intersectsPolygon(t){return this.geometries.some((e=>e.intersectsPolygon(t)))}intersectsGeoPolygon(t){return this.geometries.some((e=>e.intersectsGeoPolygon(t)))}}class pm{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new pm).multiply(this)}set(t){return this._elements=t,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(t){let e,n;for(e=0;e<this._elements.length;e++)for(n=0;n<this._elements[e].length;n++)this._elements[e][n]+=t;return this}translate(t,e){return this.multiply([[1,0,t],[0,1,e],[0,0,1]]),this}rotate(t){let e=Math.cos(-t),n=Math.sin(-t);return this.multiply([[e,n,0],[-n,e,0],[0,0,1]]),this}multiply(t){let e,n,i,r;if(t instanceof pm&&(t=t._elements),Array.isArray(t)){for(i=[[0,0,0],[0,0,0],[0,0,0]],e=0;e<this._elements.length;e++)for(n=0;n<this._elements[e].length;n++)for(r=0;r<3;r++)i[e][n]+=this._elements[e][r]*t[r][n];this._elements=i}else for(e=0;e<this._elements.length;e++)for(n=0;n<this._elements[e].length;n++)this._elements[e][n]*=t;return this}scale(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.multiply([[t,0,0],[0,e,0],[0,0,1]]),this}transform(t,e,n,i,r,o){return this.multiply([[t,n,r],[e,i,o],[0,0,1]]),this}determinant(){let t=this._elements[0][0],e=this._elements[0][1],n=this._elements[0][2],i=this._elements[1][0],r=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2],c=0;return c=t*r*l+e*o*a+n*i*s-n*r*a-e*i*l-t*o*s,c}invert(){let t=this.determinant(),e=this._elements[0][0],n=this._elements[0][1],i=this._elements[0][2],r=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-a*l,i*l-n*c,n*a-i*o],[a*s-r*c,e*c-i*s,i*r-e*a],[r*l-o*s,s*n-e*l,e*o-n*r]],this.multiply(1/t),this}transpose(){const t=Object.create(this._elements);return this._elements=[[t[0][0],t[1][0],t[2][0]],[t[0][1],t[1][1],t[2][1]],[t[0][2],t[1][2],t[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((t=>t.join("\t"))).join("\n"))}isIdentity(){const t=this._elements;return 1===t[0][0]&&0===t[0][1]&&0===t[0][2]&&0===t[1][0]&&1===t[1][1]&&0===t[1][2]&&0===t[2][0]&&0===t[2][1]&&1===t[2][2]}transformPoint(t){let e,n,i=[t.x,t.y,1],r=this._elements,o=[0,0,0];for(e=0;e<this._elements.length;e++)for(n=0;n<this._elements[e].length;n++)o[e]+=i[n]*r[e][n];return{x:o[0],y:o[1]}}transformPoints(t){let e,n,i,r,o,a=this._elements,s=[];for(r=0;r<t.length;r++){for(e=[t[r].x,t[r].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(i=0;i<this._elements[n].length;i++)o[n]+=e[i]*a[n][i];s.push({x:o[0],y:o[1]})}return s}get elements(){const t=this._elements;return[[t[0][0],t[0][1],t[0][2]],[t[1][0],t[1][1],t[1][2]],[t[2][0],t[2][1],t[2][2]]]}}const gm=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function mm(t,e){const n=e.args[0]*(Math.PI/180);if(e.args.length>2){const i=e.args[1],r=e.args[2];t.translate(i,r),t.rotate(n),t.translate(-i,-r)}else 1===e.args.length&&t.rotate(n)}function ym(t,e){const n=e.args[0],i=isNaN(e.args[1])?e.args[0]:e.args[1];t.scale(n,i)}function xm(t,e){const n=e.args[0],i=isNaN(e.args[1])?0:e.args[1];t.translate(n,i)}function vm(t,e){e.args.length>=6&&t.transform(...e.args)}function bm(t,e){const n=function(t){let e,n=[];for(;null!==(e=gm.exec(t));){const t=e[2].trim(),i=-1===t.indexOf(",")?t.split(" "):t.split(",");n.push({cmd:e[1],args:i.filter((t=>t.trim().length>0)).map((t=>Number(t)))})}return n}(t);let i;for(let t=0,r=n.length;t<r;t++)i=n[t],"rotate"===i.cmd?mm(e,i):"scale"===i.cmd?ym(e,i):"matrix"===i.cmd?vm(e,i):"translate"===i.cmd&&xm(e,i)}const wm={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},Mm={type:(t,e)=>e.filter((e=>{const n=e.type;return!!n&&n.toLowerCase()===t.toLowerCase()})),attr:(t,e,n,i)=>i.filter((i=>{const r=i.attrs[t];if(!e)return void 0!==r;if(void 0===r)return!1;switch(e){case"=":return n===String(r);case"!=":return n!==String(r);default:return!1}})),universal:t=>t,tag:(t,e)=>e.filter((e=>{const n=e.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(t.replace(".",""))}))};function km(t,e){if(!e||!e.length||!t||"function"!=typeof Mm[t.type])return[];switch(t.type){case"type":case"tag":return Mm[t.type](t.value,e);case"attr":return Mm[t.type](t.attribute,t.operator,t.attributeValue,e);case"universal":return Mm[t.type](e);default:return[]}}var _m={find:function(t,e){const n=[],i=[];let r,o;if(e.isBranch){let a;r=function(t){const e=[];let n,i,r,o;return t.split(/\s*,\s*/).forEach((t=>{t=t.trim(),n=[];const a=e=>{r=t.match(wm[e]),r&&(o=!0,t=t.slice(r[0].length),i={type:e,value:r[0]},"attr"===e&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),i.attribute=r[1],i.operator=r[2],i.attributeValue=r[3]),n.push(i))};for(;t&&(o=!1,r=t.match(/^\s*([>+~]|\s)\s*/),r&&(o=!0,n.push({type:" ",value:r[0]}),t=t.slice(r[0].length)),Object.keys(wm).forEach(a),n&&n.length&&e.indexOf(n)<0&&e.push(n),o););})),e}(t),o=e.descendants;for(let t=0,e=r.length;t<e;t++){a=r[t];const e=[];let n=o.slice(),s=!1;a.reverse().forEach((t=>{if(" "===t.type)return e.push(n),n=o.slice(),void(s=!1);n=km(t,n),s=!0})),s&&e.push(n);const l=e[0].filter((t=>{let n,i=t.parent;for(let t=1;t<e.length;t++){for(n=e[t].indexOf(i);i&&n<0;)i=i.parent,n=e[t].indexOf(i);if(n<0)return!1}return!0}));i.push(l)}for(let t=0,e=i.length;t<e;t++)for(let e=0,r=i[t].length;e<r;e++)n.indexOf(i[t][e])<0&&n.push(i[t][e])}return n||[]}};function Sm(t,e,n){const i=t.type;let r=t.points();n&&(r=r.every((t=>Array.isArray(t)))?r.map((t=>n.transformPoints(t))):n.transformPoints(r)),function(t,e){for(let n=0,i=t.length;n<i;n++)t[n].x/=e,t[n].y/=e}(r,e);let o=null;if("rect"===i||"bounds"===i)o=$i(r),o.type=i;else if("circle"===i)o=function(t,e){return{cx:t[0].x,cy:t[0].y,r:e}}(r,t.r),o.type=i;else if("line"===i)o=Hi(r),o.type=i;else if("polygon"===i||"polyline"===i){o={type:"path",d:du(r,"polygon"===i)}}else if("geopolygon"===i){let t="";for(let e=0;e<r.length;e++)t+=du(r[e],!0);o={type:"path",d:t}}return o}class Nm{constructor(t){this._bounds=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:i,width:r,height:o}=t.boundingRect?t.boundingRect(e):{x:0,y:0,width:0,height:0};return{x:n,y:i,width:r,height:o}},this._attrs=t.attrs,this._type=t.type,this._data=t.data,this._dpi=t.stage?t.stage.dpi:1,this._collider=()=>function(t,e){if(t.collider){const n=t.modelViewMatrix;return"collection"===t.colliderType?{type:"container",children:t.collider.geometries.map((t=>Sm(t,e,n)))}:Sm(t.collider,e,n)}return null}(t,this._dpi),this._desc=t.desc,this._tag=t.tag,this._children=()=>t.children.map((t=>new Nm(t))),this._parent=()=>t.parent?new Nm(t.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(t){this._cache.elementBoundingRect=null,this._element=t}get element(){return this._element}set key(t){this._key=t}get key(){return this._key}get bounds(){const t=this._bounds();return t.x/=this._dpi,t.y/=this._dpi,t.width/=this._dpi,t.height/=this._dpi,t}get localBounds(){return this._bounds(!1)}boundsRelativeTo(t){const e=typeof t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,i=this._getElementBoundingRect();let r=i.left,o=i.top;if("object"===e&&null!==t&&"function"==typeof t.getBoundingClientRect){const{left:e=0,top:n=0}=t.getBoundingClientRect();r-=e,o-=n}return n.x+=r,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function Rm(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Nm(...e)}class Am{constructor(t){this._node=Rm(t),this._parent=null,this._input=null}get node(){return this._node}set parent(t){this._parent=t}get parent(){return this._parent}set input(t){this._input=t}get input(){return this._input}}function Cm(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Am(...e)}function Dm(t,e){const n=t.parent;if(n&&"stage"!==n.type){e.parent=Cm(n);const t=n.parent;t&&"stage"!==t.type&&Dm(t,e.parent)}}function Om(t,e,n){if(null===t.colliderType)return null;const i=function(t,e){let n={};if(t.modelViewMatrix)if(Array.isArray(e))n=t.inverseModelViewMatrix.transformPoints(e);else if(isNaN(e.r))Array.isArray(e.vertices)?n.vertices=t.inverseModelViewMatrix.transformPoints(e.vertices):n=t.inverseModelViewMatrix.transformPoint(e);else{const i={x:e.cx,y:e.cy};({x:n.cx,y:n.cy}=t.inverseModelViewMatrix.transformPoint(i)),n.r=e.r}else n=e;return Array.isArray(n.vertices)&&(n=n.vertices.every((t=>Array.isArray(t)))?cm(n):om(n)),n}(t,n);return"frontChild"===t.colliderType?function(t,e,n){for(let i=t.descendants.length-1;i>=0;i--){const r=t.descendants[i];if(null!==r.collider&&r.collider[e](n)){const t=Cm(r);return Dm(r,t),t}}return null}(t,e,i):function(t,e,n){if(t.collider[e](n)){const e=Cm(t);return Dm(t,e),e}return null}(t,e,i)}function Em(t,e,n,i){const r=t.length;for(let o=0;o<r;o++){const r=t[o],a=Om(r,e,i);a&&n.push(a),!r.children||a||r.collider||Em(r.children,e,n,i)}}function zm(t,e,n){const i=t.length;for(let r=0;r<i;r++){const i=t[r];if(null!==Om(i,e,n))return!0;if(i.children&&!i.collider)return zm(i.children,e,n)}return!1}function Im(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(Wi(t)){case"circle":return n.cx=t.cx*e,n.cy=t.cy*e,n.r=t.r,["intersectsCircle",n];case"rect":return n=Vi(t).map((t=>xu(t,e))),["intersectsRect",n];case"line":return n=Bi(t).map((t=>xu(t,e))),["intersectsLine",n];case"point":return n=xu(t,e),["containsPoint",n];case"polygon":return n.vertices=t.vertices.map((t=>xu(t,e))),["intersectsPolygon",n];case"geopolygon":return n.vertices=t.vertices.map((t=>t.map((t=>xu(t,e))))),["intersectsGeoPolygon",n];default:return[]}}function Tm(t,e){const[n,i]=Im(e,t.dpi),r=[];return n&&(Em([t],n,r,i),function(t,e){for(let n=0,i=e.length;n<i;n++)e[n].input=t}(e,r)),r}function Pm(t,e){const[n,i]=Im(e,t.dpi);return zm([t],n,i)}class qm extends tm{constructor(t){super(t),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=t;const{data:e,desc:n,tag:i,strokeReference:r,fillReference:o}=t;var a,s;a=this.attrs,s=t,Object.keys(hu).forEach((t=>{const e=s[t];void 0!==e&&(a[hu[t]]=e)})),void 0!==e&&(this.data=e),"object"==typeof n&&(this.desc=Ei(!0,{},n)),"string"==typeof i&&(this.tag=i),"string"==typeof r&&(this.strokeReference=r),"string"==typeof o&&(this.fillReference=o)}findShapes(t){return _m.find(t,this).map((t=>Rm(t)))}getItemsFrom(t){return Tm(this,t)}containsPoint(t){return Pm(this,t)}intersectsLine(t){return Pm(this,t)}intersectsRect(t){return Pm(this,t)}intersectsCircle(t){return Pm(this,t)}intersectsPolygon(t){return Pm(this,t)}intersectsGeoPolygon(t){return Pm(this,t)}resolveLocalTransform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new pm;void 0!==this.attrs.transform&&bm(this.attrs.transform,t),this.modelViewMatrix=t.clone()}resolveGlobalTransform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new pm;const e=this.ancestors;if(e.length>0)for(let n=e.length-1;n>=0;n--)e[n].resolveLocalTransform(t),t=e[n].modelViewMatrix;this.resolveLocalTransform(t)}attr(t){return this.attrs[t]}equals(t){const e=this.attrs,n=Object.keys(e),i=t.attrs,r=Object.keys(i);if(n.length!==r.length)return!1;for(let t=0;t<n.length;t++){const r=n[t];if(!Object.hasOwnProperty.call(i,r))return!1;if(e[r]!==i[r])return!1}return super.equals(t)}toJSON(){const t=super.toJSON();return t.attrs=this.attrs,t}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(t){this._mvm=t,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(t){this._node=t}get node(){return this._node}set collider(t){const e=Array.isArray(t)?"collection":t&&t.type;return"string"!=typeof e?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===e&&null!==this._collider.fn?(this._collider.fn.set(t),void(this._collider.definition=t)):(this._collider.type=e,void(this._collider.definition=t))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new fm(...e)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=dm("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=dm(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class Lm extends tm{addChild(t){if(!(t&&t instanceof tm))throw new TypeError("Expecting a Node as argument, but got ".concat(t));if(t===this)throw new Error("Can not add itself as child!");if(t._children&&t._children.length&&this.ancestors.indexOf(t)>=0)throw new Error("Can not add an ancestor as child!");return t._parent&&t._parent!==this&&t._parent.removeChild(t),this._children.push(t),t._parent=this,t._ancestors=null,this}addChildren(t){let e,n=t?t.length:0;for(e=0;e<n;e++)this.addChild(t[e]);return this}removeChild(t){const e=this._children.indexOf(t);return e>=0&&(this._children.splice(e,1),t._parent=null,t._ancestors=null),this}removeChildren(t){let e,n;if(!this._children)return this;if(t)for(n=t.length,e=0;e<n;e++)this.removeChild(t[e]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const jm=Lm.prototype;class Fm extends qm{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:e="container"}=t;super(e),this.set(t)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(t);const{collider:e}=t,n=Ei({type:null},e);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(t,e){if(void 0!==t.bounds){const n=this.__boundingRect[e]||{},[i,,r]=t.bounds(e),{x:o,y:a}=i,{x:s,y:l}=r,c=isNaN(n.width)?s:Math.max(s,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?a:Math.min(a,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[e]=n}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];const e=this.children.length;for(let n=0;n<e;n++)this.appendChildRect(this.children[n],t);return this.__boundingRect[t]=Ei({x:0,y:0,width:0,height:0},this.__boundingRect[t]),this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}addChild(t){const e=jm.addChild.call(this,t);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(t,!0);const e=Ei({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=e}return e}addChildren(t){const e=jm.addChildren.call(this,t),n=t.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let e=0;e<n;e++)this.appendChildRect(t[e],!0);const e=Ei({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=e}return e}removeChild(t){t._stage=null;let e,n=t.descendants,i=n?n.length:0;for(e=0;e<i;e++)n[e]._stage=null;if(jm.removeChild.call(this,t),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const t=Ei(this.boundingRect(!0),{type:"bounds"});this.collider=t}return this}removeChildren(t){if(jm.removeChildren.call(this,t),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const t=Ei(this.boundingRect(!0),{type:"bounds"});this.collider=t}return this}}function Bm(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Fm(...e)}class Vm extends Fm{constructor(t){super("stage"),this._stage=this,this._dpiRatio=t||1}get dpi(){return this._dpiRatio}}const $m=Lm.prototype,Hm=["x1","x2","y1","y2","id","offset","style"];class Wm extends qm{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:e="container"}=t;super(e),this.set(t),this._boundingRect={}}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(t);const e=this.attrs;let n="";for(let i=0,r=Hm.length;i!==r;i++)n=Hm[i],void 0!==t[n]&&(e[n]=t[n])}addChild(t){return $m.addChild.call(this,t)}addChildren(t){return $m.addChildren.call(this,t)}removeChild(t){t._stage=null;let e,n=t.descendants,i=n?n.length:0;for(e=0;e<i;e++)n[e]._stage=null;return $m.removeChild.call(this,t),this}removeChildren(t){return $m.removeChildren.call(this,t),this}}function Um(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Wm(...e)}const Ym=Lm.prototype,Xm=["patternUnits","x","y","width","height","id"];class Gm extends qm{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:e="container"}=t;super(e),this.set(t),this._boundingRect={}}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(t);const e=this.attrs;let n="";for(let i=0,r=Xm.length;i!==r;i++)n=Xm[i],void 0!==t[n]&&(e[n]=t[n])}addChild(t){return Ym.addChild.call(this,t)}addChildren(t){return Ym.addChildren.call(this,t)}removeChild(t){t._stage=null;let e,n=t.descendants,i=n?n.length:0;for(e=0;e<i;e++)n[e]._stage=null;return Ym.removeChild.call(this,t),this}removeChildren(t){return Ym.removeChildren.call(this,t),this}}class Km extends qm{constructor(){super("rect"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:e=0,y:n=0,width:i=0,height:r=0,rx:o=0,ry:a=0,collider:s}=t,l=Ei({type:"rect",x:e,y:n,width:i,height:r},s);super.set(t),i>=0?(this.attrs.x=e,this.attrs.width=i):(this.attrs.x=e+i,this.attrs.width=-i),r>=0?(this.attrs.y=n,this.attrs.height=r):(this.attrs.y=n+r,this.attrs.height=-r),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];const e=Vi(this.attrs),n=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(e):e,[i,r,o,a]=Fi(n);return this.__boundingRect[t]={x:i,y:r,width:o-i,height:a-r},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}class Zm extends qm{constructor(){super("circle"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:e=0,cy:n=0,r:i=0,collider:r}=t,o=Ei({type:"circle",cx:e,cy:n,r:i},r);super.set(t),this.attrs.cx=e,this.attrs.cy=n,this.attrs.r=i,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];const e=this.bounds(t);return this.__boundingRect[t]={x:e[0].x,y:e[0].y,width:e[2].x-e[0].x,height:e[2].y-e[0].y},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const{cx:e,cy:n,r:i,r:r}=this.attrs,o=e-i,a=n-r;let s=2*i,l=2*r,c=[{x:o,y:a},{x:o+s,y:a},{x:o+s,y:a+l},{x:o,y:a+l}];if(t&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[e,n,i,r]=Fi(c);s=i-e,l=r-n,this.__bounds[t]=[{x:e,y:n},{x:e+s,y:n},{x:e+s,y:n+l},{x:e,y:n+l}]}else this.__bounds[t]=c;return this.__bounds[t]}}class Jm extends qm{constructor(){super("line"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:e=0,y1:n=0,x2:i=0,y2:r=0,collider:o}=t;super.set(t),this.attrs.x1=e,this.attrs.y1=n,this.attrs.x2=i,this.attrs.y2=r;const a={type:"line",x1:e,y1:n,x2:i,y2:r};this.collider=Ei(a,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];let e=Bi(this.attrs);t&&this.modelViewMatrix&&(e=this.modelViewMatrix.transformPoints(e));const[n,i,r,o]=Fi(e),a=n!==r||i!==o;return this.__boundingRect[t]={x:n,y:i,width:a?Math.max(1,r-n):0,height:a?Math.max(1,o-i):0},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}const Qm=Math.PI/2;function ty(t,e){const n=Math.atan2(e.y-t.y,e.x-t.x);return n<0?n+2*Math.PI:n}function ey(t,e,n){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}const ny={step:function(t){return new $r(t,.5)},stepAfter:function(t){return new $r(t,1)},stepBefore:function(t){return new $r(t,0)},linear:br,basis:function(t){return new Ar(t)},cardinal:Or.tension(0),catmullRom:zr,monotonex:function(t){return new Lr(t)},monotoney:function(t){return new jr(t)},natural:function(t){return new Br(t)}};function iy(t){if(t.length<2)return!1;const e=t[0],n=t[t.length-1];return Math.abs(e.x-n.x)<1e-12&&Math.abs(e.y-n.y)<1e-12}class ry extends qm{constructor(){super("path"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(t),this.segments=[],this.points=[],t.arcDatum){const e=xr();e.innerRadius(t.desc.slice.innerRadius),e.outerRadius(t.desc.slice.outerRadius),e.cornerRadius(t.desc.slice.cornerRadius);const n=e(t.arcDatum);this.attrs.d=n}else if(t.points){const{major:e,minor:n,layerObj:i,points:r,stngs:o,generatorType:a}=t,s=kr(),l=o.coordinates?o.coordinates.defined:null;s[e.p]((t=>t.major*e.size))["".concat(n.p,"1")]((t=>t.minor*n.size))["".concat(n.p,"0")]((t=>t.minor0*n.size)).curve(ny["monotone"===i.curve?"monotone".concat(e.p):i.curve]),l?s.defined((t=>!t.dummy&&"number"==typeof t.minor&&!isNaN(t.minor)&&t.defined)):s.defined((t=>!t.dummy&&"number"==typeof t.minor&&!isNaN(t.minor)));const c=o.connect?r.filter(s.defined()):r,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else t.d&&(this.attrs.d=t.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(t.collider)||"object"==typeof t.collider&&void 0!==t.collider.type)this.collider=t.collider;else if(this.attrs.d){if(this.segments=Zg(this.attrs.d),this.segments.length>1&&this.segments.every((t=>iy(t))))return void(this.collider=Ei({type:"geopolygon",vertices:this.segments},t.collider));this.segments.forEach((e=>{if(e.length<=1);else if(iy(e))this.collider=Ei({type:"polygon",vertices:e},t.collider);else if("object"==typeof t.collider&&t.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[],r=[];if("h"===n.forceOrientation){const e=t[0].x<t[1].x?-1:1,n=t[t.length-1].x>t[t.length-2].x?1:-1;t.unshift({x:t[0].x+e,y:t[0].y}),t.push({x:t[t.length-1].x+n,y:t[t.length-1].y})}else if("v"===n.forceOrientation){const e=t[0].y<t[1].y?-1:1,n=t[t.length-1].y>t[t.length-2].y?1:-1;t.unshift({x:t[0].x,y:t[0].y+e}),t.push({x:t[t.length-1].x,y:t[t.length-1].y+n})}const o=t.length-1;for(let n=1;n<o;n++){const a=t[n-1],s=t[n],l=t[n+1],c=ty(s,a),u=ty(s,l),h=(c+u)/2,d=h+Math.PI,f=Math.max(h,d),p=Math.min(h,d),g=c>u;if(1===n){const t=ty(a,s);i.push(ey(a,t-Qm,e)),r.unshift(ey(a,t+Qm,e))}const m=g?f:p,y=g?p:f;if(i.push(ey(s,m,e)),r.unshift(ey(s,y,e)),n===o-1){const t=ty(l,s);i.push(ey(l,t+Qm,e)),r.unshift(ey(l,t-Qm,e))}}return{type:"polygon",vertices:[...i,...r]}}(e,n,t.collider)}else this.collider=Ei({type:"polyline",points:e},t.collider)}))}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];this.points.length||(this.segments=this.segments.length?this.segments:Zg(this.attrs.d),this.points=function(t){const e=[];let n,i=t.length;for(let r=0;r<i;r++){n=t[r];for(let t=0;t<n.length;t++)e.push(n[t])}return e}(this.segments));const e=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,i,r,o]=Fi(e);return this.__boundingRect[t]={x:n||0,y:i||0,width:r-n||0,height:o-i||0},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}function oy(t){let{data:e,_boundingRect:n,_textBoundsFn:i}=t;return null!=e&&(n||i)}class ay extends qm{constructor(){super("text"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:e=0,y:n=0,dx:i=0,dy:r=0,textBoundsFn:o,text:a,title:s,collider:l,boundingRect:c,ellipsed:u}=t;super.set(t),this.attrs.x=e,this.attrs.y=n,this.attrs.dx=i,this.attrs.dy=r,this.attrs.text=a,void 0!==s&&(this.attrs.title=String(s)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=Ei({type:oy(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};t=this._textBoundsFn(this.attrs);const n=Vi(t),i=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[r,o,a,s]=Fi(i);return this.__boundingRect[e]={x:r,y:o,width:a-r,height:s-o},this.__boundingRect[e]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}const sy=Gr();function ly(t,e){return sy.get(t)(e)}sy.add("rect",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Km(...e)})),sy.add("circle",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Zm(...e)})),sy.add("text",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new ay(...e)})),sy.add("line",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Jm(...e)})),sy.add("path",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new ry(...e)})),sy.add("stage",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Vm(...e)})),sy.add("container",Bm),sy.add("defs",Bm),sy.add("linearGradient",Um),sy.add("radialGradient",Um),sy.add("conicGradient",Um),sy.add("stop",Um),sy.add("pattern",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Gm(...e)}));const cy=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=[{}];function n(){return e[e.length-1]}return n.save=function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n(),o={};let a="";for(let e=0;e<t.length;e++)a=t[e],void 0!==r[a]&&(o[a]=r[a]);return Ei(o,i),e.push(o),n()},n.restore=function(){e.splice(e.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function uy(t,e){if(Array.isArray(e))for(let n=0,i=e.length;n<i;n++)e[n](t)}function hy(t,e,n){t.node=n[e],t.index=e}function dy(t,e,n,i){let r=!1;const o={siblings:t,node:null,index:0};for(let a=0,s=t.length;a<s;a++){if(hy(o,a,t),uy(o,i.create),r="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,r)continue;o.node=cy.save(o.node);const s=ly(o.node.type,o.node);s&&(o.node.transform&&(n.save(),bm(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),e.addChild(s),o.node.children&&dy(o.node.children,s,n,i),o.node.transform&&n.restore()),cy.restore()}}function fy(t){let{items:e,stage:n,dpi:i,on:r={}}=t;return n||(n=ly("stage",i)),dy(e,n,new pm,r),n}function py(t,e,n){const{orientation:i,degree:r,stops:o=[]}=n;let a=null;if("radial"===i){const n=e.boundingRect();a=t.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===i){const e=n.startAngle||0,i=n.x||0,r=n.y||0;a=t.createConicGradient(e,i,r)}else{const i=gu(r);["x1","x2","y1","y2"].forEach((t=>{t in n&&(i[t]=n[t])}));const o=e.boundingRect();a=t.createLinearGradient(o.x+i.x1*o.width,o.y+i.y1*o.height,o.x+i.x2*o.width,o.y+i.y2*o.height)}for(let t=0,e=o.length;t<e;t++){let e=o[t];a.addColorStop(e.offset,e.color)}return a}function gy(t,e,n){return e.width=t.width,e.height=t.height,n.save(),n.fillStyle=t.fill,t.shapes.forEach((t=>{if("rect"===t.type)n.rect(t.x,t.y,t.width,t.height)})),n.fill(),n.restore(),n.createPattern(e,"repeat")}function my(){let{x:t,y:e,width:n,height:i,scaleRatio:r,margin:o,edgeBleed:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return s.x=isNaN(t)?s.x:t,s.y=isNaN(e)?s.y:e,s.width=isNaN(n)?s.width:n,s.height=isNaN(i)?s.height:i,void 0!==r&&(s.scaleRatio.x=isNaN(r.x)?s.scaleRatio.x:r.x,s.scaleRatio.y=isNaN(r.y)?s.scaleRatio.y:r.y),void 0!==o&&(s.margin.left=isNaN(o.left)?0:o.left,s.margin.top=isNaN(o.top)?0:o.top),"object"==typeof a&&["left","right","top","bottom"].forEach((t=>{!isNaN(a[t])&&a[t]>0&&(s.edgeBleed[t]=a[t],s.edgeBleed.bool=!0)})),s.computedPhysical={x:Math.round(s.margin.left+(s.x-s.edgeBleed.left)*s.scaleRatio.x),y:Math.round(s.margin.top+(s.y-s.edgeBleed.top)*s.scaleRatio.y),width:Math.round((s.width+s.edgeBleed.left+s.edgeBleed.right)*s.scaleRatio.x),height:Math.round((s.height+s.edgeBleed.top+s.edgeBleed.bottom)*s.scaleRatio.y)},s}function yy(){const t={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:$p,textBounds:Wp,setKey:e=>{t.element().setAttribute("data-key",e)}};return t}function xy(t){return e=>{let{node:n}=e;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=t.textBounds)}}const vy=200,by=200;class wy{constructor(t){this.targetCanvas=t,this.bufferCanvas=t.cloneNode()}updateSize(t){let e,{rect:n,dpiRatio:i,canvasBufferSize:r}=t;e=r?"function"==typeof r?r(n):r:{width:n.computedPhysical.width+2*vy,height:n.computedPhysical.height+2*by},this.bufferCanvas.style.width="".concat(e.width,"px"),this.bufferCanvas.style.height="".concat(e.height,"px"),this.bufferCanvas.width=Math.round(e.width*i),this.bufferCanvas.height=Math.round(e.height*i)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const My=Gr();function ky(t){return Array.isArray(t)?t:"string"==typeof t?-1!==t.indexOf(",")?t.split(","):t.split(" "):[]}function _y(t){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}function Sy(t,e){e.setTransform(t[0][0],t[1][0],t[0][1],t[1][1],t[0][2],t[1][2])}function Ny(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Object.keys(i);for(let r=0,o=n.length;r<o;r++){let o=n[r];const a=o[0],s=o[1],l=o[2];if(a in e.attrs&&!(s in i)&&t[s]!==e.attrs[a]){const n=l?l(e.attrs[a]):e.attrs[a];"function"==typeof t[s]?t[s](n):t[s]=n}}for(let e=0,n=r.length;e<n;e++){const n=r[e];t[n]=i[n]}}function Ry(t,e,n,i){for(let r=0,o=t.length;r<o;r++){let o=t[r],a={};e.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=py(e,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=i.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=py(e,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=i.patterns.create(o.attrs.stroke))),Ny(e,o,n,a),o.modelViewMatrix&&Sy(o.modelViewMatrix.elements,e),My.has(o.type)&&My.get(o.type)(o.attrs,{g:e,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&Ry(o.children,e,n,i),e.restore()}}function Ay(){let t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fy;const i={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let r,o=!1,a=my();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",ky]];let l;const c=yy();return c.element=()=>t,c.root=()=>t,c.settings=t=>(t&&Object.keys(i).forEach((e=>{void 0!==t[e]&&(i[e]=t[e])})),i),c.appendTo=n=>(t||(t=n.ownerDocument.createElement("canvas"),t.style.position="absolute",t.style["-webkit-font-smoothing"]="antialiased",t.style["-moz-osx-font-smoothing"]="antialiased",t.style.pointerEvents="none"),"function"!=typeof i.transform||e||(e=new wy(t)),n.appendChild(t),t),c.getScene=i=>{const r=_y(e&&e.getContext()||t.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:i,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*r*o,", ").concat(a.edgeBleed.top*r*s,")"):""};return 1===r&&1===o&&1===s||(l.transform+="scale(".concat(r*o,", ").concat(r*s,")")),n({items:[l],dpi:r,on:{create:[zp(c.measureText),xy(c)]}})},c.render=n=>{if(!t)return!1;l||(l=function(t){const e=t.createElement("canvas"),n=e.getContext("2d");let i={};return{create(t){const r=t.key;return r?(i[r]=i[r]||gy(t,e,n),i[r]):gy(t,e,n)},clear(){i={}}}}(t.ownerDocument));const u=e&&e.getContext()||t.getContext("2d"),h=_y(u),d=e&&i.transform();if(d)return t.width=t.width,function(t){let{el:e,dpiRatio:n,transform:i}=t;if("object"==typeof i){const t=[i.horizontalScaling,i.horizontalSkewing,i.verticalSkewing,i.verticalScaling,i.horizontalMoving*n,i.verticalMoving*n];e.getContext("2d").setTransform(...t)}}({el:t,dpiRatio:h,transform:d}),e.apply(),!0;o&&(t.style.left="".concat(a.computedPhysical.x,"px"),t.style.top="".concat(a.computedPhysical.y,"px"),t.style.width="".concat(a.computedPhysical.width,"px"),t.style.height="".concat(a.computedPhysical.height,"px"),t.width=Math.round(a.computedPhysical.width*h),t.height=Math.round(a.computedPhysical.height*h),e&&e.updateSize({rect:a,dpiRatio:h,canvasBufferSize:i.canvasBufferSize}));const f=c.getScene(n),p=!r||!f.equals(r);l.clear();const g=o||p,m="function"==typeof i.progressive&&i.progressive();return g&&(m&&!m.isFirst||c.clear(),Ry(f.children,u,s,{patterns:l})),e&&(t.width=t.width,e.apply()),o=!1,m&&!m.isFirst&&f.children.unshift(...r.children),r=f,g},c.itemsAt=t=>r?r.getItemsFrom(t):[],c.findShapes=t=>r?r.findShapes(t):[],c.clear=()=>(t&&(t.width=t.width),e&&e.clear(),r=null,c),c.size=t=>{if(t){const e=my(t);JSON.stringify(a)!==JSON.stringify(e)&&(o=!0,a=e)}return a},c.destroy=()=>{t&&(t.parentElement&&t.parentElement.removeChild(t),t=null),e&&(e=null),r=null},c}function Cy(t,e){My.add(t,e)}function Dy(t,e){return Math.max(0,Math.min(t,e))}const Oy=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Ey=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),zy=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function Iy(t){return Oy.test(t)}function Ty(t){return Ey.test(t)||zy.test(t)}function Py(t){let e,n,i=t?t.length:0;for(e=0;e<i;e++){if(n=t[e],Iy(n))return"ltr";if(Ty(n))return"rtl"}return"ltr"}const qy={start:"end",end:"start",center:"center",middle:"middle"};function Ly(t,e){return"rtl"===e?qy[t]:t}function jy(t,e){const n=[];let i;const r=[],o=[],a=[];let s,l;const c=t=>t.id,u=(t,e)=>{let n;return n="object"==typeof t?"id"in t?t.id:e:t,{content:t,id:"".concat(n,"__").concat(t.type||"")}};t.isTree||(t=t.map(u)),e=e.map(u),s=t.map(c),l=e.map(c);for(let t=0,i=e.length;t<i;t++){-1===s.indexOf(e[t].id)?n.push(e[t]):o.push(e[t])}for(let e=0,n=t.length;e<n;e++){-1===l.indexOf(t[e].id)?r.push(t[e]):a.push(t[e])}for(let t=0,e=n.length;t<e;t++)n[t].content.children&&(n[t].diff=jy([],n[t].content.children),n[t].children=n[t].diff.updatedNew.concat(n[t].diff.added),n[t].children.isTree=!0);for(let t=0,e=o.length;t<e;t++)o[t].diff=jy(a[t].children||[],o[t].content.children||[]),o[t].object=a[t].object,o[t].children=o[t].diff.items;return i=o.concat(n),n.isTree=!0,r.isTree=!0,o.isTree=!0,a.isTree=!0,i.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:r,items:i}}function Fy(t,e,n){for(let i=0,r=t.length;i<r;i++)t[i].object=n(t[i].content.type,e)}function By(t,e){for(let n=0,i=t.length;n<i;n++)null!==t[n].object&&void 0!==t[n].object&&(e(t[n].object),t[n].object=null)}function Vy(t,e,n,i){let r;for(let o=0,a=t.length;o<a;o++)r=t[o],null!==r.object&&void 0!==r.object&&(n(r.object,r.content),r.diff&&(Fy(r.diff.added,r.object,e),By(r.diff.removed,i),Vy(r.diff.items,e,n,i)))}function $y(t,e,n,i,r,o){const a=jy(t,e);return Fy(a.added,n,i),By(a.removed,o),Vy(a.items,i,r,o),a.items}Cy("rect",(function(t,e){let{g:n,doFill:i,doStroke:r}=e;n.beginPath(),t.rx>0||t.ry>0?function(t,e,n,i,r,o,a){o=Dy(i/2,o>0?o:a),a=Dy(r/2,a>0?a:o),t.moveTo(e,n+a),t.lineTo(e,n+r-a),t.quadraticCurveTo(e,n+r,e+o,n+r),t.lineTo(e+i-o,n+r),t.quadraticCurveTo(e+i,n+r,e+i,n+r-a),t.lineTo(e+i,n+a),t.quadraticCurveTo(e+i,n,e+i-o,n),t.lineTo(e+o,n),t.quadraticCurveTo(e,n,e,n+a)}(n,t.x,t.y,t.width,t.height,t.rx,t.ry):n.rect(t.x,t.y,t.width,t.height),i&&n.fill(),r&&n.stroke()})),Cy("circle",(function(t,e){let{g:n,doFill:i,doStroke:r}=e;n.beginPath(),n.moveTo(t.cx+t.r,t.cy),n.arc(t.cx,t.cy,t.r,0,2*Math.PI,!1),i&&n.fill(),r&&n.stroke()})),Cy("line",(function(t,e){let{g:n,doStroke:i}=e;n.beginPath(),n.moveTo(t.x1,t.y1),n.lineTo(t.x2,t.y2),i&&n.stroke()})),Cy("path",(function(t,e){let{g:n,doStroke:i,doFill:r}=e;const o=new Path2D(t.d);r&&n.fill(o),i&&n.stroke(o)})),Cy("text",(function(t,e){let{g:n,ellipsed:i,doStroke:r}=e;const o=i||Ip(t,$p);n.font=[t["font-style"],t["font-weight"],t["font-size"],t["font-family"]].filter((t=>!!t)).join(" ");const a=Py(t.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=Ly("middle"===t["text-anchor"]?"center":t["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=Tp(t);n.fillText(o,t.x+t.dx,t.y+t.dy+l),r&&n.strokeText(o,t.x+t.dx,t.y+t.dy+l)}));const Hy="http://www.w3.org/2000/svg",Wy=(t,e)=>{if(!t||"string"!=typeof t)throw new Error("Invalid type: ".concat(t));const n=e.ownerDocument.createElementNS(Hy,"container"===t?"g":t);return e.appendChild(n),n},Uy=t=>{t.parentNode&&t.parentNode.removeChild(t)},Yy=(t,e)=>{if((t=>{switch(t.type){case"circle":return!isNaN(t.attrs.cx)&&!isNaN(t.attrs.cy)&&!isNaN(t.attrs.r);case"line":return!(isNaN(t.attrs.x1)||isNaN(t.attrs.y1)||isNaN(t.attrs.x2)||isNaN(t.attrs.y2));case"rect":return!(isNaN(t.attrs.x)||isNaN(t.attrs.y)||isNaN(t.attrs.width)||isNaN(t.attrs.height));case"text":return!isNaN(t.attrs.x)&&!isNaN(t.attrs.y);default:return!0}})(e)){for(const n in e.attrs)if("stroke"===n&&e.strokeReference)t.setAttribute("stroke",e.strokeReference);else if("fill"===n&&e.fillReference)t.setAttribute("fill",e.fillReference);else if("text"===n){t.setAttribute("style","white-space: pre"),t.textContent=e.ellipsed||Ip(e.attrs,$p);const n=Py(e.attrs.text);"rtl"===n&&(t.setAttribute("direction","rtl"),t.setAttribute("dir","rtl"),t.setAttribute("text-anchor",Ly(t.getAttribute("text-anchor"),n)))}else if("text"!==e.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===e.type&&"title"===n&&e.attrs.title){const n=t.ownerDocument.createElementNS(Hy,"title");n.textContent=e.attrs.title,t.appendChild(n)}else t.setAttribute(n,e.attrs[n]);else{const i=+t.getAttribute(n)||0;let r=0;r="dominant-baseline"===n?Tp(e.attrs):e.attrs[n],t.setAttribute("dy",r+i)}if("string"==typeof e.data||"number"==typeof e.data||"boolean"==typeof e.data)t.setAttribute("data",e.data);else if("object"==typeof e.data&&null!==e.data)for(const n in e.data)"string"!=typeof e.data[n]&&"number"!=typeof e.data[n]&&"boolean"!=typeof e.data[n]||t.setAttribute("data-".concat(n),e.data[n])}};class Xy{constructor(t,e,n,i){this.create=t,this.nodeCreator=e,this.nodeMaintainer=n,this.nodeDestroyer=i}render(t,e){return this.create([],t,e,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function Gy(){return new Xy($y,Wy,Yy,Uy)}function Ky(t){let e,n,i,r=0;if(0===(t=JSON.stringify(t)).length)return r;for(e=0,i=t.length;e<i;e++)n=t.charCodeAt(e),r=(r<<5)-r+n,r&=r;return r}function Zy(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hy,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fy;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gy)();let i,r,o,a=!1,s=my();const l={transform:void 0},c=yy(),u={type:"defs",children:[]},h=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ky,n={},i=Date.now();const r={onCreate(r){let o={};r.node&&"object"==typeof r.node.fill&&"pattern"===r.node.fill.type&&r.node.fill.shapes&&(o.fill=r.node.fill),r.node&&"object"==typeof r.node.stroke&&"pattern"===r.node.stroke.type&&r.node.stroke.shapes&&(o.stroke=r.node.stroke),Object.keys(o).forEach((a=>{let s="";const l=o[a],c=e(l),u="picasso-pattern-".concat(i,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const e={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((t=>{e.children.push(t)})),t.push(e),n[c]=!0}r.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")}))},clear(){n={}}};return r}(u.children),d=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ky,n={},i=Date.now();const r={getOrCreateGradient(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=e(r[o]),l="picasso-gradient-".concat(i,"-").concat(s);if(!n[s]){let{orientation:e,degree:i,stops:a=[]}=r[o],c={};void 0===i&&(i=90),"radial"===e?c.type="radialGradient":(c=gu(i),["x1","x2","y1","y2"].forEach((t=>{t in r[o]&&(c[t]=r[o][t])})),c.type="linearGradient"),c.id=l,c.children=a.map((t=>{let{offset:e,color:n,opacity:i}=t;return{type:"stop",offset:"".concat(100*e,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==i?i:1)}})),t.push(c),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(t){let e="";"undefined"!=typeof window&&(e=window.location.href.split("#")[0]);const n=t.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=r.getOrCreateGradient(n,"fill",e)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=r.getOrCreateGradient(n,"stroke",e))},clear(){n={}}};return r}(u.children);return c.element=()=>i,c.root=()=>r,c.settings=t=>(t&&Object.keys(l).forEach((e=>{void 0!==t[e]&&(l[e]=t[e])})),l),c.appendTo=e=>(i||(i=e.ownerDocument.createElementNS(t,"svg"),i.style.position="absolute",i.style["-webkit-font-smoothing"]="antialiased",i.style["-moz-osx-font-smoothing"]="antialiased",i.style.pointerEvents="none",i.setAttribute("xmlns",t),r=e.ownerDocument.createElementNS(t,"g"),r.style.pointerEvents="auto",i.appendChild(r)),e.appendChild(i),i),c.getScene=t=>{const n=s.scaleRatio.x,i=s.scaleRatio.y,r={type:"container",children:Array.isArray(t)?[...t,u]:t,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*i,")"):""};return 1===n&&1===i||(r.transform+="scale(".concat(n,", ").concat(i,")")),e({items:[r],on:{create:[t=>{t.node.fillReference=void 0,t.node.strokeReference=void 0},d.onCreate,h.onCreate,zp(c.measureText),xy(c)]}})},c.render=t=>{if(!i)return!1;const e="function"==typeof l.transform&&l.transform();if(e){const{horizontalScaling:t,horizontalSkewing:n,verticalSkewing:i,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=e;return r.style.transform="matrix(".concat(t,", ").concat(n,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}r.style.transform="",a&&(i.style.left="".concat(s.computedPhysical.x,"px"),i.style.top="".concat(s.computedPhysical.y,"px"),i.setAttribute("width",s.computedPhysical.width),i.setAttribute("height",s.computedPhysical.height)),d.clear(),h.clear(),u.children.length=0;const f=c.getScene(t),p=!o||!f.equals(o),g=a||p;return g&&(c.clear(),n.render(f.children,r)),a=!1,o=f,g},c.itemsAt=t=>o?o.getItemsFrom(t):[],c.findShapes=t=>o?o.findShapes(t):[],c.clear=()=>{if(!r)return c;o=null;const t=r.cloneNode(!1);return i.replaceChild(t,r),r=t,c},c.destroy=()=>{i&&i.parentNode&&i.parentNode.removeChild(i),i=null,r=null},c.size=t=>{if(t){const e=my(t);JSON.stringify(s)!==JSON.stringify(e)&&(a=!0,s=e)}return s},c}var Jy,Qy,tx,ex,nx,ix,rx,ox={},ax=[],sx=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function lx(t,e){for(var n in e)t[n]=e[n];return t}function cx(t){var e=t.parentNode;e&&e.removeChild(t)}function ux(t,e,n){var i,r,o,a={};for(o in e)"key"==o?i=e[o]:"ref"==o?r=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?Jy.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===a[o]&&(a[o]=t.defaultProps[o]);return hx(t,a,i,r,null)}function hx(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++tx:r};return null==r&&null!=Qy.vnode&&Qy.vnode(o),o}function dx(t){return t.children}function fx(t,e){this.props=t,this.context=e}function px(t,e){if(null==e)return t.__?px(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?px(t):null}function gx(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return gx(t)}}function mx(t){(!t.__d&&(t.__d=!0)&&ex.push(t)&&!yx.__r++||nx!==Qy.debounceRendering)&&((nx=Qy.debounceRendering)||ix)(yx)}function yx(){var t,e,n,i,r,o,a,s;for(ex.sort(rx);t=ex.shift();)t.__d&&(e=ex.length,i=void 0,r=void 0,a=(o=(n=t).__v).__e,(s=n.__P)&&(i=[],(r=lx({},o)).__v=o.__v+1,Nx(s,o,r,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,i,null==a?px(o):a,o.__h),Rx(i,o),o.__e!=a&&gx(o)),ex.length>e&&ex.sort(rx));yx.__r=0}function xx(t,e,n,i,r,o,a,s,l,c){var u,h,d,f,p,g,m,y=i&&i.__k||ax,x=y.length;for(n.__k=[],u=0;u<e.length;u++)if(null!=(f=n.__k[u]=null==(f=e[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?hx(null,f,null,null,f):Array.isArray(f)?hx(dx,{children:f},null,null,null):f.__b>0?hx(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=y[u])||d&&f.key==d.key&&f.type===d.type)y[u]=void 0;else for(h=0;h<x;h++){if((d=y[h])&&f.key==d.key&&f.type===d.type){y[h]=void 0;break}d=null}Nx(t,f,d=d||ox,r,o,a,s,l,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(m||(m=[]),d.ref&&m.push(d.ref,null,f),m.push(h,f.__c||p,f)),null!=p?(null==g&&(g=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=vx(f,l,t):l=bx(t,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=t&&(l=px(d))}for(n.__e=g,u=x;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=wx(i).nextSibling),Dx(y[u],y[u]));if(m)for(u=0;u<m.length;u++)Cx(m[u],m[++u],m[++u])}function vx(t,e,n){for(var i,r=t.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=t,e="function"==typeof i.type?vx(i,e,n):bx(n,i,i,r,i.__e,e));return e}function bx(t,e,n,i,r,o){var a,s,l;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||r!=o||null==r.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(r),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<i.length;l+=1)if(s==r)break t;t.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function wx(t){var e,n,i;if(null==t.type||"string"==typeof t.type)return t.__e;if(t.__k)for(e=t.__k.length-1;e>=0;e--)if((n=t.__k[e])&&(i=wx(n)))return i;return null}function Mx(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||sx.test(e)?n:n+"px"}function kx(t,e,n,i,r){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Mx(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||Mx(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?Sx:_x,o):t.removeEventListener(e,o?Sx:_x,o);else if("dangerouslySetInnerHTML"!==e){if(r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function _x(t){return this.l[t.type+!1](Qy.event?Qy.event(t):t)}function Sx(t){return this.l[t.type+!0](Qy.event?Qy.event(t):t)}function Nx(t,e,n,i,r,o,a,s,l){var c,u,h,d,f,p,g,m,y,x,v,b,w,M,k,_=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(l=n.__h,s=e.__e=n.__e,e.__h=null,o=[s]),(c=Qy.__b)&&c(e);try{t:if("function"==typeof _){if(m=e.props,y=(c=_.contextType)&&i[c.__c],x=c?y?y.props.value:c.__:i,n.__c?g=(u=e.__c=n.__c).__=u.__E:("prototype"in _&&_.prototype.render?e.__c=u=new _(m,x):(e.__c=u=new fx(m,x),u.constructor=_,u.render=Ox),y&&y.sub(u),u.props=m,u.state||(u.state={}),u.context=x,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=_.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=lx({},u.__s)),lx(u.__s,_.getDerivedStateFromProps(m,u.__s))),d=u.props,f=u.state,u.__v=e,h)null==_.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==_.getDerivedStateFromProps&&m!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,x),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,x)||e.__v===n.__v){for(e.__v!==n.__v&&(u.props=m,u.state=u.__s,u.__d=!1),u.__e=!1,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&a.push(u);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,x),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,f,p)}))}if(u.context=x,u.props=m,u.__P=t,b=Qy.__r,w=0,"prototype"in _&&_.prototype.render){for(u.state=u.__s,u.__d=!1,b&&b(e),c=u.render(u.props,u.state,u.context),M=0;M<u._sb.length;M++)u.__h.push(u._sb[M]);u._sb=[]}else do{u.__d=!1,b&&b(e),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(i=lx(lx({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(d,f)),k=null!=c&&c.type===dx&&null==c.key?c.props.children:c,xx(t,Array.isArray(k)?k:[k],e,n,i,r,o,a,s,l),u.base=e.__e,e.__h=null,u.__h.length&&a.push(u),g&&(u.__E=u.__=null),u.__e=!1}else null==o&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=Ax(n.__e,e,n,i,r,o,a,l);(c=Qy.diffed)&&c(e)}catch(t){e.__v=null,(l||null!=o)&&(e.__e=s,e.__h=!!l,o[o.indexOf(s)]=null),Qy.__e(t,e,n)}}function Rx(t,e){Qy.__c&&Qy.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Qy.__e(t,e.__v)}}))}function Ax(t,e,n,i,r,o,a,s){var l,c,u,h=n.props,d=e.props,f=e.type,p=0;if("svg"===f&&(r=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){t=l,o[p]=null;break}if(null==t){if(null===f)return document.createTextNode(d);t=r?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,s=!1}if(null===f)h===d||s&&t.data===d||(t.data=d);else{if(o=o&&Jy.call(t.childNodes),c=(h=n.props||ox).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!s){if(null!=o)for(h={},p=0;p<t.attributes.length;p++)h[t.attributes[p].name]=t.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===t.innerHTML)||(t.innerHTML=u&&u.__html||""))}if(function(t,e,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in e||kx(t,o,null,n[o],i);for(o in e)r&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||kx(t,o,e[o],n[o],i)}(t,d,h,r,s),u)e.__k=[];else if(p=e.props.children,xx(t,Array.isArray(p)?p:[p],e,n,i,r&&"foreignObject"!==f,o,a,o?o[0]:n.__k&&px(n,0),s),null!=o)for(p=o.length;p--;)null!=o[p]&&cx(o[p]);s||("value"in d&&void 0!==(p=d.value)&&(p!==t.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&kx(t,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==t.checked&&kx(t,"checked",p,h.checked,!1))}return t}function Cx(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){Qy.__e(t,n)}}function Dx(t,e,n){var i,r;if(Qy.unmount&&Qy.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||Cx(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){Qy.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&Dx(i[r],e,n||"function"!=typeof t.type);n||null==t.__e||cx(t.__e),t.__=t.__e=t.__d=void 0}function Ox(t,e,n){return this.constructor(t,n)}function Ex(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:e=document.createElement.bind(document)}=t;let n,i,r=my();const o={transform:void 0},a=yy();return a.element=()=>n,a.root=()=>n,a.settings=t=>(t&&Object.keys(o).forEach((e=>{void 0!==t[e]&&(o[e]=t[e])})),o),a.appendTo=t=>(n||(n=e("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),t.appendChild(n),n),a.render=t=>{if(!n)return!1;const e="function"==typeof o.transform&&o.transform();if(e){const{horizontalScaling:t,horizontalSkewing:i,verticalSkewing:r,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=e;return n.style.transform="matrix(".concat(t,", ").concat(i,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}let a;return n.style.transform="",n.style.left="".concat(r.computedPhysical.x,"px"),n.style.top="".concat(r.computedPhysical.y,"px"),n.style.width="".concat(r.computedPhysical.width,"px"),n.style.height="".concat(r.computedPhysical.height,"px"),a=Array.isArray(t)?ux("div",null,t):t,i=function(t,e,n){var i,r,o;Qy.__&&Qy.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],Nx(e,t=(!i&&n||e).__k=ux(dx,null,[t]),r||ox,ox,void 0!==e.ownerSVGElement,!i&&n?[n]:r?null:e.firstChild?Jy.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i),Rx(o,t)}(a,n,i),!0},a.renderArgs=[ux],a.clear=()=>{if(n){let t=n.firstChild;for(;t;)n.removeChild(t),t=n.firstChild;i=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,i=null},a.size=t=>(t&&(r=my(t)),r),a}Jy=ax.slice,Qy={__e:function(t,e,n,i){for(var r,o,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,i||{}),a=r.__d),a)return r.__E=r}catch(e){t=e}throw t}},tx=0,fx.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=lx({},this.state),"function"==typeof t&&(t=t(lx({},n),this.props)),t&&lx(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),mx(this))},fx.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),mx(this))},fx.prototype.render=dx,ex=[],ix="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,rx=function(t,e){return t.__v.__b-e.__v.__b},yx.__r=0;var zx=[function(t){t.renderer("svg",Zy)},function(t){t.renderer("canvas",Ay)},function(t){t.renderer("dom",Ex)}];const Ix={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const Tx=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=function(){let{level:t=Ix.OFF,pipe:e=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t;const i={[Ix.OFF]:()=>{},[Ix.ERROR]:function(){return e.error(...arguments)},[Ix.WARN]:function(){return e.warn(...arguments)},[Ix.INFO]:function(){return e.info(...arguments)},[Ix.DEBUG]:function(){return e.log(...arguments)}},r=function(t){if(t&&!(n<t)){for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];(i[t]||i[Ix.DEBUG])(...r)}};return{log:r,error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r(Ix.ERROR,...e)},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r(Ix.WARN,...e)},info:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r(Ix.INFO,...e)},debug:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r(Ix.DEBUG,...e)},level:t=>("number"==typeof t&&(n=t),n),LOG_LEVEL:Ix}}(e.logger),r={component:Gr(n.component,"component",i),data:Gr(n.data,"data",i),formatter:Gr(n.formatter,"formatter",i),interaction:Gr(n.interaction,"interaction",i),renderer:qh(n.renderer),scale:Gr(n.scale,"scale",i),symbol:Gr(n.symbol,"symbol",i),logger:i};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t({palettes:e.palettes.concat(n.palettes||[]),style:Ei({},e.style,n.style),logger:n.logger||e.logger,renderer:n.renderer||e.renderer},r)}return e.renderer&&e.renderer.prio&&r.renderer.default(e.renderer.prio[0]),o.use=function(t){return function(t){t(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r)},o.chart=t=>Ph(t,{registries:r,logger:i,style:e.style,palettes:e.palettes}),o.config=()=>e,Object.keys(r).forEach((t=>{o[t]=r[t]})),o.version=zi,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:Lh,data:$h,formatter:bs,interaction:Hh,renderer:qh(),scale:wc,symbol:Ru});Qg.forEach(Tx.use),zx.forEach(Tx.use),[].forEach(Tx.use);const Px=52,qx=-2*Math.PI/3,Lx=2*Math.PI/3,jx="#EEEEEE",Fx=2.38,Bx={MIN:12,MAX:60},Vx={MIN:100,MAX:1e3},$x={TOP:-4,BOTTOM:0,LEFT:4,RIGHT:4},Hx={VERTICAL_ALIGNMENT_FACTOR:.4},Wx={VERTICAL_ALIGNMENT_FACTOR:1.25},Ux=1.2,Yx={DARK:"#595959",LIGHT:"#E6E6E6"},Xx=.4,Gx=1,Kx=2,Zx=.75,Jx=.75,Qx={MAX_WIDTH:150,MAX_LINES:2,CLEARANCE:12,ESTIMATED_LINE_HEIGHT:16,GAP:8},tv=70,ev=3,nv={MEASURE:"measure"},iv={BAR:"bar",LABEL_BAR:"label-bar",BACKGROUND_BAR:"background-bar",OOB_INDICATOR:"oob-indicator",BAR_AXIS:"bar-axis",AXIS_TITLE:"axis-title",GAUGE_LABEL:"gauge-label",RADIAL_GAUGE_NEEDLE:"radial-gauge-needle",RADIAL_OOB_INDICATOR:"radial-oob-indicator",RADIAL_GAUGE:"radial-gauge",REFERENCE_LINES_AND_LABELS:"reference-lines-and-labels",RADIAL_SPARK:"radial-spark",RADIAL_GAUGE_LABEL:"radial-gauge-label"},rv="XSMALL",ov="SMALL",av="XSMALL_VERTICAL",sv="XSMALL_HORIZONTAL",lv="SMALL",cv={FULL:{width:550,height:450},MEDIUM:{width:300,height:150},SMALL:{width:150,height:84},SMALLER:{width:150,height:75},XSMALL:{width:84,height:84},XSMALL_VERTICAL:{width:105,height:0},XSMALL_HORIZONTAL:{width:0,height:104},SPARK:{height:75,width:50}},uv=600,hv=200,dv=500;function fv(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function pv(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function gv(){}var mv=.7,yv=1/mv,xv="\\s*([+-]?\\d+)\\s*",vv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wv=/^#([0-9a-f]{3,8})$/,Mv=new RegExp(`^rgb\\(${xv},${xv},${xv}\\)$`),kv=new RegExp(`^rgb\\(${bv},${bv},${bv}\\)$`),_v=new RegExp(`^rgba\\(${xv},${xv},${xv},${vv}\\)$`),Sv=new RegExp(`^rgba\\(${bv},${bv},${bv},${vv}\\)$`),Nv=new RegExp(`^hsl\\(${vv},${bv},${bv}\\)$`),Rv=new RegExp(`^hsla\\(${vv},${bv},${bv},${vv}\\)$`),Av={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Cv(){return this.rgb().formatHex()}function Dv(){return this.rgb().formatRgb()}function Ov(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=wv.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Ev(e):3===n?new Pv(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?zv(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?zv(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Mv.exec(t))?new Pv(e[1],e[2],e[3],1):(e=kv.exec(t))?new Pv(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=_v.exec(t))?zv(e[1],e[2],e[3],e[4]):(e=Sv.exec(t))?zv(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Nv.exec(t))?Vv(e[1],e[2]/100,e[3]/100,1):(e=Rv.exec(t))?Vv(e[1],e[2]/100,e[3]/100,e[4]):Av.hasOwnProperty(t)?Ev(Av[t]):"transparent"===t?new Pv(NaN,NaN,NaN,0):null}function Ev(t){return new Pv(t>>16&255,t>>8&255,255&t,1)}function zv(t,e,n,i){return i<=0&&(t=e=n=NaN),new Pv(t,e,n,i)}function Iv(t){return t instanceof gv||(t=Ov(t)),t?new Pv((t=t.rgb()).r,t.g,t.b,t.opacity):new Pv}function Tv(t,e,n,i){return 1===arguments.length?Iv(t):new Pv(t,e,n,null==i?1:i)}function Pv(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function qv(){return`#${Bv(this.r)}${Bv(this.g)}${Bv(this.b)}`}function Lv(){const t=jv(this.opacity);return`${1===t?"rgb(":"rgba("}${Fv(this.r)}, ${Fv(this.g)}, ${Fv(this.b)}${1===t?")":`, ${t})`}`}function jv(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Fv(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Bv(t){return((t=Fv(t))<16?"0":"")+t.toString(16)}function Vv(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Hv(t,e,n,i)}function $v(t){if(t instanceof Hv)return new Hv(t.h,t.s,t.l,t.opacity);if(t instanceof gv||(t=Ov(t)),!t)return new Hv;if(t instanceof Hv)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n<i):n===o?(i-e)/s+2:(e-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new Hv(a,s,l,t.opacity)}function Hv(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Wv(t){return(t=(t||0)%360)<0?t+360:t}function Uv(t){return Math.max(0,Math.min(1,t||0))}function Yv(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}fv(gv,Ov,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Cv,formatHex:Cv,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return $v(this).formatHsl()},formatRgb:Dv,toString:Dv}),fv(Pv,Tv,pv(gv,{brighter(t){return t=null==t?yv:Math.pow(yv,t),new Pv(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?mv:Math.pow(mv,t),new Pv(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Pv(Fv(this.r),Fv(this.g),Fv(this.b),jv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qv,formatHex:qv,formatHex8:function(){return`#${Bv(this.r)}${Bv(this.g)}${Bv(this.b)}${Bv(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Lv,toString:Lv})),fv(Hv,(function(t,e,n,i){return 1===arguments.length?$v(t):new Hv(t,e,n,null==i?1:i)}),pv(gv,{brighter(t){return t=null==t?yv:Math.pow(yv,t),new Hv(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?mv:Math.pow(mv,t),new Hv(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Pv(Yv(t>=240?t-240:t+120,r,i),Yv(t,r,i),Yv(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Hv(Wv(this.h),Uv(this.s),Uv(this.l),jv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=jv(this.opacity);return`${1===t?"hsl(":"hsla("}${Wv(this.h)}, ${100*Uv(this.s)}%, ${100*Uv(this.l)}%${1===t?")":`, ${t})`}`}}));const Xv=Math.PI/180,Gv=180/Math.PI,Kv=.96422,Zv=.82521,Jv=4/29,Qv=6/29,tb=3*Qv*Qv,eb=Qv*Qv*Qv;function nb(t){if(t instanceof ib)return new ib(t.l,t.a,t.b,t.opacity);if(t instanceof cb)return ub(t);t instanceof Pv||(t=Iv(t));var e,n,i=sb(t.r),r=sb(t.g),o=sb(t.b),a=rb((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?e=n=a:(e=rb((.4360747*i+.3850649*r+.1430804*o)/Kv),n=rb((.0139322*i+.0971045*r+.7141733*o)/Zv)),new ib(116*a-16,500*(e-a),200*(a-n),t.opacity)}function ib(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function rb(t){return t>eb?Math.pow(t,1/3):t/tb+Jv}function ob(t){return t>Qv?t*t*t:tb*(t-Jv)}function ab(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function sb(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function lb(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof cb)return new cb(t.h,t.c,t.l,t.opacity);if(t instanceof ib||(t=nb(t)),0===t.a&&0===t.b)return new cb(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Gv;return new cb(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new cb(t,e,n,null==i?1:i)}function cb(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function ub(t){if(isNaN(t.h))return new ib(t.l,0,0,t.opacity);var e=t.h*Xv;return new ib(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function hb(t){return function(t){return lb(t).l<70}(t)?Yx.LIGHT:Yx.DARK}function db(t,e=!0){let n="";for(let e=0;e<t.length;e++){const i=t[e];n+=0===e?`M${i.x} ${i.y}`:`L${i.x} ${i.y}`,n+=" "}return e&&(n+="Z"),n}function fb(t){const{angle:e,origin:n}=t,i=t.points.map((t=>function(t,e,n={x:0,y:0}){const i=Math.cos(e),r=Math.sin(e),o=(s=n,{x:(a=t).x-s.x,y:a.y-s.y});var a,s;return function(t,e){return{x:t.x+e.x,y:t.y+e.y}}({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}(t,e,n)));return{type:"path",fill:t.fill,d:db(i)}}fv(ib,(function(t,e,n,i){return 1===arguments.length?nb(t):new ib(t,e,n,null==i?1:i)}),pv(gv,{brighter(t){return new ib(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new ib(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new Pv(ab(3.1338561*(e=Kv*ob(e))-1.6168667*(t=1*ob(t))-.4906146*(n=Zv*ob(n))),ab(-.9787684*e+1.9161415*t+.033454*n),ab(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),fv(cb,lb,pv(gv,{brighter(t){return new cb(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new cb(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return ub(this).rgb()}}));const pb={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var t;return function({chart:t,settings:e,symbol:n}){if(!t||!e||!n)return[];const{size:i,component:r,selector:o,pointingTo:a}=e;if(!t.component(e.component))return[];const s=t.findShapes(o).filter((t=>t.key===r));if(null==s||!s.length)return[];const{clientWidth:l,clientHeight:c}=t.element;let u=l/2,h=c/2,d=-Math.PI/2;const f=i/3;switch(a){case"top":h=f;break;case"bottom":h=c-f,d=3*Math.PI/2-Math.PI;break;case"right":u=l-f,d=0;break;case"left":u=f,d=Math.PI}const p=[];for(let t=0;t<s.length;t+=1){const e=s[t],n=hb(["top","right"].includes(a)?e.attrs.fill:jx),r={x:u,y:h},o=i/6,l=fb({points:[{x:r.x+2*o,y:r.y},{x:r.x,y:r.y+o},{x:r.x,y:r.y-o}],angle:d,fill:n,origin:r});p.push(l)}return p}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,symbol:this.symbol})}};function gb(t,e,n,i){const r=Math.floor(Math.min(t,e)),o=Math.abs(i-n),a=.02*Math.tan(-o/4+Math.PI/2),s=2*(.4+a)-bb(t,e)/r;return{innerRadius:s-2*(r>500?50:Math.max(r/dv*50,10))/r,outerRadius:s,radiusIncrease:a}}function mb(t,e,n,i){const r=i-Math.PI/2;return{x:t+n*Math.cos(r),y:e+n*Math.sin(r)}}function yb(t,e){const n=t.getColor()({datum:{value:()=>0}});return e?"#595959":n}function xb({innerRadius:t,outerRadius:e,width:n,height:i}){return(e-t)*Math.min(n,i)/2}function vb(t){return!1!==t.show&&0!==t.show&&"0"!==t.show}function bb(t,e){return Math.min(6,Math.min(t,e)/hv)}const wb={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var t;return function({chart:t,settings:e,symbol:n}){if(!t||!e||!n)return[];const{valueAngle:i}=e;if(!t.component(e.component))return[];const{clientWidth:r,clientHeight:o}=t.element,{outerRadius:a,innerRadius:s}=gb(r,o,qx,Lx),l=xb({innerRadius:s,outerRadius:a,width:r,height:o});let c=mb(r/2,o/2,a*Math.min(r,o)/2,e.valueAngle),u=c.x,h=c.y;const d=[],f=hb(jx),p={x:u,y:h},g=l/6,m=fb({points:[{x:p.x,y:p.y},{x:p.x-8*g,y:p.y+g},{x:p.x-8*g,y:p.y-g}],angle:i-Math.PI/2,fill:f,origin:p});return d.push(m),d}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,symbol:this.symbol})}};const Mb={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var t;return function({chart:t,settings:e,symbol:n}){if(!t||!e||!n)return[];const{size:i,component:r,selector:o,angle:a,radius:s}=e;if(!t.component(e.component))return[];const l=t.findShapes(o).filter((t=>t.key===r));if(null==l||!l.length)return[];const{clientWidth:c,clientHeight:u}=t.element;let h=c/2,d=u/2,{x:f,y:p}=mb(h,d,s,a);const g=[],m=e.fill,y=a===qx?-1:1,x={x:f,y:p},v=i/6,b=fb({points:[{x:x.x+(2*v+1)*y,y:x.y+.5},{x:x.x+1*y,y:x.y+v+.5},{x:x.x+1*y,y:x.y-v+.5}],angle:a,fill:m,origin:x});return g.push(b),g}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,symbol:this.symbol})}};function kb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _b=Object.prototype.hasOwnProperty,Sb=Object.prototype.toString,Nb=Object.defineProperty,Rb=Object.getOwnPropertyDescriptor,Ab=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===Sb.call(t)},Cb=function(t){if(!t||"[object Object]"!==Sb.call(t))return!1;var e,n=_b.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&_b.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;for(e in t);return void 0===e||_b.call(t,e)},Db=function(t,e){Nb&&"__proto__"===e.name?Nb(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},Ob=function(t,e){if("__proto__"===e){if(!_b.call(t,e))return;if(Rb)return Rb(t,e).value}return t[e]},Eb=function t(){var e,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(e=arguments[l]))for(n in e)i=Ob(s,n),s!==(r=Ob(e,n))&&(u&&r&&(Cb(r)||(o=Ab(r)))?(o?(o=!1,a=i&&Ab(i)?i:[]):a=i&&Cb(i)?i:{},Db(s,{name:n,newValue:t(u,a,r)})):void 0!==r&&Db(s,{name:n,newValue:r}));return s},zb=kb(Eb);let Ib;function Tb(){Ib=Ib||document.createElement("canvas").getContext("2d")}const Pb={measureTextWidth(t){Tb();const{width:e}=Ib.measureText(t);return e},lineWrap(t,e,n,i){let r,o;Tb();const a=t?t.split(/\n+|\r+|\r\n/):[],s=[];let l,c,u,h,d=t?t.split(/\s+/):[],f=a[0];if("number"!=typeof e||e<=0)return[t];if("number"==typeof i&&a.length>=i)return a.slice(0,i);for(n&&(Ib.font=n),o=0;o<a.length;o++){for(h=a[o],d=h.split(/\s+/),[f]=d,u="",r=1;r<d.length;r++)if(l=`${f} ${d[r]}`,c=Pb.measureTextWidth(l),c>e&&("number"!=typeof i||i>s.length)?(s.push(f),f=d[r]):f=l,"number"==typeof i&&s.length>=i){u=d.slice(r+1).join(" ");break}"number"!=typeof i||s.length<i?s.push(f):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]} ${f} ${u}`}return s},wordWrap(t,e,n,i,r){if(Tb(),!t||!t.length)return[];n&&(Ib.font=n);let o=[];const a=t.slice();let s,l,c,u="";if(a.filter((t=>!!t)),"number"!=typeof e||e<0)return t.slice();for(c=0;c<a.length;c++){var h;if(l=a[c],u="",l.length<=1||Pb.measureTextWidth(l)<=e)o.push(l);else if(s=Pb.splitWord(l,e,void 0,void 0===i?void 0:i-o.length),s.length<=1)o.push(s[0]);else u=null!==(h=s.pop())&&void 0!==h?h:"",o=o.concat(s),a[c+1]?Pb.measureTextWidth(`${u} ${a[c+1]}`)>e&&(void 0===i||o.length+a.length-c<=i)?a.splice(c+1,0,u):a[c+1]=`${u} ${a[c+1]}`:a.push(u)}return o.forEach(((t,e,n)=>{n[e]=t.trim()})),void 0!==i&&o.length>i?(o=o.splice(0,i),o[o.length-1]=Pb.truncate(o[o.length-1],e,n,r).text):(l=o[o.length-1],l&&l.length>1&&Pb.measureTextWidth(l)>e&&(o[o.length-1]=Pb.truncate(l,e,n,r).text)),o},truncate(t,e,n,i="…"){Tb();let r,o,a,s,l=t;const c=Pb.measureTextWidth("i");if(n&&(Ib.font=n),t&&e){if(Pb.measureTextWidth(l)>e){const t=Math.ceil(e/c);for(r=Math.min(t,l.length);r>0;r--)if(o=l.substring(0,r-1),a=o.trim()+i,Pb.measureTextWidth(a)<=e){s=l.substring(r-1),l=a;break}r||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:t=>"number"==typeof t&&Number.isFinite(t),explodeWord(t,e,n,i){let r;Tb();let o,a=t,s="",l=[];if(void 0!==n&&Pb.isNumber(n)&&n<=1)return[t];const c=Math.ceil(e/i);for(r=Math.min(t.length,c);r>0&&(a=t.substring(0,r),o=t.substring(r-1,r)," "===o?a=t.substring(0,r-1):a+="-",s=t.substring(r),!(Pb.measureTextWidth(a)<=e));r--);return(!r&&!a||Pb.measureTextWidth(a)>e)&&(a=t.substring(0,1),s=t.substring(1)),l.push(a),s?(Pb.measureTextWidth(s)>e?l=l.concat(Pb.explodeWord(s,e,void 0===n?void 0:n-1,i)):l.push(s),l.filter((t=>""!==t.trim()))):l},splitWord:(t,e,n,i)=>(Tb(),t&&e?(n&&(Ib.font=n),Pb.explodeWord(t,e,i,Math.max(1,Pb.measureTextWidth("i")))):[]),wrapText(t,e,n,i,r="…"){let o;return Number.isNaN(e)||!e?[t]:(o=void 0===i||i>1?Pb.lineWrap(t,e,n,i):[t],o=Pb.wordWrap(o,e,n,i,r),o)},getFontHeight:t=>(Tb(),t&&(Ib.font=t),1.5*Pb.measureTextWidth("m")),tokenize(t,e,n,i,r,o,a=1){Tb(),e&&(Ib.font=e);const s=Pb.getFontHeight(),l=a*s;let c=[],u=[];if(void 0!==o&&o<s)return[];const h=o?Math.max(1,Math.floor(o/l)):i||1;return c=[void 0===i||Number.isNaN(i)||i<=0?h:Math.min(h,i)],Array.isArray(t)?t.forEach(((t,n)=>{u.length<h&&(u=u.concat(Pb.wrapText(t,r,e,c[n])))})):u=Pb.wrapText(t,r,e,c[0],n),u}};function qb({chart:t,renderer:e,refLine:n,settings:i,width:r,height:o,barWidth:a}){if(!t||!e||!i)return{};const{position:s,scale:l,value:c,label:u,line:h,formatter:d}=n,f=n.radius?n.radius*(Math.min(r,o)/2):r/2,p=(Lx-qx)*s+qx-Math.PI/2,g={x:r/2,y:o/2};let m=zb(!0,{},i.style.line,h||{});const y={type:"line",...{x1:g.x+Math.cos(p)*f,y1:g.y+Math.sin(p)*f,x2:g.x+Math.cos(p)*(f+a),y2:g.y+Math.sin(p)*(f+a)},stroke:m.stroke,strokeWidth:m.strokeWidth,strokeDasharray:m.strokeDasharray};let x;if(u){const n=zb(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},i.style.label||{},{fill:m.stroke},u),{fontFamily:s,fontSize:h,fill:y,opacity:v}=n,b=u.showLabel?n.text:"";let w,M="";if("string"==typeof d||"object"==typeof d)w=t.formatter(d);else if(void 0!==l&&"string"!=typeof l&&"function"==typeof l.data){const t=l.data()&&l.data().fields;w=t&&t[0]?t[0].formatter():null}!1!==u.showValue&&(w?M=` (${w("function"==typeof c?c():c)})`:l&&(M=` (${c})`));const k=t=>e.measureText({text:t,fontFamily:s,fontSize:h}),_=k("M").height,S=`normal ${h} ${s}`;let N,R=ev;const A=`${b}${M}`||"",C=Math.min(r,o),D=Math.min(8,C/200),O=mb(g.x,g.y,f+a+D,p+Math.PI/2),E=k(A).width;N=Math.min(O.x,r-O.x-Fx,tv),R=function(t,e,n){const i=Math.min(Math.floor((t+Fx)/e),Math.floor((n-t)/e));return Math.min(i,ev)}(O.y,_,o);let z=Pb.tokenize(A,S,`... ${M}`,R,N,void 0);const I=function(t){let e="start";const n=t>-Math.PI&&t<0?"baseline":"hanging";return(t+=Math.PI/2)<0&&t>-Math.PI?e="end":t>0&&t<Math.PI&&(e="start"),{textAnchor:e,baseline:n}}(p);O.y-2*_>0&&O.y+2*_<o&&(O.x-E+Fx<0&&"end"===I.textAnchor||O.x+E-Fx>r)&&(z=Pb.tokenize(A,S,`... ${M}`,R,N,void 0)),x={fill:y,opacity:v,fontFamily:s,fontSize:h,linePosition:O,lineHeight:_,align:"left",baseline:I.baseline,textAnchor:I.textAnchor,lines:z}}return{lineNode:y,labelNode:x}}const Lb={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var t,e;let{settings:n,chart:i,renderer:r,rect:o}=this;if(!(i&&o&&n&&r))return[];const{width:a,height:s}=o,l=null!==(t=null==n||null===(e=n.settings)||void 0===e?void 0:e.barWidth)&&void 0!==t?t:0;let c=(null==n?void 0:n.lines)&&n.lines.radial||[];if(0===c.length)return[];c=c.map((t=>{if("function"==typeof t.value&&(t.value=t.value()),t.scale){let e=null==i?void 0:i.scale("string"==typeof t.scale?t.scale:"");const n=e(t.value);return zb(t,{scale:e,position:n})}return zb(t,{position:t.value})}));const u=[];let h=[];[...c].forEach((t=>{if(t.position>0&&t.position<1){const{lineNode:e,labelNode:o}=qb({chart:i,renderer:r,refLine:t,settings:n,width:a,height:s,barWidth:l});e&&u.push(e),o&&h.push(o)}}));const d=[];h.forEach((t=>{const{fill:e,opacity:n,fontFamily:i,fontSize:r,lines:o,lineHeight:a,textAnchor:s,linePosition:l,baseline:c}=t,u=l,h=o.length-1,f=o.map(((t,o)=>{let l=u.y;return h>0&&("baseline"===c?l-=(h-o)*a:l+=o*a),{type:"text",text:t,baseline:c,anchor:s,fill:e,opacity:n,fontFamily:i,fontSize:r,x:u.x,y:l}}));d.push(...f)}));const{MEDIUM:f,SMALLER:p}=cv,g=a>=f.width&&s>=f.height;return[...a>=p.width&&s>=p.height?u:[],...g?d:[]]}};const jb={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var t;return function({chart:t,settings:e,symbol:n}){if(!t||!e||!n)return[];const{valueAngle:i}=e,{clientWidth:r,clientHeight:o}=t.element,a=.4*Math.min(r,o),s=[],l=e.fill,c={x:r/2,y:o/2},u=fb({points:[{x:c.x-a/2,y:c.y+a/2},{x:c.x,y:c.y-a},{x:c.x+a/2,y:c.y+a/2}],angle:i,fill:l,origin:c});return s.push(u),s}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,symbol:this.symbol})}},Fb={getGap(t,e){const n=t.position<e.position?t:e,i=t.position<e.position?e:t;return i.position-i.radius-(n.position+n.radius)},findSegmentPositionMeetMaxThenMin(t,e,n){const i=t.position+t.radius,r=t.position-Math.max(0,i-n),o=r-t.radius;return r+Math.max(0,e-o)},layoutPositionFromMin(t,e,n,i=0){const r=t.length-1;let o,a,s,l=e;for(let e=0;e<r;e++)o=t[e],a=t[e+1],s=(o.position+a.position)/2-i/2,o.position=Fb.findSegmentPositionMeetMaxThenMin(o,l,s),l=o.position+o.radius+i;a&&(a.position=Fb.findSegmentPositionMeetMaxThenMin(a,l,n))},adjustPositionFromMax(t,e,n,i=0){const r=t.length-1,o=Math.max(0,t[r].position+t[r].radius-n);if(0===o)return;let a,s,l,c,u=0;for(a=r;a>0&&(s=t[a],l=t[a-1],c=Math.max(0,Fb.getGap(l,s)-i),c-=Math.max(0,u+c-o),u+=c,s.move=c,!(u>=o));a--);for(u<o&&l&&(c=Math.max(0,l.position-l.radius-e),c-=Math.max(0,u+c-o),u+=c,l.move=c),u=0,a=0;a<=r;a++)s=t[a],u+=s.move||0,s.move=u,s.position-=u},createLayout(t,e,n,i=0){const r=t.map((t=>t.segment)),o=r.length-1;if(o<0)return[];if(0===o){const t=r[0];t.position=Fb.findSegmentPositionMeetMaxThenMin(t,e,n)}else Fb.layoutPositionFromMin(r,e,n,i),Fb.adjustPositionFromMax(r,e,n,i);return t.filter((t=>{const i=Math.ceil(t.segment.position-t.segment.radius),r=t.segment.position+t.segment.radius;return i>=e&&r<=n}))}};const Bb={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var t,e;let{settings:n,chart:i,renderer:r,rect:o}=this;if(!(i&&o&&n&&r))return[];const{width:a,height:s}=o,l=null!==(t=null==n||null===(e=n.settings)||void 0===e?void 0:e.barWidth)&&void 0!==t?t:0,c=(null==n?void 0:n.lines)&&n.lines.x||[],u=(null==n?void 0:n.lines)&&n.lines.y||[];let h=c.length>0?c:u;if(0===h.length)return[];const d=c.length>0;h=h.map((t=>{if("function"==typeof t.value&&(t.value=t.value()),t.scale){let e=null==i?void 0:i.scale("string"==typeof t.scale?t.scale:"");const n=e(t.value);return zb(t,{scale:e,position:n})}return zb(t,{position:t.value})}));const f=[];let p=[];if([...h].forEach((t=>{if(vb(t)&&t.position>0&&t.position<1){const{lineNode:e,labelNode:o}=function({chart:t,renderer:e,refLine:n,settings:i,width:r,height:o,isVerticalRefLine:a,barWidth:s}){if(!t||!e||!i)return{};const{position:l,scale:c,value:u,label:h,line:d,formatter:f}=n;let p=zb(!0,{},i.style.line,d||{});const g={type:"line",...a?{x1:l*r,x2:l*r,y1:o/2-s/2,y2:o/2+s/2}:{x1:r/2-s/2,x2:r/2+s/2,y1:l*o,y2:l*o},stroke:p.stroke,strokeWidth:p.strokeWidth,strokeDasharray:p.strokeDasharray};let m;if(h){const n=zb(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},i.style.label||{},{fill:p.stroke},h),{fontFamily:d,fontSize:g,fill:y,opacity:x}=n,v=h.showLabel?n.text:"";let b,w="";if("string"==typeof f||"object"==typeof f)b=t.formatter(f);else if(void 0!==c&&"string"!=typeof c&&"function"==typeof c.data){const t=c.data()&&c.data().fields;b=t&&t[0]?t[0].formatter():null}!1!==h.showValue&&(b?w=` (${b("function"==typeof u?u():u)})`:c&&(w=` (${u})`));const M=t=>e.measureText({text:t,fontFamily:d,fontSize:g}),k=M("M").height,_=`normal ${g} ${d}`,S=a?Qx.MAX_WIDTH:r/2-s/2-Qx.CLEARANCE,N=a?2:1,R=`${v}${w}`||"",A=Pb.tokenize(R,_,`... ${w}`,N,S,void 0),C=(a?r:o)*l,D=Math.min(S,Math.max(...A.map((t=>M(t).width)))),O=A.length*k;m={fill:y,opacity:x,fontFamily:d,fontSize:g,linePosition:C,lineHeight:k,lines:A,segment:{position:C,radius:a?D/2:O/2}}}return{lineNode:g,labelNode:m}}({chart:i,renderer:r,refLine:t,settings:n,width:a,height:s,isVerticalRefLine:d,barWidth:l});e&&f.push(e),o&&p.push(o)}})),d)p=Fb.createLayout(p,0,a,Qx.GAP);else{const{attrs:t}=i.findShapes("text").filter((t=>t.key===iv.GAUGE_LABEL))[0],{"font-size":e}=t,n=parseFloat(e);let r=p.filter((e=>e.segment.position<t.y)),o=p.filter((e=>e.segment.position>t.y));r.sort(((t,e)=>t.segment.position-e.segment.position)),o.sort(((t,e)=>t.segment.position-e.segment.position)),r=Fb.createLayout(r,0,t.y-n/2),o=Fb.createLayout(o,t.y+n/2,s),p=[...r,...o]}const g=[],m=[];p.forEach((t=>{const{fill:e,opacity:n,fontFamily:i,fontSize:r,lines:o,segment:c,linePosition:u,lineHeight:h}=t,{position:f}=c;if(u!==f&&""!==t.lines[0]){let t={x1:a/2+l/2,x2:a/2+l/2+.75*Qx.CLEARANCE,y1:u,y2:f};d&&(t={y1:s/2+l/2,y2:s/2+l/2+Qx.CLEARANCE,x1:u,x2:f});const n={type:"line",...t,stroke:e,strokeWidth:1};m.push(n)}const p=o.map(((t,o)=>{let c=d?s/2+l/2+h/2+Qx.CLEARANCE:f;return c+=o*h,{type:"text",text:t,baseline:"central",anchor:d?"middle":"start",fill:e,opacity:n,fontFamily:i,fontSize:r,x:d?f:a/2+l/2+Qx.CLEARANCE,y:c}}));g.push(...p)}));const{MEDIUM:y,SMALLER:x}=cv,v=a>=y.width&&s>=y.height;return[...a>=x.width&&s>=x.height?f:[],...v?g:[],...v?m:[]]}};function Vb({layout:t,options:e}){return t.snapshotData&&!e.freeResize?{width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h}:void 0}function $b(t,e,n){if(t>=n)return 1;if(t<=e)return 0;const i=Math.min(1,Math.max(0,(t-e)/(n-e)));return Number.isNaN(i)?0:i}function Hb({chart:t,layoutService:e,dockService:n}){const{width:i,height:r}=n.meta.chart.size,{isVertical:o}=e.meta,a=Math.min(Px,o?i/10:r/10),s=o?r:i;function l(){const{min:t,max:n}=e.meta.rangeLimits,i=e.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum;return s*$b(i,t,n)}const c={getBottomPadding(t){if(o){const e=l()+-t.height*Hx.VERTICAL_ALIGNMENT_FACTOR,n=$x.BOTTOM,i=s-t.height-$x.TOP;return e<n?n:e>i?i:e}const{MAX_LINES:n,ESTIMATED_LINE_HEIGHT:c,CLEARANCE:u}=Qx,h=function(){const{MEDIUM:t}=cv,n=i>=t.width&&r>=t.height,{refLines:o}=e.meta;return o&&o.filter(vb).length>0&&n}()?n*c+u:0;return-a*Wx.VERTICAL_ALIGNMENT_FACTOR-h},getTopPadding:t=>-c.getBottomPadding(t),getLeftPadding(t){if(o)return i/5+a;const e=l()-t.width/2,n=$x.RIGHT,r=s-t.width-$x.LEFT;return e<n?n:e>r?r:e},getRightPadding:t=>-c.getLeftPadding(t)},u={getLeftPadding(e){if(!o)return 0;const n=t.findShapes("container").filter((t=>t.key===iv.BAR_AXIS));if(1!==n.length)return 0;const r=n[0],s=Math.max(...r.children.filter((t=>"text"===t.type)).map((t=>t.bounds.width))),l=Math.max(...r.children.filter((t=>"line"===t.type)).map((t=>t.bounds.width)));let c=a/2+s+l+a*Jx;return c>i/2-e.height/4&&(c=i/2-e.height/4),-c},getRightPadding:t=>-u.getLeftPadding(t),getTopPadding(){if(o)return-4;const e=t.findShapes("container").filter((t=>t.key===iv.BAR_AXIS));if(1!==e.length)return 0;const n=e[0],i=Math.max(...n.children.filter((t=>"text"===t.type)).map((t=>t.bounds.height))),r=Math.max(...n.children.filter((t=>"line"===t.type)).map((t=>t.bounds.height)));return-(a/2+i+r+a*Zx)},getBottomPadding:()=>-u.getTopPadding()};return{getBarWidthInPixels:()=>a,getValueLabelFontSize:function(t,e){const n=$b(Math.min(r,i),Vx.MIN,Vx.MAX);return t+Math.round(n*(e-t))},barValueLabel:c,barAxisTitle:u}}const Wb=({core:e})=>{const n=t.useStaleLayout(),i=t.useTheme(),o=t.useApp(),a=t.useModel(),s=t.useRect(),l=t.useOptions(),c=t.useTranslator(),{qLocaleInfo:u}=t.useAppLayout(),[h,d]=t.useState(null);return t.useEffect((()=>{if(!n||!e)return;const{picassoInstance:t,chart:h}=e;if(!h)return;const f=function(t){var e=t.source,n=t.metaAdditionsFn,i=t.experimental,o=void 0===i?{filter:!1}:i,a=M(!0,{},e),s=o.filter?function(t){var e=t.qHyperCube,n=pe(e,fe.DIMENSION),i=n.reduced,r=n.filtered;e[fe.DIMENSION]=i;var o=pe(e,fe.MEASURE),a=o.reduced,s=o.filtered;return e[fe.MEASURE]=a,{dimensions:r,measures:s}}(a):{dimensions:[],measures:[]},l=me(a),c=function(){var t=function(t){var e=t.layout,n=t.additionsFn,i=void 0===n?function(){return{}}:n,o=t.additionsProps,a=void 0===o?{}:o,s=e.qHyperCube,l=s.qDimensionInfo,c=s.qMeasureInfo,u=s.qMode,h=l.length,d=c.length,f=r({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:h,measureCount:d,hasMultipleDimensions:h>1,hasMultipleMeasures:d>1,isOneDimensional:1===h,isTwoDimensional:2===h},a);return r(r({},f),i({layout:e,meta:f}))}({layout:a,additionsFn:n,additionsProps:{size:l.size}});return t.filteredFields=s,t},u={refs:r({},l.refs),meta:c(),getLayout:function(){return a},getLayoutValue:function(t,e){return ce(a,t,e)},setLayoutValue:function(t,e){he(a,t,e),l=me(a),u.meta=c()},getHyperCube:function(){return a.qHyperCube},getHyperCubeValue:function(t,e){return ce(a.qHyperCube,t,e)},setHyperCubeValue:function(t,e){he(a.qHyperCube,t,e),l=me(a),u.meta=c()},getDataPages:function(){return ce(a,l.refs.dataPages)},setDataPages:function(t){he(a,l.refs.dataPages,t),u.meta=c()}};return u}({source:n,metaAdditionsFn:function({layout:t}){var e;const{measureAxis:n,qHyperCube:i,autoOrientation:r,gaugetype:o,useSegments:a,segmentInfo:l,refLine:c}=t,u=null===(e=t.qHyperCube)||void 0===e?void 0:e.qMeasureInfo[0].qFallbackTitle,{width:h,height:d}=s;let f=t.orientation;r&&(f=h>=d?"horizontal":"vertical");const p="vertical"===f,g=function({measureAxis:t,qHyperCube:e}){if(!t||!e)return{min:0,max:1};let{min:n,max:i}=t;if(n=Number(n),i=Number(i),n!==i)return{min:Math.min(n,i),max:Math.max(n,i)};const r=e.qDataPages[0].qMatrix[0][0].qNum;let o=Math.abs(r-n)/2;return 0===o&&(o=0!==n?Math.abs(n)/2:Number.MAX_VALUE/2),{min:n-o,max:i+o}}({measureAxis:n,qHyperCube:i}),m=(null==c?void 0:c.refLines)||[];return{measureAxisTitle:u,measureAxisSpacing:null==n?void 0:n.spacing,rangeLimits:g,qHyperCube:i,orientation:f,autoOrientation:r,gaugetype:o,isVertical:p,useSegments:a,segmentInfo:l,refLines:m}}}),p=Vb({layout:f.getLayout(),options:l}),g=le({chart:h,layoutService:f,config:{logicalSize:p},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),m=Kt({app:o,model:a,translator:c,picasso:t,layoutService:f,config:{key:"color",localeInfo:u,theme:i,auto:()=>({mode:"primary",byMeasureDef:{activeMeasureIndex:0,type:"expression",label:""}})}}),y=function(t){var e=t.theme,n=t.config,i=void 0===n?{}:n,r=i.id,o=i.resolve,a=void 0===o?[]:o,s=i.transform,l=void 0===s?[]:s,c=i.extend,u=void 0===c?[]:c,h={theme:e,matrix:De(a),styles:void 0};return h.styles=Ee({theme:e,id:r,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(t){h.theme=t,h.styles=Ee({theme:t,id:r,transform:l,extend:u,matrix:h.matrix})}}}({theme:i,config:{id:"gauge"}}),x=Hb({chart:h,layoutService:f,dockService:g}),v=function({layoutService:t,themeService:e,colorService:n}){const i=e.getStyles(),r=e=>{var n;const i=null===(n=t.getLayoutValue("components",[]))||void 0===n?void 0:n.find((t=>t.key===e));return i},o=t=>t?n.getPaletteColor(t):void 0;return{query:{axis:{title:{getStyle:()=>{var t,e,n,a;return{fontFamily:null!==(t=null===(e=r("axis"))||void 0===e||null===(e=e.axis)||void 0===e||null===(e=e.title)||void 0===e?void 0:e.fontFamily)&&void 0!==t?t:i.axis.title.fontFamily,fontSize:i.axis.title.fontSize,color:null!==(n=o(null===(a=r("axis"))||void 0===a||null===(a=a.axis)||void 0===a||null===(a=a.title)||void 0===a?void 0:a.color))&&void 0!==n?n:i.axis.title.color}}},label:{getStyle:()=>{var t,e,n,a;return{fontFamily:null!==(t=null===(e=r("axis"))||void 0===e||null===(e=e.axis)||void 0===e||null===(e=e.label)||void 0===e||null===(e=e.name)||void 0===e?void 0:e.fontFamily)&&void 0!==t?t:i.axis.label.name.fontFamily,fontSize:i.axis.label.name.fontSize,fill:null!==(n=o(null===(a=r("axis"))||void 0===a||null===(a=a.axis)||void 0===a||null===(a=a.label)||void 0===a||null===(a=a.name)||void 0===a?void 0:a.color))&&void 0!==n?n:i.axis.label.name.color}}}},label:{getStyle:()=>{var t,e,n,a;return{fontFamily:null!==(t=null===(e=r("value"))||void 0===e||null===(e=e.label)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.fontFamily)&&void 0!==t?t:i.label.value.fontFamily,fill:null!==(n=o(null===(a=r("value"))||void 0===a||null===(a=a.label)||void 0===a||null===(a=a.value)||void 0===a?void 0:a.color))&&void 0!==n?n:i.label.value.color}}}}}}({layoutService:f,themeService:y,colorService:m});d({layoutService:f,colorService:m,dockService:g,labelService:x,themeService:y,styleService:v})}),[a,o,n,i.name(),c.language(),e,s]),h};function Ub({width:t,height:e,fontSize:n}){const{FULL:i}=cv;if(t>=i.width&&e>=i.height){let t=Number.parseFloat(n);return t=Math.floor(t*Ux),`${t}px`}return n}function Yb({width:t,height:e,isVertical:n,styleService:i,themeService:r}){const o=r.getStyles(),a=i.query.axis.label.getStyle(),{fontFamily:s,fill:l,fontSize:c}=a;return[{type:"axis",key:iv.BAR_AXIS,dock:"center",scale:"m",layout:{minimumLayoutMode:rv},settings:{align:n?"left":"top",line:{show:!n},labels:{minLengthPx:20,fontFamily:s,fill:l,fontSize:Ub({width:t,height:e,fontSize:c})},paddingStart:()=>{if(n){const e=Math.min(t/10,Px);return t/2+e/2}const i=Math.min(e/10,Px);return e/2+i/2+Kx},ticks:{stroke:o.axis.line.major.color}}}]}function Xb({width:t,height:e,measureAxisTitle:n,isVertical:i,labelService:r,styleService:o}){const{getTopPadding:a,getBottomPadding:s,getLeftPadding:l,getRightPadding:c}=r.barAxisTitle,u=o.query.axis.title.getStyle(),{fontFamily:h,fontSize:d,color:f}=u;return[{type:"labels",key:iv.AXIS_TITLE,layout:{minimumLayoutMode:ov},settings:{sources:[{component:iv.BACKGROUND_BAR,selector:"rect",strategy:{type:"bar",settings:{direction:i?"up":"right",align:.5,justify:.5,labels:[{fontFamily:h,fill:f,fontSize:Number.parseFloat(Ub({width:t,height:e,fontSize:d})),label:()=>n,placements:[{position:"inside",padding:{top:a,bottom:s,left:l,right:c},overflow:!0}]}]}}}]}}]}var Gb=t=>()=>t;function Kb(t){return 1==(t=+t)?Zb:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Gb(isNaN(e)?n:e)}}function Zb(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Gb(isNaN(t)?e:t)}var Jb=function t(e){var n=Kb(e);function i(t,e){var i=n((t=Tv(t)).r,(e=Tv(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=Zb(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function Qb({thisColor:t,paletteColors:e,paletteIndex:n,limit:i,isLeft:r=!1,themeService:o}){const a=r?0:1,s=0===Object.entries(i).length,l=i.gradient;let c=n+(r?-1:1);s&&(c=r?0:e.length-1);const u=o.getTheme().getColorPickerColor(c<e.length&&c>=0?e[c]:e[0]);return{color:l?Jb(t,u)(.5):t,offset:a,gradient:l}}function tw({limits:t,paletteColors:e,paletteIndex:n,themeService:i}){const r=ce(t,""+(n-1),{}),o=ce(t,`${n}`,{}),a=[r,o].map((t=>t.gradient)).includes(!0),s=i.getTheme().getColorPickerColor(e[n]);if(!a)return[{offset:0,color:s},{offset:1,color:s}];const l=[Qb({thisColor:s,paletteColors:e,paletteIndex:n,limit:r,isLeft:!0,themeService:i}),Qb({thisColor:s,paletteColors:e,paletteIndex:n,limit:o,isLeft:!1,themeService:i})],c=2===l.filter((t=>t.gradient)).length;c&&l.splice(1,0,{offset:.5,color:s,gradient:!0});const u=l.map((({offset:t,color:e,gradient:n})=>({offset:t,color:e,gradient:n})));return u}function ew({themeService:t,segmentInfo:e,rangeLimits:n}){const{limits:i,paletteColors:r}=e,{min:o,max:a}=n;i.sort(((t,e)=>t.value-e.value));const s=[o,...i.map((t=>t.value)),a],l=[];for(let e=0;e<r.length;e++){const n=tw({limits:i,paletteColors:r,paletteIndex:e,themeService:t}).map((t=>({offset:$b(s[e]+t.offset*(s[e+1]-s[e]),o,a),color:t.color,gradient:"gradient"in t?t.gradient:void 0})));l.push(...n)}return l}function nw(t,e,n){const i=ew({themeService:e,segmentInfo:n,rangeLimits:t}),r=(Lx-qx)/(2*Math.PI),o=i.map((t=>({offset:t.offset*r,color:t.color})));return{type:"gradient",orientation:"conic",startAngle:qx-Math.PI/2,x:0,y:0,stops:o}}function iw({orientation:t,colorService:e,rangeLimits:n,isVertical:i,useSegments:r,themeService:o,segmentInfo:a}){let{min:s,max:l}=n;const c={type:"box",key:iv.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:{field:"qMeasureInfo/0"}}}},settings:{minor:{scale:"m"},orientation:t,box:{width:.1,maxWidthPx:Px,fill:e.getColor()}}},u={type:"box",key:iv.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:l}}},settings:{minor:{scale:"m"},orientation:t,box:{width:.1,maxWidthPx:Px,fill:()=>function({themeService:t,isVertical:e,segmentInfo:n,rangeLimits:i}){return{type:"gradient",x1:0,x2:e?0:1,y1:e?1:0,y2:0,stops:ew({themeService:t,segmentInfo:n,rangeLimits:i})}}({themeService:o,isVertical:i,segmentInfo:a,rangeLimits:n})}}},h={type:"box",key:iv.BACKGROUND_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:l}}},settings:{minor:{scale:"m"},orientation:t,box:{width:.1,maxWidthPx:Px,fill:jx}}};return[{type:"box",key:iv.LABEL_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:s}}},settings:{minor:{scale:"m"},orientation:t,box:{width:i?Xx:Gx,opacity:0}}},h,r?u:c]}function rw({isVertical:t,chart:e,labelService:n,styleService:i}){if(!e.formatter)return[];const{getValueLabelFontSize:r,barValueLabel:o}=n,{getTopPadding:a,getBottomPadding:s,getLeftPadding:l,getRightPadding:c}=o,u=r(Bx.MIN,Bx.MAX),h=i.query.label.getStyle();return[{type:"labels",key:iv.GAUGE_LABEL,layout:{minimumLayoutMode:t?av:sv},settings:{sources:[{component:iv.LABEL_BAR,selector:"rect",formatter:"measure",strategy:{type:"bar",settings:{direction:t?"up":"right",orientation:"horizontal",fontFamily:h.fontFamily,fill:h.fill,fontSize:u,align:t?0:.5,justify:0,labels:[{label:({data:t})=>t?e.formatter(nv.MEASURE)(t.value):"",placements:[{position:"outside",padding:{top:a,bottom:s,left:l,right:c},overflow:!0}]}]}}}]}}]}function ow({labelService:t,rangeLimits:e,qHyperCube:n,isVertical:i}){const{min:r,max:o}=e,a=n.qDataPages[0].qMatrix[0][0].qNum;if(a<=o&&a>=r)return!1;let s=i?"bottom":"left";return a>o&&(s=i?"top":"right"),{type:"oob-indicator",key:iv.OOB_INDICATOR,layout:{displayOrder:2},settings:{component:"bar",selector:"rect",pointingTo:s,size:t.getBarWidthInPixels()}}}function aw({width:t,height:e,styleService:n,themeService:i}){const r=gb(t,e,qx,Lx),{innerRadius:o,outerRadius:a,radiusIncrease:s}=r,l=4*s,c=Math.min(t,e)/2,u=i.getStyles(),h=n.query.axis.label.getStyle(),{tickLength:d,labelPadding:f}=function({width:t,height:e,defaultTickSize:n,defaultLabelPadding:i}){const r=Math.min(Math.min(t,e)/uv,1);return{tickLength:n*r,labelPadding:i*r}}({width:t,height:e,defaultTickSize:8,defaultLabelPadding:20}),p=bb(t,e);return[{type:"axis",dock:"center",layout:{minimumLayoutMode:lv},scale:"m",settings:{arc:{radius:a,startAngle:qx,endAngle:Lx,offset:-10*l*(a-o)*c},align:"top",line:{show:!1,stroke:"#cdcdcd"},ticks:{tickSize:d,stroke:u.axis.line.major.color,margin:p},labels:{margin:-6-2*d+f,fontFamily:h.fontFamily,fill:h.fill,fontSize:h.fontSize}}}]}function sw({qHyperCube:t,rangeLimits:e,width:n,height:i,colorService:r,themeService:o,segmentInfo:a,useSegments:s}){const{outerRadius:l,innerRadius:c}=gb(n,i,qx,Lx),u=e.max,h=t.qDataPages[0].qMatrix[0][0].qNum,d=u-h,f=[{value:h-e.min,valueLabel:"Measure"},{value:d,valueLabel:"Remaining"}],p=function({themeService:t,segmentInfo:e,rangeLimits:n}){const i=ew({themeService:t,segmentInfo:e,rangeLimits:n});let r=0,o=0,a=i.map((t=>(o=0===n.max?t.offset*(n.max-n.min)-r:t.offset*n.max-r,r+=o,{value:o,color:t.color,gradient:t.gradient}))).filter((t=>0!==t.value));return a.forEach((t=>{t.value=Math.abs(t.value)})),a}({themeService:o,segmentInfo:a,rangeLimits:e}),g={type:"pie",key:iv.RADIAL_GAUGE,data:{items:f},settings:{startAngle:qx,endAngle:Lx,slice:{arc:{ref:"value"},outerRadius:()=>l,innerRadius:()=>c,fill:(t,e)=>{const n=r.getColor();return 0===e?n(t):jx},strokeWidth:0}}},m={type:"pie",key:iv.RADIAL_GAUGE,renderer:"canvas",displayOrder:1,data:{items:p},settings:{startAngle:qx,endAngle:Lx,slice:{arc:{ref:"value"},outerRadius:()=>l,innerRadius:()=>c,strokeWidth:0,fill:(t,n)=>{var i;return t.datum.value.gradient||null!==(i=p[n-1])&&void 0!==i&&i.gradient?nw(e,o,a):t.datum.value.color}}}},y={type:"pie",key:"circle-gauge",renderer:"canvas",displayOrder:0,data:{items:[{value:h,valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>l,innerRadius:()=>c,fill:()=>function(t,e,n){let i=nw(t,e,n);const r={offset:(Lx-qx)/(2*Math.PI),color:"rgba(0, 0, 0, 0)"};return i.stops.push(r),i.stops.push({offset:1,color:"rgba(0, 0, 0, 0)"}),i}(e,o,a),opacity:s?1:0}}};return[y,s?m:g]}function lw({qHyperCube:t,chart:e,styleService:n,labelService:i}){const r=t.qMeasureInfo[0].qFallbackTitle,o=n.query.label.getStyle(),a=n.query.axis.title.getStyle(),{getValueLabelFontSize:s}=i,l=s(Bx.MIN,Bx.MAX),c={type:"labels",key:iv.RADIAL_GAUGE_LABEL,layout:{displayOrder:4},settings:{sources:[{component:"circle-gauge",selector:"path",strategy:{type:"rows",settings:{fill:"#000",padding:0,labels:[{fontSize:l,fontFamily:o.fontFamily,fill:o.fill,label({data:t}){const n=e.formatter(nv.MEASURE);return t&&n?n(t.value.value):""}},{fontSize:Number.parseFloat(a.fontSize),fontFamily:a.fontFamily,fill:a.color,label:()=>r}]}}}]}};return[c]}function cw({width:t,height:e,rangeLimits:n,qHyperCube:i}){const{min:r,max:o}=n,a=i.qDataPages[0].qMatrix[0][0].qNum;if(a>o||a<r)return!1;const s=gb(t,e,qx,Lx).outerRadius,l=qx+(a-r)/(o-r)*(Lx-qx);return{type:"radial-gauge-needle",key:iv.RADIAL_GAUGE_NEEDLE,layout:{displayOrder:2},settings:{component:"radial-gauge",selector:"path",radius:s,valueAngle:l}}}function uw({rangeLimits:t,qHyperCube:e,width:n,height:i,colorService:r,useSegments:o}){const{min:a,max:s}=t,l=e.qDataPages[0].qMatrix[0][0].qNum,{outerRadius:c,innerRadius:u}=gb(n,i,qx,Lx),h=(u+(c-u)/2)*Math.min(n,i)/2;if(l<=s&&l>=a)return!1;let d=qx;return l>s&&(d=Lx),{type:"radial-oob-indicator",key:iv.RADIAL_OOB_INDICATOR,layout:{displayOrder:2},settings:{component:"radial-gauge",selector:"path",angle:d,radius:h,size:xb({innerRadius:u,outerRadius:c,width:n,height:i}),fill:yb(r,o)}}}function hw({refLines:t,colorService:e,themeService:n,width:i,height:r}){const o=n.getStyles(),a=gb(i,r,qx,Lx),s={type:"radial-custom-ref-line",key:"radial-reference-lines",displayOrder:1,settings:{barWidth:xb({innerRadius:a.innerRadius,outerRadius:a.outerRadius,width:i,height:r})},lines:{radial:t.filter(vb).map((t=>{var n,i;return{scale:"m",value:t.refLineExpr.value,label:{text:t.label,...o.referenceLine.label.name,showValue:t.showValue,showLabel:t.showLabel},radius:a.innerRadius,line:{stroke:e.getPaletteColor(t.paletteColor||{index:t.color}),strokeWidth:(null===(n=t.style)||void 0===n?void 0:n.lineThickness)||2,strokeDasharray:null===(i=t.style)||void 0===i?void 0:i.lineType}}}))}};return s}function dw({width:t,height:e,rangeLimits:n,qHyperCube:i,colorService:r,useSegments:o,segmentInfo:a}){const{min:s,max:l}=n,c=i.qDataPages[0].qMatrix[0][0].qNum,u=gb(t,e,qx,Lx).outerRadius;let h;h=c<s?qx:c>l?Lx:qx+(c-s)/(l-s)*(Lx-qx);const d=r.getColor()({datum:{value:()=>0}}),f=a.paletteColors[0].color||d;return{type:"radial-spark",key:iv.RADIAL_SPARK,layout:{displayOrder:2},settings:{fill:o?f:d,radius:u,valueAngle:h}}}function fw({refLines:t,isVertical:e,labelService:n,colorService:i,themeService:r}){const o=r.getStyles(),a={type:"custom-ref-line",key:iv.REFERENCE_LINES_AND_LABELS,settings:{barWidth:n.getBarWidthInPixels()},lines:{[e?"y":"x"]:t.filter(vb).map((t=>{var e,n;return{scale:"m",value:t.refLineExpr.value,label:{text:t.label,...o.referenceLine.label.name,showValue:t.showValue,showLabel:t.showLabel},line:{stroke:i.getPaletteColor(t.paletteColor||{index:t.color}),strokeWidth:(null===(e=t.style)||void 0===e?void 0:e.lineThickness)||2,strokeDasharray:null===(n=t.style)||void 0===n?void 0:n.lineType}}}))}};return a}const pw=Math.log(10),gw={log:(t,e)=>t<=0||e<=0?NaN:Math.log(t)/Math.log(e),log10:t=>t<=0?NaN:Math.log(t)/pw,getNiceNumber(t){let e;if(0===t)return 0;const n=Math.floor(Math.log(Math.abs(t))/pw),i=t/10**n;return e=i<=1?1:i<=2?2:i<=5?5:10,e*10**n*(t<0?-1:1)},getSmallNiceNumber(t){let e;if(0===t)return 0;let n=Math.floor(Math.log(Math.abs(t))/pw);const i=t/10**n;return i<1?(e=5,n--):e=i<2?1:i<5?2:5,e*10**n*(t<0?-1:1)},getGoodNumber(t){let e;if(0===t)return 0;const n=Math.floor(Math.log(Math.abs(t))/pw),i=t/10**n;return e=Math.ceil(i),7!==e&&9!==e||e++,i>1&&i<=1.5?e=1.5:i>2&&i<=2.5&&(e=2.5),e*10**n*(t<0?-1:1)},calculateTicks(t,e,n,i,r,o){return this.plotSize=t,this.explicitPlotMin=e,this.explicitPlotMax=n,this.minTickSpacingInPixel=i,this.absMax=Math.abs(this.explicitPlotMax),this.absMin=Math.abs(this.explicitPlotMin),this.usedDataRange=this.explicitPlotMax-this.explicitPlotMin,this.maxNumIntervals=this.plotSize/this.minTickSpacingInPixel,this.maxNumTicks=this.maxNumIntervals+1,this.minTickDataSpacing=o||0,this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),this.fontHeight=r,this.tickBaseValue=0,this.spaceUseLimit=.6,0===t?(this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickDataSpacingNN=this.tickDataSpacing,_w.call(this),Nw.call(this)):(this.maxNumIntervals<1?vw.call(this):(this.explicitPlotMax>0&&this.explicitPlotMin<0?1===this.maxNumIntervals?xw.call(this,!0):this.maxNumIntervals>=5?yw.call(this):this.maxNumIntervals<2?bw.call(this):ww.call(this):yw.call(this),this.tickMaxIndex<this.tickMinIndex?(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),vw.call(this)):Mw.call(this)),_w.call(this),Nw.call(this))}};function mw(t,e,n){void 0===t&&(t=null!==this.explicitPlotMin),void 0===e&&(e=null!==this.explicitPlotMax),this.tickDataSpacingNN=n?gw.getGoodNumber(this.tickDataSpacing):gw.getNiceNumber(this.tickDataSpacing),Sw.apply(this,[t,e])}function yw(){mw.call(this);const t=this.tickMaxIndex-this.tickMinIndex;let e=this.plotMax-this.plotMin;this.spaceUseFactor=e/this.plotRange;let n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(n&&this.maxNumIntervals>=5){for(;this.tickDataSpacing<=this.absMax&&n;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),mw.call(this),e=this.plotMax-this.plotMin,this.spaceUseFactor=e/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(!n)return}for(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),(n||t<=2&&this.maxNumIntervals>=2*t)&&mw.apply(this,[void 0,void 0,!0]),e=this.plotMax-this.plotMin,this.spaceUseFactor=e/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;this.tickDataSpacing<=this.absMax&&n;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),mw.apply(this,[void 0,void 0,!0]),e=this.plotMax-this.plotMin,this.spaceUseFactor=e/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel}function xw(t){t?(this.tickDataSpacingNN=gw.getGoodNumber(this.absMax),this.tickBaseValue=-this.tickDataSpacingNN,this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickMinIndex=1,this.tickMaxIndex=1,this.tickDataSpacingNN*=2):(this.plotMax=this.explicitPlotMax,this.plotMin=this.explicitPlotMin,this.plotRange=this.plotMax-this.plotMin,this.tickMinIndex=0,this.tickMaxIndex=0,this.tickDataSpacingNN=gw.getNiceNumber(this.absMax),this.tickDataSpacingNN===this.absMax&&(this.tickDataSpacingNN=gw.getNiceNumber(1.1*this.absMax)))}function vw(){let t;this.tickDataSpacingNN=gw.getNiceNumber(this.tickDataSpacing),this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.plotRange=this.plotMax-this.plotMin,this.tickMinIndex=0,this.tickMaxIndex=0,(this.explicitPlotMax<0||this.explicitPlotMin>0)&&(t=gw.getSmallNiceNumber(this.plotRange),this.tickBaseValue=Math.ceil(this.plotMin/t)*t)}function bw(){const t=this.explicitPlotMax>=-this.explicitPlotMin,e=t||null!==this.explicitPlotMin,n=!t||null!==this.explicitPlotMax;mw.apply(this,[e,n,!0]);const i=(this.absMax+(1-this.spaceUseLimit)*this.absMin)/this.spaceUseLimit*1.0001;for(;this.tickDataSpacing<=i&&this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),mw.apply(this,[e,n,!0]);const r=this.plotMax-this.plotMin;this.spaceUseFactor=r/this.plotRange}function ww(){yw.call(this);const t=this.plotMax-this.plotMin;this.spaceUseFactor=t/this.plotRange}function Mw(){const t=gw.getNiceNumber(this.tickDataSpacingNN);if(this.tickDataSpacingNN===t||0!==this.tickBaseValue)return;const e=this.tickDataSpacingNN,n=this.tickMinIndex,i=this.tickMaxIndex,r=i-n,o=this.plotMin,a=this.plotMax;this.tickDataSpacingNN=t,Sw.apply(this,[null!==this.explicitPlotMin,null!==this.explicitPlotMax]);const s=this.plotMax-this.plotMin;this.spaceUseFactor=s/this.plotRange;const l=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel,c=this.tickMaxIndex-this.tickMinIndex;!l&&(c===r||c>=10||c>=3&&1.5*c>=r)||(this.tickDataSpacingNN=e,this.tickMinIndex=n,this.tickMaxIndex=i,this.plotMin=o,this.plotMax=a,this.plotRange=this.plotMax-this.plotMin)}function kw(){this.plotMax===this.plotMin||0===this.plotSize?(this.minTickValue=this.plotMin,this.maxTickValue=this.plotMax):(this.minTickValue=this.tickBaseValue+this.tickMinIndex*this.tickDataSpacingNN,this.maxTickValue=this.tickBaseValue+this.tickMaxIndex*this.tickDataSpacingNN)}function _w(){let t,e;if(this.mainTickValues=[],this.secondaryTickValues=[],kw.call(this),0===this.plotSize)return;t=this.tickBaseValue;const n=this.tickMaxIndex-this.tickMinIndex;if(!(n<1)){for(e=0;e<=n;e++)this.mainTickValues.push(t+(e+this.tickMinIndex)*this.tickDataSpacingNN);for(t=this.tickBaseValue+this.tickDataSpacingNN/2,e=0;e<n;e++)this.secondaryTickValues.push(t+(e+this.tickMinIndex)*this.tickDataSpacingNN)}}function Sw(t,e){this.tickMinIndex=t?Math.ceil(this.explicitPlotMin/this.tickDataSpacingNN):Math.floor(this.explicitPlotMin/this.tickDataSpacingNN),this.tickMaxIndex=e?Math.floor(this.explicitPlotMax/this.tickDataSpacingNN):Math.ceil(this.explicitPlotMax/this.tickDataSpacingNN),this.plotMin=t?this.explicitPlotMin:this.tickMinIndex*this.tickDataSpacingNN,this.plotMax=e?this.explicitPlotMax:this.tickMaxIndex*this.tickDataSpacingNN,this.plotRange=this.plotMax-this.plotMin}function Nw(){return{plotMin:this.plotMin,plotMax:this.plotMax,tickSpacing:this.tickDataSpacingNN,tickBaseValue:this.tickBaseValue,tickMinIndex:this.tickMinIndex,tickMaxIndex:this.tickMaxIndex,minTickValue:this.minTickValue,maxTickValue:this.maxTickValue,mainTickValues:this.mainTickValues,secondaryTickValues:this.secondaryTickValues}}function Rw({core:t,dockService:e,rangeLimits:n,measureAxisSpacing:i,isRadial:r,isVertical:o,styleService:a}){const s=n.min,l=n.max,{width:c,height:u}=function(t){return{width:t.meta.chart.size.width,height:t.meta.chart.size.height}}(e);let h,d=96*i;if(r)h=Math.min(u,c);else{h=o?u:c;const{chart:e,picassoInstance:n}=t;if(e&&n){const t=e.formatter(nv.MEASURE),r=n.renderer("svg")(),f=a.query.axis.label.getStyle(),{fontFamily:p,fontSize:g}=f,m=t=>r.measureText({text:t,fontSize:Ub({width:c,height:u,fontSize:g}),fontFamily:p}),y=Math.max(96,...[s,l,(l-s)/2].map((e=>m(t(e)).width)));d=o?4*m("M").height:y;d=h/(Math.max(2,h/d/i+1)-1)}}const f=function({plotSize:t,rangeMax:e,rangeMin:n,minTickSpacingInPixel:i}){const r=gw.calculateTicks(t,n,e,i,20,0);r.tickSpacing;let o=r.mainTickValues;0===o.length&&o.push(r.minTickValue);const a=o[0];o[0]=r.plotMin,a-r.plotMin>=r.tickSpacing/2&&o.splice(1,0,a);const s=r.mainTickValues[r.mainTickValues.length-1];return r.plotMax-s<=r.tickSpacing/2?o[r.mainTickValues.length-1]=Math.round(r.plotMax):o.push(Math.round(r.plotMax)),o}({plotSize:h,rangeMin:s,rangeMax:l,minTickSpacingInPixel:d});return{values:f}}function Aw({core:t,services:e,logicalSize:n}){const{layoutService:i,dockService:r,colorService:o,labelService:a,themeService:s,styleService:l}=e;if(!i.meta.qHyperCube)throw new Error("Layout is missing a hypercube");const{width:c,height:u}=r.meta.chart.size,{autoOrientation:h,gaugetype:d,rangeLimits:f,measureAxisTitle:p,qHyperCube:g,useSegments:m,segmentInfo:y,refLines:x,measureAxisSpacing:v}=i.meta;let b,w;w="radial"===d,b=h?c>=u?"horizontal":"vertical":i.meta.orientation;const M="vertical"===b,k=function({width:t,height:e,isVertical:n,orientation:i,measureAxisTitle:r,qHyperCube:o,rangeLimits:a,gaugetype:s,colorService:l,core:c,labelService:u,useSegments:h,themeService:d,segmentInfo:f,refLines:p,styleService:g}){const{chart:m}=c;if(!m)return[];let y=[];return y="bar"===s?[...Yb({width:t,height:e,isVertical:n,styleService:g,themeService:d}),...iw({orientation:i,colorService:l,rangeLimits:a,isVertical:n,useSegments:h,themeService:d,segmentInfo:f}),...Xb({width:t,height:e,labelService:u,measureAxisTitle:r,isVertical:n,styleService:g}),...rw({isVertical:n,chart:m,labelService:u,styleService:g}),ow({labelService:u,rangeLimits:a,qHyperCube:o,isVertical:n}),fw({refLines:p,isVertical:n,labelService:u,colorService:l,themeService:d})]:t>=cv.SPARK.width&&e>=cv.SPARK.height?[...sw({qHyperCube:o,rangeLimits:a,width:t,height:e,colorService:l,themeService:d,segmentInfo:f,useSegments:h}),...lw({qHyperCube:o,chart:m,styleService:g,labelService:u}),...aw({width:t,height:e,styleService:g,themeService:d}),...h?[cw({width:t,height:e,rangeLimits:a,qHyperCube:o})]:[],uw({rangeLimits:a,qHyperCube:o,width:t,height:e,colorService:l,useSegments:h}),hw({refLines:p,isVertical:n,labelService:u,colorService:l,themeService:d,width:t,height:e})]:[dw({width:t,height:e,rangeLimits:a,qHyperCube:o,colorService:l,useSegments:h,segmentInfo:f})],y}({width:c,height:u,isVertical:M,orientation:b,measureAxisTitle:p,qHyperCube:g,rangeLimits:f,gaugetype:d,colorService:o,core:t,labelService:a,themeService:s,useSegments:m,segmentInfo:y,refLines:x,styleService:l}),_=function({core:t,colorService:e,isVertical:n,isRadial:i,dockService:r,rangeLimits:o,measureAxisSpacing:a,styleService:s}){const l=Rw({core:t,dockService:r,rangeLimits:o,measureAxisSpacing:a,isRadial:i,isVertical:n,styleService:s});return{m:{data:{field:"qMeasureInfo/0"},type:"linear",invert:!!i||n,min:o.min,max:o.max,ticks:{values:l.values}},...e.getScales()}}({core:t,measureAxisSpacing:v,isVertical:M,colorService:o,isRadial:w,dockService:r,rangeLimits:f,styleService:l});return{scales:_,components:k,formatters:{[nv.MEASURE]:{data:{field:"qMeasureInfo/0"}}},strategy:{layoutModes:cv,logicalSize:n}}}return function(e){return{qae:{properties:{qHyperCubeDef:{qMeasures:[],qInitialDataFetch:[{qWidth:2,qHeight:5e3}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",measureAxis:{min:0,max:10},orientation:"vertical",segmentInfo:{limits:[],colors:[{color:3}]}},data:{targets:[{path:"/qHyperCubeDef",dimensions:{min:0,max:0},measures:{min:1,max:1}}]}},ext:Te(e),component(){const e=(()=>{const e=t.useElement(),n=t.useOptions(),[i,r]=t.useState({});return t.useEffect((()=>{e.style.overflow="hidden";const t=Tx();t.use(ki),t.component("oob-indicator",pb),t.component("radial-gauge-needle",wb),t.component("radial-custom-ref-line",Lb),t.component("custom-ref-line",Bb),t.component("radial-oob-indicator",Mb),t.component("radial-spark",jb);const i=t({renderer:{prio:[n.renderer||"svg"]}}),o=i.chart({element:e,data:[],settings:{}});return r({picassoInstance:i,chart:o}),()=>{o.destroy()}}),[]),i})(),n=Wb({core:e}),i=(({core:e,services:n})=>{const[i,r]=t.useState({}),o=t.useOptions(),a=t.useRect(),s=t.useTheme(),l=t.useStaleLayout(),{qLocaleInfo:c}=t.useAppLayout();return t.usePromise((async()=>{if(!n)return Promise.resolve();const{colorService:t}=n;return t.initialize({createConfig:()=>({theme:s,layout:l,localeInfo:c,hc:l.qHyperCube,colorProps:{...l.color,auto:!0,useBaseColors:"off",paletteColor:l.paletteProgressColor}})}).then((()=>{const{layoutService:t}=n,i=Vb({layout:t.getLayout(),options:o}),a=Aw({core:e,services:n,logicalSize:i});r(a)}))}),[n]),t.useEffect((()=>{if(n&&n.dockService&&n.layoutService){const{dockService:t,layoutService:i}=n,s=Vb({layout:i.getLayout(),options:o});t.update(s||a);const l=Aw({core:e,services:n,logicalSize:s});r(l)}}),[a]),i})({core:e,services:n});(({core:e,services:n,settings:i})=>{t.useEffect((()=>{if(!i||!e||!n)return;const{chart:t}=e;t&&t.update({data:[{type:"q",key:"qHyperCube",data:n.layoutService.getHyperCube()},...n.colorService.getData()],settings:i})}),[e,i])})({core:e,settings:i,services:n}),(({services:e})=>{t.onTakeSnapshot((t=>{if(e){const{dockService:n}=e,{width:i,height:r}=n.meta.chart.size;t.snapshotData=t.snapshotData||{content:{size:{w:i,h:r}}},t.snapshotData.content={size:{w:i,h:r}}}return Promise.resolve(t)}))})({services:n})}}}}));